@sema-agent/server 1.314.0 → 1.316.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.
- package/dist/approval-hmac.d.ts +17 -0
- package/dist/approval-hmac.js +27 -0
- package/dist/config-center/apply-effective.d.ts +22 -0
- package/dist/config-center/apply-effective.js +283 -0
- package/dist/config-center/http-client.d.ts +23 -0
- package/dist/config-center/http-client.js +109 -0
- package/dist/config-center/restart-signal.d.ts +12 -0
- package/dist/config-center/restart-signal.js +70 -0
- package/dist/config-center/skills-mcp.d.ts +13 -0
- package/dist/config-center/skills-mcp.js +113 -0
- package/dist/config-center/types.d.ts +143 -0
- package/dist/config-center/types.js +2 -0
- package/dist/fleet/fleet-bus.js +92 -83
- package/dist/hooks/hook-runner.js +18 -9
- package/dist/http/idempotency.d.ts +1 -0
- package/dist/http/idempotency.js +3 -0
- package/dist/http/principal-gate.d.ts +12 -0
- package/dist/http/principal-gate.js +52 -0
- package/dist/http/route-ctx.d.ts +67 -0
- package/dist/http/route-ctx.js +2 -0
- package/dist/http/routes/attachments.d.ts +4 -0
- package/dist/http/routes/attachments.js +106 -0
- package/dist/http/routes/capabilities.d.ts +4 -0
- package/dist/http/routes/capabilities.js +111 -0
- package/dist/http/routes/images.d.ts +20 -0
- package/dist/http/routes/images.js +572 -0
- package/dist/http/routes/memory-policy.d.ts +4 -0
- package/dist/http/routes/memory-policy.js +105 -0
- package/dist/http/routes/observability.d.ts +4 -0
- package/dist/http/routes/observability.js +63 -0
- package/dist/http/routes/session-sync.d.ts +36 -0
- package/dist/http/routes/session-sync.js +513 -0
- package/dist/http/routes/sessions-list.d.ts +4 -0
- package/dist/http/routes/sessions-list.js +117 -0
- package/dist/http/routes/sessions.d.ts +17 -0
- package/dist/http/routes/sessions.js +746 -0
- package/dist/http/send.d.ts +6 -0
- package/dist/http/send.js +19 -0
- package/dist/http/server.d.ts +101 -76
- package/dist/http/server.js +129 -2410
- package/dist/http/sse-log.d.ts +25 -0
- package/dist/http/sse-log.js +59 -0
- package/dist/http/workspace-content.d.ts +3 -0
- package/dist/http/workspace-content.js +20 -0
- package/dist/index.d.ts +1 -1
- package/dist/leader/leader.js +5 -2
- package/dist/leader/wire.js +169 -165
- package/dist/main.js +462 -451
- package/dist/plugins/approval-store-sql.d.ts +52 -0
- package/dist/plugins/approval-store-sql.js +119 -0
- package/dist/plugins/breaker-state-sql.d.ts +29 -0
- package/dist/plugins/breaker-state-sql.js +104 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +67 -0
- package/dist/plugins/checkpoint-store-sql.js +224 -0
- package/dist/plugins/file-snapshot-store-sql.d.ts +38 -0
- package/dist/plugins/file-snapshot-store-sql.js +210 -0
- package/dist/plugins/image-bake-store-sql.d.ts +53 -0
- package/dist/plugins/image-bake-store-sql.js +463 -0
- package/dist/plugins/image-index-sql.d.ts +33 -0
- package/dist/plugins/image-index-sql.js +328 -0
- package/dist/plugins/k8s-bg-scripts.d.ts +19 -0
- package/dist/plugins/k8s-bg-scripts.js +129 -0
- package/dist/plugins/k8s-exec-protocol.d.ts +20 -0
- package/dist/plugins/k8s-exec-protocol.js +87 -0
- package/dist/plugins/outcome-ledger-sql.d.ts +70 -0
- package/dist/plugins/outcome-ledger-sql.js +158 -0
- package/dist/plugins/pg-approval-store.d.ts +1 -27
- package/dist/plugins/pg-approval-store.js +1 -83
- package/dist/plugins/pg-breaker-state.d.ts +1 -19
- package/dist/plugins/pg-breaker-state.js +1 -88
- package/dist/plugins/pg-checkpoint-store.d.ts +1 -33
- package/dist/plugins/pg-checkpoint-store.js +1 -189
- package/dist/plugins/pg-cost-quota.js +3 -143
- package/dist/plugins/pg-file-snapshot-store.d.ts +1 -27
- package/dist/plugins/pg-file-snapshot-store.js +1 -190
- package/dist/plugins/pg-image-bake.d.ts +1 -40
- package/dist/plugins/pg-image-bake.js +1 -420
- package/dist/plugins/pg-image-index.d.ts +1 -21
- package/dist/plugins/pg-image-index.js +1 -217
- package/dist/plugins/pg-outcome-ledger.d.ts +2 -22
- package/dist/plugins/pg-outcome-ledger.js +1 -104
- package/dist/plugins/pg-rate-limiter.d.ts +2 -32
- package/dist/plugins/pg-rate-limiter.js +4 -147
- package/dist/plugins/pg-resume-anchor-store.d.ts +1 -13
- package/dist/plugins/pg-resume-anchor-store.js +1 -22
- package/dist/plugins/pg-run-store.d.ts +1 -75
- package/dist/plugins/pg-run-store.js +1 -287
- package/dist/plugins/pg-session-policy-store.d.ts +1 -11
- package/dist/plugins/pg-session-policy-store.js +1 -90
- package/dist/plugins/pg-tool-result-store.d.ts +1 -15
- package/dist/plugins/pg-tool-result-store.js +1 -52
- package/dist/plugins/pg-workflow-journal-store.d.ts +1 -20
- package/dist/plugins/pg-workflow-journal-store.js +1 -34
- package/dist/plugins/pg-workflow-run-store.d.ts +1 -55
- package/dist/plugins/pg-workflow-run-store.js +1 -220
- package/dist/plugins/remote-env-k8s.d.ts +5 -38
- package/dist/plugins/remote-env-k8s.js +7 -213
- package/dist/plugins/resume-anchor-store-sql.d.ts +23 -0
- package/dist/plugins/resume-anchor-store-sql.js +38 -0
- package/dist/plugins/run-store-sql.d.ts +89 -0
- package/dist/plugins/run-store-sql.js +397 -0
- package/dist/plugins/session-policy-store-sql.d.ts +22 -0
- package/dist/plugins/session-policy-store-sql.js +109 -0
- package/dist/plugins/sql-driver.d.ts +25 -0
- package/dist/plugins/sql-driver.js +59 -0
- package/dist/plugins/tidb-approval-store.d.ts +1 -39
- package/dist/plugins/tidb-approval-store.js +1 -71
- package/dist/plugins/tidb-breaker-state.d.ts +1 -17
- package/dist/plugins/tidb-breaker-state.js +1 -74
- package/dist/plugins/tidb-checkpoint-store.d.ts +1 -49
- package/dist/plugins/tidb-checkpoint-store.js +1 -191
- package/dist/plugins/tidb-file-snapshot-store.d.ts +1 -27
- package/dist/plugins/tidb-file-snapshot-store.js +1 -192
- package/dist/plugins/tidb-image-bake.d.ts +1 -38
- package/dist/plugins/tidb-image-bake.js +1 -348
- package/dist/plugins/tidb-image-index.d.ts +1 -19
- package/dist/plugins/tidb-image-index.js +1 -149
- package/dist/plugins/tidb-outcome-ledger.d.ts +1 -57
- package/dist/plugins/tidb-outcome-ledger.js +1 -97
- package/dist/plugins/tidb-resume-anchor-store.d.ts +1 -13
- package/dist/plugins/tidb-resume-anchor-store.js +1 -22
- package/dist/plugins/tidb-run-store.d.ts +1 -75
- package/dist/plugins/tidb-run-store.js +1 -306
- package/dist/plugins/tidb-session-policy-store.d.ts +1 -11
- package/dist/plugins/tidb-session-policy-store.js +1 -86
- package/dist/plugins/tidb-tool-result-store.d.ts +1 -13
- package/dist/plugins/tidb-tool-result-store.js +1 -38
- package/dist/plugins/tidb-workflow-journal-store.d.ts +1 -20
- package/dist/plugins/tidb-workflow-journal-store.js +1 -34
- package/dist/plugins/tidb-workflow-run-store.d.ts +1 -61
- package/dist/plugins/tidb-workflow-run-store.js +1 -231
- package/dist/plugins/tool-result-store-sql.d.ts +25 -0
- package/dist/plugins/tool-result-store-sql.js +69 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +30 -0
- package/dist/plugins/workflow-journal-store-sql.js +53 -0
- package/dist/plugins/workflow-run-store-sql.d.ts +85 -0
- package/dist/plugins/workflow-run-store-sql.js +299 -0
- package/dist/plugins/write-behind-counter.d.ts +14 -3
- package/dist/plugins/write-behind-counter.js +39 -12
- package/dist/principal-jwt.d.ts +44 -0
- package/dist/principal-jwt.js +95 -0
- package/dist/security.d.ts +2 -58
- package/dist/security.js +3 -118
- package/dist/sema-registry.d.ts +5 -200
- package/dist/sema-registry.js +4 -567
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ServerResponse } from "node:http";
|
|
2
|
+
export declare function sseHeaders(res: ServerResponse, extra?: Record<string, string>): void;
|
|
3
|
+
export declare function sendJson(res: ServerResponse, status: number, body: unknown): void;
|
|
4
|
+
export declare function sendError(res: ServerResponse, status: number, errorCode: string, message: string, extra?: Record<string, unknown>): void;
|
|
5
|
+
export declare function msg(e: unknown): string;
|
|
6
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function sseHeaders(res, extra) {
|
|
2
|
+
res.writeHead(200, {
|
|
3
|
+
"content-type": "text/event-stream",
|
|
4
|
+
"cache-control": "no-cache",
|
|
5
|
+
connection: "keep-alive",
|
|
6
|
+
...extra,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function sendJson(res, status, body) {
|
|
10
|
+
res.writeHead(status, { "content-type": "application/json" });
|
|
11
|
+
res.end(JSON.stringify(body));
|
|
12
|
+
}
|
|
13
|
+
export function sendError(res, status, errorCode, message, extra) {
|
|
14
|
+
sendJson(res, status, { error: message, errorCode, ...extra });
|
|
15
|
+
}
|
|
16
|
+
export function msg(e) {
|
|
17
|
+
return e instanceof Error ? e.message : String(e);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=send.js.map
|
package/dist/http/server.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { TaskRequestBody } from "./wire-types.js";
|
|
|
5
5
|
import type { ServiceConfig } from "../config-types.js";
|
|
6
6
|
import { type RestartSignal, type SessionMirrorRuling } from "../sema-registry.js";
|
|
7
7
|
import { type OwnerAwareSessionStore } from "../security.js";
|
|
8
|
-
import type { BakeState, BakeErrorCode } from "../plugins/store-contracts.js";
|
|
9
8
|
import type { RunStore, ApprovalStore, ImageIndex, ImageBake, CheckpointStoreFull, ResumeAnchorStore, ApprovalExemptionStore, ServiceSessionPolicyStore, ServiceFileSnapshotStore, StoreBackend } from "../plugins/store-backend.js";
|
|
10
9
|
import { type MemorySyncRequest, type MemorySyncResponse } from "../memory-sync.js";
|
|
11
10
|
import type { TaskAttachmentStore } from "../plugins/task-attachment-store.js";
|
|
@@ -24,64 +23,71 @@ import type { Metrics } from "../observability/metrics.js";
|
|
|
24
23
|
import { type RateGate } from "../observability/rate-limit.js";
|
|
25
24
|
import type { QuotaTracker } from "../observability/cost-quota.js";
|
|
26
25
|
import type { ModelUsageTracker, PromptManifestTracker } from "../budget.js";
|
|
26
|
+
import { scopedIdempotencyKey } from "./idempotency.js";
|
|
27
|
+
export { scopedIdempotencyKey };
|
|
28
|
+
import { coarseStatusForState, errorCodeForExit } from "./routes/images.js";
|
|
29
|
+
export { coarseStatusForState, errorCodeForExit };
|
|
30
|
+
import { explicitOperatorOk, isOperator, explicitOperator } from "./principal-gate.js";
|
|
31
|
+
export { explicitOperatorOk, isOperator, explicitOperator };
|
|
27
32
|
export interface RequestAuth {
|
|
28
33
|
principal?: string;
|
|
29
34
|
sessionId: string;
|
|
30
35
|
memoryScope?: string;
|
|
31
36
|
resolvedProjectId?: string;
|
|
32
37
|
}
|
|
33
|
-
export interface
|
|
38
|
+
export interface ServiceCoreDeps {
|
|
34
39
|
runner: Runner;
|
|
35
40
|
config: ServiceConfig;
|
|
36
|
-
registryJwtVerifier?: {
|
|
37
|
-
verify: (bearer: string) => Promise<import("../auth-bridge.js").VerifyOutcome>;
|
|
38
|
-
};
|
|
39
|
-
hookWakeBus?: {
|
|
40
|
-
deliver?: (sessionId: string, text: string) => Promise<boolean>;
|
|
41
|
-
};
|
|
42
|
-
drainState?: {
|
|
43
|
-
draining: boolean;
|
|
44
|
-
since?: number;
|
|
45
|
-
inflight?: () => number;
|
|
46
|
-
lastActivityAt?: () => number;
|
|
47
|
-
};
|
|
48
|
-
storeDegraded?: boolean;
|
|
49
|
-
sessionStoreLabel?: string;
|
|
50
|
-
modelReady?: () => boolean;
|
|
51
|
-
scenarioDetails?: Record<string, import("../capabilities/scenarios.js").ScenarioDetail>;
|
|
52
|
-
authorize?: (ctx: {
|
|
53
|
-
req: IncomingMessage;
|
|
54
|
-
body: TaskRequestBody;
|
|
55
|
-
}) => Promise<RequestAuth>;
|
|
56
41
|
resolveSpec: (body: TaskRequestBody, req: IncomingMessage | undefined, auth?: RequestAuth, opts?: {
|
|
57
42
|
leg?: "fresh" | "resume";
|
|
58
43
|
}) => TaskSpec | Promise<TaskSpec>;
|
|
44
|
+
}
|
|
45
|
+
export interface ServiceStoreDeps {
|
|
59
46
|
runStore?: RunStore;
|
|
60
47
|
resumeAnchorStore?: ResumeAnchorStore;
|
|
61
|
-
|
|
62
|
-
maybeTitle(sessionId: string, objective: string): void;
|
|
63
|
-
};
|
|
48
|
+
approvalStore?: ApprovalStore;
|
|
64
49
|
approvalExemptionStore?: ApprovalExemptionStore;
|
|
50
|
+
checkpointStore?: CheckpointStoreFull;
|
|
65
51
|
sessionPolicyStore?: ServiceSessionPolicyStore;
|
|
66
52
|
fileSnapshotStore?: ServiceFileSnapshotStore;
|
|
67
|
-
snapshotBlobSqlCapBytes?: number;
|
|
68
|
-
backend?: StoreBackend;
|
|
69
|
-
sessionMirrorRuling?: (principal: string | undefined) => Promise<SessionMirrorRuling | undefined>;
|
|
70
|
-
approvalStore?: ApprovalStore;
|
|
71
|
-
checkpointStore?: CheckpointStoreFull;
|
|
72
|
-
backgroundAgentStore?: import("@sema-agent/core").BackgroundAgentStore;
|
|
73
|
-
parkedReviveTool?: import("@sema-agent/core").ToolSpec;
|
|
74
|
-
parkedKnownAgentTypes?: ReadonlySet<string>;
|
|
75
|
-
parkedReviveInheritedGate?: (row: import("@sema-agent/core").BackgroundAgentRecord) => unknown;
|
|
76
53
|
taskAttachmentStore?: TaskAttachmentStore;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
leaderEndpoint?: LeaderEndpoint;
|
|
54
|
+
backgroundAgentStore?: import("@sema-agent/core").BackgroundAgentStore;
|
|
55
|
+
sessionStorage?: OwnerAwareSessionStore;
|
|
80
56
|
workflowRunStore?: WorkflowRunStore;
|
|
81
57
|
workflowJournalStore?: import("@sema-agent/core").WorkflowJournalStore;
|
|
82
|
-
|
|
58
|
+
imageIndex?: ImageIndex;
|
|
59
|
+
imageBakes?: ImageBake;
|
|
60
|
+
outcomeSink?: import("../plugins/file-outcome-sink.js").OutcomeSink;
|
|
61
|
+
sendFileLedger?: import("../plugins/send-file-ledger.js").SendFileLedger;
|
|
62
|
+
backend?: StoreBackend;
|
|
63
|
+
}
|
|
64
|
+
export interface ServiceCoordinatorDeps {
|
|
65
|
+
elicitation?: ElicitationCoordinator;
|
|
66
|
+
question?: QuestionCoordinator;
|
|
67
|
+
toolApproval?: ToolApprovalCoordinator;
|
|
83
68
|
workflowAgentRegistry?: WorkflowAgentRegistry;
|
|
84
69
|
subagentSteerRegistry?: SubagentSteerRegistry;
|
|
70
|
+
workflowCompletionInbox?: WorkflowCompletionInbox;
|
|
71
|
+
fleetBus?: FleetEventBus;
|
|
72
|
+
sessionWatch?: import("../session-watch.js").SessionWatchRegistry;
|
|
73
|
+
hookWakeBus?: {
|
|
74
|
+
deliver?: (sessionId: string, text: string) => Promise<boolean>;
|
|
75
|
+
};
|
|
76
|
+
sendUserFile?: import("../capabilities/send-user-file-tool.js").SendUserFileEmitter;
|
|
77
|
+
leaderEndpoint?: LeaderEndpoint;
|
|
78
|
+
sessionTitler?: {
|
|
79
|
+
maybeTitle(sessionId: string, objective: string): void;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export interface ServiceSeamDeps {
|
|
83
|
+
sessionAudit?: (sessionId: string) => Promise<({
|
|
84
|
+
owner: string | null;
|
|
85
|
+
} & Record<string, unknown>) | undefined>;
|
|
86
|
+
purgeSession?: (sessionId: string, owner: string | null) => Promise<{
|
|
87
|
+
deleted: boolean;
|
|
88
|
+
} | {
|
|
89
|
+
active: string;
|
|
90
|
+
}>;
|
|
85
91
|
subagentTaskOutput?: (handle: string, access: {
|
|
86
92
|
owner: string;
|
|
87
93
|
scope: string;
|
|
@@ -106,23 +112,10 @@ export interface ServiceDeps {
|
|
|
106
112
|
content: string;
|
|
107
113
|
details: unknown;
|
|
108
114
|
}>;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
} & Record<string, unknown>) | undefined>;
|
|
114
|
-
sessionStorage?: OwnerAwareSessionStore;
|
|
115
|
-
purgeSession?: (sessionId: string, owner: string | null) => Promise<{
|
|
116
|
-
deleted: boolean;
|
|
117
|
-
} | {
|
|
118
|
-
active: string;
|
|
119
|
-
}>;
|
|
120
|
-
instanceId?: string;
|
|
121
|
-
logger?: Logger;
|
|
122
|
-
metrics?: Metrics;
|
|
123
|
-
rateLimiter?: RateGate;
|
|
124
|
-
costQuota?: QuotaTracker;
|
|
125
|
-
fleetLease?: FleetLeaseManager;
|
|
115
|
+
memoryExport?: (scope: string) => Promise<MemoryEntry[]>;
|
|
116
|
+
memorySync?: (scope: string, syncReq: MemorySyncRequest) => Promise<MemorySyncResponse>;
|
|
117
|
+
sessionMirrorRuling?: (principal: string | undefined) => Promise<SessionMirrorRuling | undefined>;
|
|
118
|
+
instrumentDegenerate?: (result: TaskResult) => void;
|
|
126
119
|
sideQueryAccounting?: (principal: string | undefined, r: {
|
|
127
120
|
model: string;
|
|
128
121
|
family?: "input-includes-cached" | "input-excludes-cached";
|
|
@@ -136,46 +129,78 @@ export interface ServiceDeps {
|
|
|
136
129
|
};
|
|
137
130
|
};
|
|
138
131
|
}) => void;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
132
|
+
parkedReviveTool?: import("@sema-agent/core").ToolSpec;
|
|
133
|
+
parkedKnownAgentTypes?: ReadonlySet<string>;
|
|
134
|
+
parkedReviveInheritedGate?: (row: import("@sema-agent/core").BackgroundAgentRecord) => unknown;
|
|
135
|
+
}
|
|
136
|
+
export interface ServiceObservabilityDeps {
|
|
137
|
+
logger?: Logger;
|
|
138
|
+
metrics?: Metrics;
|
|
144
139
|
modelUsage?: ModelUsageTracker;
|
|
145
140
|
promptManifests?: PromptManifestTracker;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
planCacheProbe?: PlanCacheProbe;
|
|
142
|
+
}
|
|
143
|
+
export interface ServiceGovernanceDeps {
|
|
144
|
+
authorize?: (ctx: {
|
|
145
|
+
req: IncomingMessage;
|
|
146
|
+
body: TaskRequestBody;
|
|
147
|
+
}) => Promise<RequestAuth>;
|
|
148
|
+
registryJwtVerifier?: {
|
|
149
|
+
verify: (bearer: string) => Promise<import("../auth-bridge.js").VerifyOutcome>;
|
|
150
|
+
};
|
|
151
|
+
rateLimiter?: RateGate;
|
|
152
|
+
costQuota?: QuotaTracker;
|
|
153
|
+
fleetLease?: FleetLeaseManager;
|
|
154
|
+
}
|
|
155
|
+
export interface ServiceDeploymentDeps {
|
|
156
|
+
instanceId?: string;
|
|
155
157
|
capabilities?: Record<string, unknown>;
|
|
158
|
+
scenarioDetails?: Record<string, import("../capabilities/scenarios.js").ScenarioDetail>;
|
|
159
|
+
sessionStoreLabel?: string;
|
|
160
|
+
storeDegraded?: boolean;
|
|
161
|
+
drainState?: {
|
|
162
|
+
draining: boolean;
|
|
163
|
+
since?: number;
|
|
164
|
+
inflight?: () => number;
|
|
165
|
+
lastActivityAt?: () => number;
|
|
166
|
+
};
|
|
167
|
+
modelReady?: () => boolean;
|
|
156
168
|
restartState?: () => RestartSignal | undefined;
|
|
157
169
|
planeDeferredState?: () => {
|
|
158
170
|
version: number;
|
|
159
171
|
since: number;
|
|
160
172
|
blocked?: string[];
|
|
161
173
|
} | undefined;
|
|
174
|
+
workflowsCapable?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export interface ServiceKnobDeps {
|
|
177
|
+
snapshotBlobSqlCapBytes?: number;
|
|
178
|
+
sessionEventsMaxConnections?: number;
|
|
179
|
+
sessionEventsHeartbeatMs?: number;
|
|
180
|
+
sessionEventsStallMs?: number;
|
|
181
|
+
}
|
|
182
|
+
export interface ServiceDepGroups {
|
|
183
|
+
stores?: ServiceStoreDeps;
|
|
184
|
+
coordinators?: ServiceCoordinatorDeps;
|
|
185
|
+
seams?: ServiceSeamDeps;
|
|
186
|
+
observability?: ServiceObservabilityDeps;
|
|
187
|
+
governance?: ServiceGovernanceDeps;
|
|
188
|
+
deployment?: ServiceDeploymentDeps;
|
|
189
|
+
knobs?: ServiceKnobDeps;
|
|
162
190
|
}
|
|
191
|
+
export type FlatServiceDeps = ServiceCoreDeps & Partial<ServiceStoreDeps & ServiceCoordinatorDeps & ServiceSeamDeps & ServiceObservabilityDeps & ServiceGovernanceDeps & ServiceDeploymentDeps & ServiceKnobDeps>;
|
|
192
|
+
export type ServiceDeps = FlatServiceDeps & ServiceDepGroups;
|
|
193
|
+
export declare function flattenServiceDeps(deps: ServiceDeps): FlatServiceDeps;
|
|
163
194
|
export type { TaskRequestBody } from "./wire-types.js";
|
|
164
195
|
export declare const MAX_USER_SKILLS = 10;
|
|
165
196
|
export declare const MAX_SKILL_CONTENT_CHARS = 1048576;
|
|
166
197
|
export declare const MAX_SYSTEM_PROMPT_CHARS = 16384;
|
|
167
198
|
export declare const MAX_OUTPUT_SCHEMA_CHARS = 32768;
|
|
168
199
|
export declare function validateUserSkills(skills: unknown): string | null;
|
|
169
|
-
export declare function explicitOperatorOk(principal: string | undefined, operatorPrincipals: readonly string[]): boolean;
|
|
170
|
-
export declare function coarseStatusForState(state: BakeState): "running" | "done" | "failed";
|
|
171
|
-
export declare function errorCodeForExit(exitCode: number | null | undefined, cancelled: boolean): BakeErrorCode;
|
|
172
|
-
export declare function isOperator(principal: string | undefined, operatorPrincipals: readonly string[]): boolean;
|
|
173
|
-
export declare function explicitOperator(principal: string | undefined, operatorPrincipals: readonly string[]): boolean;
|
|
174
200
|
export declare function cascadeConfig(ladder: readonly string[], maxCostUsd?: number): CascadeConfig;
|
|
175
201
|
export declare function clampVerifyRounds(v: unknown): number;
|
|
176
|
-
export declare function scopedIdempotencyKey(raw: string | undefined, source: string | null, principal: string | undefined): string | undefined;
|
|
177
202
|
export declare function isQuestionAnswer(v: unknown): v is QuestionAnswer;
|
|
178
|
-
export declare function createHttpServer(
|
|
203
|
+
export declare function createHttpServer(rawDeps: ServiceDeps): http.Server & {
|
|
179
204
|
denyExpiredApprovals: (now: number) => Promise<void>;
|
|
180
205
|
};
|
|
181
206
|
export declare function streamApprovals(req: IncomingMessage, res: ServerResponse, cs: Pick<CheckpointStoreFull, "listPending">, scope: string | undefined, pollMs?: number): Promise<void>;
|