feat: add session subagent cli control
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { createHash, randomUUID } from "node:crypto";
|
||||
import type { BackendProfile, CreateCommandInput, CreateQueueTaskInput, CreateRunInput, ExecutionPolicy, JsonRecord, JsonValue, QueueTaskState, ResourceBundleRef, SecretRef, SessionRef } from "./types.js";
|
||||
import type { BackendProfile, CreateCommandInput, CreateQueueTaskInput, CreateRunInput, ExecutionPolicy, JsonRecord, JsonValue, QueueTaskState, ResourceBundleRef, SecretRef, SessionListState, SessionRef } from "./types.js";
|
||||
import { AgentRunError } from "./errors.js";
|
||||
import { backendProfileSpec, backendProfiles, isBackendProfile } from "./backend-profiles.js";
|
||||
|
||||
@@ -328,3 +328,13 @@ export function validateQueueTaskState(value: string): QueueTaskState {
|
||||
if (value === "pending" || value === "running" || value === "completed" || value === "failed" || value === "blocked" || value === "cancelled") return value;
|
||||
throw new AgentRunError("schema-invalid", `queue task state ${value} is not supported`, { httpStatus: 400 });
|
||||
}
|
||||
|
||||
export function validateSessionListState(value: string): SessionListState {
|
||||
if (value === "default" || value === "running" || value === "unread" || value === "terminal" || value === "idle" || value === "all") return value;
|
||||
throw new AgentRunError("schema-invalid", `session state ${value} is not supported`, { httpStatus: 400 });
|
||||
}
|
||||
|
||||
export function validateBackendProfile(value: string): BackendProfile {
|
||||
if (isBackendProfile(value)) return value;
|
||||
throw new AgentRunError("schema-invalid", `backendProfile ${value} is not supported in v0.1`, { httpStatus: 400, details: { allowedBackends: [...backendProfiles] } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user