@otto-code/protocol 0.8.10 → 0.8.13
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-labels.d.ts +3 -0
- package/dist/agent-labels.js +10 -0
- package/dist/agent-personalities.d.ts +4 -3
- package/dist/agent-personalities.js +13 -20
- package/dist/agent-queue.d.ts +87 -0
- package/dist/agent-queue.js +106 -0
- package/dist/agent-types.d.ts +24 -4
- package/dist/binary-frames/terminal.d.ts +4 -0
- package/dist/binary-frames/terminal.js +1 -0
- package/dist/brain.d.ts +2412 -0
- package/dist/brain.js +1100 -0
- package/dist/chat/rpc-schemas.js +1 -0
- package/dist/chat/types.js +1 -0
- package/dist/client-capabilities.d.ts +3 -0
- package/dist/client-capabilities.js +14 -0
- package/dist/code-intelligence.d.ts +917 -0
- package/dist/code-intelligence.js +699 -0
- package/dist/communications.d.ts +1106 -0
- package/dist/communications.js +384 -0
- package/dist/context.d.ts +787 -0
- package/dist/context.js +295 -0
- package/dist/daemon-config.d.ts +383 -0
- package/dist/daemon-config.js +401 -0
- package/dist/file-operations.d.ts +380 -0
- package/dist/file-operations.js +282 -0
- package/dist/generated/validation/ws-outbound.aot.js +67260 -57392
- package/dist/git-hosting.d.ts +117 -0
- package/dist/git-hosting.js +109 -0
- package/dist/git-operations.d.ts +255 -0
- package/dist/git-operations.js +221 -0
- package/dist/integration-authorization.d.ts +195 -0
- package/dist/integration-authorization.js +125 -0
- package/dist/kanban.d.ts +341 -0
- package/dist/kanban.js +273 -0
- package/dist/loop/rpc-schemas.d.ts +6 -6
- package/dist/loop/rpc-schemas.js +1 -0
- package/dist/meetings.d.ts +95 -0
- package/dist/meetings.js +57 -0
- package/dist/messages.d.ts +11175 -11039
- package/dist/messages.js +4756 -8700
- package/dist/orchestration.d.ts +726 -0
- package/dist/orchestration.js +232 -0
- package/dist/personality-schemas.d.ts +221 -0
- package/dist/personality-schemas.js +340 -0
- package/dist/preview.d.ts +140 -0
- package/dist/preview.js +98 -0
- package/dist/project-knowledge.d.ts +740 -0
- package/dist/project-knowledge.js +229 -0
- package/dist/project-links.d.ts +102 -0
- package/dist/project-links.js +62 -0
- package/dist/provider-config.d.ts +87 -2
- package/dist/provider-config.js +110 -0
- package/dist/provider-manifest.js +7 -0
- package/dist/provider-snapshot-codec.d.ts +18 -0
- package/dist/provider-snapshot-codec.js +71 -0
- package/dist/refine.d.ts +93 -0
- package/dist/refine.js +78 -0
- package/dist/schedule/rpc-schemas.d.ts +55 -111
- package/dist/schedule/types.d.ts +16 -37
- package/dist/schedule/types.js +1 -11
- package/dist/search/text-match.d.ts +55 -0
- package/dist/search/text-match.js +262 -0
- package/dist/speech.d.ts +180 -0
- package/dist/speech.js +177 -0
- package/dist/storage.d.ts +79 -0
- package/dist/storage.js +107 -0
- package/dist/suggested-tasks.d.ts +106 -0
- package/dist/suggested-tasks.js +81 -0
- package/dist/terminal-compatibility.d.ts +55 -0
- package/dist/terminal-compatibility.js +35 -0
- package/dist/terminal-input-mode.d.ts +4 -0
- package/dist/terminal-input-mode.js +35 -6
- package/dist/terminal-key-input.js +15 -6
- package/dist/terminal-profiles.d.ts +35 -0
- package/dist/terminal-profiles.js +246 -4
- package/dist/tool-call-display.d.ts +2 -2
- package/dist/tool-call-display.js +6 -6
- package/dist/usage-stats.d.ts +255 -0
- package/dist/usage-stats.js +162 -0
- package/dist/validation/ws-outbound-schema-metadata.d.ts +1906 -266
- package/dist/worktree-ops.d.ts +81 -0
- package/dist/worktree-ops.js +88 -0
- package/package.json +1 -1
package/dist/agent-labels.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const PARENT_AGENT_ID_LABEL = "otto.parent-agent-id";
|
|
2
|
+
export declare function getOpenAgentTabLabel(clientId: string): string;
|
|
3
|
+
export declare function isOpenAgentTabLabel(label: string): boolean;
|
|
2
4
|
export interface AgentLabelSource {
|
|
3
5
|
labels?: Record<string, unknown> | null;
|
|
4
6
|
}
|
|
@@ -30,4 +32,5 @@ export interface OrchestrationQueryToolLabel {
|
|
|
30
32
|
path?: string;
|
|
31
33
|
}
|
|
32
34
|
export declare function getQueryToolsFromLabels(labels: Record<string, unknown> | null | undefined): OrchestrationQueryToolLabel[] | null;
|
|
35
|
+
export declare function hasOpenAgentTab(labels: Record<string, unknown> | null | undefined): boolean;
|
|
33
36
|
//# sourceMappingURL=agent-labels.d.ts.map
|
package/dist/agent-labels.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export const PARENT_AGENT_ID_LABEL = "otto.parent-agent-id";
|
|
2
|
+
const OPEN_AGENT_TAB_LABEL_PREFIX = "otto.open-agent-tab.";
|
|
3
|
+
export function getOpenAgentTabLabel(clientId) {
|
|
4
|
+
return `${OPEN_AGENT_TAB_LABEL_PREFIX}${clientId}`;
|
|
5
|
+
}
|
|
6
|
+
export function isOpenAgentTabLabel(label) {
|
|
7
|
+
return label.startsWith(OPEN_AGENT_TAB_LABEL_PREFIX);
|
|
8
|
+
}
|
|
2
9
|
export function getParentAgentIdFromLabels(labels) {
|
|
3
10
|
const parentAgentId = labels?.[PARENT_AGENT_ID_LABEL];
|
|
4
11
|
return typeof parentAgentId === "string" && parentAgentId.trim().length > 0
|
|
@@ -90,4 +97,7 @@ function parseJsonArrayLabel(labels, key, isValid) {
|
|
|
90
97
|
});
|
|
91
98
|
return entries.length > 0 ? entries : null;
|
|
92
99
|
}
|
|
100
|
+
export function hasOpenAgentTab(labels) {
|
|
101
|
+
return Object.entries(labels ?? {}).some(([label, value]) => isOpenAgentTabLabel(label) && value === "true");
|
|
102
|
+
}
|
|
93
103
|
//# sourceMappingURL=agent-labels.js.map
|
|
@@ -3,8 +3,8 @@ export declare function isPersonalityRole(value: string): value is PersonalityRo
|
|
|
3
3
|
/**
|
|
4
4
|
* Filter an arbitrary role array (roles ride the wire as plain strings) down to
|
|
5
5
|
* the known set, deduped and returned in canonical `PERSONALITY_ROLES` order.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Unknown roles (for example, a role from a newer peer) are dropped rather
|
|
7
|
+
* than trusted.
|
|
8
8
|
*/
|
|
9
9
|
export declare function normalizePersonalityRoles(roles: readonly string[] | undefined): PersonalityRole[];
|
|
10
10
|
export declare function personalityHasRole(personality: Pick<AgentPersonality, "roles">, role: PersonalityRole): boolean;
|
|
@@ -34,11 +34,12 @@ export interface PersonalitySelectionSummary {
|
|
|
34
34
|
* deciding agent can pick the right teammate from the list alone.
|
|
35
35
|
*/
|
|
36
36
|
export declare function summarizePersonalityForSelection(personality: Pick<AgentPersonality, "roles">): PersonalitySelectionSummary;
|
|
37
|
+
export declare const OTTO_WORK_VOCABULARY_DIRECTIVE = "Otto work vocabulary: a suggested task is deferred work for the user and does not start work; a chat is an active Otto chat session; a child chat is created by another chat; a personality profile is a reusable provider, model, mode, effort, and behavior template; an orchestration coordinates multiple chats; a schedule starts a background chat when due; a heartbeat sends a reminder or prompt and does not start a chat. Use suggest_task for concrete work to preserve for later, create_chat to start one chat now, and start_orchestration only for managed multi-chat coordination. Use list_personalities, optionally filtered by roles, before choosing a personality profile. Never substitute a harness-native agent-spawn tool for suggest_task, and when a user names an Otto tool exactly, use that exact Otto tool.";
|
|
37
38
|
export declare const ORCHESTRATOR_METHOD_DIRECTIVE: string;
|
|
38
39
|
/**
|
|
39
40
|
* The in-context "role directive" injected into a personality's system prompt at
|
|
40
41
|
* spawn. The orchestrator gets the full conductor method; other coordinators
|
|
41
|
-
* (chatter/artificer/scheduler) get a lighter delegate nudge; focused
|
|
42
|
+
* (chatter/artificer/scheduler) get a lighter delegate nudge; focused personalities
|
|
42
43
|
* are told to stay on the task someone is waiting on. Roleless spawns get
|
|
43
44
|
* nothing. This is guidance, not a gate - the tools stay available either way.
|
|
44
45
|
*/
|
|
@@ -4,22 +4,14 @@ import { PERSONALITY_ROLES } from "./messages.js";
|
|
|
4
4
|
// resolution is NOT here - it needs the model's advertised thinking options and
|
|
5
5
|
// lives with the daemon's effort resolver; availability does not depend on it.
|
|
6
6
|
const ROLE_SET = new Set(PERSONALITY_ROLES);
|
|
7
|
-
// Retired role names, mapped to their canonical replacement. "worker" was split
|
|
8
|
-
// into "writer" (fast small-text generation) and "coder" (sub-agent coding); a
|
|
9
|
-
// personality that still carries the old tag resolves to "coder", the closer
|
|
10
|
-
// heir of what a worker did. Normalization applies these before filtering so
|
|
11
|
-
// personalities persisted before the split keep a real role.
|
|
12
|
-
const LEGACY_ROLE_ALIASES = {
|
|
13
|
-
worker: "coder",
|
|
14
|
-
};
|
|
15
7
|
export function isPersonalityRole(value) {
|
|
16
8
|
return ROLE_SET.has(value);
|
|
17
9
|
}
|
|
18
10
|
/**
|
|
19
11
|
* Filter an arbitrary role array (roles ride the wire as plain strings) down to
|
|
20
12
|
* the known set, deduped and returned in canonical `PERSONALITY_ROLES` order.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
13
|
+
* Unknown roles (for example, a role from a newer peer) are dropped rather
|
|
14
|
+
* than trusted.
|
|
23
15
|
*/
|
|
24
16
|
export function normalizePersonalityRoles(roles) {
|
|
25
17
|
if (!roles || roles.length === 0) {
|
|
@@ -27,7 +19,7 @@ export function normalizePersonalityRoles(roles) {
|
|
|
27
19
|
}
|
|
28
20
|
const present = new Set();
|
|
29
21
|
for (const raw of roles) {
|
|
30
|
-
const canonical =
|
|
22
|
+
const canonical = isPersonalityRole(raw) ? raw : null;
|
|
31
23
|
if (canonical) {
|
|
32
24
|
present.add(canonical);
|
|
33
25
|
}
|
|
@@ -51,7 +43,7 @@ export const PERSONALITY_ROLE_INFO = {
|
|
|
51
43
|
tier: "coordinator",
|
|
52
44
|
guidance: "Creates and manages schedules; may orchestrate recurring or multi-step jobs. Pick for scheduling.",
|
|
53
45
|
},
|
|
54
|
-
// ── Thinking
|
|
46
|
+
// ── Thinking specialists (read-only, structured findings) ────────────────
|
|
55
47
|
researcher: {
|
|
56
48
|
tier: "focused",
|
|
57
49
|
guidance: "Read-only surveyor - maps the code or domain and reports files, types, patterns, and gotchas. Pick to gather facts; proposes no solutions and edits nothing.",
|
|
@@ -68,7 +60,7 @@ export const PERSONALITY_ROLE_INFO = {
|
|
|
68
60
|
tier: "focused",
|
|
69
61
|
guidance: "Read-only second opinion - weighs the trade-offs and returns one recommendation. Pick for advice; never edits and does not fan out.",
|
|
70
62
|
},
|
|
71
|
-
// ── Making
|
|
63
|
+
// ── Making specialists (produce code, design, or text) ───────────────────
|
|
72
64
|
coder: {
|
|
73
65
|
tier: "focused",
|
|
74
66
|
guidance: "Focused implementer - writes code for one sub-task others are waiting on. Pick to get a coding job done; stays on task.",
|
|
@@ -84,7 +76,7 @@ export const PERSONALITY_ROLE_INFO = {
|
|
|
84
76
|
// ── Conductor ─────────────────────────────────────────────────────────────
|
|
85
77
|
orchestrator: {
|
|
86
78
|
tier: "coordinator",
|
|
87
|
-
guidance: "The sole conductor - plans team-shaped work, dispatches typed tasks to the right teammates, gathers, and synthesizes. Pick to
|
|
79
|
+
guidance: "The sole conductor - plans team-shaped work, dispatches typed tasks to the right teammates, gathers, and synthesizes. Pick to coordinate a multi-chat workflow.",
|
|
88
80
|
},
|
|
89
81
|
};
|
|
90
82
|
/**
|
|
@@ -113,17 +105,18 @@ export function summarizePersonalityForSelection(personality) {
|
|
|
113
105
|
}
|
|
114
106
|
// The conductor's standing directive - the distilled `/epic` method taught to
|
|
115
107
|
// the sole orchestrator role at spawn. It chooses direct work, a dedicated
|
|
116
|
-
//
|
|
108
|
+
// chat, a suggested task, or an orchestration by the task's actual needs rather than
|
|
117
109
|
// treating orchestration as the default. Kept here as one exported constant so
|
|
118
110
|
// the wording is testable and shared. See projects/agent-orchestration/agent-orchestration.md.
|
|
111
|
+
export const OTTO_WORK_VOCABULARY_DIRECTIVE = "Otto work vocabulary: a suggested task is deferred work for the user and does not start work; a chat is an active Otto chat session; a child chat is created by another chat; a personality profile is a reusable provider, model, mode, effort, and behavior template; an orchestration coordinates multiple chats; a schedule starts a background chat when due; a heartbeat sends a reminder or prompt and does not start a chat. Use suggest_task for concrete work to preserve for later, create_chat to start one chat now, and start_orchestration only for managed multi-chat coordination. Use list_personalities, optionally filtered by roles, before choosing a personality profile. Never substitute a harness-native agent-spawn tool for suggest_task, and when a user names an Otto tool exactly, use that exact Otto tool.";
|
|
119
112
|
export const ORCHESTRATOR_METHOD_DIRECTIVE = "You are the orchestrator - the team's sole conductor. Choose tools because the task needs their specific capability, never because a tool is available or named. " +
|
|
120
|
-
"Do a small, self-contained task directly. Use
|
|
121
|
-
"For work that genuinely needs orchestration: (1) if the shape is unclear, dispatch
|
|
113
|
+
"Do a small, self-contained task directly. Use create_chat only for an independently executable piece of active work that benefits from its own chat. Use suggest_task only to preserve a concrete, out-of-scope follow-up for later. Use start_orchestration only when the active work needs a declared multi-chat plan with daemon-managed fan-out, gathering, judging, loops, or approval gates. " +
|
|
114
|
+
"For work that genuinely needs orchestration: (1) if the shape is unclear, dispatch research and planning chats; (2) declare the plan with start_orchestration - phases typed research/plan/implement/design/verify/gate/deliver, fanning out where several angles help and attaching a judger to grade them, looping until enough pass; (3) put a gate before irreversible or costly steps so the user approves; (4) synthesize the passing results into the deliverable. " +
|
|
122
115
|
"Every phase maps to a teammate's role; if the active team lacks a role a phase needs, say so plainly and stop rather than papering over the gap.";
|
|
123
116
|
/**
|
|
124
117
|
* The in-context "role directive" injected into a personality's system prompt at
|
|
125
118
|
* spawn. The orchestrator gets the full conductor method; other coordinators
|
|
126
|
-
* (chatter/artificer/scheduler) get a lighter delegate nudge; focused
|
|
119
|
+
* (chatter/artificer/scheduler) get a lighter delegate nudge; focused personalities
|
|
127
120
|
* are told to stay on the task someone is waiting on. Roleless spawns get
|
|
128
121
|
* nothing. This is guidance, not a gate - the tools stay available either way.
|
|
129
122
|
*/
|
|
@@ -137,9 +130,9 @@ export function composeRoleFocusDirective(roles) {
|
|
|
137
130
|
return `${ORCHESTRATOR_METHOD_DIRECTIVE} (Your roles: ${roleList}.)`;
|
|
138
131
|
}
|
|
139
132
|
if (normalized.some((role) => PERSONALITY_ROLE_INFO[role].tier === "coordinator")) {
|
|
140
|
-
return `You are a coordinator personality (roles: ${roleList}). You front interactive work and may delegate when the task benefits from it: use list_personalities to see who else is available, then either do the work directly,
|
|
133
|
+
return `You are a coordinator personality (roles: ${roleList}). You front interactive work and may delegate when the task benefits from it: use list_personalities to see who else is available, then either do the work directly, create a child chat for an independent active piece, or hand off genuinely multi-chat work to the team's orchestrator.`;
|
|
141
134
|
}
|
|
142
|
-
return `You are a focused
|
|
135
|
+
return `You are a focused personality (roles: ${roleList}). Someone is waiting on this specific task - stay on it and finish it. You can still call list_personalities to see the roster, but don't create child chats or start side workflows unless it is genuinely essential to completing this job.`;
|
|
143
136
|
}
|
|
144
137
|
/**
|
|
145
138
|
* Decide whether a personality is usable against a provider's current snapshot.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Otto steer-queue wire schemas: the agent.queue.* remove, reorder and clear RPCs and the queued-message payload. Fork-only capability, so it owns its schemas; messages.ts re-exports them.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* One message parked for delivery as an agent's NEXT turn (`delivery: "queue"`).
|
|
7
|
+
* The daemon owns the queue; this is the read-only projection the Queue track
|
|
8
|
+
* renders. Declared above AgentSnapshotPayloadSchema - zod-aot emits schemas in
|
|
9
|
+
* source order, so a forward reference is a build-time ReferenceError.
|
|
10
|
+
*/
|
|
11
|
+
export declare const QueuedAgentMessagePayloadSchema: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
preview: z.ZodString;
|
|
14
|
+
enqueuedAt: z.ZodString;
|
|
15
|
+
attachmentCount: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
user: "user";
|
|
18
|
+
system: "system";
|
|
19
|
+
}>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
/** Pull one message back out of an agent's queue (Queue-track edit / send now). */
|
|
22
|
+
export declare const AgentQueueRemoveRequestMessageSchema: z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"agent.queue.remove.request">;
|
|
24
|
+
requestId: z.ZodString;
|
|
25
|
+
agentId: z.ZodString;
|
|
26
|
+
messageId: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
/**
|
|
29
|
+
* Move one queued message to a different position in an agent's queue.
|
|
30
|
+
*
|
|
31
|
+
* Order is what the queue means, so this is the edit that changes the next
|
|
32
|
+
* turn's content without changing the queue's membership. The daemon resolves
|
|
33
|
+
* `messageId` fresh and clamps `toIndex`, so a client acting on a snapshot that
|
|
34
|
+
* is one drain stale reorders what is actually there or reports `moved: false`.
|
|
35
|
+
* COMPAT(steerQueueReorder): added in v0.6.9, drop the gate when floor >= v0.6.9.
|
|
36
|
+
*/
|
|
37
|
+
export declare const AgentQueueReorderRequestMessageSchema: z.ZodObject<{
|
|
38
|
+
type: z.ZodLiteral<"agent.queue.reorder.request">;
|
|
39
|
+
requestId: z.ZodString;
|
|
40
|
+
agentId: z.ZodString;
|
|
41
|
+
messageId: z.ZodString;
|
|
42
|
+
toIndex: z.ZodNumber;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
/** Drop every message queued behind an agent's current turn. */
|
|
45
|
+
export declare const AgentQueueClearRequestMessageSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"agent.queue.clear.request">;
|
|
47
|
+
requestId: z.ZodString;
|
|
48
|
+
agentId: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const AgentQueueRemoveResponseMessageSchema: z.ZodObject<{
|
|
51
|
+
type: z.ZodLiteral<"agent.queue.remove.response">;
|
|
52
|
+
payload: z.ZodObject<{
|
|
53
|
+
requestId: z.ZodString;
|
|
54
|
+
agentId: z.ZodString;
|
|
55
|
+
removed: z.ZodNullable<z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
text: z.ZodString;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
error: z.ZodNullable<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export declare const AgentQueueReorderResponseMessageSchema: z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"agent.queue.reorder.response">;
|
|
64
|
+
payload: z.ZodObject<{
|
|
65
|
+
requestId: z.ZodString;
|
|
66
|
+
agentId: z.ZodString;
|
|
67
|
+
moved: z.ZodBoolean;
|
|
68
|
+
error: z.ZodNullable<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export declare const AgentQueueClearResponseMessageSchema: z.ZodObject<{
|
|
72
|
+
type: z.ZodLiteral<"agent.queue.clear.response">;
|
|
73
|
+
payload: z.ZodObject<{
|
|
74
|
+
requestId: z.ZodString;
|
|
75
|
+
agentId: z.ZodString;
|
|
76
|
+
clearedCount: z.ZodNumber;
|
|
77
|
+
error: z.ZodNullable<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type QueuedAgentMessagePayload = z.infer<typeof QueuedAgentMessagePayloadSchema>;
|
|
81
|
+
export type AgentQueueRemoveRequestMessage = z.infer<typeof AgentQueueRemoveRequestMessageSchema>;
|
|
82
|
+
export type AgentQueueRemoveResponseMessage = z.infer<typeof AgentQueueRemoveResponseMessageSchema>;
|
|
83
|
+
export type AgentQueueReorderRequestMessage = z.infer<typeof AgentQueueReorderRequestMessageSchema>;
|
|
84
|
+
export type AgentQueueReorderResponseMessage = z.infer<typeof AgentQueueReorderResponseMessageSchema>;
|
|
85
|
+
export type AgentQueueClearRequestMessage = z.infer<typeof AgentQueueClearRequestMessageSchema>;
|
|
86
|
+
export type AgentQueueClearResponseMessage = z.infer<typeof AgentQueueClearResponseMessageSchema>;
|
|
87
|
+
//# sourceMappingURL=agent-queue.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Otto steer-queue wire schemas: the agent.queue.* remove, reorder and clear RPCs and the queued-message payload. Fork-only capability, so it owns its schemas; messages.ts re-exports them.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* One message parked for delivery as an agent's NEXT turn (`delivery: "queue"`).
|
|
7
|
+
* The daemon owns the queue; this is the read-only projection the Queue track
|
|
8
|
+
* renders. Declared above AgentSnapshotPayloadSchema - zod-aot emits schemas in
|
|
9
|
+
* source order, so a forward reference is a build-time ReferenceError.
|
|
10
|
+
*/
|
|
11
|
+
export const QueuedAgentMessagePayloadSchema = z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
/** Leading text of the message, truncated for display. */
|
|
14
|
+
preview: z.string(),
|
|
15
|
+
enqueuedAt: z.string(),
|
|
16
|
+
attachmentCount: z.number().int().nonnegative().optional(),
|
|
17
|
+
/**
|
|
18
|
+
* Who parked the message. Absent (from an older daemon) or "user" is a normal
|
|
19
|
+
* user turn; "system" marks a system-injected entry (a chat mention, a
|
|
20
|
+
* scheduled fire) that the daemon's drain never merges into a user turn - the
|
|
21
|
+
* client must likewise exclude it from "Send all".
|
|
22
|
+
*/
|
|
23
|
+
source: z.enum(["user", "system"]).optional(),
|
|
24
|
+
});
|
|
25
|
+
/** Pull one message back out of an agent's queue (Queue-track edit / send now). */
|
|
26
|
+
export const AgentQueueRemoveRequestMessageSchema = z.object({
|
|
27
|
+
type: z.literal("agent.queue.remove.request"),
|
|
28
|
+
requestId: z.string(),
|
|
29
|
+
/** Accepts full ID, unique prefix, or exact full title (server resolves). */
|
|
30
|
+
agentId: z.string(),
|
|
31
|
+
/** The queued message's `id` from `AgentSnapshotPayload.queuedMessages`. */
|
|
32
|
+
messageId: z.string(),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Move one queued message to a different position in an agent's queue.
|
|
36
|
+
*
|
|
37
|
+
* Order is what the queue means, so this is the edit that changes the next
|
|
38
|
+
* turn's content without changing the queue's membership. The daemon resolves
|
|
39
|
+
* `messageId` fresh and clamps `toIndex`, so a client acting on a snapshot that
|
|
40
|
+
* is one drain stale reorders what is actually there or reports `moved: false`.
|
|
41
|
+
* COMPAT(steerQueueReorder): added in v0.6.9, drop the gate when floor >= v0.6.9.
|
|
42
|
+
*/
|
|
43
|
+
export const AgentQueueReorderRequestMessageSchema = z.object({
|
|
44
|
+
type: z.literal("agent.queue.reorder.request"),
|
|
45
|
+
requestId: z.string(),
|
|
46
|
+
/** Accepts full ID, unique prefix, or exact full title (server resolves). */
|
|
47
|
+
agentId: z.string(),
|
|
48
|
+
/** The queued message's `id` from `AgentSnapshotPayload.queuedMessages`. */
|
|
49
|
+
messageId: z.string(),
|
|
50
|
+
/** Zero-based destination, clamped to the queue's current length. */
|
|
51
|
+
toIndex: z.number().int().nonnegative(),
|
|
52
|
+
});
|
|
53
|
+
/** Drop every message queued behind an agent's current turn. */
|
|
54
|
+
export const AgentQueueClearRequestMessageSchema = z.object({
|
|
55
|
+
type: z.literal("agent.queue.clear.request"),
|
|
56
|
+
requestId: z.string(),
|
|
57
|
+
/** Accepts full ID, unique prefix, or exact full title (server resolves). */
|
|
58
|
+
agentId: z.string(),
|
|
59
|
+
});
|
|
60
|
+
export const AgentQueueRemoveResponseMessageSchema = z.object({
|
|
61
|
+
type: z.literal("agent.queue.remove.response"),
|
|
62
|
+
payload: z.object({
|
|
63
|
+
requestId: z.string(),
|
|
64
|
+
agentId: z.string(),
|
|
65
|
+
/**
|
|
66
|
+
* The removed message's text, handed back so the composer can put it back
|
|
67
|
+
* in the box for editing or re-send it right away. Null when the id was
|
|
68
|
+
* already gone - the turn drained it while the tap was in flight.
|
|
69
|
+
* Attachments are not echoed: the client that queued the message keeps its
|
|
70
|
+
* own local copy keyed by `id` (see the composer's queued-attachment
|
|
71
|
+
* sidecar), and a client that never queued it has nothing to restore.
|
|
72
|
+
*/
|
|
73
|
+
removed: z
|
|
74
|
+
.object({
|
|
75
|
+
id: z.string(),
|
|
76
|
+
text: z.string(),
|
|
77
|
+
})
|
|
78
|
+
.nullable(),
|
|
79
|
+
error: z.string().nullable(),
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
export const AgentQueueReorderResponseMessageSchema = z.object({
|
|
83
|
+
type: z.literal("agent.queue.reorder.response"),
|
|
84
|
+
payload: z.object({
|
|
85
|
+
requestId: z.string(),
|
|
86
|
+
agentId: z.string(),
|
|
87
|
+
/**
|
|
88
|
+
* False when the id was already gone (the turn drained it while the tap was
|
|
89
|
+
* in flight) or the entry was already at that position. The authoritative
|
|
90
|
+
* order arrives on the agent snapshot either way, so a client only needs
|
|
91
|
+
* this to decide whether to surface an error.
|
|
92
|
+
*/
|
|
93
|
+
moved: z.boolean(),
|
|
94
|
+
error: z.string().nullable(),
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
export const AgentQueueClearResponseMessageSchema = z.object({
|
|
98
|
+
type: z.literal("agent.queue.clear.response"),
|
|
99
|
+
payload: z.object({
|
|
100
|
+
requestId: z.string(),
|
|
101
|
+
agentId: z.string(),
|
|
102
|
+
clearedCount: z.number().int().nonnegative(),
|
|
103
|
+
error: z.string().nullable(),
|
|
104
|
+
}),
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=agent-queue.js.map
|
package/dist/agent-types.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ export type ModelTier = "deep" | "standard" | "fast";
|
|
|
77
77
|
export interface AgentModelDefinition {
|
|
78
78
|
provider: AgentProvider;
|
|
79
79
|
id: string;
|
|
80
|
+
aliases?: string[];
|
|
81
|
+
isSelectable?: boolean;
|
|
80
82
|
label: string;
|
|
81
83
|
description?: string;
|
|
82
84
|
/** Catalog-owned model-family identity, currently emitted by Otto Brain only. */
|
|
@@ -372,6 +374,13 @@ export interface CompactionTimelineItem {
|
|
|
372
374
|
preTokens?: number;
|
|
373
375
|
postTokens?: number;
|
|
374
376
|
}
|
|
377
|
+
export interface AgentTaskItem {
|
|
378
|
+
text: string;
|
|
379
|
+
completed: boolean;
|
|
380
|
+
id?: string;
|
|
381
|
+
status?: "pending" | "in_progress" | "completed";
|
|
382
|
+
activeForm?: string;
|
|
383
|
+
}
|
|
375
384
|
export type AgentTimelineItem = {
|
|
376
385
|
type: "user_message";
|
|
377
386
|
text: string;
|
|
@@ -386,10 +395,7 @@ export type AgentTimelineItem = {
|
|
|
386
395
|
text: string;
|
|
387
396
|
} | ToolCallTimelineItem | {
|
|
388
397
|
type: "todo";
|
|
389
|
-
items:
|
|
390
|
-
text: string;
|
|
391
|
-
completed: boolean;
|
|
392
|
-
}[];
|
|
398
|
+
items: AgentTaskItem[];
|
|
393
399
|
} | {
|
|
394
400
|
type: "error";
|
|
395
401
|
message: string;
|
|
@@ -581,6 +587,18 @@ export interface AgentRunResult {
|
|
|
581
587
|
export declare const WORKSPACE_ACCESS_LEVELS: readonly ["none", "read", "write"];
|
|
582
588
|
export type WorkspaceAccess = (typeof WORKSPACE_ACCESS_LEVELS)[number];
|
|
583
589
|
export declare function isWorkspaceAccess(value: unknown): value is WorkspaceAccess;
|
|
590
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
591
|
+
[key: string]: JsonValue;
|
|
592
|
+
};
|
|
593
|
+
export type ProviderOptions = Record<string, JsonValue>;
|
|
594
|
+
export interface McpToolRef {
|
|
595
|
+
kind: "mcp";
|
|
596
|
+
server: string;
|
|
597
|
+
tool: string;
|
|
598
|
+
}
|
|
599
|
+
export interface ToolPolicy {
|
|
600
|
+
preapproved: McpToolRef[];
|
|
601
|
+
}
|
|
584
602
|
export interface AgentSessionConfig {
|
|
585
603
|
provider: AgentProvider;
|
|
586
604
|
cwd: string;
|
|
@@ -609,6 +627,8 @@ export interface AgentSessionConfig {
|
|
|
609
627
|
codex?: AgentMetadata;
|
|
610
628
|
claude?: AgentMetadata;
|
|
611
629
|
};
|
|
630
|
+
providerOptions?: ProviderOptions;
|
|
631
|
+
toolPolicy?: ToolPolicy;
|
|
612
632
|
mcpServers?: Record<string, McpServerConfig>;
|
|
613
633
|
/**
|
|
614
634
|
* Internal agents are hidden from listings and don't trigger notifications.
|
|
@@ -3,6 +3,10 @@ import { TerminalStateSchema } from "../messages.js";
|
|
|
3
3
|
export declare const TerminalStreamResizeSchema: z.ZodObject<{
|
|
4
4
|
rows: z.ZodNumber;
|
|
5
5
|
cols: z.ZodNumber;
|
|
6
|
+
intent: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
claim: "claim";
|
|
8
|
+
update: "update";
|
|
9
|
+
}>>;
|
|
6
10
|
}, z.core.$strip>;
|
|
7
11
|
export declare const TerminalStreamOpcode: {
|
|
8
12
|
readonly Output: 1;
|
|
@@ -3,6 +3,7 @@ import { TerminalStateSchema } from "../messages.js";
|
|
|
3
3
|
export const TerminalStreamResizeSchema = z.object({
|
|
4
4
|
rows: z.number().int().positive(),
|
|
5
5
|
cols: z.number().int().positive(),
|
|
6
|
+
intent: z.enum(["claim", "update"]).optional(),
|
|
6
7
|
});
|
|
7
8
|
export const TerminalStreamOpcode = {
|
|
8
9
|
Output: 0x01,
|