@sema-agent/server 1.311.0 → 1.312.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/auth-keys.d.ts +14 -0
- package/dist/auth-keys.js +31 -0
- package/dist/brain.d.ts +1 -1
- package/dist/capabilities/select-environment-tool.d.ts +1 -1
- package/dist/config-types.d.ts +306 -0
- package/dist/config-types.js +2 -0
- package/dist/config.d.ts +4 -305
- package/dist/config.js +1 -1
- package/dist/env-facts.d.ts +1 -1
- package/dist/hooks/hook-llm.d.ts +1 -1
- package/dist/http/server.d.ts +5 -85
- package/dist/http/wire-types.d.ts +84 -0
- package/dist/http/wire-types.js +2 -0
- package/dist/images/manifest.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/per-task-image.d.ts +2 -2
- package/dist/plugins/file-run-store.d.ts +1 -1
- package/dist/plugins/local-session-store.d.ts +2 -2
- package/dist/plugins/local-session-store.js +1 -1
- package/dist/plugins/memory-run-store.d.ts +1 -1
- package/dist/plugins/pg-image-bake.d.ts +2 -2
- package/dist/plugins/pg-image-bake.js +1 -1
- package/dist/plugins/pg-image-index.d.ts +2 -2
- package/dist/plugins/pg-image-index.js +1 -1
- package/dist/plugins/pg-pool.d.ts +1 -1
- package/dist/plugins/pg-run-store.d.ts +1 -1
- package/dist/plugins/pg-run-store.js +1 -1
- package/dist/plugins/pg-session-storage.d.ts +2 -2
- package/dist/plugins/pg-session-storage.js +2 -2
- package/dist/plugins/pg-tool-result-store.js +1 -1
- package/dist/plugins/session-store.d.ts +1 -1
- package/dist/plugins/sql-escape.d.ts +2 -0
- package/dist/plugins/sql-escape.js +4 -0
- package/dist/plugins/store-backend.d.ts +1 -1
- package/dist/plugins/store-contracts.d.ts +205 -0
- package/dist/plugins/store-contracts.js +61 -0
- package/dist/plugins/tidb-image-bake.d.ts +3 -95
- package/dist/plugins/tidb-image-bake.js +3 -35
- package/dist/plugins/tidb-image-index.d.ts +3 -76
- package/dist/plugins/tidb-image-index.js +2 -26
- package/dist/plugins/tidb-pool.d.ts +1 -1
- package/dist/plugins/tidb-run-store.d.ts +2 -32
- package/dist/plugins/tidb-run-store.js +1 -1
- package/dist/plugins/tidb-session-store.d.ts +2 -2
- package/dist/plugins/tidb-session-store.js +2 -2
- package/dist/plugins/tidb-tool-result-store.d.ts +1 -1
- package/dist/plugins/tidb-tool-result-store.js +2 -3
- package/dist/security.d.ts +6 -16
- package/dist/security.js +1 -30
- package/dist/sema-registry.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +47 -0
- package/dist/session-sync-kernel.js +47 -0
- package/dist/session-sync.d.ts +3 -45
- package/dist/session-sync.js +2 -46
- package/dist/trace/artifacts.d.ts +1 -1
- package/dist/trace/project.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ApprovalHmacKey {
|
|
2
|
+
kid: string;
|
|
3
|
+
key: string;
|
|
4
|
+
status?: "active" | "retiring";
|
|
5
|
+
}
|
|
6
|
+
export declare function parseApprovalHmacKeys(raw: string | undefined): ApprovalHmacKey[];
|
|
7
|
+
export interface PrincipalJwtKey {
|
|
8
|
+
kid: string;
|
|
9
|
+
alg: "EdDSA" | "RS256" | "ES256";
|
|
10
|
+
key: string;
|
|
11
|
+
status?: "active" | "retiring";
|
|
12
|
+
}
|
|
13
|
+
export declare function parsePrincipalJwks(raw: string | undefined): PrincipalJwtKey[];
|
|
14
|
+
//# sourceMappingURL=auth-keys.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function parseApprovalHmacKeys(raw) {
|
|
2
|
+
if (!raw)
|
|
3
|
+
return [];
|
|
4
|
+
try {
|
|
5
|
+
const v = JSON.parse(raw);
|
|
6
|
+
if (!Array.isArray(v))
|
|
7
|
+
return [];
|
|
8
|
+
return v.filter((k) => !!k && typeof k.kid === "string" && typeof k.key === "string");
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function parsePrincipalJwks(raw) {
|
|
15
|
+
if (!raw)
|
|
16
|
+
return [];
|
|
17
|
+
const ALGS = new Set(["EdDSA", "RS256", "ES256"]);
|
|
18
|
+
try {
|
|
19
|
+
const v = JSON.parse(raw);
|
|
20
|
+
if (!Array.isArray(v))
|
|
21
|
+
return [];
|
|
22
|
+
return v.filter((k) => {
|
|
23
|
+
const e = k;
|
|
24
|
+
return !!e && typeof e.kid === "string" && typeof e.key === "string" && typeof e.alg === "string" && ALGS.has(e.alg);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=auth-keys.js.map
|
package/dist/brain.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brain, type BreakerState } from "@sema-agent/core";
|
|
2
|
-
import type { ServiceConfig } from "./config.js";
|
|
2
|
+
import type { ServiceConfig } from "./config-types.js";
|
|
3
3
|
export declare function createBrain(config: ServiceConfig, deps?: {
|
|
4
4
|
fetchImpl?: typeof fetch;
|
|
5
5
|
breakerState?: BreakerState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolSpec } from "@sema-agent/core";
|
|
2
2
|
import { type SandboxImageResolver } from "../per-task-image.js";
|
|
3
|
-
import type { ImageViewer, ImageIndexEntry, ImageListFilter } from "../plugins/
|
|
3
|
+
import type { ImageViewer, ImageIndexEntry, ImageListFilter } from "../plugins/store-contracts.js";
|
|
4
4
|
export interface EnvironmentCatalog extends SandboxImageResolver {
|
|
5
5
|
list(filter: ImageListFilter): Promise<{
|
|
6
6
|
entries: ImageIndexEntry[];
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import type { SealedKeyPoison } from "./sealed-key.js";
|
|
2
|
+
import type { McpServerSpec, Model, ModelRoles } from "@sema-agent/core";
|
|
3
|
+
import type { ApprovalHmacKey, PrincipalJwtKey } from "./auth-keys.js";
|
|
4
|
+
import type { ElicitationThrottle } from "./elicitation.js";
|
|
5
|
+
import type { InfraCostRates } from "./finance/cost-taxonomy.js";
|
|
6
|
+
import type { Autonomy, CommandRule } from "./runtime-governance.js";
|
|
7
|
+
export interface ScopedMcpServer {
|
|
8
|
+
scenarios: string[];
|
|
9
|
+
spec: McpServerSpec;
|
|
10
|
+
}
|
|
11
|
+
export interface ImageBakeConfig {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
runnerPrincipal: string;
|
|
14
|
+
registry: string | null;
|
|
15
|
+
cacheBase: string | null;
|
|
16
|
+
defaultBaseRef: string | null;
|
|
17
|
+
leaseMs: number;
|
|
18
|
+
staleMs: number;
|
|
19
|
+
submitRateMax: number;
|
|
20
|
+
submitRateWindowSec: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ServiceConfig {
|
|
23
|
+
port: number;
|
|
24
|
+
gatewayBaseUrl: string;
|
|
25
|
+
gatewayApiKey?: string;
|
|
26
|
+
gatewayFallbackUrls: string[];
|
|
27
|
+
anthropic?: {
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
authToken?: string;
|
|
30
|
+
baseUrl?: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
cacheBreakpoints: boolean;
|
|
33
|
+
maxRetries: number;
|
|
34
|
+
};
|
|
35
|
+
resilience: {
|
|
36
|
+
connectTimeoutMs: number;
|
|
37
|
+
firstTokenTimeoutMs: number;
|
|
38
|
+
idleTimeoutMs: number;
|
|
39
|
+
circuitBreaker: boolean;
|
|
40
|
+
failureThreshold: number;
|
|
41
|
+
cooldownMs: number;
|
|
42
|
+
};
|
|
43
|
+
model: Model;
|
|
44
|
+
models: Record<string, Model>;
|
|
45
|
+
modelApiKeyEnv: Record<string, string>;
|
|
46
|
+
modelApiKeys: Record<string, string | SealedKeyPoison>;
|
|
47
|
+
modelQuotaWeights: Record<string, number>;
|
|
48
|
+
tiers: Record<string, string>;
|
|
49
|
+
projects: Record<string, {
|
|
50
|
+
displayName?: string;
|
|
51
|
+
gitRemotes?: string[];
|
|
52
|
+
defaultScopes?: string[];
|
|
53
|
+
}>;
|
|
54
|
+
roles: ModelRoles;
|
|
55
|
+
sessionBackend: "memory" | "tidb" | "auto";
|
|
56
|
+
sessionCacheTtlSec: number;
|
|
57
|
+
rewindSnapshotMaxMb?: number;
|
|
58
|
+
memoryEngineEnabled: boolean;
|
|
59
|
+
memoryEngineDir?: string;
|
|
60
|
+
memoryEngineRemoteLaneAllowed: boolean;
|
|
61
|
+
memoryScope?: string;
|
|
62
|
+
memorySync?: {
|
|
63
|
+
url: string;
|
|
64
|
+
token: string;
|
|
65
|
+
scope: string;
|
|
66
|
+
maxPushEntries?: number;
|
|
67
|
+
maxPullEntries?: number;
|
|
68
|
+
};
|
|
69
|
+
remoteExec?: {
|
|
70
|
+
provider: "e2b";
|
|
71
|
+
apiKey: string;
|
|
72
|
+
template?: string;
|
|
73
|
+
timeoutMs?: number;
|
|
74
|
+
livenessMs?: number;
|
|
75
|
+
allowInternetAccess?: boolean;
|
|
76
|
+
sandboxEnv?: Record<string, string>;
|
|
77
|
+
mountPath?: string;
|
|
78
|
+
} | {
|
|
79
|
+
provider: "k8s";
|
|
80
|
+
image: string;
|
|
81
|
+
apiUrl?: string;
|
|
82
|
+
token?: string;
|
|
83
|
+
caCert?: string;
|
|
84
|
+
insecureTls?: boolean;
|
|
85
|
+
namespace?: string;
|
|
86
|
+
runtimeClass?: string;
|
|
87
|
+
mountPath?: string;
|
|
88
|
+
timeoutMs?: number;
|
|
89
|
+
memory?: string;
|
|
90
|
+
cpu?: string;
|
|
91
|
+
s3Snapshot?: {
|
|
92
|
+
endpoint: string;
|
|
93
|
+
bucket: string;
|
|
94
|
+
accessKey: string;
|
|
95
|
+
secretKey: string;
|
|
96
|
+
region?: string;
|
|
97
|
+
keyPrefix?: string;
|
|
98
|
+
presignTtlSec?: number;
|
|
99
|
+
};
|
|
100
|
+
} | {
|
|
101
|
+
provider: "ssh";
|
|
102
|
+
host: string;
|
|
103
|
+
port?: number;
|
|
104
|
+
username: string;
|
|
105
|
+
privateKey: string;
|
|
106
|
+
mountPath?: string;
|
|
107
|
+
} | {
|
|
108
|
+
provider: "adb";
|
|
109
|
+
serial: string;
|
|
110
|
+
adbPath?: string;
|
|
111
|
+
mountPath?: string;
|
|
112
|
+
} | {
|
|
113
|
+
provider: "host";
|
|
114
|
+
workspaceBase?: string;
|
|
115
|
+
commandTimeoutMs?: number;
|
|
116
|
+
} | {
|
|
117
|
+
provider: "local-docker";
|
|
118
|
+
image: string;
|
|
119
|
+
mountPath?: string;
|
|
120
|
+
dockerPath?: string;
|
|
121
|
+
dockerHost?: string;
|
|
122
|
+
memory?: string;
|
|
123
|
+
cpus?: number;
|
|
124
|
+
pidsLimit?: number;
|
|
125
|
+
dropAllCaps?: boolean;
|
|
126
|
+
network?: "none" | "bridge" | "host";
|
|
127
|
+
commandTimeoutMs?: number;
|
|
128
|
+
env?: Record<string, string>;
|
|
129
|
+
};
|
|
130
|
+
worktreeIsolation?: {
|
|
131
|
+
repoRoot: string;
|
|
132
|
+
allowedRoots?: string[];
|
|
133
|
+
commit?: string;
|
|
134
|
+
};
|
|
135
|
+
mcpServers?: ScopedMcpServer[];
|
|
136
|
+
tidb?: {
|
|
137
|
+
host: string;
|
|
138
|
+
port: number;
|
|
139
|
+
user: string;
|
|
140
|
+
password: string;
|
|
141
|
+
database: string;
|
|
142
|
+
connectionLimit?: number;
|
|
143
|
+
};
|
|
144
|
+
dbBackend: "mysql" | "pg" | "local" | "memory";
|
|
145
|
+
dbBackendExplicit: boolean;
|
|
146
|
+
localDataRoot?: string;
|
|
147
|
+
pg?: {
|
|
148
|
+
host: string;
|
|
149
|
+
port: number;
|
|
150
|
+
user: string;
|
|
151
|
+
password: string;
|
|
152
|
+
database: string;
|
|
153
|
+
connectionLimit?: number;
|
|
154
|
+
};
|
|
155
|
+
dbQueryTimeoutMs?: number;
|
|
156
|
+
snapshotBlobStore?: {
|
|
157
|
+
endpoint: string;
|
|
158
|
+
bucket: string;
|
|
159
|
+
accessKey: string;
|
|
160
|
+
secretKey: string;
|
|
161
|
+
region?: string;
|
|
162
|
+
keyPrefix?: string;
|
|
163
|
+
presignTtlSec?: number;
|
|
164
|
+
};
|
|
165
|
+
snapshotBlobSqlMaxBytes?: number;
|
|
166
|
+
snapshotBlobAllowSql: boolean;
|
|
167
|
+
pluginsAllowHosts: string[];
|
|
168
|
+
bindHost?: string;
|
|
169
|
+
attachmentOrphanGraceMs: number;
|
|
170
|
+
workspaceFileMaxBytes: number;
|
|
171
|
+
sendUserFile?: {
|
|
172
|
+
endpoint: string;
|
|
173
|
+
publicEndpoint?: string;
|
|
174
|
+
publicBucket: string;
|
|
175
|
+
privateBucket: string;
|
|
176
|
+
privateKeyPrefix: string;
|
|
177
|
+
sandboxPutEndpoint?: string;
|
|
178
|
+
accessKey: string;
|
|
179
|
+
secretKey: string;
|
|
180
|
+
region?: string;
|
|
181
|
+
defaultTtlSec: number;
|
|
182
|
+
};
|
|
183
|
+
authToken?: string;
|
|
184
|
+
authTokens: Record<string, string>;
|
|
185
|
+
allowUnauthedWrites?: boolean;
|
|
186
|
+
metricsToken?: string;
|
|
187
|
+
traceToken?: string;
|
|
188
|
+
corsOrigins: string[];
|
|
189
|
+
attachmentMaxBytes: number;
|
|
190
|
+
attachmentMimeAllowlist?: string[];
|
|
191
|
+
attachmentUnboundTtlMs: number;
|
|
192
|
+
principalHeader: string;
|
|
193
|
+
requirePrincipal: boolean;
|
|
194
|
+
autonomy?: Autonomy;
|
|
195
|
+
commandPolicy?: CommandRule[];
|
|
196
|
+
approvalRequire: string[];
|
|
197
|
+
operatorPrincipals: string[];
|
|
198
|
+
approvalDeny: string[];
|
|
199
|
+
approvalPollMs: number;
|
|
200
|
+
durableApproval: boolean;
|
|
201
|
+
resourceSuspend: boolean;
|
|
202
|
+
resourceSuspendTtlSec: number;
|
|
203
|
+
approvalAutoBudget: number;
|
|
204
|
+
approvalNeverAuto: string[];
|
|
205
|
+
approvalHmacKeys: ApprovalHmacKey[];
|
|
206
|
+
directApprovalDoor: boolean;
|
|
207
|
+
principalJwtPubkeys: PrincipalJwtKey[];
|
|
208
|
+
principalJwtIss?: string;
|
|
209
|
+
principalJwtAud?: string;
|
|
210
|
+
principalJwtMaxTtlSec: number;
|
|
211
|
+
directDoorActive: boolean;
|
|
212
|
+
infraCostRates: InfraCostRates;
|
|
213
|
+
leaderEnabled: boolean;
|
|
214
|
+
leaderFanoutEnabled: boolean;
|
|
215
|
+
routerEnabled: boolean;
|
|
216
|
+
selfOrchestrationEnabled: boolean;
|
|
217
|
+
forkEnabled: boolean;
|
|
218
|
+
experimentalObserverAgents: boolean;
|
|
219
|
+
selfOrchestrationModels: string[];
|
|
220
|
+
selfOrchestrationWorkerIsolation: boolean;
|
|
221
|
+
workflowRunStoreBackend: "auto" | "file" | "memory";
|
|
222
|
+
workflowOrphanGraceMs: number;
|
|
223
|
+
schedulerEnabled: boolean;
|
|
224
|
+
projectMemoryDisabled: boolean;
|
|
225
|
+
schedulerStorePath?: string;
|
|
226
|
+
configBootFetchBudgetMs: number;
|
|
227
|
+
schedulerSessionWakeup: boolean;
|
|
228
|
+
planModeEnabled: boolean;
|
|
229
|
+
workflowJournalRetentionMs: number;
|
|
230
|
+
workflowRunRetentionMs: number;
|
|
231
|
+
backgroundAgentRetentionMs: number;
|
|
232
|
+
backgroundAgentStaleRunningMs: number;
|
|
233
|
+
backgroundAgentParkClaimStaleMs: number;
|
|
234
|
+
rosterRetentionMs: number;
|
|
235
|
+
scratchpadSweepTtlMs: number;
|
|
236
|
+
sandboxPkgSource?: string;
|
|
237
|
+
sessionAutoTitle: boolean;
|
|
238
|
+
selectEnvironmentTool: boolean;
|
|
239
|
+
envFactsEnabled: boolean;
|
|
240
|
+
sensitiveWritePatterns: string[];
|
|
241
|
+
manualModeShellGate?: "always" | "classify";
|
|
242
|
+
toolDeferLongtail: boolean;
|
|
243
|
+
lspEnabled: boolean;
|
|
244
|
+
lspHostEnabled: boolean;
|
|
245
|
+
drainGraceMs: number;
|
|
246
|
+
sighupIdleGraceMs: number;
|
|
247
|
+
mcpElicitation: {
|
|
248
|
+
enabled: boolean;
|
|
249
|
+
throttle: ElicitationThrottle;
|
|
250
|
+
};
|
|
251
|
+
askQuestionEnabled: boolean;
|
|
252
|
+
toolApprovalEnabled: boolean;
|
|
253
|
+
workflowAgentsReadOnly: boolean;
|
|
254
|
+
imageBakes: ImageBakeConfig;
|
|
255
|
+
toolTrace: boolean;
|
|
256
|
+
traceThinking: boolean;
|
|
257
|
+
logLevel: "debug" | "info" | "warn" | "error";
|
|
258
|
+
rateLimitPerMin: number;
|
|
259
|
+
maxTaskCostUsd: number;
|
|
260
|
+
maxTaskTokens: number;
|
|
261
|
+
maxPrincipalCostUsd: number;
|
|
262
|
+
costQuotaWindowSec: number;
|
|
263
|
+
degrade?: {
|
|
264
|
+
to: string;
|
|
265
|
+
atCostFraction: number;
|
|
266
|
+
reactive: boolean;
|
|
267
|
+
downgradeOn?: ("rate_limit" | "breaker_open")[];
|
|
268
|
+
toSupportsImages: boolean;
|
|
269
|
+
};
|
|
270
|
+
cascadeLadder: string[];
|
|
271
|
+
otel?: {
|
|
272
|
+
endpoint: string;
|
|
273
|
+
intervalMs: number;
|
|
274
|
+
serviceName: string;
|
|
275
|
+
headers: Record<string, string>;
|
|
276
|
+
};
|
|
277
|
+
approvalTimeoutSec: number;
|
|
278
|
+
reapIntervalSec: number;
|
|
279
|
+
toolResultTtlSec: number;
|
|
280
|
+
runStaleSec: number;
|
|
281
|
+
syncImportLeaseStaleSec: number;
|
|
282
|
+
gitApiBaseUrl?: string;
|
|
283
|
+
gitApiToken?: string;
|
|
284
|
+
memoryEngineBackend: "file" | "pg" | "tidb";
|
|
285
|
+
workflowSizeGuideline?: "small" | "medium" | "large" | "unrestricted";
|
|
286
|
+
defaultScenario: string;
|
|
287
|
+
skillsDir: string;
|
|
288
|
+
oaApiBaseUrl?: string;
|
|
289
|
+
oaServiceToken?: string;
|
|
290
|
+
oaIssue?: {
|
|
291
|
+
baseUrl: string;
|
|
292
|
+
owner: string;
|
|
293
|
+
repo: string;
|
|
294
|
+
token: string;
|
|
295
|
+
defaultLabels?: number[];
|
|
296
|
+
};
|
|
297
|
+
configCenter?: {
|
|
298
|
+
baseUrl: string;
|
|
299
|
+
token: string;
|
|
300
|
+
dryRun: boolean;
|
|
301
|
+
worker?: string;
|
|
302
|
+
};
|
|
303
|
+
configProvider?: string;
|
|
304
|
+
configLocalDir?: string;
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=config-types.d.ts.map
|
package/dist/config.d.ts
CHANGED
|
@@ -1,308 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import type { InfraCostRates } from "./finance/cost-taxonomy.js";
|
|
6
|
-
import type { Autonomy, CommandRule } from "./runtime-governance.js";
|
|
7
|
-
export interface ScopedMcpServer {
|
|
8
|
-
scenarios: string[];
|
|
9
|
-
spec: McpServerSpec;
|
|
10
|
-
}
|
|
11
|
-
export interface ImageBakeConfig {
|
|
12
|
-
enabled: boolean;
|
|
13
|
-
runnerPrincipal: string;
|
|
14
|
-
registry: string | null;
|
|
15
|
-
cacheBase: string | null;
|
|
16
|
-
defaultBaseRef: string | null;
|
|
17
|
-
leaseMs: number;
|
|
18
|
-
staleMs: number;
|
|
19
|
-
submitRateMax: number;
|
|
20
|
-
submitRateWindowSec: number;
|
|
21
|
-
}
|
|
22
|
-
export interface ServiceConfig {
|
|
23
|
-
port: number;
|
|
24
|
-
gatewayBaseUrl: string;
|
|
25
|
-
gatewayApiKey?: string;
|
|
26
|
-
gatewayFallbackUrls: string[];
|
|
27
|
-
anthropic?: {
|
|
28
|
-
apiKey?: string;
|
|
29
|
-
authToken?: string;
|
|
30
|
-
baseUrl?: string;
|
|
31
|
-
version?: string;
|
|
32
|
-
cacheBreakpoints: boolean;
|
|
33
|
-
maxRetries: number;
|
|
34
|
-
};
|
|
35
|
-
resilience: {
|
|
36
|
-
connectTimeoutMs: number;
|
|
37
|
-
firstTokenTimeoutMs: number;
|
|
38
|
-
idleTimeoutMs: number;
|
|
39
|
-
circuitBreaker: boolean;
|
|
40
|
-
failureThreshold: number;
|
|
41
|
-
cooldownMs: number;
|
|
42
|
-
};
|
|
43
|
-
model: Model;
|
|
44
|
-
models: Record<string, Model>;
|
|
45
|
-
modelApiKeyEnv: Record<string, string>;
|
|
46
|
-
modelApiKeys: Record<string, string | SealedKeyPoison>;
|
|
47
|
-
modelQuotaWeights: Record<string, number>;
|
|
48
|
-
tiers: Record<string, string>;
|
|
49
|
-
projects: Record<string, {
|
|
50
|
-
displayName?: string;
|
|
51
|
-
gitRemotes?: string[];
|
|
52
|
-
defaultScopes?: string[];
|
|
53
|
-
}>;
|
|
54
|
-
roles: ModelRoles;
|
|
55
|
-
sessionBackend: "memory" | "tidb" | "auto";
|
|
56
|
-
sessionCacheTtlSec: number;
|
|
57
|
-
rewindSnapshotMaxMb?: number;
|
|
58
|
-
memoryEngineEnabled: boolean;
|
|
59
|
-
memoryEngineDir?: string;
|
|
60
|
-
memoryEngineRemoteLaneAllowed: boolean;
|
|
61
|
-
memoryScope?: string;
|
|
62
|
-
memorySync?: {
|
|
63
|
-
url: string;
|
|
64
|
-
token: string;
|
|
65
|
-
scope: string;
|
|
66
|
-
maxPushEntries?: number;
|
|
67
|
-
maxPullEntries?: number;
|
|
68
|
-
};
|
|
69
|
-
remoteExec?: {
|
|
70
|
-
provider: "e2b";
|
|
71
|
-
apiKey: string;
|
|
72
|
-
template?: string;
|
|
73
|
-
timeoutMs?: number;
|
|
74
|
-
livenessMs?: number;
|
|
75
|
-
allowInternetAccess?: boolean;
|
|
76
|
-
sandboxEnv?: Record<string, string>;
|
|
77
|
-
mountPath?: string;
|
|
78
|
-
} | {
|
|
79
|
-
provider: "k8s";
|
|
80
|
-
image: string;
|
|
81
|
-
apiUrl?: string;
|
|
82
|
-
token?: string;
|
|
83
|
-
caCert?: string;
|
|
84
|
-
insecureTls?: boolean;
|
|
85
|
-
namespace?: string;
|
|
86
|
-
runtimeClass?: string;
|
|
87
|
-
mountPath?: string;
|
|
88
|
-
timeoutMs?: number;
|
|
89
|
-
memory?: string;
|
|
90
|
-
cpu?: string;
|
|
91
|
-
s3Snapshot?: {
|
|
92
|
-
endpoint: string;
|
|
93
|
-
bucket: string;
|
|
94
|
-
accessKey: string;
|
|
95
|
-
secretKey: string;
|
|
96
|
-
region?: string;
|
|
97
|
-
keyPrefix?: string;
|
|
98
|
-
presignTtlSec?: number;
|
|
99
|
-
};
|
|
100
|
-
} | {
|
|
101
|
-
provider: "ssh";
|
|
102
|
-
host: string;
|
|
103
|
-
port?: number;
|
|
104
|
-
username: string;
|
|
105
|
-
privateKey: string;
|
|
106
|
-
mountPath?: string;
|
|
107
|
-
} | {
|
|
108
|
-
provider: "adb";
|
|
109
|
-
serial: string;
|
|
110
|
-
adbPath?: string;
|
|
111
|
-
mountPath?: string;
|
|
112
|
-
} | {
|
|
113
|
-
provider: "host";
|
|
114
|
-
workspaceBase?: string;
|
|
115
|
-
commandTimeoutMs?: number;
|
|
116
|
-
} | {
|
|
117
|
-
provider: "local-docker";
|
|
118
|
-
image: string;
|
|
119
|
-
mountPath?: string;
|
|
120
|
-
dockerPath?: string;
|
|
121
|
-
dockerHost?: string;
|
|
122
|
-
memory?: string;
|
|
123
|
-
cpus?: number;
|
|
124
|
-
pidsLimit?: number;
|
|
125
|
-
dropAllCaps?: boolean;
|
|
126
|
-
network?: "none" | "bridge" | "host";
|
|
127
|
-
commandTimeoutMs?: number;
|
|
128
|
-
env?: Record<string, string>;
|
|
129
|
-
};
|
|
130
|
-
worktreeIsolation?: {
|
|
131
|
-
repoRoot: string;
|
|
132
|
-
allowedRoots?: string[];
|
|
133
|
-
commit?: string;
|
|
134
|
-
};
|
|
135
|
-
mcpServers?: ScopedMcpServer[];
|
|
136
|
-
tidb?: {
|
|
137
|
-
host: string;
|
|
138
|
-
port: number;
|
|
139
|
-
user: string;
|
|
140
|
-
password: string;
|
|
141
|
-
database: string;
|
|
142
|
-
connectionLimit?: number;
|
|
143
|
-
};
|
|
144
|
-
dbBackend: "mysql" | "pg" | "local" | "memory";
|
|
145
|
-
dbBackendExplicit: boolean;
|
|
146
|
-
localDataRoot?: string;
|
|
147
|
-
pg?: {
|
|
148
|
-
host: string;
|
|
149
|
-
port: number;
|
|
150
|
-
user: string;
|
|
151
|
-
password: string;
|
|
152
|
-
database: string;
|
|
153
|
-
connectionLimit?: number;
|
|
154
|
-
};
|
|
155
|
-
dbQueryTimeoutMs?: number;
|
|
156
|
-
snapshotBlobStore?: {
|
|
157
|
-
endpoint: string;
|
|
158
|
-
bucket: string;
|
|
159
|
-
accessKey: string;
|
|
160
|
-
secretKey: string;
|
|
161
|
-
region?: string;
|
|
162
|
-
keyPrefix?: string;
|
|
163
|
-
presignTtlSec?: number;
|
|
164
|
-
};
|
|
165
|
-
snapshotBlobSqlMaxBytes?: number;
|
|
166
|
-
snapshotBlobAllowSql: boolean;
|
|
167
|
-
pluginsAllowHosts: string[];
|
|
168
|
-
bindHost?: string;
|
|
169
|
-
attachmentOrphanGraceMs: number;
|
|
170
|
-
workspaceFileMaxBytes: number;
|
|
171
|
-
sendUserFile?: {
|
|
172
|
-
endpoint: string;
|
|
173
|
-
publicEndpoint?: string;
|
|
174
|
-
publicBucket: string;
|
|
175
|
-
privateBucket: string;
|
|
176
|
-
privateKeyPrefix: string;
|
|
177
|
-
sandboxPutEndpoint?: string;
|
|
178
|
-
accessKey: string;
|
|
179
|
-
secretKey: string;
|
|
180
|
-
region?: string;
|
|
181
|
-
defaultTtlSec: number;
|
|
182
|
-
};
|
|
183
|
-
authToken?: string;
|
|
184
|
-
authTokens: Record<string, string>;
|
|
185
|
-
allowUnauthedWrites?: boolean;
|
|
186
|
-
metricsToken?: string;
|
|
187
|
-
traceToken?: string;
|
|
188
|
-
corsOrigins: string[];
|
|
189
|
-
attachmentMaxBytes: number;
|
|
190
|
-
attachmentMimeAllowlist?: string[];
|
|
191
|
-
attachmentUnboundTtlMs: number;
|
|
192
|
-
principalHeader: string;
|
|
193
|
-
requirePrincipal: boolean;
|
|
194
|
-
autonomy?: Autonomy;
|
|
195
|
-
commandPolicy?: CommandRule[];
|
|
196
|
-
approvalRequire: string[];
|
|
197
|
-
operatorPrincipals: string[];
|
|
198
|
-
approvalDeny: string[];
|
|
199
|
-
approvalPollMs: number;
|
|
200
|
-
durableApproval: boolean;
|
|
201
|
-
resourceSuspend: boolean;
|
|
202
|
-
resourceSuspendTtlSec: number;
|
|
203
|
-
approvalAutoBudget: number;
|
|
204
|
-
approvalNeverAuto: string[];
|
|
205
|
-
approvalHmacKeys: ApprovalHmacKey[];
|
|
206
|
-
directApprovalDoor: boolean;
|
|
207
|
-
principalJwtPubkeys: PrincipalJwtKey[];
|
|
208
|
-
principalJwtIss?: string;
|
|
209
|
-
principalJwtAud?: string;
|
|
210
|
-
principalJwtMaxTtlSec: number;
|
|
211
|
-
directDoorActive: boolean;
|
|
212
|
-
infraCostRates: InfraCostRates;
|
|
213
|
-
leaderEnabled: boolean;
|
|
214
|
-
leaderFanoutEnabled: boolean;
|
|
215
|
-
routerEnabled: boolean;
|
|
216
|
-
selfOrchestrationEnabled: boolean;
|
|
217
|
-
forkEnabled: boolean;
|
|
218
|
-
experimentalObserverAgents: boolean;
|
|
219
|
-
selfOrchestrationModels: string[];
|
|
220
|
-
selfOrchestrationWorkerIsolation: boolean;
|
|
221
|
-
workflowRunStoreBackend: "auto" | "file" | "memory";
|
|
222
|
-
workflowOrphanGraceMs: number;
|
|
223
|
-
schedulerEnabled: boolean;
|
|
224
|
-
projectMemoryDisabled: boolean;
|
|
225
|
-
schedulerStorePath?: string;
|
|
226
|
-
configBootFetchBudgetMs: number;
|
|
227
|
-
schedulerSessionWakeup: boolean;
|
|
228
|
-
planModeEnabled: boolean;
|
|
229
|
-
workflowJournalRetentionMs: number;
|
|
230
|
-
workflowRunRetentionMs: number;
|
|
231
|
-
backgroundAgentRetentionMs: number;
|
|
232
|
-
backgroundAgentStaleRunningMs: number;
|
|
233
|
-
backgroundAgentParkClaimStaleMs: number;
|
|
234
|
-
rosterRetentionMs: number;
|
|
235
|
-
scratchpadSweepTtlMs: number;
|
|
236
|
-
sandboxPkgSource?: string;
|
|
237
|
-
sessionAutoTitle: boolean;
|
|
238
|
-
selectEnvironmentTool: boolean;
|
|
239
|
-
envFactsEnabled: boolean;
|
|
240
|
-
sensitiveWritePatterns: string[];
|
|
241
|
-
manualModeShellGate?: "always" | "classify";
|
|
242
|
-
toolDeferLongtail: boolean;
|
|
243
|
-
lspEnabled: boolean;
|
|
244
|
-
lspHostEnabled: boolean;
|
|
245
|
-
drainGraceMs: number;
|
|
246
|
-
sighupIdleGraceMs: number;
|
|
247
|
-
mcpElicitation: {
|
|
248
|
-
enabled: boolean;
|
|
249
|
-
throttle: ElicitationThrottle;
|
|
250
|
-
};
|
|
251
|
-
askQuestionEnabled: boolean;
|
|
252
|
-
toolApprovalEnabled: boolean;
|
|
253
|
-
workflowAgentsReadOnly: boolean;
|
|
254
|
-
imageBakes: ImageBakeConfig;
|
|
255
|
-
toolTrace: boolean;
|
|
256
|
-
traceThinking: boolean;
|
|
257
|
-
logLevel: "debug" | "info" | "warn" | "error";
|
|
258
|
-
rateLimitPerMin: number;
|
|
259
|
-
maxTaskCostUsd: number;
|
|
260
|
-
maxTaskTokens: number;
|
|
261
|
-
maxPrincipalCostUsd: number;
|
|
262
|
-
costQuotaWindowSec: number;
|
|
263
|
-
degrade?: {
|
|
264
|
-
to: string;
|
|
265
|
-
atCostFraction: number;
|
|
266
|
-
reactive: boolean;
|
|
267
|
-
downgradeOn?: ("rate_limit" | "breaker_open")[];
|
|
268
|
-
toSupportsImages: boolean;
|
|
269
|
-
};
|
|
270
|
-
cascadeLadder: string[];
|
|
271
|
-
otel?: {
|
|
272
|
-
endpoint: string;
|
|
273
|
-
intervalMs: number;
|
|
274
|
-
serviceName: string;
|
|
275
|
-
headers: Record<string, string>;
|
|
276
|
-
};
|
|
277
|
-
approvalTimeoutSec: number;
|
|
278
|
-
reapIntervalSec: number;
|
|
279
|
-
toolResultTtlSec: number;
|
|
280
|
-
runStaleSec: number;
|
|
281
|
-
syncImportLeaseStaleSec: number;
|
|
282
|
-
gitApiBaseUrl?: string;
|
|
283
|
-
gitApiToken?: string;
|
|
284
|
-
memoryEngineBackend: "file" | "pg" | "tidb";
|
|
285
|
-
workflowSizeGuideline?: "small" | "medium" | "large" | "unrestricted";
|
|
286
|
-
defaultScenario: string;
|
|
287
|
-
skillsDir: string;
|
|
288
|
-
oaApiBaseUrl?: string;
|
|
289
|
-
oaServiceToken?: string;
|
|
290
|
-
oaIssue?: {
|
|
291
|
-
baseUrl: string;
|
|
292
|
-
owner: string;
|
|
293
|
-
repo: string;
|
|
294
|
-
token: string;
|
|
295
|
-
defaultLabels?: number[];
|
|
296
|
-
};
|
|
297
|
-
configCenter?: {
|
|
298
|
-
baseUrl: string;
|
|
299
|
-
token: string;
|
|
300
|
-
dryRun: boolean;
|
|
301
|
-
worker?: string;
|
|
302
|
-
};
|
|
303
|
-
configProvider?: string;
|
|
304
|
-
configLocalDir?: string;
|
|
305
|
-
}
|
|
1
|
+
import { type Model } from "@sema-agent/core";
|
|
2
|
+
import type { Autonomy } from "./runtime-governance.js";
|
|
3
|
+
import type { ServiceConfig } from "./config-types.js";
|
|
4
|
+
export type { ServiceConfig, ScopedMcpServer, ImageBakeConfig } from "./config-types.js";
|
|
306
5
|
export declare function parseAutonomy(raw: string | undefined): Autonomy | undefined;
|
|
307
6
|
export declare function drainConfigWarnings(): Array<{
|
|
308
7
|
env: string;
|
package/dist/config.js
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { CODE_AGENT_PROMPT, formatUserScope, isThinkingLevel, RECOMMENDED_SENSITIVE_PATTERNS } from "@sema-agent/core";
|
|
5
5
|
import { ROSTER_PRIMARY_ROLES, ROSTER_CHEAP_ROLES } from "@sema-agent/registry-core";
|
|
6
|
-
import { parseApprovalHmacKeys, parsePrincipalJwks } from "./
|
|
6
|
+
import { parseApprovalHmacKeys, parsePrincipalJwks } from "./auth-keys.js";
|
|
7
7
|
import { DEFAULT_ELICITATION_THROTTLE } from "./elicitation.js";
|
|
8
8
|
function csv(name) {
|
|
9
9
|
return (process.env[name] ?? "")
|
package/dist/env-facts.d.ts
CHANGED