@wjarka/cezarion 0.16.0-dev.1505 → 0.16.0-pr929.1508

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 (90) hide show
  1. package/dist/ci-wait/controller.d.ts +26 -26
  2. package/dist/contract/index.d.ts +2 -0
  3. package/dist/contract/index.js +103 -0
  4. package/dist/contract/live-coordination.d.ts +158 -0
  5. package/dist/contract/live.d.ts +126 -0
  6. package/dist/contract/preview.d.ts +2 -0
  7. package/dist/contract/projects.d.ts +17 -0
  8. package/dist/delegation/routes.d.ts +50 -50
  9. package/dist/delegation/transport.d.ts +13 -13
  10. package/dist/preview/host.d.ts +4 -1
  11. package/dist/preview/host.js +8 -2
  12. package/dist/preview/host.js.map +1 -1
  13. package/dist/runs/history-stream.d.ts +2 -0
  14. package/dist/runs/history-stream.js +62 -0
  15. package/dist/runs/history-stream.js.map +1 -0
  16. package/dist/runs/store.js +2 -0
  17. package/dist/runs/store.js.map +1 -1
  18. package/dist/server/checkout-progress.d.ts +10 -0
  19. package/dist/server/checkout-progress.js +27 -0
  20. package/dist/server/checkout-progress.js.map +1 -0
  21. package/dist/server/live-routes.d.ts +68 -0
  22. package/dist/server/live-routes.js +146 -0
  23. package/dist/server/live-routes.js.map +1 -0
  24. package/dist/server/run-event-feed.d.ts +12 -0
  25. package/dist/server/run-event-feed.js +141 -0
  26. package/dist/server/run-event-feed.js.map +1 -0
  27. package/dist/server/server.d.ts +92 -0
  28. package/dist/server/server.js +52 -51
  29. package/dist/server/server.js.map +1 -1
  30. package/package.json +3 -3
  31. package/scripts/mock-codex-app-server.mjs +2 -1
  32. package/web/dist/assets/{agent-accounts-CDhVzwnd.js → agent-accounts-HmAuTFGK.js} +1 -1
  33. package/web/dist/assets/alert-dialog-DaUp2Meg.js +1 -0
  34. package/web/dist/assets/button-CHH9BZRo.js +43 -0
  35. package/web/dist/assets/cez-idle-CUCH2qDt.js +1 -0
  36. package/web/dist/assets/compare-variants-CKh2OXgP.js +1 -0
  37. package/web/dist/assets/diff-CjmCIvnH.js +3 -0
  38. package/web/dist/assets/{diff-controls-BWAkxipD.js → diff-controls-gcx-cPzO.js} +1 -1
  39. package/web/dist/assets/{diff-view-DWh9FnNY.js → diff-view-BMWZ9m3B.js} +1 -1
  40. package/web/dist/assets/{dropdown-menu-Ddqp8eUw.js → dropdown-menu-DX9D7vad.js} +1 -1
  41. package/web/dist/assets/{format-DTNjugyE.js → format-CQvhD-mf.js} +1 -1
  42. package/web/dist/assets/{git-toolbar-B4rwm9Lr.js → git-toolbar-CPfKi7ft.js} +1 -1
  43. package/web/dist/assets/github-DpQEVtz0.js +1 -0
  44. package/web/dist/assets/{image-preview-Dy5i96RC.js → image-preview-DySOT9De.js} +1 -1
  45. package/web/dist/assets/index-CsxtEQn-.js +13 -0
  46. package/web/dist/assets/live-protocol-2a58DLw3.js +1 -0
  47. package/web/dist/assets/live-worker-BRuglz5K.ts +33 -0
  48. package/web/dist/assets/{nav-row-styles-Ci-Ke7wG.js → nav-row-styles-Dj7dS2DN.js} +1 -1
  49. package/web/dist/assets/{popover-BjjDOSGv.js → popover-Dzeqpu-Q.js} +1 -1
  50. package/web/dist/assets/preview-pane-connected-DE4464pj.js +3 -0
  51. package/web/dist/assets/{preview-state-D8-YBJ6m.js → preview-state-Dm0om-n8.js} +1 -1
  52. package/web/dist/assets/prompt-templates-BwsrSzyb.js +15 -0
  53. package/web/dist/assets/repo-git-CW8FqwH1.js +1 -0
  54. package/web/dist/assets/{run-diff-1ZzFrOx1.js → run-diff-wDDz00K4.js} +3 -3
  55. package/web/dist/assets/run-header-KtmymzWk.js +1 -0
  56. package/web/dist/assets/skills-CC3R9n7n.js +1 -0
  57. package/web/dist/assets/src-3yLqe_dy.js +64 -0
  58. package/web/dist/assets/{status-dot-DwFmt_Jg.js → status-dot-B0alAY-O.js} +1 -1
  59. package/web/dist/assets/{tab-link-COpvArgR.js → tab-link-C31t1hzc.js} +1 -1
  60. package/web/dist/assets/{task-changes-CY-mi-mC.js → task-changes-C30vU5rE.js} +1 -1
  61. package/web/dist/assets/{task-commits-EvLi8T4a.js → task-commits-CQVaPg-g.js} +1 -1
  62. package/web/dist/assets/{task-files-BR3d8X2U.js → task-files-DI_V6SCj.js} +2 -2
  63. package/web/dist/assets/task-github-item-DNyeK21f.js +1 -0
  64. package/web/dist/assets/task-thread-D_ZlipUo.js +7 -0
  65. package/web/dist/assets/textarea-zSpt3L4b.js +1 -0
  66. package/web/dist/assets/thread-state-IjqWds4P.js +4 -0
  67. package/web/dist/assets/use-hand-to-agent-state-BRjnwznf.js +1 -0
  68. package/web/dist/assets/utils-D8ErgBN1.js +1 -0
  69. package/web/dist/assets/{workflows-BTE-5RwX.js → workflows-BBtlSsLQ.js} +4 -4
  70. package/web/dist/assets/zoomable-image-otpapgFT.js +1 -0
  71. package/web/dist/index.html +16 -13
  72. package/web/dist/live-worker.js +4 -0
  73. package/web/dist/assets/alert-dialog-A0-kEfJK.js +0 -1
  74. package/web/dist/assets/button-Jj1Itx83.js +0 -43
  75. package/web/dist/assets/compare-variants-aor2j4bO.js +0 -1
  76. package/web/dist/assets/diff-CDL5SDNO.js +0 -3
  77. package/web/dist/assets/github-DgMD1v4U.js +0 -1
  78. package/web/dist/assets/index-BfAearY6.js +0 -13
  79. package/web/dist/assets/preview-pane-connected-Nv_nhV63.js +0 -3
  80. package/web/dist/assets/prompt-templates-DFeXUVOZ.js +0 -15
  81. package/web/dist/assets/repo-git-DcWh5s_b.js +0 -1
  82. package/web/dist/assets/run-header-CPoYzbAy.js +0 -1
  83. package/web/dist/assets/skills-CnLazLgF.js +0 -1
  84. package/web/dist/assets/task-github-item-BVsPg9RI.js +0 -1
  85. package/web/dist/assets/task-thread-DQCsu_v8.js +0 -7
  86. package/web/dist/assets/textarea-BbNV5Uo2.js +0 -1
  87. package/web/dist/assets/thread-state-DTkIvHsU.js +0 -4
  88. package/web/dist/assets/use-hand-to-agent-state-DT-QBsPC.js +0 -1
  89. package/web/dist/assets/utils-POVs3UKu.js +0 -64
  90. package/web/dist/assets/zoomable-image-cL1VgYK4.js +0 -1
@@ -50,17 +50,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
50
50
  "/api/v1/tools/ci-wait": {
51
51
  $post: {
52
52
  output: {
53
- prUrl: string;
54
- repository: string;
55
- prNumber: number;
56
- headSha: string;
57
- waitId: string;
58
- registeredAt: string;
59
- deadline: string;
60
- phase: "delivered" | "parked" | "registered" | "wake-pending" | "withdrawn";
53
+ code: 'capability_revoked';
54
+ message: string;
61
55
  };
62
56
  outputFormat: "json";
63
- status: import("hono/utils/http-status").ContentfulStatusCode;
57
+ status: 401;
64
58
  input: {
65
59
  json: {
66
60
  pr: string;
@@ -69,11 +63,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
69
63
  };
70
64
  } | {
71
65
  output: {
72
- code: 'capability_revoked';
66
+ code: "authentication" | "capability_revoked" | "capacity" | "command_failed" | "finish_requested" | "generation_mismatch" | "gh_missing" | "human_ask_pending" | "human_ask_unanswered" | "inaccessible_pr" | "invalid_request" | "malformed_data" | "manager_disposed" | "output_limit" | "persistence" | "query_timeout" | "registration_aborted" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "turn_changed" | "unauthorized" | "unavailable" | "unsupported_host" | "wait_conflict" | "worker_execution_stopped" | "worker_wait_pending";
73
67
  message: string;
74
68
  };
75
69
  outputFormat: "json";
76
- status: 401;
70
+ status: 503;
77
71
  input: {
78
72
  json: {
79
73
  pr: string;
@@ -82,11 +76,17 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
82
76
  };
83
77
  } | {
84
78
  output: {
85
- code: "authentication" | "capability_revoked" | "capacity" | "command_failed" | "finish_requested" | "generation_mismatch" | "gh_missing" | "human_ask_pending" | "human_ask_unanswered" | "inaccessible_pr" | "invalid_request" | "malformed_data" | "manager_disposed" | "output_limit" | "persistence" | "query_timeout" | "registration_aborted" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "turn_changed" | "unauthorized" | "unavailable" | "unsupported_host" | "wait_conflict" | "worker_execution_stopped" | "worker_wait_pending";
86
- message: string;
79
+ prUrl: string;
80
+ repository: string;
81
+ prNumber: number;
82
+ headSha: string;
83
+ waitId: string;
84
+ registeredAt: string;
85
+ deadline: string;
86
+ phase: "delivered" | "parked" | "registered" | "wake-pending" | "withdrawn";
87
87
  };
88
88
  outputFormat: "json";
89
- status: 503;
89
+ status: import("hono/utils/http-status").ContentfulStatusCode;
90
90
  input: {
91
91
  json: {
92
92
  pr: string;
@@ -99,13 +99,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
99
99
  "/api/v1/tools/preview-stop": {
100
100
  $post: {
101
101
  output: {
102
- ok: boolean;
103
- code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
102
+ code: 'capability_revoked';
104
103
  message: string;
105
- hint: string;
106
104
  };
107
105
  outputFormat: "json";
108
- status: import("hono/utils/http-status").ContentfulStatusCode;
106
+ status: 401;
109
107
  input: {
110
108
  json: {
111
109
  port: number;
@@ -114,11 +112,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
114
112
  };
115
113
  } | {
116
114
  output: {
117
- code: 'capability_revoked';
115
+ ok: boolean;
116
+ code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
118
117
  message: string;
118
+ hint: string;
119
119
  };
120
120
  outputFormat: "json";
121
- status: 401;
121
+ status: import("hono/utils/http-status").ContentfulStatusCode;
122
122
  input: {
123
123
  json: {
124
124
  port: number;
@@ -131,13 +131,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
131
131
  "/api/v1/tools/preview-serve": {
132
132
  $post: {
133
133
  output: {
134
- ok: boolean;
135
- code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
134
+ code: 'capability_revoked';
136
135
  message: string;
137
- hint: string;
138
136
  };
139
137
  outputFormat: "json";
140
- status: import("hono/utils/http-status").ContentfulStatusCode;
138
+ status: 401;
141
139
  input: {
142
140
  json: {
143
141
  command: string;
@@ -149,11 +147,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
149
147
  };
150
148
  } | {
151
149
  output: {
152
- code: 'capability_revoked';
150
+ ok: boolean;
151
+ code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
153
152
  message: string;
153
+ hint: string;
154
154
  };
155
155
  outputFormat: "json";
156
- status: 401;
156
+ status: import("hono/utils/http-status").ContentfulStatusCode;
157
157
  input: {
158
158
  json: {
159
159
  command: string;
@@ -26,3 +26,5 @@ export * from './conversations.ts';
26
26
  export * from './ci-wait.ts';
27
27
  export * from './artifacts.ts';
28
28
  export * from './discovery.ts';
29
+ export * from './live.ts';
30
+ export * from './live-coordination.ts';
@@ -1410,6 +1410,9 @@ var previewClientMessageSchema = z12.discriminatedUnion("t", [
1410
1410
  /** Never spawns anything: a silent port answers with `needs-approval`. */
1411
1411
  z12.object({
1412
1412
  t: z12.literal("open"),
1413
+ /** Automatic reconnects may reclaim only this pane's last ownership. */
1414
+ viewerId: z12.string().min(1).max(128).optional(),
1415
+ resume: z12.boolean().optional(),
1413
1416
  target: z12.union([z12.object({ port }), z12.object({ url: z12.string().min(1).max(2048) })])
1414
1417
  }),
1415
1418
  /** The owner's explicit approval; the only message that runs a registered command. */
@@ -2643,6 +2646,8 @@ var fsBrowseResponseSchema = z16.object({
2643
2646
  var launchKeyResponseSchema = z16.object({
2644
2647
  key: z16.string()
2645
2648
  });
2649
+ var checkoutProgressParamsSchema = z16.object({ checkoutId: z16.string().min(1).max(128) });
2650
+ var checkoutProgressResponseSchema = z16.object({ progress: checkoutProgressEventSchema.nullable() });
2646
2651
 
2647
2652
  // ../contract/src/skills.ts
2648
2653
  import { z as z17 } from "zod";
@@ -3282,6 +3287,81 @@ var fileLinkResultSchema = z22.union([
3282
3287
  var artifactListSchema = z22.object({ artifacts: z22.array(publishedArtifactSchema).max(64) }).strict();
3283
3288
  var fileLinkQuerySchema = z22.object({ path: pathSchema, raw: z22.literal("1").optional() }).strict();
3284
3289
  var artifactParamsSchema = z22.object({ id: z22.uuid(), artifactId: z22.uuid() });
3290
+
3291
+ // ../contract/src/live.ts
3292
+ import { z as z23 } from "zod";
3293
+ var LIVE_RUN_LIMIT = 32;
3294
+ var LIVE_EVENT_LIMIT = 256;
3295
+ var LIVE_BYTE_LIMIT = 1024 * 1024;
3296
+ var liveRunDemandSchema = z23.object({
3297
+ projectId: z23.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
3298
+ runId: runIdParamSchema.shape.id,
3299
+ cursor: runHistoryCursorSchema.optional(),
3300
+ afterSeq: z23.number().int().nonnegative().safe()
3301
+ });
3302
+ var liveRunsRequestSchema = z23.object({
3303
+ runs: z23.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
3304
+ }).refine(({ runs }) => new Set(runs.map((r) => `${r.projectId}/${r.runId}`)).size === runs.length, {
3305
+ message: "duplicate run demand"
3306
+ });
3307
+ var identity = liveRunDemandSchema.pick({ projectId: true, runId: true });
3308
+ var liveRunErrorSchema = identity.extend({
3309
+ type: z23.enum(["error", "reset"]),
3310
+ status: z23.union([z23.literal(400), z23.literal(404), z23.literal(409), z23.literal(413), z23.literal(503)]),
3311
+ error: z23.string()
3312
+ });
3313
+ var liveRunBatchSchema = identity.extend({
3314
+ type: z23.literal("batch"),
3315
+ events: z23.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
3316
+ cursor: runHistoryCursorSchema,
3317
+ afterSeq: z23.number().int().nonnegative(),
3318
+ hasMore: z23.boolean()
3319
+ });
3320
+ var liveRunBatchResultSchema = z23.union([liveRunBatchSchema, liveRunErrorSchema]);
3321
+ var liveRunBatchResponseSchema = z23.object({
3322
+ generation: z23.string(),
3323
+ results: z23.array(liveRunBatchResultSchema)
3324
+ });
3325
+ var liveRunFrameSchema = z23.union([
3326
+ z23.object({ type: z23.literal("ready"), generation: z23.string() }),
3327
+ z23.object({ type: z23.literal("ping") }),
3328
+ identity.extend({ type: z23.literal("event"), name: z23.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
3329
+ liveRunErrorSchema
3330
+ ]);
3331
+
3332
+ // ../contract/src/live-coordination.ts
3333
+ import { z as z24 } from "zod";
3334
+ var LIVE_PROTOCOL = 1;
3335
+ var LIVE_WORKER_NAME = "cezar-live-v1";
3336
+ var LEASE_MS = 15e3;
3337
+ var RENEW_MS = 5e3;
3338
+ function allowedLiveRead(path) {
3339
+ if (!path.startsWith("/api/v1/") || path.includes("#") || /[\\\r\n]/.test(path)) return false;
3340
+ return /^\/api\/v1\/(?:workspace\/(?:runs-index|skills-update)|p\/[a-zA-Z0-9_-]+\/(?:runs\/[a-zA-Z0-9._-]+\/(?:changes|commits)|github(?:\/(?:checks|ref-status))?))(?:\?[^#]*)?$/.test(path);
3341
+ }
3342
+ var liveDemandSchema = z24.discriminatedUnion("kind", [
3343
+ z24.object({ kind: z24.literal("workspace") }),
3344
+ liveRunDemandSchema.extend({ kind: z24.literal("run") }),
3345
+ z24.object({ kind: z24.literal("topic"), topic: z24.string().min(1).max(128) }),
3346
+ z24.object({ kind: z24.literal("read"), path: z24.string().max(4096).refine(allowedLiveRead), intervalMs: z24.number().int().min(1e3).max(3e5) })
3347
+ ]);
3348
+ var liveEntrySchema = z24.object({ id: z24.string().min(1).max(128), demand: liveDemandSchema });
3349
+ var envelope = z24.object({ version: z24.literal(LIVE_PROTOCOL), documentId: z24.string().min(1).max(128), epoch: z24.number().int().nonnegative() });
3350
+ var ownerInputSchema = z24.discriminatedUnion("type", [
3351
+ envelope.extend({ type: z24.literal("sync"), entries: z24.array(liveEntrySchema).max(64) }).refine((value) => new Set(value.entries.map((e) => e.id)).size === value.entries.length),
3352
+ envelope.extend({ type: z24.literal("ack"), id: z24.string(), seq: z24.number().int().nonnegative() }),
3353
+ envelope.extend({ type: z24.literal("refresh"), id: z24.string() })
3354
+ ]);
3355
+ var wireFrameSchema = z24.object({ event: z24.string(), data: z24.string(), id: z24.string() });
3356
+ var ownerOutputSchema = z24.discriminatedUnion("type", [
3357
+ z24.object({ type: z24.literal("unavailable"), version: z24.literal(LIVE_PROTOCOL), epoch: z24.number(), reason: z24.string() }),
3358
+ z24.object({ type: z24.literal("hello"), version: z24.literal(LIVE_PROTOCOL) }),
3359
+ z24.object({ type: z24.literal("alive"), version: z24.literal(LIVE_PROTOCOL), epoch: z24.number() }),
3360
+ z24.object({ type: z24.literal("frame"), version: z24.literal(LIVE_PROTOCOL), epoch: z24.number(), id: z24.string(), frame: z24.union([wireFrameSchema, liveRunFrameSchema]) }),
3361
+ z24.object({ type: z24.literal("value"), version: z24.literal(LIVE_PROTOCOL), epoch: z24.number(), id: z24.string(), value: z24.unknown(), error: z24.string().optional() }),
3362
+ z24.object({ type: z24.literal("reset"), version: z24.literal(LIVE_PROTOCOL), epoch: z24.number(), id: z24.string(), reason: z24.string() })
3363
+ ]);
3364
+ var runKey = (run) => `${run.projectId}/${run.runId}`;
3285
3365
  export {
3286
3366
  ARCHIVED_RUNS_PAGE_DEFAULT,
3287
3367
  ARCHIVED_RUNS_PAGE_MAX,
@@ -3293,12 +3373,19 @@ export {
3293
3373
  EFFORT_LEVELS,
3294
3374
  FILE_ATTACHMENT_MEDIA_TYPES,
3295
3375
  GITHUB_SEARCH_MAX,
3376
+ LEASE_MS,
3377
+ LIVE_BYTE_LIMIT,
3378
+ LIVE_EVENT_LIMIT,
3379
+ LIVE_PROTOCOL,
3380
+ LIVE_RUN_LIMIT,
3381
+ LIVE_WORKER_NAME,
3296
3382
  MODEL_DISCOVERY_RUNNERS,
3297
3383
  PROJECT_TAGS_MAX,
3298
3384
  PROJECT_TAG_MAX_LENGTH,
3299
3385
  PROJECT_WEBHOOK_TOKEN_MAX_LENGTH,
3300
3386
  PROJECT_WEBHOOK_URL_MAX_LENGTH,
3301
3387
  REFERENCE_STATUS_MAX,
3388
+ RENEW_MS,
3302
3389
  RUNS_SEARCH_PER_PROJECT_MAX,
3303
3390
  RUN_HISTORY_PAGE_ITEMS,
3304
3391
  SCHEDULE_HOURS_OPTIONS,
@@ -3327,6 +3414,7 @@ export {
3327
3414
  agentProfileSchema,
3328
3415
  agentProfileSelectionsResponseSchema,
3329
3416
  agentProfilesResponseSchema,
3417
+ allowedLiveRead,
3330
3418
  apiRunSchema,
3331
3419
  applicationUpdateInputSchema,
3332
3420
  applicationUpdateResponseSchema,
@@ -3375,6 +3463,8 @@ export {
3375
3463
  changedFileSchema,
3376
3464
  changesPayloadSchema,
3377
3465
  checkoutProgressEventSchema,
3466
+ checkoutProgressParamsSchema,
3467
+ checkoutProgressResponseSchema,
3378
3468
  checkoutProjectInputSchema,
3379
3469
  ciPrIdentitySchema,
3380
3470
  ciPrUrlSchema,
@@ -3469,6 +3559,15 @@ export {
3469
3559
  isValidTimeZone,
3470
3560
  isoWeekday,
3471
3561
  launchKeyResponseSchema,
3562
+ liveDemandSchema,
3563
+ liveEntrySchema,
3564
+ liveRunBatchResponseSchema,
3565
+ liveRunBatchResultSchema,
3566
+ liveRunBatchSchema,
3567
+ liveRunDemandSchema,
3568
+ liveRunErrorSchema,
3569
+ liveRunFrameSchema,
3570
+ liveRunsRequestSchema,
3472
3571
  localTimeZone,
3473
3572
  logEntrySchema,
3474
3573
  logEntrySourceSchema,
@@ -3489,6 +3588,8 @@ export {
3489
3588
  openProjectInSchema,
3490
3589
  openTargetSchema,
3491
3590
  openTargetsResponseSchema,
3591
+ ownerInputSchema,
3592
+ ownerOutputSchema,
3492
3593
  parseCron,
3493
3594
  parseEffort,
3494
3595
  parsedWorkflowSchema,
@@ -3562,6 +3663,7 @@ export {
3562
3663
  runHistoryQuerySchema,
3563
3664
  runIdParamSchema,
3564
3665
  runIndexEntrySchema,
3666
+ runKey,
3565
3667
  runRecordSchema,
3566
3668
  runRelationshipsSchema,
3567
3669
  runStatusSchema,
@@ -3607,6 +3709,7 @@ export {
3607
3709
  updateProjectInputSchema,
3608
3710
  updateProjectResponseSchema,
3609
3711
  userMcpListingSchema,
3712
+ wireFrameSchema,
3610
3713
  workerBackendSchema,
3611
3714
  workerCancelWaitRequestSchema,
3612
3715
  workerCancelWaitResultSchema,
@@ -0,0 +1,158 @@
1
+ import { z } from 'zod';
2
+ import { liveRunFrameSchema } from './live.ts';
3
+ export declare const LIVE_PROTOCOL = 1;
4
+ export declare const LIVE_WORKER_NAME = "cezar-live-v1";
5
+ export declare const LEASE_MS = 15000;
6
+ export declare const RENEW_MS = 5000;
7
+ /** Only periodic public cockpit GET families; never arbitrary URLs or mutation execution. */
8
+ export declare function allowedLiveRead(path: string): boolean;
9
+ export declare const liveDemandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ kind: z.ZodLiteral<"workspace">;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ projectId: z.ZodString;
13
+ runId: z.ZodString;
14
+ cursor: z.ZodOptional<z.ZodString>;
15
+ afterSeq: z.ZodNumber;
16
+ kind: z.ZodLiteral<"run">;
17
+ }, z.core.$strip>, z.ZodObject<{
18
+ kind: z.ZodLiteral<"topic">;
19
+ topic: z.ZodString;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ kind: z.ZodLiteral<"read">;
22
+ path: z.ZodString;
23
+ intervalMs: z.ZodNumber;
24
+ }, z.core.$strip>], "kind">;
25
+ export type LiveDemand = z.infer<typeof liveDemandSchema>;
26
+ export declare const liveEntrySchema: z.ZodObject<{
27
+ id: z.ZodString;
28
+ demand: z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ kind: z.ZodLiteral<"workspace">;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ projectId: z.ZodString;
32
+ runId: z.ZodString;
33
+ cursor: z.ZodOptional<z.ZodString>;
34
+ afterSeq: z.ZodNumber;
35
+ kind: z.ZodLiteral<"run">;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ kind: z.ZodLiteral<"topic">;
38
+ topic: z.ZodString;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ kind: z.ZodLiteral<"read">;
41
+ path: z.ZodString;
42
+ intervalMs: z.ZodNumber;
43
+ }, z.core.$strip>], "kind">;
44
+ }, z.core.$strip>;
45
+ export declare const ownerInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
+ version: z.ZodLiteral<1>;
47
+ documentId: z.ZodString;
48
+ epoch: z.ZodNumber;
49
+ type: z.ZodLiteral<"sync">;
50
+ entries: z.ZodArray<z.ZodObject<{
51
+ id: z.ZodString;
52
+ demand: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
+ kind: z.ZodLiteral<"workspace">;
54
+ }, z.core.$strip>, z.ZodObject<{
55
+ projectId: z.ZodString;
56
+ runId: z.ZodString;
57
+ cursor: z.ZodOptional<z.ZodString>;
58
+ afterSeq: z.ZodNumber;
59
+ kind: z.ZodLiteral<"run">;
60
+ }, z.core.$strip>, z.ZodObject<{
61
+ kind: z.ZodLiteral<"topic">;
62
+ topic: z.ZodString;
63
+ }, z.core.$strip>, z.ZodObject<{
64
+ kind: z.ZodLiteral<"read">;
65
+ path: z.ZodString;
66
+ intervalMs: z.ZodNumber;
67
+ }, z.core.$strip>], "kind">;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>, z.ZodObject<{
70
+ version: z.ZodLiteral<1>;
71
+ documentId: z.ZodString;
72
+ epoch: z.ZodNumber;
73
+ type: z.ZodLiteral<"ack">;
74
+ id: z.ZodString;
75
+ seq: z.ZodNumber;
76
+ }, z.core.$strip>, z.ZodObject<{
77
+ version: z.ZodLiteral<1>;
78
+ documentId: z.ZodString;
79
+ epoch: z.ZodNumber;
80
+ type: z.ZodLiteral<"refresh">;
81
+ id: z.ZodString;
82
+ }, z.core.$strip>], "type">;
83
+ export type OwnerInput = z.infer<typeof ownerInputSchema>;
84
+ export declare const wireFrameSchema: z.ZodObject<{
85
+ event: z.ZodString;
86
+ data: z.ZodString;
87
+ id: z.ZodString;
88
+ }, z.core.$strip>;
89
+ export declare const ownerOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ type: z.ZodLiteral<"unavailable">;
91
+ version: z.ZodLiteral<1>;
92
+ epoch: z.ZodNumber;
93
+ reason: z.ZodString;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ type: z.ZodLiteral<"hello">;
96
+ version: z.ZodLiteral<1>;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ type: z.ZodLiteral<"alive">;
99
+ version: z.ZodLiteral<1>;
100
+ epoch: z.ZodNumber;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ type: z.ZodLiteral<"frame">;
103
+ version: z.ZodLiteral<1>;
104
+ epoch: z.ZodNumber;
105
+ id: z.ZodString;
106
+ frame: z.ZodUnion<readonly [z.ZodObject<{
107
+ event: z.ZodString;
108
+ data: z.ZodString;
109
+ id: z.ZodString;
110
+ }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
111
+ type: z.ZodLiteral<"ready">;
112
+ generation: z.ZodString;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ type: z.ZodLiteral<"ping">;
115
+ }, z.core.$strip>, z.ZodObject<{
116
+ projectId: z.ZodString;
117
+ runId: z.ZodString;
118
+ type: z.ZodLiteral<"event">;
119
+ name: z.ZodEnum<{
120
+ "run-event": "run-event";
121
+ "ui-event": "ui-event";
122
+ }>;
123
+ event: z.ZodObject<{
124
+ seq: z.ZodNumber;
125
+ ts: z.ZodString;
126
+ stepId: z.ZodOptional<z.ZodString>;
127
+ type: z.ZodString;
128
+ }, z.core.$catchall<z.ZodAny>>;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ projectId: z.ZodString;
131
+ runId: z.ZodString;
132
+ type: z.ZodEnum<{
133
+ error: "error";
134
+ reset: "reset";
135
+ }>;
136
+ status: z.ZodUnion<readonly [z.ZodLiteral<400>, z.ZodLiteral<404>, z.ZodLiteral<409>, z.ZodLiteral<413>, z.ZodLiteral<503>]>;
137
+ error: z.ZodString;
138
+ }, z.core.$strip>]>]>;
139
+ }, z.core.$strip>, z.ZodObject<{
140
+ type: z.ZodLiteral<"value">;
141
+ version: z.ZodLiteral<1>;
142
+ epoch: z.ZodNumber;
143
+ id: z.ZodString;
144
+ value: z.ZodUnknown;
145
+ error: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strip>, z.ZodObject<{
147
+ type: z.ZodLiteral<"reset">;
148
+ version: z.ZodLiteral<1>;
149
+ epoch: z.ZodNumber;
150
+ id: z.ZodString;
151
+ reason: z.ZodString;
152
+ }, z.core.$strip>], "type">;
153
+ export type OwnerOutput = z.infer<typeof ownerOutputSchema>;
154
+ export type LiveFrame = z.infer<typeof wireFrameSchema> | z.infer<typeof liveRunFrameSchema>;
155
+ export declare const runKey: (run: {
156
+ projectId: string;
157
+ runId: string;
158
+ }) => string;
@@ -0,0 +1,126 @@
1
+ import { z } from 'zod';
2
+ export declare const LIVE_RUN_LIMIT = 32;
3
+ export declare const LIVE_EVENT_LIMIT = 256;
4
+ export declare const LIVE_BYTE_LIMIT: number;
5
+ export declare const liveRunDemandSchema: z.ZodObject<{
6
+ projectId: z.ZodString;
7
+ runId: z.ZodString;
8
+ cursor: z.ZodOptional<z.ZodString>;
9
+ afterSeq: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ export type LiveRunDemand = z.infer<typeof liveRunDemandSchema>;
12
+ export declare const liveRunsRequestSchema: z.ZodObject<{
13
+ runs: z.ZodArray<z.ZodObject<{
14
+ projectId: z.ZodString;
15
+ runId: z.ZodString;
16
+ cursor: z.ZodOptional<z.ZodString>;
17
+ afterSeq: z.ZodNumber;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ export type LiveRunsRequest = z.infer<typeof liveRunsRequestSchema>;
21
+ export declare const liveRunErrorSchema: z.ZodObject<{
22
+ projectId: z.ZodString;
23
+ runId: z.ZodString;
24
+ type: z.ZodEnum<{
25
+ error: "error";
26
+ reset: "reset";
27
+ }>;
28
+ status: z.ZodUnion<readonly [z.ZodLiteral<400>, z.ZodLiteral<404>, z.ZodLiteral<409>, z.ZodLiteral<413>, z.ZodLiteral<503>]>;
29
+ error: z.ZodString;
30
+ }, z.core.$strip>;
31
+ export declare const liveRunBatchSchema: z.ZodObject<{
32
+ projectId: z.ZodString;
33
+ runId: z.ZodString;
34
+ type: z.ZodLiteral<"batch">;
35
+ events: z.ZodArray<z.ZodObject<{
36
+ seq: z.ZodNumber;
37
+ ts: z.ZodString;
38
+ stepId: z.ZodOptional<z.ZodString>;
39
+ type: z.ZodString;
40
+ }, z.core.$catchall<z.ZodAny>>>;
41
+ cursor: z.ZodString;
42
+ afterSeq: z.ZodNumber;
43
+ hasMore: z.ZodBoolean;
44
+ }, z.core.$strip>;
45
+ export type LiveRunBatch = z.infer<typeof liveRunBatchSchema>;
46
+ export declare const liveRunBatchResultSchema: z.ZodUnion<readonly [z.ZodObject<{
47
+ projectId: z.ZodString;
48
+ runId: z.ZodString;
49
+ type: z.ZodLiteral<"batch">;
50
+ events: z.ZodArray<z.ZodObject<{
51
+ seq: z.ZodNumber;
52
+ ts: z.ZodString;
53
+ stepId: z.ZodOptional<z.ZodString>;
54
+ type: z.ZodString;
55
+ }, z.core.$catchall<z.ZodAny>>>;
56
+ cursor: z.ZodString;
57
+ afterSeq: z.ZodNumber;
58
+ hasMore: z.ZodBoolean;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ projectId: z.ZodString;
61
+ runId: z.ZodString;
62
+ type: z.ZodEnum<{
63
+ error: "error";
64
+ reset: "reset";
65
+ }>;
66
+ status: z.ZodUnion<readonly [z.ZodLiteral<400>, z.ZodLiteral<404>, z.ZodLiteral<409>, z.ZodLiteral<413>, z.ZodLiteral<503>]>;
67
+ error: z.ZodString;
68
+ }, z.core.$strip>]>;
69
+ export type LiveRunBatchResult = z.infer<typeof liveRunBatchResultSchema>;
70
+ export declare const liveRunBatchResponseSchema: z.ZodObject<{
71
+ generation: z.ZodString;
72
+ results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
73
+ projectId: z.ZodString;
74
+ runId: z.ZodString;
75
+ type: z.ZodLiteral<"batch">;
76
+ events: z.ZodArray<z.ZodObject<{
77
+ seq: z.ZodNumber;
78
+ ts: z.ZodString;
79
+ stepId: z.ZodOptional<z.ZodString>;
80
+ type: z.ZodString;
81
+ }, z.core.$catchall<z.ZodAny>>>;
82
+ cursor: z.ZodString;
83
+ afterSeq: z.ZodNumber;
84
+ hasMore: z.ZodBoolean;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ projectId: z.ZodString;
87
+ runId: z.ZodString;
88
+ type: z.ZodEnum<{
89
+ error: "error";
90
+ reset: "reset";
91
+ }>;
92
+ status: z.ZodUnion<readonly [z.ZodLiteral<400>, z.ZodLiteral<404>, z.ZodLiteral<409>, z.ZodLiteral<413>, z.ZodLiteral<503>]>;
93
+ error: z.ZodString;
94
+ }, z.core.$strip>]>>;
95
+ }, z.core.$strip>;
96
+ export type LiveRunBatchResponse = z.infer<typeof liveRunBatchResponseSchema>;
97
+ export declare const liveRunFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
98
+ type: z.ZodLiteral<"ready">;
99
+ generation: z.ZodString;
100
+ }, z.core.$strip>, z.ZodObject<{
101
+ type: z.ZodLiteral<"ping">;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ projectId: z.ZodString;
104
+ runId: z.ZodString;
105
+ type: z.ZodLiteral<"event">;
106
+ name: z.ZodEnum<{
107
+ "run-event": "run-event";
108
+ "ui-event": "ui-event";
109
+ }>;
110
+ event: z.ZodObject<{
111
+ seq: z.ZodNumber;
112
+ ts: z.ZodString;
113
+ stepId: z.ZodOptional<z.ZodString>;
114
+ type: z.ZodString;
115
+ }, z.core.$catchall<z.ZodAny>>;
116
+ }, z.core.$strip>, z.ZodObject<{
117
+ projectId: z.ZodString;
118
+ runId: z.ZodString;
119
+ type: z.ZodEnum<{
120
+ error: "error";
121
+ reset: "reset";
122
+ }>;
123
+ status: z.ZodUnion<readonly [z.ZodLiteral<400>, z.ZodLiteral<404>, z.ZodLiteral<409>, z.ZodLiteral<413>, z.ZodLiteral<503>]>;
124
+ error: z.ZodString;
125
+ }, z.core.$strip>]>;
126
+ export type LiveRunFrame = z.infer<typeof liveRunFrameSchema>;
@@ -120,6 +120,8 @@ export declare const previewKeyTypeSchema: z.ZodEnum<{
120
120
  /** Client to server. A whitelist: a message outside it is dropped and logged once per connection. */
121
121
  export declare const previewClientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
122
  t: z.ZodLiteral<"open">;
123
+ viewerId: z.ZodOptional<z.ZodString>;
124
+ resume: z.ZodOptional<z.ZodBoolean>;
123
125
  target: z.ZodUnion<readonly [z.ZodObject<{
124
126
  port: z.ZodNumber;
125
127
  }, z.core.$strip>, z.ZodObject<{
@@ -248,3 +248,20 @@ export declare const launchKeyResponseSchema: z.ZodObject<{
248
248
  key: z.ZodString;
249
249
  }, z.core.$strip>;
250
250
  export type LaunchKeyResponse = z.infer<typeof launchKeyResponseSchema>;
251
+ export declare const checkoutProgressParamsSchema: z.ZodObject<{
252
+ checkoutId: z.ZodString;
253
+ }, z.core.$strip>;
254
+ export declare const checkoutProgressResponseSchema: z.ZodObject<{
255
+ progress: z.ZodNullable<z.ZodObject<{
256
+ checkoutId: z.ZodOptional<z.ZodString>;
257
+ name: z.ZodString;
258
+ phase: z.ZodEnum<{
259
+ cloning: "cloning";
260
+ done: "done";
261
+ error: "error";
262
+ }>;
263
+ line: z.ZodOptional<z.ZodString>;
264
+ error: z.ZodOptional<z.ZodString>;
265
+ }, z.core.$strip>>;
266
+ }, z.core.$strip>;
267
+ export type CheckoutProgressResponse = z.infer<typeof checkoutProgressResponseSchema>;