@capybara-hq/kernel 0.1.0-rc.36 → 0.1.0-rc.37

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 (309) hide show
  1. package/bootstrap.json +5 -5
  2. package/dist/admin/admin.module.d.ts +3 -3
  3. package/dist/admin/admin.module.js +6 -6
  4. package/dist/admin/audit-log.service.d.ts +51 -0
  5. package/dist/admin/{platform-audit.service.js → audit-log.service.js} +20 -12
  6. package/dist/admin/audit.controller.d.ts +18 -6
  7. package/dist/admin/audit.controller.js +36 -6
  8. package/dist/admin/audit.schemas.d.ts +9 -1
  9. package/dist/admin/audit.schemas.js +22 -2
  10. package/dist/admin/outbox-dead.controller.d.ts +4 -6
  11. package/dist/admin/outbox-dead.controller.js +9 -6
  12. package/dist/admin/outbox-dead.schemas.d.ts +16 -0
  13. package/dist/admin/outbox-dead.schemas.js +25 -1
  14. package/dist/admin/outbox-dead.service.d.ts +16 -7
  15. package/dist/admin/outbox-dead.service.js +34 -10
  16. package/dist/admin/overview.service.d.ts +3 -3
  17. package/dist/admin/overview.service.js +0 -1
  18. package/dist/agents/agent-lookup.js +2 -10
  19. package/dist/agents/agents.service.js +9 -20
  20. package/dist/agents/definition.d.ts +3 -51
  21. package/dist/agents/definition.js +4 -254
  22. package/dist/agents/org-templates.js +2 -6
  23. package/dist/agents/readiness.controller.d.ts +4 -12
  24. package/dist/agents/readiness.controller.js +4 -12
  25. package/dist/agents/readiness.service.d.ts +23 -11
  26. package/dist/agents/readiness.service.js +31 -14
  27. package/dist/agents/templates.d.ts +0 -6
  28. package/dist/agents/templates.js +8 -34
  29. package/dist/background/store.d.ts +2 -0
  30. package/dist/background/store.js +3 -1
  31. package/dist/background/wake-rules.js +2 -1
  32. package/dist/catalog/admin-catalog.controller.d.ts +1 -2
  33. package/dist/catalog/admin-catalog.controller.js +1 -2
  34. package/dist/catalog/appearance.service.js +1 -3
  35. package/dist/catalog/catalog-content.d.ts +1 -1
  36. package/dist/catalog/catalog-content.js +1 -4
  37. package/dist/catalog/catalog-items.js +3 -3
  38. package/dist/catalog/catalog-scope.service.d.ts +10 -28
  39. package/dist/catalog/catalog-scope.service.js +22 -73
  40. package/dist/catalog/cli.d.ts +0 -11
  41. package/dist/catalog/cli.js +0 -20
  42. package/dist/catalog/component-scope.service.js +0 -2
  43. package/dist/catalog/component-state.js +2 -2
  44. package/dist/catalog/install-status.d.ts +6 -0
  45. package/dist/catalog/install-status.js +6 -0
  46. package/dist/catalog/job-ids.d.ts +0 -4
  47. package/dist/catalog/job-ids.js +0 -4
  48. package/dist/catalog/marketplaces.service.d.ts +1 -1
  49. package/dist/catalog/org-catalog.service.d.ts +2 -0
  50. package/dist/catalog/org-catalog.service.js +8 -3
  51. package/dist/catalog/org-extension-switch.d.ts +7 -2
  52. package/dist/catalog/org-extension-switch.js +56 -9
  53. package/dist/catalog/org-plugin-uploads.d.ts +6 -15
  54. package/dist/catalog/org-plugin-uploads.js +9 -27
  55. package/dist/catalog/owned-items.js +1 -3
  56. package/dist/catalog/platform-import-update.js +1 -1
  57. package/dist/catalog/plugin-import.d.ts +15 -13
  58. package/dist/catalog/plugin-import.js +21 -30
  59. package/dist/catalog/plugin-install.d.ts +3 -43
  60. package/dist/catalog/plugin-install.js +8 -150
  61. package/dist/catalog/plugin-package.d.ts +5 -10
  62. package/dist/catalog/plugin-package.js +12 -33
  63. package/dist/catalog/plugin-upgrade.js +5 -4
  64. package/dist/catalog/scope-jobs.d.ts +34 -34
  65. package/dist/catalog/scope-jobs.js +50 -37
  66. package/dist/catalog/scope-orgs.d.ts +1 -1
  67. package/dist/catalog/scope-orgs.js +1 -2
  68. package/dist/catalog/scope-sync-workers.d.ts +4 -3
  69. package/dist/catalog/scope-sync-workers.js +18 -6
  70. package/dist/catalog/scope-sync.d.ts +56 -59
  71. package/dist/catalog/scope-sync.js +96 -166
  72. package/dist/catalog/unshare.d.ts +3 -4
  73. package/dist/catalog/unshare.js +5 -8
  74. package/dist/channels/job-ids.d.ts +2 -6
  75. package/dist/channels/job-ids.js +2 -6
  76. package/dist/channels/outbound.d.ts +1 -1
  77. package/dist/channels/outbound.js +1 -1
  78. package/dist/channels/supervisor.d.ts +2 -3
  79. package/dist/channels/supervisor.js +2 -3
  80. package/dist/client/client-access.service.js +1 -1
  81. package/dist/config/env.js +19 -1
  82. package/dist/config/load.d.ts +0 -6
  83. package/dist/config/load.js +8 -27
  84. package/dist/config/schema.d.ts +53 -47
  85. package/dist/config/schema.js +190 -40
  86. package/dist/conversations/attachments.service.d.ts +10 -3
  87. package/dist/conversations/attachments.service.js +49 -16
  88. package/dist/conversations/conversations.controller.d.ts +0 -39
  89. package/dist/conversations/conversations.controller.js +0 -39
  90. package/dist/conversations/events.d.ts +71 -46
  91. package/dist/conversations/events.js +124 -112
  92. package/dist/conversations/media-types.d.ts +25 -0
  93. package/dist/conversations/media-types.js +38 -0
  94. package/dist/conversations/queue.d.ts +3 -1
  95. package/dist/conversations/queue.service.js +9 -2
  96. package/dist/conversations/titles.js +6 -0
  97. package/dist/ctx/create-ctx.js +1 -2
  98. package/dist/ctx/secrets.d.ts +24 -7
  99. package/dist/ctx/secrets.js +97 -30
  100. package/dist/db/kernel-schema.d.ts +17 -6
  101. package/dist/errors.d.ts +5 -2
  102. package/dist/errors.js +5 -2
  103. package/dist/evals/reconstruct.d.ts +4 -17
  104. package/dist/evals/reconstruct.js +13 -53
  105. package/dist/evals/recorded-tools.d.ts +0 -27
  106. package/dist/evals/recorded-tools.js +2 -92
  107. package/dist/evals/run-replay.d.ts +1 -6
  108. package/dist/evals/run-replay.js +10 -17
  109. package/dist/evals/sets.service.d.ts +17 -5
  110. package/dist/evals/sets.service.js +33 -12
  111. package/dist/evals/snapshot.d.ts +1 -2
  112. package/dist/evals/snapshot.js +4 -17
  113. package/dist/extensions/admin-ops.d.ts +6 -1
  114. package/dist/extensions/admin-ops.js +17 -4
  115. package/dist/extensions/admin-view.d.ts +7 -4
  116. package/dist/extensions/admin-view.js +27 -21
  117. package/dist/extensions/bootstrap.js +0 -1
  118. package/dist/extensions/cli.js +0 -1
  119. package/dist/extensions/host.d.ts +2 -3
  120. package/dist/extensions/host.js +1 -5
  121. package/dist/extensions/installs.d.ts +1 -3
  122. package/dist/extensions/instance.d.ts +0 -2
  123. package/dist/extensions/instance.js +0 -3
  124. package/dist/extensions/org-config.d.ts +4 -4
  125. package/dist/extensions/org-config.js +13 -22
  126. package/dist/extensions/package.d.ts +6 -6
  127. package/dist/extensions/package.js +3 -7
  128. package/dist/extensions/permission-view.d.ts +2 -4
  129. package/dist/extensions/plugin-items.d.ts +21 -1
  130. package/dist/extensions/plugin-items.js +28 -0
  131. package/dist/extensions/sync.js +5 -10
  132. package/dist/extensions/unavailable.js +0 -1
  133. package/dist/http/api.module.js +2 -1
  134. package/dist/identity/audit.d.ts +0 -12
  135. package/dist/identity/audit.js +0 -27
  136. package/dist/identity/auth.controller.js +5 -9
  137. package/dist/identity/cookies.d.ts +4 -9
  138. package/dist/identity/cookies.js +8 -32
  139. package/dist/identity/initial-passwords.d.ts +1 -1
  140. package/dist/identity/initial-passwords.js +1 -2
  141. package/dist/identity/sessions.d.ts +0 -6
  142. package/dist/identity/sessions.js +0 -18
  143. package/dist/inbox/platform-inbox.service.d.ts +33 -1
  144. package/dist/inbox/platform-inbox.service.js +56 -6
  145. package/dist/index.d.ts +4 -2
  146. package/dist/index.js +4 -2
  147. package/dist/infra/cli/master-key-rewrap.d.ts +15 -0
  148. package/dist/infra/cli/master-key-rewrap.js +24 -0
  149. package/dist/infra/config/kernel-config.service.js +0 -17
  150. package/dist/infra/health/health.controller.js +8 -0
  151. package/dist/infra/health/process-fault.d.ts +16 -0
  152. package/dist/infra/health/process-fault.js +49 -0
  153. package/dist/infra/lifecycle/process-guards.d.ts +8 -2
  154. package/dist/infra/lifecycle/process-guards.js +12 -3
  155. package/dist/infra/lifecycle/shutdown-signals.d.ts +10 -1
  156. package/dist/infra/lifecycle/shutdown-signals.js +28 -13
  157. package/dist/infra/outbox/outbox.service.d.ts +12 -9
  158. package/dist/infra/outbox/outbox.service.js +22 -26
  159. package/dist/infra/outbox/registry.d.ts +15 -7
  160. package/dist/infra/outbox/registry.js +39 -23
  161. package/dist/lifecycle/kernel-lifecycle.js +1 -7
  162. package/dist/models/enablement.d.ts +5 -6
  163. package/dist/models/enablement.js +7 -14
  164. package/dist/orgs/orgs.module.d.ts +2 -2
  165. package/dist/orgs/orgs.module.js +2 -2
  166. package/dist/orgs/settings.controller.d.ts +3 -2
  167. package/dist/orgs/settings.service.d.ts +59 -14
  168. package/dist/orgs/settings.service.js +102 -20
  169. package/dist/overrides.d.ts +3 -7
  170. package/dist/overrides.js +2 -4
  171. package/dist/packages/tgz.d.ts +0 -2
  172. package/dist/packages/tgz.js +0 -2
  173. package/dist/platform/exclusions.js +0 -5
  174. package/dist/platform/operation.js +1 -1
  175. package/dist/platform/ops/admin.ops.d.ts +2 -2
  176. package/dist/platform/ops/admin.ops.js +9 -6
  177. package/dist/platform/ops/agents.ops.js +1 -1
  178. package/dist/platform/ops/connectors.ops.js +46 -1
  179. package/dist/platform/ops/evals.ops.js +1 -64
  180. package/dist/platform/ops/extensions-admin.ops.js +1 -1
  181. package/dist/platform/ops/inbox.ops.js +16 -3
  182. package/dist/platform/ops/org-plugins.ops.js +1 -1
  183. package/dist/platform/ops/orgs.ops.d.ts +5 -3
  184. package/dist/platform/ops/orgs.ops.js +19 -4
  185. package/dist/platform/ops/outbox.ops.js +5 -5
  186. package/dist/roles/worker-role.d.ts +2 -3
  187. package/dist/roles/worker-role.js +3 -13
  188. package/dist/runtime/context/build.d.ts +56 -18
  189. package/dist/runtime/context/build.js +143 -50
  190. package/dist/runtime/context/compaction.d.ts +1 -3
  191. package/dist/runtime/context/compaction.js +42 -8
  192. package/dist/runtime/context/run-context.js +1 -2
  193. package/dist/runtime/context/skills.d.ts +27 -56
  194. package/dist/runtime/context/skills.js +42 -114
  195. package/dist/runtime/context/tool-changes.d.ts +3 -3
  196. package/dist/runtime/context/tool-changes.js +6 -16
  197. package/dist/runtime/hook-calls.d.ts +6 -6
  198. package/dist/runtime/hook-calls.js +7 -7
  199. package/dist/runtime/langgraph-loop.js +1 -0
  200. package/dist/runtime/maintenance.d.ts +3 -11
  201. package/dist/runtime/maintenance.js +5 -20
  202. package/dist/runtime/model-call.d.ts +5 -0
  203. package/dist/runtime/model-call.js +48 -36
  204. package/dist/runtime/providers.d.ts +33 -35
  205. package/dist/runtime/providers.js +64 -109
  206. package/dist/runtime/run-context.service.js +7 -22
  207. package/dist/runtime/run-deletion.d.ts +6 -0
  208. package/dist/runtime/run-deletion.js +39 -16
  209. package/dist/runtime/run-execution.js +4 -3
  210. package/dist/runtime/run-finish.js +2 -1
  211. package/dist/runtime/run-liveness.d.ts +11 -0
  212. package/dist/runtime/run-liveness.js +19 -0
  213. package/dist/runtime/run-orphan-check.job.js +2 -1
  214. package/dist/runtime/run-queue.js +8 -16
  215. package/dist/runtime/run-worker.d.ts +2 -2
  216. package/dist/runtime/run-worker.js +8 -6
  217. package/dist/runtime/subagents/definition.d.ts +16 -20
  218. package/dist/runtime/subagents/definition.js +27 -27
  219. package/dist/runtime/subagents/dispatch.d.ts +6 -2
  220. package/dist/runtime/subagents/dispatch.js +17 -3
  221. package/dist/runtime/subagents/org-agents.js +1 -2
  222. package/dist/runtime/subagents/preamble.d.ts +3 -2
  223. package/dist/runtime/subagents/preamble.js +3 -2
  224. package/dist/runtime/subagents/render.d.ts +1 -2
  225. package/dist/runtime/subagents/render.js +1 -2
  226. package/dist/runtime/subagents/skill-fork.d.ts +2 -4
  227. package/dist/runtime/subagents/template-skills.d.ts +47 -0
  228. package/dist/runtime/subagents/template-skills.js +76 -0
  229. package/dist/schedules/effective-settings.d.ts +9 -3
  230. package/dist/schedules/effective-settings.js +5 -4
  231. package/dist/schedules/fire.js +11 -0
  232. package/dist/schedules/scheduled-tasks.service.js +5 -0
  233. package/dist/schedules/unattended.d.ts +2 -0
  234. package/dist/schedules/unattended.js +6 -1
  235. package/dist/skills/agent-skills.service.js +1 -2
  236. package/dist/skills/catalog.d.ts +1 -3
  237. package/dist/skills/catalog.js +1 -3
  238. package/dist/skills/conversation-catalog.d.ts +1 -2
  239. package/dist/skills/conversation-catalog.js +1 -2
  240. package/dist/skills/usable.js +2 -3
  241. package/dist/storage/storage.service.js +9 -1
  242. package/dist/tools/approvals.service.js +2 -4
  243. package/dist/tools/builtin-names.d.ts +2 -9
  244. package/dist/tools/builtin-names.js +4 -13
  245. package/dist/tools/builtins/sandbox/bash.js +3 -3
  246. package/dist/tools/builtins/sandbox/common.d.ts +7 -13
  247. package/dist/tools/builtins/sandbox/common.js +8 -115
  248. package/dist/tools/builtins/sandbox/fetch-attachment.d.ts +10 -0
  249. package/dist/tools/builtins/sandbox/fetch-attachment.js +119 -0
  250. package/dist/tools/builtins/sandbox/glob.js +1 -3
  251. package/dist/tools/builtins/sandbox/grep.js +3 -5
  252. package/dist/tools/builtins/sandbox/index.d.ts +8 -5
  253. package/dist/tools/builtins/sandbox/index.js +10 -5
  254. package/dist/tools/builtins/sandbox/read.js +3 -2
  255. package/dist/tools/builtins/tool-search.d.ts +4 -7
  256. package/dist/tools/builtins/tool-search.js +6 -10
  257. package/dist/tools/connector-account-policies.d.ts +30 -3
  258. package/dist/tools/connector-account-policies.js +54 -7
  259. package/dist/tools/connectors.controller.d.ts +24 -11
  260. package/dist/tools/connectors.controller.js +35 -6
  261. package/dist/tools/connectors.schemas.d.ts +14 -1
  262. package/dist/tools/connectors.schemas.js +14 -2
  263. package/dist/tools/connectors.service.d.ts +22 -0
  264. package/dist/tools/connectors.service.js +56 -0
  265. package/dist/tools/drift.d.ts +1 -1
  266. package/dist/tools/drift.js +1 -1
  267. package/dist/tools/git-push-policy.d.ts +4 -1
  268. package/dist/tools/git-push-policy.js +3 -1
  269. package/dist/tools/info.d.ts +1 -7
  270. package/dist/tools/info.js +5 -18
  271. package/dist/tools/job-ids.d.ts +0 -4
  272. package/dist/tools/job-ids.js +1 -6
  273. package/dist/tools/pipeline.d.ts +4 -10
  274. package/dist/tools/pipeline.js +16 -62
  275. package/dist/tools/policy.d.ts +6 -2
  276. package/dist/tools/policy.js +14 -12
  277. package/dist/tools/registry.js +1 -5
  278. package/dist/ui/views.d.ts +5 -5
  279. package/dist/ui/views.js +10 -16
  280. package/package.json +3 -3
  281. package/src/migrations/0137_audit_org_idx.sql +5 -0
  282. package/src/migrations/0138_plugin_install_status_no_upgrading.sql +18 -0
  283. package/src/migrations/0139_retire_legacy_forms.sql +183 -0
  284. package/src/migrations/0140_retire_history_forms.sql +148 -0
  285. package/src/migrations/0141_install_ledger_promoted_rows.sql +36 -0
  286. package/src/migrations/0142_backfill_event_fields.sql +74 -0
  287. package/src/migrations/0143_backfill_model_call_fields.sql +105 -0
  288. package/src/migrations/0144_retire_frozen_definition_keys.sql +163 -0
  289. package/dist/admin/platform-audit.service.d.ts +0 -41
  290. package/dist/conversations/job-ids.d.ts +0 -6
  291. package/dist/conversations/job-ids.js +0 -6
  292. package/dist/extensions/job-ids.d.ts +0 -6
  293. package/dist/extensions/job-ids.js +0 -6
  294. package/dist/infra/queue/retired-schedulers.d.ts +0 -7
  295. package/dist/infra/queue/retired-schedulers.js +0 -9
  296. package/dist/orgs/job-ids.d.ts +0 -8
  297. package/dist/orgs/job-ids.js +0 -8
  298. package/dist/runtime/context/legacy-text.d.ts +0 -22
  299. package/dist/runtime/context/legacy-text.js +0 -37
  300. package/dist/runtime/job-ids.d.ts +0 -10
  301. package/dist/runtime/job-ids.js +0 -10
  302. package/dist/runtime/retired-schedulers.d.ts +0 -7
  303. package/dist/runtime/retired-schedulers.js +0 -31
  304. package/dist/storage/job-ids.d.ts +0 -6
  305. package/dist/storage/job-ids.js +0 -6
  306. package/dist/tools/legacy-data.d.ts +0 -34
  307. package/dist/tools/legacy-data.js +0 -76
  308. package/dist/tools/legacy-keys.d.ts +0 -51
  309. package/dist/tools/legacy-keys.js +0 -114
@@ -1,7 +1,6 @@
1
1
  import { devicePathsChange, devicePathsLevel, } from "../runtime/context/device-paths.js";
2
2
  import { assistantIdemKey } from "../runtime/model-call.js";
3
3
  import { MATCH_IGNORED_FIELDS } from "../tools/builtin-names.js";
4
- import { isLegacyPrefixedKey, legacyToolInput, legacyToolKey, } from "../tools/legacy-keys.js";
5
4
  import { RUN_STOPPED_TEXT } from "../tools/pipeline.js";
6
5
  /**
7
6
  * 整轮回放的工具管线(C6 / Review Focus 3):只回放原运行记录的工具结果,**从不执行任何工具**——
@@ -10,85 +9,6 @@ import { RUN_STOPPED_TEXT } from "../tools/pipeline.js";
10
9
  */
11
10
  /** 没有匹配记录时模型看到的工具结果(模型可见,英文)。 */
12
11
  export const REPLAY_NO_RECORDING = "[replay] No recorded result matches this tool call (same tool and arguments); the tool was not executed during replay.";
13
- /**
14
- * The connectors and extensions an rc `<x>__<tool>` key can name, from positive evidence in the
15
- * snapshot only (a head with no evidence, or evidence of both kinds, stays unmapped, so its
16
- * recorded calls are unmatched, which is a safe miss):
17
- * - a connector: the tool definition the key was recorded with (`toolSpecs`, found by the specHash of
18
- * its `tool_call_started` or its `model_call` tools / catalog entry) has `connectorData`;
19
- * - an extension: that definition exists without `connectorData` and its name is the key's tool
20
- * part, or an rc-era agent definition names exactly that tool as a `{ kind: "plugin", plugin: x, name }`
21
- * ref.
22
- */
23
- export function legacyScopeOf(s) {
24
- const hashes = new Map();
25
- const note = (key, hash) => {
26
- if (!isLegacyPrefixedKey(key))
27
- return;
28
- const set = hashes.get(key) ?? new Set();
29
- if (hash !== undefined && hash !== "")
30
- set.add(hash);
31
- hashes.set(key, set);
32
- };
33
- for (const e of s.events) {
34
- if (e.type === "tool_call_started") {
35
- const p = e.payload;
36
- note(p.toolKey, p.specHash);
37
- }
38
- else if (e.type === "model_call") {
39
- const r = e.payload.request;
40
- for (const t of [...(r?.tools ?? []), ...(r?.catalog ?? [])])
41
- note(t.key, t.specHash);
42
- }
43
- }
44
- const extensionNames = new Set();
45
- const connectorSlugs = new Set();
46
- const planted = new Set();
47
- // rc-era snapshots hold definitions from before tools were on by default: an enabled `tools`
48
- // list of refs (tools default-on spec §2)
49
- for (const def of Object.values(s.definitions)) {
50
- const refs = def.tools;
51
- if (!Array.isArray(refs))
52
- continue;
53
- for (const t of refs) {
54
- if (t?.kind === "plugin" && typeof t.plugin === "string" && typeof t.name === "string") {
55
- planted.add(`${t.plugin}__${t.name}`);
56
- }
57
- }
58
- }
59
- for (const [key, set] of hashes) {
60
- const i = key.indexOf("__");
61
- const head = key.slice(0, i);
62
- const tool = key.slice(i + 2);
63
- for (const h of set) {
64
- const spec = s.toolSpecs[h];
65
- if (spec === undefined)
66
- continue;
67
- if (spec.connectorData !== undefined) {
68
- connectorSlugs.add(head);
69
- }
70
- else if (spec.name === tool) {
71
- extensionNames.add(head);
72
- }
73
- }
74
- }
75
- for (const key of planted) {
76
- if (hashes.has(key))
77
- extensionNames.add(key.slice(0, key.indexOf("__")));
78
- }
79
- return { connectorSlugs, extensionNames };
80
- }
81
- /**
82
- * A recorded call in the current names: an rc builtin or `<x>__<tool>` key becomes its current
83
- * key with the input's parameters renamed. Only the recorded side is ever normalized; a call
84
- * already in current names (or one that cannot be mapped) is returned as is.
85
- */
86
- export function currentCall(name, input, scope) {
87
- const key = legacyToolKey(name, scope);
88
- if (key === null)
89
- return { name, input, legacy: false };
90
- return { name: key, input: legacyToolInput(name, input), legacy: true };
91
- }
92
12
  /** 规范化 JSON:对象键递归按码点排序,数组保持顺序;`undefined` 按 JSON 规则省略。 */
93
13
  export function canonicalJson(v) {
94
14
  const norm = (x) => {
@@ -156,7 +76,6 @@ export function recordedCalls(s) {
156
76
  if (current !== undefined)
157
77
  pathsOf.set(a, current);
158
78
  }
159
- const scope = legacyScopeOf(s);
160
79
  const out = [];
161
80
  for (const e of own) {
162
81
  if (e.type !== "assistant_message")
@@ -170,11 +89,9 @@ export function recordedCalls(s) {
170
89
  const r = results.get(call.id);
171
90
  if (!r)
172
91
  continue;
173
- const cur = currentCall(call.name, call.input, scope);
174
92
  out.push({
175
- toolKey: cur.name,
176
- inputKey: matchKey(cur.name, cur.input),
177
- ...(cur.legacy && { legacy: true }),
93
+ toolKey: call.name,
94
+ inputKey: matchKey(call.name, call.input),
178
95
  content: r.content,
179
96
  isError: r.isError,
180
97
  ...(r.loadedTools !== undefined && { loadedTools: r.loadedTools }),
@@ -195,14 +112,9 @@ export class RecordedToolPipeline {
195
112
  d;
196
113
  used = new Set();
197
114
  misses = 0;
198
- legacyHits = 0;
199
115
  constructor(d) {
200
116
  this.d = d;
201
117
  }
202
- /** Calls so far matched with a recording made under release-candidate tool names. */
203
- legacyMatches() {
204
- return this.legacyHits;
205
- }
206
118
  /** 至今没有匹配到记录的调用数。 */
207
119
  unmatched() {
208
120
  return this.misses;
@@ -271,8 +183,6 @@ export class RecordedToolPipeline {
271
183
  if (i < 0)
272
184
  return undefined;
273
185
  this.used.add(i);
274
- if (this.d.recordings[i]?.legacy === true)
275
- this.legacyHits++;
276
186
  return this.d.recordings[i];
277
187
  }
278
188
  }
@@ -11,7 +11,7 @@ import type { AgentLoop, LoopOutcome } from "../runtime/loop.js";
11
11
  import { type MediaSourceDeps } from "../runtime/model-call.js";
12
12
  import type { ProviderRegistry } from "../runtime/providers.js";
13
13
  import type { RunFinish } from "../runtime/run-finish.js";
14
- import type { CaseSnapshot, SnapshotEvent } from "./snapshot.js";
14
+ import { type CaseSnapshot, type SnapshotEvent } from "./snapshot.js";
15
15
  import type { ResolvedCandidate } from "./step-replay.js";
16
16
  /**
17
17
  * 整轮回放(D2 / C6):在 `kind = 'eval'` 的隐藏对话里跑**同一个** `LangGraphLoop`,工具管线换成
@@ -42,11 +42,6 @@ export interface RunReplayResult {
42
42
  usage: ModelUsage;
43
43
  steps: number;
44
44
  unmatched: number;
45
- /**
46
- * Set when a call was matched with a recording made under the release-candidate tool names
47
- * (`sandbox_edit` for `Edit`, `docs__search` for `mcp__docs__search`, old parameter names).
48
- */
49
- legacyKeyMatch?: true;
50
45
  }
51
46
  /** 原运行(基线)的同形摘要。 */
52
47
  export type RunBaseline = Omit<RunReplayResult, "conversationId" | "outcome" | "unmatched">;
@@ -27,7 +27,8 @@ import { runContextIdemKey } from "../runtime/run-context.service.js";
27
27
  import { recordedSkillForks } from "../runtime/subagents/skill-fork.js";
28
28
  import { skillsCatalogIdemKey } from "../skills/catalog.js";
29
29
  import { ACTIVE_EVAL_STATUSES, addUsage, consumeTokens, TOO_MANY_ERRORS, usageTokens, } from "./budget.js";
30
- import { currentCall, legacyScopeOf, RecordedToolPipeline, recordedCalls, } from "./recorded-tools.js";
30
+ import { RecordedToolPipeline, recordedCalls } from "./recorded-tools.js";
31
+ import { toEvents } from "./snapshot.js";
31
32
  /** 写种子时发现已失去认领或运行已不在执行:本次执行停下,不留评测对话。 */
32
33
  export class ReplayClaimLost extends Error {
33
34
  constructor() {
@@ -210,7 +211,7 @@ const ZERO = {
210
211
  cacheWriteTokens: 0,
211
212
  };
212
213
  /** 一次运行的工具调用序列、最后的回复、停止原因、用量与步数(基线与候选同一算法)。 */
213
- function summarize(events, runId, scope) {
214
+ function summarize(events, runId) {
214
215
  const toolCalls = [];
215
216
  let usage = ZERO;
216
217
  let last = null;
@@ -224,12 +225,7 @@ function summarize(events, runId, scope) {
224
225
  for (const b of p.content) {
225
226
  if (b.type !== "tool_call")
226
227
  continue;
227
- if (scope === undefined)
228
- toolCalls.push({ name: b.name, input: b.input });
229
- else {
230
- const { name, input } = currentCall(b.name, b.input, scope);
231
- toolCalls.push({ name, input });
232
- }
228
+ toolCalls.push({ name: b.name, input: b.input });
233
229
  }
234
230
  last = { content: p.content, stopReason: p.stopReason };
235
231
  }
@@ -253,9 +249,7 @@ function summarize(events, runId, scope) {
253
249
  }
254
250
  /** 原运行(快照)的摘要,作为整轮回放的基线。 */
255
251
  export function runBaseline(s) {
256
- // an rc recording is read in the current tool names, so the diff against a candidate only
257
- // shows real differences
258
- return summarize(s.events, s.runId, legacyScopeOf(s));
252
+ return summarize(s.events, s.runId);
259
253
  }
260
254
  /**
261
255
  * 删掉一个评测对话(崩溃重跑前清掉上一次的残留):先删它各次运行的 checkpoint,再删对话(事件、运行随之级联删除)。
@@ -279,17 +273,17 @@ export async function deleteEvalConversation(d, conversationId) {
279
273
  .execute();
280
274
  }
281
275
  /**
282
- * 原运行每步开始时吸收到的位置(第一次尝试的 `absorbedUpToSeq`;较早的事件没有时取该 model_call 的 seq)。
276
+ * Where each step of the original run had taken in absorbable events (its first attempt's
277
+ * `absorbedUpToSeq`).
283
278
  */
284
279
  function absorbedByStep(s) {
285
280
  const out = new Map();
286
- for (const e of s.events) {
281
+ for (const e of toEvents(s)) {
287
282
  if (e.runId !== s.runId || e.type !== "model_call")
288
283
  continue;
289
- const p = e.payload;
290
- if (out.has(p.step))
284
+ if (out.has(e.payload.step))
291
285
  continue;
292
- out.set(p.step, p.request?.absorbedUpToSeq ?? e.seq);
286
+ out.set(e.payload.step, e.payload.request.absorbedUpToSeq);
293
287
  }
294
288
  return out;
295
289
  }
@@ -668,6 +662,5 @@ export async function replayRun(d, s, candidate, evalRunId, signal) {
668
662
  outcome: outcome.kind,
669
663
  ...summary,
670
664
  unmatched: pipeline.unmatched(),
671
- ...(pipeline.legacyMatches() > 0 && { legacyKeyMatch: true }),
672
665
  };
673
666
  }
@@ -61,7 +61,9 @@ export interface SampleInput {
61
61
  /** 用例标题:触发消息文本的前 80 个字符(按码点)。 */
62
62
  export declare const CASE_TITLE_CHARS = 80;
63
63
  /**
64
- * 快照运行的触发消息(该运行 `run_started` 之前最近的一条 `user_message`)的文本,空白折叠后取前 80 个字符。
64
+ * The text of the snapshot run's trigger message (the latest `user_message` before its
65
+ * `run_started`, never a template skill's invocation written after a sub-agent's task),
66
+ * whitespace collapsed, first 80 characters.
65
67
  */
66
68
  export declare function caseTitle(s: CaseSnapshot): string;
67
69
  /**
@@ -118,10 +120,20 @@ export declare class EvalSetsService {
118
120
  */
119
121
  private insertCase;
120
122
  /**
121
- * 把某次运行加为用例。对话不在本组织(或是 eval 对话)→ `conversation.not_found`;对话的 agent 不是集合的 agent →
122
- * `eval.agent_mismatch`;手动压缩运行(无模型步骤)→ `eval.compact_not_replayable`;已在集合里 →
123
- * `eval.case_exists`;集合满了 → `eval.too_many_cases`;运行未终态 / 快照超大 →
124
- * `eval.run_not_finished` / `eval.case_too_large`(`takeSnapshot`)。
123
+ * The admission checks of a case, in one place (the route and the Platform operation's precheck
124
+ * both call it); throws the `ApiError` the route gives. Writes nothing. Capacity is checked before
125
+ * the snapshot is taken (it can be large) and again under the lock when the case is written.
126
+ */
127
+ checkAddCase(orgId: string, setId: string, input: {
128
+ conversationId: string;
129
+ runId: string;
130
+ }): Promise<void>;
131
+ /**
132
+ * Adds a run as a case. Admission is `checkAddCase` (conversation not in the org or an eval
133
+ * conversation -> `conversation.not_found`; the conversation's agent is not the set's ->
134
+ * `eval.agent_mismatch`; manual compaction run -> `eval.compact_not_replayable`; already in the
135
+ * set -> `eval.case_exists`; set full -> `eval.too_many_cases`; run not finished / snapshot too
136
+ * large -> `eval.run_not_finished` / `eval.case_too_large` (`takeSnapshot`)).
125
137
  */
126
138
  addCase(orgId: string, actor: string, setId: string, input: {
127
139
  conversationId: string;
@@ -44,7 +44,9 @@ const STATUSES = {
44
44
  any: ["completed", "failed", "aborted"],
45
45
  };
46
46
  /**
47
- * 快照运行的触发消息(该运行 `run_started` 之前最近的一条 `user_message`)的文本,空白折叠后取前 80 个字符。
47
+ * The text of the snapshot run's trigger message (the latest `user_message` before its
48
+ * `run_started`, never a template skill's invocation written after a sub-agent's task),
49
+ * whitespace collapsed, first 80 characters.
48
50
  */
49
51
  export function caseTitle(s) {
50
52
  const started = s.events.find((e) => e.type === "run_started" && e.runId === s.runId);
@@ -56,6 +58,10 @@ export function caseTitle(s) {
56
58
  if (e.type !== "user_message")
57
59
  continue;
58
60
  const payload = e.payload;
61
+ // a template sub-agent's skill (or the notice that it could not be read), written after its
62
+ // task: the task titles the case
63
+ if (payload.skill?.template || payload.templateSkillNotice !== undefined)
64
+ continue;
59
65
  // a skill invocation: what the person typed, never the rendered skill (content[0])
60
66
  if (payload.skill !== undefined) {
61
67
  text = typedInvocation(payload.skill);
@@ -402,12 +408,11 @@ let EvalSetsService = EvalSetsService_1 = class EvalSetsService {
402
408
  return this.insertCaseIn(orgId, actor, setId, snapshot, extra, { max, json, plans, base });
403
409
  }
404
410
  /**
405
- * 把某次运行加为用例。对话不在本组织(或是 eval 对话)→ `conversation.not_found`;对话的 agent 不是集合的 agent →
406
- * `eval.agent_mismatch`;手动压缩运行(无模型步骤)→ `eval.compact_not_replayable`;已在集合里 →
407
- * `eval.case_exists`;集合满了 → `eval.too_many_cases`;运行未终态 / 快照超大 →
408
- * `eval.run_not_finished` / `eval.case_too_large`(`takeSnapshot`)。
411
+ * The admission checks of a case, in one place (the route and the Platform operation's precheck
412
+ * both call it); throws the `ApiError` the route gives. Writes nothing. Capacity is checked before
413
+ * the snapshot is taken (it can be large) and again under the lock when the case is written.
409
414
  */
410
- async addCase(orgId, actor, setId, input, actorTokenId, auditDetail) {
415
+ async checkAddCase(orgId, setId, input) {
411
416
  const set = await this.liveSet(orgId, setId);
412
417
  const conv = await this.db
413
418
  .selectFrom("conversations")
@@ -423,15 +428,18 @@ let EvalSetsService = EvalSetsService_1 = class EvalSetsService {
423
428
  if (conv.agent_id !== set.agent_id) {
424
429
  throw new ApiError("eval.agent_mismatch", "The run belongs to a different agent");
425
430
  }
426
- // a manual compaction run has no model step to replay (context compaction spec §4.7): it would
427
- // take a set slot and never produce a result, so it is refused with a clear code
428
431
  const run = await this.db
429
432
  .selectFrom("runs")
430
- .select("compact")
433
+ .select(["status", "compact"])
431
434
  .where("id", "=", input.runId)
432
435
  .where("conversation_id", "=", input.conversationId)
433
436
  .executeTakeFirst();
434
- if (run?.compact === true) {
437
+ if (run === undefined) {
438
+ throw new ApiError("conversation.not_found", "Conversation or run not found");
439
+ }
440
+ // a manual compaction run has no model step to replay (context compaction spec §4.7): it would
441
+ // take a set slot and never produce a result, so it is refused with a clear code
442
+ if (run.compact) {
435
443
  throw new ApiError("eval.compact_not_replayable", "A manual compaction run has no model step to replay, so it cannot be an eval case");
436
444
  }
437
445
  const exists = await this.db
@@ -442,10 +450,23 @@ let EvalSetsService = EvalSetsService_1 = class EvalSetsService {
442
450
  .executeTakeFirst();
443
451
  if (exists)
444
452
  throw caseExists();
445
- const { maxCasesPerSet, maxCaseBytes } = this.config.get().evals;
446
- // 先判容量再取快照(快照可能很大);写入时在锁内再判一次
453
+ if (run.status === "running" || run.status === "queued") {
454
+ throw new ApiError("eval.run_not_finished", "The run has not finished yet");
455
+ }
456
+ const { maxCasesPerSet } = this.config.get().evals;
447
457
  if ((await this.caseCount(this.db, setId)) >= maxCasesPerSet)
448
458
  throw tooMany(maxCasesPerSet);
459
+ }
460
+ /**
461
+ * Adds a run as a case. Admission is `checkAddCase` (conversation not in the org or an eval
462
+ * conversation -> `conversation.not_found`; the conversation's agent is not the set's ->
463
+ * `eval.agent_mismatch`; manual compaction run -> `eval.compact_not_replayable`; already in the
464
+ * set -> `eval.case_exists`; set full -> `eval.too_many_cases`; run not finished / snapshot too
465
+ * large -> `eval.run_not_finished` / `eval.case_too_large` (`takeSnapshot`)).
466
+ */
467
+ async addCase(orgId, actor, setId, input, actorTokenId, auditDetail) {
468
+ await this.checkAddCase(orgId, setId, input);
469
+ const { maxCasesPerSet, maxCaseBytes } = this.config.get().evals;
449
470
  const snapshot = await takeSnapshot(this.db, orgId, input.conversationId, input.runId, maxCaseBytes);
450
471
  const r = await this.insertCase(orgId, actor, setId, snapshot, {
451
472
  sampled: false,
@@ -66,8 +66,7 @@ export interface CaseSnapshot {
66
66
  export declare function takeSnapshot(db: KernelSchemaDb, orgId: string, conversationId: string, runId: string, maxBytes: number): Promise<CaseSnapshot>;
67
67
  /**
68
68
  * Reads a stored snapshot (`eval_cases.snapshot`): each version's definition goes through
69
- * `normalizeStoredDefinition` (rc tool keys, and an enabled tool list read as nothing turned off).
70
- * Other fields as they are.
69
+ * `normalizeStoredDefinition` (missing turned-off lists read as empty). Other fields as they are.
71
70
  */
72
71
  export declare function readSnapshot(raw: unknown): CaseSnapshot;
73
72
  /** 快照事件还原为日志事件(`createdAt` 转回 Date)。 */
@@ -84,7 +84,7 @@ export async function takeSnapshot(db, orgId, conversationId, runId, maxBytes) {
84
84
  }
85
85
  else if (e.type === "model_call") {
86
86
  const req = e.payload.request;
87
- for (const t of [...(req.tools ?? []), ...(req.catalog ?? [])])
87
+ for (const t of [...req.tools, ...(req.catalog ?? [])])
88
88
  hashes.add(t.specHash);
89
89
  }
90
90
  }
@@ -97,7 +97,7 @@ export async function takeSnapshot(db, orgId, conversationId, runId, maxBytes) {
97
97
  .orderBy("version")
98
98
  .execute();
99
99
  for (const r of defRows) {
100
- definitions[String(r.version)] = snapshotDefinition(r.definition);
100
+ definitions[String(r.version)] = normalizeStoredDefinition(r.definition);
101
101
  }
102
102
  const toolSpecs = {};
103
103
  if (hashes.size > 0) {
@@ -151,28 +151,15 @@ export async function takeSnapshot(db, orgId, conversationId, runId, maxBytes) {
151
151
  throw tooLarge();
152
152
  return snapshot;
153
153
  }
154
- /**
155
- * A definition as a snapshot holds it: normalized (`normalizeStoredDefinition`), and one from
156
- * before tools were on by default keeps its enabled list next to it: rc tool keys are read by its
157
- * extension refs (`legacyScopeOf`); the runtime ignores it (tools default-on spec §2).
158
- */
159
- function snapshotDefinition(d) {
160
- const enabled = d?.tools;
161
- return {
162
- ...normalizeStoredDefinition(d),
163
- ...(Array.isArray(enabled) && { tools: enabled }),
164
- };
165
- }
166
154
  /**
167
155
  * Reads a stored snapshot (`eval_cases.snapshot`): each version's definition goes through
168
- * `normalizeStoredDefinition` (rc tool keys, and an enabled tool list read as nothing turned off).
169
- * Other fields as they are.
156
+ * `normalizeStoredDefinition` (missing turned-off lists read as empty). Other fields as they are.
170
157
  */
171
158
  export function readSnapshot(raw) {
172
159
  const s = raw;
173
160
  const definitions = {};
174
161
  for (const [v, d] of Object.entries(s.definitions ?? {})) {
175
- definitions[v] = snapshotDefinition(d);
162
+ definitions[v] = normalizeStoredDefinition(d);
176
163
  }
177
164
  return {
178
165
  ...s,
@@ -3,6 +3,7 @@ import { SuperAdminLock } from "../identity/super-admin.js";
3
3
  import { KernelConfigService } from "../infra/config/kernel-config.service.js";
4
4
  import { KernelDb } from "../infra/database/kernel-db.js";
5
5
  import { TransactionHost } from "../infra/database/transaction-host.js";
6
+ import { OutboxService } from "../infra/outbox/outbox.service.js";
6
7
  import type { KernelLogger } from "../log.js";
7
8
  import { OrgLock } from "../orgs/org-lock.js";
8
9
  import { ExtensionAdmin, type PublishBus } from "./admin-view.js";
@@ -73,6 +74,8 @@ export declare class ExtensionAdminOps {
73
74
  private readonly log;
74
75
  /** One enabled provider per single-provider extension point (checked in the enable). */
75
76
  private readonly singleProvider;
77
+ /** The plugin scope sync a deploy owes (`oweDeployedExtensionSync`). */
78
+ private readonly outbox;
76
79
  constructor(kdb: KernelDb, txHost: TransactionHost,
77
80
  /** The super admin lock (identity/super-admin.ts): joins the transaction. */
78
81
  adminLock: SuperAdminLock,
@@ -97,7 +100,9 @@ export declare class ExtensionAdminOps {
97
100
  */
98
101
  lifecycle: ExtensionLifecycle, log: KernelLogger,
99
102
  /** One enabled provider per single-provider extension point (checked in the enable). */
100
- singleProvider: SingleProviderGuard);
103
+ singleProvider: SingleProviderGuard,
104
+ /** The plugin scope sync a deploy owes (`oweDeployedExtensionSync`). */
105
+ outbox: Pick<OutboxService, "add">);
101
106
  private get db();
102
107
  /**
103
108
  * New install or version change (upgrade / downgrade): the install record points at package
@@ -11,6 +11,7 @@ import { SDK_VERSION } from "@capybara-hq/plugin-sdk";
11
11
  import { Inject, Injectable } from "@nestjs/common";
12
12
  import { sql } from "kysely";
13
13
  import semver from "semver";
14
+ import { oweDeployedExtensionSync } from "../catalog/scope-jobs.js";
14
15
  import { pluginSchemaName } from "../ctx/create-ctx.js";
15
16
  import { ApiError } from "../errors.js";
16
17
  import { audit } from "../identity/audit.js";
@@ -20,6 +21,7 @@ import { afterCommit } from "../infra/database/after-commit.js";
20
21
  import { KernelDb } from "../infra/database/kernel-db.js";
21
22
  import { TransactionHost } from "../infra/database/transaction-host.js";
22
23
  import { Transactional } from "../infra/database/transactional.decorator.js";
24
+ import { OutboxService } from "../infra/outbox/outbox.service.js";
23
25
  import { KERNEL_BUS, KERNEL_LOGGER } from "../infra/tokens.js";
24
26
  import { OrgLock } from "../orgs/org-lock.js";
25
27
  import { ExtensionAdmin } from "./admin-view.js";
@@ -44,6 +46,7 @@ let ExtensionAdminOps = class ExtensionAdminOps {
44
46
  lifecycle;
45
47
  log;
46
48
  singleProvider;
49
+ outbox;
47
50
  constructor(kdb, txHost,
48
51
  /** The super admin lock (identity/super-admin.ts): joins the transaction. */
49
52
  adminLock,
@@ -68,7 +71,9 @@ let ExtensionAdminOps = class ExtensionAdminOps {
68
71
  */
69
72
  lifecycle, log,
70
73
  /** One enabled provider per single-provider extension point (checked in the enable). */
71
- singleProvider) {
74
+ singleProvider,
75
+ /** The plugin scope sync a deploy owes (`oweDeployedExtensionSync`). */
76
+ outbox) {
72
77
  this.kdb = kdb;
73
78
  this.txHost = txHost;
74
79
  this.adminLock = adminLock;
@@ -82,6 +87,7 @@ let ExtensionAdminOps = class ExtensionAdminOps {
82
87
  this.lifecycle = lifecycle;
83
88
  this.log = log;
84
89
  this.singleProvider = singleProvider;
90
+ this.outbox = outbox;
85
91
  }
86
92
  get db() {
87
93
  return this.kdb.db;
@@ -136,8 +142,7 @@ let ExtensionAdminOps = class ExtensionAdminOps {
136
142
  throw new ApiError("extension.name_mismatch", `Package ${sha256} contains extension ${pkg.name}, not ${name}`);
137
143
  }
138
144
  // The downgrade check needs the target package's migration files: read and parse the package
139
- // outside the transaction (inside it only _migrations is compared). A stored package in the
140
- // pre-0.1.0 format -> extension.legacy_format.
145
+ // outside the transaction (inside it only _migrations is compared).
141
146
  const target = await readExtensionPackage(await this.blobs.get(sha256), {
142
147
  maxBytes: this.config.get().packages.maxBytes,
143
148
  hostSdkVersion: SDK_VERSION,
@@ -282,6 +287,9 @@ let ExtensionAdminOps = class ExtensionAdminOps {
282
287
  afterCommit(() => this.notify(name));
283
288
  if (leftDisabled !== undefined)
284
289
  return { changed: true, state: "disabled", leftDisabled };
290
+ // A new version of an enabled extension is a deploy: it owes its plugin's scope sync
291
+ if (row?.desired_state === "enabled")
292
+ await oweDeployedExtensionSync(this.outbox, db, name);
285
293
  return { changed: true, state: row?.desired_state ?? "disabled" };
286
294
  }
287
295
  /**
@@ -393,6 +401,10 @@ let ExtensionAdminOps = class ExtensionAdminOps {
393
401
  .execute();
394
402
  await this.audit(actor, actorTokenId, state === "enabled" ? "extension.enabled" : "extension.disabled", name, row.version, row.sha256, { ...ownerDetail(owner), ...auditDetail });
395
403
  afterCommit(() => this.notify(name));
404
+ // The enable is the deploy: it owes its plugin's scope sync, which installs it where its scope
405
+ // wants it on (a replica that has not loaded it yet retries)
406
+ if (state === "enabled")
407
+ await oweDeployedExtensionSync(this.outbox, db, name);
396
408
  return { row, changed: true };
397
409
  }
398
410
  /**
@@ -503,7 +515,8 @@ ExtensionAdminOps = __decorate([
503
515
  __param(9, Inject(KERNEL_BUS)),
504
516
  __param(10, Inject(ExtensionLifecycle)),
505
517
  __param(11, Inject(KERNEL_LOGGER)),
506
- __param(12, Inject(SingleProviderGuard))
518
+ __param(12, Inject(SingleProviderGuard)),
519
+ __param(13, Inject(OutboxService))
507
520
  ], ExtensionAdminOps);
508
521
  export { ExtensionAdminOps };
509
522
  /**
@@ -2,6 +2,7 @@ import { SuperAdminLock } from "../identity/super-admin.js";
2
2
  import { KernelConfigService } from "../infra/config/kernel-config.service.js";
3
3
  import { KernelDb } from "../infra/database/kernel-db.js";
4
4
  import { TransactionHost } from "../infra/database/transaction-host.js";
5
+ import { OutboxService } from "../infra/outbox/outbox.service.js";
5
6
  import type { KernelLogger } from "../log.js";
6
7
  import { ExtensionApprovals } from "./approvals.js";
7
8
  import { ExtensionBlobs } from "./blobs.js";
@@ -55,6 +56,8 @@ export declare class ExtensionAdmin {
55
56
  private readonly singleProvider;
56
57
  /** The plugins' icons (admin catalog routes). */
57
58
  private readonly icons;
59
+ /** The plugin scope sync an approval of an enabled extension owes. */
60
+ private readonly outbox;
58
61
  private readonly packageSets;
59
62
  constructor(kdb: KernelDb, txHost: TransactionHost,
60
63
  /** The super admin lock (identity/super-admin.ts): joins the transaction. */
@@ -70,7 +73,9 @@ export declare class ExtensionAdmin {
70
73
  /** Which enabled extension keeps a disabled one from being enabled (`enableBlocked`). */
71
74
  singleProvider: SingleProviderGuard,
72
75
  /** The plugins' icons (admin catalog routes). */
73
- icons: PluginIcons);
76
+ icons: PluginIcons,
77
+ /** The plugin scope sync an approval of an enabled extension owes. */
78
+ outbox: Pick<OutboxService, "add">);
74
79
  private get db();
75
80
  /**
76
81
  * Every extension (config-declared, then install records, each by name). With `names`, only
@@ -82,9 +87,7 @@ export declare class ExtensionAdmin {
82
87
  * A single extension; unknown -> `extension.not_found`; package unreadable ->
83
88
  * `extension.package_unavailable`. With `allowUnreadable` an unreadable package returns the same
84
89
  * degraded item as {@link list} (status failed, with `error`): used after a write has committed, so
85
- * an operation that took effect is not reported as failed. A package in the pre-0.1.0 format is
86
- * a state, not an error: it always returns the item with status `legacy_format` (so the admin can
87
- * see it and uninstall it).
90
+ * an operation that took effect is not reported as failed.
88
91
  */
89
92
  get(name: string, opts?: {
90
93
  allowUnreadable?: boolean;