@otto-code/protocol 0.8.18 → 0.9.0

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.
Files changed (40) hide show
  1. package/dist/agent-labels.d.ts +13 -0
  2. package/dist/agent-labels.js +26 -1
  3. package/dist/agent-profiles.d.ts +1 -1
  4. package/dist/agent-profiles.js +3 -3
  5. package/dist/architectural-views/rpc-schemas.d.ts +342 -0
  6. package/dist/architectural-views/rpc-schemas.js +171 -0
  7. package/dist/artifacts/rpc-schemas.d.ts +360 -2
  8. package/dist/artifacts/rpc-schemas.js +75 -1
  9. package/dist/artifacts/types.d.ts +71 -0
  10. package/dist/artifacts/types.js +27 -0
  11. package/dist/binary-frames/terminal.d.ts +1 -1
  12. package/dist/daemon-config.d.ts +66 -0
  13. package/dist/daemon-config.js +76 -3
  14. package/dist/generated/validation/ws-outbound.aot.js +70170 -56553
  15. package/dist/git-hosting.d.ts +56 -0
  16. package/dist/git-hosting.js +50 -0
  17. package/dist/kanban.d.ts +4 -0
  18. package/dist/kanban.js +4 -0
  19. package/dist/messages.d.ts +12186 -1217
  20. package/dist/messages.js +642 -33
  21. package/dist/model-tiers.js +2 -0
  22. package/dist/project-knowledge.d.ts +172 -0
  23. package/dist/project-knowledge.js +77 -0
  24. package/dist/provider-config.js +1 -1
  25. package/dist/provider-icon-names.js +1 -0
  26. package/dist/schedule/rpc-schemas.d.ts +212 -0
  27. package/dist/schedule/rpc-schemas.js +2 -0
  28. package/dist/schedule/types.d.ts +110 -0
  29. package/dist/schedule/types.js +27 -0
  30. package/dist/search/text-match.d.ts +16 -0
  31. package/dist/search/text-match.js +31 -2
  32. package/dist/validation/ws-outbound-schema-metadata.d.ts +2481 -104
  33. package/dist/workflow.d.ts +3060 -0
  34. package/dist/{orchestration.js → workflow.js} +461 -29
  35. package/dist/workspace-labels.d.ts +9 -0
  36. package/dist/workspace-labels.js +19 -0
  37. package/package.json +1 -1
  38. package/dist/orchestration.d.ts +0 -1148
  39. package/dist/project-links.d.ts +0 -102
  40. package/dist/project-links.js +0 -62
@@ -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<{
@@ -58,6 +62,51 @@ export declare const ScheduleRunSchema: z.ZodObject<{
58
62
  failed: "failed";
59
63
  succeeded: "succeeded";
60
64
  }>;
65
+ target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
66
+ type: z.ZodLiteral<"agent">;
67
+ agentId: z.ZodGUID;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ type: z.ZodLiteral<"new-agent">;
70
+ config: z.ZodObject<{
71
+ provider: z.ZodString;
72
+ cwd: z.ZodString;
73
+ personality: z.ZodOptional<z.ZodString>;
74
+ agentProfile: z.ZodOptional<z.ZodString>;
75
+ modeId: z.ZodOptional<z.ZodString>;
76
+ model: z.ZodOptional<z.ZodString>;
77
+ thinkingOptionId: z.ZodOptional<z.ZodString>;
78
+ archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
79
+ isolation: z.ZodOptional<z.ZodEnum<{
80
+ worktree: "worktree";
81
+ local: "local";
82
+ }>>;
83
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
85
+ approvalPolicy: z.ZodOptional<z.ZodString>;
86
+ sandboxMode: z.ZodOptional<z.ZodString>;
87
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
88
+ webSearch: z.ZodOptional<z.ZodBoolean>;
89
+ extra: z.ZodOptional<z.ZodObject<{
90
+ codex: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
91
+ claude: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
92
+ }, z.core.$strip>>;
93
+ featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
94
+ systemPrompt: z.ZodOptional<z.ZodString>;
95
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
96
+ }, z.core.$strip>;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ type: z.ZodLiteral<"workflow">;
99
+ definitionId: z.ZodString;
100
+ projectRoot: z.ZodString;
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>>;
61
110
  agentId: z.ZodNullable<z.ZodGUID>;
62
111
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
112
  personalityName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -111,6 +160,10 @@ export declare const StoredScheduleSchema: z.ZodObject<{
111
160
  systemPrompt: z.ZodOptional<z.ZodString>;
112
161
  mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
162
  }, z.core.$strip>;
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ type: z.ZodLiteral<"workflow">;
165
+ definitionId: z.ZodString;
166
+ projectRoot: z.ZodString;
114
167
  }, z.core.$strip>], "type">;
115
168
  status: z.ZodEnum<{
116
169
  completed: "completed";
@@ -142,6 +195,51 @@ export declare const StoredScheduleSchema: z.ZodObject<{
142
195
  failed: "failed";
143
196
  succeeded: "succeeded";
144
197
  }>;
198
+ target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
199
+ type: z.ZodLiteral<"agent">;
200
+ agentId: z.ZodGUID;
201
+ }, z.core.$strip>, z.ZodObject<{
202
+ type: z.ZodLiteral<"new-agent">;
203
+ config: z.ZodObject<{
204
+ provider: z.ZodString;
205
+ cwd: z.ZodString;
206
+ personality: z.ZodOptional<z.ZodString>;
207
+ agentProfile: z.ZodOptional<z.ZodString>;
208
+ modeId: z.ZodOptional<z.ZodString>;
209
+ model: z.ZodOptional<z.ZodString>;
210
+ thinkingOptionId: z.ZodOptional<z.ZodString>;
211
+ archiveOnFinish: z.ZodOptional<z.ZodBoolean>;
212
+ isolation: z.ZodOptional<z.ZodEnum<{
213
+ worktree: "worktree";
214
+ local: "local";
215
+ }>>;
216
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
217
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
218
+ approvalPolicy: z.ZodOptional<z.ZodString>;
219
+ sandboxMode: z.ZodOptional<z.ZodString>;
220
+ networkAccess: z.ZodOptional<z.ZodBoolean>;
221
+ webSearch: z.ZodOptional<z.ZodBoolean>;
222
+ extra: z.ZodOptional<z.ZodObject<{
223
+ codex: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
224
+ claude: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
225
+ }, z.core.$strip>>;
226
+ featureValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
227
+ systemPrompt: z.ZodOptional<z.ZodString>;
228
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
229
+ }, z.core.$strip>;
230
+ }, z.core.$strip>, z.ZodObject<{
231
+ type: z.ZodLiteral<"workflow">;
232
+ definitionId: z.ZodString;
233
+ projectRoot: z.ZodString;
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>>;
145
243
  agentId: z.ZodNullable<z.ZodGUID>;
146
244
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
147
245
  personalityName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -196,6 +294,10 @@ export declare const ScheduleSummarySchema: z.ZodObject<{
196
294
  systemPrompt: z.ZodOptional<z.ZodString>;
197
295
  mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
198
296
  }, z.core.$strip>;
297
+ }, z.core.$strip>, z.ZodObject<{
298
+ type: z.ZodLiteral<"workflow">;
299
+ definitionId: z.ZodString;
300
+ projectRoot: z.ZodString;
199
301
  }, z.core.$strip>], "type">;
200
302
  cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
201
303
  type: z.ZodLiteral<"every">;
@@ -252,5 +354,13 @@ export interface UpdateScheduleInput {
252
354
  export interface ScheduleExecutionResult {
253
355
  agentId: string | null;
254
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
+ };
255
365
  }
256
366
  //# sourceMappingURL=types.d.ts.map
@@ -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(),
@@ -68,6 +77,24 @@ export const ScheduleRunSchema = z.object({
68
77
  startedAt: z.string(),
69
78
  endedAt: z.string().nullable(),
70
79
  status: z.enum(["running", "succeeded", "failed"]),
80
+ // The exact schedule target requested when this run was claimed. Keeping the
81
+ // snapshot on the run means later edits do not rewrite history, and gives
82
+ // future Workflow/artifact target adapters one compatibility-safe audit slot.
83
+ // Optional because persisted runs before v0.9 do not carry it.
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(),
71
98
  agentId: z.guid().nullable(),
72
99
  workspaceId: z.string().nullable().optional(),
73
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 exact = scoreSubstringMatch(q, t) ?? scoreSubsequenceMatch(q, t);
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
  }