@sema-agent/core 5.36.0 → 5.38.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/CHANGELOG.md +124 -0
- package/dist/agents/subagent.d.ts +10 -0
- package/dist/agents/subagent.js +6 -0
- package/dist/agents/teacher.js +3 -0
- package/dist/agents/team.d.ts +7 -1
- package/dist/agents/team.js +11 -9
- package/dist/agents/verify.js +3 -0
- package/dist/core/auto-mode-prompt-assets.d.ts +5 -3
- package/dist/core/auto-mode-prompt-assets.js +1 -1
- package/dist/core/checkpoint-store.d.ts +26 -1
- package/dist/core/governance-codes.js +4 -0
- package/dist/core/hooks.d.ts +129 -2
- package/dist/core/hooks.js +20 -3
- package/dist/core/memory-engine/engine.d.ts +142 -0
- package/dist/core/memory-engine/engine.js +264 -2
- package/dist/core/memory-engine/file-backend.d.ts +490 -16
- package/dist/core/memory-engine/file-backend.js +1099 -36
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layout.d.ts +42 -2
- package/dist/core/memory-engine/layout.js +76 -12
- package/dist/core/memory-engine/memory-backend-contract.d.ts +13 -0
- package/dist/core/memory-engine/memory-backend-contract.js +89 -0
- package/dist/core/protocol-table.d.ts +4 -4
- package/dist/core/runner/assemble-result.d.ts +5 -0
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/prepare-config-doors.d.ts +17 -0
- package/dist/core/runner/prepare-config-doors.js +33 -2
- package/dist/core/runner/prepare-memory.d.ts +11 -1
- package/dist/core/runner/prepare-memory.js +48 -2
- package/dist/core/runner/prepare-task.d.ts +22 -2
- package/dist/core/runner/prepare-task.js +125 -42
- package/dist/core/runner/runtask.js +50 -11
- package/dist/core/tool-model-gate.d.ts +125 -0
- package/dist/core/tool-model-gate.js +303 -0
- package/dist/core/tool-policy.d.ts +1 -1
- package/dist/core/types.d.ts +284 -1
- package/dist/core/types.js +21 -0
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -2
- package/dist/orchestration/builtin-workflows.d.ts +68 -6
- package/dist/orchestration/builtin-workflows.js +26 -9
- package/dist/orchestration/run-workflow-tool.d.ts +10 -1
- package/dist/orchestration/run-workflow-tool.js +70 -27
- package/dist/orchestration/workflow-script-store.d.ts +8 -3
- package/dist/prompts/coordinator.d.ts +4 -1
- package/dist/prompts/coordinator.js +8 -0
- package/dist/prompts/default.d.ts +14 -4
- package/dist/prompts/default.js +2 -1
- package/dist/scenarios/full-body.d.ts +5 -0
- package/dist/scenarios/full-body.js +8 -4
- package/dist/tools/fs/fs-shared.d.ts +3 -2
- package/dist/tools/fs/fs-shared.js +19 -9
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +24 -1
|
@@ -28,6 +28,8 @@ export interface CodeToolsConfig {
|
|
|
28
28
|
* parity: TodoWrite is enabled only when the task list is off). With `taskList` on (the default),
|
|
29
29
|
* TodoWrite is NOT mounted even when `todoWrite: true` is set explicitly — the exclusion gate wins;
|
|
30
30
|
* pass `taskList: false` to get TodoWrite back. `todoWrite: false` always drops it.
|
|
31
|
+
* design/277: the DEFAULT arm (undefined) is model-gated (`modelGate: "task-scaffold"` — trimmed
|
|
32
|
+
* at prepare for gate-table models); an EXPLICIT `true` mounts unstamped (never gated).
|
|
31
33
|
*/
|
|
32
34
|
todoWrite?: boolean;
|
|
33
35
|
/**
|
|
@@ -36,6 +38,9 @@ export interface CodeToolsConfig {
|
|
|
36
38
|
* list is on unless explicitly disabled, and TodoWrite is its off-state fallback — the two families
|
|
37
39
|
* are mutually exclusive, never co-mounted). Only an explicit `taskList: false` reverts to the
|
|
38
40
|
* TodoWrite shape.
|
|
41
|
+
* design/277: the DEFAULT arm (undefined) is model-gated (`modelGate: "task-scaffold"`); an
|
|
42
|
+
* EXPLICIT `true` mounts the family unstamped (never gated). `taskList: false` only selects the
|
|
43
|
+
* TodoWrite family shape — it is NOT an explicit demand for TodoWrite (see `todoWrite`).
|
|
39
44
|
*/
|
|
40
45
|
taskList?: boolean;
|
|
41
46
|
/**
|
|
@@ -10,11 +10,15 @@ export function assembleCodeTools(cfg = {}) {
|
|
|
10
10
|
tools.push(createWebSearchTool(cfg.webSearch));
|
|
11
11
|
if (cfg.subagent)
|
|
12
12
|
tools.push(createSubagentTool({ ...cfg.subagent, systemPrompt: cfg.subagent.systemPrompt ?? CODE_SYSTEM_PROMPT }));
|
|
13
|
+
const stamp = (t) => ({ ...t, modelGate: "task-scaffold" });
|
|
13
14
|
const taskListOn = cfg.taskList !== false;
|
|
14
|
-
if (cfg.todoWrite !== false && !taskListOn)
|
|
15
|
-
tools.push(createTodoWriteTool());
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (cfg.todoWrite !== false && !taskListOn) {
|
|
16
|
+
tools.push(cfg.todoWrite === true ? createTodoWriteTool() : stamp(createTodoWriteTool()));
|
|
17
|
+
}
|
|
18
|
+
if (taskListOn) {
|
|
19
|
+
const family = createTaskListTools(cfg.taskListStore);
|
|
20
|
+
tools.push(...(cfg.taskList === true ? family : family.map(stamp)));
|
|
21
|
+
}
|
|
18
22
|
return tools;
|
|
19
23
|
}
|
|
20
24
|
export const CODE_ROLE = { systemPrompt: CODE_SYSTEM_PROMPT, thinking: "high" };
|
|
@@ -232,8 +232,9 @@ export declare function resolveBashTimeoutCaps(opts?: {
|
|
|
232
232
|
defaultMs: number;
|
|
233
233
|
maxMs: number;
|
|
234
234
|
};
|
|
235
|
-
/** Test seam: the announcement de-dupes per process, so a test that asserts
|
|
236
|
-
*
|
|
235
|
+
/** Test seam: the announcement de-dupes per sink (console arm per process), so a test that asserts
|
|
236
|
+
* the line must be able to re-arm the ledger. Re-arms BOTH arms (a WeakMap has no clear — it is
|
|
237
|
+
* re-minted). Never called by production code. */
|
|
237
238
|
export declare function __resetBashTimeoutAnnouncements(): void;
|
|
238
239
|
/** RB-370 ②: the seconds view of a resolved {@link resolveBashTimeoutCaps} pair — the shell's INTERNAL
|
|
239
240
|
* unit stays seconds while every model-facing surface stays ms (design/64 §8.1C posture). One rounding
|
|
@@ -88,8 +88,23 @@ export function envErrorDetail(message) {
|
|
|
88
88
|
const trimmed = (message ?? "").trim();
|
|
89
89
|
return trimmed === "" ? "the execution environment reported no reason" : trimmed;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
let announcedTimeoutConfigBySink = new WeakMap();
|
|
92
|
+
const announcedTimeoutConfigConsole = new Set();
|
|
93
|
+
function timeoutConfigLedger(onNotice) {
|
|
94
|
+
if (typeof onNotice !== "function")
|
|
95
|
+
return announcedTimeoutConfigConsole;
|
|
96
|
+
let lines = announcedTimeoutConfigBySink.get(onNotice);
|
|
97
|
+
if (lines === undefined) {
|
|
98
|
+
lines = new Set();
|
|
99
|
+
announcedTimeoutConfigBySink.set(onNotice, lines);
|
|
100
|
+
}
|
|
101
|
+
return lines;
|
|
102
|
+
}
|
|
92
103
|
function emitTimeoutDiscardNotice(message, detail, onNotice) {
|
|
104
|
+
const ledger = timeoutConfigLedger(onNotice);
|
|
105
|
+
if (ledger.has(message))
|
|
106
|
+
return;
|
|
107
|
+
ledger.add(message);
|
|
93
108
|
deliverEngineNotice(onNotice, { code: "config.env_timeout_discarded", message, detail });
|
|
94
109
|
}
|
|
95
110
|
function announceDiscardedTimeout(knob, raw, usedMs, onNotice) {
|
|
@@ -106,9 +121,6 @@ function announceDiscardedTimeout(knob, raw, usedMs, onNotice) {
|
|
|
106
121
|
return;
|
|
107
122
|
line = `${knob}=${String(raw)} was ignored — it ${defect}. Using ${usedMs}ms instead.`;
|
|
108
123
|
}
|
|
109
|
-
if (announcedTimeoutConfig.has(line))
|
|
110
|
-
return;
|
|
111
|
-
announcedTimeoutConfig.add(line);
|
|
112
124
|
emitTimeoutDiscardNotice(line, { knob, raw, usedMs }, onNotice);
|
|
113
125
|
}
|
|
114
126
|
export function bashTimeoutParamDescription(caps, withDefault) {
|
|
@@ -147,15 +159,13 @@ export function resolveBashTimeoutCaps(opts) {
|
|
|
147
159
|
if (requestedCap !== undefined && requestedCap < defaultMs) {
|
|
148
160
|
const knob = optsCap !== undefined ? "bashMaxTimeoutMs" : "BASH_MAX_TIMEOUT_MS";
|
|
149
161
|
const line = `${knob}=${requestedCap} is below the resolved default budget (${defaultMs}ms) — the ceiling was raised to ${maxMs}ms (the default always fits under the cap).`;
|
|
150
|
-
|
|
151
|
-
announcedTimeoutConfig.add(line);
|
|
152
|
-
emitTimeoutDiscardNotice(line, { knob, raw: requestedCap, usedMs: maxMs }, opts?.onNotice);
|
|
153
|
-
}
|
|
162
|
+
emitTimeoutDiscardNotice(line, { knob, raw: requestedCap, usedMs: maxMs }, opts?.onNotice);
|
|
154
163
|
}
|
|
155
164
|
return { defaultMs, maxMs };
|
|
156
165
|
}
|
|
157
166
|
export function __resetBashTimeoutAnnouncements() {
|
|
158
|
-
|
|
167
|
+
announcedTimeoutConfigBySink = new WeakMap();
|
|
168
|
+
announcedTimeoutConfigConsole.clear();
|
|
159
169
|
}
|
|
160
170
|
export function bashTimeoutCapsSec(caps) {
|
|
161
171
|
return { defaultSec: Math.max(1, Math.round(caps.defaultMs / 1000)), maxSec: Math.max(1, Math.round(caps.maxMs / 1000)) };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "design/87 L3 — frozen public export surface of src/index.ts (name -> kind). DO NOT edit by hand to silence a red test. A removed/changed entry = a SemVer-BREAKING change; bump MAJOR and update this fixture in the SAME commit (design/87 §4.2 / §5.2). Regenerate via REGEN in test/export-surface.test.ts.",
|
|
3
|
-
"count":
|
|
3
|
+
"count": 1585,
|
|
4
4
|
"exports": {
|
|
5
5
|
"A2ATaskState": "type",
|
|
6
6
|
"A2ATaskStateReversal": "type",
|
|
@@ -171,6 +171,9 @@
|
|
|
171
171
|
"CircuitBreakerOptions": "interface",
|
|
172
172
|
"CodeReviewMode": "type",
|
|
173
173
|
"CodeToolsConfig": "interface",
|
|
174
|
+
"CommittedBinding": "type",
|
|
175
|
+
"CommittedEntrySnapshot": "type",
|
|
176
|
+
"CommittedScopeSnapshots": "type",
|
|
174
177
|
"CompactOutcome": "type",
|
|
175
178
|
"CompactionWindowSafetyInfo": "interface",
|
|
176
179
|
"CompiledEventPrompt": "interface",
|
|
@@ -223,12 +226,15 @@
|
|
|
223
226
|
"DEFAULT_TOOL_RESULT_THRESHOLD_CHARS": "variable",
|
|
224
227
|
"DEGRADED_DIAGNOSTIC_TYPE": "variable",
|
|
225
228
|
"DESIGN_REVIEW_PROMPTS": "variable",
|
|
229
|
+
"DISCUSSION_SCRIPT": "variable",
|
|
230
|
+
"DISCUSSION_WORKFLOW_NAME": "variable",
|
|
226
231
|
"DURABLE_AGENT_HANDLE_RE": "variable",
|
|
227
232
|
"DecisionReason": "type",
|
|
228
233
|
"DefaultPackDescription": "interface",
|
|
229
234
|
"DegradationInfo": "interface",
|
|
230
235
|
"DegradeReason": "type",
|
|
231
236
|
"DegradingBrainOptions": "type",
|
|
237
|
+
"DelegationLifecycleEvent": "type",
|
|
232
238
|
"DelegationTaskType": "type",
|
|
233
239
|
"DeveloperTaskConfig": "interface",
|
|
234
240
|
"DocumentContent": "interface",
|
|
@@ -243,10 +249,16 @@
|
|
|
243
249
|
"EXPLORE_WHEN_TO_USE": "variable",
|
|
244
250
|
"EXPLORE_WHEN_TO_USE_LEAN": "variable",
|
|
245
251
|
"EffectiveConfigField": "interface",
|
|
252
|
+
"EffectiveMemoryScopes": "type",
|
|
246
253
|
"EffectivePermissionRule": "interface",
|
|
247
254
|
"Embedder": "interface",
|
|
248
255
|
"EngineNotice": "interface",
|
|
256
|
+
"EntryCustodyReport": "interface",
|
|
257
|
+
"EntryProvenanceAccount": "interface",
|
|
249
258
|
"EnvironmentFacts": "interface",
|
|
259
|
+
"EraseMemoryEntriesInput": "interface",
|
|
260
|
+
"ErasedBinding": "type",
|
|
261
|
+
"ErasureSelect": "type",
|
|
250
262
|
"EscalationRecord": "interface",
|
|
251
263
|
"EscalationTrigger": "type",
|
|
252
264
|
"EventDedupe": "type",
|
|
@@ -327,6 +339,7 @@
|
|
|
327
339
|
"HarvestRejectionCode": "type",
|
|
328
340
|
"HarvestReport": "interface",
|
|
329
341
|
"HookEnvCapabilities": "interface",
|
|
342
|
+
"HookInvocationIdentity": "interface",
|
|
330
343
|
"HookToolContext": "interface",
|
|
331
344
|
"HookToolFailure": "interface",
|
|
332
345
|
"HookToolOutput": "interface",
|
|
@@ -456,6 +469,7 @@
|
|
|
456
469
|
"MemoryEntry": "interface",
|
|
457
470
|
"MemoryEntryFrontmatter": "interface",
|
|
458
471
|
"MemoryEntryHeader": "interface",
|
|
472
|
+
"MemoryErasureAttestation": "interface",
|
|
459
473
|
"MemoryGateError": "class",
|
|
460
474
|
"MemoryGetDetails": "interface",
|
|
461
475
|
"MemoryInjection": "interface",
|
|
@@ -607,6 +621,7 @@
|
|
|
607
621
|
"PlatformLimitReason": "type",
|
|
608
622
|
"PostCompactContext": "interface",
|
|
609
623
|
"PostToolBatchCall": "interface",
|
|
624
|
+
"PostToolBatchContext": "interface",
|
|
610
625
|
"PostToolBatchResult": "interface",
|
|
611
626
|
"PostToolUseFailureResult": "interface",
|
|
612
627
|
"PostToolUseResult": "interface",
|
|
@@ -910,6 +925,7 @@
|
|
|
910
925
|
"TEAM_DISCUSSION_SCRIPT": "variable",
|
|
911
926
|
"TEAM_DISCUSSION_WORKFLOW_NAME": "variable",
|
|
912
927
|
"TOKEN_CHECKPOINT_VERSION": "variable",
|
|
928
|
+
"TOOL_MODEL_GATE_CLASSES": "variable",
|
|
913
929
|
"TOOL_RESULT_REF_CONFLICT_CODE": "variable",
|
|
914
930
|
"TSchema": "interface",
|
|
915
931
|
"TaskAccess": "interface",
|
|
@@ -953,6 +969,7 @@
|
|
|
953
969
|
"ToolEffect": "type",
|
|
954
970
|
"ToolExecuteContext": "interface",
|
|
955
971
|
"ToolFingerprintInput": "interface",
|
|
972
|
+
"ToolModelGateRule": "interface",
|
|
956
973
|
"ToolOrigin": "type",
|
|
957
974
|
"ToolPolicy": "interface",
|
|
958
975
|
"ToolPolicyNameSets": "interface",
|
|
@@ -968,6 +985,7 @@
|
|
|
968
985
|
"ToolSpec": "interface",
|
|
969
986
|
"TraceEvent": "type",
|
|
970
987
|
"TracerHook": "type",
|
|
988
|
+
"TransferEvidence": "interface",
|
|
971
989
|
"TransportLspSession": "class",
|
|
972
990
|
"TripwireResult": "interface",
|
|
973
991
|
"TtlSessionStore": "class",
|
|
@@ -987,6 +1005,7 @@
|
|
|
987
1005
|
"UsageWindowRecord": "interface",
|
|
988
1006
|
"UsageWindowStore": "interface",
|
|
989
1007
|
"UserMessage": "interface",
|
|
1008
|
+
"UserPromptSubmitContext": "interface",
|
|
990
1009
|
"UserPromptSubmitResult": "interface",
|
|
991
1010
|
"UtilityGate": "type",
|
|
992
1011
|
"V2HeaderHints": "interface",
|
|
@@ -1119,6 +1138,7 @@
|
|
|
1119
1138
|
"callKeyOrdinal": "function",
|
|
1120
1139
|
"canAccessAgentRecord": "function",
|
|
1121
1140
|
"canAccessWorkflowRun": "function",
|
|
1141
|
+
"canonicalWorkflowName": "function",
|
|
1122
1142
|
"capAggregateMediaBytes": "function",
|
|
1123
1143
|
"capAggregateToolResults": "function",
|
|
1124
1144
|
"captureBaseline": "function",
|
|
@@ -1256,6 +1276,7 @@
|
|
|
1256
1276
|
"enqueueMemoryAnnouncement": "function",
|
|
1257
1277
|
"ensureDir": "function",
|
|
1258
1278
|
"entryFromFile": "function",
|
|
1279
|
+
"erasureSelectHash": "function",
|
|
1259
1280
|
"err": "function",
|
|
1260
1281
|
"errorClassOf": "function",
|
|
1261
1282
|
"eventDefaultOn": "function",
|
|
@@ -1306,6 +1327,7 @@
|
|
|
1306
1327
|
"isApprovalSettledBy": "function",
|
|
1307
1328
|
"isDelegatedAgentTerminal": "function",
|
|
1308
1329
|
"isIsolated": "function",
|
|
1330
|
+
"isModelGatedForClass": "function",
|
|
1309
1331
|
"isPersonalScope": "function",
|
|
1310
1332
|
"isQuestionUnavailable": "function",
|
|
1311
1333
|
"isRemoteExecutionEnv": "function",
|
|
@@ -1457,6 +1479,7 @@
|
|
|
1457
1479
|
"resolveUsageWindows": "function",
|
|
1458
1480
|
"restoreFrozenPaths": "function",
|
|
1459
1481
|
"resumeWithVerification": "function",
|
|
1482
|
+
"retiredWorkflowNameAliases": "function",
|
|
1460
1483
|
"retryBackoffMs": "function",
|
|
1461
1484
|
"riskSeverity": "function",
|
|
1462
1485
|
"ruleAdmitsCommand": "function",
|