@kici-dev/engine 0.14.2 → 0.16.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 (58) hide show
  1. package/dist/approval/expiry-duration.d.ts +11 -0
  2. package/dist/approval/expiry-duration.js +29 -0
  3. package/dist/audit/access-log-policy.js +2 -0
  4. package/dist/audit/retention-policy.d.ts +1 -1
  5. package/dist/audit/retention-policy.js +5 -1
  6. package/dist/auth/permissions.d.ts +69 -0
  7. package/dist/auth/permissions.js +51 -0
  8. package/dist/context/hold-type.d.ts +0 -19
  9. package/dist/context/hold-type.js +1 -37
  10. package/dist/context/index.d.ts +1 -1
  11. package/dist/context/index.js +2 -2
  12. package/dist/index.d.ts +7 -2
  13. package/dist/index.js +20 -15
  14. package/dist/labels.d.ts +2 -17
  15. package/dist/labels.js +3 -33
  16. package/dist/mcp/held-run-resolve.d.ts +2 -5
  17. package/dist/mcp/held-run-resolve.js +3 -4
  18. package/dist/metrics/metric-catalog.generated.d.ts +0 -5
  19. package/dist/metrics/metric-catalog.generated.js +0 -6
  20. package/dist/protocol/messages/access-log.d.ts +10 -0
  21. package/dist/protocol/messages/access-log.js +2 -0
  22. package/dist/protocol/messages/auth.d.ts +7 -8
  23. package/dist/protocol/messages/auth.js +12 -17
  24. package/dist/protocol/messages/browser.js +1 -1
  25. package/dist/protocol/messages/capabilities.d.ts +21 -100
  26. package/dist/protocol/messages/capabilities.js +22 -124
  27. package/dist/protocol/messages/dashboard.d.ts +64 -22
  28. package/dist/protocol/messages/dashboard.js +43 -40
  29. package/dist/protocol/messages/execution-status.d.ts +3 -3
  30. package/dist/protocol/messages/execution-status.js +7 -12
  31. package/dist/protocol/messages/join.d.ts +73 -2
  32. package/dist/protocol/messages/join.js +101 -12
  33. package/dist/protocol/messages/orchestrator-agent.d.ts +35 -40
  34. package/dist/protocol/messages/orchestrator-agent.js +63 -96
  35. package/dist/protocol/messages/peer.d.ts +278 -26
  36. package/dist/protocol/messages/peer.js +120 -65
  37. package/dist/protocol/messages/platform-orchestrator.d.ts +36 -141
  38. package/dist/protocol/messages/platform-orchestrator.js +24 -86
  39. package/dist/protocol/messages/source-registration.d.ts +0 -13
  40. package/dist/protocol/messages/source-registration.js +9 -10
  41. package/dist/protocol/version.d.ts +9 -15
  42. package/dist/protocol/version.js +9 -15
  43. package/dist/provenance/id-token-claim-names.d.ts +3 -5
  44. package/dist/provenance/id-token-claim-names.js +3 -5
  45. package/dist/status/presentation.d.ts +2 -14
  46. package/dist/status/presentation.js +3 -23
  47. package/dist/trigger/types.d.ts +125 -34
  48. package/dist/trigger/types.js +9 -24
  49. package/dist/util/date.d.ts +7 -0
  50. package/dist/util/date.js +14 -0
  51. package/dist/util/parse-duration.d.ts +6 -0
  52. package/dist/util/parse-duration.js +21 -0
  53. package/dist/util/sleep.d.ts +3 -0
  54. package/dist/util/sleep.js +10 -0
  55. package/dist/webhook/webhook-url-format.d.ts +2 -2
  56. package/dist/webhook/webhook-url-format.js +2 -2
  57. package/package.json +1 -1
  58. package/sbom.spdx.json +5 -5
package/dist/labels.js CHANGED
@@ -58,35 +58,6 @@ function deriveOsArchLabels(platform, arch) {
58
58
  return labels;
59
59
  }
60
60
  /**
61
- * Plain OS/arch labels that gate a bare-metal scaler as a mandatory taint.
62
- * A pool whose declared labels include one of these only accepts jobs that
63
- * explicitly request that platform. Linux and x64/amd64 are the defaults and
64
- * are absent on purpose — an unqualified `runsOn: 'bare-metal'` job must still
65
- * land on a Linux-x64 scaler.
66
- */
67
- const PLATFORM_TAINT_LABELS = /* @__PURE__ */ new Set([
68
- "windows",
69
- "win32",
70
- "macos",
71
- "darwin",
72
- "arm64",
73
- "aarch64",
74
- "arm"
75
- ]);
76
- /**
77
- * Intersect a pool's declared labels with {@link PLATFORM_TAINT_LABELS},
78
- * returning the de-duplicated plain platform-taint labels (lowercased) in
79
- * input order.
80
- */
81
- function derivePlatformTaints(declaredLabels) {
82
- const seen = /* @__PURE__ */ new Set();
83
- for (const raw of declaredLabels) {
84
- const label = raw.toLowerCase();
85
- if (PLATFORM_TAINT_LABELS.has(label)) seen.add(label);
86
- }
87
- return [...seen];
88
- }
89
- /**
90
61
  * Operating systems a scaler pool can declare via the structured `platform`
91
62
  * field. `linux` is the default and carries no taint; `macos` / `windows` are
92
63
  * non-default and taint the pool.
@@ -132,9 +103,8 @@ function platformToOsArchLabels(platform) {
132
103
  * Derive the plain platform-taint labels for a declared structured platform.
133
104
  * Returns the canonical tokens (`macos`, `windows`, `arm64`) that a job's
134
105
  * `runsOn` must include to allocate on the pool. The linux/x64 default carries
135
- * no taint. Unlike {@link derivePlatformTaints} (which intersects declared
136
- * labels against a denylist), this derives from the structured field, so a pool
137
- * labeled `windows-2022` still taints correctly.
106
+ * no taint. It derives from the structured field, so a pool labeled
107
+ * `windows-2022` still taints correctly.
138
108
  */
139
109
  function platformToTaints(platform) {
140
110
  const taints = [];
@@ -452,6 +422,6 @@ function separateLabels(labels) {
452
422
  };
453
423
  }
454
424
  //#endregion
455
- export { AGENT_FEATURE_LABELS, AGENT_FEATURE_LABEL_PREFIX, AgentFeature, CAPABILITY_LABEL_PREFIX, CONTAINER_BUILD_RUNTIME_LABEL, GLOBAL_EVAL_SKIPS_RESULT_AWARE_LABEL, HOST_LABEL_PREFIX, INIT_LABEL, INIT_RUNNER_ROLE_LABEL, JOB_IMAGE_RUNTIME_LABEL, KNOWN_ROLES, PLATFORM_TAINT_LABELS, PRIVILEGED_ROOT_LABEL, RESERVED_LABEL_PREFIX, ROLE_LABEL_PREFIX, RUNTIME_LABEL_PREFIX, RuntimeFact, SELF_REPORTED_LABEL_PREFIXES, SSH_TRANSPORT_CAPABILITY, ScalerArch, ScalerOs, agentFeatureLabel, agentTypeLabel, capabilityLabel, deriveOsArchLabels, derivePlatformTaints, hostLabel, hostToScalerPlatform, isAutoLabel, isSelfReportedLabel, mergeAutoLabels, nodeArchToScalerArch, nodePlatformToScalerOs, normalizeRunsOn, parseHostLabel, platformToOsArchLabels, platformToTaints, resolveRoleLabels, roleToLabel, runtimeLabel, scalerAgentLabels, scalerLabel, scalerPlatformSchema, separateLabels, validateNoReservedLabels };
425
+ export { AGENT_FEATURE_LABELS, AGENT_FEATURE_LABEL_PREFIX, AgentFeature, CAPABILITY_LABEL_PREFIX, CONTAINER_BUILD_RUNTIME_LABEL, GLOBAL_EVAL_SKIPS_RESULT_AWARE_LABEL, HOST_LABEL_PREFIX, INIT_LABEL, INIT_RUNNER_ROLE_LABEL, JOB_IMAGE_RUNTIME_LABEL, KNOWN_ROLES, PRIVILEGED_ROOT_LABEL, RESERVED_LABEL_PREFIX, ROLE_LABEL_PREFIX, RUNTIME_LABEL_PREFIX, RuntimeFact, SELF_REPORTED_LABEL_PREFIXES, SSH_TRANSPORT_CAPABILITY, ScalerArch, ScalerOs, agentFeatureLabel, agentTypeLabel, capabilityLabel, deriveOsArchLabels, hostLabel, hostToScalerPlatform, isAutoLabel, isSelfReportedLabel, mergeAutoLabels, nodeArchToScalerArch, nodePlatformToScalerOs, normalizeRunsOn, parseHostLabel, platformToOsArchLabels, platformToTaints, resolveRoleLabels, roleToLabel, runtimeLabel, scalerAgentLabels, scalerLabel, scalerPlatformSchema, separateLabels, validateNoReservedLabels };
456
426
 
457
427
  //# sourceMappingURL=labels.js.map
@@ -10,9 +10,7 @@ export interface HeldRunSummary {
10
10
  status: string;
11
11
  /**
12
12
  * Persisted `held_runs.hold_type`, when the orchestrator's list response
13
- * carried one. Optional and un-normalized: callers pass it through
14
- * `normalizePersistedHoldType` before branching. Absent from an older
15
- * orchestrator's response.
13
+ * carried one. Absent from an older orchestrator's response.
16
14
  */
17
15
  holdType?: string;
18
16
  /**
@@ -51,8 +49,7 @@ export interface HeldRunFilter {
51
49
  holdId?: string;
52
50
  /**
53
51
  * Narrow to holds of one type (`reviewer` / `timer` / `concurrency` /
54
- * `security`), normalized through `normalizePersistedHoldType` on both sides
55
- * so a legacy `approval` row answers to `reviewer`.
52
+ * `security`), compared verbatim.
56
53
  *
57
54
  * Composes with {@link job} / {@link step} rather than replacing them: a
58
55
  * matrix whose children each carry two holds needs both halves.
@@ -1,6 +1,5 @@
1
1
  import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { HeldRunStatus } from "../context/held-run-status.js";
3
- import { normalizePersistedHoldType } from "../context/hold-type.js";
4
3
  //#region src/mcp/held-run-resolve.ts
5
4
  /**
6
5
  * Shared held-run resolution for the `kici approve` / `kici reject` commands and
@@ -32,7 +31,7 @@ import { normalizePersistedHoldType } from "../context/hold-type.js";
32
31
  function describeHold(hold) {
33
32
  const job = hold.jobId || "(unnamed hold)";
34
33
  const base = hold.holdScope === "step" && hold.stepIndex != null ? `step ${hold.stepIndex} of ${job}` : job;
35
- return hold.holdType ? `${base} (${normalizePersistedHoldType(hold.holdType)})` : base;
34
+ return hold.holdType ? `${base} (${hold.holdType})` : base;
36
35
  }
37
36
  /**
38
37
  * The hold descriptions, in listing order, for an error message.
@@ -89,8 +88,8 @@ function resolveHeldRunId(holds, filter) {
89
88
  error: "No pending approval holds found for this run."
90
89
  };
91
90
  if (filter.holdId !== void 0) return pickSingle(pending.filter((h) => h.id === filter.holdId), `hold '${filter.holdId}'`, pending);
92
- const wanted = filter.holdType && normalizePersistedHoldType(filter.holdType);
93
- const byType = (candidates) => wanted === void 0 ? candidates : candidates.filter((h) => h.holdType && normalizePersistedHoldType(h.holdType) === wanted);
91
+ const wanted = filter.holdType;
92
+ const byType = (candidates) => wanted === void 0 ? candidates : candidates.filter((h) => h.holdType === wanted);
94
93
  const typeLabel = wanted ? ` of type '${wanted}'` : "";
95
94
  if (filter.step !== void 0) {
96
95
  if (!filter.job) return {
@@ -136,7 +136,6 @@ export declare const MetricNames: {
136
136
  readonly KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: 'kici_orch_webhooks_processed_total';
137
137
  readonly KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: 'kici_orch_webhooks_received_total';
138
138
  readonly KICI_ORCH_WS_NACK_RECEIVED_TOTAL: 'kici_orch_ws_nack_received_total';
139
- readonly KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: 'kici_orch_ws_platform_capability_gap_total';
140
139
  readonly KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: 'kici_orch_ws_unsupported_message_sent_total';
141
140
  readonly KICI_ORCHESTRATOR_DRAINING: 'kici_orchestrator_draining';
142
141
  readonly KICI_ORG_AGENT_MINUTES: 'kici_org_agent_minutes';
@@ -386,7 +385,6 @@ export declare const MetricLabels: {
386
385
  readonly KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: readonly ['result'];
387
386
  readonly KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: readonly ['source', 'event'];
388
387
  readonly KICI_ORCH_WS_NACK_RECEIVED_TOTAL: readonly [];
389
- readonly KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: readonly [];
390
388
  readonly KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: readonly [];
391
389
  readonly KICI_ORCHESTRATOR_DRAINING: readonly [];
392
390
  readonly KICI_ORG_AGENT_MINUTES: readonly ['org_id', 'status'];
@@ -635,7 +633,6 @@ export declare const MetricKind: {
635
633
  readonly KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: 'counter';
636
634
  readonly KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: 'counter';
637
635
  readonly KICI_ORCH_WS_NACK_RECEIVED_TOTAL: 'counter';
638
- readonly KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: 'counter';
639
636
  readonly KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: 'counter';
640
637
  readonly KICI_ORCHESTRATOR_DRAINING: 'observableGauge';
641
638
  readonly KICI_ORG_AGENT_MINUTES: 'observableGauge';
@@ -884,7 +881,6 @@ export declare const MetricDescription: {
884
881
  readonly KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: 'Total number of webhooks processed';
885
882
  readonly KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: 'Total number of webhooks received';
886
883
  readonly KICI_ORCH_WS_NACK_RECEIVED_TOTAL: 'NACKs received from the Platform for a message it could not process (version skew)';
887
- readonly KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: 'Feature-gated sends suppressed because the Platform does not advertise the capability';
888
884
  readonly KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: 'NACKs sent to the Platform for an unrecognized inbound message type (version skew)';
889
885
  readonly KICI_ORCHESTRATOR_DRAINING: 'Whether this coordinator is draining (1) or accepting new jobs (0)';
890
886
  readonly KICI_ORG_AGENT_MINUTES: 'Per-org total agent runtime in minutes, by terminal status over a rolling window (DB-derived, top-N active orgs, leader-only, operator-side capacity-planning aggregate)';
@@ -1140,7 +1136,6 @@ export declare const MetricService: {
1140
1136
  readonly KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: 'orchestrator';
1141
1137
  readonly KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: 'orchestrator';
1142
1138
  readonly KICI_ORCH_WS_NACK_RECEIVED_TOTAL: 'orchestrator';
1143
- readonly KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: 'orchestrator';
1144
1139
  readonly KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: 'orchestrator';
1145
1140
  readonly KICI_ORCHESTRATOR_DRAINING: 'orchestrator';
1146
1141
  readonly KICI_ORG_AGENT_MINUTES: 'platform';
@@ -138,7 +138,6 @@ const MetricNames = {
138
138
  KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: "kici_orch_webhooks_processed_total",
139
139
  KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: "kici_orch_webhooks_received_total",
140
140
  KICI_ORCH_WS_NACK_RECEIVED_TOTAL: "kici_orch_ws_nack_received_total",
141
- KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: "kici_orch_ws_platform_capability_gap_total",
142
141
  KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: "kici_orch_ws_unsupported_message_sent_total",
143
142
  KICI_ORCHESTRATOR_DRAINING: "kici_orchestrator_draining",
144
143
  KICI_ORG_AGENT_MINUTES: "kici_org_agent_minutes",
@@ -399,7 +398,6 @@ const MetricLabels = {
399
398
  KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: ["result"],
400
399
  KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: ["source", "event"],
401
400
  KICI_ORCH_WS_NACK_RECEIVED_TOTAL: [],
402
- KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: [],
403
401
  KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: [],
404
402
  KICI_ORCHESTRATOR_DRAINING: [],
405
403
  KICI_ORG_AGENT_MINUTES: ["org_id", "status"],
@@ -652,7 +650,6 @@ const MetricKind = {
652
650
  KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: "counter",
653
651
  KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: "counter",
654
652
  KICI_ORCH_WS_NACK_RECEIVED_TOTAL: "counter",
655
- KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: "counter",
656
653
  KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: "counter",
657
654
  KICI_ORCHESTRATOR_DRAINING: "observableGauge",
658
655
  KICI_ORG_AGENT_MINUTES: "observableGauge",
@@ -901,7 +898,6 @@ const MetricDescription = {
901
898
  KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: "Total number of webhooks processed",
902
899
  KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: "Total number of webhooks received",
903
900
  KICI_ORCH_WS_NACK_RECEIVED_TOTAL: "NACKs received from the Platform for a message it could not process (version skew)",
904
- KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: "Feature-gated sends suppressed because the Platform does not advertise the capability",
905
901
  KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: "NACKs sent to the Platform for an unrecognized inbound message type (version skew)",
906
902
  KICI_ORCHESTRATOR_DRAINING: "Whether this coordinator is draining (1) or accepting new jobs (0)",
907
903
  KICI_ORG_AGENT_MINUTES: "Per-org total agent runtime in minutes, by terminal status over a rolling window (DB-derived, top-N active orgs, leader-only, operator-side capacity-planning aggregate)",
@@ -1157,7 +1153,6 @@ const MetricService = {
1157
1153
  KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: "orchestrator",
1158
1154
  KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: "orchestrator",
1159
1155
  KICI_ORCH_WS_NACK_RECEIVED_TOTAL: "orchestrator",
1160
- KICI_ORCH_WS_PLATFORM_CAPABILITY_GAP_TOTAL: "orchestrator",
1161
1156
  KICI_ORCH_WS_UNSUPPORTED_MESSAGE_SENT_TOTAL: "orchestrator",
1162
1157
  KICI_ORCHESTRATOR_DRAINING: "orchestrator",
1163
1158
  KICI_ORG_AGENT_MINUTES: "platform",
@@ -1407,7 +1402,6 @@ const ALL_METRIC_NAMES = [
1407
1402
  "kici_orch_webhooks_processed_total",
1408
1403
  "kici_orch_webhooks_received_total",
1409
1404
  "kici_orch_ws_nack_received_total",
1410
- "kici_orch_ws_platform_capability_gap_total",
1411
1405
  "kici_orch_ws_unsupported_message_sent_total",
1412
1406
  "kici_orchestrator_draining",
1413
1407
  "kici_org_agent_minutes",
@@ -82,6 +82,7 @@ export declare const AccessLogAction: z.ZodEnum<{
82
82
  "db.create_role": "db.create_role";
83
83
  "db.ensure": "db.ensure";
84
84
  "db.fresh": "db.fresh";
85
+ "db.migrate": "db.migrate";
85
86
  "db.refresh_collation_version": "db.refresh_collation_version";
86
87
  "db.reindex": "db.reindex";
87
88
  "diagnostics.read": "diagnostics.read";
@@ -125,6 +126,7 @@ export declare const AccessLogAction: z.ZodEnum<{
125
126
  "scaler.capacity.read": "scaler.capacity.read";
126
127
  "scaler.orphan.stop": "scaler.orphan.stop";
127
128
  "scaler.orphans.read": "scaler.orphans.read";
129
+ "scaler.reload": "scaler.reload";
128
130
  "secret.delete": "secret.delete";
129
131
  "secret.list.read": "secret.list.read";
130
132
  "secret.reveal": "secret.reveal";
@@ -191,6 +193,7 @@ export declare const accessLogItemSchema: z.ZodObject<{
191
193
  "db.create_role": "db.create_role";
192
194
  "db.ensure": "db.ensure";
193
195
  "db.fresh": "db.fresh";
196
+ "db.migrate": "db.migrate";
194
197
  "db.refresh_collation_version": "db.refresh_collation_version";
195
198
  "db.reindex": "db.reindex";
196
199
  "diagnostics.read": "diagnostics.read";
@@ -234,6 +237,7 @@ export declare const accessLogItemSchema: z.ZodObject<{
234
237
  "scaler.capacity.read": "scaler.capacity.read";
235
238
  "scaler.orphan.stop": "scaler.orphan.stop";
236
239
  "scaler.orphans.read": "scaler.orphans.read";
240
+ "scaler.reload": "scaler.reload";
237
241
  "secret.delete": "secret.delete";
238
242
  "secret.list.read": "secret.list.read";
239
243
  "secret.reveal": "secret.reveal";
@@ -327,6 +331,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
327
331
  "db.create_role": "db.create_role";
328
332
  "db.ensure": "db.ensure";
329
333
  "db.fresh": "db.fresh";
334
+ "db.migrate": "db.migrate";
330
335
  "db.refresh_collation_version": "db.refresh_collation_version";
331
336
  "db.reindex": "db.reindex";
332
337
  "diagnostics.read": "diagnostics.read";
@@ -370,6 +375,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
370
375
  "scaler.capacity.read": "scaler.capacity.read";
371
376
  "scaler.orphan.stop": "scaler.orphan.stop";
372
377
  "scaler.orphans.read": "scaler.orphans.read";
378
+ "scaler.reload": "scaler.reload";
373
379
  "secret.delete": "secret.delete";
374
380
  "secret.list.read": "secret.list.read";
375
381
  "secret.reveal": "secret.reveal";
@@ -493,6 +499,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
493
499
  "db.create_role": "db.create_role";
494
500
  "db.ensure": "db.ensure";
495
501
  "db.fresh": "db.fresh";
502
+ "db.migrate": "db.migrate";
496
503
  "db.refresh_collation_version": "db.refresh_collation_version";
497
504
  "db.reindex": "db.reindex";
498
505
  "diagnostics.read": "diagnostics.read";
@@ -536,6 +543,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
536
543
  "scaler.capacity.read": "scaler.capacity.read";
537
544
  "scaler.orphan.stop": "scaler.orphan.stop";
538
545
  "scaler.orphans.read": "scaler.orphans.read";
546
+ "scaler.reload": "scaler.reload";
539
547
  "secret.delete": "secret.delete";
540
548
  "secret.list.read": "secret.list.read";
541
549
  "secret.reveal": "secret.reveal";
@@ -640,6 +648,7 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
640
648
  "db.create_role": "db.create_role";
641
649
  "db.ensure": "db.ensure";
642
650
  "db.fresh": "db.fresh";
651
+ "db.migrate": "db.migrate";
643
652
  "db.refresh_collation_version": "db.refresh_collation_version";
644
653
  "db.reindex": "db.reindex";
645
654
  "diagnostics.read": "diagnostics.read";
@@ -683,6 +692,7 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
683
692
  "scaler.capacity.read": "scaler.capacity.read";
684
693
  "scaler.orphan.stop": "scaler.orphan.stop";
685
694
  "scaler.orphans.read": "scaler.orphans.read";
695
+ "scaler.reload": "scaler.reload";
686
696
  "secret.delete": "secret.delete";
687
697
  "secret.list.read": "secret.list.read";
688
698
  "secret.reveal": "secret.reveal";
@@ -126,6 +126,7 @@ const AccessLogAction = z.enum([
126
126
  "cluster_name.update",
127
127
  "attestation.retry",
128
128
  "scaler.orphan.stop",
129
+ "scaler.reload",
129
130
  "peer.forget",
130
131
  "access_log.list.read",
131
132
  "event_dlq.list.read",
@@ -134,6 +135,7 @@ const AccessLogAction = z.enum([
134
135
  "archive_chunk",
135
136
  "purge_chunk",
136
137
  "db.fresh",
138
+ "db.migrate",
137
139
  "db.ensure",
138
140
  "db.create_role",
139
141
  "db.create_readonly_user",
@@ -4,11 +4,11 @@ export declare const authRequestSchema: z.ZodObject<{
4
4
  type: z.ZodLiteral<"auth.request">;
5
5
  token: z.ZodString;
6
6
  protocolVersion: z.ZodNumber;
7
- capabilities: z.ZodOptional<z.ZodObject<{
8
- orchRole: z.ZodOptional<z.ZodEnum<{
7
+ capabilities: z.ZodObject<{
8
+ orchRole: z.ZodEnum<{
9
9
  coordinator: "coordinator";
10
10
  worker: "worker";
11
- }>>;
11
+ }>;
12
12
  dashboardWrites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
13
13
  "attestations.retry": "attestations.retry";
14
14
  "backends.sync": "backends.sync";
@@ -42,7 +42,6 @@ export declare const authRequestSchema: z.ZodObject<{
42
42
  encrypted: "encrypted";
43
43
  permissive: "permissive";
44
44
  }>>>;
45
- supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
45
  dashboardEncryptionKey: z.ZodOptional<z.ZodObject<{
47
46
  kty: z.ZodLiteral<"OKP">;
48
47
  crv: z.ZodLiteral<"X25519">;
@@ -51,15 +50,15 @@ export declare const authRequestSchema: z.ZodObject<{
51
50
  use: z.ZodOptional<z.ZodLiteral<"enc">>;
52
51
  }, z.core.$loose>>;
53
52
  dashboardVerifiedIssuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
- }, z.core.$loose>>;
53
+ }, z.core.$loose>;
55
54
  }, z.core.$strip>;
56
55
  /** Auth success response sent by Platform to orchestrator after successful authentication. */
57
56
  export declare const authSuccessSchema: z.ZodObject<{
58
57
  type: z.ZodLiteral<"auth.success">;
59
58
  connectionId: z.ZodString;
60
- orgPublicAlias: z.ZodOptional<z.ZodString>;
61
- orgId: z.ZodOptional<z.ZodString>;
62
- provenanceIssuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ orgPublicAlias: z.ZodString;
60
+ orgId: z.ZodString;
61
+ githubWebhookUrl: z.ZodNullable<z.ZodString>;
63
62
  }, z.core.$strip>;
64
63
  /** Auth failure response sent by Platform to orchestrator when authentication fails. */
65
64
  export declare const authFailureSchema: z.ZodObject<{
@@ -7,8 +7,8 @@ const authRequestSchema = z.object({
7
7
  type: z.literal("auth.request"),
8
8
  token: z.string().min(1),
9
9
  protocolVersion: z.number().int().positive(),
10
- /** Orchestrator capabilities (optional for backward compat with pre-capability orchestrators). */
11
- capabilities: orchCapabilitiesSchema.optional()
10
+ /** Orchestrator capabilities. */
11
+ capabilities: orchCapabilitiesSchema
12
12
  });
13
13
  /** Auth success response sent by Platform to orchestrator after successful authentication. */
14
14
  const authSuccessSchema = z.object({
@@ -19,29 +19,24 @@ const authSuccessSchema = z.object({
19
19
  * (`oal_<12-char>`). Used by the orchestrator's check-run emitter to
20
20
  * build a `details_url` that points at the dashboard's resolver
21
21
  * route, so the canonical `org_<12-char>` id never appears in URLs
22
- * that reach public surfaces. Optional for back-compat with Platforms
23
- * that don't yet supply it; when absent, the orchestrator skips
24
- * `details_url` (preserving today's behaviour).
22
+ * that reach public surfaces.
25
23
  */
26
- orgPublicAlias: z.string().optional(),
24
+ orgPublicAlias: z.string(),
27
25
  /**
28
26
  * Canonical org id (`org_<…>`) of the authenticated orchestrator's owning
29
27
  * org. The orchestrator auto-provisions a `remote_sources` anchor
30
28
  * (`remote:<orgId>`) from this so `kici run remote` relayed through the
31
- * Platform resolves the real tenant. Optional for back-compat with Platforms
32
- * that don't yet supply it; when absent, the orchestrator skips
33
- * remote-source provisioning.
29
+ * Platform resolves the real tenant.
34
30
  */
35
- orgId: z.string().optional(),
31
+ orgId: z.string(),
36
32
  /**
37
- * Provenance trust root (the OIDC issuer) the Platform mints build-provenance
38
- * tokens under. The orchestrator uses it to verify provenance bundles at
39
- * ingest: it derives the JWKS URI (`<issuer>/.well-known/jwks.json`) and
40
- * caches the key set. `null` (or absent) means provenance is not configured —
41
- * the orchestrator records each attestation's verdict as `unverifiable`
42
- * rather than silently `verified`.
33
+ * The Platform's org-scoped GitHub App webhook URL
34
+ * (`<WEBHOOK_PUBLIC_URL>/webhook/<orgId>/github`). It is known before any
35
+ * App exists, so the orchestrator's manifest flow bakes it into a new App in
36
+ * platform and hybrid mode. `null` when the Platform has no public webhook
37
+ * base.
43
38
  */
44
- provenanceIssuer: z.string().nullable().optional()
39
+ githubWebhookUrl: z.string().nullable()
45
40
  });
46
41
  /** Auth failure response sent by Platform to orchestrator when authentication fails. */
47
42
  const authFailureSchema = z.object({
@@ -1,7 +1,7 @@
1
1
  import "../../rolldown-runtime-ClRpJifh.js";
2
+ import { LogStream } from "./log-stream.js";
2
3
  import { browserJobContextSchema, browserRunEventSchema } from "./run-events.js";
3
4
  import { browserEventLogPayloadChunkSchema } from "./dashboard.js";
4
- import { LogStream } from "./log-stream.js";
5
5
  import { OrchLogPhase } from "./platform-orchestrator.js";
6
6
  import { z } from "zod";
7
7
  //#region src/protocol/messages/browser.ts
@@ -1,24 +1,19 @@
1
1
  /**
2
- * Capability negotiation schemas — bidirectional.
2
+ * Capability schemas — bidirectional.
3
3
  *
4
4
  * Modeled after peerCapabilitiesSchema in peer.ts.
5
5
  *
6
- * Two directions, each advertised as the sending side learns what the other
7
- * understands:
8
- * - **orchestrator → Platform** (`orchCapabilitiesSchema`, sent in `auth.request`):
9
- * the Platform pre-flight-checks orchestrator capabilities before sending
10
- * feature-gated messages (e.g. the dashboard-request manifest).
6
+ * - **orchestrator → Platform** (`orchCapabilitiesSchema`, sent in `auth.request`
7
+ * and rebroadcast as `orch.capabilities.update`): the orchestrator's role and
8
+ * the dashboard settings the Platform caches per org.
11
9
  * - **Platform → orchestrator** (`platformCapabilitiesSchema`, advertised once
12
- * after auth): a self-hosted orchestrator can run *ahead* of the hosted
13
- * Platform, so it pre-flight-checks its own feature-gated sends against what
14
- * the Platform advertises — surfacing a diagnosable capability gap instead of
15
- * firing a frame the Platform would drop.
10
+ * after auth), **orchestrator → agent** (`orchAgentCapabilitiesSchema`, on
11
+ * `register.ack`) and **agent → orchestrator** (`agentCapabilitiesSchema`, on
12
+ * `agent.register`): each defines no flag at protocol 4 and is advertised
13
+ * empty. A later release adds a flag to one of them without a protocol bump.
16
14
  *
17
- * Pattern (both directions): each field indicates support for an optional
18
- * protocol feature. Missing fields default to unsupported for backward
19
- * compatibility; `.passthrough()` preserves unknown flags from a newer peer.
20
- * A peer that never advertises at all is treated as "unknown" (optimistic),
21
- * never as "supports nothing".
15
+ * Every schema uses `.passthrough()`, so a newer peer's unknown fields are
16
+ * preserved rather than stripped.
22
17
  */
23
18
  import { z } from 'zod';
24
19
  /** Orchestrator role in a cluster topology. */
@@ -32,10 +27,10 @@ export type OrchRole = z.infer<typeof OrchRole>;
32
27
  * Uses .passthrough() so newer orchestrators sending unknown flags are preserved.
33
28
  */
34
29
  export declare const orchCapabilitiesSchema: z.ZodObject<{
35
- orchRole: z.ZodOptional<z.ZodEnum<{
30
+ orchRole: z.ZodEnum<{
36
31
  coordinator: "coordinator";
37
32
  worker: "worker";
38
- }>>;
33
+ }>;
39
34
  dashboardWrites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
40
35
  "attestations.retry": "attestations.retry";
41
36
  "backends.sync": "backends.sync";
@@ -69,7 +64,6 @@ export declare const orchCapabilitiesSchema: z.ZodObject<{
69
64
  encrypted: "encrypted";
70
65
  permissive: "permissive";
71
66
  }>>>;
72
- supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
67
  dashboardEncryptionKey: z.ZodOptional<z.ZodObject<{
74
68
  kty: z.ZodLiteral<"OKP">;
75
69
  crv: z.ZodLiteral<"X25519">;
@@ -84,96 +78,23 @@ export type OrchCapabilities = z.infer<typeof orchCapabilitiesSchema>;
84
78
  /** Default orchestrator capabilities sent in auth.request. */
85
79
  export declare const ORCH_CAPABILITIES: Readonly<{
86
80
  orchRole: "coordinator";
87
- supportedDashboardRequests: string[];
88
81
  }>;
89
- /**
90
- * Check whether an orchestrator advertises a specific capability flag.
91
- *
92
- * Takes `string` (not `keyof`) because newer versions may have flags the current code
93
- * doesn't know about. Returns false if capabilities is undefined (pre-capability
94
- * orchestrator) or the flag is missing/false.
95
- */
96
- export declare function hasOrchCapability(capabilities: OrchCapabilities | undefined, flag: string): boolean;
97
- /**
98
- * Platform-advertised capabilities sent to the orchestrator after auth.
99
- * Uses .passthrough() so a newer Platform's unknown flags are preserved.
100
- * Every field is optional and absent = unsupported (same evolution contract as
101
- * `orchCapabilitiesSchema`).
102
- */
103
- export declare const platformCapabilitiesSchema: z.ZodObject<{
104
- orchMetrics: z.ZodOptional<z.ZodBoolean>;
105
- }, z.core.$loose>;
82
+ /** Platform-advertised capabilities sent to the orchestrator after auth. */
83
+ export declare const platformCapabilitiesSchema: z.ZodObject<{}, z.core.$loose>;
106
84
  /** Inferred type for Platform capabilities. */
107
85
  export type PlatformCapabilities = z.infer<typeof platformCapabilitiesSchema>;
108
86
  /** Default Platform capabilities advertised to the orchestrator after auth. */
109
- export declare const PLATFORM_CAPABILITIES: Readonly<{
110
- orchMetrics: true;
111
- }>;
112
- /**
113
- * Check whether the Platform advertises a specific capability flag.
114
- *
115
- * Takes `string` (not `keyof`) because a newer Platform may advertise flags the
116
- * current orchestrator build doesn't know about. Returns false if capabilities
117
- * is undefined (nothing advertised yet) or the flag is missing/false.
118
- *
119
- * NOTE: "undefined → false" here is the plain reader semantics. A feature-gated
120
- * SEND that must stay backward-safe against a pre-capability Platform (which
121
- * never advertises) treats "nothing advertised yet" as optimistic-send — that
122
- * layer lives in the orchestrator's `sendIfPlatformSupports`, not here.
123
- */
124
- export declare function hasPlatformCapability(capabilities: PlatformCapabilities | undefined, flag: string): boolean;
125
- /**
126
- * Orchestrator -> Agent capabilities, advertised on `register.ack`. Same
127
- * evolution contract as the other two directions: every field optional,
128
- * absent = unsupported, `.passthrough()` preserves a newer orchestrator's
129
- * unknown flags. Lets the agent learn which optional agent-facing protocol
130
- * features this orchestrator build supports.
131
- */
132
- export declare const orchAgentCapabilitiesSchema: z.ZodObject<{
133
- artifactCompleteAck: z.ZodOptional<z.ZodBoolean>;
134
- }, z.core.$loose>;
87
+ export declare const PLATFORM_CAPABILITIES: Readonly<{}>;
88
+ /** Orchestrator -> agent capabilities, advertised on `register.ack`. */
89
+ export declare const orchAgentCapabilitiesSchema: z.ZodObject<{}, z.core.$loose>;
135
90
  /** Inferred type for orchestrator -> agent capabilities. */
136
91
  export type OrchAgentCapabilities = z.infer<typeof orchAgentCapabilitiesSchema>;
137
92
  /** Default orchestrator -> agent capabilities advertised on register.ack. */
138
- export declare const ORCH_AGENT_CAPABILITIES: Readonly<{
139
- artifactCompleteAck: true;
140
- }>;
141
- /**
142
- * Check whether an orchestrator advertises a specific agent-facing capability
143
- * flag.
144
- *
145
- * Takes `string` (not `keyof`) because a newer orchestrator may advertise flags
146
- * this agent build doesn't know about. Returns false if capabilities is
147
- * undefined (pre-capability orchestrator) or the flag is missing/false.
148
- */
149
- export declare function hasOrchAgentCapability(capabilities: OrchAgentCapabilities | undefined, flag: string): boolean;
150
- /**
151
- * Agent -> Orchestrator capabilities, advertised on `agent.register`. Same
152
- * evolution contract as the other directions: every field optional, absent =
153
- * unsupported, `.passthrough()` preserves a newer agent's unknown flags. Lets
154
- * the orchestrator route work that depends on an optional agent behaviour only
155
- * to agents that implement it.
156
- */
157
- export declare const agentCapabilitiesSchema: z.ZodObject<{
158
- globalEvalSkipsResultAwareGenerators: z.ZodOptional<z.ZodBoolean>;
159
- }, z.core.$loose>;
160
- /** Flag names of {@link agentCapabilitiesSchema}, for {@link hasAgentCapability} lookups. */
161
- export declare const AgentCapabilityFlag: z.ZodEnum<{
162
- globalEvalSkipsResultAwareGenerators: "globalEvalSkipsResultAwareGenerators";
163
- }>;
164
- export type AgentCapabilityFlag = z.infer<typeof AgentCapabilityFlag>;
93
+ export declare const ORCH_AGENT_CAPABILITIES: Readonly<{}>;
94
+ /** Agent -> orchestrator capabilities, advertised on `agent.register`. */
95
+ export declare const agentCapabilitiesSchema: z.ZodObject<{}, z.core.$loose>;
165
96
  /** Inferred type for agent -> orchestrator capabilities. */
166
97
  export type AgentCapabilities = z.infer<typeof agentCapabilitiesSchema>;
167
98
  /** Default agent -> orchestrator capabilities advertised on agent.register. */
168
- export declare const AGENT_CAPABILITIES: Readonly<{
169
- globalEvalSkipsResultAwareGenerators: true;
170
- }>;
171
- /**
172
- * Check whether an agent advertises a specific capability flag.
173
- *
174
- * Takes `string` (not `keyof`) because a newer agent may advertise flags this
175
- * orchestrator build doesn't know about. Returns false if capabilities is
176
- * undefined (pre-capability agent) or the flag is missing/false.
177
- */
178
- export declare function hasAgentCapability(capabilities: AgentCapabilities | null | undefined, flag: string): boolean;
99
+ export declare const AGENT_CAPABILITIES: Readonly<{}>;
179
100
  //# sourceMappingURL=capabilities.d.ts.map