@kici-dev/orchestrator 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 (176) hide show
  1. package/dist/__test-helpers__/peer-mutual-auth.d.ts +42 -0
  2. package/dist/__test-helpers__/scratch-db.d.ts +16 -0
  3. package/dist/agent/host-roster.d.ts +100 -37
  4. package/dist/agent/registry.d.ts +1 -8
  5. package/dist/app-on-error.d.ts +1 -1
  6. package/dist/app.d.ts +4 -2
  7. package/dist/artifacts/artifact-store.d.ts +0 -2
  8. package/dist/audit/access-log.d.ts +1 -1
  9. package/dist/cache/source-cache.d.ts +1 -1
  10. package/dist/cache/user-cache.d.ts +0 -28
  11. package/dist/cli/api-client.d.ts +27 -1
  12. package/dist/cli/commands/access-log.d.ts +1 -1
  13. package/dist/cli/commands/cold-store-impl.d.ts +7 -84
  14. package/dist/cli/commands/db.d.ts +1 -0
  15. package/dist/cli/commands/host.d.ts +3 -0
  16. package/dist/cli/commands/orchestrator-service/status.d.ts +2 -0
  17. package/dist/cli/commands/org.d.ts +12 -0
  18. package/dist/cli/commands/scaler.d.ts +14 -0
  19. package/dist/cli/commands/secret.d.ts +1 -45
  20. package/dist/cli/commands/service-health.d.ts +21 -13
  21. package/dist/cli/commands/shared/cli-action.d.ts +17 -0
  22. package/dist/cli/commands/shared/db.d.ts +5 -5
  23. package/dist/cli/commands/shared/org-id.d.ts +5 -0
  24. package/dist/cli/commands/shared/service-verbs.d.ts +19 -0
  25. package/dist/cli/commands/shared/table.d.ts +3 -0
  26. package/dist/cli/commands/shared/unbound-context-warning.d.ts +2 -22
  27. package/dist/cli/commands/source-manifest.d.ts +3 -3
  28. package/dist/cli/commands/source.d.ts +23 -0
  29. package/dist/cli/commands/trust-policy.d.ts +7 -31
  30. package/dist/cli/join.d.ts +2 -2
  31. package/dist/cli/kici-admin.d.ts +6 -1
  32. package/dist/cli/local-github-ingress-url.d.ts +6 -0
  33. package/dist/cli/root-option-routing.d.ts +46 -0
  34. package/dist/cli/webhook-url-notes.d.ts +15 -0
  35. package/dist/cli.js +10667 -8461
  36. package/dist/cluster/coordinator-credential.d.ts +21 -0
  37. package/dist/cluster/coordinator.d.ts +2 -2
  38. package/dist/cluster/index.d.ts +4 -4
  39. package/dist/cluster/join-client.d.ts +23 -21
  40. package/dist/cluster/join-handler.d.ts +24 -16
  41. package/dist/cluster/join-protocol-v2.d.ts +84 -0
  42. package/dist/cluster/join-token.d.ts +78 -56
  43. package/dist/cluster/peer-auth-coordinator.d.ts +16 -2
  44. package/dist/cluster/peer-client.d.ts +99 -5
  45. package/dist/cluster/peer-crypto.d.ts +60 -3
  46. package/dist/cluster/peer-discovery.d.ts +67 -0
  47. package/dist/cluster/peer-forget.d.ts +4 -9
  48. package/dist/cluster/peer-handler.d.ts +28 -6
  49. package/dist/cluster/peer-registry.d.ts +15 -1
  50. package/dist/cluster/peer-request-waiters.d.ts +26 -0
  51. package/dist/cluster/scaler-orphans-peer.d.ts +4 -9
  52. package/dist/cluster/scaler-reload-fanout.d.ts +29 -0
  53. package/dist/cluster/scaler-reload-peer.d.ts +16 -0
  54. package/dist/cluster/worker-cluster-settings.d.ts +1 -0
  55. package/dist/cold-store/load-access-log-range.d.ts +3 -3
  56. package/dist/cold-store/tables/access-log.d.ts +4 -12
  57. package/dist/cold-store/tables/event-log.d.ts +8 -19
  58. package/dist/cold-store/tables/execution-jobs.d.ts +7 -24
  59. package/dist/cold-store/tables/execution-runs.d.ts +6 -20
  60. package/dist/cold-store/tables/execution-steps.d.ts +8 -26
  61. package/dist/cold-store/tables/secret-audit-log.d.ts +4 -11
  62. package/dist/config/env-overlay.d.ts +3 -8
  63. package/dist/config/reload.d.ts +9 -2
  64. package/dist/config/schema.d.ts +16 -2
  65. package/dist/config/types.d.ts +6 -2
  66. package/dist/config.d.ts +22 -17
  67. package/dist/contexts/held-runs.d.ts +3 -6
  68. package/dist/dashboard/cursor.d.ts +12 -0
  69. package/dist/dashboard/handler.d.ts +5 -12
  70. package/dist/db/deferred-index-build.d.ts +42 -0
  71. package/dist/db/deferred-indexes.d.ts +3 -37
  72. package/dist/db/migrations/100_held_runs_hold_type_vocabulary.d.ts +3 -5
  73. package/dist/db/migrations/157_host_roster_identity_source.d.ts +21 -0
  74. package/dist/db/migrations/158_normalize_legacy_values.d.ts +4 -0
  75. package/dist/db/repos/org-ids-repo.d.ts +87 -0
  76. package/dist/db/schema-snapshot.generated.d.ts +3 -0
  77. package/dist/db/types.d.ts +21 -24
  78. package/dist/fault-injection-types.d.ts +0 -6
  79. package/dist/git/dispatch-git-auth.d.ts +6 -12
  80. package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +25 -13
  81. package/dist/helpers/json.d.ts +3 -0
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.js +357 -216
  84. package/dist/metrics/prometheus.d.ts +0 -5
  85. package/dist/oidc/id-token-claims.d.ts +1 -1
  86. package/dist/oidc/resolve-signer.d.ts +2 -4
  87. package/dist/orchestrator-core.d.ts +10 -3
  88. package/dist/pipeline/global-eval-round.d.ts +2 -26
  89. package/dist/pipeline/install-secrets-resolver.d.ts +0 -3
  90. package/dist/pipeline/manual-schedule.d.ts +1 -7
  91. package/dist/provenance/dispatch-context.d.ts +5 -7
  92. package/dist/provenance/pending-attestations-repo.d.ts +1 -1
  93. package/dist/provenance/trust-root.d.ts +4 -5
  94. package/dist/provenance/verify-deferred-capture.d.ts +3 -3
  95. package/dist/provider-registry.d.ts +13 -40
  96. package/dist/providers/github/manifest.d.ts +58 -7
  97. package/dist/providers/universal-git/ssh-auth.d.ts +0 -5
  98. package/dist/reporting/check-run-reporter.d.ts +8 -21
  99. package/dist/reporting/check-run-summary.d.ts +2 -2
  100. package/dist/reporting/execution-tracker.d.ts +1 -1
  101. package/dist/reporting/log-chunk-sink.d.ts +1 -1
  102. package/dist/reporting/run-summary-fields.d.ts +25 -0
  103. package/dist/reporting/s3-log-storage.d.ts +2 -2
  104. package/dist/routes/admin-access-log.d.ts +2 -9
  105. package/dist/routes/admin-backends.d.ts +2 -9
  106. package/dist/routes/admin-cluster-name.d.ts +2 -8
  107. package/dist/routes/admin-cluster-settings.d.ts +2 -8
  108. package/dist/routes/admin-config.d.ts +0 -3
  109. package/dist/routes/admin-contexts.d.ts +3 -11
  110. package/dist/routes/admin-db.d.ts +2 -9
  111. package/dist/routes/admin-env.d.ts +33 -0
  112. package/dist/routes/admin-event-dlq.d.ts +2 -9
  113. package/dist/routes/admin-event-inspect.d.ts +2 -9
  114. package/dist/routes/admin-event-log.d.ts +2 -9
  115. package/dist/routes/admin-events.d.ts +3 -13
  116. package/dist/routes/admin-held-runs.d.ts +2 -8
  117. package/dist/routes/admin-list-limit.d.ts +3 -0
  118. package/dist/routes/admin-maintenance.d.ts +2 -9
  119. package/dist/routes/admin-orchestrator-drain.d.ts +2 -9
  120. package/dist/routes/admin-org-settings.d.ts +2 -8
  121. package/dist/routes/admin-orgs.d.ts +27 -0
  122. package/dist/routes/admin-peer-forget.d.ts +2 -9
  123. package/dist/routes/admin-queue-execution.d.ts +3 -10
  124. package/dist/routes/admin-registrations.d.ts +3 -14
  125. package/dist/routes/admin-runs.d.ts +3 -14
  126. package/dist/routes/admin-scaler-orphans.d.ts +2 -9
  127. package/dist/routes/admin-scaler-reload.d.ts +41 -0
  128. package/dist/routes/admin-scheduled-jobs.d.ts +2 -9
  129. package/dist/routes/admin-signing-keys.d.ts +2 -9
  130. package/dist/routes/admin-sources.d.ts +28 -32
  131. package/dist/routes/admin-trust-policy.d.ts +2 -8
  132. package/dist/routes/admin.d.ts +29 -30
  133. package/dist/routes/cluster-join.d.ts +13 -0
  134. package/dist/routes/github-webhook.d.ts +13 -11
  135. package/dist/scaler/bare-metal-backend.d.ts +42 -1
  136. package/dist/scaler/config.d.ts +12 -84
  137. package/dist/scaler/file-reload.d.ts +48 -0
  138. package/dist/scaler/manager.d.ts +47 -33
  139. package/dist/scaler/scaler-state-store.d.ts +5 -0
  140. package/dist/scaler/types.d.ts +8 -9
  141. package/dist/secrets/job-secret-gate.d.ts +2 -5
  142. package/dist/secrets/secret-resolver.d.ts +2 -4
  143. package/dist/security/trust-policy-gate.d.ts +0 -4
  144. package/dist/server.d.ts +6 -17
  145. package/dist/server.js +10933 -10836
  146. package/dist/sources/source-manager.d.ts +0 -24
  147. package/dist/sources/webhook-url-resolvers.d.ts +60 -0
  148. package/dist/standalone.js +10457 -10060
  149. package/dist/worker/reroute-dispatch.d.ts +1 -0
  150. package/dist/worker/reroute-spawn-control.d.ts +1 -3
  151. package/dist/worker-core.d.ts +9 -2
  152. package/dist/ws/agent-handler.d.ts +3 -3
  153. package/dist/ws/dashboard-access.d.ts +57 -0
  154. package/dist/ws/dashboard-backends-handler.d.ts +1 -6
  155. package/dist/ws/dashboard-context-handler.d.ts +10 -15
  156. package/dist/ws/dashboard-fleet-handler.d.ts +4 -3
  157. package/dist/ws/dashboard-fleet-write-handler.d.ts +6 -5
  158. package/dist/ws/dashboard-global-workflows-handler.d.ts +1 -6
  159. package/dist/ws/dashboard-registrations-handler.d.ts +1 -7
  160. package/dist/ws/platform-client.d.ts +94 -327
  161. package/installer-image-digests.json +3 -3
  162. package/package.json +4 -4
  163. package/sbom.spdx.json +53 -53
  164. package/dist/cache/legacy-prefixes.d.ts +0 -19
  165. package/dist/cli/commands/agent-service/logs.d.ts +0 -14
  166. package/dist/cli/commands/agent-service/restart.d.ts +0 -12
  167. package/dist/cli/commands/agent-service/start.d.ts +0 -12
  168. package/dist/cli/commands/agent-service/stop.d.ts +0 -12
  169. package/dist/cli/commands/agent-service/uninstall.d.ts +0 -13
  170. package/dist/cli/commands/cache.d.ts +0 -51
  171. package/dist/cli/commands/orchestrator-service/logs.d.ts +0 -14
  172. package/dist/cli/commands/orchestrator-service/restart.d.ts +0 -12
  173. package/dist/cli/commands/orchestrator-service/start.d.ts +0 -12
  174. package/dist/cli/commands/orchestrator-service/stop.d.ts +0 -12
  175. package/dist/cli/commands/orchestrator-service/uninstall.d.ts +0 -13
  176. package/dist/git/inherited-secret.d.ts +0 -29
@@ -31,5 +31,6 @@ export interface WorkerQueuedJob {
31
31
  export declare function buildWorkerDispatchMessage(job: WorkerQueuedJob, ids: {
32
32
  messageId: string;
33
33
  timestamp: number;
34
+ concurrencyWaitTimeoutMs: number;
34
35
  }): Record<string, unknown>;
35
36
  //# sourceMappingURL=reroute-dispatch.d.ts.map
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * Assembled here so `bootstrapWorker` only wires it.
14
14
  */
15
- import { type JobReroute, type PeerScalerEvent, type RerouteSpawnRetry } from '@kici-dev/engine';
15
+ import { type JobReroute, type PeerScalerEvent } from '@kici-dev/engine';
16
16
  import type { Dispatcher } from '../agent/dispatcher.js';
17
17
  import type { ScalerManager } from '../scaler/manager.js';
18
18
  import type { ScaleResult, ScalerEvent } from '../scaler/types.js';
@@ -29,8 +29,6 @@ export interface RerouteSpawnControlDeps {
29
29
  jobOwnership: Map<string, string>;
30
30
  /** Relay a message to the coordinator that owns the job. */
31
31
  sendToOwningCoord: (jobId: string, msg: PeerScalerEvent) => void;
32
- /** The worker's configured budget, used when the coordinator sent none. */
33
- defaults: RerouteSpawnRetry;
34
32
  logger: {
35
33
  debug(message: string, meta?: Record<string, unknown>): unknown;
36
34
  info(message: string, meta?: Record<string, unknown>): unknown;
@@ -74,12 +74,19 @@ export declare function resolveWorkerAgentTokenTtlMs(pushed: {
74
74
  /**
75
75
  * Resolve the Firecracker API-socket wait a worker-spawned VM should use: the
76
76
  * fleet-wide `firecracker_api_socket_wait_ms` pulled from a coordinator,
77
- * otherwise the boot-time config default. A snapshot from a coordinator that
78
- * predates the knob carries no value, and the default applies.
77
+ * otherwise the boot-time config default.
79
78
  */
80
79
  export declare function resolveWorkerFirecrackerApiSocketWaitMs(pushed: {
81
80
  settings: WorkerClusterSettings;
82
81
  } | null, fallback: number): number;
82
+ /**
83
+ * Resolve the concurrency-slot wait timeout a worker sends on `job.dispatch`:
84
+ * the fleet-wide `concurrency_wait_timeout_ms` pulled from a coordinator,
85
+ * otherwise the boot-time config default.
86
+ */
87
+ export declare function resolveWorkerConcurrencyWaitTimeoutMs(pushed: {
88
+ settings: WorkerClusterSettings;
89
+ } | null, fallback: number): number;
83
90
  /**
84
91
  * Bootstrap the orchestrator in worker mode.
85
92
  *
@@ -425,7 +425,7 @@ export declare function isValidLogChunk(raw: unknown): raw is {
425
425
  stepIndex: number;
426
426
  lines: string[];
427
427
  timestamp: number;
428
- stream?: LogStream;
428
+ stream: LogStream;
429
429
  };
430
430
  /** A log chunk as the handler passes it on. */
431
431
  export interface AgentLogChunkInput {
@@ -434,8 +434,8 @@ export interface AgentLogChunkInput {
434
434
  stepIndex: number;
435
435
  lines: string[];
436
436
  timestamp: number;
437
- /** Absent when the agent does not report a stream; read as `stdout`. */
438
- stream?: LogStream;
437
+ /** The stream the lines came from. */
438
+ stream: LogStream;
439
439
  }
440
440
  /**
441
441
  * Release the in-memory waiters of jobs a disconnect triage failed: pending
@@ -0,0 +1,57 @@
1
+ import type { AccessLogAction, AccessLogOutcome, AccessLogTargetType, ActorPrincipal } from '@kici-dev/engine';
2
+ import type { AccessLogWriter } from '../audit/access-log.js';
3
+ import { type DetachedFailureLogger } from '../helpers/run-detached.js';
4
+ /** The org and routing key an access_log row is attributed to. */
5
+ export type AccessScope = {
6
+ orgId: string | null;
7
+ routingKey: string | null;
8
+ };
9
+ export type AccessTarget = {
10
+ type: AccessLogTargetType;
11
+ id: string;
12
+ } | null;
13
+ /**
14
+ * Writes access_log rows for one dashboard handler. Best-effort: the write runs
15
+ * detached and a failure is logged through the handler's own logger.
16
+ */
17
+ export declare class DashboardAccessRecorder {
18
+ private readonly accessLog;
19
+ private readonly scope;
20
+ private readonly logger;
21
+ /**
22
+ * @param scope read at every write, so a handler re-bound to another org or
23
+ * routing key attributes its later rows to the new pair.
24
+ */
25
+ constructor(accessLog: AccessLogWriter | undefined, scope: () => AccessScope, logger: DetachedFailureLogger);
26
+ /** Record a row attributed to the handler's bound scope. */
27
+ record(actor: ActorPrincipal, action: AccessLogAction, target: AccessTarget, requestId: string | null, outcome: AccessLogOutcome, errorMessage?: string | null): void;
28
+ /** Record a row attributed to an explicit scope (the org that owns the target). */
29
+ recordIn(scope: AccessScope, actor: ActorPrincipal, action: AccessLogAction, target: AccessTarget, requestId: string | null, outcome: AccessLogOutcome, errorMessage?: string | null): void;
30
+ }
31
+ /** Where an audited request writes its row and its answer. */
32
+ export interface AuditedIo {
33
+ recorder: DashboardAccessRecorder;
34
+ send: (msg: Record<string, unknown>) => void;
35
+ sendError: (type: string, requestId: string, err: unknown) => void;
36
+ }
37
+ /** One request's audit identity: who, what, on which target, answered with which frame. */
38
+ export interface AuditedRequest {
39
+ msg: {
40
+ actor: ActorPrincipal;
41
+ requestId: string;
42
+ };
43
+ action: AccessLogAction;
44
+ target: AccessTarget;
45
+ responseType: string;
46
+ /** The policy gate. Returns false after answering a denied request itself. */
47
+ enforce?: () => Promise<boolean>;
48
+ }
49
+ /**
50
+ * Run one dashboard request: the optional policy gate, then `body`. On success
51
+ * it records an `allowed` row and sends `{ type: responseType, requestId,
52
+ * ...payload }`; on a throw it records an `error` row with the message and hands
53
+ * the error to `sendError`. A gate that returns false has already answered the
54
+ * request, so nothing else runs. A gate that throws propagates to the caller.
55
+ */
56
+ export declare function audited(args: AuditedIo & AuditedRequest, body: () => Promise<Record<string, unknown> | void>): Promise<void>;
57
+ //# sourceMappingURL=dashboard-access.d.ts.map
@@ -28,7 +28,7 @@ export declare class DashboardBackendsHandler {
28
28
  private readonly deps;
29
29
  private orgId;
30
30
  private routingKey;
31
- private readonly accessLog;
31
+ private readonly access;
32
32
  constructor(deps: DashboardBackendsHandlerDeps);
33
33
  /**
34
34
  * Update the bound orgId + routingKey. Called from server.ts after resolving
@@ -45,11 +45,6 @@ export declare class DashboardBackendsHandler {
45
45
  * customer yet, so there's nothing to look up.
46
46
  */
47
47
  private enforcePolicy;
48
- /**
49
- * Write an access_log row for a handler invocation. Best-effort; the writer
50
- * swallows failures.
51
- */
52
- private recordAccess;
53
48
  /**
54
49
  * Route a dashboard backends message to the appropriate handler.
55
50
  * Returns true if the message was handled, false otherwise.
@@ -10,7 +10,7 @@
10
10
  * 2. Calls the appropriate store method
11
11
  * 3. Returns a response message with requestId and data (or error)
12
12
  */
13
- import { type Kysely } from 'kysely';
13
+ import type { Kysely } from 'kysely';
14
14
  import type { HeldRunStore, ReleaseSignal } from '../contexts/held-runs.js';
15
15
  import type { TeamMembershipLookup } from '../approvals/approval-resolver.js';
16
16
  import { type ApplyDecisionDeps } from '../approvals/apply-decision.js';
@@ -47,13 +47,12 @@ export interface DashboardContextHandlerDeps {
47
47
  /** Routing key for access_log rows (null when not run-scoped). */
48
48
  routingKey?: string | null;
49
49
  /**
50
- * Held-run store + resume hook for the approve/reject flow. When present, the
51
- * approve/reject handlers route through the shared `applyDecision` applier
52
- * (eligibility check, real attribution, multi-clause accumulation, and the
53
- * resume-after-approval re-dispatch). When absent (legacy / tests), the
54
- * handlers fall back to the direct status flip.
50
+ * Held-run store + resume hook for the approve/reject flow. The approve/reject
51
+ * handlers route through the shared `applyDecision` applier (eligibility
52
+ * check, real attribution, multi-clause accumulation, and the
53
+ * resume-after-approval re-dispatch).
55
54
  */
56
- approvals?: ApprovalHandlerDeps;
55
+ approvals: ApprovalHandlerDeps;
57
56
  /**
58
57
  * Dashboard-encryption key resolver. Present when KICI_SECRET_KEY is
59
58
  * configured. Under the `encrypted` posture the secret/variable set handlers
@@ -100,7 +99,7 @@ export interface ApprovalHandlerDeps {
100
99
  export declare class DashboardContextHandler {
101
100
  private readonly deps;
102
101
  private routingKey;
103
- private readonly accessLog;
102
+ private readonly access;
104
103
  constructor(deps: DashboardContextHandlerDeps);
105
104
  /** Update the orgId used for all operations (called when resolved from DB). */
106
105
  setOrgId(orgId: string): void;
@@ -113,6 +112,8 @@ export declare class DashboardContextHandler {
113
112
  * sends a structured `operation_disabled` envelope back to Platform.
114
113
  */
115
114
  private enforcePolicy;
115
+ /** Run a single-call request through `audited` with this handler's recorder and response channel. */
116
+ private audited;
116
117
  /**
117
118
  * Resolve the plaintext value for a secret/variable set under the write
118
119
  * policy. When the client sends a `sealed` envelope, decrypt it with the
@@ -123,12 +124,6 @@ export declare class DashboardContextHandler {
123
124
  * structured error code the caller records + sends back.
124
125
  */
125
126
  private resolveWriteValue;
126
- /**
127
- * Write an access_log row for a handler invocation. Uses the handler's
128
- * bound orgId + routingKey, the msg.actor principal, and the handler-
129
- * specified action + target. Best-effort; the writer swallows failures.
130
- */
131
- private recordAccess;
132
127
  /**
133
128
  * Route a dashboard message to the appropriate handler.
134
129
  * Returns true if the message was handled, false otherwise.
@@ -140,7 +135,7 @@ export declare class DashboardContextHandler {
140
135
  * its scope bindings. Joins `context_bindings` → `scoped_secrets` on the
141
136
  * scope pattern, excluding the `__empty__` sentinel. Returns key names only —
142
137
  * never values. Scoped to the caller-resolved org (the request's target org,
143
- * or the connection-level org on the legacy path).
138
+ * else the connection-level org).
144
139
  */
145
140
  private loadSecretKeysByEnv;
146
141
  private handleEnvGet;
@@ -2,8 +2,9 @@
2
2
  * Orchestrator-side handlers for the fleet-management read path (P2).
3
3
  *
4
4
  * Each handler answers one Platform->orchestrator read-relay request from
5
- * `HostRosterStore`, returning the canonical `HostInventoryEntry` shape on the
6
- * wire. The handlers are pure (they take their dependencies as arguments) so
5
+ * `HostRosterStore`. The roster reads return `FleetHostEntry` (the canonical
6
+ * `HostInventoryEntry` plus `confirmed`) so the dashboard can show hosts
7
+ * declared from the dashboard that no agent or operator confirmed yet. The handlers are pure (they take their dependencies as arguments) so
7
8
  * the WS wiring in `server.ts` stays a thin adapter and the logic is unit
8
9
  * testable without a live DB / Platform connection.
9
10
  */
@@ -27,7 +28,7 @@ export interface FleetHandlerDeps {
27
28
  /** All registered workflows (for the host-centric workflows-for-host read). */
28
29
  registrationStore: RegistrationStore;
29
30
  }
30
- /** Roster: every declared/live host as a `HostInventoryEntry`. */
31
+ /** Roster: every host, unconfirmed placeholders included, flagged `confirmed`. */
31
32
  export declare function handleFleetHostsRequest(deps: FleetHandlerDeps, requestId: string): Promise<DashboardFleetHostsResponse>;
32
33
  /** Host detail: one host (or null) plus its most-recent pinned runs. */
33
34
  export declare function handleFleetHostRequest(deps: FleetHandlerDeps, requestId: string, agentId: string): Promise<DashboardFleetHostResponse>;
@@ -1,7 +1,7 @@
1
1
  import type { FleetHostDeclareRequest, FleetHostRemoveRequest } from '@kici-dev/engine';
2
2
  import type { Kysely } from 'kysely';
3
3
  import type { Database } from '../db/types.js';
4
- import type { HostRosterStore } from '../agent/host-roster.js';
4
+ import { type HostRosterStore } from '../agent/host-roster.js';
5
5
  import type { AccessLogWriter } from '../audit/access-log.js';
6
6
  interface DashboardFleetWriteHandlerDeps {
7
7
  /** Send a response message back to Platform over the WS connection. */
@@ -27,7 +27,7 @@ export declare class DashboardFleetWriteHandler {
27
27
  private readonly deps;
28
28
  private orgId;
29
29
  private routingKey;
30
- private readonly accessLog;
30
+ private readonly access;
31
31
  constructor(deps: DashboardFleetWriteHandlerDeps);
32
32
  /**
33
33
  * Update the bound orgId + routingKey. Called from server.ts after resolving
@@ -44,10 +44,11 @@ export declare class DashboardFleetWriteHandler {
44
44
  */
45
45
  private enforcePolicy;
46
46
  /**
47
- * Write an access_log row for a handler invocation. Best-effort; the writer
48
- * swallows failures.
47
+ * Answer a write the roster store refused for the Platform's authority: a
48
+ * `denied` access-log row with `<code>:<detail>`, and the refusal code in the
49
+ * response `error` field (plus the reserved keys for `reserved_property`).
49
50
  */
50
- private recordAccess;
51
+ private refuse;
51
52
  /**
52
53
  * Route a fleet host-write message to the appropriate handler. Returns true
53
54
  * if the message was handled, false otherwise.
@@ -41,7 +41,7 @@ export declare function isDashboardGlobalWorkflowsMessage(msg: {
41
41
  } | null | undefined): msg is GlobalWorkflowsMessage;
42
42
  export declare class DashboardGlobalWorkflowsHandler {
43
43
  private readonly deps;
44
- private readonly accessLog;
44
+ private readonly access;
45
45
  constructor(deps: DashboardGlobalWorkflowsHandlerDeps);
46
46
  /** Update the customer / org id this handler operates on. */
47
47
  setOrgId(customerId: string | null): void;
@@ -51,11 +51,6 @@ export declare class DashboardGlobalWorkflowsHandler {
51
51
  * envelope and a `denied` access_log row) when policy says no.
52
52
  */
53
53
  private enforcePolicy;
54
- /**
55
- * Write an access_log row for a handler invocation. Best-effort; the writer
56
- * swallows failures.
57
- */
58
- private recordAccess;
59
54
  handleMessage(msg: GlobalWorkflowsMessage): Promise<boolean>;
60
55
  private handleGet;
61
56
  private handleUpdate;
@@ -51,7 +51,7 @@ type RegistrationMessage = RegistrationsListMessage | RegistrationDisableMessage
51
51
  export declare class DashboardRegistrationsHandler {
52
52
  private readonly deps;
53
53
  private routingKey;
54
- private readonly accessLog;
54
+ private readonly access;
55
55
  constructor(deps: DashboardRegistrationsHandlerDeps);
56
56
  /** Update the orgId used for all operations (called when resolved from DB). */
57
57
  setOrgId(orgId: string): void;
@@ -64,12 +64,6 @@ export declare class DashboardRegistrationsHandler {
64
64
  * and emits a structured `operation_disabled` envelope on the WS.
65
65
  */
66
66
  private enforcePolicy;
67
- /**
68
- * Write an access_log row for a handler invocation. Uses the handler's
69
- * bound orgId + routingKey, the msg.actor principal, and the handler-
70
- * specified action + target. Best-effort; the writer swallows failures.
71
- */
72
- private recordAccess;
73
67
  handle(msg: RegistrationMessage): Promise<void>;
74
68
  private handleDisable;
75
69
  private handleDelete;