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

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 (351) hide show
  1. package/bootstrap.json +5 -5
  2. package/dist/admin/admin.module.d.ts +3 -2
  3. package/dist/admin/admin.module.js +9 -5
  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/org-network.controller.d.ts +30 -0
  11. package/dist/admin/org-network.controller.js +77 -0
  12. package/dist/admin/org-network.schemas.d.ts +16 -0
  13. package/dist/admin/org-network.schemas.js +27 -0
  14. package/dist/admin/org-network.service.d.ts +41 -0
  15. package/dist/admin/org-network.service.js +101 -0
  16. package/dist/admin/outbox-dead.controller.d.ts +4 -6
  17. package/dist/admin/outbox-dead.controller.js +9 -6
  18. package/dist/admin/outbox-dead.schemas.d.ts +16 -0
  19. package/dist/admin/outbox-dead.schemas.js +25 -1
  20. package/dist/admin/outbox-dead.service.d.ts +16 -7
  21. package/dist/admin/outbox-dead.service.js +34 -10
  22. package/dist/admin/overview.service.d.ts +3 -3
  23. package/dist/admin/overview.service.js +0 -1
  24. package/dist/agents/agent-lookup.js +2 -10
  25. package/dist/agents/agents.service.js +9 -20
  26. package/dist/agents/definition.d.ts +3 -51
  27. package/dist/agents/definition.js +4 -254
  28. package/dist/agents/org-templates.js +2 -6
  29. package/dist/agents/readiness.controller.d.ts +4 -12
  30. package/dist/agents/readiness.controller.js +4 -12
  31. package/dist/agents/readiness.service.d.ts +23 -11
  32. package/dist/agents/readiness.service.js +31 -14
  33. package/dist/agents/templates.d.ts +0 -6
  34. package/dist/agents/templates.js +8 -34
  35. package/dist/background/store.d.ts +2 -0
  36. package/dist/background/store.js +3 -1
  37. package/dist/background/wake-rules.js +2 -1
  38. package/dist/catalog/admin-catalog.controller.d.ts +1 -2
  39. package/dist/catalog/admin-catalog.controller.js +1 -2
  40. package/dist/catalog/appearance.service.js +1 -3
  41. package/dist/catalog/catalog-content.d.ts +1 -1
  42. package/dist/catalog/catalog-content.js +1 -4
  43. package/dist/catalog/catalog-items.js +3 -3
  44. package/dist/catalog/catalog-scope.service.d.ts +10 -28
  45. package/dist/catalog/catalog-scope.service.js +22 -73
  46. package/dist/catalog/cli.d.ts +0 -11
  47. package/dist/catalog/cli.js +0 -20
  48. package/dist/catalog/component-scope.service.js +0 -2
  49. package/dist/catalog/component-state.js +2 -2
  50. package/dist/catalog/install-status.d.ts +6 -0
  51. package/dist/catalog/install-status.js +6 -0
  52. package/dist/catalog/job-ids.d.ts +0 -4
  53. package/dist/catalog/job-ids.js +0 -4
  54. package/dist/catalog/marketplaces.service.d.ts +1 -1
  55. package/dist/catalog/org-catalog.service.d.ts +2 -0
  56. package/dist/catalog/org-catalog.service.js +8 -3
  57. package/dist/catalog/org-extension-switch.d.ts +7 -2
  58. package/dist/catalog/org-extension-switch.js +56 -9
  59. package/dist/catalog/org-plugin-uploads.d.ts +6 -15
  60. package/dist/catalog/org-plugin-uploads.js +9 -27
  61. package/dist/catalog/owned-items.js +1 -3
  62. package/dist/catalog/platform-import-update.js +1 -1
  63. package/dist/catalog/plugin-import.d.ts +15 -13
  64. package/dist/catalog/plugin-import.js +21 -30
  65. package/dist/catalog/plugin-install.d.ts +3 -43
  66. package/dist/catalog/plugin-install.js +8 -150
  67. package/dist/catalog/plugin-package.d.ts +5 -10
  68. package/dist/catalog/plugin-package.js +12 -33
  69. package/dist/catalog/plugin-upgrade.js +5 -4
  70. package/dist/catalog/scope-jobs.d.ts +34 -34
  71. package/dist/catalog/scope-jobs.js +50 -37
  72. package/dist/catalog/scope-orgs.d.ts +1 -1
  73. package/dist/catalog/scope-orgs.js +1 -2
  74. package/dist/catalog/scope-sync-workers.d.ts +4 -3
  75. package/dist/catalog/scope-sync-workers.js +18 -6
  76. package/dist/catalog/scope-sync.d.ts +56 -59
  77. package/dist/catalog/scope-sync.js +96 -166
  78. package/dist/catalog/unshare.d.ts +3 -4
  79. package/dist/catalog/unshare.js +5 -8
  80. package/dist/channels/job-ids.d.ts +2 -6
  81. package/dist/channels/job-ids.js +2 -6
  82. package/dist/channels/outbound.d.ts +1 -1
  83. package/dist/channels/outbound.js +1 -1
  84. package/dist/channels/supervisor.d.ts +2 -3
  85. package/dist/channels/supervisor.js +2 -3
  86. package/dist/client/client-access.service.js +1 -1
  87. package/dist/config/env.js +19 -1
  88. package/dist/config/load.d.ts +0 -6
  89. package/dist/config/load.js +8 -27
  90. package/dist/config/schema.d.ts +54 -47
  91. package/dist/config/schema.js +198 -42
  92. package/dist/conversations/attachments.service.d.ts +10 -3
  93. package/dist/conversations/attachments.service.js +49 -16
  94. package/dist/conversations/conversations.controller.d.ts +0 -39
  95. package/dist/conversations/conversations.controller.js +0 -39
  96. package/dist/conversations/event-log.js +4 -1
  97. package/dist/conversations/events.d.ts +71 -46
  98. package/dist/conversations/events.js +124 -112
  99. package/dist/conversations/media-types.d.ts +25 -0
  100. package/dist/conversations/media-types.js +38 -0
  101. package/dist/conversations/queue.d.ts +3 -1
  102. package/dist/conversations/queue.service.js +9 -2
  103. package/dist/conversations/titles.js +6 -0
  104. package/dist/ctx/create-ctx.d.ts +8 -1
  105. package/dist/ctx/create-ctx.js +13 -3
  106. package/dist/ctx/net.d.ts +50 -0
  107. package/dist/ctx/net.js +67 -0
  108. package/dist/ctx/secrets.d.ts +24 -7
  109. package/dist/ctx/secrets.js +97 -30
  110. package/dist/db/kernel-schema.d.ts +27 -6
  111. package/dist/devices/devices.service.js +2 -1
  112. package/dist/errors.d.ts +10 -2
  113. package/dist/errors.js +10 -2
  114. package/dist/evals/reconstruct.d.ts +4 -17
  115. package/dist/evals/reconstruct.js +13 -53
  116. package/dist/evals/recorded-tools.d.ts +0 -27
  117. package/dist/evals/recorded-tools.js +2 -92
  118. package/dist/evals/run-replay.d.ts +1 -6
  119. package/dist/evals/run-replay.js +10 -17
  120. package/dist/evals/sets.service.d.ts +17 -5
  121. package/dist/evals/sets.service.js +33 -12
  122. package/dist/evals/snapshot.d.ts +1 -2
  123. package/dist/evals/snapshot.js +4 -17
  124. package/dist/extensions/admin-ops.d.ts +6 -1
  125. package/dist/extensions/admin-ops.js +17 -4
  126. package/dist/extensions/admin-view.d.ts +7 -4
  127. package/dist/extensions/admin-view.js +27 -21
  128. package/dist/extensions/bootstrap.js +0 -1
  129. package/dist/extensions/cli.js +0 -1
  130. package/dist/extensions/extensions.module.js +3 -0
  131. package/dist/extensions/host.d.ts +9 -4
  132. package/dist/extensions/host.js +14 -8
  133. package/dist/extensions/installs.d.ts +1 -3
  134. package/dist/extensions/instance.d.ts +0 -2
  135. package/dist/extensions/instance.js +0 -3
  136. package/dist/extensions/org-config.d.ts +4 -4
  137. package/dist/extensions/org-config.js +13 -22
  138. package/dist/extensions/package.d.ts +6 -6
  139. package/dist/extensions/package.js +3 -7
  140. package/dist/extensions/permission-view.d.ts +2 -4
  141. package/dist/extensions/plugin-items.d.ts +21 -1
  142. package/dist/extensions/plugin-items.js +28 -0
  143. package/dist/extensions/sync.js +5 -10
  144. package/dist/extensions/unavailable.js +0 -1
  145. package/dist/http/api.module.js +4 -1
  146. package/dist/identity/audit.d.ts +0 -12
  147. package/dist/identity/audit.js +0 -27
  148. package/dist/identity/auth.controller.js +5 -9
  149. package/dist/identity/cookies.d.ts +4 -9
  150. package/dist/identity/cookies.js +8 -32
  151. package/dist/identity/initial-passwords.d.ts +1 -1
  152. package/dist/identity/initial-passwords.js +1 -2
  153. package/dist/identity/sessions.d.ts +0 -6
  154. package/dist/identity/sessions.js +0 -18
  155. package/dist/inbox/platform-inbox.service.d.ts +33 -1
  156. package/dist/inbox/platform-inbox.service.js +56 -6
  157. package/dist/index.d.ts +4 -2
  158. package/dist/index.js +4 -2
  159. package/dist/infra/cli/master-key-rewrap.d.ts +15 -0
  160. package/dist/infra/cli/master-key-rewrap.js +24 -0
  161. package/dist/infra/config/kernel-config.service.js +0 -17
  162. package/dist/infra/database/transaction-host.d.ts +32 -1
  163. package/dist/infra/database/transaction-host.js +30 -4
  164. package/dist/infra/database/xact-lock.d.ts +16 -0
  165. package/dist/infra/database/xact-lock.js +28 -1
  166. package/dist/infra/health/health.controller.js +8 -0
  167. package/dist/infra/health/process-fault.d.ts +16 -0
  168. package/dist/infra/health/process-fault.js +49 -0
  169. package/dist/infra/lifecycle/process-guards.d.ts +8 -2
  170. package/dist/infra/lifecycle/process-guards.js +12 -3
  171. package/dist/infra/lifecycle/shutdown-signals.d.ts +10 -1
  172. package/dist/infra/lifecycle/shutdown-signals.js +28 -13
  173. package/dist/infra/outbox/outbox.service.d.ts +12 -9
  174. package/dist/infra/outbox/outbox.service.js +22 -26
  175. package/dist/infra/outbox/registry.d.ts +15 -7
  176. package/dist/infra/outbox/registry.js +39 -23
  177. package/dist/lifecycle/kernel-lifecycle.js +1 -7
  178. package/dist/models/enablement.d.ts +5 -6
  179. package/dist/models/enablement.js +7 -14
  180. package/dist/net/public-address.d.ts +21 -1
  181. package/dist/net/public-address.js +56 -10
  182. package/dist/net/safe-fetch.d.ts +4 -1
  183. package/dist/net/safe-fetch.js +15 -4
  184. package/dist/orgs/directory-sync.js +2 -0
  185. package/dist/orgs/members.service.js +5 -0
  186. package/dist/orgs/network-allowances.service.d.ts +79 -0
  187. package/dist/orgs/network-allowances.service.js +371 -0
  188. package/dist/orgs/offboarding.d.ts +3 -1
  189. package/dist/orgs/offboarding.js +9 -2
  190. package/dist/orgs/org-lock.d.ts +28 -2
  191. package/dist/orgs/org-lock.js +59 -4
  192. package/dist/orgs/orgs.controller.d.ts +11 -2
  193. package/dist/orgs/orgs.controller.js +19 -3
  194. package/dist/orgs/orgs.module.d.ts +3 -2
  195. package/dist/orgs/orgs.module.js +6 -2
  196. package/dist/orgs/orgs.schemas.d.ts +12 -0
  197. package/dist/orgs/orgs.schemas.js +5 -0
  198. package/dist/orgs/orgs.service.js +6 -1
  199. package/dist/orgs/settings.controller.d.ts +3 -2
  200. package/dist/orgs/settings.service.d.ts +59 -14
  201. package/dist/orgs/settings.service.js +102 -20
  202. package/dist/overrides.d.ts +7 -7
  203. package/dist/overrides.js +4 -4
  204. package/dist/packages/tgz.d.ts +0 -2
  205. package/dist/packages/tgz.js +0 -2
  206. package/dist/platform/exclusions.js +0 -5
  207. package/dist/platform/operation.js +1 -1
  208. package/dist/platform/ops/admin.ops.d.ts +2 -2
  209. package/dist/platform/ops/admin.ops.js +9 -6
  210. package/dist/platform/ops/agents.ops.js +1 -1
  211. package/dist/platform/ops/connectors.ops.js +46 -1
  212. package/dist/platform/ops/evals.ops.js +1 -64
  213. package/dist/platform/ops/extensions-admin.ops.js +1 -1
  214. package/dist/platform/ops/inbox.ops.js +16 -3
  215. package/dist/platform/ops/org-plugins.ops.js +1 -1
  216. package/dist/platform/ops/orgs.ops.d.ts +11 -3
  217. package/dist/platform/ops/orgs.ops.js +139 -5
  218. package/dist/platform/ops/outbox.ops.js +5 -5
  219. package/dist/platform/route-schemas.js +3 -0
  220. package/dist/roles/worker-role.d.ts +2 -3
  221. package/dist/roles/worker-role.js +3 -13
  222. package/dist/runtime/checkpointer.d.ts +3 -0
  223. package/dist/runtime/checkpointer.js +7 -4
  224. package/dist/runtime/context/build.d.ts +56 -18
  225. package/dist/runtime/context/build.js +143 -50
  226. package/dist/runtime/context/compaction.d.ts +1 -3
  227. package/dist/runtime/context/compaction.js +42 -8
  228. package/dist/runtime/context/run-context.js +1 -2
  229. package/dist/runtime/context/skills.d.ts +27 -56
  230. package/dist/runtime/context/skills.js +42 -114
  231. package/dist/runtime/context/tool-changes.d.ts +3 -3
  232. package/dist/runtime/context/tool-changes.js +6 -16
  233. package/dist/runtime/hook-calls.d.ts +6 -6
  234. package/dist/runtime/hook-calls.js +7 -7
  235. package/dist/runtime/langgraph-loop.js +9 -3
  236. package/dist/runtime/maintenance.d.ts +3 -11
  237. package/dist/runtime/maintenance.js +5 -20
  238. package/dist/runtime/model-call.d.ts +5 -0
  239. package/dist/runtime/model-call.js +48 -36
  240. package/dist/runtime/providers.d.ts +33 -35
  241. package/dist/runtime/providers.js +64 -109
  242. package/dist/runtime/run-context.service.js +7 -22
  243. package/dist/runtime/run-deletion.d.ts +6 -0
  244. package/dist/runtime/run-deletion.js +39 -16
  245. package/dist/runtime/run-execution.d.ts +56 -3
  246. package/dist/runtime/run-execution.js +81 -11
  247. package/dist/runtime/run-finish.js +2 -1
  248. package/dist/runtime/run-liveness.d.ts +11 -0
  249. package/dist/runtime/run-liveness.js +19 -0
  250. package/dist/runtime/run-orphan-check.job.js +2 -1
  251. package/dist/runtime/run-queue.js +8 -16
  252. package/dist/runtime/run-worker.d.ts +2 -2
  253. package/dist/runtime/run-worker.js +8 -6
  254. package/dist/runtime/step-log.d.ts +5 -0
  255. package/dist/runtime/step-log.js +9 -4
  256. package/dist/runtime/subagents/definition.d.ts +16 -20
  257. package/dist/runtime/subagents/definition.js +27 -27
  258. package/dist/runtime/subagents/dispatch.d.ts +6 -2
  259. package/dist/runtime/subagents/dispatch.js +17 -3
  260. package/dist/runtime/subagents/org-agents.js +1 -2
  261. package/dist/runtime/subagents/preamble.d.ts +3 -2
  262. package/dist/runtime/subagents/preamble.js +3 -2
  263. package/dist/runtime/subagents/render.d.ts +1 -2
  264. package/dist/runtime/subagents/render.js +1 -2
  265. package/dist/runtime/subagents/skill-fork.d.ts +2 -4
  266. package/dist/runtime/subagents/template-skills.d.ts +47 -0
  267. package/dist/runtime/subagents/template-skills.js +76 -0
  268. package/dist/runtime/waits.js +3 -1
  269. package/dist/schedules/effective-settings.d.ts +9 -3
  270. package/dist/schedules/effective-settings.js +5 -4
  271. package/dist/schedules/fire.js +11 -0
  272. package/dist/schedules/scheduled-tasks.service.js +5 -0
  273. package/dist/schedules/unattended.d.ts +2 -0
  274. package/dist/schedules/unattended.js +6 -1
  275. package/dist/skills/agent-skills.service.js +1 -2
  276. package/dist/skills/catalog.d.ts +1 -3
  277. package/dist/skills/catalog.js +1 -3
  278. package/dist/skills/conversation-catalog.d.ts +1 -2
  279. package/dist/skills/conversation-catalog.js +1 -2
  280. package/dist/skills/usable.js +2 -3
  281. package/dist/storage/storage.service.js +9 -1
  282. package/dist/tools/approvals.service.js +2 -4
  283. package/dist/tools/builtin-names.d.ts +2 -9
  284. package/dist/tools/builtin-names.js +4 -13
  285. package/dist/tools/builtins/sandbox/bash.js +3 -3
  286. package/dist/tools/builtins/sandbox/common.d.ts +7 -13
  287. package/dist/tools/builtins/sandbox/common.js +8 -115
  288. package/dist/tools/builtins/sandbox/fetch-attachment.d.ts +10 -0
  289. package/dist/tools/builtins/sandbox/fetch-attachment.js +119 -0
  290. package/dist/tools/builtins/sandbox/glob.js +1 -3
  291. package/dist/tools/builtins/sandbox/grep.js +3 -5
  292. package/dist/tools/builtins/sandbox/index.d.ts +8 -5
  293. package/dist/tools/builtins/sandbox/index.js +10 -5
  294. package/dist/tools/builtins/sandbox/read.js +3 -2
  295. package/dist/tools/builtins/tool-search.d.ts +4 -7
  296. package/dist/tools/builtins/tool-search.js +6 -10
  297. package/dist/tools/connector-account-policies.d.ts +30 -3
  298. package/dist/tools/connector-account-policies.js +54 -7
  299. package/dist/tools/connector-content.js +1 -0
  300. package/dist/tools/connectors.controller.d.ts +24 -11
  301. package/dist/tools/connectors.controller.js +35 -6
  302. package/dist/tools/connectors.schemas.d.ts +14 -1
  303. package/dist/tools/connectors.schemas.js +14 -2
  304. package/dist/tools/connectors.service.d.ts +22 -0
  305. package/dist/tools/connectors.service.js +65 -6
  306. package/dist/tools/drift.d.ts +6 -2
  307. package/dist/tools/drift.js +10 -5
  308. package/dist/tools/git-push-policy.d.ts +4 -1
  309. package/dist/tools/git-push-policy.js +3 -1
  310. package/dist/tools/info.d.ts +1 -7
  311. package/dist/tools/info.js +5 -18
  312. package/dist/tools/job-ids.d.ts +0 -4
  313. package/dist/tools/job-ids.js +1 -6
  314. package/dist/tools/pipeline.d.ts +4 -10
  315. package/dist/tools/pipeline.js +17 -62
  316. package/dist/tools/policy.d.ts +6 -2
  317. package/dist/tools/policy.js +14 -12
  318. package/dist/tools/registry.js +1 -5
  319. package/dist/ui/views.d.ts +5 -5
  320. package/dist/ui/views.js +10 -16
  321. package/package.json +3 -3
  322. package/src/migrations/0137_audit_org_idx.sql +5 -0
  323. package/src/migrations/0138_plugin_install_status_no_upgrading.sql +18 -0
  324. package/src/migrations/0139_retire_legacy_forms.sql +183 -0
  325. package/src/migrations/0140_retire_history_forms.sql +148 -0
  326. package/src/migrations/0141_install_ledger_promoted_rows.sql +36 -0
  327. package/src/migrations/0142_backfill_event_fields.sql +74 -0
  328. package/src/migrations/0143_backfill_model_call_fields.sql +105 -0
  329. package/src/migrations/0144_retire_frozen_definition_keys.sql +163 -0
  330. package/src/migrations/0145_org_network_allowances.sql +12 -0
  331. package/dist/admin/platform-audit.service.d.ts +0 -41
  332. package/dist/conversations/job-ids.d.ts +0 -6
  333. package/dist/conversations/job-ids.js +0 -6
  334. package/dist/extensions/job-ids.d.ts +0 -6
  335. package/dist/extensions/job-ids.js +0 -6
  336. package/dist/infra/queue/retired-schedulers.d.ts +0 -7
  337. package/dist/infra/queue/retired-schedulers.js +0 -9
  338. package/dist/orgs/job-ids.d.ts +0 -8
  339. package/dist/orgs/job-ids.js +0 -8
  340. package/dist/runtime/context/legacy-text.d.ts +0 -22
  341. package/dist/runtime/context/legacy-text.js +0 -37
  342. package/dist/runtime/job-ids.d.ts +0 -10
  343. package/dist/runtime/job-ids.js +0 -10
  344. package/dist/runtime/retired-schedulers.d.ts +0 -7
  345. package/dist/runtime/retired-schedulers.js +0 -31
  346. package/dist/storage/job-ids.d.ts +0 -6
  347. package/dist/storage/job-ids.js +0 -6
  348. package/dist/tools/legacy-data.d.ts +0 -34
  349. package/dist/tools/legacy-data.js +0 -76
  350. package/dist/tools/legacy-keys.d.ts +0 -51
  351. package/dist/tools/legacy-keys.js +0 -114
@@ -1,6 +1,7 @@
1
1
  import { Annotation, END, START, StateGraph } from "@langchain/langgraph";
2
2
  import { MediaCache } from "./media-cache.js";
3
3
  import { runFinalWrapUp, runModelStep, } from "./model-call.js";
4
+ import { withExclusiveAdmission } from "./run-execution.js";
4
5
  import { budgetRunOf, subagentBudgetUsedUp } from "./subagents/limits.js";
5
6
  import { isForkInvocation } from "./subagents/skill-fork.js";
6
7
  /**
@@ -145,6 +146,7 @@ export class LangGraphLoop {
145
146
  sink: ctx.sink,
146
147
  absorbedUpToSeq,
147
148
  ...(maxSteps !== undefined && { maxSteps }),
149
+ ...(ctx.limits.deadline !== undefined && { deadline: ctx.limits.deadline }),
148
150
  mediaCache,
149
151
  agentId: ctx.agentId,
150
152
  accountId: ctx.triggerAccountId,
@@ -184,7 +186,9 @@ export class LangGraphLoop {
184
186
  // carries the record too, but a child never dispatches.
185
187
  const fork = firstStep && ctx.parent === undefined ? absorbed.find(isForkInvocation) : undefined;
186
188
  if (fork !== undefined && deps.skillForks) {
187
- const r = await deps.skillForks.advance({ ctx, fork });
189
+ const skillForks = deps.skillForks;
190
+ // a dispatch, like a tool step: its writes are admitted exclusively (`RunExecution`)
191
+ const r = await withExclusiveAdmission(() => skillForks.advance({ ctx, fork }));
188
192
  if (r.kind === "suspend")
189
193
  throw new LoopSuspended(r.waitingFor);
190
194
  if (r.kind === "aborted") {
@@ -213,7 +217,9 @@ export class LangGraphLoop {
213
217
  // 本步的全部工具调用都写下结果后才回到 prepare(不在「已记录调用、未记录结果」之间构建请求)。
214
218
  // 某个调用需要等人处理时抛 LoopSuspended(该调用之后的调用留到续跑时处理)。
215
219
  const tools = async (s) => {
216
- const r = await deps.toolPipeline.runStep({
220
+ // the tool step's writes are admitted exclusively, whatever they ask for (`RunExecution`):
221
+ // tools take org-level locks after the conversation rows
222
+ const r = await withExclusiveAdmission(() => deps.toolPipeline.runStep({
217
223
  orgId: ctx.orgId,
218
224
  conversationId: ctx.conversationId,
219
225
  runId: ctx.runId,
@@ -229,7 +235,7 @@ export class LangGraphLoop {
229
235
  ...(ctx.limits.deadline !== undefined && { deadline: ctx.limits.deadline }),
230
236
  ...(ctx.conversationKind !== undefined && { conversationKind: ctx.conversationKind }),
231
237
  ...(ctx.parent !== undefined && { parent: ctx.parent }),
232
- });
238
+ }));
233
239
  if (r.kind === "suspended")
234
240
  throw new LoopSuspended(r.waitingFor);
235
241
  if (ctx.parent !== undefined) {
@@ -1,5 +1,5 @@
1
1
  import { WorkerHost } from "@nestjs/bullmq";
2
- import type { Job, Queue, Worker } from "bullmq";
2
+ import type { Job, Worker } from "bullmq";
3
3
  import { OwnedPluginCleanup } from "../catalog/owned-plugin-cleanup.js";
4
4
  import { ScheduledRuns } from "../infra/schedule/scheduled-runs.js";
5
5
  import type { KernelLogger } from "../log.js";
@@ -42,14 +42,7 @@ export declare class MaintenanceProcessor extends WorkerHost<Worker> {
42
42
  private readonly deviceOps;
43
43
  private readonly scheduled;
44
44
  private readonly log;
45
- private readonly queue;
46
- constructor(waits: Pick<Waits, "processTimeout" | "childFinished" | "stopChildren" | "stopDescendantsOfStopped" | "stopTree">, sandbox: Pick<SandboxService, "destroyDevice" | "resetFileSystem">, drift: Pick<ToolDrift, "check">, directory: Pick<DirectorySync, "runSyncJob">, deletion: Pick<RunDeletion, "stopOrg" | "stopTree">, offboarding: Pick<Offboarding, "stopRun">, runs: Pick<RunQueue, "ensureRun">, ownedCleanup: Pick<OwnedPluginCleanup, "run">, scheduledTasks: Pick<ScheduledTaskFirer, "fire" | "settle">, deviceOps: Pick<DeviceOpResolver, "resolve">, scheduled: Pick<ScheduledRuns, "runNow">, log: Pick<KernelLogger, "error" | "warn">, queue: Pick<Queue, "removeJobScheduler">);
47
- /**
48
- * Removes the retired job schedulers (`RETIRED_SCHEDULER_IDS`, runtime/retired-schedulers.ts): every fixed-period
49
- * maintenance job is a `@LockedCron` / `@LockedInterval` now. Idempotent; called once when a
50
- * worker role starts.
51
- */
52
- removeRetiredSchedulers(): Promise<void>;
45
+ constructor(waits: Pick<Waits, "processTimeout" | "childFinished" | "stopChildren" | "stopDescendantsOfStopped" | "stopTree">, sandbox: Pick<SandboxService, "destroyDevice" | "resetFileSystem">, drift: Pick<ToolDrift, "check">, directory: Pick<DirectorySync, "runSyncJob">, deletion: Pick<RunDeletion, "stopOrg" | "stopTree">, offboarding: Pick<Offboarding, "stopRun">, runs: Pick<RunQueue, "ensureRun">, ownedCleanup: Pick<OwnedPluginCleanup, "run">, scheduledTasks: Pick<ScheduledTaskFirer, "fire" | "settle">, deviceOps: Pick<DeviceOpResolver, "resolve">, scheduled: Pick<ScheduledRuns, "runNow">, log: Pick<KernelLogger, "error" | "warn">);
53
46
  process(job: Job, token?: string): Promise<void>;
54
47
  /** Starts consuming (worker role, after the extensions loaded; built with `autorun: false`). */
55
48
  start(): void;
@@ -60,8 +53,7 @@ export declare class MaintenanceProcessor extends WorkerHost<Worker> {
60
53
  /**
61
54
  * The maintenance queue's consumer: {@link MaintenanceProcessor}. Imported only by the worker role
62
55
  * (`WorkerModule`), so other roles get no processor and no BullMQ worker. It never starts by
63
- * itself: the worker role (`WorkerRole`) removes the retired job schedulers and starts it after the
64
- * extensions loaded.
56
+ * itself: the worker role (`WorkerRole`) starts it after the extensions loaded.
65
57
  */
66
58
  export declare class MaintenanceModule {
67
59
  }
@@ -7,14 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __param = (this && this.__param) || function (paramIndex, decorator) {
8
8
  return function (target, key) { decorator(target, key, paramIndex); }
9
9
  };
10
- import { getQueueToken, OnWorkerEvent, WorkerHost } from "@nestjs/bullmq";
10
+ import { OnWorkerEvent, WorkerHost } from "@nestjs/bullmq";
11
11
  import { Inject, Injectable, Module } from "@nestjs/common";
12
12
  import { BG_WAKE_JOB } from "../background/wake-rules.js";
13
13
  import { OWNED_PLUGIN_CLEANUP_JOB } from "../catalog/job-ids.js";
14
14
  import { OwnedPluginCleanup, OwnedPluginCleanupModule } from "../catalog/owned-plugin-cleanup.js";
15
15
  import { configuredProcessor } from "../infra/queue/configured-processor.js";
16
16
  import { QueueModule } from "../infra/queue/queue.module.js";
17
- import { removeRetiredSchedulers } from "../infra/queue/retired-schedulers.js";
18
17
  import { runJob } from "../infra/queue/run-job.js";
19
18
  import { KernelScheduleModule } from "../infra/schedule/schedule.module.js";
20
19
  import { ScheduledRuns } from "../infra/schedule/scheduled-runs.js";
@@ -33,7 +32,6 @@ import { ToolDrift } from "../tools/drift.js";
33
32
  import { DRIFT_CONNECTOR_JOB } from "../tools/job-ids.js";
34
33
  import { ToolsModule } from "../tools/tools.module.js";
35
34
  import { MAINTENANCE_QUEUE_NAME } from "./maintenance-queue.js";
36
- import { RETIRED_SCHEDULER_IDS } from "./retired-schedulers.js";
37
35
  import { RunDeletion, STOP_DELETED_ORG_JOB } from "./run-deletion.js";
38
36
  import { ENSURE_RUN_JOB, RunQueue } from "./run-queue.js";
39
37
  import { RuntimeModule } from "./runtime.module.js";
@@ -69,8 +67,7 @@ let MaintenanceProcessor = class MaintenanceProcessor extends WorkerHost {
69
67
  deviceOps;
70
68
  scheduled;
71
69
  log;
72
- queue;
73
- constructor(waits, sandbox, drift, directory, deletion, offboarding, runs, ownedCleanup, scheduledTasks, deviceOps, scheduled, log, queue) {
70
+ constructor(waits, sandbox, drift, directory, deletion, offboarding, runs, ownedCleanup, scheduledTasks, deviceOps, scheduled, log) {
74
71
  super();
75
72
  this.waits = waits;
76
73
  this.sandbox = sandbox;
@@ -84,15 +81,6 @@ let MaintenanceProcessor = class MaintenanceProcessor extends WorkerHost {
84
81
  this.deviceOps = deviceOps;
85
82
  this.scheduled = scheduled;
86
83
  this.log = log;
87
- this.queue = queue;
88
- }
89
- /**
90
- * Removes the retired job schedulers (`RETIRED_SCHEDULER_IDS`, runtime/retired-schedulers.ts): every fixed-period
91
- * maintenance job is a `@LockedCron` / `@LockedInterval` now. Idempotent; called once when a
92
- * worker role starts.
93
- */
94
- removeRetiredSchedulers() {
95
- return removeRetiredSchedulers(this.queue, RETIRED_SCHEDULER_IDS);
96
84
  }
97
85
  process(job, token) {
98
86
  return runJob(MAINTENANCE_QUEUE_NAME, job, () => this.dispatch(job, token));
@@ -180,8 +168,7 @@ let MaintenanceProcessor = class MaintenanceProcessor extends WorkerHost {
180
168
  return;
181
169
  // never completed unrun: in a rolling deploy an old worker meets a job a newer replica
182
170
  // owed (its outbox row is gone once added); failing it leaves it to BullMQ's retries, so a
183
- // newer replica can take it within the job's attempts (old workers still go first, see
184
- // docs/deploy/upgrade.md)
171
+ // newer replica can take it within the job's attempts
185
172
  throw new Error(`unknown maintenance job "${job.name}"`);
186
173
  }
187
174
  }
@@ -211,15 +198,13 @@ MaintenanceProcessor = __decorate([
211
198
  __param(8, Inject(ScheduledTaskFirer)),
212
199
  __param(9, Inject(DeviceOpResolver)),
213
200
  __param(10, Inject(ScheduledRuns)),
214
- __param(11, Inject(KERNEL_LOGGER)),
215
- __param(12, Inject(getQueueToken(MAINTENANCE_QUEUE_NAME)))
201
+ __param(11, Inject(KERNEL_LOGGER))
216
202
  ], MaintenanceProcessor);
217
203
  export { MaintenanceProcessor };
218
204
  /**
219
205
  * The maintenance queue's consumer: {@link MaintenanceProcessor}. Imported only by the worker role
220
206
  * (`WorkerModule`), so other roles get no processor and no BullMQ worker. It never starts by
221
- * itself: the worker role (`WorkerRole`) removes the retired job schedulers and starts it after the
222
- * extensions loaded.
207
+ * itself: the worker role (`WorkerRole`) starts it after the extensions loaded.
223
208
  */
224
209
  let MaintenanceModule = class MaintenanceModule {
225
210
  };
@@ -148,6 +148,11 @@ export interface ModelStepInput {
148
148
  * reminder is sent.
149
149
  */
150
150
  maxSteps?: number;
151
+ /**
152
+ * The run's deadline in epoch ms (`LoopContext.limits.deadline`); absent: no deadline. A
153
+ * provider's retry-after is honoured when it fits the time left.
154
+ */
155
+ deadline?: number;
151
156
  }
152
157
  export interface ModelStepResult {
153
158
  content: ContentBlock[];
@@ -51,10 +51,25 @@ export const contextTooLargeText = (model, target, estimate) => `The request is
51
51
  /** 可重试错误在同一模型上重试前的默认等待(供应商未给 retryAfterMs 时)。 */
52
52
  const DEFAULT_RETRY_DELAY_MS = 1000;
53
53
  /**
54
- * 供应商建议等待(retryAfterMs)的上限。超过它就不在同一模型上等待重试,直接切兜底(没有兜底则失败),
55
- * 避免一次运行被「请 10 分钟后再试」之类的建议长时间挂起。
54
+ * Longest provider-suggested wait (retryAfterMs) honoured on the same model. With a run deadline
55
+ * the wait must also fit the time the run has left.
56
56
  */
57
- const MAX_RETRY_AFTER_MS = 10_000;
57
+ const MAX_RETRY_AFTER_MS = 5 * 60_000;
58
+ /**
59
+ * Whether waiting `retryAfterMs` on the same model is allowed, and which limit decided it:
60
+ * the ceiling, or the run's remaining deadline (absent: no deadline, only the ceiling applies).
61
+ */
62
+ function retryAfterDecision(retryAfterMs, deadline) {
63
+ const wait = retryAfterMs ?? 0;
64
+ const remainingMs = deadline === undefined ? undefined : deadline - Date.now();
65
+ if (wait > MAX_RETRY_AFTER_MS)
66
+ return { fits: false, limit: "ceiling", remainingMs };
67
+ // the wait must leave time for the retry itself: a wait that ends at the deadline is no wait
68
+ if (remainingMs !== undefined && wait >= remainingMs) {
69
+ return { fits: false, limit: "deadline", remainingMs };
70
+ }
71
+ return { fits: true, limit: remainingMs === undefined ? "ceiling" : "deadline", remainingMs };
72
+ }
58
73
  /** 读事件日志的分页大小。 */
59
74
  const READ_PAGE = 1000;
60
75
  /**
@@ -492,6 +507,9 @@ export function assembleModelRequest(input) {
492
507
  tools: input.model.capabilities.tools ? [...tools] : [],
493
508
  });
494
509
  const { request } = built;
510
+ // the omission is recorded, so readers never infer it from the reminder text
511
+ if (tools.length > 0 && !input.model.capabilities.tools)
512
+ built.meta.toolsOmitted = true;
495
513
  request.messages = guardToolPairs(request.messages);
496
514
  const knob = request.params.maxOutputTokens;
497
515
  request.maxOutputTokens = Math.min(input.model.maxOutputTokens, typeof knob === "number" ? knob : defaultMaxOutputTokens);
@@ -621,39 +639,25 @@ function consecutiveCompactionFailures(events) {
621
639
  }
622
640
  return n;
623
641
  }
624
- /** The step an event of a run belongs to, when its payload names one. */
625
- function stepOf(e) {
626
- const step = e.payload.step;
627
- return typeof step === "number" ? step : undefined;
628
- }
629
642
  /**
630
643
  * The ordinal of the next compaction of this run's `step`: 1 + the `compaction_summary` /
631
644
  * `compaction_failed` events the step already wrote (context compaction spec §4.4, revision
632
645
  * 2026-11-15). It keys the compaction's events (summary, failure, usage, hook denial), so every
633
646
  * compaction of a step writes its own, while a crash-retried compaction (nothing written yet) gets
634
- * the same keys again. Outcome events record their step, so they are counted by it. Older ones
635
- * have none: a run's step N compacts after every event of its earlier steps, so those are counted
636
- * from the run's last event of an earlier step on. The backoff keeps counting consecutive failures
647
+ * the same keys again. The backoff keeps counting consecutive failures
637
648
  * ({@link consecutiveCompactionFailures}).
638
649
  */
639
650
  function compactionOrdinal(events, runId, step) {
640
651
  let recorded = 0;
641
- let legacy = 0;
642
652
  for (const e of events) {
643
653
  if (e.runId !== runId)
644
654
  continue;
645
- const of = stepOf(e);
646
- if (e.type === "compaction_summary" || e.type === "compaction_failed") {
647
- if (of === undefined)
648
- legacy++;
649
- else if (of === step)
650
- recorded++;
655
+ if (e.type !== "compaction_summary" && e.type !== "compaction_failed")
651
656
  continue;
652
- }
653
- if (of !== undefined && of < step)
654
- legacy = 0;
657
+ if (e.payload.step === step)
658
+ recorded++;
655
659
  }
656
- return recorded + legacy + 1;
660
+ return recorded + 1;
657
661
  }
658
662
  /** Estimated input tokens of a plain text (a user message's only content). */
659
663
  function textTokens(text) {
@@ -1069,12 +1073,15 @@ async function mergeWritten(eventLog, conversationId, events, written) {
1069
1073
  return out.sort((a, b) => a.seq - b.seq);
1070
1074
  }
1071
1075
  /**
1072
- * 降级梯子:主模型 → 主模型重试一次(等 `retryAfterMs ?? 1000`,可被中止)→ `agent.fallback`(若有)。
1073
- * 建议等待超过 `MAX_RETRY_AFTER_MS` 时跳过同模型重试。
1074
- * 每次尝试解析出模型后、写 `model_call` 之前写本步的尾部提醒(均按本步幂等,只写一次):所用模型不支持工具而本步有工具
1075
- * → {@link TOOLS_UNSUPPORTED_REMINDER};然后是轮次提醒或收尾提醒(收尾提醒因此位于请求末尾)。
1076
- * 每次实际尝试写自己的 `model_call`(attempt 从 1 连续递增,跳过的不计);重试前经 sink 发 `step_reset`。
1077
- * 不可重试的失败或梯子用尽 → `RunError`; except that the agent's own model failing to resolve as
1076
+ * The degradation ladder: the main model -> one retry of the main model (waiting
1077
+ * `retryAfterMs ?? 1000`, abortable) -> `agent.fallback` (when set). The same-model retry is
1078
+ * skipped when the suggested wait does not fit the run's remaining time or exceeds
1079
+ * `MAX_RETRY_AFTER_MS`. After each attempt resolves its model and before it writes `model_call`,
1080
+ * the step's trailing reminders are written (each idempotent per step, written once): the model has
1081
+ * no tool support while the step has tools -> {@link TOOLS_UNSUPPORTED_REMINDER}; then the turn
1082
+ * reminder or the wrap-up reminder (which therefore ends the request). Every real attempt writes
1083
+ * its own `model_call` (attempt counts up from 1, skipped ones not counted); a retry first sends
1084
+ * `step_reset` through the sink. A non-retryable failure or an exhausted ladder -> `RunError`; except that the agent's own model failing to resolve as
1078
1085
  * `agent.model_unavailable` (gone from the list, disabled since the agent was saved, its provider
1079
1086
  * not configured in the org: spec B §5.3) goes straight to `agent.fallback` when there is one,
1080
1087
  * without the same-model retry.
@@ -1109,14 +1116,19 @@ async function ladder(deps, input, events, runtime, compaction, tools, wrapUpRea
1109
1116
  for (const rung of rungs) {
1110
1117
  if ((mainUnavailable || skipToFallback) && !rung.fallback)
1111
1118
  continue;
1112
- if (last && !rung.fallback && (last.retryAfterMs ?? 0) > MAX_RETRY_AFTER_MS) {
1113
- deps.log.warn("model retry skipped: suggested wait exceeds cap", {
1114
- conversationId,
1115
- runId,
1116
- step,
1117
- retryAfterMs: last.retryAfterMs,
1118
- });
1119
- continue;
1119
+ if (last && !rung.fallback) {
1120
+ const d = retryAfterDecision(last.retryAfterMs, input.deadline);
1121
+ if (!d.fits) {
1122
+ deps.log.warn("model retry skipped: suggested wait exceeds the limit", {
1123
+ conversationId,
1124
+ runId,
1125
+ step,
1126
+ retryAfterMs: last.retryAfterMs,
1127
+ limit: d.limit,
1128
+ ...(d.remainingMs !== undefined && { remainingMs: d.remainingMs }),
1129
+ });
1130
+ continue;
1131
+ }
1120
1132
  }
1121
1133
  // reactive `model.context_overflow` fix-ups, at most one of each per rung (context compaction
1122
1134
  // spec §4.4): media exclusion, forced compaction, then a progressive trim
@@ -1,4 +1,4 @@
1
- import { type EmbedRequest, type EmbedResult, type ExtensionManifest, type ExtensionPointRef, type Logger, type ModelInfo, type ModelKind, type ModelProvider, type ModelProviderV1, type ModelRequest, type ModelStreamEvent } from "@capybara-hq/plugin-sdk";
1
+ import { type EmbedRequest, type EmbedResult, type ExtensionManifest, type ExtensionPointRef, type Logger, type ModelInfo, type ModelKind, type ModelRequest, type ModelStreamEvent } from "@capybara-hq/plugin-sdk";
2
2
  import type { Redis } from "ioredis";
3
3
  import type { ModelRef } from "../agents/definition.js";
4
4
  import { ApiError } from "../errors.js";
@@ -91,24 +91,15 @@ export declare class ProviderListError extends ApiError {
91
91
  constructor(provider: string, cause: unknown);
92
92
  }
93
93
  /**
94
- * 把 `model-provider@1` 实现包成 `@2`:
95
- * - `listModels`:`parameters` 由 `capabilities.effort` 推导(为真时只有 effort 旋钮,否则为空);
96
- * an `@1` model is always a chat model: `kind` and `embedding` are dropped (an `@1` provider has
97
- * no `embed`); the per-call options are not passed (an `@1` provider reads `ctx.config`);
98
- * - `stream`:`params.effort` 映射为 `req.effort`,其余参数丢弃(`@1` 没有对应字段);
99
- * 没有 `params.effort` 时保留请求自带的 `effort`;only the signal is passed.
100
- */
101
- export declare function adaptModelProviderV1(impl: ModelProviderV1): ModelProvider;
102
- /**
103
- * 模型供应商注册表:供应商即提供 `model-provider` 能力的插件(以插件名为供应商名)。
104
- * 同时支持 `model-provider@1`(经 {@link adaptModelProviderV1} 适配)与 `@2`;
105
- * 同一插件两者都提供时用 `@2`。
94
+ * The model provider registry: a provider is an extension that provides `model-provider@2` (the
95
+ * provider's name is the plugin's name).
106
96
  *
107
97
  * Org-bound (spec B §5.5, A §6): every list and call is made for an org with the provider's
108
- * effective config there (`EffectiveConfigs.get`), passed as `{ orgId, config }`; a provider whose
109
- * effective config is not valid in the org offers no models there, and neither does one the org
110
- * explicitly turned off (its own extension switch row off, spec A §8; a provider with no switch row
111
- * stays usable). The admin view (no org) lists with the platform config.
98
+ * effective config there (`EffectiveConfigs.get`), passed as `{ orgId, config }`. A provider is on
99
+ * in an org only when the org enabled it, like every other extension (`enabledExtensionsQuery`: the
100
+ * org's switch on, or a required bootstrap plugin); one not enabled there, or whose effective
101
+ * config is not valid there, offers no models there. The admin view (no org) lists with the
102
+ * platform config.
112
103
  *
113
104
  * Each list is validated per model (spec B §5.1): kinds are normalised (absent = `chat`, unknown =
114
105
  * `other`); a chat model failing `assertValidDeclarations`, or an `embedding` model without
@@ -116,7 +107,7 @@ export declare function adaptModelProviderV1(impl: ModelProviderV1): ModelProvid
116
107
  * provider stays usable. Only `chat` and `embedding` models resolve.
117
108
  *
118
109
  * Each list (`@2`-shaped) is cached in Redis (`@Cacheable`, key
119
- * `cache:capk:models:<provider>:v<major>:<plugin version>:<config digest>`, 600 s), never in
110
+ * `cache:capk:models:<provider>:f<format>:<plugin version>:<config digest>`, 600 s), never in
120
111
  * process memory: every replica shares it. The digest is the platform config's for every org that
121
112
  * follows the platform (one shared list), and a per-org digest for an org's own copy.
122
113
  */
@@ -130,26 +121,30 @@ export declare class ProviderRegistry {
130
121
  private readonly log?;
131
122
  /** Overrides `models.listTimeoutMs` (tests). */
132
123
  private readonly listTimeoutOverride?;
133
- constructor(host: ProviderHost, effective: Pick<EffectiveConfigs, "get">, cacheService: CacheService, kv: Redis, config: Pick<KernelConfigService, "get">, enablement: Pick<ModelEnablement, "disabled" | "switchedOff">, log?: Pick<Logger, "warn"> | undefined,
124
+ constructor(host: ProviderHost, effective: Pick<EffectiveConfigs, "get">, cacheService: CacheService, kv: Redis, config: Pick<KernelConfigService, "get">, enablement: Pick<ModelEnablement, "disabled" | "enabledIn">, log?: Pick<Logger, "warn"> | undefined,
134
125
  /** Overrides `models.listTimeoutMs` (tests). */
135
126
  listTimeoutOverride?: number | undefined);
136
- /** `listModels()` 加时限(到时按失败处理,供应商的调用留在后台、结果丢弃)。 */
127
+ /**
128
+ * `listModels()` with a time limit: a timeout counts as a failure; the provider's call runs on in
129
+ * the background and its result is dropped.
130
+ */
137
131
  private listModelsWithTimeout;
138
132
  /**
139
- * Whether at least one model-provider extension is loaded on this replica (enabled, configured,
140
- * set up) with a valid effective config in `orgId`. Read from extension state and the org's
141
- * config only: never calls a vendor, so a provider whose vendor is down still counts (org
142
- * readiness, web-order spec §3.8).
133
+ * Whether a model provider is usable in `orgId` (org readiness, web-order spec §3.8,
134
+ * `ReadinessService`), from extension state, the org's switches and its config only: never calls
135
+ * a vendor, so a provider whose vendor is down still counts. True when a provider loaded on this
136
+ * replica is enabled in `orgId` with a valid effective config there.
143
137
  */
144
138
  hasProvider(orgId: string): Promise<boolean>;
145
- /** 每个插件取一个实现(`@2` 优先),按插件首次出现的顺序;不支持的主版本记 warn 后忽略。 */
139
+ /** One implementation per plugin, in the order plugins first appear; another major is ignored. */
146
140
  private providers;
147
141
  /**
148
142
  * The call options and list digest of `p` for `orgId`, or for the platform when `orgId` is
149
143
  * undefined (the admin view). An org: its effective config (not valid -> `needs_config`); the
150
144
  * platform's digest while it follows the platform, a per-org one for its copy. The platform: its
151
- * own config (a required overridable field left empty -> `org_configured`). `off`: the
152
- * extensions the org explicitly turned off (`ModelEnablement.switchedOff`) -> `switched_off`.
145
+ * own config (a required overridable field left empty -> `org_configured`). `on`: the
146
+ * extensions enabled in the org (`ModelEnablement.enabledIn`); a provider not in it ->
147
+ * `not_enabled`. Unused for the platform.
153
148
  */
154
149
  private target;
155
150
  private models;
@@ -175,18 +170,21 @@ export declare class ProviderRegistry {
175
170
  */
176
171
  catalog(orgId: string): Promise<ProviderStatus[]>;
177
172
  /**
178
- * 每个已安装供应商及其状态(按插件加载顺序),for `orgId` (enabled models only), or the platform
179
- * view when undefined (`/admin/models`: every model, `disabled` from the platform's list only).
173
+ * Every installed provider with its status (in plugin load order), for `orgId` (the providers it enabled, their enabled
174
+ * models only), or the platform view when undefined (`/admin/models`: every model, `disabled`
175
+ * from the platform's list only).
180
176
  * See {@link statuses} for the statuses.
181
177
  */
182
178
  listWithStatus(orgId?: string): Promise<ProviderStatus[]>;
183
179
  /**
184
- * 每个已安装供应商的完整列表与状态,for `orgId` or the platform: 列模型失败(含超过
185
- * `models.listTimeoutMs`)的标 `error`、`models` 为空,不影响其他供应商;列模型失败的在
186
- * {@link LIST_FAILURE_TTL_SECONDS} 秒内不再请求。An org where the provider needs configuration gets
187
- * `error`; the platform view of a provider whose platform config leaves a required overridable
188
- * field empty gets `org_configured`. `error` 只是内核自己的英文说明(不透出上游错误原文,原文记 warn
189
- * 日志)。No disabled list applied.
180
+ * Every installed provider's full list and status, for `orgId` or the platform: a provider whose
181
+ * model listing fails (including passing `models.listTimeoutMs`) gets `error` with empty
182
+ * `models` without affecting the others, and is not asked again for
183
+ * {@link LIST_FAILURE_TTL_SECONDS} seconds. For an org only the providers it enabled are
184
+ * listed (one it did not enable is absent); one that needs configuration there gets `error`. The
185
+ * platform view of a provider whose platform config leaves a required overridable field empty
186
+ * gets `org_configured`. `error` is only the kernel's own English message (the upstream error
187
+ * text is never exposed; it goes to a warn log). No disabled list applied.
190
188
  */
191
189
  private statuses;
192
190
  /**