@sema-agent/core 7.36.0 → 7.37.1

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 (56) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/dist/brain/anthropic.js +7 -14
  3. package/dist/brain/open-responses.js +6 -13
  4. package/dist/brain/openai.js +7 -14
  5. package/dist/brain/stream-shared.d.ts +21 -0
  6. package/dist/brain/stream-shared.js +13 -0
  7. package/dist/core/ask-origin.d.ts +35 -5
  8. package/dist/core/ask-origin.js +23 -4
  9. package/dist/core/checkpoint-store.d.ts +13 -3
  10. package/dist/core/decision-receipt.d.ts +21 -0
  11. package/dist/core/decision-receipt.js +63 -0
  12. package/dist/core/engine-notice.d.ts +17 -5
  13. package/dist/core/gate-fold.js +2 -1
  14. package/dist/core/gate-lanes.js +8 -13
  15. package/dist/core/gate-outcome.d.ts +7 -5
  16. package/dist/core/gate-outcome.js +5 -1
  17. package/dist/core/governance-codes.d.ts +1 -1
  18. package/dist/core/governance-codes.js +2 -0
  19. package/dist/core/hooks.d.ts +11 -2
  20. package/dist/core/hooks.js +3 -1
  21. package/dist/core/park-selfcheck.js +2 -0
  22. package/dist/core/runner/denial-limit-arms.d.ts +28 -18
  23. package/dist/core/runner/denial-limit-arms.js +11 -7
  24. package/dist/core/runner/inherited-ask-grants.d.ts +32 -31
  25. package/dist/core/runner/inherited-ask-grants.js +5 -0
  26. package/dist/core/runner/prepare-inherited-gate.js +1 -1
  27. package/dist/core/runner/prepare-park-ask.d.ts +2 -2
  28. package/dist/core/runner/prepare-park-ask.js +1 -5
  29. package/dist/core/runner/prepare-policy-chain.d.ts +3 -8
  30. package/dist/core/runner/prepare-policy-chain.js +43 -25
  31. package/dist/core/runner/run-identity-wiring.d.ts +1 -1
  32. package/dist/core/runner/run-identity-wiring.js +2 -0
  33. package/dist/core/runner/tool-turn-repair-seat.d.ts +8 -0
  34. package/dist/core/runner/tool-turn-repair-seat.js +28 -0
  35. package/dist/core/session-reconcile.d.ts +35 -0
  36. package/dist/core/session-reconcile.js +31 -20
  37. package/dist/core/side-query.js +4 -2
  38. package/dist/core/store-contracts/checkpoint-store-contract.js +18 -0
  39. package/dist/core/tool-name-readings.d.ts +4 -0
  40. package/dist/core/tool-name-readings.js +1 -0
  41. package/dist/core/tool-policy.d.ts +74 -84
  42. package/dist/core/tool-policy.js +71 -36
  43. package/dist/engine/harness/agent-harness.d.ts +7 -0
  44. package/dist/engine/harness/agent-harness.js +14 -2
  45. package/dist/engine/llm/index.d.ts +1 -0
  46. package/dist/engine/llm/index.js +1 -0
  47. package/dist/engine/llm/tool-turns.d.ts +20 -0
  48. package/dist/engine/llm/tool-turns.js +91 -0
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/internal/llm.d.ts +2 -2
  52. package/dist/internal/llm.js +1 -1
  53. package/package.json +1 -1
  54. package/test/export-surface.snapshot.json +7 -1
  55. package/wire-changes/core@7.37.0.json +405 -0
  56. package/wire-changes/core@7.37.1.json +122 -0
@@ -1,7 +1,7 @@
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
3
  "_tierComment": "#435 v1 — machine-readable layering of the public surface: stable = demonstrated by README.md / src/examples; internal = an `Internal`-marked name or a runner/engine deep-subtree declaration (the model seam src/engine/llm is excluded — it is the BYOM contract, not an engine internal); advanced = a supported export the front door does not walk you through. THIS IS AN INITIAL HEURISTIC, derived mechanically and expected to be refined ticket by ticket: no human reviewed these 1700+ entries one by one, and nothing here claims otherwise. Known bias: a short or English-word export name (ok, err, Result, Usage) can match ordinary prose in README.md and land `stable` on a coincidence. Every export MUST carry a tier — a new export with no row fails the gate in export-surface.test.ts.",
4
- "count": 2537,
4
+ "count": 2540,
5
5
  "exports": {
6
6
  "A2ATaskState": "type",
7
7
  "A2ATaskStateReversal": "type",
@@ -713,6 +713,7 @@
713
713
  "MEMORY_SEARCH_TOOL_NAME": "variable",
714
714
  "MODEL_ROLES": "variable",
715
715
  "MODE_ARBITRATION": "variable",
716
+ "MODE_RELEASE_REASONS": "variable",
716
717
  "MONITOR_BATCH_WINDOW_MS": "variable",
717
718
  "MONITOR_DEFAULT_TIMEOUT_MS": "variable",
718
719
  "MONITOR_MAX_BATCHES_PER_MINUTE": "variable",
@@ -822,6 +823,7 @@
822
823
  "ModePolicy": "interface",
823
824
  "ModeRefusal": "interface",
824
825
  "ModeRelease": "interface",
826
+ "ModeReleaseReason": "type",
825
827
  "Model": "interface",
826
828
  "ModelCriteria": "interface",
827
829
  "ModelMention": "interface",
@@ -2094,6 +2096,7 @@
2094
2096
  "isGateKind": "function",
2095
2097
  "isInstructionEntry": "function",
2096
2098
  "isIsolated": "function",
2099
+ "isModeReleaseReason": "function",
2097
2100
  "isModelGatedForClass": "function",
2098
2101
  "isModelPriced": "function",
2099
2102
  "isNamespacedCoveringRuleName": "function",
@@ -3252,6 +3255,7 @@
3252
3255
  "MEMORY_SEARCH_TOOL_NAME": "advanced",
3253
3256
  "MODEL_ROLES": "advanced",
3254
3257
  "MODE_ARBITRATION": "advanced",
3258
+ "MODE_RELEASE_REASONS": "advanced",
3255
3259
  "MONITOR_BATCH_WINDOW_MS": "advanced",
3256
3260
  "MONITOR_DEFAULT_TIMEOUT_MS": "advanced",
3257
3261
  "MONITOR_MAX_BATCHES_PER_MINUTE": "advanced",
@@ -3361,6 +3365,7 @@
3361
3365
  "ModePolicy": "advanced",
3362
3366
  "ModeRefusal": "advanced",
3363
3367
  "ModeRelease": "advanced",
3368
+ "ModeReleaseReason": "advanced",
3364
3369
  "Model": "stable",
3365
3370
  "ModelCriteria": "advanced",
3366
3371
  "ModelMention": "advanced",
@@ -4633,6 +4638,7 @@
4633
4638
  "isGateKind": "advanced",
4634
4639
  "isInstructionEntry": "advanced",
4635
4640
  "isIsolated": "advanced",
4641
+ "isModeReleaseReason": "advanced",
4636
4642
  "isModelGatedForClass": "advanced",
4637
4643
  "isModelPriced": "advanced",
4638
4644
  "isNamespacedCoveringRuleName": "advanced",
@@ -0,0 +1,405 @@
1
+ {
2
+ "repo": "core",
3
+ "version": "7.37.0",
4
+ "from": "9cf65a30c780cb7a6497bc3efa04f3257fac788a",
5
+ "to": "862965ccedf0b4b84695b6a2ed99666a60b0d57f",
6
+ "added": [
7
+ {
8
+ "name": "MODE_RELEASE_REASONS",
9
+ "kind": "variable",
10
+ "tier": "advanced",
11
+ "at": [
12
+ "src/core/ask-origin.ts:675",
13
+ "src/index.ts:1451"
14
+ ],
15
+ "criteriaCovered": false,
16
+ "breaking": false
17
+ },
18
+ {
19
+ "name": "ModeReleaseReason",
20
+ "kind": "type",
21
+ "tier": "advanced",
22
+ "at": [
23
+ "src/core/ask-origin.ts:676",
24
+ "src/index.ts:1451"
25
+ ],
26
+ "criteriaCovered": false,
27
+ "breaking": false
28
+ },
29
+ {
30
+ "name": "isModeReleaseReason",
31
+ "kind": "function",
32
+ "tier": "advanced",
33
+ "at": [
34
+ "src/core/ask-origin.ts:680",
35
+ "src/index.ts:1451"
36
+ ],
37
+ "criteriaCovered": false,
38
+ "breaking": false
39
+ }
40
+ ],
41
+ "removed": [],
42
+ "changed": [],
43
+ "narrowed": [],
44
+ "closedSetMembers": [
45
+ {
46
+ "set": "MODE_RELEASE_REASONS",
47
+ "at": [
48
+ "src/core/ask-origin.ts:675"
49
+ ],
50
+ "newSet": true,
51
+ "added": [
52
+ "rule_unreadable"
53
+ ],
54
+ "removed": [],
55
+ "breaking": false,
56
+ "criteriaCovered": false
57
+ },
58
+ {
59
+ "set": "ModeReleaseReason",
60
+ "at": [
61
+ "src/core/ask-origin.ts:676",
62
+ "src/index.ts:1451"
63
+ ],
64
+ "newSet": true,
65
+ "added": [
66
+ "rule_unreadable"
67
+ ],
68
+ "removed": [],
69
+ "breaking": false,
70
+ "criteriaCovered": false
71
+ }
72
+ ],
73
+ "closedSetsUnreadable": [],
74
+ "typeKeys": [
75
+ {
76
+ "type": "AskCarry",
77
+ "at": [
78
+ "src/core/hooks.ts:2171"
79
+ ],
80
+ "added": [
81
+ "askClass",
82
+ "classes"
83
+ ],
84
+ "addedDetail": [
85
+ {
86
+ "key": "askClass",
87
+ "optional": true
88
+ },
89
+ {
90
+ "key": "classes",
91
+ "optional": true
92
+ }
93
+ ],
94
+ "addedRequired": [],
95
+ "removed": [],
96
+ "breaking": false,
97
+ "criteriaCovered": false
98
+ },
99
+ {
100
+ "type": "AskRequest",
101
+ "at": [
102
+ "src/core/tool-policy.ts:2782"
103
+ ],
104
+ "added": [
105
+ "askClass",
106
+ "classes"
107
+ ],
108
+ "addedDetail": [
109
+ {
110
+ "key": "askClass",
111
+ "optional": true
112
+ },
113
+ {
114
+ "key": "classes",
115
+ "optional": true
116
+ }
117
+ ],
118
+ "addedRequired": [],
119
+ "removed": [],
120
+ "breaking": false,
121
+ "criteriaCovered": true
122
+ },
123
+ {
124
+ "type": "PendingAction",
125
+ "at": [
126
+ "src/core/checkpoint-store.ts:962"
127
+ ],
128
+ "added": [
129
+ "tool_approval.askClass",
130
+ "tool_approval.classes"
131
+ ],
132
+ "addedDetail": [
133
+ {
134
+ "key": "tool_approval.askClass",
135
+ "optional": true
136
+ },
137
+ {
138
+ "key": "tool_approval.classes",
139
+ "optional": true
140
+ }
141
+ ],
142
+ "addedRequired": [],
143
+ "removed": [],
144
+ "breaking": false,
145
+ "criteriaCovered": false
146
+ },
147
+ {
148
+ "type": "PermissionResult",
149
+ "at": [
150
+ "src/core/tool-policy.ts:451"
151
+ ],
152
+ "added": [
153
+ "ask.askClass",
154
+ "ask.classes"
155
+ ],
156
+ "addedDetail": [
157
+ {
158
+ "key": "ask.askClass",
159
+ "optional": true
160
+ },
161
+ {
162
+ "key": "ask.classes",
163
+ "optional": true
164
+ }
165
+ ],
166
+ "addedRequired": [],
167
+ "removed": [],
168
+ "breaking": false,
169
+ "criteriaCovered": false
170
+ },
171
+ {
172
+ "type": "PreToolUseResult",
173
+ "at": [
174
+ "src/core/hooks.ts:1163"
175
+ ],
176
+ "added": [
177
+ "ask.askClass",
178
+ "ask.classes"
179
+ ],
180
+ "addedDetail": [
181
+ {
182
+ "key": "ask.askClass",
183
+ "optional": true
184
+ },
185
+ {
186
+ "key": "ask.classes",
187
+ "optional": true
188
+ }
189
+ ],
190
+ "addedRequired": [],
191
+ "removed": [],
192
+ "breaking": false,
193
+ "criteriaCovered": false
194
+ }
195
+ ],
196
+ "typeKeysUnreadableArms": [],
197
+ "typeKeysFlattenedCount": 219,
198
+ "declarationMoves": [],
199
+ "mintMoves": [],
200
+ "criteriaObserves": [
201
+ {
202
+ "kind": "taskEventField",
203
+ "name": "tool_end.gate",
204
+ "assertions": [
205
+ "G1.b",
206
+ "G2.c",
207
+ "G4.a",
208
+ "G4.b",
209
+ "G4.c",
210
+ "G4.e",
211
+ "G4.d",
212
+ "G6.a",
213
+ "G6.b",
214
+ "G6.c",
215
+ "G6.d",
216
+ "G6.e",
217
+ "G7.a",
218
+ "G7.d",
219
+ "G8.a",
220
+ "G8.b",
221
+ "G8.c",
222
+ "G9.a",
223
+ "G9.b",
224
+ "G9.c",
225
+ "G9.d",
226
+ "G9.e",
227
+ "G9.f",
228
+ "G9.g",
229
+ "G9.h",
230
+ "G9.i",
231
+ "G9.j",
232
+ "G9.k"
233
+ ]
234
+ },
235
+ {
236
+ "kind": "typeMember",
237
+ "name": "AskRequest.args",
238
+ "assertions": [
239
+ "G6.d"
240
+ ]
241
+ },
242
+ {
243
+ "kind": "typeMember",
244
+ "name": "AskRequest.askClass",
245
+ "assertions": [
246
+ "G2.a",
247
+ "G2.b",
248
+ "G5.a",
249
+ "G5.b"
250
+ ]
251
+ },
252
+ {
253
+ "kind": "typeMember",
254
+ "name": "AskRequest.classes",
255
+ "assertions": [
256
+ "G2.a",
257
+ "G2.b",
258
+ "G2.c",
259
+ "G4.a",
260
+ "G4.b",
261
+ "G4.c",
262
+ "G4.e",
263
+ "G5.b",
264
+ "G7.a",
265
+ "G7.b",
266
+ "G7.c",
267
+ "G7.d",
268
+ "G7.e",
269
+ "G9.f"
270
+ ]
271
+ },
272
+ {
273
+ "kind": "typeMember",
274
+ "name": "AskRequest.denialLimitFallback",
275
+ "assertions": [
276
+ "G9.i"
277
+ ]
278
+ },
279
+ {
280
+ "kind": "typeMember",
281
+ "name": "AskRequest.origin",
282
+ "assertions": [
283
+ "G2.c"
284
+ ]
285
+ },
286
+ {
287
+ "kind": "typeMember",
288
+ "name": "AskRequest.probeCause",
289
+ "assertions": [
290
+ "G9.i"
291
+ ]
292
+ },
293
+ {
294
+ "kind": "typeMember",
295
+ "name": "AskRequest.riskAxes",
296
+ "assertions": [
297
+ "G7.c"
298
+ ]
299
+ },
300
+ {
301
+ "kind": "typeMember",
302
+ "name": "GateOutcome.disposition.released.reason",
303
+ "assertions": [
304
+ "G1.b"
305
+ ]
306
+ },
307
+ {
308
+ "kind": "typeMember",
309
+ "name": "ModeRelease.reason",
310
+ "assertions": [
311
+ "G1.a",
312
+ "G1.c"
313
+ ]
314
+ },
315
+ {
316
+ "kind": "typeMember",
317
+ "name": "PendingAction.askClass",
318
+ "assertions": [
319
+ "G3.a",
320
+ "G3.b"
321
+ ]
322
+ },
323
+ {
324
+ "kind": "typeMember",
325
+ "name": "PendingAction.classes",
326
+ "assertions": [
327
+ "G3.a",
328
+ "G3.b",
329
+ "G3.c"
330
+ ]
331
+ },
332
+ {
333
+ "kind": "typeMember",
334
+ "name": "PermissionResult.action",
335
+ "assertions": [
336
+ "G8.a",
337
+ "G8.b",
338
+ "G9.a",
339
+ "G9.d"
340
+ ]
341
+ },
342
+ {
343
+ "kind": "typeMember",
344
+ "name": "PermissionResult.askClass",
345
+ "assertions": [
346
+ "G5.a"
347
+ ]
348
+ },
349
+ {
350
+ "kind": "typeMember",
351
+ "name": "PermissionResult.decisionReason",
352
+ "assertions": [
353
+ "G6.e"
354
+ ]
355
+ },
356
+ {
357
+ "kind": "typeMember",
358
+ "name": "PermissionResult.denialLimitFallback",
359
+ "assertions": [
360
+ "G9.c",
361
+ "G9.h"
362
+ ]
363
+ },
364
+ {
365
+ "kind": "typeMember",
366
+ "name": "PermissionResult.requiresRealApproval",
367
+ "assertions": [
368
+ "G6.a",
369
+ "G6.b"
370
+ ]
371
+ },
372
+ {
373
+ "kind": "typeMember",
374
+ "name": "ToolPolicy.check",
375
+ "assertions": [
376
+ "G9.j",
377
+ "G9.k"
378
+ ]
379
+ }
380
+ ],
381
+ "consumersHint": {
382
+ "cli": [
383
+ "AskCarry",
384
+ "AskRequest",
385
+ "PendingAction",
386
+ "PermissionResult",
387
+ "PreToolUseResult"
388
+ ],
389
+ "server": [
390
+ "AskRequest",
391
+ "PendingAction",
392
+ "PermissionResult",
393
+ "PreToolUseResult"
394
+ ],
395
+ "sdk": [
396
+ "AskRequest",
397
+ "PendingAction",
398
+ "PermissionResult",
399
+ "PreToolUseResult"
400
+ ],
401
+ "note": "scanned cli@6b6025f7 server@65b2df99 sdk@a90a03a — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it. Ledger files (**/docs/core-consumption/**, **/docs/wire-consumption/**, **/*LEDGER*.json) are not evidence of use — server: 1 name(s) matched ONLY in bookkeeping files and were set aside (AskCarry)"
402
+ },
403
+ "breakingCount": 0,
404
+ "breakingItems": []
405
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "repo": "core",
3
+ "version": "7.37.1",
4
+ "from": "979f761e382593d192c6c5b3170cb82cc676677c",
5
+ "to": "072c5d4502bddacb7b28e2e3f47653ad28c008a5",
6
+ "added": [],
7
+ "removed": [],
8
+ "changed": [],
9
+ "narrowed": [],
10
+ "closedSetMembers": [
11
+ {
12
+ "set": "ENGINE_NOTICE_CODES",
13
+ "at": [
14
+ "src/core/governance-codes.ts:344"
15
+ ],
16
+ "newSet": false,
17
+ "added": [
18
+ "context.tool_turn_repaired"
19
+ ],
20
+ "removed": [],
21
+ "breaking": false,
22
+ "criteriaCovered": true
23
+ },
24
+ {
25
+ "set": "TOOL_TURN_REPAIR_FORMS",
26
+ "at": [
27
+ "src/engine/llm/tool-turns.ts:43"
28
+ ],
29
+ "newSet": true,
30
+ "added": [
31
+ "duplicate_result",
32
+ "late_result",
33
+ "missing_result",
34
+ "trailing_text"
35
+ ],
36
+ "removed": [],
37
+ "breaking": false,
38
+ "criteriaCovered": false
39
+ },
40
+ {
41
+ "set": "ToolTurnRepairForm",
42
+ "at": [
43
+ "src/engine/llm/tool-turns.ts:44"
44
+ ],
45
+ "newSet": true,
46
+ "added": [
47
+ "duplicate_result",
48
+ "late_result",
49
+ "missing_result",
50
+ "trailing_text"
51
+ ],
52
+ "removed": [],
53
+ "breaking": false,
54
+ "criteriaCovered": false
55
+ }
56
+ ],
57
+ "closedSetsUnreadable": [],
58
+ "typeKeys": [],
59
+ "typeKeysUnreadableArms": [],
60
+ "typeKeysFlattenedCount": 219,
61
+ "declarationMoves": [],
62
+ "mintMoves": [],
63
+ "criteriaObserves": [
64
+ {
65
+ "kind": "engineNoticeCode",
66
+ "name": "context.tool_turn_repaired",
67
+ "assertions": [
68
+ "G1.b",
69
+ "G3.a",
70
+ "G3.b",
71
+ "G3.c"
72
+ ]
73
+ },
74
+ {
75
+ "kind": "typeMember",
76
+ "name": "AssistantMessage.content",
77
+ "assertions": [
78
+ "G1.a",
79
+ "G1.c",
80
+ "G2.a",
81
+ "G2.b"
82
+ ]
83
+ },
84
+ {
85
+ "kind": "typeMember",
86
+ "name": "AssistantMessage.errorMessage",
87
+ "assertions": [
88
+ "G2.c",
89
+ "G4.a",
90
+ "G4.b"
91
+ ]
92
+ },
93
+ {
94
+ "kind": "typeMember",
95
+ "name": "AssistantMessage.stopReason",
96
+ "assertions": [
97
+ "G2.c"
98
+ ]
99
+ },
100
+ {
101
+ "kind": "typeMember",
102
+ "name": "EngineNotice.detail",
103
+ "assertions": [
104
+ "G1.b"
105
+ ]
106
+ }
107
+ ],
108
+ "consumersHint": {
109
+ "cli": [
110
+ "ENGINE_NOTICE_CODES"
111
+ ],
112
+ "server": [
113
+ "ENGINE_NOTICE_CODES"
114
+ ],
115
+ "sdk": [
116
+ "ENGINE_NOTICE_CODES"
117
+ ],
118
+ "note": "scanned cli@6b6025f7 server@65b2df99 sdk@a90a03a — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it"
119
+ },
120
+ "breakingCount": 0,
121
+ "breakingItems": []
122
+ }