@otto-code/protocol 0.8.19 → 0.9.2
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 +22 -0
- package/dist/agent-labels.js +42 -1
- package/dist/agent-profiles.d.ts +1 -1
- package/dist/agent-profiles.js +3 -3
- package/dist/agent-rate-limit.d.ts +13 -0
- package/dist/agent-rate-limit.js +18 -0
- package/dist/agent-types.d.ts +6 -0
- package/dist/architectural-views/rpc-schemas.d.ts +465 -0
- package/dist/architectural-views/rpc-schemas.js +205 -0
- package/dist/artifacts/rpc-schemas.d.ts +360 -2
- package/dist/artifacts/rpc-schemas.js +75 -1
- package/dist/artifacts/types.d.ts +71 -0
- package/dist/artifacts/types.js +27 -0
- package/dist/binary-frames/terminal.d.ts +1 -1
- package/dist/brain.d.ts +3 -3
- package/dist/browser-automation/capabilities.d.ts +1 -1
- package/dist/browser-automation/rpc-schemas.d.ts +16 -16
- package/dist/code-intelligence.d.ts +5 -5
- package/dist/daemon-config.d.ts +66 -0
- package/dist/daemon-config.js +76 -3
- package/dist/file-operations.d.ts +1 -1
- package/dist/generated/validation/ws-outbound.aot.js +81113 -69135
- package/dist/loop/rpc-schemas.d.ts +6 -6
- package/dist/messages.d.ts +11477 -1097
- package/dist/messages.js +633 -117
- package/dist/model-preferences.d.ts +26 -0
- package/dist/model-preferences.js +47 -0
- package/dist/model-tiers.js +2 -0
- package/dist/personality-schemas.d.ts +4 -4
- package/dist/project-knowledge.d.ts +38 -16
- package/dist/project-knowledge.js +17 -1
- package/dist/provider-config.js +1 -1
- package/dist/provider-icon-names.js +1 -0
- package/dist/schedule/rpc-schemas.d.ts +92 -12
- package/dist/schedule/rpc-schemas.js +2 -0
- package/dist/schedule/types.d.ts +47 -3
- package/dist/schedule/types.js +22 -0
- package/dist/search/text-match.d.ts +16 -0
- package/dist/search/text-match.js +31 -2
- package/dist/suggested-tasks.d.ts +7 -3
- package/dist/suggested-tasks.js +2 -0
- package/dist/validation/ws-outbound-schema-metadata.d.ts +2348 -111
- package/dist/websocket-control.d.ts +39 -0
- package/dist/websocket-control.js +36 -0
- package/dist/workflow.d.ts +3060 -0
- package/dist/{orchestration.js → workflow.js} +461 -29
- package/dist/workspace-labels.d.ts +9 -0
- package/dist/workspace-labels.js +19 -0
- package/package.json +1 -1
- package/dist/orchestration.d.ts +0 -1148
package/dist/schedule/types.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ export declare const ScheduleTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
46
46
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
47
47
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"workflow">;
|
|
51
|
+
definitionId: z.ZodString;
|
|
52
|
+
projectRoot: z.ZodString;
|
|
49
53
|
}, z.core.$strip>], "type">;
|
|
50
54
|
export type ScheduleTarget = z.infer<typeof ScheduleTargetSchema>;
|
|
51
55
|
export declare const ScheduleRunSchema: z.ZodObject<{
|
|
@@ -90,7 +94,19 @@ export declare const ScheduleRunSchema: z.ZodObject<{
|
|
|
90
94
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
91
95
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
92
96
|
}, z.core.$strip>;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"workflow">;
|
|
99
|
+
definitionId: z.ZodString;
|
|
100
|
+
projectRoot: z.ZodString;
|
|
93
101
|
}, z.core.$strip>], "type">>;
|
|
102
|
+
workflow: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
definitionId: z.ZodString;
|
|
104
|
+
title: z.ZodString;
|
|
105
|
+
kind: z.ZodString;
|
|
106
|
+
projectRoot: z.ZodString;
|
|
107
|
+
fingerprint: z.ZodString;
|
|
108
|
+
runId: z.ZodString;
|
|
109
|
+
}, z.core.$strip>>;
|
|
94
110
|
agentId: z.ZodNullable<z.ZodGUID>;
|
|
95
111
|
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
112
|
personalityName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -144,6 +160,10 @@ export declare const StoredScheduleSchema: z.ZodObject<{
|
|
|
144
160
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
145
161
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
146
162
|
}, z.core.$strip>;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"workflow">;
|
|
165
|
+
definitionId: z.ZodString;
|
|
166
|
+
projectRoot: z.ZodString;
|
|
147
167
|
}, z.core.$strip>], "type">;
|
|
148
168
|
status: z.ZodEnum<{
|
|
149
169
|
completed: "completed";
|
|
@@ -207,7 +227,19 @@ export declare const StoredScheduleSchema: z.ZodObject<{
|
|
|
207
227
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
208
228
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
209
229
|
}, z.core.$strip>;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<"workflow">;
|
|
232
|
+
definitionId: z.ZodString;
|
|
233
|
+
projectRoot: z.ZodString;
|
|
210
234
|
}, z.core.$strip>], "type">>;
|
|
235
|
+
workflow: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
definitionId: z.ZodString;
|
|
237
|
+
title: z.ZodString;
|
|
238
|
+
kind: z.ZodString;
|
|
239
|
+
projectRoot: z.ZodString;
|
|
240
|
+
fingerprint: z.ZodString;
|
|
241
|
+
runId: z.ZodString;
|
|
242
|
+
}, z.core.$strip>>;
|
|
211
243
|
agentId: z.ZodNullable<z.ZodGUID>;
|
|
212
244
|
workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
245
|
personalityName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -221,14 +253,14 @@ export type StoredSchedule = z.infer<typeof StoredScheduleSchema>;
|
|
|
221
253
|
export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
222
254
|
prompt: z.ZodString;
|
|
223
255
|
name: z.ZodNullable<z.ZodString>;
|
|
224
|
-
id: z.ZodString;
|
|
225
|
-
createdAt: z.ZodString;
|
|
226
|
-
updatedAt: z.ZodString;
|
|
227
256
|
status: z.ZodEnum<{
|
|
228
257
|
completed: "completed";
|
|
229
258
|
active: "active";
|
|
230
259
|
paused: "paused";
|
|
231
260
|
}>;
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
createdAt: z.ZodString;
|
|
263
|
+
updatedAt: z.ZodString;
|
|
232
264
|
expiresAt: z.ZodNullable<z.ZodString>;
|
|
233
265
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
234
266
|
type: z.ZodLiteral<"agent">;
|
|
@@ -262,6 +294,10 @@ export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
|
262
294
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
263
295
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
264
296
|
}, z.core.$strip>;
|
|
297
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
298
|
+
type: z.ZodLiteral<"workflow">;
|
|
299
|
+
definitionId: z.ZodString;
|
|
300
|
+
projectRoot: z.ZodString;
|
|
265
301
|
}, z.core.$strip>], "type">;
|
|
266
302
|
cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
267
303
|
type: z.ZodLiteral<"every">;
|
|
@@ -318,5 +354,13 @@ export interface UpdateScheduleInput {
|
|
|
318
354
|
export interface ScheduleExecutionResult {
|
|
319
355
|
agentId: string | null;
|
|
320
356
|
output: string | null;
|
|
357
|
+
workflow?: {
|
|
358
|
+
definitionId: string;
|
|
359
|
+
title: string;
|
|
360
|
+
kind: string;
|
|
361
|
+
projectRoot: string;
|
|
362
|
+
fingerprint: string;
|
|
363
|
+
runId: string;
|
|
364
|
+
};
|
|
321
365
|
}
|
|
322
366
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/schedule/types.js
CHANGED
|
@@ -61,6 +61,15 @@ export const ScheduleTargetSchema = z.discriminatedUnion("type", [
|
|
|
61
61
|
mcpServers: z.record(z.string(), z.unknown()).optional(),
|
|
62
62
|
}),
|
|
63
63
|
}),
|
|
64
|
+
// A schedule names a durable saved Workflow definition, never a Workflow run
|
|
65
|
+
// and never a reconstructed prompt. `projectRoot` is the authority boundary:
|
|
66
|
+
// the daemon resolves the selected project's Workflow store immediately
|
|
67
|
+
// before launch and refuses a definition from any other project or host.
|
|
68
|
+
z.object({
|
|
69
|
+
type: z.literal("workflow"),
|
|
70
|
+
definitionId: z.string().trim().min(1),
|
|
71
|
+
projectRoot: z.string().trim().min(1),
|
|
72
|
+
}),
|
|
64
73
|
]);
|
|
65
74
|
export const ScheduleRunSchema = z.object({
|
|
66
75
|
id: z.string(),
|
|
@@ -73,6 +82,19 @@ export const ScheduleRunSchema = z.object({
|
|
|
73
82
|
// future Workflow/artifact target adapters one compatibility-safe audit slot.
|
|
74
83
|
// Optional because persisted runs before v0.9 do not carry it.
|
|
75
84
|
target: ScheduleTargetSchema.optional(),
|
|
85
|
+
// Immutable result of resolving a saved Workflow target at fire time. The
|
|
86
|
+
// definition can change later; this record is the audit of what actually
|
|
87
|
+
// launched. Optional keeps historical agent schedule runs readable.
|
|
88
|
+
workflow: z
|
|
89
|
+
.object({
|
|
90
|
+
definitionId: z.string().min(1),
|
|
91
|
+
title: z.string().min(1),
|
|
92
|
+
kind: z.string().min(1),
|
|
93
|
+
projectRoot: z.string().min(1),
|
|
94
|
+
fingerprint: z.string().min(1),
|
|
95
|
+
runId: z.string().min(1),
|
|
96
|
+
})
|
|
97
|
+
.optional(),
|
|
76
98
|
agentId: z.guid().nullable(),
|
|
77
99
|
workspaceId: z.string().nullable().optional(),
|
|
78
100
|
// Who actually executed this run - the resolved personality (if any),
|
|
@@ -15,6 +15,14 @@ export interface MatchScore {
|
|
|
15
15
|
export interface MatchOptions {
|
|
16
16
|
/** Omit or pass null to match exactly. `fuzzyPolicyForToken` picks a policy. */
|
|
17
17
|
fuzzy?: FuzzyPolicy | null;
|
|
18
|
+
/**
|
|
19
|
+
* Match characters that appear in order but not adjacently, so `pasbab` finds
|
|
20
|
+
* `otto-babysit`. Defaults to on. Turn it off where a near miss has to read as
|
|
21
|
+
* no match at all: it widens far enough that most typos hit something, and a
|
|
22
|
+
* list that preselects its first row would then act on that row when the user
|
|
23
|
+
* presses Enter expecting nothing to happen.
|
|
24
|
+
*/
|
|
25
|
+
subsequence?: boolean;
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* How much a typo in one query token is forgiven. Short tokens get
|
|
@@ -28,6 +36,8 @@ export interface FuzzyPolicy {
|
|
|
28
36
|
}
|
|
29
37
|
export declare function fuzzyPolicyForToken(token: string): FuzzyPolicy | null;
|
|
30
38
|
export declare function scoreMatch(query: string, text: string, options?: MatchOptions): MatchScore | null;
|
|
39
|
+
/** Match a query against a complete displayed path, including its separators. */
|
|
40
|
+
export declare function scorePathMatch(query: string, path: string): MatchScore | null;
|
|
31
41
|
export interface MatchRange {
|
|
32
42
|
start: number;
|
|
33
43
|
length: number;
|
|
@@ -50,6 +60,12 @@ export interface TextFieldsOptions {
|
|
|
50
60
|
* query mixes long words that can absorb an edit with short ones that cannot.
|
|
51
61
|
*/
|
|
52
62
|
typoTolerant?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* See `MatchOptions.subsequence`. Applied per token, so turning it off means
|
|
65
|
+
* every token has to appear as a run of adjacent characters in some field —
|
|
66
|
+
* `lab des` still matches "Label as Design", `labdes` no longer does.
|
|
67
|
+
*/
|
|
68
|
+
subsequence?: boolean;
|
|
53
69
|
}
|
|
54
70
|
export declare function scoreTextFields(query: string, fields: string[], options?: TextFieldsOptions): MatchScore | null;
|
|
55
71
|
//# sourceMappingURL=text-match.d.ts.map
|
|
@@ -168,12 +168,41 @@ export function scoreMatch(query, text, options = {}) {
|
|
|
168
168
|
const t = text.toLowerCase();
|
|
169
169
|
if (t === q)
|
|
170
170
|
return { tier: TIER_EXACT, offset: 0 };
|
|
171
|
-
const
|
|
171
|
+
const substring = scoreSubstringMatch(q, t);
|
|
172
|
+
const exact = substring ?? (options.subsequence === false ? null : scoreSubsequenceMatch(q, t));
|
|
172
173
|
if (exact)
|
|
173
174
|
return exact;
|
|
174
175
|
const fuzzy = options.fuzzy;
|
|
175
176
|
return fuzzy ? scoreFuzzyMatch(q, t, fuzzy) : null;
|
|
176
177
|
}
|
|
178
|
+
function compactText(value) {
|
|
179
|
+
let compact = "";
|
|
180
|
+
const offsets = [];
|
|
181
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
182
|
+
if (!/[a-z0-9]/i.test(value[index]))
|
|
183
|
+
continue;
|
|
184
|
+
compact += value[index].toLowerCase();
|
|
185
|
+
offsets.push(index);
|
|
186
|
+
}
|
|
187
|
+
return { value: compact, offsets };
|
|
188
|
+
}
|
|
189
|
+
/** Match a query against a complete displayed path, including its separators. */
|
|
190
|
+
export function scorePathMatch(query, path) {
|
|
191
|
+
const direct = scoreMatch(query, path);
|
|
192
|
+
if (direct)
|
|
193
|
+
return direct;
|
|
194
|
+
const compactQuery = compactText(query);
|
|
195
|
+
const compactPath = compactText(path);
|
|
196
|
+
if (!compactQuery.value || !compactPath.value)
|
|
197
|
+
return null;
|
|
198
|
+
const compactScore = scoreMatch(compactQuery.value, compactPath.value);
|
|
199
|
+
if (!compactScore)
|
|
200
|
+
return null;
|
|
201
|
+
return {
|
|
202
|
+
...compactScore,
|
|
203
|
+
offset: compactPath.offsets[compactScore.offset] ?? compactScore.offset,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
177
206
|
function mergeAdjacentRanges(indices) {
|
|
178
207
|
const ranges = [];
|
|
179
208
|
for (const index of indices) {
|
|
@@ -246,7 +275,7 @@ export function scoreTextFields(query, fields, options = {}) {
|
|
|
246
275
|
const fuzzy = options.typoTolerant ? fuzzyPolicyForToken(token) : null;
|
|
247
276
|
let best = null;
|
|
248
277
|
for (const field of fields) {
|
|
249
|
-
const score = scoreMatch(token, field, { fuzzy });
|
|
278
|
+
const score = scoreMatch(token, field, { fuzzy, subsequence: options.subsequence });
|
|
250
279
|
if (score && (!best || compareMatchScores(score, best) < 0)) {
|
|
251
280
|
best = score;
|
|
252
281
|
}
|
|
@@ -3,9 +3,9 @@ import { z } from "zod";
|
|
|
3
3
|
* Otto suggested-task wire schemas: the tasks.suggested.* start and dismiss RPCs and the suggested-task payloads. Fork-only capability, so it owns its schemas; messages.ts re-exports them.
|
|
4
4
|
*/
|
|
5
5
|
export declare const SuggestedTaskStateSchema: z.ZodEnum<{
|
|
6
|
+
dismissed: "dismissed";
|
|
6
7
|
pending: "pending";
|
|
7
8
|
started: "started";
|
|
8
|
-
dismissed: "dismissed";
|
|
9
9
|
}>;
|
|
10
10
|
export declare const SuggestedTaskInfoSchema: z.ZodObject<{
|
|
11
11
|
taskId: z.ZodString;
|
|
@@ -14,9 +14,9 @@ export declare const SuggestedTaskInfoSchema: z.ZodObject<{
|
|
|
14
14
|
tldr: z.ZodString;
|
|
15
15
|
cwd: z.ZodOptional<z.ZodString>;
|
|
16
16
|
state: z.ZodEnum<{
|
|
17
|
+
dismissed: "dismissed";
|
|
17
18
|
pending: "pending";
|
|
18
19
|
started: "started";
|
|
19
|
-
dismissed: "dismissed";
|
|
20
20
|
}>;
|
|
21
21
|
createdAt: z.ZodString;
|
|
22
22
|
updatedAt: z.ZodString;
|
|
@@ -32,9 +32,9 @@ export declare const SuggestedTasksChangedSchema: z.ZodObject<{
|
|
|
32
32
|
tldr: z.ZodString;
|
|
33
33
|
cwd: z.ZodOptional<z.ZodString>;
|
|
34
34
|
state: z.ZodEnum<{
|
|
35
|
+
dismissed: "dismissed";
|
|
35
36
|
pending: "pending";
|
|
36
37
|
started: "started";
|
|
37
|
-
dismissed: "dismissed";
|
|
38
38
|
}>;
|
|
39
39
|
createdAt: z.ZodString;
|
|
40
40
|
updatedAt: z.ZodString;
|
|
@@ -65,6 +65,10 @@ export declare const TasksSuggestedStartRequestMessageSchema: z.ZodObject<{
|
|
|
65
65
|
subagent: "subagent";
|
|
66
66
|
in_session: "in_session";
|
|
67
67
|
}>;
|
|
68
|
+
launch: z.ZodOptional<z.ZodObject<{
|
|
69
|
+
provider: z.ZodString;
|
|
70
|
+
model: z.ZodString;
|
|
71
|
+
}, z.core.$strip>>;
|
|
68
72
|
requestId: z.ZodString;
|
|
69
73
|
}, z.core.$strip>;
|
|
70
74
|
export declare const TasksSuggestedStartResponseMessageSchema: z.ZodObject<{
|
package/dist/suggested-tasks.js
CHANGED
|
@@ -62,6 +62,8 @@ export const TasksSuggestedStartRequestMessageSchema = z.object({
|
|
|
62
62
|
parentAgentId: z.string(),
|
|
63
63
|
taskIds: z.array(z.string()),
|
|
64
64
|
mode: TasksSuggestedStartModeSchema,
|
|
65
|
+
// Omitted by older clients, which retain the source chat's configuration.
|
|
66
|
+
launch: z.object({ provider: z.string(), model: z.string() }).optional(),
|
|
65
67
|
requestId: z.string(),
|
|
66
68
|
});
|
|
67
69
|
export const TasksSuggestedStartResponseMessageSchema = z.object({
|