@otto-code/protocol 0.5.2 → 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.
@@ -38,6 +38,10 @@ const CLAUDE_MODES = [
38
38
  icon: "ShieldCheck",
39
39
  colorTier: "moderate",
40
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,
41
45
  },
42
46
  {
43
47
  id: "bypassPermissions",
@@ -228,6 +232,19 @@ export function getUnattendedModeId(provider, definitions = [
228
232
  const definition = definitions.find((entry) => entry.id === provider);
229
233
  return definition?.modes.find((mode) => mode.isUnattended)?.id;
230
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
+ }
231
248
  export function getModeVisuals(provider, modeId, definitions) {
232
249
  const definition = definitions.find((entry) => entry.id === provider);
233
250
  const mode = definition?.modes.find((m) => m.id === modeId);
@@ -121,12 +121,12 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
121
121
  schedule: z.ZodNullable<z.ZodObject<{
122
122
  prompt: z.ZodString;
123
123
  name: z.ZodNullable<z.ZodString>;
124
+ id: z.ZodString;
124
125
  status: z.ZodEnum<{
126
+ paused: "paused";
125
127
  completed: "completed";
126
128
  active: "active";
127
- paused: "paused";
128
129
  }>;
129
- id: z.ZodString;
130
130
  createdAt: z.ZodString;
131
131
  updatedAt: z.ZodString;
132
132
  cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -171,8 +171,8 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
171
171
  nextRunAt: z.ZodNullable<z.ZodString>;
172
172
  lastRunAt: z.ZodNullable<z.ZodString>;
173
173
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
174
- succeeded: "succeeded";
175
174
  failed: "failed";
175
+ succeeded: "succeeded";
176
176
  }>>>;
177
177
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
178
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -189,12 +189,12 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
189
189
  schedules: z.ZodArray<z.ZodObject<{
190
190
  prompt: z.ZodString;
191
191
  name: z.ZodNullable<z.ZodString>;
192
+ id: z.ZodString;
192
193
  status: z.ZodEnum<{
194
+ paused: "paused";
193
195
  completed: "completed";
194
196
  active: "active";
195
- paused: "paused";
196
197
  }>;
197
- id: z.ZodString;
198
198
  createdAt: z.ZodString;
199
199
  updatedAt: z.ZodString;
200
200
  cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -239,8 +239,8 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
239
239
  nextRunAt: z.ZodNullable<z.ZodString>;
240
240
  lastRunAt: z.ZodNullable<z.ZodString>;
241
241
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
242
- succeeded: "succeeded";
243
242
  failed: "failed";
243
+ succeeded: "succeeded";
244
244
  }>>>;
245
245
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
246
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -298,17 +298,17 @@ export declare const ScheduleInspectResponseSchema: z.ZodObject<{
298
298
  }, z.core.$strip>;
299
299
  }, z.core.$strip>], "type">;
300
300
  status: z.ZodEnum<{
301
+ paused: "paused";
301
302
  completed: "completed";
302
303
  active: "active";
303
- paused: "paused";
304
304
  }>;
305
305
  createdAt: z.ZodString;
306
306
  updatedAt: z.ZodString;
307
307
  nextRunAt: z.ZodNullable<z.ZodString>;
308
308
  lastRunAt: z.ZodNullable<z.ZodString>;
309
309
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
310
- succeeded: "succeeded";
311
310
  failed: "failed";
311
+ succeeded: "succeeded";
312
312
  }>>>;
313
313
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
314
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -321,8 +321,8 @@ export declare const ScheduleInspectResponseSchema: z.ZodObject<{
321
321
  endedAt: z.ZodNullable<z.ZodString>;
322
322
  status: z.ZodEnum<{
323
323
  running: "running";
324
- succeeded: "succeeded";
325
324
  failed: "failed";
325
+ succeeded: "succeeded";
326
326
  }>;
327
327
  agentId: z.ZodNullable<z.ZodGUID>;
328
328
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -344,8 +344,8 @@ export declare const ScheduleLogsResponseSchema: z.ZodObject<{
344
344
  endedAt: z.ZodNullable<z.ZodString>;
345
345
  status: z.ZodEnum<{
346
346
  running: "running";
347
- succeeded: "succeeded";
348
347
  failed: "failed";
348
+ succeeded: "succeeded";
349
349
  }>;
350
350
  agentId: z.ZodNullable<z.ZodGUID>;
351
351
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -362,12 +362,12 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
362
362
  schedule: z.ZodNullable<z.ZodObject<{
363
363
  prompt: z.ZodString;
364
364
  name: z.ZodNullable<z.ZodString>;
365
+ id: z.ZodString;
365
366
  status: z.ZodEnum<{
367
+ paused: "paused";
366
368
  completed: "completed";
367
369
  active: "active";
368
- paused: "paused";
369
370
  }>;
370
- id: z.ZodString;
371
371
  createdAt: z.ZodString;
372
372
  updatedAt: z.ZodString;
373
373
  cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -412,8 +412,8 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
412
412
  nextRunAt: z.ZodNullable<z.ZodString>;
413
413
  lastRunAt: z.ZodNullable<z.ZodString>;
414
414
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
415
- succeeded: "succeeded";
416
415
  failed: "failed";
416
+ succeeded: "succeeded";
417
417
  }>>>;
418
418
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
419
419
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -430,12 +430,12 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
430
430
  schedule: z.ZodNullable<z.ZodObject<{
431
431
  prompt: z.ZodString;
432
432
  name: z.ZodNullable<z.ZodString>;
433
+ id: z.ZodString;
433
434
  status: z.ZodEnum<{
435
+ paused: "paused";
434
436
  completed: "completed";
435
437
  active: "active";
436
- paused: "paused";
437
438
  }>;
438
- id: z.ZodString;
439
439
  createdAt: z.ZodString;
440
440
  updatedAt: z.ZodString;
441
441
  cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -480,8 +480,8 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
480
480
  nextRunAt: z.ZodNullable<z.ZodString>;
481
481
  lastRunAt: z.ZodNullable<z.ZodString>;
482
482
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
483
- succeeded: "succeeded";
484
483
  failed: "failed";
484
+ succeeded: "succeeded";
485
485
  }>>>;
486
486
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
487
487
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -547,17 +547,17 @@ export declare const ScheduleRunOnceResponseSchema: z.ZodObject<{
547
547
  }, z.core.$strip>;
548
548
  }, z.core.$strip>], "type">;
549
549
  status: z.ZodEnum<{
550
+ paused: "paused";
550
551
  completed: "completed";
551
552
  active: "active";
552
- paused: "paused";
553
553
  }>;
554
554
  createdAt: z.ZodString;
555
555
  updatedAt: z.ZodString;
556
556
  nextRunAt: z.ZodNullable<z.ZodString>;
557
557
  lastRunAt: z.ZodNullable<z.ZodString>;
558
558
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
559
- succeeded: "succeeded";
560
559
  failed: "failed";
560
+ succeeded: "succeeded";
561
561
  }>>>;
562
562
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
563
563
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -570,8 +570,8 @@ export declare const ScheduleRunOnceResponseSchema: z.ZodObject<{
570
570
  endedAt: z.ZodNullable<z.ZodString>;
571
571
  status: z.ZodEnum<{
572
572
  running: "running";
573
- succeeded: "succeeded";
574
573
  failed: "failed";
574
+ succeeded: "succeeded";
575
575
  }>;
576
576
  agentId: z.ZodNullable<z.ZodGUID>;
577
577
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -630,17 +630,17 @@ export declare const ScheduleUpdateResponseSchema: z.ZodObject<{
630
630
  }, z.core.$strip>;
631
631
  }, z.core.$strip>], "type">;
632
632
  status: z.ZodEnum<{
633
+ paused: "paused";
633
634
  completed: "completed";
634
635
  active: "active";
635
- paused: "paused";
636
636
  }>;
637
637
  createdAt: z.ZodString;
638
638
  updatedAt: z.ZodString;
639
639
  nextRunAt: z.ZodNullable<z.ZodString>;
640
640
  lastRunAt: z.ZodNullable<z.ZodString>;
641
641
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
642
- succeeded: "succeeded";
643
642
  failed: "failed";
643
+ succeeded: "succeeded";
644
644
  }>>>;
645
645
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
646
646
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -653,8 +653,8 @@ export declare const ScheduleUpdateResponseSchema: z.ZodObject<{
653
653
  endedAt: z.ZodNullable<z.ZodString>;
654
654
  status: z.ZodEnum<{
655
655
  running: "running";
656
- succeeded: "succeeded";
657
656
  failed: "failed";
657
+ succeeded: "succeeded";
658
658
  }>;
659
659
  agentId: z.ZodNullable<z.ZodGUID>;
660
660
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export declare const ScheduleStatusSchema: z.ZodEnum<{
3
+ paused: "paused";
3
4
  completed: "completed";
4
5
  active: "active";
5
- paused: "paused";
6
6
  }>;
7
7
  export type ScheduleStatus = z.infer<typeof ScheduleStatusSchema>;
8
8
  export declare const ScheduleCadenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -53,8 +53,8 @@ export declare const ScheduleRunSchema: z.ZodObject<{
53
53
  endedAt: z.ZodNullable<z.ZodString>;
54
54
  status: z.ZodEnum<{
55
55
  running: "running";
56
- succeeded: "succeeded";
57
56
  failed: "failed";
57
+ succeeded: "succeeded";
58
58
  }>;
59
59
  agentId: z.ZodNullable<z.ZodGUID>;
60
60
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -106,17 +106,17 @@ export declare const StoredScheduleSchema: z.ZodObject<{
106
106
  }, z.core.$strip>;
107
107
  }, z.core.$strip>], "type">;
108
108
  status: z.ZodEnum<{
109
+ paused: "paused";
109
110
  completed: "completed";
110
111
  active: "active";
111
- paused: "paused";
112
112
  }>;
113
113
  createdAt: z.ZodString;
114
114
  updatedAt: z.ZodString;
115
115
  nextRunAt: z.ZodNullable<z.ZodString>;
116
116
  lastRunAt: z.ZodNullable<z.ZodString>;
117
117
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
118
- succeeded: "succeeded";
119
118
  failed: "failed";
119
+ succeeded: "succeeded";
120
120
  }>>>;
121
121
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
122
  pausedAt: z.ZodNullable<z.ZodString>;
@@ -129,8 +129,8 @@ export declare const StoredScheduleSchema: z.ZodObject<{
129
129
  endedAt: z.ZodNullable<z.ZodString>;
130
130
  status: z.ZodEnum<{
131
131
  running: "running";
132
- succeeded: "succeeded";
133
132
  failed: "failed";
133
+ succeeded: "succeeded";
134
134
  }>;
135
135
  agentId: z.ZodNullable<z.ZodGUID>;
136
136
  workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -142,12 +142,12 @@ export type StoredSchedule = z.infer<typeof StoredScheduleSchema>;
142
142
  export declare const ScheduleSummarySchema: z.ZodObject<{
143
143
  prompt: z.ZodString;
144
144
  name: z.ZodNullable<z.ZodString>;
145
+ id: z.ZodString;
145
146
  status: z.ZodEnum<{
147
+ paused: "paused";
146
148
  completed: "completed";
147
149
  active: "active";
148
- paused: "paused";
149
150
  }>;
150
- id: z.ZodString;
151
151
  createdAt: z.ZodString;
152
152
  updatedAt: z.ZodString;
153
153
  cadence: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -192,8 +192,8 @@ export declare const ScheduleSummarySchema: z.ZodObject<{
192
192
  nextRunAt: z.ZodNullable<z.ZodString>;
193
193
  lastRunAt: z.ZodNullable<z.ZodString>;
194
194
  lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
195
- succeeded: "succeeded";
196
195
  failed: "failed";
196
+ succeeded: "succeeded";
197
197
  }>>>;
198
198
  lastRunError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
199
199
  pausedAt: z.ZodNullable<z.ZodString>;