@otto-code/protocol 0.5.1 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-attention-notification.js +60 -12
- package/dist/agent-personalities.d.ts +36 -0
- package/dist/agent-personalities.js +104 -0
- package/dist/agent-teams.d.ts +49 -0
- package/dist/agent-teams.js +99 -0
- package/dist/agent-types.d.ts +41 -0
- package/dist/artifacts/rpc-schemas.d.ts +8 -8
- package/dist/artifacts/types.d.ts +7 -7
- package/dist/browser-automation/rpc-schemas.d.ts +3 -3
- package/dist/default-personalities.d.ts +2 -1
- package/dist/default-personalities.js +35 -11
- package/dist/generated/validation/ws-outbound.aot.js +13487 -10996
- package/dist/judge-verdict.d.ts +30 -0
- package/dist/judge-verdict.js +61 -0
- package/dist/loop/rpc-schemas.d.ts +19 -19
- package/dist/messages.d.ts +1886 -350
- package/dist/messages.js +298 -3
- package/dist/model-tiers.d.ts +34 -0
- package/dist/model-tiers.js +92 -0
- package/dist/orchestration.d.ts +152 -0
- package/dist/orchestration.js +199 -0
- package/dist/provider-manifest.d.ts +10 -0
- package/dist/provider-manifest.js +28 -0
- package/dist/schedule/rpc-schemas.d.ts +27 -26
- package/dist/schedule/rpc-schemas.js +3 -0
- package/dist/schedule/types.d.ts +9 -9
- package/dist/validation/ws-outbound-schema-metadata.d.ts +382 -93
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RUN_PHASE_TYPES: readonly ["research", "plan", "refactor", "implement", "design", "verify", "gate", "deliver"];
|
|
3
|
+
export type RunPhaseType = (typeof RUN_PHASE_TYPES)[number];
|
|
4
|
+
export declare function isRunPhaseType(value: string): value is RunPhaseType;
|
|
5
|
+
/** The role a phase type dispatches to by default (null for human `gate`). */
|
|
6
|
+
export declare function defaultRoleForPhaseType(type: RunPhaseType): string | null;
|
|
7
|
+
export declare const RUN_PHASE_STATUSES: readonly ["pending", "running", "blocked", "done", "failed", "skipped"];
|
|
8
|
+
export type RunPhaseStatus = (typeof RUN_PHASE_STATUSES)[number];
|
|
9
|
+
export declare const RUN_STATUSES: readonly ["pending", "running", "paused", "done", "failed", "canceled"];
|
|
10
|
+
export type RunStatus = (typeof RUN_STATUSES)[number];
|
|
11
|
+
export declare function isRunPhaseStatus(value: string): value is RunPhaseStatus;
|
|
12
|
+
export declare function isRunStatus(value: string): value is RunStatus;
|
|
13
|
+
/** Terminal run statuses — no further phases will run. */
|
|
14
|
+
export declare function isTerminalRunStatus(value: string): boolean;
|
|
15
|
+
/** Terminal phase statuses — the phase will not change again on its own. */
|
|
16
|
+
export declare function isTerminalPhaseStatus(value: string): boolean;
|
|
17
|
+
export declare const RunPhaseJudgeSpecSchema: z.ZodObject<{
|
|
18
|
+
role: z.ZodOptional<z.ZodString>;
|
|
19
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
}, z.core.$loose>;
|
|
21
|
+
export declare const RunPhaseDeclarationSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
type: z.ZodString;
|
|
24
|
+
title: z.ZodString;
|
|
25
|
+
task: z.ZodString;
|
|
26
|
+
role: z.ZodOptional<z.ZodString>;
|
|
27
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
fanOut: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
keepBest: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
judge: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
role: z.ZodOptional<z.ZodString>;
|
|
32
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
}, z.core.$loose>>;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
export type RunPhaseDeclaration = z.infer<typeof RunPhaseDeclarationSchema>;
|
|
36
|
+
export declare const RunPlanSchema: z.ZodObject<{
|
|
37
|
+
title: z.ZodString;
|
|
38
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
|
+
autopilot: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
phases: z.ZodArray<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
type: z.ZodString;
|
|
43
|
+
title: z.ZodString;
|
|
44
|
+
task: z.ZodString;
|
|
45
|
+
role: z.ZodOptional<z.ZodString>;
|
|
46
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
fanOut: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
keepBest: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
judge: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
role: z.ZodOptional<z.ZodString>;
|
|
51
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$loose>>;
|
|
53
|
+
}, z.core.$loose>>;
|
|
54
|
+
}, z.core.$loose>;
|
|
55
|
+
export type RunPlan = z.infer<typeof RunPlanSchema>;
|
|
56
|
+
export declare const RunPhaseCandidateSchema: z.ZodObject<{
|
|
57
|
+
agentId: z.ZodString;
|
|
58
|
+
personalityId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
verdict: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
verdict: z.ZodString;
|
|
61
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
met: z.ZodBoolean;
|
|
65
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$loose>>>;
|
|
67
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$loose>>;
|
|
69
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$loose>;
|
|
71
|
+
export type RunPhaseCandidate = z.infer<typeof RunPhaseCandidateSchema>;
|
|
72
|
+
export declare const RunPhaseSchema: z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
type: z.ZodString;
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
task: z.ZodString;
|
|
77
|
+
status: z.ZodString;
|
|
78
|
+
assigneeRole: z.ZodOptional<z.ZodString>;
|
|
79
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
fanOut: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
keepBest: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
candidates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
83
|
+
agentId: z.ZodString;
|
|
84
|
+
personalityId: z.ZodOptional<z.ZodString>;
|
|
85
|
+
verdict: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
verdict: z.ZodString;
|
|
87
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
met: z.ZodBoolean;
|
|
91
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$loose>>>;
|
|
93
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$loose>>;
|
|
95
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$loose>>>;
|
|
97
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
98
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
99
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$loose>;
|
|
101
|
+
export type RunPhase = z.infer<typeof RunPhaseSchema>;
|
|
102
|
+
export declare const RunSchema: z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
title: z.ZodString;
|
|
105
|
+
status: z.ZodString;
|
|
106
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
autopilot: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
phases: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
type: z.ZodString;
|
|
111
|
+
title: z.ZodString;
|
|
112
|
+
task: z.ZodString;
|
|
113
|
+
status: z.ZodString;
|
|
114
|
+
assigneeRole: z.ZodOptional<z.ZodString>;
|
|
115
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
|
+
fanOut: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
keepBest: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
candidates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
119
|
+
agentId: z.ZodString;
|
|
120
|
+
personalityId: z.ZodOptional<z.ZodString>;
|
|
121
|
+
verdict: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
verdict: z.ZodString;
|
|
123
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
met: z.ZodBoolean;
|
|
127
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$loose>>>;
|
|
129
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$loose>>;
|
|
131
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$loose>>>;
|
|
133
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
134
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
135
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$loose>>>;
|
|
137
|
+
conductorAgentId: z.ZodOptional<z.ZodString>;
|
|
138
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
139
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
teamName: z.ZodOptional<z.ZodString>;
|
|
142
|
+
error: z.ZodOptional<z.ZodString>;
|
|
143
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
144
|
+
summaryStatus: z.ZodOptional<z.ZodString>;
|
|
145
|
+
agentCount: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
147
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$loose>;
|
|
149
|
+
export type Run = z.infer<typeof RunSchema>;
|
|
150
|
+
export declare const RUN_SUMMARY_STATUSES: readonly ["pending", "ready", "failed"];
|
|
151
|
+
export type RunSummaryStatus = (typeof RUN_SUMMARY_STATUSES)[number];
|
|
152
|
+
//# sourceMappingURL=orchestration.d.ts.map
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { JudgeVerdictSchema } from "./judge-verdict.js";
|
|
3
|
+
// The orchestration data model — a daemon-owned "Run": one execution of a
|
|
4
|
+
// declared multi-agent plan, and its observable/resumable projection to clients.
|
|
5
|
+
// See projects/agent-orchestration/agent-orchestration.md. This is Otto's
|
|
6
|
+
// provider-agnostic answer to a harness "Workflow": the conductor (an
|
|
7
|
+
// orchestrator-role agent) DECLARES the shape (typed phases, assignments, the
|
|
8
|
+
// loop target) via `start_run`, and the daemon runtime drives control flow —
|
|
9
|
+
// fan-out, gather-barrier, gate, loop — in code, so orchestrating is cheaper
|
|
10
|
+
// than hand-tracking N agent ids across async notifications.
|
|
11
|
+
//
|
|
12
|
+
// Wire-forward-compat, per the protocol contract: every open vocabulary (phase
|
|
13
|
+
// type, phase/run status) rides as a plain string leaf validated by a
|
|
14
|
+
// normalizer, never a z.enum, so the daemon can grow the vocabulary without
|
|
15
|
+
// breaking an older client's parse. Objects `.passthrough()`; no transforms.
|
|
16
|
+
// ── The deterministic plan vocabulary ──────────────────────────────────────
|
|
17
|
+
// Fixed phase types used by the runtime (NOT roles). The dispatcher maps a phase
|
|
18
|
+
// type to the role that fills it: research→researcher, plan→planner,
|
|
19
|
+
// refactor/implement→coder, design→designer, verify→judger, gate→human (no
|
|
20
|
+
// agent), deliver→coder/writer.
|
|
21
|
+
export const RUN_PHASE_TYPES = [
|
|
22
|
+
"research",
|
|
23
|
+
"plan",
|
|
24
|
+
"refactor",
|
|
25
|
+
"implement",
|
|
26
|
+
"design",
|
|
27
|
+
"verify",
|
|
28
|
+
"gate",
|
|
29
|
+
"deliver",
|
|
30
|
+
];
|
|
31
|
+
const PHASE_TYPE_SET = new Set(RUN_PHASE_TYPES);
|
|
32
|
+
export function isRunPhaseType(value) {
|
|
33
|
+
return PHASE_TYPE_SET.has(value);
|
|
34
|
+
}
|
|
35
|
+
// The default role that fills each phase type. `gate` has no role — it's a human
|
|
36
|
+
// approval point. `deliver` defaults to coder (a writer may cover small text
|
|
37
|
+
// deliverables; the conductor can override per phase).
|
|
38
|
+
const PHASE_TYPE_DEFAULT_ROLE = {
|
|
39
|
+
research: "researcher",
|
|
40
|
+
plan: "planner",
|
|
41
|
+
refactor: "coder",
|
|
42
|
+
implement: "coder",
|
|
43
|
+
design: "designer",
|
|
44
|
+
verify: "judger",
|
|
45
|
+
gate: null,
|
|
46
|
+
deliver: "coder",
|
|
47
|
+
};
|
|
48
|
+
/** The role a phase type dispatches to by default (null for human `gate`). */
|
|
49
|
+
export function defaultRoleForPhaseType(type) {
|
|
50
|
+
return PHASE_TYPE_DEFAULT_ROLE[type];
|
|
51
|
+
}
|
|
52
|
+
// ── Phase + run status (open vocabularies, plain-string on the wire) ─────────
|
|
53
|
+
export const RUN_PHASE_STATUSES = [
|
|
54
|
+
"pending",
|
|
55
|
+
"running",
|
|
56
|
+
"blocked", // a gate phase awaiting human approval
|
|
57
|
+
"done",
|
|
58
|
+
"failed",
|
|
59
|
+
"skipped",
|
|
60
|
+
];
|
|
61
|
+
export const RUN_STATUSES = [
|
|
62
|
+
"pending",
|
|
63
|
+
"running",
|
|
64
|
+
"paused", // stopped at an attended gate, awaiting the user
|
|
65
|
+
"done",
|
|
66
|
+
"failed",
|
|
67
|
+
"canceled",
|
|
68
|
+
];
|
|
69
|
+
const PHASE_STATUS_SET = new Set(RUN_PHASE_STATUSES);
|
|
70
|
+
const RUN_STATUS_SET = new Set(RUN_STATUSES);
|
|
71
|
+
export function isRunPhaseStatus(value) {
|
|
72
|
+
return PHASE_STATUS_SET.has(value);
|
|
73
|
+
}
|
|
74
|
+
export function isRunStatus(value) {
|
|
75
|
+
return RUN_STATUS_SET.has(value);
|
|
76
|
+
}
|
|
77
|
+
/** Terminal run statuses — no further phases will run. */
|
|
78
|
+
export function isTerminalRunStatus(value) {
|
|
79
|
+
return value === "done" || value === "failed" || value === "canceled";
|
|
80
|
+
}
|
|
81
|
+
/** Terminal phase statuses — the phase will not change again on its own. */
|
|
82
|
+
export function isTerminalPhaseStatus(value) {
|
|
83
|
+
return value === "done" || value === "failed" || value === "skipped";
|
|
84
|
+
}
|
|
85
|
+
// ── Declaration schema (the `start_run` input) ──────────────────────────────
|
|
86
|
+
// What the conductor DECLARES. Kept minimal and schema-validated so a bad plan
|
|
87
|
+
// is rejected at the tool boundary. `role` overrides the phase-type default;
|
|
88
|
+
// `fanOut` spawns N parallel candidates; `judge` attaches a verify sub-step so a
|
|
89
|
+
// making/research phase's output is graded and (with `keepBest`) looped until
|
|
90
|
+
// enough candidates pass.
|
|
91
|
+
export const RunPhaseJudgeSpecSchema = z
|
|
92
|
+
.object({
|
|
93
|
+
role: z.string().min(1).optional(),
|
|
94
|
+
criteria: z.array(z.string().min(1)).optional(),
|
|
95
|
+
})
|
|
96
|
+
.passthrough();
|
|
97
|
+
export const RunPhaseDeclarationSchema = z
|
|
98
|
+
.object({
|
|
99
|
+
// Caller-assigned id, referenced by other phases' `dependsOn`.
|
|
100
|
+
id: z.string().min(1),
|
|
101
|
+
type: z.string().min(1),
|
|
102
|
+
title: z.string().min(1),
|
|
103
|
+
// The instruction handed to the assigned agent(s) as their prompt.
|
|
104
|
+
task: z.string().min(1),
|
|
105
|
+
// Override the phase-type's default role (e.g. deliver→writer).
|
|
106
|
+
role: z.string().min(1).optional(),
|
|
107
|
+
// Phase ids that must reach a terminal state before this phase starts.
|
|
108
|
+
// Absent/empty ⇒ runs after the previous declared phase (linear default).
|
|
109
|
+
dependsOn: z.array(z.string().min(1)).optional(),
|
|
110
|
+
// Spawn N parallel candidates from the same task (different angles). 1 ⇒ solo.
|
|
111
|
+
fanOut: z.number().int().min(1).max(16).optional(),
|
|
112
|
+
// With a judge: keep the best N passers; if fewer pass, the runtime
|
|
113
|
+
// re-dispatches replacements until the target is met or a cap trips.
|
|
114
|
+
keepBest: z.number().int().min(1).max(16).optional(),
|
|
115
|
+
// Attach a structured-judge sub-step to a non-verify phase.
|
|
116
|
+
judge: RunPhaseJudgeSpecSchema.optional(),
|
|
117
|
+
})
|
|
118
|
+
.passthrough();
|
|
119
|
+
export const RunPlanSchema = z
|
|
120
|
+
.object({
|
|
121
|
+
title: z.string().min(1),
|
|
122
|
+
// Immutable acceptance criteria — the run is "not done until every one is
|
|
123
|
+
// met." Carried onto the Run and shown at gates.
|
|
124
|
+
requirements: z.array(z.string().min(1)).optional(),
|
|
125
|
+
// Attended by default: the run pauses at `gate` phases for the user.
|
|
126
|
+
// Autopilot runs straight through (eligibility enforced daemon-side).
|
|
127
|
+
autopilot: z.boolean().optional(),
|
|
128
|
+
phases: z.array(RunPhaseDeclarationSchema).min(1).max(64),
|
|
129
|
+
})
|
|
130
|
+
.passthrough();
|
|
131
|
+
// ── Projection schema (the Run the daemon persists + pushes to clients) ─────
|
|
132
|
+
// One spawned candidate for a phase: the observable child agent plus, when the
|
|
133
|
+
// phase judged it, that candidate's verdict.
|
|
134
|
+
export const RunPhaseCandidateSchema = z
|
|
135
|
+
.object({
|
|
136
|
+
agentId: z.string().min(1),
|
|
137
|
+
// The personality that filled the role for this candidate, if resolved.
|
|
138
|
+
personalityId: z.string().min(1).optional(),
|
|
139
|
+
verdict: JudgeVerdictSchema.optional(),
|
|
140
|
+
// The candidate's final message (synthesis input); may be large — clients
|
|
141
|
+
// truncate for display.
|
|
142
|
+
summary: z.string().optional(),
|
|
143
|
+
})
|
|
144
|
+
.passthrough();
|
|
145
|
+
export const RunPhaseSchema = z
|
|
146
|
+
.object({
|
|
147
|
+
id: z.string().min(1),
|
|
148
|
+
type: z.string().min(1),
|
|
149
|
+
title: z.string().min(1),
|
|
150
|
+
task: z.string().min(1),
|
|
151
|
+
status: z.string().min(1),
|
|
152
|
+
// Resolved dispatch target. `assigneeRole` is what the type/override asked
|
|
153
|
+
// for; `candidates` are the spawned agents (>1 when fanned out).
|
|
154
|
+
assigneeRole: z.string().min(1).optional(),
|
|
155
|
+
dependsOn: z.array(z.string().min(1)).optional(),
|
|
156
|
+
fanOut: z.number().int().min(1).optional(),
|
|
157
|
+
keepBest: z.number().int().min(1).optional(),
|
|
158
|
+
candidates: z.array(RunPhaseCandidateSchema).optional(),
|
|
159
|
+
// Free-text runtime notes (why it blocked, which cap tripped, gap named).
|
|
160
|
+
notes: z.string().optional(),
|
|
161
|
+
startedAt: z.string().optional(),
|
|
162
|
+
completedAt: z.string().optional(),
|
|
163
|
+
})
|
|
164
|
+
.passthrough();
|
|
165
|
+
export const RunSchema = z
|
|
166
|
+
.object({
|
|
167
|
+
id: z.string().min(1),
|
|
168
|
+
title: z.string().min(1),
|
|
169
|
+
status: z.string().min(1),
|
|
170
|
+
// Immutable requirements block (see RunPlan.requirements).
|
|
171
|
+
requirements: z.array(z.string().min(1)).optional(),
|
|
172
|
+
autopilot: z.boolean().optional(),
|
|
173
|
+
phases: z.array(RunPhaseSchema).default([]),
|
|
174
|
+
// The conductor agent that owns this run, and the workspace it runs in.
|
|
175
|
+
conductorAgentId: z.string().min(1).optional(),
|
|
176
|
+
cwd: z.string().optional(),
|
|
177
|
+
workspaceId: z.string().optional(),
|
|
178
|
+
// The team that was active when this run started (id for a stable filter key,
|
|
179
|
+
// name for display). Absent on runs started without an active team.
|
|
180
|
+
teamId: z.string().min(1).optional(),
|
|
181
|
+
teamName: z.string().min(1).optional(),
|
|
182
|
+
// Set when the run ends in failure or a cap trips.
|
|
183
|
+
error: z.string().optional(),
|
|
184
|
+
// AI-generated, human-readable summary of the whole run (from a Writer
|
|
185
|
+
// personality). `summaryStatus` is a plain-string, forward-compat leaf:
|
|
186
|
+
// "pending" (being generated), "ready", or "failed". Both absent on daemons
|
|
187
|
+
// or runs without the run-summary feature.
|
|
188
|
+
summary: z.string().optional(),
|
|
189
|
+
summaryStatus: z.string().optional(),
|
|
190
|
+
// Total child agents this run spawned (makers + judgers) — a complexity
|
|
191
|
+
// signal surfaced in the Runs display. Grows as the run executes.
|
|
192
|
+
agentCount: z.number().int().min(0).optional(),
|
|
193
|
+
createdAt: z.string().optional(),
|
|
194
|
+
updatedAt: z.string().optional(),
|
|
195
|
+
})
|
|
196
|
+
.passthrough();
|
|
197
|
+
// Summary generation lifecycle (plain-string on the wire; see RunSchema.summaryStatus).
|
|
198
|
+
export const RUN_SUMMARY_STATUSES = ["pending", "ready", "failed"];
|
|
199
|
+
//# sourceMappingURL=orchestration.js.map
|
|
@@ -8,6 +8,7 @@ export interface AgentModeVisuals {
|
|
|
8
8
|
}
|
|
9
9
|
export type AgentProviderModeDefinition = Omit<AgentMode, "icon" | "colorTier"> & AgentModeVisuals & {
|
|
10
10
|
isUnattended?: boolean;
|
|
11
|
+
userSelectable?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export interface AgentProviderDefinition {
|
|
13
14
|
id: string;
|
|
@@ -30,5 +31,14 @@ export declare const AGENT_PROVIDER_IDS: string[];
|
|
|
30
31
|
export declare const AgentProviderSchema: z.ZodString;
|
|
31
32
|
export declare function isValidAgentProvider(value: string, validIds?: Iterable<string>): boolean;
|
|
32
33
|
export declare function getUnattendedModeId(provider: string, definitions?: AgentProviderDefinition[]): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a user may pick this mode themselves. False only for modes explicitly
|
|
36
|
+
* flagged `userSelectable: false` in the static manifest (Claude "dontAsk") — a
|
|
37
|
+
* system-assigned mode that agents can run in but no one selects by hand. Unknown
|
|
38
|
+
* modes (dynamic/ACP, custom providers) default to selectable. The flag is a
|
|
39
|
+
* static property of the mode, so this always consults the built-in manifest
|
|
40
|
+
* rather than snapshot-derived definitions (which don't carry it).
|
|
41
|
+
*/
|
|
42
|
+
export declare function isUserSelectableMode(provider: string, modeId: string): boolean;
|
|
33
43
|
export declare function getModeVisuals(provider: string, modeId: string, definitions: AgentProviderDefinition[]): AgentModeVisuals | undefined;
|
|
34
44
|
//# sourceMappingURL=provider-manifest.d.ts.map
|
|
@@ -28,6 +28,21 @@ const CLAUDE_MODES = [
|
|
|
28
28
|
icon: "LocalPolice",
|
|
29
29
|
colorTier: "moderate",
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
id: "dontAsk",
|
|
33
|
+
label: "Don't Ask",
|
|
34
|
+
description: "Runs without prompting — actions not pre-approved are denied",
|
|
35
|
+
// Guarded unattended mode: more dangerous than acceptEdits (edits only) but
|
|
36
|
+
// safer than bypass (deny-by-default vs. run-everything), so it sits at the
|
|
37
|
+
// "moderate" tier alongside Auto.
|
|
38
|
+
icon: "ShieldCheck",
|
|
39
|
+
colorTier: "moderate",
|
|
40
|
+
isUnattended: true,
|
|
41
|
+
// System-assigned only: the coercion target for unattended runs and for Auto
|
|
42
|
+
// on models that can't run it (Haiku). Users never pick it — it's hidden from
|
|
43
|
+
// mode dropdowns and locks the control when it's an agent's active mode.
|
|
44
|
+
userSelectable: false,
|
|
45
|
+
},
|
|
31
46
|
{
|
|
32
47
|
id: "bypassPermissions",
|
|
33
48
|
label: "Bypass",
|
|
@@ -217,6 +232,19 @@ export function getUnattendedModeId(provider, definitions = [
|
|
|
217
232
|
const definition = definitions.find((entry) => entry.id === provider);
|
|
218
233
|
return definition?.modes.find((mode) => mode.isUnattended)?.id;
|
|
219
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Whether a user may pick this mode themselves. False only for modes explicitly
|
|
237
|
+
* flagged `userSelectable: false` in the static manifest (Claude "dontAsk") — a
|
|
238
|
+
* system-assigned mode that agents can run in but no one selects by hand. Unknown
|
|
239
|
+
* modes (dynamic/ACP, custom providers) default to selectable. The flag is a
|
|
240
|
+
* static property of the mode, so this always consults the built-in manifest
|
|
241
|
+
* rather than snapshot-derived definitions (which don't carry it).
|
|
242
|
+
*/
|
|
243
|
+
export function isUserSelectableMode(provider, modeId) {
|
|
244
|
+
const definition = [...AGENT_PROVIDER_DEFINITIONS, ...DEV_AGENT_PROVIDER_DEFINITIONS].find((entry) => entry.id === provider);
|
|
245
|
+
const mode = definition?.modes.find((entry) => entry.id === modeId);
|
|
246
|
+
return mode?.userSelectable !== false;
|
|
247
|
+
}
|
|
220
248
|
export function getModeVisuals(provider, modeId, definitions) {
|
|
221
249
|
const definition = definitions.find((entry) => entry.id === provider);
|
|
222
250
|
const mode = definition?.modes.find((m) => m.id === modeId);
|
|
@@ -100,6 +100,7 @@ export declare const ScheduleUpdateRequestSchema: z.ZodObject<{
|
|
|
100
100
|
}, z.core.$strip>], "type">>;
|
|
101
101
|
newAgentConfig: z.ZodOptional<z.ZodObject<{
|
|
102
102
|
provider: z.ZodOptional<z.ZodString>;
|
|
103
|
+
personality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
104
|
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
105
|
modeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
106
|
thinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -118,13 +119,14 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
|
|
|
118
119
|
payload: z.ZodObject<{
|
|
119
120
|
requestId: z.ZodString;
|
|
120
121
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
122
|
+
prompt: z.ZodString;
|
|
121
123
|
name: z.ZodNullable<z.ZodString>;
|
|
124
|
+
id: z.ZodString;
|
|
122
125
|
status: z.ZodEnum<{
|
|
126
|
+
paused: "paused";
|
|
123
127
|
completed: "completed";
|
|
124
128
|
active: "active";
|
|
125
|
-
paused: "paused";
|
|
126
129
|
}>;
|
|
127
|
-
id: z.ZodString;
|
|
128
130
|
createdAt: z.ZodString;
|
|
129
131
|
updatedAt: z.ZodString;
|
|
130
132
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -166,12 +168,11 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
|
|
|
166
168
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
167
169
|
}, z.core.$strip>;
|
|
168
170
|
}, z.core.$strip>], "type">;
|
|
169
|
-
prompt: z.ZodString;
|
|
170
171
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
171
172
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
172
173
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
173
|
-
succeeded: "succeeded";
|
|
174
174
|
failed: "failed";
|
|
175
|
+
succeeded: "succeeded";
|
|
175
176
|
}>>>;
|
|
176
177
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
178
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -186,13 +187,14 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
|
|
|
186
187
|
payload: z.ZodObject<{
|
|
187
188
|
requestId: z.ZodString;
|
|
188
189
|
schedules: z.ZodArray<z.ZodObject<{
|
|
190
|
+
prompt: z.ZodString;
|
|
189
191
|
name: z.ZodNullable<z.ZodString>;
|
|
192
|
+
id: z.ZodString;
|
|
190
193
|
status: z.ZodEnum<{
|
|
194
|
+
paused: "paused";
|
|
191
195
|
completed: "completed";
|
|
192
196
|
active: "active";
|
|
193
|
-
paused: "paused";
|
|
194
197
|
}>;
|
|
195
|
-
id: z.ZodString;
|
|
196
198
|
createdAt: z.ZodString;
|
|
197
199
|
updatedAt: z.ZodString;
|
|
198
200
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -234,12 +236,11 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
|
|
|
234
236
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
235
237
|
}, z.core.$strip>;
|
|
236
238
|
}, z.core.$strip>], "type">;
|
|
237
|
-
prompt: z.ZodString;
|
|
238
239
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
239
240
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
240
241
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
241
|
-
succeeded: "succeeded";
|
|
242
242
|
failed: "failed";
|
|
243
|
+
succeeded: "succeeded";
|
|
243
244
|
}>>>;
|
|
244
245
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
246
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -297,17 +298,17 @@ export declare const ScheduleInspectResponseSchema: z.ZodObject<{
|
|
|
297
298
|
}, z.core.$strip>;
|
|
298
299
|
}, z.core.$strip>], "type">;
|
|
299
300
|
status: z.ZodEnum<{
|
|
301
|
+
paused: "paused";
|
|
300
302
|
completed: "completed";
|
|
301
303
|
active: "active";
|
|
302
|
-
paused: "paused";
|
|
303
304
|
}>;
|
|
304
305
|
createdAt: z.ZodString;
|
|
305
306
|
updatedAt: z.ZodString;
|
|
306
307
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
307
308
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
308
309
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
309
|
-
succeeded: "succeeded";
|
|
310
310
|
failed: "failed";
|
|
311
|
+
succeeded: "succeeded";
|
|
311
312
|
}>>>;
|
|
312
313
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
314
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -320,8 +321,8 @@ export declare const ScheduleInspectResponseSchema: z.ZodObject<{
|
|
|
320
321
|
endedAt: z.ZodNullable<z.ZodString>;
|
|
321
322
|
status: z.ZodEnum<{
|
|
322
323
|
running: "running";
|
|
323
|
-
succeeded: "succeeded";
|
|
324
324
|
failed: "failed";
|
|
325
|
+
succeeded: "succeeded";
|
|
325
326
|
}>;
|
|
326
327
|
agentId: z.ZodNullable<z.ZodGUID>;
|
|
327
328
|
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -343,8 +344,8 @@ export declare const ScheduleLogsResponseSchema: z.ZodObject<{
|
|
|
343
344
|
endedAt: z.ZodNullable<z.ZodString>;
|
|
344
345
|
status: z.ZodEnum<{
|
|
345
346
|
running: "running";
|
|
346
|
-
succeeded: "succeeded";
|
|
347
347
|
failed: "failed";
|
|
348
|
+
succeeded: "succeeded";
|
|
348
349
|
}>;
|
|
349
350
|
agentId: z.ZodNullable<z.ZodGUID>;
|
|
350
351
|
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -359,13 +360,14 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
|
|
|
359
360
|
payload: z.ZodObject<{
|
|
360
361
|
requestId: z.ZodString;
|
|
361
362
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
363
|
+
prompt: z.ZodString;
|
|
362
364
|
name: z.ZodNullable<z.ZodString>;
|
|
365
|
+
id: z.ZodString;
|
|
363
366
|
status: z.ZodEnum<{
|
|
367
|
+
paused: "paused";
|
|
364
368
|
completed: "completed";
|
|
365
369
|
active: "active";
|
|
366
|
-
paused: "paused";
|
|
367
370
|
}>;
|
|
368
|
-
id: z.ZodString;
|
|
369
371
|
createdAt: z.ZodString;
|
|
370
372
|
updatedAt: z.ZodString;
|
|
371
373
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -407,12 +409,11 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
|
|
|
407
409
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
408
410
|
}, z.core.$strip>;
|
|
409
411
|
}, z.core.$strip>], "type">;
|
|
410
|
-
prompt: z.ZodString;
|
|
411
412
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
412
413
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
413
414
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
414
|
-
succeeded: "succeeded";
|
|
415
415
|
failed: "failed";
|
|
416
|
+
succeeded: "succeeded";
|
|
416
417
|
}>>>;
|
|
417
418
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
418
419
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -427,13 +428,14 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
|
|
|
427
428
|
payload: z.ZodObject<{
|
|
428
429
|
requestId: z.ZodString;
|
|
429
430
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
431
|
+
prompt: z.ZodString;
|
|
430
432
|
name: z.ZodNullable<z.ZodString>;
|
|
433
|
+
id: z.ZodString;
|
|
431
434
|
status: z.ZodEnum<{
|
|
435
|
+
paused: "paused";
|
|
432
436
|
completed: "completed";
|
|
433
437
|
active: "active";
|
|
434
|
-
paused: "paused";
|
|
435
438
|
}>;
|
|
436
|
-
id: z.ZodString;
|
|
437
439
|
createdAt: z.ZodString;
|
|
438
440
|
updatedAt: z.ZodString;
|
|
439
441
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -475,12 +477,11 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
|
|
|
475
477
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
476
478
|
}, z.core.$strip>;
|
|
477
479
|
}, z.core.$strip>], "type">;
|
|
478
|
-
prompt: z.ZodString;
|
|
479
480
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
480
481
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
481
482
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
482
|
-
succeeded: "succeeded";
|
|
483
483
|
failed: "failed";
|
|
484
|
+
succeeded: "succeeded";
|
|
484
485
|
}>>>;
|
|
485
486
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
486
487
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -546,17 +547,17 @@ export declare const ScheduleRunOnceResponseSchema: z.ZodObject<{
|
|
|
546
547
|
}, z.core.$strip>;
|
|
547
548
|
}, z.core.$strip>], "type">;
|
|
548
549
|
status: z.ZodEnum<{
|
|
550
|
+
paused: "paused";
|
|
549
551
|
completed: "completed";
|
|
550
552
|
active: "active";
|
|
551
|
-
paused: "paused";
|
|
552
553
|
}>;
|
|
553
554
|
createdAt: z.ZodString;
|
|
554
555
|
updatedAt: z.ZodString;
|
|
555
556
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
556
557
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
557
558
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
558
|
-
succeeded: "succeeded";
|
|
559
559
|
failed: "failed";
|
|
560
|
+
succeeded: "succeeded";
|
|
560
561
|
}>>>;
|
|
561
562
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
562
563
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -569,8 +570,8 @@ export declare const ScheduleRunOnceResponseSchema: z.ZodObject<{
|
|
|
569
570
|
endedAt: z.ZodNullable<z.ZodString>;
|
|
570
571
|
status: z.ZodEnum<{
|
|
571
572
|
running: "running";
|
|
572
|
-
succeeded: "succeeded";
|
|
573
573
|
failed: "failed";
|
|
574
|
+
succeeded: "succeeded";
|
|
574
575
|
}>;
|
|
575
576
|
agentId: z.ZodNullable<z.ZodGUID>;
|
|
576
577
|
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -629,17 +630,17 @@ export declare const ScheduleUpdateResponseSchema: z.ZodObject<{
|
|
|
629
630
|
}, z.core.$strip>;
|
|
630
631
|
}, z.core.$strip>], "type">;
|
|
631
632
|
status: z.ZodEnum<{
|
|
633
|
+
paused: "paused";
|
|
632
634
|
completed: "completed";
|
|
633
635
|
active: "active";
|
|
634
|
-
paused: "paused";
|
|
635
636
|
}>;
|
|
636
637
|
createdAt: z.ZodString;
|
|
637
638
|
updatedAt: z.ZodString;
|
|
638
639
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
639
640
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
640
641
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
641
|
-
succeeded: "succeeded";
|
|
642
642
|
failed: "failed";
|
|
643
|
+
succeeded: "succeeded";
|
|
643
644
|
}>>>;
|
|
644
645
|
lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
645
646
|
pausedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -652,8 +653,8 @@ export declare const ScheduleUpdateResponseSchema: z.ZodObject<{
|
|
|
652
653
|
endedAt: z.ZodNullable<z.ZodString>;
|
|
653
654
|
status: z.ZodEnum<{
|
|
654
655
|
running: "running";
|
|
655
|
-
succeeded: "succeeded";
|
|
656
656
|
failed: "failed";
|
|
657
|
+
succeeded: "succeeded";
|
|
657
658
|
}>;
|
|
658
659
|
agentId: z.ZodNullable<z.ZodGUID>;
|
|
659
660
|
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -62,6 +62,9 @@ export const ScheduleRunOnceRequestSchema = z.object({
|
|
|
62
62
|
});
|
|
63
63
|
const ScheduleUpdateNewAgentConfigSchema = z.object({
|
|
64
64
|
provider: z.string().trim().min(1).optional(),
|
|
65
|
+
// Personality binding by name — or the "@team-scheduler" sentinel. Explicit
|
|
66
|
+
// null clears a stored binding; omission leaves it untouched.
|
|
67
|
+
personality: z.string().trim().min(1).nullable().optional(),
|
|
65
68
|
model: z.string().trim().min(1).nullable().optional(),
|
|
66
69
|
modeId: z.string().trim().min(1).nullable().optional(),
|
|
67
70
|
thinkingOptionId: z.string().trim().min(1).nullable().optional(),
|