@sema-agent/server 7.131.0 → 7.133.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 (509) hide show
  1. package/MIGRATION.md +575 -0
  2. package/README.md +12 -9
  3. package/README.zh-CN.md +9 -6
  4. package/USAGE.md +326 -98
  5. package/deploy/sema-up/README.md +19 -1
  6. package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -2
  7. package/deploy/sema-up/chart/templates/server.yaml +5 -2
  8. package/deploy/sema-up/stack/compose.yaml +3 -0
  9. package/deploy/sema-up/stack/sema-stack-cluster.yaml +4 -2
  10. package/dist/adoption/plan.d.ts +3 -2
  11. package/dist/adoption/plan.js +7 -5
  12. package/dist/adoption/runner.js +3 -10
  13. package/dist/adoption/sql.d.ts +3 -2
  14. package/dist/adoption/sql.js +3 -5
  15. package/dist/adoption/wire.d.ts +4 -1
  16. package/dist/adoption/wire.js +1 -0
  17. package/dist/approval-ask-audit-store.d.ts +31 -13
  18. package/dist/approval-ask-audit-store.js +272 -74
  19. package/dist/approval-ask-machine.d.ts +15 -0
  20. package/dist/approval-ask-machine.js +6 -0
  21. package/dist/approval-ask-retention.d.ts +136 -0
  22. package/dist/approval-ask-retention.js +102 -0
  23. package/dist/approval-card.d.ts +82 -20
  24. package/dist/approval-card.js +46 -16
  25. package/dist/approval-deny-reasons.d.ts +1 -1
  26. package/dist/approval.d.ts +9 -0
  27. package/dist/approval.js +24 -3
  28. package/dist/audit.d.ts +33 -19
  29. package/dist/audit.js +12 -16
  30. package/dist/auth-bridge.d.ts +4 -0
  31. package/dist/auth-bridge.js +10 -11
  32. package/dist/bake-runner/main.js +3 -2
  33. package/dist/boot/deferred-sandbox-path-env.js +1 -1
  34. package/dist/boot/deployment-mods.d.ts +31 -0
  35. package/dist/boot/deployment-mods.js +26 -0
  36. package/dist/boot/execution-env.d.ts +1 -1
  37. package/dist/boot/execution-env.js +27 -12
  38. package/dist/boot/execution-lane.js +11 -0
  39. package/dist/boot/leader.js +2 -0
  40. package/dist/boot/memory-boundary.d.ts +2 -2
  41. package/dist/boot/memory-boundary.js +2 -2
  42. package/dist/boot/memory-consolidation.d.ts +5 -4
  43. package/dist/boot/memory-consolidation.js +7 -6
  44. package/dist/boot/org-delivery.d.ts +28 -0
  45. package/dist/boot/org-delivery.js +20 -0
  46. package/dist/boot/read-deny-anchor-audit.d.ts +17 -0
  47. package/dist/boot/read-deny-anchor-audit.js +36 -0
  48. package/dist/boot/reapers.d.ts +3 -0
  49. package/dist/boot/reapers.js +21 -1
  50. package/dist/boot/resolve-spec.d.ts +4 -5
  51. package/dist/boot/resolve-spec.js +74 -123
  52. package/dist/boot/runner-deps.d.ts +19 -8
  53. package/dist/boot/runner-deps.js +15 -2
  54. package/dist/boot/session-faces.d.ts +2 -7
  55. package/dist/boot/session-faces.js +4 -2
  56. package/dist/boot/stage-02-web-admin-pull.js +4 -1
  57. package/dist/boot/stage-03-store-backend.d.ts +1 -1
  58. package/dist/boot/stage-03-store-backend.js +2 -2
  59. package/dist/boot/stage-04-stores.d.ts +1 -1
  60. package/dist/boot/stage-05-execution-env.d.ts +4 -4
  61. package/dist/boot/stage-05-execution-env.js +7 -10
  62. package/dist/boot/stage-06-runners.d.ts +4 -2
  63. package/dist/boot/stage-06-runners.js +11 -7
  64. package/dist/boot/stage-07-capability-layer.d.ts +4 -2
  65. package/dist/boot/stage-07-capability-layer.js +27 -6
  66. package/dist/boot/stage-08-reapers.d.ts +4 -2
  67. package/dist/boot/stage-08-reapers.js +2 -2
  68. package/dist/boot/stage-09-leader.d.ts +6 -9
  69. package/dist/boot/stage-10-http-server.d.ts +6 -9
  70. package/dist/boot/stage-10-http-server.js +7 -9
  71. package/dist/boot/stores.d.ts +1 -1
  72. package/dist/boot/stores.js +7 -8
  73. package/dist/boot/web-admin.d.ts +4 -3
  74. package/dist/boot/web-admin.js +186 -98
  75. package/dist/boot/workflow-orchestration.d.ts +2 -0
  76. package/dist/boot/workflow-orchestration.js +2 -1
  77. package/dist/brain.js +25 -25
  78. package/dist/breaker-key.d.ts +6 -0
  79. package/dist/breaker-key.js +29 -0
  80. package/dist/budget.js +5 -4
  81. package/dist/caller-text-echo.d.ts +23 -0
  82. package/dist/caller-text-echo.js +21 -0
  83. package/dist/capabilities/brand-identity.d.ts +26 -0
  84. package/dist/capabilities/brand-identity.js +27 -0
  85. package/dist/capabilities/center-plugins.d.ts +7 -0
  86. package/dist/capabilities/center-plugins.js +1 -1
  87. package/dist/capabilities/center-prompts.d.ts +32 -59
  88. package/dist/capabilities/center-prompts.js +18 -32
  89. package/dist/capabilities/composite-members.d.ts +1 -1
  90. package/dist/capabilities/composite-members.js +1 -1
  91. package/dist/capabilities/engine-capabilities.js +2 -1
  92. package/dist/capabilities/execution-lane.js +2 -2
  93. package/dist/capabilities/hands-lane.d.ts +30 -6
  94. package/dist/capabilities/hands-lane.js +11 -1
  95. package/dist/capabilities/mcp-probe.d.ts +48 -3
  96. package/dist/capabilities/mcp-probe.js +47 -135
  97. package/dist/capabilities/scenarios.d.ts +95 -45
  98. package/dist/capabilities/scenarios.js +53 -38
  99. package/dist/capabilities/skills.d.ts +19 -4
  100. package/dist/capabilities/skills.js +30 -10
  101. package/dist/capability-facts.d.ts +34 -4
  102. package/dist/capability-facts.js +28 -2
  103. package/dist/center-config-tier.d.ts +69 -0
  104. package/dist/center-config-tier.js +42 -0
  105. package/dist/checkpoint-identity.d.ts +16 -0
  106. package/dist/checkpoint-identity.js +19 -0
  107. package/dist/config-catalog.d.ts +17 -10
  108. package/dist/config-catalog.js +47 -32
  109. package/dist/config-d-migration.d.ts +3 -1
  110. package/dist/config-d-migration.js +2 -2
  111. package/dist/config-dir-trust.d.ts +114 -0
  112. package/dist/config-dir-trust.js +388 -0
  113. package/dist/config-invariants.d.ts +18 -5
  114. package/dist/config-invariants.js +35 -3
  115. package/dist/config-lkg.d.ts +9 -9
  116. package/dist/config-lkg.js +20 -4
  117. package/dist/config-provider.d.ts +9 -2
  118. package/dist/config-provider.js +18 -6
  119. package/dist/config-types.d.ts +75 -20
  120. package/dist/config-types.js +8 -0
  121. package/dist/config.d.ts +13 -0
  122. package/dist/config.js +137 -62
  123. package/dist/delegated-session-owner.d.ts +185 -0
  124. package/dist/delegated-session-owner.js +119 -0
  125. package/dist/device-protocol.d.ts +5 -3
  126. package/dist/device-protocol.js +1 -1
  127. package/dist/device-ws-hub.js +21 -2
  128. package/dist/device-ws-protocol.d.ts +70 -6
  129. package/dist/device-ws-protocol.js +50 -22
  130. package/dist/elicitation.js +3 -2
  131. package/dist/entry-problems.d.ts +34 -0
  132. package/dist/entry-problems.js +14 -0
  133. package/dist/env-name-allowlist-knobs.d.ts +12 -2
  134. package/dist/env-name-allowlist-knobs.js +5 -4
  135. package/dist/exec-bounds.d.ts +15 -3
  136. package/dist/exec-bounds.js +4 -0
  137. package/dist/execution-lane-caps.d.ts +56 -10
  138. package/dist/execution-lane-caps.js +50 -0
  139. package/dist/field-conflict.d.ts +43 -0
  140. package/dist/field-conflict.js +20 -0
  141. package/dist/fleet/fleet-bus.d.ts +80 -6
  142. package/dist/fleet/fleet-bus.js +41 -9
  143. package/dist/hooks/classic-stations.d.ts +91 -0
  144. package/dist/hooks/classic-stations.js +27 -0
  145. package/dist/hooks/command-spawn.d.ts +57 -0
  146. package/dist/hooks/command-spawn.js +139 -0
  147. package/dist/hooks/hook-llm.d.ts +8 -5
  148. package/dist/hooks/hook-llm.js +79 -36
  149. package/dist/hooks/hook-runner.d.ts +349 -95
  150. package/dist/hooks/hook-runner.js +855 -568
  151. package/dist/hooks/hook-source.d.ts +44 -0
  152. package/dist/hooks/hook-source.js +40 -0
  153. package/dist/http/active-run-conflict.d.ts +5 -13
  154. package/dist/http/active-run-conflict.js +17 -27
  155. package/dist/http/admission.d.ts +8 -2
  156. package/dist/http/admission.js +188 -101
  157. package/dist/http/approval-sweeps.js +99 -21
  158. package/dist/http/caller-trust.d.ts +77 -0
  159. package/dist/http/caller-trust.js +143 -0
  160. package/dist/http/checkpoint-ctx.d.ts +41 -24
  161. package/dist/http/checkpoint-ctx.js +23 -16
  162. package/dist/http/claimed-run.d.ts +14 -0
  163. package/dist/http/claimed-run.js +15 -0
  164. package/dist/http/device-placement.d.ts +2 -4
  165. package/dist/http/device-placement.js +7 -11
  166. package/dist/http/dispatch.d.ts +0 -4
  167. package/dist/http/dispatch.js +15 -13
  168. package/dist/http/durable-run-leg.d.ts +6 -33
  169. package/dist/http/durable-run-leg.js +36 -10
  170. package/dist/http/health-self-report.d.ts +7 -5
  171. package/dist/http/health-self-report.js +4 -18
  172. package/dist/http/owner-access.d.ts +56 -0
  173. package/dist/http/owner-access.js +42 -0
  174. package/dist/http/principal-gate.d.ts +70 -28
  175. package/dist/http/principal-gate.js +61 -15
  176. package/dist/http/readiness.d.ts +11 -5
  177. package/dist/http/readiness.js +10 -3
  178. package/dist/http/refusal-body.d.ts +21 -0
  179. package/dist/http/refusal-body.js +4 -0
  180. package/dist/http/request-guards.d.ts +43 -23
  181. package/dist/http/request-guards.js +53 -17
  182. package/dist/http/resume-ctx-read.d.ts +2 -5
  183. package/dist/http/resume-ctx-read.js +7 -4
  184. package/dist/http/resume-legs.d.ts +28 -4
  185. package/dist/http/resume-legs.js +169 -91
  186. package/dist/http/retired-service-deps.d.ts +43 -0
  187. package/dist/http/retired-service-deps.js +18 -0
  188. package/dist/http/route-ctx.d.ts +44 -28
  189. package/dist/http/route-ctx.js +4 -0
  190. package/dist/http/route-table.js +2 -0
  191. package/dist/http/routes/a2a-serve.js +3 -4
  192. package/dist/http/routes/admin-config-refresh.js +1 -1
  193. package/dist/http/routes/admin-drain.js +1 -1
  194. package/dist/http/routes/admin-memory-optout.js +5 -1
  195. package/dist/http/routes/adoption.js +2 -9
  196. package/dist/http/routes/approvals-assistant.js +49 -48
  197. package/dist/http/routes/background.js +3 -2
  198. package/dist/http/routes/capabilities.js +21 -5
  199. package/dist/http/routes/config-catalog.d.ts +3 -3
  200. package/dist/http/routes/config-catalog.js +1 -1
  201. package/dist/http/routes/devices.js +3 -17
  202. package/dist/http/routes/diagnostics.js +6 -2
  203. package/dist/http/routes/images.js +6 -7
  204. package/dist/http/routes/leader.js +1 -8
  205. package/dist/http/routes/mcp-reconnect.d.ts +1 -1
  206. package/dist/http/routes/mcp-reconnect.js +3 -2
  207. package/dist/http/routes/memory-bundle.js +1 -1
  208. package/dist/http/routes/memory-compliance.js +1 -1
  209. package/dist/http/routes/memory-consolidation.js +1 -1
  210. package/dist/http/routes/memory-origin.js +1 -1
  211. package/dist/http/routes/memory-policy.d.ts +1 -1
  212. package/dist/http/routes/memory-policy.js +3 -2
  213. package/dist/http/routes/notify-wake.js +8 -21
  214. package/dist/http/routes/observability.js +2 -2
  215. package/dist/http/routes/principal-inbox.d.ts +39 -0
  216. package/dist/http/routes/principal-inbox.js +76 -0
  217. package/dist/http/routes/retention-ops.js +2 -9
  218. package/dist/http/routes/rules.js +5 -18
  219. package/dist/http/routes/runs.d.ts +5 -0
  220. package/dist/http/routes/runs.js +34 -107
  221. package/dist/http/routes/session-sync.js +15 -26
  222. package/dist/http/routes/sessions.js +30 -40
  223. package/dist/http/routes/shared-memory.js +2 -13
  224. package/dist/http/routes/side-query.js +8 -7
  225. package/dist/http/routes/tasks.js +67 -21
  226. package/dist/http/routes/workflows.d.ts +351 -0
  227. package/dist/http/routes/workflows.js +153 -119
  228. package/dist/http/send.d.ts +33 -10
  229. package/dist/http/send.js +21 -4
  230. package/dist/http/server.d.ts +27 -18
  231. package/dist/http/server.js +34 -6
  232. package/dist/http/stored-body-replay.js +17 -4
  233. package/dist/http/submit-ctx.d.ts +25 -0
  234. package/dist/http/submit-ctx.js +40 -0
  235. package/dist/http/submit-replay.d.ts +4 -3
  236. package/dist/http/submit-replay.js +5 -4
  237. package/dist/http/wire-types.d.ts +11 -8
  238. package/dist/index.d.ts +2 -2
  239. package/dist/index.js +1 -2
  240. package/dist/lane-home-probe.d.ts +112 -0
  241. package/dist/lane-home-probe.js +101 -0
  242. package/dist/leader/endpoint.d.ts +4 -1
  243. package/dist/leader/endpoint.js +11 -10
  244. package/dist/limit-refusal.d.ts +59 -0
  245. package/dist/limit-refusal.js +15 -0
  246. package/dist/main.js +1 -1
  247. package/dist/mcp-assertion-header.d.ts +32 -19
  248. package/dist/mcp-assertion-header.js +10 -9
  249. package/dist/mcp-tool-faces.d.ts +5 -0
  250. package/dist/mcp-tool-faces.js +6 -4
  251. package/dist/memory-project-layer.d.ts +37 -0
  252. package/dist/memory-project-layer.js +46 -0
  253. package/dist/memory-scope.d.ts +24 -17
  254. package/dist/memory-scope.js +24 -8
  255. package/dist/memory-sync-client.d.ts +27 -13
  256. package/dist/memory-sync-client.js +107 -18
  257. package/dist/model-entry-refusal.d.ts +9 -1
  258. package/dist/model-entry-refusal.js +6 -1
  259. package/dist/model-plane-face.d.ts +51 -0
  260. package/dist/model-plane-face.js +24 -0
  261. package/dist/model-provider.d.ts +44 -12
  262. package/dist/model-provider.js +21 -2
  263. package/dist/model-route-endpoint.d.ts +9 -12
  264. package/dist/model-route-endpoint.js +8 -11
  265. package/dist/model-route-env.d.ts +22 -0
  266. package/dist/model-route-env.js +2 -0
  267. package/dist/model-route-gap.d.ts +60 -30
  268. package/dist/model-route-gap.js +21 -15
  269. package/dist/observability/corrupt-read-seat.d.ts +7 -0
  270. package/dist/observability/corrupt-read-seat.js +9 -0
  271. package/dist/observability/cost-taxonomy.d.ts +7 -7
  272. package/dist/observability/err-text.d.ts +6 -0
  273. package/dist/observability/err-text.js +18 -4
  274. package/dist/observability/fail-open.d.ts +76 -14
  275. package/dist/observability/fail-open.js +76 -14
  276. package/dist/observability/metrics.js +4 -1
  277. package/dist/observability/prompt-manifest.d.ts +33 -82
  278. package/dist/observability/prompt-manifest.js +122 -17
  279. package/dist/observability/run-terminal.js +14 -6
  280. package/dist/observability/secret-env-scrub.d.ts +13 -1
  281. package/dist/observability/secret-env-scrub.js +13 -1
  282. package/dist/observability/tool-trace.d.ts +16 -21
  283. package/dist/observability/tool-trace.js +58 -49
  284. package/dist/operator-ask.d.ts +10 -0
  285. package/dist/operator-ask.js +3 -0
  286. package/dist/orchestration/workflow-agent-session-index.d.ts +12 -12
  287. package/dist/orchestration/workflow-agent-session-index.js +9 -13
  288. package/dist/orchestration/workflow-completion-inbox.d.ts +42 -15
  289. package/dist/orchestration/workflow-completion-inbox.js +13 -0
  290. package/dist/orchestration/workflow-notify-journal.d.ts +13 -32
  291. package/dist/orchestration/workflow-notify-journal.js +27 -34
  292. package/dist/orchestration/workflow-park-decision.d.ts +89 -0
  293. package/dist/orchestration/workflow-park-decision.js +118 -0
  294. package/dist/org-delivery-gate.d.ts +81 -0
  295. package/dist/org-delivery-gate.js +59 -0
  296. package/dist/panel-tool-names.d.ts +23 -0
  297. package/dist/panel-tool-names.js +8 -0
  298. package/dist/parked-decide.d.ts +39 -6
  299. package/dist/parked-decide.js +98 -51
  300. package/dist/parked-revive-surface.d.ts +9 -2
  301. package/dist/parked-revive-surface.js +11 -8
  302. package/dist/per-task-image.d.ts +7 -1
  303. package/dist/per-task-image.js +3 -3
  304. package/dist/permission-rule-list.d.ts +1 -1
  305. package/dist/permission-rule-list.js +2 -2
  306. package/dist/plain-string-record.d.ts +25 -0
  307. package/dist/plain-string-record.js +32 -0
  308. package/dist/plugins/approval-ask-store-file.d.ts +16 -1
  309. package/dist/plugins/approval-ask-store-file.js +21 -0
  310. package/dist/plugins/approval-ask-store-memory.d.ts +18 -1
  311. package/dist/plugins/approval-ask-store-memory.js +34 -2
  312. package/dist/plugins/approval-ask-store-sql.d.ts +25 -0
  313. package/dist/plugins/approval-ask-store-sql.js +37 -1
  314. package/dist/plugins/blob-backend.d.ts +83 -15
  315. package/dist/plugins/blob-backend.js +68 -15
  316. package/dist/plugins/breaker-state-sql.d.ts +2 -2
  317. package/dist/plugins/breaker-state-sql.js +4 -4
  318. package/dist/plugins/caching-session-store.d.ts +3 -0
  319. package/dist/plugins/caching-session-store.js +3 -0
  320. package/dist/plugins/checkpoint-store-sql.d.ts +28 -4
  321. package/dist/plugins/checkpoint-store-sql.js +59 -28
  322. package/dist/plugins/file-history-store-sql.d.ts +5 -2
  323. package/dist/plugins/file-history-store-sql.js +3 -1
  324. package/dist/plugins/file-run-store.d.ts +5 -13
  325. package/dist/plugins/file-run-store.js +9 -0
  326. package/dist/plugins/fork-routing-session-store.d.ts +9 -1
  327. package/dist/plugins/fork-routing-session-store.js +12 -1
  328. package/dist/plugins/host-platform.d.ts +2 -0
  329. package/dist/plugins/host-platform.js +2 -1
  330. package/dist/plugins/k8s-bg-scripts.d.ts +11 -0
  331. package/dist/plugins/k8s-bg-scripts.js +22 -0
  332. package/dist/plugins/local-checkpoint-store.d.ts +2 -0
  333. package/dist/plugins/local-checkpoint-store.js +11 -3
  334. package/dist/plugins/local-session-store.d.ts +1 -1
  335. package/dist/plugins/local-session-store.js +1 -1
  336. package/dist/plugins/local-session-window.d.ts +39 -0
  337. package/dist/plugins/local-session-window.js +54 -0
  338. package/dist/plugins/mailbox-recipient-lifecycle.d.ts +3 -2
  339. package/dist/plugins/mailbox-store-sql.d.ts +30 -48
  340. package/dist/plugins/mailbox-store-sql.js +77 -52
  341. package/dist/plugins/memory-embedder-fingerprint.js +2 -1
  342. package/dist/plugins/memory-run-store.d.ts +5 -13
  343. package/dist/plugins/memory-run-store.js +8 -0
  344. package/dist/plugins/one-time-migrations.d.ts +245 -93
  345. package/dist/plugins/one-time-migrations.js +668 -207
  346. package/dist/plugins/org-delivery-quota-store.d.ts +123 -0
  347. package/dist/plugins/org-delivery-quota-store.js +228 -0
  348. package/dist/plugins/permission-rule-store-sql.d.ts +13 -7
  349. package/dist/plugins/permission-rule-store-sql.js +4 -18
  350. package/dist/plugins/pg-pool.js +39 -7
  351. package/dist/plugins/pg-session-storage.d.ts +20 -8
  352. package/dist/plugins/pg-session-storage.js +34 -21
  353. package/dist/plugins/remote-env-adb.d.ts +12 -12
  354. package/dist/plugins/remote-env-adb.js +21 -6
  355. package/dist/plugins/remote-env-device.js +3 -0
  356. package/dist/plugins/remote-env-e2b.d.ts +1 -1
  357. package/dist/plugins/remote-env-e2b.js +21 -9
  358. package/dist/plugins/remote-env-host.d.ts +9 -9
  359. package/dist/plugins/remote-env-host.js +10 -32
  360. package/dist/plugins/remote-env-k8s.d.ts +103 -38
  361. package/dist/plugins/remote-env-k8s.js +288 -95
  362. package/dist/plugins/remote-env-local-docker.d.ts +27 -13
  363. package/dist/plugins/remote-env-local-docker.js +82 -11
  364. package/dist/plugins/remote-env-ssh.d.ts +21 -12
  365. package/dist/plugins/remote-env-ssh.js +117 -5
  366. package/dist/plugins/remote-shell.d.ts +0 -1
  367. package/dist/plugins/remote-shell.js +1 -2
  368. package/dist/plugins/retention-store-sql.js +6 -2
  369. package/dist/plugins/run-store-sql.d.ts +16 -14
  370. package/dist/plugins/run-store-sql.js +22 -2
  371. package/dist/plugins/schema-consistency.d.ts +54 -0
  372. package/dist/plugins/schema-consistency.js +52 -0
  373. package/dist/plugins/schema-indexes.js +2 -0
  374. package/dist/plugins/send-user-file.js +2 -2
  375. package/dist/plugins/session-epoch-anchor.d.ts +39 -0
  376. package/dist/plugins/session-epoch-anchor.js +22 -0
  377. package/dist/plugins/session-store.d.ts +18 -8
  378. package/dist/plugins/session-store.js +15 -4
  379. package/dist/plugins/shared-memory-store-sql.d.ts +9 -3
  380. package/dist/plugins/shared-memory-store-sql.js +5 -16
  381. package/dist/plugins/sql-driver.d.ts +205 -1
  382. package/dist/plugins/sql-driver.js +325 -13
  383. package/dist/plugins/sql-errors.d.ts +64 -0
  384. package/dist/plugins/sql-errors.js +57 -0
  385. package/dist/plugins/store-backend.d.ts +36 -1
  386. package/dist/plugins/store-backend.js +42 -15
  387. package/dist/plugins/store-contracts.d.ts +42 -0
  388. package/dist/plugins/store-contracts.js +1 -0
  389. package/dist/plugins/tidb-pool.d.ts +6 -1
  390. package/dist/plugins/tidb-pool.js +44 -10
  391. package/dist/plugins/tidb-session-storage.d.ts +8 -11
  392. package/dist/plugins/tidb-session-storage.js +6 -16
  393. package/dist/plugins/tidb-session-store.d.ts +24 -4
  394. package/dist/plugins/tidb-session-store.js +29 -5
  395. package/dist/plugins/workflow-journal-store-sql.d.ts +73 -19
  396. package/dist/plugins/workflow-journal-store-sql.js +19 -6
  397. package/dist/plugins/workflow-run-store-sql.d.ts +30 -8
  398. package/dist/plugins/workflow-run-store-sql.js +50 -9
  399. package/dist/posture-source.d.ts +18 -10
  400. package/dist/posture-source.js +4 -1
  401. package/dist/project-identity.d.ts +45 -6
  402. package/dist/project-identity.js +162 -8
  403. package/dist/project-layer-key.d.ts +28 -0
  404. package/dist/project-layer-key.js +29 -0
  405. package/dist/prompts-domain-validate.d.ts +17 -61
  406. package/dist/prompts-domain-validate.js +9 -119
  407. package/dist/question.js +3 -2
  408. package/dist/read-deny-entry.d.ts +25 -0
  409. package/dist/read-deny-entry.js +12 -0
  410. package/dist/read-face-posture.d.ts +37 -11
  411. package/dist/read-face-posture.js +32 -3
  412. package/dist/request-key-closure.d.ts +9 -2
  413. package/dist/request-key-closure.js +11 -5
  414. package/dist/request-value-closure.d.ts +5 -0
  415. package/dist/request-value-closure.js +11 -3
  416. package/dist/rule-entry-list.d.ts +38 -11
  417. package/dist/rule-entry-list.js +106 -30
  418. package/dist/rules-consent.js +3 -4
  419. package/dist/run-acceptance.d.ts +19 -3
  420. package/dist/run-acceptance.js +13 -1
  421. package/dist/run-local.js +54 -24
  422. package/dist/runs.d.ts +15 -8
  423. package/dist/runs.js +35 -1
  424. package/dist/runtime-caps-resolver.d.ts +16 -6
  425. package/dist/runtime-caps-resolver.js +18 -5
  426. package/dist/sandbox-pkg-source.d.ts +19 -1
  427. package/dist/sandbox-pkg-source.js +29 -7
  428. package/dist/security.d.ts +87 -9
  429. package/dist/security.js +52 -9
  430. package/dist/server-secret-env.d.ts +44 -18
  431. package/dist/server-secret-env.js +49 -8
  432. package/dist/session-error-wire.d.ts +19 -2
  433. package/dist/session-error-wire.js +5 -1
  434. package/dist/session-incarnation.d.ts +15 -5
  435. package/dist/session-incarnation.js +16 -9
  436. package/dist/session-titled-frame.d.ts +33 -0
  437. package/dist/session-titled-frame.js +4 -0
  438. package/dist/session-titler.d.ts +9 -1
  439. package/dist/session-titler.js +27 -6
  440. package/dist/spec-fields.d.ts +28 -16
  441. package/dist/spec-fields.js +66 -54
  442. package/dist/sql-engine-posture.d.ts +31 -4
  443. package/dist/sql-engine-posture.js +36 -1
  444. package/dist/stored-request-tool-axes-m19.d.ts +19 -4
  445. package/dist/stored-request-tool-axes-m19.js +30 -2
  446. package/dist/task-a2a.d.ts +9 -1
  447. package/dist/task-a2a.js +73 -47
  448. package/dist/task-cwd.d.ts +1 -1
  449. package/dist/task-mcp.d.ts +46 -58
  450. package/dist/task-mcp.js +82 -107
  451. package/dist/task-settings.d.ts +95 -108
  452. package/dist/task-settings.js +77 -98
  453. package/dist/text-bidi.d.ts +1 -48
  454. package/dist/text-bidi.js +3 -5
  455. package/dist/tighten-only-seats.d.ts +150 -0
  456. package/dist/tighten-only-seats.js +196 -0
  457. package/dist/tool-approval.d.ts +304 -88
  458. package/dist/tool-approval.js +623 -239
  459. package/dist/trace/core-keyset-guard.d.ts +122 -20
  460. package/dist/trace/engine-notice-wire.d.ts +11 -3
  461. package/dist/trace/engine-notice-wire.js +8 -1
  462. package/dist/trace/exit-seat.d.ts +28 -0
  463. package/dist/trace/exit-seat.js +76 -0
  464. package/dist/trace/ledger-events.d.ts +6 -3
  465. package/dist/trace/ledger-sink.js +4 -1
  466. package/dist/trace/model-segment.js +1 -1
  467. package/dist/trace/project.d.ts +98 -17
  468. package/dist/trace/project.js +98 -50
  469. package/dist/trace/projection-table.d.ts +100 -0
  470. package/dist/trace/projection-table.js +130 -0
  471. package/dist/trace/redact.d.ts +54 -0
  472. package/dist/trace/redact.js +778 -152
  473. package/dist/trace/self-minted-wire.d.ts +345 -1
  474. package/dist/trace/self-minted-wire.js +117 -1
  475. package/dist/trace/wire-projection-faces.d.ts +377 -3
  476. package/dist/trace/wire-projection-faces.js +164 -1
  477. package/dist/url-refusal.js +2 -0
  478. package/dist/web-admin-client/apply-effective.d.ts +12 -0
  479. package/dist/web-admin-client/apply-effective.js +56 -5
  480. package/dist/web-admin-client/candidate-gate.d.ts +6 -6
  481. package/dist/web-admin-client/candidate-gate.js +3 -3
  482. package/dist/web-admin-client/facade.d.ts +1 -1
  483. package/dist/web-admin-client/facade.js +1 -1
  484. package/dist/web-admin-client/http-client.js +0 -6
  485. package/dist/web-admin-client/read-face.js +5 -9
  486. package/dist/web-admin-client/read-warnings.d.ts +13 -0
  487. package/dist/web-admin-client/read-warnings.js +10 -0
  488. package/dist/web-admin-client/skills-mcp.d.ts +3 -0
  489. package/dist/web-admin-client/skills-mcp.js +11 -9
  490. package/dist/web-admin-client/types.d.ts +2 -3
  491. package/dist/workspace-cache.d.ts +35 -0
  492. package/dist/workspace-cache.js +36 -0
  493. package/dist/workspace-space.d.ts +3 -2
  494. package/dist/workspace-space.js +2 -0
  495. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +65 -10
  496. package/package.json +8 -4
  497. package/scripts/drain-check-local.mjs +34 -1
  498. package/scripts/drain-check.mysql.sql +30 -2
  499. package/scripts/drain-check.pg.sql +29 -2
  500. package/dist/capabilities/memory-notice.d.ts +0 -138
  501. package/dist/capabilities/memory-notice.js +0 -64
  502. package/dist/capabilities/prompt.d.ts +0 -17
  503. package/dist/capabilities/prompt.js +0 -6
  504. package/dist/mcp-content-origin.d.ts +0 -34
  505. package/dist/mcp-content-origin.js +0 -10
  506. package/dist/tool-axis-words.d.ts +0 -27
  507. package/dist/tool-axis-words.js +0 -9
  508. package/dist/wire-name-bound.d.ts +0 -14
  509. package/dist/wire-name-bound.js +0 -13
@@ -10,6 +10,11 @@
10
10
  * 没有任何机器能替人决定一个键该不该上 wire,所以这一栏必须是人写的。它的正确性由门反向钉住
11
11
  * (登记的词必须仍是 core 的键;core 退役一个键而这里留着残条目 ⇒ 红)。
12
12
  * · `minted` —— 本仓**自铸**、core 没有的 wire 键。同样是处置,同样被反向钉住(铸键不许与 core 键重名)。
13
+ * · `keys` —— 只有一类面才有:投影器**就是这份声明的解释器**的面(今天 = 清单行 `promptManifestRecordOf` 的各层)。声明是键集本身
14
+ * (键 → 值形 + 是否可选 + 嵌套层的面名),不是对 core 键集的第二份抄本:解释器按它读,所以它与 core 型的分岔会在键等式门(与 `keys`
15
+ * 对 core `.d.ts` 的对账格)和 `core-keyset-guard.ts` ⑦b 的编译期钉上红。要它的理由是**机器清单**:`scripts/wire-changes-server.mjs`
16
+ * 只读本文件的纯数据,看不见 `coreType` 在安装态 core 里展开成哪些键 —— 声明在表里,生成器对同一张表、同一只比较器就能逐键比
17
+ * (删 / 改形 ⇒ breaking,新增 ⇒ additive)。
13
18
  *
14
19
  * ## 为什么在 `src/` 而不在 `test/`
15
20
  * 与 `core-keyset-guard.ts` 同一条理由:它的**执行点之一是 `tsc --noEmit`** —— 那个文件的 ① 面把
@@ -17,7 +22,8 @@
17
22
  * 旧形是两个:守卫文件一簿、`test/wire-whitelist-exhaustiveness.test.ts` 的 `KnownExcluded` 一簿,那份门注
18
23
  * 自己写着「两处必须同时改」—— 而「必须同时改」正是 [ref] 要下线的东西(对账门不算替代,单写者才算)。
19
24
  * 本表是纯数据、无行为(唯一的派生是 `wiring_manifest_operator` 行的两只取值器:`excluded` = 租户行减具名常量,S-724;`minted` = 租户行,S-961),
20
- * 被守卫文件以 `typeof import(...)` 的**类型查询**读取(编译期擦除,零运行期边)。
25
+ * 被守卫文件以 `typeof import(...)` 的**类型查询**读取(编译期擦除,零运行期边);唯一的运行期读者是清单行的解释器
26
+ * (`observability/prompt-manifest.ts`,读 `keys` 声明)与机器清单生成器(转译本文件、求值、只读数据)—— 两者都不改表。
21
27
  *
22
28
  * ## 门在哪里
23
29
  * `test/wire-whitelist-exhaustiveness.test.ts`:对每一行喂一枚 core 型全键 fixture,真的跑一遍构造器,
@@ -44,7 +50,47 @@ export interface WireProjectionFace {
44
50
  * **没有**的嵌套成员」,而全键 fixture 是照 core 型生成的,结构上永远触发不了它。
45
51
  */
46
52
  readonly mintedConditional?: readonly string[];
53
+ /**
54
+ * 本面的键集**声明**(键 → 值形 + 是否可选)。只有投影器是这份声明的解释器的面才登记,今天 = `promptManifestRecordOf` 登记的清单行各层
55
+ * (一层一行,层与层靠 {@link ManifestShape} 的 `object.face` 引用)。声明与该行的 `coreType` 在键名与可选性上必须一致(对账格:
56
+ * `test/wire-whitelist-exhaustiveness.test.ts`;编译期:`core-keyset-guard.ts` ⑦b)。值形(text / count / flag …)错了,真帧上读不出,
57
+ * 键等式门按漏投报红。其余面(键集由 `coreType` 在安装态 core 里展开)不登记本栏。
58
+ */
59
+ readonly keys?: Readonly<Record<string, DeclaredKey>>;
47
60
  }
61
+ /**
62
+ * 清单行一个键的值形(纯数据;解释器对这个闭集做穷尽 `switch`,不认得的词是编译红)。**词表的属主是引擎**:`text` 是开集串 —— 本仓不判词、
63
+ * 新词原样过境;`true` 是唯一的闭一词(在场即真,从不铸 `false`)。
64
+ * · `object` —— 一句话:嵌套对象,键声明在名为 `face` 的那一行里;每一格都读得出才算读得出(半句话不上行);
65
+ * · `list` —— 列表,每个元素都读得出才算读得出;
66
+ * · `rows` —— 一行一判的列表:读不出的那一行丢并计一次,空列表是一句正面陈述原样上行,「本来有行、一行都读不出」才缺席;
67
+ * · `entries` —— 以名为键的表,每个条目的值都读得出才算读得出。
68
+ */
69
+ export type ManifestShape = {
70
+ readonly is: "text";
71
+ } | {
72
+ readonly is: "count";
73
+ } | {
74
+ readonly is: "flag";
75
+ } | {
76
+ readonly is: "true";
77
+ } | {
78
+ readonly is: "object";
79
+ readonly face: string;
80
+ } | {
81
+ readonly is: "list";
82
+ readonly of: ManifestShape;
83
+ } | {
84
+ readonly is: "rows";
85
+ readonly of: ManifestShape;
86
+ } | {
87
+ readonly is: "entries";
88
+ readonly of: ManifestShape;
89
+ };
90
+ /** 一个键的声明:值形 + 是否可选(`optional: true` = 缺席是合法的一句话;不写 = 必选,缺席即这一层读不出)。 */
91
+ export type DeclaredKey = ManifestShape & {
92
+ readonly optional?: true;
93
+ };
48
94
  /**
49
95
  * `TaskEvent` **信封**上的键 —— 这一族构造器一个都不管,所以在每一只 TaskEvent 面上统一扣除。
50
96
  * · `type`:臂名由调用点自己拼在投影体外(`{ type: "tool_end", ...toolEndEventData(ev) }`),不是载荷键;
@@ -54,7 +100,7 @@ export interface WireProjectionFace {
54
100
  */
55
101
  export declare const FRAME_ENVELOPE_KEYS: readonly ["type", "sourceTaskId", "bgAgentId"];
56
102
  /** 探针文件要从 `@sema-agent/core` 具名导入的类型(`coreType` 表达式里用到的全部名字)。 */
57
- export declare const WIRE_PROJECTION_CORE_IMPORTS: readonly ["TaskEvent", "TaskNotificationPayload", "WiringManifest", "EngineNotice", "MemoryImportReport", "OriginClearanceRow", "OriginClearanceEvent", "MemoryEntryOrigin"];
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"];
58
104
  /**
59
105
  * `wiring_manifest` 的 **operator 面多投的那几段**(`wiringManifestOperatorEventData` 在租户形之上加的段)。
60
106
  * operator 行的 `excluded` = 租户行减本常量(派生);四段各自的受众裁定在 `core-keyset-guard.ts` ⑥b。
@@ -158,6 +204,12 @@ export declare const WIRE_PROJECTION_FACES: {
158
204
  readonly excluded: readonly [];
159
205
  readonly minted: readonly [];
160
206
  };
207
+ readonly compaction_started: {
208
+ readonly projector: "compactionStartedEventData";
209
+ readonly coreType: string;
210
+ readonly excluded: readonly [];
211
+ readonly minted: readonly [];
212
+ };
161
213
  readonly human_input: {
162
214
  readonly projector: "humanInputEventData";
163
215
  readonly coreType: string;
@@ -174,7 +226,7 @@ export declare const WIRE_PROJECTION_FACES: {
174
226
  readonly wiring_manifest_tenant: {
175
227
  readonly projector: "wiringManifestEventData";
176
228
  readonly coreType: `WiringManifest & ${string}`;
177
- readonly excluded: readonly ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence", "permissionMode"];
229
+ readonly excluded: readonly ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence"];
178
230
  readonly unwrapped: readonly ["manifest"];
179
231
  readonly minted: readonly ["instructions"];
180
232
  };
@@ -216,6 +268,328 @@ export declare const WIRE_PROJECTION_FACES: {
216
268
  readonly excluded: readonly [];
217
269
  readonly minted: readonly [];
218
270
  };
271
+ readonly prompt_manifest: {
272
+ readonly projector: "promptManifestRecordOf";
273
+ readonly coreType: "Extract<TraceEvent, { kind: \"prompt.assembled\" }>";
274
+ readonly excluded: readonly ["kind", "version", "taskId", "snapshot", "lowering", "ts"];
275
+ readonly minted: readonly [];
276
+ readonly keys: {
277
+ readonly identity: {
278
+ readonly is: "object";
279
+ readonly face: "prompt_manifest_identity";
280
+ readonly optional: true;
281
+ };
282
+ readonly selectors: {
283
+ readonly is: "object";
284
+ readonly face: "prompt_manifest_selectors";
285
+ readonly optional: true;
286
+ };
287
+ readonly blocks: {
288
+ readonly is: "rows";
289
+ readonly of: {
290
+ readonly is: "object";
291
+ readonly face: "prompt_manifest_block";
292
+ };
293
+ readonly optional: true;
294
+ };
295
+ readonly sections: {
296
+ readonly is: "rows";
297
+ readonly of: {
298
+ readonly is: "object";
299
+ readonly face: "prompt_manifest_section";
300
+ };
301
+ readonly optional: true;
302
+ };
303
+ readonly superseded: {
304
+ readonly is: "rows";
305
+ readonly of: {
306
+ readonly is: "object";
307
+ readonly face: "prompt_manifest_superseded";
308
+ };
309
+ readonly optional: true;
310
+ };
311
+ readonly tools: {
312
+ readonly is: "rows";
313
+ readonly of: {
314
+ readonly is: "object";
315
+ readonly face: "prompt_manifest_tool";
316
+ };
317
+ readonly optional: true;
318
+ };
319
+ readonly toolDisclosure: {
320
+ readonly is: "object";
321
+ readonly face: "prompt_manifest_tool_disclosure";
322
+ readonly optional: true;
323
+ };
324
+ readonly totalChars: {
325
+ readonly is: "count";
326
+ readonly optional: true;
327
+ };
328
+ };
329
+ };
330
+ readonly prompt_manifest_identity: {
331
+ readonly projector: "promptManifestRecordOf";
332
+ readonly coreType: "PromptManifestIdentity";
333
+ readonly excluded: readonly [];
334
+ readonly minted: readonly [];
335
+ readonly keys: {
336
+ readonly artifact: {
337
+ readonly is: "text";
338
+ };
339
+ readonly layers: {
340
+ readonly is: "object";
341
+ readonly face: "prompt_manifest_identity_layers";
342
+ };
343
+ readonly epoch: {
344
+ readonly is: "count";
345
+ };
346
+ readonly activatedBy: {
347
+ readonly is: "text";
348
+ };
349
+ };
350
+ };
351
+ readonly prompt_manifest_identity_layers: {
352
+ readonly projector: "promptManifestRecordOf";
353
+ readonly coreType: "PromptIdentityLayers";
354
+ readonly excluded: readonly [];
355
+ readonly minted: readonly [];
356
+ readonly keys: {
357
+ readonly catalog: {
358
+ readonly is: "text";
359
+ };
360
+ readonly renderers: {
361
+ readonly is: "entries";
362
+ readonly of: {
363
+ readonly is: "count";
364
+ };
365
+ };
366
+ readonly center: {
367
+ readonly is: "text";
368
+ readonly optional: true;
369
+ };
370
+ readonly deploy: {
371
+ readonly is: "text";
372
+ readonly optional: true;
373
+ };
374
+ readonly task: {
375
+ readonly is: "text";
376
+ readonly optional: true;
377
+ };
378
+ readonly binding: {
379
+ readonly is: "text";
380
+ };
381
+ };
382
+ };
383
+ readonly prompt_manifest_selectors: {
384
+ readonly projector: "promptManifestRecordOf";
385
+ readonly coreType: "PromptManifestSelectors";
386
+ readonly excluded: readonly [];
387
+ readonly minted: readonly [];
388
+ readonly keys: {
389
+ readonly binding: {
390
+ readonly is: "text";
391
+ readonly optional: true;
392
+ };
393
+ readonly traits: {
394
+ readonly is: "list";
395
+ readonly of: {
396
+ readonly is: "text";
397
+ };
398
+ };
399
+ readonly host: {
400
+ readonly is: "object";
401
+ readonly face: "prompt_manifest_selectors_host";
402
+ };
403
+ readonly facts: {
404
+ readonly is: "entries";
405
+ readonly of: {
406
+ readonly is: "flag";
407
+ };
408
+ };
409
+ };
410
+ };
411
+ readonly prompt_manifest_selectors_host: {
412
+ readonly projector: "promptManifestRecordOf";
413
+ readonly coreType: "PromptManifestSelectors[\"host\"]";
414
+ readonly excluded: readonly [];
415
+ readonly minted: readonly [];
416
+ readonly keys: {
417
+ readonly role: {
418
+ readonly is: "text";
419
+ };
420
+ readonly form: {
421
+ readonly is: "text";
422
+ };
423
+ };
424
+ };
425
+ readonly prompt_manifest_block: {
426
+ readonly projector: "promptManifestRecordOf";
427
+ readonly coreType: "Extract<TraceEvent, { kind: \"prompt.assembled\" }>[\"blocks\"][number]";
428
+ readonly excluded: readonly [];
429
+ readonly minted: readonly [];
430
+ readonly keys: {
431
+ readonly id: {
432
+ readonly is: "text";
433
+ };
434
+ readonly chars: {
435
+ readonly is: "count";
436
+ };
437
+ readonly hash: {
438
+ readonly is: "text";
439
+ };
440
+ };
441
+ };
442
+ readonly prompt_manifest_section: {
443
+ readonly projector: "promptManifestRecordOf";
444
+ readonly coreType: "PromptManifestSection";
445
+ readonly excluded: readonly [];
446
+ readonly minted: readonly [];
447
+ readonly keys: {
448
+ readonly id: {
449
+ readonly is: "text";
450
+ };
451
+ readonly band: {
452
+ readonly is: "text";
453
+ };
454
+ readonly rank: {
455
+ readonly is: "count";
456
+ };
457
+ readonly variant: {
458
+ readonly is: "text";
459
+ readonly optional: true;
460
+ };
461
+ readonly renderer: {
462
+ readonly is: "object";
463
+ readonly face: "prompt_manifest_section_renderer";
464
+ readonly optional: true;
465
+ };
466
+ readonly chars: {
467
+ readonly is: "count";
468
+ };
469
+ readonly locale: {
470
+ readonly is: "text";
471
+ };
472
+ readonly contentHash: {
473
+ readonly is: "text";
474
+ };
475
+ readonly chain: {
476
+ readonly is: "list";
477
+ readonly of: {
478
+ readonly is: "object";
479
+ readonly face: "prompt_manifest_chain_link";
480
+ };
481
+ };
482
+ };
483
+ };
484
+ readonly prompt_manifest_section_renderer: {
485
+ readonly projector: "promptManifestRecordOf";
486
+ readonly coreType: "NonNullable<PromptManifestSection[\"renderer\"]>";
487
+ readonly excluded: readonly [];
488
+ readonly minted: readonly [];
489
+ readonly keys: {
490
+ readonly id: {
491
+ readonly is: "text";
492
+ };
493
+ readonly version: {
494
+ readonly is: "count";
495
+ };
496
+ };
497
+ };
498
+ readonly prompt_manifest_chain_link: {
499
+ readonly projector: "promptManifestRecordOf";
500
+ readonly coreType: "PromptChainLink";
501
+ readonly excluded: readonly [];
502
+ readonly minted: readonly [];
503
+ readonly keys: {
504
+ readonly source: {
505
+ readonly is: "text";
506
+ };
507
+ readonly overlay: {
508
+ readonly is: "text";
509
+ readonly optional: true;
510
+ };
511
+ readonly op: {
512
+ readonly is: "text";
513
+ readonly optional: true;
514
+ };
515
+ readonly superseded: {
516
+ readonly is: "true";
517
+ readonly optional: true;
518
+ };
519
+ };
520
+ };
521
+ readonly prompt_manifest_superseded: {
522
+ readonly projector: "promptManifestRecordOf";
523
+ readonly coreType: "SupersededOverlay";
524
+ readonly excluded: readonly [];
525
+ readonly minted: readonly [];
526
+ readonly keys: {
527
+ readonly id: {
528
+ readonly is: "text";
529
+ };
530
+ readonly source: {
531
+ readonly is: "text";
532
+ };
533
+ readonly by: {
534
+ readonly is: "text";
535
+ };
536
+ readonly target: {
537
+ readonly is: "text";
538
+ };
539
+ readonly supersededBy: {
540
+ readonly is: "text";
541
+ };
542
+ };
543
+ };
544
+ readonly prompt_manifest_tool: {
545
+ readonly projector: "promptManifestRecordOf";
546
+ readonly coreType: "NonNullable<Extract<TraceEvent, { kind: \"prompt.assembled\" }>[\"tools\"]>[number]";
547
+ readonly excluded: readonly [];
548
+ readonly minted: readonly [];
549
+ readonly keys: {
550
+ readonly wireName: {
551
+ readonly is: "text";
552
+ };
553
+ readonly aliases: {
554
+ readonly is: "list";
555
+ readonly of: {
556
+ readonly is: "text";
557
+ };
558
+ };
559
+ readonly contractId: {
560
+ readonly is: "text";
561
+ };
562
+ readonly implementationRevision: {
563
+ readonly is: "text";
564
+ };
565
+ readonly cardId: {
566
+ readonly is: "text";
567
+ };
568
+ readonly shapeDigest: {
569
+ readonly is: "text";
570
+ };
571
+ readonly wireSchemaDigest: {
572
+ readonly is: "text";
573
+ };
574
+ };
575
+ };
576
+ readonly prompt_manifest_tool_disclosure: {
577
+ readonly projector: "promptManifestRecordOf";
578
+ readonly coreType: "ToolDisclosureManifest";
579
+ readonly excluded: readonly [];
580
+ readonly minted: readonly [];
581
+ readonly keys: {
582
+ readonly deferredTools: {
583
+ readonly is: "count";
584
+ };
585
+ readonly strategy: {
586
+ readonly is: "text";
587
+ };
588
+ readonly source: {
589
+ readonly is: "text";
590
+ };
591
+ };
592
+ };
219
593
  };
220
594
  /** 面名。 */
221
595
  export type WireProjectionFaceName = keyof typeof WIRE_PROJECTION_FACES;
@@ -8,8 +8,17 @@ export const WIRE_PROJECTION_CORE_IMPORTS = [
8
8
  "OriginClearanceRow",
9
9
  "OriginClearanceEvent",
10
10
  "MemoryEntryOrigin",
11
+ "TraceEvent",
12
+ "PromptManifestIdentity",
13
+ "PromptIdentityLayers",
14
+ "PromptManifestSelectors",
15
+ "PromptManifestSection",
16
+ "PromptChainLink",
17
+ "SupersededOverlay",
18
+ "ToolDisclosureManifest",
11
19
  ];
12
20
  const arm = (name) => `Extract<TaskEvent, { type: "${name}" }>`;
21
+ const MANIFEST_FRAME = `Extract<TraceEvent, { kind: "prompt.assembled" }>`;
13
22
  export const WIRING_MANIFEST_OPERATOR_ONLY_SECTIONS = ["governance", "configFingerprint", "autoConsolidation", "readDeny"];
14
23
  function withoutSections(all, drop) {
15
24
  return all.filter((k) => !drop.includes(k));
@@ -30,6 +39,7 @@ export const WIRE_PROJECTION_FACES = {
30
39
  context_usage: { projector: "contextUsageEventData", coreType: arm("context_usage"), excluded: [], minted: [] },
31
40
  turn_end: { projector: "turnEndEventData", coreType: arm("turn_end"), excluded: [], minted: [] },
32
41
  compaction_outcome: { projector: "compactionOutcomeEventData", coreType: arm("compaction_outcome"), excluded: [], minted: [] },
42
+ compaction_started: { projector: "compactionStartedEventData", coreType: arm("compaction_started"), excluded: [], minted: [] },
33
43
  human_input: { projector: "humanInputEventData", coreType: arm("human_input"), excluded: ["principal"], minted: [] },
34
44
  task_notification: {
35
45
  projector: "taskNotificationEventData",
@@ -41,7 +51,7 @@ export const WIRE_PROJECTION_FACES = {
41
51
  wiring_manifest_tenant: {
42
52
  projector: "wiringManifestEventData",
43
53
  coreType: `WiringManifest & ${arm("wiring_manifest")}`,
44
- excluded: ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence", "permissionMode"],
54
+ excluded: ["governance", "configFingerprint", "autoConsolidation", "readDeny", "peerPresence"],
45
55
  unwrapped: ["manifest"],
46
56
  minted: ["instructions"],
47
57
  },
@@ -67,5 +77,158 @@ export const WIRE_PROJECTION_FACES = {
67
77
  },
68
78
  origin_clearance_origin: { projector: "buildClearanceRowWire", coreType: "MemoryEntryOrigin", excluded: [], minted: [] },
69
79
  origin_clearance_event: { projector: "buildClearanceRowWire", coreType: "OriginClearanceEvent", excluded: [], minted: [] },
80
+ prompt_manifest: {
81
+ projector: "promptManifestRecordOf",
82
+ coreType: MANIFEST_FRAME,
83
+ excluded: ["kind", "version", "taskId", "snapshot", "lowering", "ts"],
84
+ minted: [],
85
+ keys: {
86
+ identity: { is: "object", face: "prompt_manifest_identity", optional: true },
87
+ selectors: { is: "object", face: "prompt_manifest_selectors", optional: true },
88
+ blocks: { is: "rows", of: { is: "object", face: "prompt_manifest_block" }, optional: true },
89
+ sections: { is: "rows", of: { is: "object", face: "prompt_manifest_section" }, optional: true },
90
+ superseded: { is: "rows", of: { is: "object", face: "prompt_manifest_superseded" }, optional: true },
91
+ tools: { is: "rows", of: { is: "object", face: "prompt_manifest_tool" }, optional: true },
92
+ toolDisclosure: { is: "object", face: "prompt_manifest_tool_disclosure", optional: true },
93
+ totalChars: { is: "count", optional: true },
94
+ },
95
+ },
96
+ prompt_manifest_identity: {
97
+ projector: "promptManifestRecordOf",
98
+ coreType: "PromptManifestIdentity",
99
+ excluded: [],
100
+ minted: [],
101
+ keys: {
102
+ artifact: { is: "text" },
103
+ layers: { is: "object", face: "prompt_manifest_identity_layers" },
104
+ epoch: { is: "count" },
105
+ activatedBy: { is: "text" },
106
+ },
107
+ },
108
+ prompt_manifest_identity_layers: {
109
+ projector: "promptManifestRecordOf",
110
+ coreType: "PromptIdentityLayers",
111
+ excluded: [],
112
+ minted: [],
113
+ keys: {
114
+ catalog: { is: "text" },
115
+ renderers: { is: "entries", of: { is: "count" } },
116
+ center: { is: "text", optional: true },
117
+ deploy: { is: "text", optional: true },
118
+ task: { is: "text", optional: true },
119
+ binding: { is: "text" },
120
+ },
121
+ },
122
+ prompt_manifest_selectors: {
123
+ projector: "promptManifestRecordOf",
124
+ coreType: "PromptManifestSelectors",
125
+ excluded: [],
126
+ minted: [],
127
+ keys: {
128
+ binding: { is: "text", optional: true },
129
+ traits: { is: "list", of: { is: "text" } },
130
+ host: { is: "object", face: "prompt_manifest_selectors_host" },
131
+ facts: { is: "entries", of: { is: "flag" } },
132
+ },
133
+ },
134
+ prompt_manifest_selectors_host: {
135
+ projector: "promptManifestRecordOf",
136
+ coreType: `PromptManifestSelectors["host"]`,
137
+ excluded: [],
138
+ minted: [],
139
+ keys: {
140
+ role: { is: "text" },
141
+ form: { is: "text" },
142
+ },
143
+ },
144
+ prompt_manifest_block: {
145
+ projector: "promptManifestRecordOf",
146
+ coreType: `${MANIFEST_FRAME}["blocks"][number]`,
147
+ excluded: [],
148
+ minted: [],
149
+ keys: {
150
+ id: { is: "text" },
151
+ chars: { is: "count" },
152
+ hash: { is: "text" },
153
+ },
154
+ },
155
+ prompt_manifest_section: {
156
+ projector: "promptManifestRecordOf",
157
+ coreType: "PromptManifestSection",
158
+ excluded: [],
159
+ minted: [],
160
+ keys: {
161
+ id: { is: "text" },
162
+ band: { is: "text" },
163
+ rank: { is: "count" },
164
+ variant: { is: "text", optional: true },
165
+ renderer: { is: "object", face: "prompt_manifest_section_renderer", optional: true },
166
+ chars: { is: "count" },
167
+ locale: { is: "text" },
168
+ contentHash: { is: "text" },
169
+ chain: { is: "list", of: { is: "object", face: "prompt_manifest_chain_link" } },
170
+ },
171
+ },
172
+ prompt_manifest_section_renderer: {
173
+ projector: "promptManifestRecordOf",
174
+ coreType: `NonNullable<PromptManifestSection["renderer"]>`,
175
+ excluded: [],
176
+ minted: [],
177
+ keys: {
178
+ id: { is: "text" },
179
+ version: { is: "count" },
180
+ },
181
+ },
182
+ prompt_manifest_chain_link: {
183
+ projector: "promptManifestRecordOf",
184
+ coreType: "PromptChainLink",
185
+ excluded: [],
186
+ minted: [],
187
+ keys: {
188
+ source: { is: "text" },
189
+ overlay: { is: "text", optional: true },
190
+ op: { is: "text", optional: true },
191
+ superseded: { is: "true", optional: true },
192
+ },
193
+ },
194
+ prompt_manifest_superseded: {
195
+ projector: "promptManifestRecordOf",
196
+ coreType: "SupersededOverlay",
197
+ excluded: [],
198
+ minted: [],
199
+ keys: {
200
+ id: { is: "text" },
201
+ source: { is: "text" },
202
+ by: { is: "text" },
203
+ target: { is: "text" },
204
+ supersededBy: { is: "text" },
205
+ },
206
+ },
207
+ prompt_manifest_tool: {
208
+ projector: "promptManifestRecordOf",
209
+ coreType: `NonNullable<${MANIFEST_FRAME}["tools"]>[number]`,
210
+ excluded: [],
211
+ minted: [],
212
+ keys: {
213
+ wireName: { is: "text" },
214
+ aliases: { is: "list", of: { is: "text" } },
215
+ contractId: { is: "text" },
216
+ implementationRevision: { is: "text" },
217
+ cardId: { is: "text" },
218
+ shapeDigest: { is: "text" },
219
+ wireSchemaDigest: { is: "text" },
220
+ },
221
+ },
222
+ prompt_manifest_tool_disclosure: {
223
+ projector: "promptManifestRecordOf",
224
+ coreType: "ToolDisclosureManifest",
225
+ excluded: [],
226
+ minted: [],
227
+ keys: {
228
+ deferredTools: { is: "count" },
229
+ strategy: { is: "text" },
230
+ source: { is: "text" },
231
+ },
232
+ },
70
233
  };
71
234
  //# sourceMappingURL=wire-projection-faces.js.map
@@ -3,6 +3,8 @@ import { DISPLAY_SAFE_URL_TOKEN, buildDisplaySafeUrl } from "./trace/redact.js";
3
3
  export function buildRefusalShownUrl(raw) {
4
4
  if (!isHierarchicalUrl(raw))
5
5
  return DISPLAY_SAFE_URL_TOKEN;
6
+ if (raw.includes("\\"))
7
+ return DISPLAY_SAFE_URL_TOKEN;
6
8
  const u = new URL(raw);
7
9
  if (u.protocol !== "http:" && u.protocol !== "https:")
8
10
  return DISPLAY_SAFE_URL_TOKEN;
@@ -104,6 +104,18 @@ export declare const PLANE_REFUSAL_INVARIANT_OF: {
104
104
  readonly "config.model_route_endpoint_missing": "model-route-endpoint";
105
105
  readonly "config.gateway_fallback_without_primary": "model-route-endpoint";
106
106
  };
107
+ /**
108
+ * S-667 —— **「无中心配置」档的候选**:中心凭证换人时,server 把在用的中心配置降到这一档({@link applyEffective} 吃它,和吃任何候选走同一条 stage → swap → commit)。
109
+ * 它的意思是「**撤回**中心配置」—— 中心下发的每个热面回 env 底:
110
+ * · 限额键 / 审批名单 / autonomy / commandPolicy / projects:本来就**非粘**(域缺席 ⇒ 回 env 底),这份候选什么域都没有,于是自然回底,不另写降档代码;
111
+ * · 模型面组:中心发来的零启用条目空候选 = 本候选不管模型面、上一代继续(不是撤回),所以模型面需要这一个专门的词 —— 见 {@link stageEnvModelPlane};
112
+ * · MCP:带一张**空的已发布**服务器表(`mcp.servers: []`)—— 撤销台账只在域「已发布」时才动(域缺席 ≠ 撤销指令),空表 = 每一条 boot 烘焙的挂载都不再被发布 ⇒ 即时撤销
113
+ * (core 每次 MCP dispatch 前探 isRevoked);新身份重新发布同形条目才恢复。其余没有热面的域(技能 / A2A / 场景 …)不在 stage 里读,缺席。
114
+ * 判别在候选的**身份**上(本常量是进程里唯一的这一个对象,深冻结),不在调用点另传旗子:拿别的空候选来「降档」降不了模型面,而这一条是编译期看得见的。
115
+ */
116
+ export declare const NO_CENTER_EFFECTIVE: EffectiveConfig;
117
+ /** 这份候选是不是「无中心配置」档的那一个(对象身份)。 */
118
+ export declare const isNoCenterEffective: (eff: EffectiveConfig) => boolean;
107
119
  /**
108
120
  * collab 域 = 中心的多成员讨论模板。**本仓不执行它们**:唯一的执行体是引擎的团队讨论脚本,core 7.49.0 已删(本仓不留第二份
109
121
  * 团队编排)。这一只是本仓对该域的**唯一读法**:已发布且启用的模板 id(`enabled === false` 是运营态关闭,不算发布)——