@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,4 +1,5 @@
1
1
  import { createCipheriv, createDecipheriv, createHash, hkdfSync, randomBytes } from "node:crypto";
2
+ import { sql } from "kysely";
2
3
  import { assertNamespace } from "./namespace.js";
3
4
  const IV_LEN = 12;
4
5
  const TAG_LEN = 16;
@@ -142,38 +143,104 @@ export function createSecrets(db, keyring, namespace) {
142
143
  },
143
144
  };
144
145
  }
146
+ /** Rows rewrapped per transaction by default. */
147
+ export const REWRAP_BATCH_SIZE = 500;
148
+ /** The AAD binding a sealed initial password to its account (a row moved to another one fails). */
149
+ export const initialPasswordAad = (accountId) => `capybara:initial-password:${accountId}`;
150
+ const MASTER_KEYED = [
151
+ {
152
+ table: "org_data_keys",
153
+ idColumn: "org_id",
154
+ dataColumn: "wrapped_key",
155
+ aad: dekAad,
156
+ hasExpiresAt: false,
157
+ },
158
+ {
159
+ table: "account_initial_passwords",
160
+ idColumn: "account_id",
161
+ dataColumn: "ciphertext",
162
+ aad: initialPasswordAad,
163
+ hasExpiresAt: true,
164
+ },
165
+ ];
166
+ function staleRows(db, t, keyring) {
167
+ let q = db
168
+ .withSchema("capybara")
169
+ .selectFrom(t.table)
170
+ .where("master_key_id", "!=", keyring.currentId);
171
+ if (t.hasExpiresAt)
172
+ q = q.where("expires_at", ">", sql `now()`);
173
+ return q;
174
+ }
175
+ function assertKnown(t, keyring, rows) {
176
+ const unknown = rows.filter((r) => !keyring.has(r.mk));
177
+ if (unknown.length === 0)
178
+ return;
179
+ const shown = unknown.slice(0, 20).map((r) => `${r.id}(master_key_id=${r.mk})`);
180
+ throw new Error(`secrets: master key not in keyring for ${t.table}.${t.idColumn}: ${shown.join(", ")}`);
181
+ }
145
182
  /**
146
- * 把非当前主密钥包装的数据密钥改用当前主密钥重新包装,返回处理条数。One transaction over the given
147
- * handles (`KernelDb` + its `TransactionHost`, as `DatabaseModule` provides them).
183
+ * Rewraps everything sealed with a master key other than the keyring's current one (org data keys
184
+ * and unexpired initial passwords) with the current key, `batchSize` rows per transaction, until
185
+ * none is left. Checks first that the keyring holds every master key in use and throws (naming row
186
+ * ids and key ids, never key material) before writing anything when it does not. Idempotent: a
187
+ * second run finds nothing; concurrent runs lock the same rows and skip the ones already done.
148
188
  */
149
- export async function rewrapDataKeys(handles, keyring) {
150
- return handles.txHost.run(async () => {
151
- const trx = handles.db.db;
152
- const rows = await trx
153
- .withSchema("capybara")
154
- .selectFrom("org_data_keys")
155
- .select(["org_id", "wrapped_key", "master_key_id"])
156
- .where("master_key_id", "!=", keyring.currentId)
157
- .orderBy("org_id")
158
- .forUpdate()
189
+ export async function rewrapToCurrentMasterKey(handles, keyring, opts = {}) {
190
+ const batchSize = opts.batchSize ?? REWRAP_BATCH_SIZE;
191
+ if (!Number.isInteger(batchSize) || batchSize < 1) {
192
+ throw new RangeError("rewrap batch size must be a positive integer");
193
+ }
194
+ const db = () => handles.db.db;
195
+ for (const t of MASTER_KEYED) {
196
+ const rows = await staleRows(db(), t, keyring)
197
+ .select([`${t.idColumn} as id`, "master_key_id as mk"])
198
+ .orderBy(t.idColumn)
159
199
  .execute();
160
- const unknown = rows.filter((r) => !keyring.has(r.master_key_id));
161
- if (unknown.length > 0) {
162
- const shown = unknown
163
- .slice(0, 20)
164
- .map((r) => `${r.org_id}(master_key_id=${r.master_key_id})`);
165
- throw new Error(`secrets: master key not in keyring for org_id: ${shown.join(", ")}`);
166
- }
167
- for (const r of rows) {
168
- const dek = keyring.unwrap(r.master_key_id, Buffer.from(r.wrapped_key), dekAad(r.org_id));
169
- const w = keyring.wrap(dek, dekAad(r.org_id));
170
- await trx
171
- .withSchema("capybara")
172
- .updateTable("org_data_keys")
173
- .set({ wrapped_key: w.data, master_key_id: w.masterKeyId })
174
- .where("org_id", "=", r.org_id)
175
- .execute();
200
+ assertKnown(t, keyring, rows);
201
+ }
202
+ const counts = new Map();
203
+ for (const t of MASTER_KEYED) {
204
+ let total = 0;
205
+ for (;;) {
206
+ const done = await handles.txHost.run(async () => {
207
+ const trx = db();
208
+ const rows = await staleRows(trx, t, keyring)
209
+ .select([`${t.idColumn} as id`, "master_key_id as mk", `${t.dataColumn} as data`])
210
+ .orderBy(t.idColumn)
211
+ .limit(batchSize)
212
+ .forUpdate()
213
+ .execute();
214
+ // a row written meanwhile by a replica that runs an older config
215
+ assertKnown(t, keyring, rows);
216
+ for (const r of rows) {
217
+ let plain;
218
+ try {
219
+ plain = keyring.unwrap(r.mk, Buffer.from(r.data), t.aad(r.id));
220
+ }
221
+ catch (e) {
222
+ const why = e instanceof Error ? e.message : String(e);
223
+ throw new Error(`secrets: cannot unwrap ${t.table}.${t.idColumn}=${r.id}: ${why}`);
224
+ }
225
+ const w = keyring.wrap(plain, t.aad(r.id));
226
+ plain.fill(0);
227
+ await trx
228
+ .withSchema("capybara")
229
+ .updateTable(t.table)
230
+ .set({ [t.dataColumn]: w.data, master_key_id: w.masterKeyId })
231
+ .where(t.idColumn, "=", r.id)
232
+ .execute();
233
+ }
234
+ return rows.length;
235
+ });
236
+ total += done;
237
+ if (done === 0)
238
+ break;
176
239
  }
177
- return rows.length;
178
- });
240
+ counts.set(t.table, total);
241
+ }
242
+ return {
243
+ dataKeys: counts.get("org_data_keys") ?? 0,
244
+ initialPasswords: counts.get("account_initial_passwords") ?? 0,
245
+ };
179
246
  }
@@ -1294,8 +1294,16 @@ export interface ScheduledTaskGrantsTable {
1294
1294
  connector_id: string | null;
1295
1295
  created_at: Ts;
1296
1296
  }
1297
+ /** 0001: the per-org data key, wrapped by the master key (ctx/secrets.ts reads it untyped). */
1298
+ export interface OrgDataKeysTable {
1299
+ org_id: string;
1300
+ wrapped_key: Buffer;
1301
+ master_key_id: string;
1302
+ created_at: Ts;
1303
+ }
1297
1304
  export interface KernelDatabase {
1298
1305
  accounts: AccountsTable;
1306
+ org_data_keys: OrgDataKeysTable;
1299
1307
  account_initial_passwords: AccountInitialPasswordsTable;
1300
1308
  identities: IdentitiesTable;
1301
1309
  local_passwords: LocalPasswordsTable;
@@ -1531,7 +1539,7 @@ export interface CatalogItemsTable {
1531
1539
  builtin: ColumnType<boolean, boolean | undefined, boolean>;
1532
1540
  /** 0075: switched off for every org by the super admin. */
1533
1541
  disabled: ColumnType<boolean, boolean | undefined, boolean>;
1534
- /** 0075: bumped on every scope change. */
1542
+ /** 0075: unused since design review 2026-11-16; dropped by a later contract migration. */
1535
1543
  scope_version: ColumnType<number, number | undefined, number>;
1536
1544
  /** 0077: orgs outside a `named` item's list see it as requestable (never usable). */
1537
1545
  shown_to_others: ColumnType<boolean, boolean | undefined, boolean>;
@@ -1572,6 +1580,7 @@ interface PlatformScopeColumns {
1572
1580
  scope: Dflt<ComponentScope>;
1573
1581
  disabled: Dflt<boolean>;
1574
1582
  shown_to_others: Dflt<boolean>;
1583
+ /** Unused since design review 2026-11-16; dropped by a later contract migration. */
1575
1584
  scope_version: Dflt<number>;
1576
1585
  }
1577
1586
  /** 0081: a skill owned by the deployment (ruling A2). */
@@ -1894,20 +1903,22 @@ export interface CatalogOrgGrantsTable {
1894
1903
  granted_by: string | null;
1895
1904
  granted_at: Generated<Date>;
1896
1905
  }
1897
- /** 0037:应用在组织里的安装。 */
1906
+ /** 0049 / 0138: the states of a plugin install (`LIVE_INSTALL_STATUSES` are the live ones). */
1907
+ export type PluginInstallStatus = "installing" | "installed" | "failed" | "uninstalling";
1908
+ /** 0037: a plugin's install in an org. */
1898
1909
  export interface PluginInstallsTable {
1899
1910
  id: string;
1900
1911
  org_id: string;
1901
1912
  item_id: string;
1902
1913
  version: string;
1903
- /** 0049: `upgrading` while an in-place upgrade runs. */
1904
- status: "installing" | "installed" | "failed" | "uninstalling" | "upgrading";
1914
+ /** 0138 dropped 0049's `upgrading` (no per-org upgrade since ruling F2). */
1915
+ status: PluginInstallStatus;
1905
1916
  installed_by: string | null;
1906
1917
  installed_at: Generated<Date>;
1907
1918
  error: ColumnType<unknown, string | null | undefined, string | null>;
1908
1919
  /**
1909
- * 0049: the journal of the running upgrade, `{ id, from, to, startedAt, done }` with `done` the
1910
- * `UpgradeStep`s of catalog/plugin-install.ts (read by `journalEntries`); null otherwise.
1920
+ * 0049: the journal of a per-org upgrade. Unused since 0138 (no code reads or writes it, every
1921
+ * row null); kept for the replicas of the previous release, dropped by a later migration.
1911
1922
  */
1912
1923
  upgrade: ColumnType<unknown, string | null | undefined, string | null>;
1913
1924
  }
package/dist/errors.d.ts CHANGED
@@ -61,7 +61,6 @@ export declare const ERROR_CODES: {
61
61
  readonly "extension.has_dependents": 409;
62
62
  readonly "extension.not_enabled": 409;
63
63
  readonly "extension.package_invalid": 400;
64
- readonly "extension.legacy_format": 422;
65
64
  readonly "extension.no_extension": 400;
66
65
  readonly "extension.package_too_large": 413;
67
66
  readonly "extension.config_declared": 409;
@@ -89,7 +88,6 @@ export declare const ERROR_CODES: {
89
88
  readonly "bootstrap.download_failed": 502;
90
89
  readonly "bootstrap.missing_file": 500;
91
90
  readonly "catalog.invalid_manifest": 422;
92
- readonly "catalog.legacy_format": 422;
93
91
  readonly "catalog.no_extension": 409;
94
92
  readonly "catalog.dependency_unresolved": 409;
95
93
  readonly "catalog.dependency_disabled": 409;
@@ -303,6 +301,11 @@ export declare const ERROR_CODES: {
303
301
  readonly "connector.resources_disabled": 409;
304
302
  /** Per-member tool policies on a connector with one org credential (decision 2026-11-09). */
305
303
  readonly "connector.not_personal": 409;
304
+ /**
305
+ * Loosening a connector's default git push policy through the Platform tool or an API token:
306
+ * only a person in a session widens it.
307
+ */
308
+ readonly "connector.git_push_widen_not_allowed": 400;
306
309
  readonly "approval.not_found": 404;
307
310
  readonly "approval.already_decided": 409;
308
311
  readonly "approval.scope_not_allowed": 409;
package/dist/errors.js CHANGED
@@ -61,7 +61,6 @@ export const ERROR_CODES = {
61
61
  "extension.has_dependents": 409,
62
62
  "extension.not_enabled": 409,
63
63
  "extension.package_invalid": 400,
64
- "extension.legacy_format": 422,
65
64
  "extension.no_extension": 400,
66
65
  "extension.package_too_large": 413,
67
66
  "extension.config_declared": 409,
@@ -89,7 +88,6 @@ export const ERROR_CODES = {
89
88
  "bootstrap.download_failed": 502,
90
89
  "bootstrap.missing_file": 500,
91
90
  "catalog.invalid_manifest": 422,
92
- "catalog.legacy_format": 422,
93
91
  "catalog.no_extension": 409,
94
92
  "catalog.dependency_unresolved": 409,
95
93
  "catalog.dependency_disabled": 409,
@@ -303,6 +301,11 @@ export const ERROR_CODES = {
303
301
  "connector.resources_disabled": 409,
304
302
  /** Per-member tool policies on a connector with one org credential (decision 2026-11-09). */
305
303
  "connector.not_personal": 409,
304
+ /**
305
+ * Loosening a connector's default git push policy through the Platform tool or an API token:
306
+ * only a person in a session widens it.
307
+ */
308
+ "connector.git_push_widen_not_allowed": 400,
306
309
  "approval.not_found": 404,
307
310
  "approval.already_decided": 409,
308
311
  "approval.scope_not_allowed": 409,
@@ -13,17 +13,10 @@ import { type CaseSnapshot } from "./snapshot.js";
13
13
  * - `system_hash` / `tools_changed`(只在基线判定):system 指纹、工具序列(tools 与 catalog)与记录不同;
14
14
  * - `tool_spec_missing`:快照里缺某个工具定义(从请求里去掉);
15
15
  * - `definition_missing`:快照里缺该 agent 版本的定义(用空指令);
16
- * - `pinned_changed` (phase B, never for a baseline, not with `definition_missing`): the
17
- * `skills_catalog` snapshot in effect at the call pinned skills (`pinned` non-empty). No candidate
18
- * can pin any more (skills default-on spec §9), so any candidate differs from such a call; the
19
- * request still renders the recorded pinned bodies (Decision 1);
20
16
  * - `subagent_changed` (phase C, never for a baseline): a sub-agent's (child) case with a candidate
21
17
  * whose effective definition differs from the one frozen in its `subagent_started` (see
22
18
  * {@link subagentChanged}); the request still renders the logged definition and preamble. A child
23
- * case never consults `definitions` (no `definition_missing`) and has no `pinned_changed` (a
24
- * logged child definition that pinned counts as `subagent_changed`);
25
- * - `legacy_event`:记录缺 `tools` / `params` / `absorbedUpToSeq` / `maxOutputTokens`,或还原出媒体而记录里没有
26
- * `media` / `mediaBudgetBytes`(较早的事件);
19
+ * case never consults `definitions` (no `definition_missing`);
27
20
  * - `params_changed`:没给候选参数时,记录的参数按所用模型的声明清洗后有键被丢弃或值变了(换了模型或模型声明变了);
28
21
  * - `media_missing`:某附件记录里不是「不再可用」,还原时却取不到;
29
22
  * - `media_changed`(只在基线判定):其余任何媒体结果与记录不同(按附件 id 比 outcome 与 etag:预算省略、
@@ -34,13 +27,8 @@ import { type CaseSnapshot } from "./snapshot.js";
34
27
  */
35
28
  /** 还原结果与原请求不一致的原因。 */
36
29
  export type DriftReason = "system_hash" | "tools_changed" | "tool_spec_missing" | "definition_missing"
37
- /**
38
- * The call rendered pinned skills (phase B), which no candidate has any more (skills default-on
39
- * spec §9).
40
- */
41
- | "pinned_changed"
42
30
  /** A child case's candidate has another effective definition than the logged one (phase C). */
43
- | "subagent_changed" | "legacy_event" | "params_changed"
31
+ | "subagent_changed" | "params_changed"
44
32
  /**
45
33
  * UI refresh B: a non-baseline reconstruction whose run used a person's mid-conversation model
46
34
  * switch (`model_switched`) and whose candidate model (`modelRef`) replaces it.
@@ -66,7 +54,7 @@ export interface ReconstructOptions {
66
54
  /** 附件行信息与字节(调用方按 {@link snapshotMediaRefs} 取);缺省表示都取不到。 */
67
55
  mediaInfo?: ReadonlyMap<string, MediaInfo>;
68
56
  media?: ReadonlyMap<string, MediaBytes | null>;
69
- /** 单次请求的媒体字节预算;缺省用记录的 `mediaBudgetBytes`(较早的事件没有时不限)。 */
57
+ /** The request's media byte budget; defaults to the recorded `mediaBudgetBytes` (recorded only when the request had media). */
70
58
  mediaBudgetBytes?: number;
71
59
  /** The candidate's model (a non-baseline reconstruction): checked against the run's switch. */
72
60
  modelRef?: ModelRef;
@@ -116,8 +104,7 @@ export interface SubagentTemplateRef {
116
104
  * Does a candidate change what a sub-agent (child) case would run (`subagent_changed`, spec
117
105
  * §15.1)? Pure, from the snapshot alone, comparing the model-visible parts of the effective
118
106
  * definition (instructions, turned-off skills, tools) with the logged one (`logged`, from its
119
- * `subagent_started`). A logged definition that pinned skills (`started.definition`, read raw)
120
- * differs from every candidate: none pins any more (skills default-on spec §9).
107
+ * `subagent_started`).
121
108
  * - the same agent version (`sameVersion`): the candidate is the logged definition with
122
109
  * overrides (instructions, model, params), compared field by field;
123
110
  * - another version of the case's agent: for an org agent child (`source: "agent"`) that agent's
@@ -11,17 +11,6 @@ import { CHILD_REMOVED_TOOLS } from "../runtime/subagents/definition.js";
11
11
  import { AGENT_TOOL } from "../tools/builtin-names.js";
12
12
  import { canonicalJson } from "./recorded-tools.js";
13
13
  import { toEvents } from "./snapshot.js";
14
- /**
15
- * Does a definition from before skills were on by default pin skills? Read raw: the normalizer
16
- * drops `skills.pinned` (skills default-on spec §4, §9).
17
- */
18
- const pinsSkills = (d) => {
19
- const skills = typeof d === "object" && d !== null ? d.skills : undefined;
20
- const pinned = typeof skills === "object" && skills !== null
21
- ? skills.pinned
22
- : undefined;
23
- return Array.isArray(pinned) && pinned.length > 0;
24
- };
25
14
  /** `R` when the caller did not resolve the org's settings (the built-in platform default). */
26
15
  const DEFAULT_RESERVE_TOKENS = COMPACTION_SETTINGS.parse({}).reserveTokens;
27
16
  /** Two hard-fit plans trim the same messages and blocks (the recorded plan may be absent). */
@@ -47,9 +36,7 @@ const DRIFT_ORDER = [
47
36
  "tools_changed",
48
37
  "tool_spec_missing",
49
38
  "definition_missing",
50
- "pinned_changed",
51
39
  "subagent_changed",
52
- "legacy_event",
53
40
  "params_changed",
54
41
  "model_switched",
55
42
  "media_missing",
@@ -85,12 +72,6 @@ export function reconstructRequest(s, modelCallSeq, opts) {
85
72
  const call = findCall(all, modelCallSeq);
86
73
  const rec = call.payload.request;
87
74
  const drift = new Set();
88
- if (rec.tools === undefined ||
89
- rec.params === undefined ||
90
- rec.absorbedUpToSeq === undefined ||
91
- rec.maxOutputTokens === undefined) {
92
- drift.add("legacy_event");
93
- }
94
75
  const origVersion = recordedVersion(s, all, call);
95
76
  const version = opts.agentVersion ?? origVersion;
96
77
  const started = subagentStartedOf(all);
@@ -137,22 +118,11 @@ export function reconstructRequest(s, modelCallSeq, opts) {
137
118
  model: { provider: call.payload.provider, model: call.payload.model },
138
119
  });
139
120
  }
140
- // pinned_changed (skills default-on spec §9): the snapshot in effect at the call pinned skills,
141
- // and no candidate pins any more (the migration rewrote the stored versions without pins). The
142
- // stub of definition_missing is no candidate, so it is skipped then; a child reports a logged
143
- // pin as subagent_changed instead.
144
- if (!baseline && started === undefined && !drift.has("definition_missing")) {
145
- const snap = inputEvents(all, call)
146
- .filter((e) => e.type === "skills_catalog")
147
- .at(-1);
148
- if ((snap?.payload.pinned ?? []).length > 0)
149
- drift.add("pinned_changed");
150
- }
151
121
  // 工具:按记录的顺序从快照取定义;取不到的从请求里去掉(基线与候选一样)
152
122
  const tools = [];
153
123
  const seen = new Set();
154
- const kept = (list) => (list ?? []).filter((t) => s.toolSpecs[t.specHash] !== undefined);
155
- for (const t of [...(rec.tools ?? []), ...(rec.catalog ?? [])]) {
124
+ const kept = (list) => list.filter((t) => s.toolSpecs[t.specHash] !== undefined);
125
+ for (const t of [...rec.tools, ...(rec.catalog ?? [])]) {
156
126
  if (seen.has(t.key))
157
127
  continue;
158
128
  seen.add(t.key);
@@ -173,11 +143,11 @@ export function reconstructRequest(s, modelCallSeq, opts) {
173
143
  }
174
144
  let params = opts.params;
175
145
  if (params === undefined) {
176
- const recorded = rec.params ?? {};
177
- const clean = sanitizeParams(opts.model.parameters, recorded);
146
+ const clean = sanitizeParams(opts.model.parameters, rec.params);
178
147
  params = clean.value;
179
- if (clean.dropped.length > 0 || !sameParams(clean.value, recorded))
148
+ if (clean.dropped.length > 0 || !sameParams(clean.value, rec.params)) {
180
149
  drift.add("params_changed");
150
+ }
181
151
  }
182
152
  const budget = opts.mediaBudgetBytes ?? rec.mediaBudgetBytes;
183
153
  const built = assembleModelRequest({
@@ -186,7 +156,7 @@ export function reconstructRequest(s, modelCallSeq, opts) {
186
156
  agentVersion: version,
187
157
  model: opts.model,
188
158
  step: call.payload.step,
189
- ...(rec.absorbedUpToSeq !== undefined && { absorbedUpToSeq: rec.absorbedUpToSeq }),
159
+ absorbedUpToSeq: rec.absorbedUpToSeq,
190
160
  params,
191
161
  tools,
192
162
  toolSearch: rec.catalog !== undefined,
@@ -194,13 +164,11 @@ export function reconstructRequest(s, modelCallSeq, opts) {
194
164
  ...(opts.mediaInfo !== undefined && { mediaInfo: opts.mediaInfo }),
195
165
  ...(opts.media !== undefined && { media: opts.media }),
196
166
  ...(budget !== undefined && { mediaBudgetBytes: budget }),
197
- defaultMaxOutputTokens: rec.maxOutputTokens ?? opts.model.maxOutputTokens,
167
+ defaultMaxOutputTokens: rec.maxOutputTokens,
198
168
  // The baseline replays the recorded output cap as sent: the runtime may have clamped it below
199
169
  // the agent's `maxOutputTokens` knob (context compaction spec §4.3), and recomputing it from the
200
170
  // knob would replay a larger cap. A candidate below recomputes the clamp and the trim instead.
201
- ...(baseline && rec.maxOutputTokens !== undefined
202
- ? { recordedMaxOutputTokens: rec.maxOutputTokens }
203
- : {}),
171
+ ...(baseline && { recordedMaxOutputTokens: rec.maxOutputTokens }),
204
172
  // the baseline replays the recorded trim (no reserve needed); a candidate below recomputes it
205
173
  ...(baseline && rec.fit !== undefined ? { fit: rec.fit } : {}),
206
174
  });
@@ -240,16 +208,12 @@ export function reconstructRequest(s, modelCallSeq, opts) {
240
208
  if (meta.systemHash !== rec.systemHash)
241
209
  drift.add("system_hash");
242
210
  // 与记录比较时排除快照里缺定义的工具(已记 tool_spec_missing)
243
- if (rec.tools !== undefined &&
244
- (!sameList(meta.tools, kept(rec.tools)) ||
245
- !sameList(meta.catalog, rec.catalog === undefined ? undefined : kept(rec.catalog)))) {
211
+ if (!sameList(meta.tools, kept(rec.tools)) ||
212
+ !sameList(meta.catalog, rec.catalog === undefined ? undefined : kept(rec.catalog))) {
246
213
  drift.add("tools_changed");
247
214
  }
248
215
  }
249
216
  // 媒体:按附件 id 与记录比较
250
- if (meta.media !== undefined && (rec.media === undefined || rec.mediaBudgetBytes === undefined)) {
251
- drift.add("legacy_event");
252
- }
253
217
  const recordedMedia = new Map((rec.media ?? []).map((m) => [m.attachmentId, m]));
254
218
  for (const m of meta.media ?? []) {
255
219
  const was = recordedMedia.get(m.attachmentId);
@@ -257,14 +221,13 @@ export function reconstructRequest(s, modelCallSeq, opts) {
257
221
  drift.add("media_missing");
258
222
  }
259
223
  else if (baseline &&
260
- rec.media !== undefined &&
261
224
  (was === undefined || was.outcome !== m.outcome || was.etag !== m.etag)) {
262
225
  drift.add("media_changed");
263
226
  }
264
227
  }
265
- if (baseline && rec.media !== undefined) {
228
+ if (baseline) {
266
229
  const now = new Set((meta.media ?? []).map((m) => m.attachmentId));
267
- if (rec.media.some((m) => !now.has(m.attachmentId)))
230
+ if ((rec.media ?? []).some((m) => !now.has(m.attachmentId)))
268
231
  drift.add("media_changed");
269
232
  }
270
233
  return { request, meta, drift: DRIFT_ORDER.filter((r) => drift.has(r)), mediaTokens };
@@ -314,8 +277,7 @@ const parentSide = (d, started) => canonicalJson({
314
277
  * Does a candidate change what a sub-agent (child) case would run (`subagent_changed`, spec
315
278
  * §15.1)? Pure, from the snapshot alone, comparing the model-visible parts of the effective
316
279
  * definition (instructions, turned-off skills, tools) with the logged one (`logged`, from its
317
- * `subagent_started`). A logged definition that pinned skills (`started.definition`, read raw)
318
- * differs from every candidate: none pins any more (skills default-on spec §9).
280
+ * `subagent_started`).
319
281
  * - the same agent version (`sameVersion`): the candidate is the logged definition with
320
282
  * overrides (instructions, model, params), compared field by field;
321
283
  * - another version of the case's agent: for an org agent child (`source: "agent"`) that agent's
@@ -336,8 +298,6 @@ const parentSide = (d, started) => canonicalJson({
336
298
  export function subagentChanged(started, logged, candidate, sameVersion,
337
299
  /** The parent's definition at the case's version (the snapshot's), for template children. */
338
300
  original) {
339
- if (pinsSkills(started.definition))
340
- return true;
341
301
  const keepAgent = hasAgent(logged);
342
302
  const childTools = (d) => childToolsOf(d, keepAgent);
343
303
  const differs = (instructions, skills, tools) => instructions !== logged.instructions ||
@@ -1,6 +1,5 @@
1
1
  import type { EventLog } from "../conversations/event-log.js";
2
2
  import { type DevicePathsPayload } from "../runtime/context/device-paths.js";
3
- import { type LegacyScope } from "../tools/legacy-keys.js";
4
3
  import { type ToolPipeline, type ToolStepContext } from "../tools/pipeline.js";
5
4
  import type { CaseSnapshot } from "./snapshot.js";
6
5
  /**
@@ -22,8 +21,6 @@ export interface RecordedCall {
22
21
  contentTypes?: string[];
23
22
  /** 原 `tool_call_started` 的定义指纹(没有开始事件的调用为空串)。 */
24
23
  specHash: string;
25
- /** The recorded call used release-candidate names; `toolKey` and `inputKey` are already the current ones. */
26
- legacy?: true;
27
24
  /**
28
25
  * The payload (roots, and the sandbox level when recorded) of the latest `device_paths` event
29
26
  * the original run had logged by this call's step (environments spec §13.1, ruling R22): set on
@@ -33,27 +30,6 @@ export interface RecordedCall {
33
30
  */
34
31
  devicePaths?: DevicePathsPayload;
35
32
  }
36
- /**
37
- * The connectors and extensions an rc `<x>__<tool>` key can name, from positive evidence in the
38
- * snapshot only (a head with no evidence, or evidence of both kinds, stays unmapped, so its
39
- * recorded calls are unmatched, which is a safe miss):
40
- * - a connector: the tool definition the key was recorded with (`toolSpecs`, found by the specHash of
41
- * its `tool_call_started` or its `model_call` tools / catalog entry) has `connectorData`;
42
- * - an extension: that definition exists without `connectorData` and its name is the key's tool
43
- * part, or an rc-era agent definition names exactly that tool as a `{ kind: "plugin", plugin: x, name }`
44
- * ref.
45
- */
46
- export declare function legacyScopeOf(s: CaseSnapshot): LegacyScope;
47
- /**
48
- * A recorded call in the current names: an rc builtin or `<x>__<tool>` key becomes its current
49
- * key with the input's parameters renamed. Only the recorded side is ever normalized; a call
50
- * already in current names (or one that cannot be mapped) is returned as is.
51
- */
52
- export declare function currentCall(name: string, input: unknown, scope: LegacyScope): {
53
- name: string;
54
- input: unknown;
55
- legacy: boolean;
56
- };
57
33
  /** 规范化 JSON:对象键递归按码点排序,数组保持顺序;`undefined` 按 JSON 规则省略。 */
58
34
  export declare function canonicalJson(v: unknown): string;
59
35
  /** The matching key of a call: the canonical JSON of its input without the ignored fields. */
@@ -76,10 +52,7 @@ export declare class RecordedToolPipeline implements Pick<ToolPipeline, "runStep
76
52
  private readonly d;
77
53
  private readonly used;
78
54
  private misses;
79
- private legacyHits;
80
55
  constructor(d: RecordedToolPipelineDeps);
81
- /** Calls so far matched with a recording made under release-candidate tool names. */
82
- legacyMatches(): number;
83
56
  /** 至今没有匹配到记录的调用数。 */
84
57
  unmatched(): number;
85
58
  runStep(ctx: ToolStepContext): Promise<{