@sema-agent/server 7.136.0 → 7.138.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.
Files changed (327) hide show
  1. package/MIGRATION.md +501 -139
  2. package/README.md +1 -0
  3. package/README.zh-CN.md +1 -0
  4. package/USAGE.md +149 -34
  5. package/deploy/sema-up/README.md +14 -0
  6. package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +7 -1
  7. package/deploy/sema-up/stack/sema-stack-cluster.yaml +7 -1
  8. package/dist/approval-card.d.ts +21 -14
  9. package/dist/approval-card.js +1 -0
  10. package/dist/approval-content-kind.d.ts +6 -0
  11. package/dist/approval-content-kind.js +7 -0
  12. package/dist/approval-gate-currency.d.ts +48 -6
  13. package/dist/approval-gate-currency.js +16 -9
  14. package/dist/approval-hmac.d.ts +13 -1
  15. package/dist/approval-hmac.js +1 -1
  16. package/dist/approval.js +3 -3
  17. package/dist/audit.js +1 -0
  18. package/dist/auth-bridge.js +2 -2
  19. package/dist/background-agent-name.d.ts +5 -0
  20. package/dist/background-agent-name.js +5 -0
  21. package/dist/boot/budget-tracing.d.ts +1 -12
  22. package/dist/boot/deployment-mods.d.ts +46 -16
  23. package/dist/boot/deployment-mods.js +82 -6
  24. package/dist/boot/execution-env.d.ts +24 -1
  25. package/dist/boot/execution-env.js +69 -6
  26. package/dist/boot/governance-seams.d.ts +10 -17
  27. package/dist/boot/governance-seams.js +5 -17
  28. package/dist/boot/leader.d.ts +3 -0
  29. package/dist/boot/leader.js +1 -0
  30. package/dist/boot/org-delivery.js +15 -2
  31. package/dist/boot/reapers.d.ts +3 -0
  32. package/dist/boot/reapers.js +15 -1
  33. package/dist/boot/resolve-spec.d.ts +7 -0
  34. package/dist/boot/resolve-spec.js +36 -26
  35. package/dist/boot/retention-lane.d.ts +11 -5
  36. package/dist/boot/retention-lane.js +2 -2
  37. package/dist/boot/runner-deps.d.ts +7 -3
  38. package/dist/boot/runner-deps.js +1 -0
  39. package/dist/boot/stage-03-store-backend.d.ts +1 -1
  40. package/dist/boot/stage-04-stores.d.ts +2 -13
  41. package/dist/boot/stage-05-execution-env.d.ts +6 -13
  42. package/dist/boot/stage-05-execution-env.js +17 -5
  43. package/dist/boot/stage-06-runners.d.ts +6 -13
  44. package/dist/boot/stage-06-runners.js +10 -3
  45. package/dist/boot/stage-07-capability-layer.d.ts +7 -13
  46. package/dist/boot/stage-07-capability-layer.js +3 -3
  47. package/dist/boot/stage-08-reapers.d.ts +7 -13
  48. package/dist/boot/stage-08-reapers.js +2 -1
  49. package/dist/boot/stage-09-leader.d.ts +7 -13
  50. package/dist/boot/stage-09-leader.js +2 -2
  51. package/dist/boot/stage-10-http-server.d.ts +7 -13
  52. package/dist/boot/stage-10-http-server.js +6 -3
  53. package/dist/boot/stores.d.ts +1 -1
  54. package/dist/boot/web-admin.d.ts +5 -2
  55. package/dist/boot/web-admin.js +3 -3
  56. package/dist/brain.js +5 -5
  57. package/dist/broker/broker.d.ts +89 -0
  58. package/dist/broker/broker.js +287 -0
  59. package/dist/broker/constants.d.ts +39 -0
  60. package/dist/broker/constants.js +15 -0
  61. package/dist/broker/http1.d.ts +111 -0
  62. package/dist/broker/http1.js +256 -0
  63. package/dist/broker/lease-book.d.ts +87 -0
  64. package/dist/broker/lease-book.js +142 -0
  65. package/dist/broker/lease-file.d.ts +60 -0
  66. package/dist/broker/lease-file.js +127 -0
  67. package/dist/broker/main.d.ts +2 -0
  68. package/dist/broker/main.js +20 -0
  69. package/dist/budget.d.ts +17 -15
  70. package/dist/budget.js +2 -2
  71. package/dist/capabilities/composite-members.d.ts +2 -1
  72. package/dist/capabilities/composite-members.js +2 -1
  73. package/dist/capabilities/engine-capabilities.js +1 -0
  74. package/dist/capabilities/mcp-probe.d.ts +36 -11
  75. package/dist/capabilities/mcp-probe.js +44 -5
  76. package/dist/capabilities/scenarios.d.ts +23 -8
  77. package/dist/capabilities/scenarios.js +13 -8
  78. package/dist/capabilities/skills.d.ts +28 -5
  79. package/dist/capabilities/skills.js +8 -0
  80. package/dist/capability-facts.d.ts +6 -0
  81. package/dist/capability-facts.js +5 -0
  82. package/dist/center-credential-renewer.js +5 -1
  83. package/dist/checkpoint-ctx-seal-m28.d.ts +3 -10
  84. package/dist/checkpoint-ctx-seal-m28.js +1 -1
  85. package/dist/checkpoint-identity.d.ts +13 -6
  86. package/dist/config-catalog.js +16 -7
  87. package/dist/config-types.d.ts +24 -7
  88. package/dist/config.d.ts +1 -1
  89. package/dist/config.js +42 -13
  90. package/dist/deployment-governance.d.ts +2 -2
  91. package/dist/deployment-governance.js +7 -9
  92. package/dist/deployment-shape.d.ts +6 -6
  93. package/dist/device-ws-protocol.d.ts +1 -0
  94. package/dist/device-ws-protocol.js +2 -1
  95. package/dist/file-history-disclosure.d.ts +4 -2
  96. package/dist/file-history-disclosure.js +2 -0
  97. package/dist/gate-settlement.d.ts +71 -0
  98. package/dist/gate-settlement.js +40 -0
  99. package/dist/hooks/classic-stations.d.ts +12 -54
  100. package/dist/hooks/classic-stations.js +1 -0
  101. package/dist/hooks/command-spawn.d.ts +2 -2
  102. package/dist/hooks/hook-runner.js +14 -14
  103. package/dist/http/admission.js +14 -9
  104. package/dist/http/approval-sweeps.js +4 -3
  105. package/dist/http/caller-trust.d.ts +2 -1
  106. package/dist/http/caller-trust.js +1 -3
  107. package/dist/http/checkpoint-ctx.d.ts +48 -7
  108. package/dist/http/checkpoint-ctx.js +40 -0
  109. package/dist/http/dispatch.d.ts +4 -0
  110. package/dist/http/dispatch.js +18 -10
  111. package/dist/http/durable-run-leg.d.ts +5 -1
  112. package/dist/http/durable-run-leg.js +5 -3
  113. package/dist/http/health-self-report.d.ts +2 -2
  114. package/dist/http/memory-compliance-failure-reply.js +3 -0
  115. package/dist/http/principal-gate.d.ts +15 -10
  116. package/dist/http/principal-gate.js +48 -9
  117. package/dist/http/resume-legs.d.ts +7 -31
  118. package/dist/http/resume-legs.js +185 -126
  119. package/dist/http/route-ctx.d.ts +38 -53
  120. package/dist/http/route-ctx.js +2 -5
  121. package/dist/http/routes/a2a-serve.js +10 -4
  122. package/dist/http/routes/agents-roster.d.ts +1 -1
  123. package/dist/http/routes/agents-roster.js +5 -1
  124. package/dist/http/routes/approvals-assistant.js +24 -10
  125. package/dist/http/routes/capabilities.js +23 -11
  126. package/dist/http/routes/mcp-reconnect.d.ts +3 -2
  127. package/dist/http/routes/mcp-reconnect.js +7 -7
  128. package/dist/http/routes/memory-consolidation.d.ts +1 -1
  129. package/dist/http/routes/memory-origin.d.ts +1 -1
  130. package/dist/http/routes/rules.js +3 -3
  131. package/dist/http/routes/runs.js +13 -8
  132. package/dist/http/routes/session-sync.js +42 -6
  133. package/dist/http/routes/sessions.js +6 -3
  134. package/dist/http/routes/side-query.js +2 -3
  135. package/dist/http/routes/tasks.js +794 -780
  136. package/dist/http/server.d.ts +35 -25
  137. package/dist/http/stored-body-replay.d.ts +3 -3
  138. package/dist/http/stored-body-replay.js +6 -1
  139. package/dist/http/wire-types.d.ts +66 -33
  140. package/dist/identity-source.d.ts +65 -0
  141. package/dist/identity-source.js +45 -0
  142. package/dist/index.d.ts +2 -0
  143. package/dist/index.js +1 -0
  144. package/dist/leader/wire.d.ts +7 -0
  145. package/dist/leader/wire.js +5 -4
  146. package/dist/mcp-assertion-header.d.ts +51 -40
  147. package/dist/mcp-assertion-header.js +10 -11
  148. package/dist/mcp-authorization-face.d.ts +27 -0
  149. package/dist/mcp-authorization-face.js +15 -0
  150. package/dist/memory-operator-faces.d.ts +13 -4
  151. package/dist/memory-operator-faces.js +1 -17
  152. package/dist/memory-store-refusal.d.ts +3 -3
  153. package/dist/memory-sync-client.js +72 -57
  154. package/dist/memory-sync.d.ts +1 -1
  155. package/dist/model-entry-refusal.d.ts +2 -0
  156. package/dist/model-entry-refusal.js +11 -0
  157. package/dist/model-route-gap.d.ts +6 -22
  158. package/dist/model-route-gap.js +7 -5
  159. package/dist/model-select.d.ts +6 -17
  160. package/dist/model-select.js +0 -3
  161. package/dist/mods-declaration.d.ts +110 -0
  162. package/dist/mods-declaration.js +109 -0
  163. package/dist/namespaced-rule-name.d.ts +1 -1
  164. package/dist/observability/err-text.d.ts +5 -0
  165. package/dist/observability/err-text.js +9 -0
  166. package/dist/observability/fail-open.d.ts +17 -1
  167. package/dist/observability/fail-open.js +17 -1
  168. package/dist/observability/metrics.js +1 -1
  169. package/dist/observability/run-terminal.js +1 -0
  170. package/dist/observability/secret-env-scrub.d.ts +1 -1
  171. package/dist/observability/secret-env-scrub.js +1 -1
  172. package/dist/operator-ask.d.ts +2 -2
  173. package/dist/org-delivery-gate.js +1 -1
  174. package/dist/org-memory-admission.d.ts +2 -2
  175. package/dist/org-memory-admission.js +39 -2
  176. package/dist/parked-decide.d.ts +15 -2
  177. package/dist/parked-decide.js +17 -10
  178. package/dist/peer-directory.js +2 -0
  179. package/dist/peer-seat.d.ts +150 -0
  180. package/dist/peer-seat.js +239 -0
  181. package/dist/permission-rule-list.d.ts +2 -2
  182. package/dist/permission-rule-vocab.d.ts +7 -7
  183. package/dist/permission-rule-vocab.js +3 -3
  184. package/dist/plain-string-record.d.ts +38 -0
  185. package/dist/plain-string-record.js +38 -0
  186. package/dist/plugins/background-agent-store-sql.js +6 -3
  187. package/dist/plugins/caching-session-store.d.ts +5 -0
  188. package/dist/plugins/caching-session-store.js +6 -0
  189. package/dist/plugins/checkpoint-store-sql.d.ts +34 -29
  190. package/dist/plugins/checkpoint-store-sql.js +14 -14
  191. package/dist/plugins/file-history-store-sql.js +10 -16
  192. package/dist/plugins/file-run-store.js +8 -2
  193. package/dist/plugins/k8s-exec-protocol.d.ts +69 -13
  194. package/dist/plugins/k8s-exec-protocol.js +116 -28
  195. package/dist/plugins/k8s-pod-delete-failure.d.ts +25 -0
  196. package/dist/plugins/k8s-pod-delete-failure.js +17 -0
  197. package/dist/plugins/k8s-pod-reaper.d.ts +106 -0
  198. package/dist/plugins/k8s-pod-reaper.js +122 -0
  199. package/dist/plugins/local-checkpoint-store.d.ts +4 -17
  200. package/dist/plugins/local-checkpoint-store.js +3 -4
  201. package/dist/plugins/local-session-store.d.ts +66 -27
  202. package/dist/plugins/local-session-store.js +60 -28
  203. package/dist/plugins/mailbox-store-sql.d.ts +11 -3
  204. package/dist/plugins/mailbox-store-sql.js +103 -15
  205. package/dist/plugins/memory-run-store.js +2 -0
  206. package/dist/plugins/memory-sync-store-pg.d.ts +16 -5
  207. package/dist/plugins/memory-sync-store-tidb.d.ts +3 -3
  208. package/dist/plugins/one-time-migrations.d.ts +34 -12
  209. package/dist/plugins/one-time-migrations.js +51 -9
  210. package/dist/plugins/permission-rule-store-file.js +2 -2
  211. package/dist/plugins/permission-rule-store-sql.d.ts +17 -17
  212. package/dist/plugins/permission-rule-store-sql.js +37 -30
  213. package/dist/plugins/pg-pool.js +4 -0
  214. package/dist/plugins/pg-session-storage.d.ts +10 -2
  215. package/dist/plugins/pg-session-storage.js +20 -7
  216. package/dist/plugins/remote-env-adb.d.ts +6 -1
  217. package/dist/plugins/remote-env-adb.js +2 -1
  218. package/dist/plugins/remote-env-device.d.ts +6 -1
  219. package/dist/plugins/remote-env-device.js +5 -1
  220. package/dist/plugins/remote-env-e2b.d.ts +5 -0
  221. package/dist/plugins/remote-env-e2b.js +2 -1
  222. package/dist/plugins/remote-env-file-error.d.ts +8 -1
  223. package/dist/plugins/remote-env-file-error.js +7 -1
  224. package/dist/plugins/remote-env-host.d.ts +10 -2
  225. package/dist/plugins/remote-env-host.js +8 -2
  226. package/dist/plugins/remote-env-k8s.d.ts +140 -11
  227. package/dist/plugins/remote-env-k8s.js +277 -15
  228. package/dist/plugins/remote-env-local-docker.d.ts +5 -0
  229. package/dist/plugins/remote-env-local-docker.js +2 -1
  230. package/dist/plugins/remote-env-ssh.d.ts +6 -1
  231. package/dist/plugins/remote-env-ssh.js +2 -1
  232. package/dist/plugins/retention-store-sql.d.ts +14 -2
  233. package/dist/plugins/retention-store-sql.js +6 -0
  234. package/dist/plugins/run-store-sql.js +10 -4
  235. package/dist/plugins/session-fork.d.ts +10 -13
  236. package/dist/plugins/session-fork.js +5 -25
  237. package/dist/plugins/session-ownership.d.ts +24 -3
  238. package/dist/plugins/session-ownership.js +24 -5
  239. package/dist/plugins/session-workspace-cell.d.ts +17 -0
  240. package/dist/plugins/session-workspace-cell.js +38 -0
  241. package/dist/plugins/sql-errors.d.ts +23 -2
  242. package/dist/plugins/sql-errors.js +15 -0
  243. package/dist/plugins/store-backend.js +7 -7
  244. package/dist/plugins/store-contracts.d.ts +10 -1
  245. package/dist/plugins/store-fault.d.ts +2 -2
  246. package/dist/plugins/store-fault.js +4 -2
  247. package/dist/plugins/tidb-pool.js +13 -0
  248. package/dist/plugins/tidb-session-store.d.ts +17 -2
  249. package/dist/plugins/tidb-session-store.js +18 -7
  250. package/dist/plugins/tool-result-store-sql.d.ts +13 -6
  251. package/dist/plugins/tool-result-store-sql.js +8 -7
  252. package/dist/plugins/worktree-isolation.d.ts +3 -2
  253. package/dist/plugins/worktree-isolation.js +1 -7
  254. package/dist/project-identity.d.ts +1 -14
  255. package/dist/project-identity.js +0 -4
  256. package/dist/request-key-closure.js +1 -1
  257. package/dist/request-value-closure.d.ts +31 -2
  258. package/dist/request-value-closure.js +7 -1
  259. package/dist/rule-entry-list.d.ts +3 -2
  260. package/dist/rule-entry-list.js +2 -2
  261. package/dist/rules-consent.js +12 -7
  262. package/dist/run-local.d.ts +2 -2
  263. package/dist/run-local.js +12 -6
  264. package/dist/runs.d.ts +7 -1
  265. package/dist/runs.js +8 -2
  266. package/dist/runtime-governance.d.ts +5 -5
  267. package/dist/sandbox-git-lease.d.ts +49 -0
  268. package/dist/sandbox-git-lease.js +60 -0
  269. package/dist/sandbox-git-plane.d.ts +84 -0
  270. package/dist/sandbox-git-plane.js +105 -0
  271. package/dist/security.d.ts +16 -4
  272. package/dist/security.js +8 -3
  273. package/dist/server-secret-env.d.ts +12 -3
  274. package/dist/server-secret-env.js +18 -2
  275. package/dist/session-error-wire.d.ts +14 -6
  276. package/dist/session-error-wire.js +2 -1
  277. package/dist/session-incarnation.d.ts +4 -5
  278. package/dist/session-incarnation.js +2 -2
  279. package/dist/session-policy-wire.d.ts +1 -1
  280. package/dist/session-policy-wire.js +2 -2
  281. package/dist/session-sync.d.ts +1 -1
  282. package/dist/session-workspace.d.ts +130 -0
  283. package/dist/session-workspace.js +83 -0
  284. package/dist/spec-fields.d.ts +44 -14
  285. package/dist/spec-fields.js +33 -12
  286. package/dist/standing-answer-grant.d.ts +2 -13
  287. package/dist/standing-answer-grant.js +0 -7
  288. package/dist/stored-request-prompt-profile-m30.d.ts +49 -0
  289. package/dist/stored-request-prompt-profile-m30.js +25 -0
  290. package/dist/task-a2a.d.ts +44 -14
  291. package/dist/task-a2a.js +46 -20
  292. package/dist/task-mcp.d.ts +34 -21
  293. package/dist/task-mcp.js +46 -22
  294. package/dist/task-settings.d.ts +2 -2
  295. package/dist/tool-approval.d.ts +43 -9
  296. package/dist/tool-approval.js +57 -15
  297. package/dist/tool-rule-names.d.ts +5 -0
  298. package/dist/trace/core-keyset-guard.d.ts +34 -19
  299. package/dist/trace/engine-notice-wire.d.ts +1 -1
  300. package/dist/trace/engine-notice-wire.js +4 -0
  301. package/dist/trace/exit-seat.d.ts +20 -1
  302. package/dist/trace/exit-seat.js +5 -2
  303. package/dist/trace/extension-call-face.d.ts +33 -0
  304. package/dist/trace/extension-call-face.js +39 -0
  305. package/dist/trace/ledger-sink.d.ts +4 -5
  306. package/dist/trace/ledger-sink.js +3 -7
  307. package/dist/trace/project.d.ts +62 -10
  308. package/dist/trace/project.js +49 -9
  309. package/dist/trace/redact.d.ts +18 -6
  310. package/dist/trace/redact.js +154 -60
  311. package/dist/trace/self-minted-wire.d.ts +500 -7
  312. package/dist/trace/self-minted-wire.js +182 -1
  313. package/dist/trace/wire-projection-faces.d.ts +7 -5
  314. package/dist/trace/wire-projection-faces.js +9 -4
  315. package/dist/user-authored-text.d.ts +2 -2
  316. package/dist/user-authored-text.js +16 -1
  317. package/dist/web-admin-client/apply-effective.js +0 -1
  318. package/dist/web-admin-client/center-request.d.ts +23 -4
  319. package/dist/web-admin-client/center-request.js +42 -8
  320. package/dist/web-admin-client/http-client.js +6 -6
  321. package/dist/web-admin-client/skills-mcp.d.ts +8 -4
  322. package/dist/web-admin-client/skills-mcp.js +31 -18
  323. package/dist/web-admin-client/types.d.ts +10 -5
  324. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +11 -5
  325. package/package.json +3 -3
  326. package/wire-changes/server@7.137.0.json +825 -0
  327. package/wire-changes/server@7.138.0.json +446 -0
@@ -39,6 +39,7 @@ export const SELF_MINTED_WIRE = {
39
39
  at: "POST /v1/sessions/:id/memory/erase(已分类拒 errorCode → HTTP 状态)",
40
40
  members: {
41
41
  "config.memory_erasure_request": { attr: 400, since: "7.52.0" },
42
+ "config.memory_erasure_scope": { attr: 400, since: "7.138.0" },
42
43
  "memory.target_outside_store": { attr: 409, since: "7.101.0" },
43
44
  "memory.scope_home_not_directory": { attr: 409, since: "7.118.0" },
44
45
  "memory.erasure_evidence_unavailable": { attr: 409, since: "7.108.0" },
@@ -148,6 +149,33 @@ export const SELF_MINTED_WIRE = {
148
149
  title: { attr: "-", since: "7.133.0" },
149
150
  },
150
151
  },
152
+ credentialPlaneSandboxGitState: {
153
+ at: "GET /v1/capabilities credentialPlane.sandboxGit.state",
154
+ members: {
155
+ on: { attr: "-", since: "7.137.0" },
156
+ off: { attr: "-", since: "7.137.0" },
157
+ },
158
+ },
159
+ credentialPlaneSandboxGitOffReason: {
160
+ at: "GET /v1/capabilities credentialPlane.sandboxGit.reason",
161
+ members: {
162
+ single_user: { attr: "-", since: "7.137.0" },
163
+ lane_without_boundary: { attr: "-", since: "7.137.0" },
164
+ no_caller_credential: { attr: "-", since: "7.137.0" },
165
+ center_not_https: { attr: "-", since: "7.137.0" },
166
+ secret_seat_unverified: { attr: "-", since: "7.137.0" },
167
+ secret_seat_denied: { attr: "-", since: "7.137.0" },
168
+ pod_patch_reaches_broker: { attr: "-", since: "7.137.0" },
169
+ broker_image_unset: { attr: "-", since: "7.137.0" },
170
+ no_origins: { attr: "-", since: "7.137.0" },
171
+ },
172
+ },
173
+ credentialPlaneSandboxGitOriginReason: {
174
+ at: "GET /v1/capabilities credentialPlane.sandboxGit.origins[].reason",
175
+ members: {
176
+ insecure_transport: { attr: "-", since: "7.137.0" },
177
+ },
178
+ },
151
179
  healthAuthKind: {
152
180
  at: "GET /health auth.kinds[]",
153
181
  members: {
@@ -193,6 +221,58 @@ export const SELF_MINTED_WIRE = {
193
221
  unknown: { attr: "-", since: "7.121.0" },
194
222
  },
195
223
  },
224
+ healthModsKey: {
225
+ at: "GET /health mods",
226
+ members: {
227
+ deploymentPackages: { attr: "present-iff deployment mod packages loaded at boot", since: "7.138.0" },
228
+ },
229
+ },
230
+ modelsRowKey: {
231
+ at: "GET /v1/models models[] 行键(<键> → 在场律)",
232
+ members: {
233
+ supportsThinkingOff: { attr: "always", since: "7.138.0" },
234
+ },
235
+ },
236
+ toolEndGateDispositionKey: {
237
+ at: "tool_end gate.disposition 键(<臂>#<键> → 在场律)",
238
+ members: {
239
+ "denied#extension": { attr: "present-iff hook-layer denial by a named extension", since: "7.138.0" },
240
+ },
241
+ },
242
+ sideQueryBodyKey: {
243
+ at: "POST /v1/side-query 200 体键(<键> → 在场律)",
244
+ members: {
245
+ account: { attr: "always", since: "7.138.0" },
246
+ },
247
+ },
248
+ sideQueryErrorKind: {
249
+ at: "POST /v1/side-query 200 体 errorKind 的值(失败时在场;引擎的词逐字过境)",
250
+ members: {
251
+ image_unprocessable: { attr: "-", since: "7.138.0" },
252
+ },
253
+ },
254
+ mcpAuthorizationKey: {
255
+ at: "MCP 授权记录 authorization 的出现面(<面>#<键> → 在场律)",
256
+ members: {
257
+ "wiring_manifest.mcp[]#authorization": { attr: "present-iff errorCode unauthorized", since: "7.138.0" },
258
+ "POST /v1/sessions/:id/mcp/reconnect#status.authorization": { attr: "present-iff errorCode unauthorized", since: "7.138.0" },
259
+ "GET /v1/sessions/:id/mcp#servers[].authorization": { attr: "present-iff server unauthorized (this face carries no errorCode)", since: "7.138.0" },
260
+ },
261
+ },
262
+ wiringModProvenance: {
263
+ at: "wiring_manifest mods[].provenance",
264
+ members: {
265
+ server: { attr: "-", since: "7.138.0" },
266
+ operator: { attr: "-", since: "7.138.0" },
267
+ },
268
+ },
269
+ extensionRequesterSeat: {
270
+ at: "审批开卡帧上的 requestedBy(<帧>#requestedBy → 在场律)",
271
+ members: {
272
+ "tool_approval#requestedBy": { attr: "present-iff extension-initiated call", since: "7.138.0" },
273
+ "approval_request#requestedBy": { attr: "present-iff extension-initiated call", since: "7.138.0" },
274
+ },
275
+ },
196
276
  fieldConflictKind: {
197
277
  at: "400 request.field_conflict detail.kind",
198
278
  members: {
@@ -235,6 +315,15 @@ export const SELF_MINTED_WIRE = {
235
315
  not_object: { attr: "-", since: "7.133.0" },
236
316
  },
237
317
  },
318
+ inheritEnvRefusalReason: {
319
+ at: "400 request.field_invalid reason(inheritEnv 的值形 / 车道 / 无会话三只拒;另带 field: \"inheritEnv\")",
320
+ members: {
321
+ unknown_word: { attr: "-", since: "7.137.0" },
322
+ not_a_string: { attr: "-", since: "7.137.0" },
323
+ lane_not_host: { attr: "-", since: "7.137.0" },
324
+ no_authorizer_session: { attr: "-", since: "7.137.0" },
325
+ },
326
+ },
238
327
  submitIdempotency: {
239
328
  at: "提交幂等(<端点>#<面> → 应答状态)",
240
329
  members: {
@@ -268,6 +357,14 @@ export const SELF_MINTED_WIRE = {
268
357
  center: { attr: "-", since: "7.135.0" },
269
358
  },
270
359
  },
360
+ wiringSkillSource: {
361
+ at: "wiring_manifest skills[].source(run 级技能名册的来处;段只投根腿 / 续跑腿帧,零技能 = [])",
362
+ members: {
363
+ factory: { attr: "-", since: "7.137.0" },
364
+ center: { attr: "-", since: "7.137.0" },
365
+ request: { attr: "-", since: "7.137.0" },
366
+ },
367
+ },
271
368
  configCatalogValueVerdict: {
272
369
  at: "GET /v1/config/catalog rows[] 的判词位(<键> → 在场律)",
273
370
  members: {
@@ -301,6 +398,12 @@ export const SELF_MINTED_WIRE = {
301
398
  classifierNoRuling: { attr: "present-iff", since: "7.136.0" },
302
399
  },
303
400
  },
401
+ constraintRejectedBodyKey: {
402
+ at: "409 resume.constraint_rejected 拒体(<键> → 在场律)",
403
+ members: {
404
+ acceptableForm: { attr: "present-iff", since: "7.137.0" },
405
+ },
406
+ },
304
407
  endpointFaceStatus: {
305
408
  at: "逐端点应答面 → 状态(<端点>#<面> → 状态;只登记本版改了状态的面)",
306
409
  members: {
@@ -308,8 +411,15 @@ export const SELF_MINTED_WIRE = {
308
411
  "GET /v1/sessions/:id/sync/manifest#store_connection_fault(体 state.file_history_unreadable + permanence: transient)": { attr: 503, since: "7.136.0" },
309
412
  "GET /v1/sessions/:id/sync/entries#store_connection_fault(应答头发出之前;体同上)": { attr: 503, since: "7.136.0" },
310
413
  "GET /v1/sessions/:id/sync/history/blobs/:hash#store_connection_fault(体同上)": { attr: 503, since: "7.136.0" },
414
+ "GET /v1/sessions/:id/sync/manifest#store_connection_fault_session_gate(会话门那一读;体同上)": { attr: 503, since: "7.137.0" },
415
+ "GET /v1/sessions/:id/sync/entries#store_connection_fault_session_gate(会话门那一读,应答头发出之前;体同上)": { attr: 503, since: "7.137.0" },
416
+ "GET /v1/sessions/:id/sync/history/blobs/:hash#store_connection_fault_session_gate(会话门那一读;体同上)": { attr: 503, since: "7.137.0" },
417
+ "GET /v1/sessions/:id/sync/manifest#store_deployment_fault(缺表 / 权限拒;门读与读腿同一形;体 state.file_history_unreadable + permanence: terminal)": { attr: 503, since: "7.137.0" },
418
+ "GET /v1/sessions/:id/sync/entries#store_deployment_fault(应答头发出之前;体同上)": { attr: 503, since: "7.137.0" },
419
+ "GET /v1/sessions/:id/sync/history/blobs/:hash#store_deployment_fault(体同上)": { attr: 503, since: "7.137.0" },
311
420
  "GET /v1/sessions/:id/events#corrupt_archive(DB_BACKEND=local;开流之前;体 corrupt_session)": { attr: 500, since: "7.136.0" },
312
421
  "PATCH /v1/sessions/:id#corrupt_archive(DB_BACKEND=local;体 corrupt_session)": { attr: 500, since: "7.136.0" },
422
+ "POST /v1/tasks#stored_log_invalid(同步腿;打开已存日志撞上结构坏:悬空父 / 自指 / 成环 / 叶子缺席;零工作的拒;体 invalid_session)": { attr: 500, since: "7.137.0" },
313
423
  "POST /v1/sessions/:id/sync/import#identical_repush_blob_missing(体 missing_blob)": { attr: 422, since: "7.136.0" },
314
424
  "PATCH /v1/sessions/:id#title_no_visible_character(体 request.field_invalid)": { attr: 400, since: "7.136.0" },
315
425
  "POST /v1/sessions/:id/sync/import#title_no_visible_character(Phase A 体的 title;体 request.field_invalid)": { attr: 400, since: "7.136.0" },
@@ -321,18 +431,28 @@ export const SELF_MINTED_WIRE = {
321
431
  "POST /v1/tool-approvals/:id/respond#edited_rule_text_refused_after_adoption(匿名活卡收编给具名主体后新属主交坏规则文本;体 request.body_shape;契约成文的判据,今天经 /v1/adoption 到不了)": { attr: 400, since: "7.136.0" },
322
432
  "POST /v1/tasks|/v1/runs#command_line_slots_without_sealed_key_store(stdio MCP 的 command / args 与 command hook 的 command / args;体 conflict.checkpoint_ctx_unsealable + field + reason no_key_store;POST /v1/tasks/stream 在终局帧上带本码;本服务自己的装配下不可达(装配期已对「店在而封签器缺席」拒启,见 submit-ctx.ts 自述))": { attr: 409, since: "7.136.0" },
323
433
  "ALL authenticated routes#bearer_token_without_scope_claim(鉴权桥验证腿;配了 service 凭据或多租 REQUIRE_PRINCIPAL 的部署;体通用 auth.unauthorized)": { attr: 401, since: "7.136.0" },
434
+ "ALL principal-reading routes#principal_not_a_name(主体头 / SSO 令牌的 sub / 直连门 JWT 的 sub 不是一位主体的名字:空 / 空白 / 带控制、行段分隔或不可见格式字符;体 principal_not_a_name)": { attr: 400, since: "7.137.0" },
435
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#promptProfile(新提交;体 request.body_shape + unknownKeys [promptProfile])": { attr: 400, since: "7.137.0" },
436
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#skills[i].mods|agents[i].skills[j].mods(新提交;体 request.field_invalid)": { attr: 400, since: "7.137.0" },
437
+ "PUT /v1/sessions/:id/policy|POST /v1/sessions/:id/sync/import#toolDeny 名内带 *(`*` / `mcp__git*` / `Bas*`)": { attr: 200, since: "7.137.0" },
438
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#限制侧名内带 *(settings.permissions.deny|ask)": { attr: 200, since: "7.137.0" },
439
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#限制侧名内带 *(excludeTools)": { attr: 200, since: "7.137.0" },
440
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#限制侧名内带 *(skills[i].disallowedTools|agents[i].skills[j].disallowedTools)": { attr: 200, since: "7.137.0" },
441
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#限制侧名内带 *(agents[i].denyTools)": { attr: 200, since: "7.137.0" },
442
+ "POST /v1/assistant/tasks/:id/plan_review#checkpointId_not_current(体带的门身份不是该会话此刻待决的 plan 门;体 approval_stale + currentPending { checkpointId }?;不落决断、零状态改动)": { attr: 409, since: "7.137.0" },
443
+ "POST /v1/assistant/tasks/:id/plan_review#checkpointId_current(体带当前门的身份;受理形与不带键同)": { attr: 200, since: "7.137.0" },
324
444
  },
325
445
  },
326
446
  refusalSentenceForm: {
327
447
  at: "拒体 message 的句型(<码>#<座> → 句型骨架;码 / 状态 / 机读位不变)",
328
448
  members: {
329
- "409 decide.row_unrevivable#no_agent_name": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
330
449
  "409 decide.row_unrevivable#no_root_anchor": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
331
450
  "400 request.field_invalid#mcpServers.over_cap(受理口 · POST /v1/capabilities/mcp/probe 同句)": { attr: "head: <field> has <count> entries — at most <cap> are accepted", since: "7.136.0" },
332
451
  "400 request.field_invalid#a2aPeers.over_cap": { attr: "tail: 声明列表拒绝骨架的句尾(与 mcpServers 共用 request-declaration-refusal)", since: "7.136.0" },
333
452
  "400 request.field_invalid#a2aPeers[i].url|cardUrl.credential": { attr: "<field> (peer <name>) is not a usable declaration — <rule> …", since: "7.136.0" },
334
453
  "400 request.field_invalid#title.no_visible_character(PATCH /v1/sessions/:id · 会话同步 2c 导入的 title)": { attr: "title must contain at least one visible character", since: "7.136.0" },
335
454
  "503 state.file_history_unreadable#store_connection_fault(会话同步三条拉取读腿)": { attr: "this session's stored state could not be read right now (the store connection failed), so nothing was exported — retry later", since: "7.136.0" },
455
+ "503 state.file_history_unreadable#store_deployment_fault(会话同步三条拉取口)": { attr: "this session's stored state cannot be read: the store does not match what this deployment requires (a table is missing or the database account lacks a privilege), so nothing was exported — retrying will not help until an operator repairs the store", since: "7.137.0" },
336
456
  "connect_failed(run 失败终局)#snapshot_bucket_missing(k8s 车道读 latest 得 404 NoSuchBucket;连沙箱失败,一只 pod 都不建)": { attr: "workspace space pointer read failed (snapshot_bucket_missing): the workspace snapshot bucket <name> (WORKSPACE_SNAPSHOT_BUCKET; default workspaces) does not exist in the object store — refusing to start this run … Ways out: create the bucket, or set WORKSPACE_SNAPSHOT_BUCKET to one that exists, or set WORKSPACE_PERSIST=off …", since: "7.136.0" },
337
457
  "400 request.field_invalid#images[i].url.credential": { attr: "<field> <规则句> — the URL is kept as written (a parked task's resume context, logs), while images[i] can carry the image bytes inline: send { data, mimeType } instead of a URL that holds the credential", since: "7.136.0" },
338
458
  "400 request.field_invalid#a2aPeers.not_array": { attr: "head: a2aPeers is <shape>, not an array of A2A peer declarations", since: "7.136.0" },
@@ -341,12 +461,59 @@ export const SELF_MINTED_WIRE = {
341
461
  "400 request.body_shape#a2aPeers[i].unknown_key": { attr: "body: unrecognized key(s) on an A2A peer declaration — refused rather than dropped …; Accepted per entry: <keys>", since: "7.136.0" },
342
462
  "409 conflict.checkpoint_ctx_unsealable#submit(提交面:本服务没有保管店)": { attr: "slots: static request headers, the command lines and environment values given to MCP stdio servers and command hooks, settings.env, or settings.webSearch.apiKey", since: "7.136.0" },
343
463
  "409 conflict.checkpoint_ctx_unsealable#resume(续跑上下文读口)": { attr: "slots: static request headers, the command lines and environment values given to MCP stdio servers and command hooks, settings.env, or settings.webSearch.apiKey", since: "7.136.0" },
464
+ "400 request.field_invalid#promptLean.not_boolean": { attr: "promptLean must be a boolean", since: "7.137.0" },
465
+ "409 checkpoint.unsupported_version#retired_request_key(续跑问点:存体仍带退役请求键 promptProfile)": { attr: "this task was suspended by an earlier server version and its stored request still carries promptProfile, a request key this version no longer reads (…) … submit the work again as a new task with promptLean in place of promptProfile, …", since: "7.137.0" },
466
+ "400 request.field_invalid#skills[i].mods(顶层技能项)": { attr: "skill.mods is not a request key — skill registrations are code the deployment mounts, not request data (…)", since: "7.137.0" },
467
+ "400 request.field_invalid#attachments.not_object": { attr: "attachments must be an object { …, mcpInstructions?, mcpUnavailable? }", since: "7.137.0" },
468
+ "400 request.field_invalid#attachments.mcpUnavailable.not_boolean": { attr: "attachments.mcpUnavailable must be a boolean", since: "7.137.0" },
469
+ "读成空的规则条目拒句#wildcard_all(授予侧)": { attr: "`*` grants nothing on an allow list (the entries beside it still apply) — …; on a deny or ask list `*` is every tool", since: "7.137.0" },
470
+ "读成空的规则条目拒句#namespace_wildcard(授予侧)": { attr: "an allow list reads a `*` only in a protocol name's tool segment — …; on a deny or ask list a `*` in a name is a glob over the whole name (…)", since: "7.137.0" },
471
+ "400 request.field_invalid#plan_review.checkpointId.not_non_empty_string": { attr: "checkpointId must be a non-empty string (the identity of the plan gate you decided on: …)", since: "7.137.0" },
472
+ "400 request.field_invalid#plan_review.checkpointId.too_large": { attr: "checkpointId too large (max <n> chars)", since: "7.137.0" },
473
+ "400 request.body_shape#/decide.checkpointId(落 unsupportedKeys)": { attr: "unsupported (a body field of POST /v1/assistant/tasks/:id/plan_review — send it there, this door never reads it): checkpointId", since: "7.137.0" },
474
+ },
475
+ },
476
+ decisionBodyKey: {
477
+ at: "回决门族决断体的受理键(<端点>#<键> → 读法;只登本版新增的键)",
478
+ members: {
479
+ "POST /v1/assistant/tasks/:id/plan_review#checkpointId": { attr: "optional;non-empty-string≤128;not-current⇒409 approval_stale;direct-door:signed-envelope-ext", since: "7.137.0" },
480
+ },
481
+ },
482
+ approvalStaleBodyKey: {
483
+ at: "409 approval_stale 拒体(<端点>#<键> → 在场律)",
484
+ members: {
485
+ "POST /v1/assistant/tasks/:id/plan_review#currentPending.checkpointId": { attr: "present-iff", since: "7.137.0" },
486
+ },
487
+ },
488
+ parkLedgerRowKey: {
489
+ at: "GET /v1/runs/:id/events 的 suspended / needs_review 账本行 data(<键> → 在场律)",
490
+ members: {
491
+ checkpointId: { attr: "present-iff", since: "7.137.0" },
492
+ gate: { attr: "always", since: "1.214.2" },
493
+ reopened: { attr: "present-iff", since: "1.231.0" },
494
+ toolCallId: { attr: "present-iff", since: "7.41.0" },
495
+ },
496
+ },
497
+ settlementEvidenceKey: {
498
+ at: "回决门族 200 体的结清证据(<键> → 在场律;五个执行 / 回放边界由一只铸函数铸)",
499
+ members: {
500
+ checkpointId: { attr: "present-iff", since: "7.138.0" },
501
+ decisionCommitted: { attr: "present-iff", since: "7.138.0" },
502
+ },
503
+ },
504
+ approvalEnvelopeExtKey: {
505
+ at: "直连门证明 HMAC 信封第 6 位扩展对象的键(<键> → 用它的门)",
506
+ members: {
507
+ answer: { attr: "POST /v1/approvals/:sessionId/decide", since: "7.87.0" },
508
+ checkpointId: { attr: "POST /v1/assistant/tasks/:id/plan_review", since: "7.137.0" },
509
+ permissionModeAfter: { attr: "POST /v1/assistant/tasks/:id/plan_review", since: "7.87.0" },
344
510
  },
345
511
  },
346
512
  storeFaultPermanence: {
347
513
  at: "文件历史店故障答的体键 permanence(422 adopt_failed · restore_failed 等 · 503 state.file_history_unreadable)",
348
514
  members: {
349
515
  transient: { attr: "present-iff", since: "7.136.0" },
516
+ "terminal#deployment": { attr: "present-iff", since: "7.137.0" },
350
517
  },
351
518
  },
352
519
  configCatalogRow: {
@@ -355,6 +522,14 @@ export const SELF_MINTED_WIRE = {
355
522
  SEALED_KEY_DIR: { attr: "store", since: "7.136.0" },
356
523
  },
357
524
  },
525
+ deviceProtocolRevision: {
526
+ at: "GET /v1/capabilities deviceExecutor.protocolVersion 与 device WS challenge 帧的修订号(<修订号> → 它加进结局码闭集的词)",
527
+ members: {
528
+ 1: { attr: "base", since: "7.51.0" },
529
+ 2: { attr: "+liveness_no_output", since: "7.133.0" },
530
+ 3: { attr: "+name_too_long", since: "7.137.0" },
531
+ },
532
+ },
358
533
  wireValueRule: {
359
534
  at: "出口值变换(<端点>#<键> → 变换)",
360
535
  members: {
@@ -377,6 +552,12 @@ export const SELF_MINTED_WIRE = {
377
552
  "GET /v1/config/catalog#rows[WORKSPACE_SNAPSHOT_BUCKET].semantics": { attr: "boot-checks-bucket;runtime-latest-no-such-bucket-fails-run", since: "7.136.0" },
378
553
  "GET /v1/config/catalog#rows[WORKSPACE_SNAPSHOT_PREFIX].semantics": { attr: "multi-segment-prefix;bad-segment-refuses-boot", since: "7.136.0" },
379
554
  "GET /v1/config/catalog#rows[WORKSPACE_SNAPSHOT_PREFIX].derivedDefaultNote": { attr: "absent=>kata", since: "7.136.0" },
555
+ "GET /v1/config/catalog#rows[K8S_SANDBOX_ENV].semantics": { attr: "values-only-in-the-pod-own-secret;role-needs-secrets-create;denied-refuses-boot", since: "7.137.0" },
556
+ "GET /v1/sessions/:id/mcp#servers[].error": { attr: "exit-seat:mcp-remote-text(engine-mark=masked-value)+truncate:200", since: "7.138.0" },
557
+ "POST /v1/sessions/:id/mcp/reconnect#reason|status.error|listingIncomplete.error": { attr: "exit-seat:mcp-remote-text(engine-mark=masked-value)+truncate:200", since: "7.138.0" },
558
+ "GET /v1/config/catalog#rows[MODEL_VISION].semantics": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
559
+ "GET /v1/config/catalog#rows[MODEL_VISION].derivedDefaultNote": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
560
+ "GET /v1/config/catalog#rows[MODEL_CHEAP_VISION].semantics": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
380
561
  },
381
562
  },
382
563
  };
@@ -100,7 +100,7 @@ export type DeclaredKey = ManifestShape & {
100
100
  */
101
101
  export declare const FRAME_ENVELOPE_KEYS: readonly ["type", "sourceTaskId", "bgAgentId"];
102
102
  /** 探针文件要从 `@sema-agent/core` 具名导入的类型(`coreType` 表达式里用到的全部名字)。 */
103
- export declare const WIRE_PROJECTION_CORE_IMPORTS: readonly ["TaskEvent", "TaskNotificationPayload", "WiringManifest", "EngineNotice", "MemoryImportReport", "OriginClearanceRow", "OriginClearanceEvent", "MemoryEntryOrigin", "TraceEvent", "PromptManifestIdentity", "PromptIdentityLayers", "PromptManifestSelectors", "PromptManifestSection", "PromptChainLink", "SupersededOverlay", "ToolDisclosureManifest"];
103
+ export declare const WIRE_PROJECTION_CORE_IMPORTS: readonly ["TaskEvent", "BrainStatus", "TaskNotificationPayload", "WiringManifest", "EngineNotice", "MemoryImportReport", "OriginClearanceRow", "OriginClearanceEvent", "MemoryEntryOrigin", "TraceEvent", "PromptManifestIdentity", "PromptIdentityLayers", "PromptManifestSelectors", "PromptManifestSection", "PromptChainLink", "SupersededOverlay", "ToolDisclosureManifest"];
104
104
  /**
105
105
  * `wiring_manifest` 的 **operator 面多投的那几段**(`wiringManifestOperatorEventData` 在租户形之上加的段)。
106
106
  * operator 行的 `excluded` = 租户行减本常量(派生);四段各自的受众裁定在 `core-keyset-guard.ts` ⑥b。
@@ -171,12 +171,12 @@ export declare const WIRE_PROJECTION_FACES: {
171
171
  readonly workspace_changed: {
172
172
  readonly projector: "workspaceChangedEventData";
173
173
  readonly coreType: string;
174
- readonly excluded: readonly [];
174
+ readonly excluded: readonly ["root", "remote", "entered", "project"];
175
175
  readonly minted: readonly [];
176
176
  };
177
177
  readonly status: {
178
178
  readonly projector: "brainStatusEventData";
179
- readonly coreType: string;
179
+ readonly coreType: `BrainStatus & ${string}`;
180
180
  readonly excluded: readonly [];
181
181
  readonly minted: readonly [];
182
182
  };
@@ -213,7 +213,7 @@ export declare const WIRE_PROJECTION_FACES: {
213
213
  readonly human_input: {
214
214
  readonly projector: "humanInputEventData";
215
215
  readonly coreType: string;
216
- readonly excluded: readonly ["principal"];
216
+ readonly excluded: readonly ["principal", "runOrigin"];
217
217
  readonly minted: readonly [];
218
218
  };
219
219
  readonly task_notification: {
@@ -226,9 +226,10 @@ export declare const WIRE_PROJECTION_FACES: {
226
226
  readonly wiring_manifest_tenant: {
227
227
  readonly projector: "wiringManifestEventData";
228
228
  readonly coreType: `WiringManifest & ${string}`;
229
- readonly excluded: readonly ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence", "advisor"];
229
+ readonly excluded: readonly ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence", "advisor", "hostFloor"];
230
230
  readonly unwrapped: readonly ["manifest"];
231
231
  readonly minted: readonly ["instructions"];
232
+ readonly mintedConditional: readonly ["skills"];
232
233
  };
233
234
  readonly wiring_manifest_operator: {
234
235
  readonly projector: "wiringManifestOperatorEventData";
@@ -236,6 +237,7 @@ export declare const WIRE_PROJECTION_FACES: {
236
237
  readonly excluded: readonly string[];
237
238
  readonly unwrapped: readonly ["manifest"];
238
239
  readonly minted: readonly string[];
240
+ readonly mintedConditional: readonly string[];
239
241
  };
240
242
  readonly engine_notice: {
241
243
  readonly projector: "engineNoticeEventData";
@@ -1,6 +1,7 @@
1
1
  export const FRAME_ENVELOPE_KEYS = ["type", "sourceTaskId", "bgAgentId"];
2
2
  export const WIRE_PROJECTION_CORE_IMPORTS = [
3
3
  "TaskEvent",
4
+ "BrainStatus",
4
5
  "TaskNotificationPayload",
5
6
  "WiringManifest",
6
7
  "EngineNotice",
@@ -33,14 +34,14 @@ export const WIRE_PROJECTION_FACES = {
33
34
  tool_roster_delta: { projector: "toolRosterDeltaEventData", coreType: arm("tool_roster_delta"), excluded: [], minted: [] },
34
35
  diagnostics: { projector: "diagnosticsEventData", coreType: arm("diagnostics"), excluded: [], minted: [] },
35
36
  steering_injected: { projector: "steeringInjectedEventData", coreType: arm("steering_injected"), excluded: [], minted: [] },
36
- workspace_changed: { projector: "workspaceChangedEventData", coreType: arm("workspace_changed"), excluded: [], minted: [] },
37
- status: { projector: "brainStatusEventData", coreType: arm("status"), excluded: [], minted: [] },
37
+ workspace_changed: { projector: "workspaceChangedEventData", coreType: arm("workspace_changed"), excluded: ["root", "remote", "entered", "project"], minted: [] },
38
+ status: { projector: "brainStatusEventData", coreType: `BrainStatus & ${arm("status")}`, excluded: [], minted: [] },
38
39
  compacted: { projector: "compactedEventData", coreType: arm("compacted"), excluded: [], minted: [] },
39
40
  context_usage: { projector: "contextUsageEventData", coreType: arm("context_usage"), excluded: [], minted: [] },
40
41
  turn_end: { projector: "turnEndEventData", coreType: arm("turn_end"), excluded: [], minted: [] },
41
42
  compaction_outcome: { projector: "compactionOutcomeEventData", coreType: arm("compaction_outcome"), excluded: [], minted: [] },
42
43
  compaction_started: { projector: "compactionStartedEventData", coreType: arm("compaction_started"), excluded: [], minted: [] },
43
- human_input: { projector: "humanInputEventData", coreType: arm("human_input"), excluded: ["principal"], minted: [] },
44
+ human_input: { projector: "humanInputEventData", coreType: arm("human_input"), excluded: ["principal", "runOrigin"], minted: [] },
44
45
  task_notification: {
45
46
  projector: "taskNotificationEventData",
46
47
  coreType: `TaskNotificationPayload & ${arm("task_notification")}`,
@@ -51,9 +52,10 @@ export const WIRE_PROJECTION_FACES = {
51
52
  wiring_manifest_tenant: {
52
53
  projector: "wiringManifestEventData",
53
54
  coreType: `WiringManifest & ${arm("wiring_manifest")}`,
54
- excluded: ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence", "advisor"],
55
+ excluded: ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence", "advisor", "hostFloor"],
55
56
  unwrapped: ["manifest"],
56
57
  minted: ["instructions"],
58
+ mintedConditional: ["skills"],
57
59
  },
58
60
  wiring_manifest_operator: {
59
61
  projector: "wiringManifestOperatorEventData",
@@ -65,6 +67,9 @@ export const WIRE_PROJECTION_FACES = {
65
67
  get minted() {
66
68
  return WIRE_PROJECTION_FACES.wiring_manifest_tenant.minted;
67
69
  },
70
+ get mintedConditional() {
71
+ return WIRE_PROJECTION_FACES.wiring_manifest_tenant.mintedConditional;
72
+ },
68
73
  },
69
74
  engine_notice: { projector: "engineNoticeEventData", coreType: "EngineNotice", excluded: [], minted: ["ts"] },
70
75
  memory_import_report: { projector: "buildImportReportWire", coreType: "MemoryImportReport", excluded: [], minted: [] },
@@ -1,5 +1,5 @@
1
- /** 非用户正文块的闭集标签(引擎 / 壳注入)。加一个标签 = 改这里一处:下面的正则由本表生成。 */
2
- export declare const INJECTED_BLOCK_TAGS: readonly ["system-reminder", "task-notification", "attachment"];
1
+ /** 非用户正文块的闭集标签(引擎 / 壳注入)。加一个标签 = 改这里一处:下面的正则由本表生成(分支组的序 = 本表的序)。 */
2
+ export declare const INJECTED_BLOCK_TAGS: readonly ["system-reminder", "task-notification", "attachment", "command-name", "command-message", "command-args", "local-command-stdout", "local-command-stderr", "local-command-caveat", "bash-input", "bash-stdout", "bash-stderr", "bash-exit-code", "user-memory-input"];
3
3
  /**
4
4
  * 注入块的唯一一只正则(由 {@link INJECTED_BLOCK_TAGS} 生成)。**只配 `String.prototype.replace` 使用**(带 `g`,
5
5
  * `lastIndex` 有状态,拿去 `.test` / `.exec` 会读到上一次的位置)。
@@ -1,5 +1,20 @@
1
1
  import { redactSecrets } from "./trace/redact.js";
2
- export const INJECTED_BLOCK_TAGS = ["system-reminder", "task-notification", "attachment"];
2
+ export const INJECTED_BLOCK_TAGS = [
3
+ "system-reminder",
4
+ "task-notification",
5
+ "attachment",
6
+ "command-name",
7
+ "command-message",
8
+ "command-args",
9
+ "local-command-stdout",
10
+ "local-command-stderr",
11
+ "local-command-caveat",
12
+ "bash-input",
13
+ "bash-stdout",
14
+ "bash-stderr",
15
+ "bash-exit-code",
16
+ "user-memory-input",
17
+ ];
3
18
  export const INJECTED_BLOCK_RE = new RegExp(`<(${INJECTED_BLOCK_TAGS.join("|")})(?:\\s(?:[^<>"']|"[^"<]*"|'[^'<]*')*?)?(?:\\/>|>[\\s\\S]*?(?:<\\/\\1>|$))\\s*`, "g");
4
19
  export function stripInjectedBlocks(text) {
5
20
  return text.replace(INJECTED_BLOCK_RE, "");
@@ -52,7 +52,6 @@ function toModel(m, envDefaults = {}, logger) {
52
52
  ...(thinkingDefault ? { defaultThinking: thinkingDefault } : {}),
53
53
  ...(compat ? { compat } : {}),
54
54
  ...(m.extraBody ? { extraBody: m.extraBody } : {}),
55
- ...(Array.isArray(m.promptGuidance) && m.promptGuidance.length > 0 ? { promptGuidance: m.promptGuidance.map(String) } : {}),
56
55
  ...buildModelHeadersKey(m.name, m.headers, m.api),
57
56
  };
58
57
  const explicitAct = m.autoCompactTokens;
@@ -63,6 +63,14 @@ export declare function pullViewQuery(view: {
63
63
  readonly worker?: string | undefined;
64
64
  readonly principal?: string | undefined;
65
65
  }): string;
66
+ /**
67
+ * 中心回了重定向(`egress-redirect.ts` 的判据:`opaqueredirect` 或任何 3xx;304 除外,见 {@link NOT_MODIFIED}):不跟、不重试,类型化拒。拒句是 `egress-redirect.ts` 既有 helper 的那一句(与 hook 直连腿 /
68
+ * 记忆 embedder 同一条律),前面冠上这条请求打的那一席;不回显 `Location`。`status` 是中心回的码(续签器据此落「被拒」终态)。
69
+ */
70
+ export declare class CenterRedirectRefusedError extends Error {
71
+ readonly status: number;
72
+ constructor(status: number, message: string);
73
+ }
66
74
  export interface CenterRequestInit {
67
75
  readonly method?: "GET" | "POST" | "DELETE";
68
76
  /** JSON 请求体(在场 ⇒ `content-type: application/json`)。 */
@@ -74,8 +82,9 @@ export interface CenterRequestInit {
74
82
  }
75
83
  /**
76
84
  * 「后面要拼路径的基址」的拒句 —— 中心基址三席(`SEMA_WEB_ADMIN_URL` / `SEMA_WEB_ADMIN_LIVE_URL` / `SEMA_WEB_ADMIN_WEB_URL`)与本实例的
77
- * 公告地址(`FLEET_ADVERTISE_ADDRESS`,中心往它后面拼 `/v1/...`)同读。判官是 settings-schema 的 `httpUrlFlaws`(层级式 http(s) URL;Node 的 fetch
78
- * 认 `file://` / `data:`,配错的地址不许变成读本地文件),本函数只声明这一席禁哪几件({@link PATH_BASE_FORBIDS})。起服时 `config.ts` 判
85
+ * 公告地址(`FLEET_ADVERTISE_ADDRESS`,中心往它后面拼 `/v1/...`)同读。判官是 settings-schema 的 `pathBaseUrlFlaws`(14.7.0 起:这一座位的禁用集
86
+ * userinfo / query / fragment 与判官都在契约包,= `httpUrlFlaws` 配那一集;层级式 http(s) URL,Node 的 fetch 认 `file://` / `data:`,配错的地址不许变成
87
+ * 读本地文件),本仓零禁用集副本,编排器渲染公告地址 env 的一方调的是同一只。起服时 `config.ts` 判
79
88
  * (拒启),请求期 {@link centerFetch} 对同一份基址再判一次(自拼 `ServiceConfig` 的嵌入方也吃同一条规则)。合格 ⇒ `undefined`;否则交回
80
89
  * `<subject> <规则词>; got "<展示面安全形>"` —— 拒句里没有从值里解析出来的任何记号(scheme / userinfo / 主机名),捕获点照原样落日志即可。
81
90
  */
@@ -84,13 +93,23 @@ export declare function pathBaseUrlRefusal(subject: string, raw: string): string
84
93
  * [ref] —— 凭证续签:`POST {issuer}/api/v1/auth/token/refresh`,form `refresh_token=…`(settings-schema `AUTH_V1_PATHS.tokenRefresh`)。
85
94
  * · 以 `issuer` 为根(可带路径前缀;同源与否由续签器先判,本函数只装配);query / fragment 不带过去。
86
95
  * · **不带 Authorization**:这条端点凭 refresh token 认人,手里的 access token 可能已经过期。
87
- * · `redirect: "manual"`:3xx 不跟 —— POST 307/308 会把体(= refresh token)原样带去 `Location`,同源判据在重定向面前失效。
88
- * 3xx 原样交回,续签器按「被拒」处置。
96
+ * · 经 {@link sendToCenter}(`redirect: "manual"`):POST 307/308 会把体(= refresh token)原样带去 `Location`,同源判据在重定向面前失效 ⇒
97
+ * 中心回重定向 ⇒ 抛 {@link CenterRedirectRefusedError}(不跟),续签器把它落成「被拒」终态(配置事故,重试无益)。
89
98
  */
90
99
  export declare function centerTokenRefresh(issuer: string, refreshToken: string, init: {
91
100
  readonly timeoutMs: number;
92
101
  readonly fetchImpl?: typeof fetch;
93
102
  }): Promise<Response>;
103
+ /**
104
+ * 鉴权桥的 JWKS 拉取:`GET <jwksUrl>`,不带凭证(公钥集是公开的)。地址缺省 = 签发方(`SEMA_WEB_ADMIN_URL` / `AUTH_BRIDGE_ISSUER`)+ 契约包的
105
+ * `WEB_ADMIN_JWKS_PATH`,运维可用 `AUTH_BRIDGE_JWKS_URL` 改写 —— 打的是中心的公钥面,所以同经 {@link sendToCenter}:回重定向 ⇒ 同一只类型化拒、不跟
106
+ * (此前它自带 `redirect: "error"`,是中心面上的第二种重定向读法,拒句是传输层的 `fetch failed`、不点名出路)。体量帽 / 解析 / 缓存仍是调用方
107
+ * (`auth-bridge.ts`)的事;本函数只发这一次请求。
108
+ */
109
+ export declare function centerJwksFetch(jwksUrl: string, init: {
110
+ readonly timeoutMs: number;
111
+ readonly fetchImpl?: typeof fetch | undefined;
112
+ }): Promise<Response>;
94
113
  /**
95
114
  * 对中心发一条请求。返回响应与**这次请求所用凭证的身份**(调用方据此给拿回来的候选打分箱标记,
96
115
  * 见 `boot/web-admin.ts` 的 LKG / prompt 状态分箱)。
@@ -2,8 +2,9 @@ import settingsSchemaPackage from "@sema-agent/settings-schema/package.json" wit
2
2
  import { AUTH_V1_PATHS } from "@sema-agent/settings-schema/api/auth";
3
3
  import { FLEET_LIVE_PATHS, FLEET_PATHS } from "@sema-agent/settings-schema/fleet";
4
4
  import { CenterCredentialUnavailableError } from "../center-credential.js";
5
- import { WEB_ADMIN_ENV, httpUrlFlaws } from "@sema-agent/settings-schema";
5
+ import { WEB_ADMIN_ENV, httpUrlFlaws, pathBaseUrlFlaws } from "@sema-agent/settings-schema";
6
6
  import { buildHttpUrlRefusal } from "../url-refusal.js";
7
+ import { egressRedirectRefusal } from "../egress-redirect.js";
7
8
  export const SCHEMA_MAJOR_HEADER = "x-sema-schema-major";
8
9
  export const CENTER_PULL_TIMEOUT_MS = 8000;
9
10
  export const SETTINGS_SCHEMA_MAJOR = (() => {
@@ -57,9 +58,32 @@ function routePath(route, kind) {
57
58
  return "/api/config/execution-keys";
58
59
  }
59
60
  }
60
- const PATH_BASE_FORBIDS = ["userinfo", "query", "fragment"];
61
+ export class CenterRedirectRefusedError extends Error {
62
+ status;
63
+ constructor(status, message) {
64
+ super(message);
65
+ this.status = status;
66
+ this.name = "CenterRedirectRefusedError";
67
+ }
68
+ }
69
+ const NOT_MODIFIED = 304;
70
+ async function sendToCenter(fix, url, wire) {
71
+ const res = await (wire.fetchImpl ?? fetch)(url, {
72
+ method: wire.method,
73
+ headers: wire.headers,
74
+ ...(wire.body !== undefined ? { body: wire.body } : {}),
75
+ redirect: "manual",
76
+ signal: AbortSignal.timeout(wire.timeoutMs),
77
+ });
78
+ if (res.status === NOT_MODIFIED)
79
+ return res;
80
+ const refusal = egressRedirectRefusal(res, fix);
81
+ if (refusal !== undefined)
82
+ throw new CenterRedirectRefusedError(res.status, `web-admin center request: ${refusal}`);
83
+ return res;
84
+ }
61
85
  export function pathBaseUrlRefusal(subject, raw) {
62
- const flaws = httpUrlFlaws(raw, PATH_BASE_FORBIDS);
86
+ const flaws = pathBaseUrlFlaws(raw);
63
87
  return flaws.length === 0 ? undefined : buildHttpUrlRefusal(subject, raw, flaws);
64
88
  }
65
89
  function assertPathBaseUrl(raw, what) {
@@ -75,12 +99,20 @@ export async function centerTokenRefresh(issuer, refreshToken, init) {
75
99
  url.pathname = `${url.pathname.replace(/\/+$/, "")}${AUTH_V1_PATHS.tokenRefresh}`;
76
100
  url.search = "";
77
101
  url.hash = "";
78
- return (init.fetchImpl ?? fetch)(url, {
102
+ return sendToCenter(`the credential issuer must be the final center address — set ${WEB_ADMIN_ENV.url} to it and sign in again`, url, {
79
103
  method: "POST",
80
104
  headers: { [SCHEMA_MAJOR_HEADER]: SETTINGS_SCHEMA_MAJOR, "content-type": "application/x-www-form-urlencoded" },
81
105
  body: new URLSearchParams({ refresh_token: refreshToken }).toString(),
82
- redirect: "manual",
83
- signal: AbortSignal.timeout(init.timeoutMs),
106
+ timeoutMs: init.timeoutMs,
107
+ fetchImpl: init.fetchImpl,
108
+ });
109
+ }
110
+ export async function centerJwksFetch(jwksUrl, init) {
111
+ return sendToCenter(`declare the final JWKS address — AUTH_BRIDGE_JWKS_URL, or the issuer it derives from (${WEB_ADMIN_ENV.url} / AUTH_BRIDGE_ISSUER)`, jwksUrl, {
112
+ method: "GET",
113
+ headers: { [SCHEMA_MAJOR_HEADER]: SETTINGS_SCHEMA_MAJOR },
114
+ timeoutMs: init.timeoutMs,
115
+ fetchImpl: init.fetchImpl,
84
116
  });
85
117
  }
86
118
  export async function centerFetch(center, route, init) {
@@ -99,12 +131,14 @@ export async function centerFetch(center, route, init) {
99
131
  const liveBase = FLEET_LIVE_PATHS.includes(path) ? center.liveBaseUrl : undefined;
100
132
  if (liveBase !== undefined)
101
133
  assertPathBaseUrl(liveBase, WEB_ADMIN_ENV.liveUrl);
134
+ const seat = liveBase !== undefined ? WEB_ADMIN_ENV.liveUrl : WEB_ADMIN_ENV.url;
102
135
  const url = `${(liveBase ?? center.baseUrl).replace(/\/+$/, "")}${path}`;
103
- const res = await (init.fetchImpl ?? fetch)(url, {
136
+ const res = await sendToCenter(`declare the final address in ${seat}`, url, {
104
137
  method: init.method ?? "GET",
105
138
  headers,
106
139
  ...(init.json !== undefined ? { body: JSON.stringify(init.json) } : {}),
107
- signal: AbortSignal.timeout(init.timeoutMs),
140
+ timeoutMs: init.timeoutMs,
141
+ fetchImpl: init.fetchImpl,
108
142
  });
109
143
  return { res, identity: cred.identity };
110
144
  }
@@ -3,7 +3,7 @@ import { readEffectiveWire, PrincipalCapsWire } from "@sema-agent/settings-schem
3
3
  import { separateRetiredDomains, splitFoldedReadWarnings, withDroppedCatalogEntries } from "./read-warnings.js";
4
4
  import { CENTER_PULL_TIMEOUT_MS, centerFetch } from "./center-request.js";
5
5
  import { answerStillCurrent } from "../center-credential.js";
6
- export async function fetchEffective(center, etag, fetchImpl = fetch, worker) {
6
+ export async function fetchEffective(center, etag, fetchImpl, worker) {
7
7
  const { res, identity } = await centerFetch(center, { kind: "effective", worker }, { etag, timeoutMs: CENTER_PULL_TIMEOUT_MS, fetchImpl });
8
8
  if (res.status === 304)
9
9
  return null;
@@ -25,7 +25,7 @@ export async function fetchEffective(center, etag, fetchImpl = fetch, worker) {
25
25
  ...(retiredDomains.length > 0 ? { retiredDomains: [...retiredDomains] } : {}),
26
26
  };
27
27
  }
28
- export async function fetchPrincipalCaps(center, principal, etag, fetchImpl = fetch, worker) {
28
+ export async function fetchPrincipalCaps(center, principal, etag, fetchImpl, worker) {
29
29
  const raw = await requestPrincipalView(center, principal, etag, fetchImpl, worker);
30
30
  if (raw === null)
31
31
  return null;
@@ -99,7 +99,7 @@ async function requestPrincipalView(center, principal, etag, fetchImpl, worker)
99
99
  return { json, ...(responseEtag !== null ? { etag: responseEtag } : {}) };
100
100
  }
101
101
  const PrincipalOrgMemoryEnvelope = PrincipalCapsWire.pick({ principal: true, orgMemory: true });
102
- export async function fetchPrincipalOrgMemory(center, principal, fetchImpl = fetch, worker) {
102
+ export async function fetchPrincipalOrgMemory(center, principal, fetchImpl, worker) {
103
103
  const raw = await requestPrincipalView(center, principal, undefined, fetchImpl, worker);
104
104
  if (raw === null)
105
105
  throw new Error("web-admin returned 304 to a non-conditional org-directory fetch");
@@ -118,7 +118,7 @@ export class WebAdminHttpError extends Error {
118
118
  this.name = "WebAdminHttpError";
119
119
  }
120
120
  }
121
- export async function fetchSkillContent(center, contentHash, fetchImpl = fetch) {
121
+ export async function fetchSkillContent(center, contentHash, fetchImpl) {
122
122
  const { res } = await centerFetch(center, { kind: "skill-content", contentHash }, { timeoutMs: CENTER_PULL_TIMEOUT_MS, fetchImpl });
123
123
  if (!res.ok)
124
124
  throw new WebAdminHttpError(`skill content HTTP ${res.status} for ${contentHash}`, res.status);
@@ -129,13 +129,13 @@ export async function fetchSkillContent(center, contentHash, fetchImpl = fetch)
129
129
  throw new Error(`skill content hash mismatch for ${contentHash}: computed sha256:${got}`);
130
130
  return content;
131
131
  }
132
- export async function fetchPromptArtifact(center, artifactDigest, fetchImpl = fetch) {
132
+ export async function fetchPromptArtifact(center, artifactDigest, fetchImpl) {
133
133
  const { res } = await centerFetch(center, { kind: "prompt-artifact", digest: artifactDigest }, { timeoutMs: CENTER_PULL_TIMEOUT_MS, fetchImpl });
134
134
  if (!res.ok)
135
135
  throw new WebAdminHttpError(`prompt artifact HTTP ${res.status} for ${artifactDigest}`, res.status);
136
136
  return await res.json();
137
137
  }
138
- export async function fetchPromptBlob(center, contentDigest, fetchImpl = fetch) {
138
+ export async function fetchPromptBlob(center, contentDigest, fetchImpl) {
139
139
  const { res } = await centerFetch(center, { kind: "prompt-blob", digest: contentDigest }, { timeoutMs: CENTER_PULL_TIMEOUT_MS, fetchImpl });
140
140
  if (!res.ok)
141
141
  throw new WebAdminHttpError(`prompt blob HTTP ${res.status} for ${contentDigest}`, res.status);