@sema-agent/core 7.24.2 → 7.24.4

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 (34) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/dist/core/mcp-failure.d.ts +73 -0
  3. package/dist/core/mcp-failure.js +21 -0
  4. package/dist/core/mcp.d.ts +18 -1
  5. package/dist/core/mcp.js +33 -12
  6. package/dist/core/permission-rules.js +14 -10
  7. package/dist/core/rule-denial-sentence.d.ts +75 -0
  8. package/dist/core/rule-denial-sentence.js +16 -0
  9. package/dist/core/runner/prepare-policy-chain.js +30 -20
  10. package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -2
  11. package/dist/core/runner/prepare-wiring-manifest.js +3 -1
  12. package/dist/core/runner/run-leg.js +2 -1
  13. package/dist/core/runner/session-rule-policy.d.ts +74 -2
  14. package/dist/core/runner/session-rule-policy.js +113 -21
  15. package/dist/core/wiring-manifest.d.ts +20 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/orchestration/workflow.js +12 -3
  19. package/dist/prompt-assembly/packs/sema-default.js +15 -0
  20. package/dist/prompts/default.d.ts +1 -1
  21. package/dist/prompts/default.js +4 -4
  22. package/dist/tools/fs/bash-program-position.d.ts +5 -0
  23. package/dist/tools/fs/bash-program-position.js +1 -1
  24. package/dist/tools/fs/bash-readonly-classifier.d.ts +476 -1
  25. package/dist/tools/fs/bash-readonly-classifier.js +98 -34
  26. package/dist/tools/fs/fs-bash.js +2 -325
  27. package/dist/tools/fs/shell-read-establish.d.ts +127 -0
  28. package/dist/tools/fs/shell-read-establish.js +326 -0
  29. package/dist/tools/fs/shell-read-plan.d.ts +113 -0
  30. package/dist/tools/fs/shell-read-plan.js +700 -0
  31. package/package.json +1 -1
  32. package/test/export-surface.snapshot.json +7 -1
  33. package/wire-changes/core@7.24.3.json +244 -0
  34. package/wire-changes/core@7.24.4.json +54 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "7.24.2",
3
+ "version": "7.24.4",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -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": 2399,
4
+ "count": 2402,
5
5
  "exports": {
6
6
  "A2ATaskState": "type",
7
7
  "A2ATaskStateReversal": "type",
@@ -654,6 +654,7 @@
654
654
  "MCP_IMAGE_MAX_BASE64": "variable",
655
655
  "MCP_INJECTION_DROP_REASONS": "variable",
656
656
  "MCP_INJECTION_DROP_TEXT": "variable",
657
+ "MCP_LIVENESS_STATES": "variable",
657
658
  "MCP_NAMESPACE": "variable",
658
659
  "MCP_PREFIX": "variable",
659
660
  "MEMORY_ANNOUNCEMENTS_MAX": "variable",
@@ -713,8 +714,10 @@
713
714
  "McpImageResizer": "type",
714
715
  "McpInjectionDropFacts": "interface",
715
716
  "McpInjectionDropReason": "type",
717
+ "McpLivenessState": "type",
716
718
  "McpReconnectResult": "interface",
717
719
  "McpRefreshResult": "interface",
720
+ "McpServerLiveness": "interface",
718
721
  "McpServerSpec": "interface",
719
722
  "McpServerStatus": "interface",
720
723
  "McpToolFace": "type",
@@ -3055,6 +3058,7 @@
3055
3058
  "MCP_IMAGE_MAX_BASE64": "advanced",
3056
3059
  "MCP_INJECTION_DROP_REASONS": "advanced",
3057
3060
  "MCP_INJECTION_DROP_TEXT": "advanced",
3061
+ "MCP_LIVENESS_STATES": "advanced",
3058
3062
  "MCP_NAMESPACE": "advanced",
3059
3063
  "MCP_PREFIX": "advanced",
3060
3064
  "MEMORY_ANNOUNCEMENTS_MAX": "advanced",
@@ -3114,8 +3118,10 @@
3114
3118
  "McpImageResizer": "advanced",
3115
3119
  "McpInjectionDropFacts": "advanced",
3116
3120
  "McpInjectionDropReason": "advanced",
3121
+ "McpLivenessState": "advanced",
3117
3122
  "McpReconnectResult": "advanced",
3118
3123
  "McpRefreshResult": "advanced",
3124
+ "McpServerLiveness": "advanced",
3119
3125
  "McpServerSpec": "advanced",
3120
3126
  "McpServerStatus": "advanced",
3121
3127
  "McpToolFace": "internal",
@@ -0,0 +1,244 @@
1
+ {
2
+ "repo": "core",
3
+ "version": "7.24.3",
4
+ "from": "800729adecdc333ea7b87007593b24c96714f6e3",
5
+ "to": "v7.24.3",
6
+ "added": [
7
+ {
8
+ "name": "MCP_LIVENESS_STATES",
9
+ "kind": "variable",
10
+ "tier": "advanced",
11
+ "at": [
12
+ "src/core/mcp-failure.ts:96",
13
+ "src/index.ts:351"
14
+ ],
15
+ "criteriaCovered": false,
16
+ "breaking": false
17
+ },
18
+ {
19
+ "name": "McpLivenessState",
20
+ "kind": "type",
21
+ "tier": "advanced",
22
+ "at": [
23
+ "src/core/mcp-failure.ts:97",
24
+ "src/index.ts:351"
25
+ ],
26
+ "criteriaCovered": false,
27
+ "breaking": false
28
+ },
29
+ {
30
+ "name": "McpServerLiveness",
31
+ "kind": "interface",
32
+ "tier": "advanced",
33
+ "at": [
34
+ "src/core/mcp-failure.ts:111",
35
+ "src/index.ts:351"
36
+ ],
37
+ "criteriaCovered": false,
38
+ "breaking": false
39
+ }
40
+ ],
41
+ "removed": [],
42
+ "changed": [],
43
+ "narrowed": [],
44
+ "closedSetMembers": [
45
+ {
46
+ "set": "MCP_LIVENESS_STATES",
47
+ "at": [
48
+ "src/core/mcp-failure.ts:96"
49
+ ],
50
+ "newSet": true,
51
+ "added": [
52
+ "reachable",
53
+ "unknown",
54
+ "unreachable"
55
+ ],
56
+ "removed": [],
57
+ "breaking": false,
58
+ "criteriaCovered": false
59
+ },
60
+ {
61
+ "set": "McpExchangeOutcome",
62
+ "at": [
63
+ "src/core/mcp-failure.ts:150"
64
+ ],
65
+ "newSet": true,
66
+ "added": [
67
+ "completed",
68
+ "connect_refused",
69
+ "connection_closed",
70
+ "connection_failed",
71
+ "http_status",
72
+ "invalid_config",
73
+ "not_mcp_response",
74
+ "protocol",
75
+ "spawn_failed",
76
+ "timeout",
77
+ "unknown"
78
+ ],
79
+ "removed": [],
80
+ "breaking": false,
81
+ "criteriaCovered": false
82
+ },
83
+ {
84
+ "set": "McpLivenessState",
85
+ "at": [
86
+ "src/core/mcp-failure.ts:97",
87
+ "src/index.ts:351"
88
+ ],
89
+ "newSet": true,
90
+ "added": [
91
+ "reachable",
92
+ "unknown",
93
+ "unreachable"
94
+ ],
95
+ "removed": [],
96
+ "breaking": false,
97
+ "criteriaCovered": false
98
+ },
99
+ {
100
+ "set": "OptionValueKind",
101
+ "at": [
102
+ "src/tools/fs/bash-readonly-classifier.ts:1477"
103
+ ],
104
+ "newSet": true,
105
+ "added": [
106
+ "count",
107
+ "delimiter",
108
+ "form",
109
+ "header",
110
+ "indirect",
111
+ "label",
112
+ "name-pattern",
113
+ "path",
114
+ "pattern",
115
+ "script",
116
+ "url"
117
+ ],
118
+ "removed": [],
119
+ "breaking": false,
120
+ "criteriaCovered": false
121
+ },
122
+ {
123
+ "set": "READ_CANDIDATE_PROVENANCES",
124
+ "at": [
125
+ "src/tools/fs/shell-read-plan.ts:79"
126
+ ],
127
+ "newSet": true,
128
+ "added": [
129
+ "cd_target",
130
+ "env_assignment",
131
+ "operand",
132
+ "option_value",
133
+ "program_path",
134
+ "script_slot_file",
135
+ "stdin_redirect",
136
+ "traversal_root",
137
+ "unlisted_word",
138
+ "write_redirect_target"
139
+ ],
140
+ "removed": [],
141
+ "breaking": false,
142
+ "criteriaCovered": false
143
+ },
144
+ {
145
+ "set": "ReadCandidateProvenance",
146
+ "at": [
147
+ "src/tools/fs/shell-read-plan.ts:91"
148
+ ],
149
+ "newSet": true,
150
+ "added": [
151
+ "cd_target",
152
+ "env_assignment",
153
+ "operand",
154
+ "option_value",
155
+ "program_path",
156
+ "script_slot_file",
157
+ "stdin_redirect",
158
+ "traversal_root",
159
+ "unlisted_word",
160
+ "write_redirect_target"
161
+ ],
162
+ "removed": [],
163
+ "breaking": false,
164
+ "criteriaCovered": false
165
+ }
166
+ ],
167
+ "closedSetsUnreadable": [],
168
+ "typeKeys": [
169
+ {
170
+ "type": "McpServerStatus",
171
+ "at": [
172
+ "src/core/mcp.ts:394"
173
+ ],
174
+ "added": [
175
+ "liveness"
176
+ ],
177
+ "removed": [],
178
+ "breaking": false,
179
+ "criteriaCovered": false
180
+ },
181
+ {
182
+ "type": "WiringManifestMcpEntry",
183
+ "at": [
184
+ "src/core/wiring-manifest.ts:128"
185
+ ],
186
+ "added": [
187
+ "liveness"
188
+ ],
189
+ "removed": [],
190
+ "breaking": false,
191
+ "criteriaCovered": true
192
+ }
193
+ ],
194
+ "declarationMoves": [],
195
+ "mintMoves": [],
196
+ "criteriaObserves": [
197
+ {
198
+ "kind": "taskEventField",
199
+ "name": "tool_end.isError",
200
+ "assertions": [
201
+ "G3.a"
202
+ ]
203
+ },
204
+ {
205
+ "kind": "taskEventField",
206
+ "name": "wiring_manifest.manifest",
207
+ "assertions": [
208
+ "G1.b"
209
+ ]
210
+ },
211
+ {
212
+ "kind": "typeMember",
213
+ "name": "TaskSpec.sessionId",
214
+ "assertions": [
215
+ "G2.a"
216
+ ]
217
+ },
218
+ {
219
+ "kind": "typeMember",
220
+ "name": "WiringManifestMcpEntry.liveness",
221
+ "assertions": [
222
+ "G1.a"
223
+ ]
224
+ }
225
+ ],
226
+ "consumersHint": {
227
+ "cli": [
228
+ "McpServerStatus",
229
+ "WiringManifestMcpEntry"
230
+ ],
231
+ "server": [
232
+ "McpServerStatus",
233
+ "WiringManifestMcpEntry"
234
+ ],
235
+ "sdk": [
236
+ "McpServerStatus",
237
+ "WiringManifestMcpEntry"
238
+ ],
239
+ "note": "scanned cli@547c2c31 server@02807610 sdk@9b6bcaa — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it"
240
+ },
241
+ "breakingCount": 0,
242
+ "breakingItems": [],
243
+ "toResolvedAt": "aa2335b2f9223c8e838c8a496564058bdf972870"
244
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "repo": "core",
3
+ "version": "7.24.4",
4
+ "from": "583db3a8918e747e8dab1c5e2f457cf79171bd3f",
5
+ "to": "v7.24.4",
6
+ "added": [],
7
+ "removed": [],
8
+ "changed": [],
9
+ "narrowed": [
10
+ {
11
+ "id": "F1",
12
+ "source": "behaviorFlips.summary",
13
+ "text": "NARROWING (#978, P2, permissions): every rule source is re-read at every tool gate — a session-policy rule (`PUT /v1/sessions/:id/policy` on server; `sessionPolicyStore` in core) written after a run's first turn denies the matching call in the SAME run; and every rule denial is one minted sentence naming its source."
14
+ }
15
+ ],
16
+ "closedSetMembers": [],
17
+ "closedSetsUnreadable": [],
18
+ "typeKeys": [],
19
+ "declarationMoves": [],
20
+ "mintMoves": [],
21
+ "criteriaObserves": [
22
+ {
23
+ "kind": "taskEventField",
24
+ "name": "tool_end.isError",
25
+ "assertions": [
26
+ "G1.a",
27
+ "G1.b"
28
+ ]
29
+ },
30
+ {
31
+ "kind": "typeMember",
32
+ "name": "BackgroundChildEvent.seq",
33
+ "assertions": [
34
+ "G2.a"
35
+ ]
36
+ },
37
+ {
38
+ "kind": "typeMember",
39
+ "name": "SessionPermissionRules.toolDeny",
40
+ "assertions": [
41
+ "G1.a"
42
+ ]
43
+ }
44
+ ],
45
+ "consumersHint": {
46
+ "cli": [],
47
+ "server": [],
48
+ "sdk": [],
49
+ "note": "NOT SCANNED: sema-cli, sema-server, sema-sdk — an empty list for those repos means \"not checked out\", not \"no consumer\""
50
+ },
51
+ "breakingCount": 0,
52
+ "breakingItems": [],
53
+ "toResolvedAt": "5cbec5a04d5cd905a121a02e21c3c71087a7b4fe"
54
+ }