@capybara-hq/kernel 0.1.0-rc.6 → 0.1.0-rc.8

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 (333) hide show
  1. package/bootstrap.json +27 -3
  2. package/dist/admin/admin.controller.d.ts +8 -72
  3. package/dist/admin/admin.controller.js +21 -46
  4. package/dist/admin/admin.schemas.d.ts +57 -0
  5. package/dist/admin/admin.schemas.js +50 -0
  6. package/dist/admin/extensions.controller.d.ts +10 -0
  7. package/dist/admin/extensions.controller.js +18 -0
  8. package/dist/admin/extensions.schemas.d.ts +7 -0
  9. package/dist/admin/extensions.schemas.js +10 -0
  10. package/dist/admin/limit-defaults.d.ts +20 -0
  11. package/dist/admin/limit-defaults.js +10 -0
  12. package/dist/agents/agent-profile.service.d.ts +7 -5
  13. package/dist/agents/agent-profile.service.js +14 -9
  14. package/dist/agents/agents.controller.d.ts +7 -287
  15. package/dist/agents/agents.controller.js +7 -67
  16. package/dist/agents/agents.schemas.d.ts +389 -0
  17. package/dist/agents/agents.schemas.js +126 -0
  18. package/dist/agents/agents.service.d.ts +13 -5
  19. package/dist/agents/agents.service.js +67 -13
  20. package/dist/agents/definition.d.ts +47 -19
  21. package/dist/agents/definition.js +119 -38
  22. package/dist/agents/from-template.d.ts +2 -2
  23. package/dist/agents/from-template.js +76 -45
  24. package/dist/agents/from-template.service.d.ts +12 -0
  25. package/dist/agents/from-template.service.js +20 -3
  26. package/dist/agents/models.controller.d.ts +1 -2
  27. package/dist/agents/models.controller.js +1 -1
  28. package/dist/agents/org-templates.d.ts +13 -3
  29. package/dist/agents/org-templates.js +69 -28
  30. package/dist/agents/pending-connector-requests.d.ts +2 -0
  31. package/dist/agents/pending-connector-requests.js +1 -1
  32. package/dist/agents/pending-connectors.controller.d.ts +1 -1
  33. package/dist/agents/pending-connectors.controller.js +2 -2
  34. package/dist/agents/pending-connectors.service.d.ts +2 -2
  35. package/dist/agents/pending-connectors.service.js +19 -19
  36. package/dist/agents/profile.d.ts +18 -0
  37. package/dist/agents/profile.js +5 -1
  38. package/dist/agents/templates.controller.d.ts +8 -17
  39. package/dist/agents/templates.controller.js +13 -31
  40. package/dist/agents/templates.schemas.d.ts +20 -0
  41. package/dist/agents/templates.schemas.js +45 -0
  42. package/dist/background/background.controller.js +3 -2
  43. package/dist/background/background.schemas.d.ts +10 -0
  44. package/dist/background/background.schemas.js +16 -0
  45. package/dist/background/tasks.service.d.ts +1 -1
  46. package/dist/background/tasks.service.js +7 -2
  47. package/dist/catalog/admin-catalog.controller.d.ts +4 -57
  48. package/dist/catalog/admin-catalog.controller.js +8 -45
  49. package/dist/catalog/admin-catalog.schemas.d.ts +72 -0
  50. package/dist/catalog/admin-catalog.schemas.js +92 -0
  51. package/dist/catalog/catalog-content.d.ts +12 -2
  52. package/dist/catalog/catalog-scope.service.js +8 -2
  53. package/dist/catalog/catalog.service.d.ts +2 -0
  54. package/dist/catalog/catalog.service.js +3 -0
  55. package/dist/catalog/component-scope.controller.d.ts +3 -65
  56. package/dist/catalog/component-scope.controller.js +3 -56
  57. package/dist/catalog/component-scope.schemas.d.ts +114 -0
  58. package/dist/catalog/component-scope.schemas.js +97 -0
  59. package/dist/catalog/component-scope.service.d.ts +28 -4
  60. package/dist/catalog/component-scope.service.js +55 -3
  61. package/dist/catalog/component-state.d.ts +9 -2
  62. package/dist/catalog/component-state.js +22 -13
  63. package/dist/catalog/marketplaces.controller.d.ts +5 -35
  64. package/dist/catalog/marketplaces.controller.js +6 -34
  65. package/dist/catalog/marketplaces.schemas.d.ts +48 -0
  66. package/dist/catalog/marketplaces.schemas.js +53 -0
  67. package/dist/catalog/marketplaces.service.d.ts +15 -1
  68. package/dist/catalog/marketplaces.service.js +22 -1
  69. package/dist/catalog/org-catalog.controller.d.ts +6 -62
  70. package/dist/catalog/org-catalog.controller.js +12 -66
  71. package/dist/catalog/org-catalog.schemas.d.ts +79 -0
  72. package/dist/catalog/org-catalog.schemas.js +82 -0
  73. package/dist/catalog/org-catalog.service.d.ts +9 -2
  74. package/dist/catalog/org-catalog.service.js +38 -5
  75. package/dist/catalog/org-extension.controller.d.ts +1 -12
  76. package/dist/catalog/org-extension.controller.js +1 -10
  77. package/dist/catalog/org-extension.schemas.d.ts +15 -0
  78. package/dist/catalog/org-extension.schemas.js +22 -0
  79. package/dist/catalog/org-plugin-uploads.controller.d.ts +2 -19
  80. package/dist/catalog/org-plugin-uploads.controller.js +15 -28
  81. package/dist/catalog/org-plugin-uploads.schemas.d.ts +20 -0
  82. package/dist/catalog/org-plugin-uploads.schemas.js +32 -0
  83. package/dist/catalog/owned-items.d.ts +6 -2
  84. package/dist/catalog/owned-items.js +16 -4
  85. package/dist/catalog/platform-components.d.ts +2 -0
  86. package/dist/catalog/platform-components.js +2 -0
  87. package/dist/catalog/plugin-import.js +1 -0
  88. package/dist/catalog/plugin-install.js +1 -1
  89. package/dist/catalog/requests.service.d.ts +2 -1
  90. package/dist/catalog/requests.service.js +6 -2
  91. package/dist/channels/channels.schemas.d.ts +33 -0
  92. package/dist/channels/channels.schemas.js +34 -0
  93. package/dist/channels/connections.controller.d.ts +2 -29
  94. package/dist/channels/connections.controller.js +1 -23
  95. package/dist/channels/connections.service.d.ts +8 -2
  96. package/dist/channels/connections.service.js +23 -5
  97. package/dist/channels/inbound.js +4 -0
  98. package/dist/conversations/conversations.controller.d.ts +16 -37
  99. package/dist/conversations/conversations.controller.js +16 -56
  100. package/dist/conversations/conversations.schemas.d.ts +52 -0
  101. package/dist/conversations/conversations.schemas.js +79 -0
  102. package/dist/conversations/conversations.service.d.ts +9 -1
  103. package/dist/conversations/conversations.service.js +23 -18
  104. package/dist/conversations/events.d.ts +80 -6
  105. package/dist/conversations/events.js +60 -5
  106. package/dist/conversations/message-context.d.ts +28 -0
  107. package/dist/conversations/message-context.js +56 -0
  108. package/dist/conversations/queue.d.ts +2 -1
  109. package/dist/conversations/queue.js +11 -2
  110. package/dist/db/kernel-schema.d.ts +20 -0
  111. package/dist/environments/environments.schemas.d.ts +3 -0
  112. package/dist/environments/environments.schemas.js +14 -0
  113. package/dist/environments/environments.service.d.ts +16 -4
  114. package/dist/environments/environments.service.js +58 -13
  115. package/dist/errors.d.ts +3 -0
  116. package/dist/errors.js +3 -0
  117. package/dist/evals/evals.schemas.d.ts +110 -0
  118. package/dist/evals/evals.schemas.js +107 -0
  119. package/dist/evals/reconstruct.js +18 -11
  120. package/dist/evals/recorded-tools.d.ts +2 -1
  121. package/dist/evals/recorded-tools.js +11 -3
  122. package/dist/evals/run-replay.d.ts +8 -1
  123. package/dist/evals/run-replay.js +13 -0
  124. package/dist/evals/runs.controller.d.ts +2 -57
  125. package/dist/evals/runs.controller.js +1 -42
  126. package/dist/evals/runs.service.d.ts +6 -6
  127. package/dist/evals/runs.service.js +32 -18
  128. package/dist/evals/sets.controller.d.ts +2 -28
  129. package/dist/evals/sets.controller.js +1 -31
  130. package/dist/evals/sets.service.d.ts +7 -7
  131. package/dist/evals/sets.service.js +23 -17
  132. package/dist/evals/snapshot.d.ts +3 -2
  133. package/dist/evals/snapshot.js +17 -4
  134. package/dist/extensions/admin-ops.d.ts +5 -3
  135. package/dist/extensions/admin-ops.js +17 -12
  136. package/dist/extensions/deployment-config.d.ts +16 -1
  137. package/dist/extensions/deployment-config.js +83 -0
  138. package/dist/extensions/extensions.module.js +3 -0
  139. package/dist/extensions/host.d.ts +33 -2
  140. package/dist/extensions/host.js +107 -1
  141. package/dist/extensions/installs.d.ts +5 -0
  142. package/dist/extensions/installs.js +12 -0
  143. package/dist/extensions/org-config.d.ts +17 -2
  144. package/dist/extensions/org-config.js +23 -4
  145. package/dist/extensions/point-defaults.controller.d.ts +2 -8
  146. package/dist/extensions/point-defaults.controller.js +1 -3
  147. package/dist/extensions/point-defaults.d.ts +3 -1
  148. package/dist/extensions/point-defaults.js +4 -2
  149. package/dist/extensions/point-defaults.schemas.d.ts +9 -0
  150. package/dist/extensions/point-defaults.schemas.js +14 -0
  151. package/dist/extensions/unavailable.d.ts +49 -0
  152. package/dist/extensions/unavailable.js +113 -0
  153. package/dist/files/previewers.controller.js +2 -3
  154. package/dist/files/previewers.d.ts +1 -1
  155. package/dist/files/previewers.js +4 -4
  156. package/dist/files/previewers.schemas.d.ts +10 -0
  157. package/dist/files/previewers.schemas.js +9 -0
  158. package/dist/http/api.module.js +2 -0
  159. package/dist/identity/accounts.d.ts +43 -4
  160. package/dist/identity/accounts.js +74 -6
  161. package/dist/identity/auth.guard.js +10 -1
  162. package/dist/identity/cookies.d.ts +6 -0
  163. package/dist/identity/cookies.js +14 -0
  164. package/dist/identity/identity.module.js +3 -0
  165. package/dist/identity/initial-passwords.controller.d.ts +22 -0
  166. package/dist/identity/initial-passwords.controller.js +49 -0
  167. package/dist/identity/initial-passwords.d.ts +61 -0
  168. package/dist/identity/initial-passwords.job.d.ts +16 -0
  169. package/dist/identity/initial-passwords.job.js +46 -0
  170. package/dist/identity/initial-passwords.js +159 -0
  171. package/dist/identity/me.controller.d.ts +12 -0
  172. package/dist/identity/me.controller.js +31 -1
  173. package/dist/identity/me.schemas.d.ts +14 -0
  174. package/dist/identity/me.schemas.js +17 -0
  175. package/dist/identity/principal.d.ts +8 -0
  176. package/dist/identity/principal.js +8 -0
  177. package/dist/identity/settings.d.ts +3 -1
  178. package/dist/identity/settings.js +6 -4
  179. package/dist/inbox/inbox.schemas.d.ts +8 -0
  180. package/dist/inbox/inbox.schemas.js +11 -0
  181. package/dist/inbox/platform-inbox.controller.d.ts +1 -1
  182. package/dist/inbox/platform-inbox.controller.js +2 -2
  183. package/dist/index.d.ts +4 -0
  184. package/dist/index.js +6 -0
  185. package/dist/lifecycle/kernel-lifecycle.js +4 -0
  186. package/dist/models/enablement.d.ts +2 -0
  187. package/dist/models/enablement.js +1 -0
  188. package/dist/models/org-models.schemas.d.ts +8 -0
  189. package/dist/models/org-models.schemas.js +22 -0
  190. package/dist/models/prices.d.ts +3 -1
  191. package/dist/models/prices.js +7 -5
  192. package/dist/models/purposes.d.ts +12 -2
  193. package/dist/models/purposes.js +22 -8
  194. package/dist/orgs/orgs.controller.d.ts +2 -5
  195. package/dist/orgs/orgs.controller.js +3 -6
  196. package/dist/orgs/orgs.schemas.d.ts +8 -0
  197. package/dist/orgs/orgs.schemas.js +16 -0
  198. package/dist/orgs/orgs.service.d.ts +3 -1
  199. package/dist/orgs/orgs.service.js +6 -4
  200. package/dist/orgs/settings.service.d.ts +9 -1
  201. package/dist/orgs/settings.service.js +20 -5
  202. package/dist/overrides.d.ts +4 -0
  203. package/dist/overrides.js +2 -0
  204. package/dist/platform/errors.d.ts +21 -4
  205. package/dist/platform/errors.js +45 -6
  206. package/dist/platform/exclusions.d.ts +2 -3
  207. package/dist/platform/exclusions.js +58 -849
  208. package/dist/platform/method.js +1 -1
  209. package/dist/platform/operation.d.ts +82 -5
  210. package/dist/platform/operation.js +63 -8
  211. package/dist/platform/ops/accounts.ops.d.ts +32 -0
  212. package/dist/platform/ops/accounts.ops.js +291 -0
  213. package/dist/platform/ops/admin.ops.d.ts +36 -0
  214. package/dist/platform/ops/admin.ops.js +389 -0
  215. package/dist/platform/ops/agent-skills.ops.d.ts +24 -0
  216. package/dist/platform/ops/agent-skills.ops.js +226 -0
  217. package/dist/platform/ops/agent-templates.ops.d.ts +4 -1
  218. package/dist/platform/ops/agent-templates.ops.js +194 -14
  219. package/dist/platform/ops/agents.ops.d.ts +19 -1
  220. package/dist/platform/ops/agents.ops.js +481 -58
  221. package/dist/platform/ops/approvals.ops.d.ts +30 -0
  222. package/dist/platform/ops/approvals.ops.js +116 -0
  223. package/dist/platform/ops/background.ops.d.ts +14 -0
  224. package/dist/platform/ops/background.ops.js +134 -0
  225. package/dist/platform/ops/catalog-admin.ops.d.ts +74 -0
  226. package/dist/platform/ops/catalog-admin.ops.js +587 -0
  227. package/dist/platform/ops/channels.ops.d.ts +16 -0
  228. package/dist/platform/ops/channels.ops.js +195 -0
  229. package/dist/platform/ops/components.ops.d.ts +46 -0
  230. package/dist/platform/ops/components.ops.js +853 -0
  231. package/dist/platform/ops/connectors.ops.d.ts +4 -2
  232. package/dist/platform/ops/connectors.ops.js +68 -6
  233. package/dist/platform/ops/conversations.ops.d.ts +30 -0
  234. package/dist/platform/ops/conversations.ops.js +470 -0
  235. package/dist/platform/ops/environments.ops.d.ts +26 -0
  236. package/dist/platform/ops/environments.ops.js +289 -0
  237. package/dist/platform/ops/errors.d.ts +10 -5
  238. package/dist/platform/ops/errors.js +19 -11
  239. package/dist/platform/ops/evals.ops.d.ts +28 -0
  240. package/dist/platform/ops/evals.ops.js +783 -0
  241. package/dist/platform/ops/extensions-admin.ops.d.ts +25 -0
  242. package/dist/platform/ops/extensions-admin.ops.js +344 -0
  243. package/dist/platform/ops/extensions.ops.d.ts +7 -1
  244. package/dist/platform/ops/extensions.ops.js +248 -17
  245. package/dist/platform/ops/inbox.ops.d.ts +25 -0
  246. package/dist/platform/ops/inbox.ops.js +378 -0
  247. package/dist/platform/ops/marketplaces.ops.d.ts +7 -1
  248. package/dist/platform/ops/marketplaces.ops.js +326 -17
  249. package/dist/platform/ops/models.ops.d.ts +25 -0
  250. package/dist/platform/ops/models.ops.js +232 -0
  251. package/dist/platform/ops/org-plugins.ops.d.ts +29 -0
  252. package/dist/platform/ops/org-plugins.ops.js +329 -0
  253. package/dist/platform/ops/org-settings.ops.d.ts +16 -0
  254. package/dist/platform/ops/org-settings.ops.js +102 -0
  255. package/dist/platform/ops/orgs.ops.d.ts +28 -0
  256. package/dist/platform/ops/orgs.ops.js +295 -0
  257. package/dist/platform/ops/other-orgs.d.ts +20 -0
  258. package/dist/platform/ops/other-orgs.js +72 -0
  259. package/dist/platform/ops/platform.ops.d.ts +11 -6
  260. package/dist/platform/ops/platform.ops.js +73 -27
  261. package/dist/platform/ops/plugins.ops.d.ts +10 -8
  262. package/dist/platform/ops/plugins.ops.js +176 -77
  263. package/dist/platform/ops/previewers.ops.d.ts +14 -0
  264. package/dist/platform/ops/previewers.ops.js +109 -0
  265. package/dist/platform/ops/requests.ops.js +57 -19
  266. package/dist/platform/ops/skills.ops.d.ts +5 -1
  267. package/dist/platform/ops/skills.ops.js +129 -11
  268. package/dist/platform/ops/unavailable.d.ts +23 -0
  269. package/dist/platform/ops/unavailable.js +111 -0
  270. package/dist/platform/parity.d.ts +33 -0
  271. package/dist/platform/parity.js +272 -0
  272. package/dist/platform/platform-ops.module.d.ts +32 -0
  273. package/dist/platform/platform-ops.module.js +78 -11
  274. package/dist/platform/route-schemas.d.ts +18 -0
  275. package/dist/platform/route-schemas.js +63 -0
  276. package/dist/roles/worker.module.js +2 -0
  277. package/dist/runtime/context/build.d.ts +2 -0
  278. package/dist/runtime/context/build.js +28 -2
  279. package/dist/runtime/context/compaction.js +10 -1
  280. package/dist/runtime/context/run-context.d.ts +65 -0
  281. package/dist/runtime/context/run-context.js +215 -0
  282. package/dist/runtime/model-call.js +2 -1
  283. package/dist/runtime/providers.js +8 -1
  284. package/dist/runtime/run-context.service.d.ts +65 -0
  285. package/dist/runtime/run-context.service.js +220 -0
  286. package/dist/runtime/run-worker.d.ts +5 -0
  287. package/dist/runtime/run-worker.js +31 -6
  288. package/dist/runtime/runtime.module.js +2 -0
  289. package/dist/runtime/subagents/definition.d.ts +15 -15
  290. package/dist/runtime/subagents/definition.js +46 -115
  291. package/dist/skills/changes.controller.js +2 -1
  292. package/dist/skills/changes.service.d.ts +1 -1
  293. package/dist/skills/changes.service.js +4 -4
  294. package/dist/skills/invocable.controller.d.ts +1 -1
  295. package/dist/skills/invocable.controller.js +2 -2
  296. package/dist/skills/invoke.d.ts +2 -2
  297. package/dist/skills/invoke.js +8 -1
  298. package/dist/skills/skills.controller.d.ts +4 -13
  299. package/dist/skills/skills.controller.js +8 -24
  300. package/dist/skills/skills.schemas.d.ts +48 -0
  301. package/dist/skills/skills.schemas.js +61 -0
  302. package/dist/skills/skills.service.d.ts +11 -1
  303. package/dist/skills/skills.service.js +37 -14
  304. package/dist/time-zone.d.ts +5 -0
  305. package/dist/time-zone.js +19 -0
  306. package/dist/tools/approvals.controller.js +2 -3
  307. package/dist/tools/approvals.schemas.d.ts +21 -0
  308. package/dist/tools/approvals.schemas.js +15 -0
  309. package/dist/tools/builtin-names.d.ts +10 -8
  310. package/dist/tools/builtin-names.js +16 -11
  311. package/dist/tools/builtins/builtin-tools.d.ts +3 -1
  312. package/dist/tools/builtins/builtin-tools.js +15 -3
  313. package/dist/tools/builtins/current-time.d.ts +26 -0
  314. package/dist/tools/builtins/current-time.js +99 -0
  315. package/dist/tools/builtins/platform.d.ts +19 -2
  316. package/dist/tools/builtins/platform.js +105 -16
  317. package/dist/tools/connectors.controller.d.ts +1 -2
  318. package/dist/tools/connectors.controller.js +1 -4
  319. package/dist/tools/connectors.schemas.d.ts +12 -0
  320. package/dist/tools/connectors.schemas.js +19 -0
  321. package/dist/tools/connectors.service.d.ts +5 -2
  322. package/dist/tools/connectors.service.js +7 -5
  323. package/dist/tools/org-tool-switches.d.ts +16 -2
  324. package/dist/tools/org-tool-switches.js +26 -9
  325. package/dist/tools/pipeline.js +3 -1
  326. package/dist/tools/registry.d.ts +48 -51
  327. package/dist/tools/registry.js +222 -233
  328. package/package.json +3 -3
  329. package/src/migrations/0090_initial_passwords.sql +27 -0
  330. package/src/migrations/0091_account_time_zone.sql +4 -0
  331. package/src/migrations/0092_tools_default_on.sql +27 -0
  332. package/dist/platform/redact-orgs.d.ts +0 -7
  333. package/dist/platform/redact-orgs.js +0 -52
@@ -223,16 +223,26 @@ let ModelPurposesService = class ModelPurposesService {
223
223
  if (issues.length > 0)
224
224
  throw invalid(issues);
225
225
  }
226
- async set(orgId, purpose, target, actor, actorTokenId) {
226
+ async set(orgId, purpose, target, actor, actorTokenId, auditDetail) {
227
227
  const decl = this.find(purpose);
228
228
  if (target)
229
229
  await this.check(orgId, target, decl.kind);
230
- await this.write(orgId, purpose, target, actor, actorTokenId);
230
+ await this.write(orgId, purpose, target, actor, actorTokenId, auditDetail);
231
231
  const [view] = await this.views([decl], orgId ?? undefined);
232
232
  return view;
233
233
  }
234
+ /**
235
+ * The checks {@link set} runs before writing, nothing written: an unknown purpose, and a target
236
+ * model the scope cannot use, of another kind, or with invalid params (the Platform tool's
237
+ * precheck, so a known failure never reaches the confirmation card).
238
+ */
239
+ async validate(orgId, purpose, target) {
240
+ const decl = this.find(purpose);
241
+ if (target)
242
+ await this.check(orgId, target, decl.kind);
243
+ }
234
244
  /** The mapping write of {@link set}, under the super admin or org lock. */
235
- async write(orgId, purpose, target, actor, actorTokenId) {
245
+ async write(orgId, purpose, target, actor, actorTokenId, auditDetail) {
236
246
  if (orgId === null)
237
247
  await this.adminLock.lockAndAuthorize(actor);
238
248
  else
@@ -265,16 +275,20 @@ let ModelPurposesService = class ModelPurposesService {
265
275
  ...(orgId !== null && { orgId }),
266
276
  action: "model.purpose_mapped",
267
277
  target: purpose,
268
- detail: { scope: orgId === null ? "deployment" : "org", target },
278
+ detail: { scope: orgId === null ? "deployment" : "org", target, ...auditDetail },
269
279
  });
270
280
  }
271
281
  /** 设置(或 `null` 清除)部署默认;只有超级管理员(事务内复核)。 */
272
- setDefault(purpose, target, actor, actorTokenId) {
273
- return this.set(null, purpose, target, actor, actorTokenId);
282
+ setDefault(purpose, target, actor, actorTokenId,
283
+ /** Merged into the audit detail (a write made through the Platform tool). */
284
+ auditDetail) {
285
+ return this.set(null, purpose, target, actor, actorTokenId, auditDetail);
274
286
  }
275
287
  /** 设置(或 `null` 清除)组织覆盖;事务内锁组织并复核 `org.models.manage`。 */
276
- setOrg(orgId, purpose, target, actor, actorTokenId) {
277
- return this.set(orgId, purpose, target, actor, actorTokenId);
288
+ setOrg(orgId, purpose, target, actor, actorTokenId,
289
+ /** Merged into the audit detail (a write made through the Platform tool). */
290
+ auditDetail) {
291
+ return this.set(orgId, purpose, target, actor, actorTokenId, auditDetail);
278
292
  }
279
293
  /**
280
294
  * 生效的映射:组织覆盖,否则部署默认;都没有 → `model.unconfigured`;用途未声明 → `model.purpose_unknown`。
@@ -3,16 +3,13 @@ import { type ApiTokenRecord, ApiTokenService } from "../identity/api-tokens.js"
3
3
  import { type Principal } from "../identity/principal.js";
4
4
  import { type Member, MembersService } from "./members.service.js";
5
5
  import { type OrgContext } from "./org.guard.js";
6
+ import { OrgUpdateBody } from "./orgs.schemas.js";
6
7
  import { type Org, OrgsService } from "./orgs.service.js";
7
8
  import { type OrgRole } from "./roles.js";
8
9
  declare const CreateSchema: z.ZodObject<{
9
10
  name: z.ZodString;
10
11
  slug: z.ZodOptional<z.ZodString>;
11
12
  }, z.core.$strip>;
12
- declare const UpdateSchema: z.ZodObject<{
13
- name: z.ZodOptional<z.ZodString>;
14
- slug: z.ZodOptional<z.ZodString>;
15
- }, z.core.$strip>;
16
13
  declare const TransferSchema: z.ZodObject<{
17
14
  toAccountId: z.ZodString;
18
15
  }, z.core.$strip>;
@@ -52,7 +49,7 @@ export declare class OrgsController {
52
49
  org: Org;
53
50
  role: OrgRole;
54
51
  }>;
55
- update(principal: Principal, org: OrgContext, body: z.infer<typeof UpdateSchema>): Promise<{
52
+ update(principal: Principal, org: OrgContext, body: z.infer<typeof OrgUpdateBody>): Promise<{
56
53
  org: Org;
57
54
  }>;
58
55
  remove(principal: Principal, org: OrgContext): Promise<void>;
@@ -16,6 +16,7 @@ import { createZodDto } from "../infra/validation/create-zod-dto.js";
16
16
  import { ZBody } from "../infra/validation/zod-params.js";
17
17
  import { MembersService } from "./members.service.js";
18
18
  import { CurrentOrg, OrgAction } from "./org.guard.js";
19
+ import { OrgUpdateBody } from "./orgs.schemas.js";
19
20
  import { OrgsService } from "./orgs.service.js";
20
21
  import { ORG_ROLES } from "./roles.js";
21
22
  const CreateSchema = z.object({
@@ -24,11 +25,7 @@ const CreateSchema = z.object({
24
25
  });
25
26
  class OrgCreateBody extends createZodDto(CreateSchema, "OrgCreateBody") {
26
27
  }
27
- const UpdateSchema = z.object({
28
- name: z.string().min(1).max(100).optional(),
29
- slug: z.string().min(1).max(40).optional(),
30
- });
31
- class OrgUpdateBody extends createZodDto(UpdateSchema, "OrgUpdateBody") {
28
+ class OrgUpdateBodyDto extends createZodDto(OrgUpdateBody, "OrgUpdateBody") {
32
29
  }
33
30
  const TransferSchema = z.object({ toAccountId: z.string().min(1) });
34
31
  class OrgTransferBody extends createZodDto(TransferSchema, "OrgTransferBody") {
@@ -127,7 +124,7 @@ __decorate([
127
124
  OrgAction("org.update"),
128
125
  __param(0, CurrentPrincipal()),
129
126
  __param(1, CurrentOrg()),
130
- __param(2, ZBody(OrgUpdateBody))
127
+ __param(2, ZBody(OrgUpdateBodyDto))
131
128
  ], OrgsController.prototype, "update", null);
132
129
  __decorate([
133
130
  Delete(":orgId"),
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import type { RouteSchemas } from "../platform/route-schemas.js";
3
+ export declare const OrgUpdateBody: z.ZodObject<{
4
+ name: z.ZodOptional<z.ZodString>;
5
+ slug: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export declare const ORG_ROUTES: readonly RouteSchemas[];
8
+ export declare const ORG_SETTINGS_ROUTES: readonly RouteSchemas[];
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ import { OrgSettingsPatchSchema } from "./settings.service.js";
3
+ export const OrgUpdateBody = z.object({
4
+ name: z.string().min(1).max(100).optional(),
5
+ slug: z.string().min(1).max(40).optional(),
6
+ });
7
+ export const ORG_ROUTES = [
8
+ { route: "GET /api/v1/orgs" },
9
+ { route: "GET /api/v1/orgs/:orgId" },
10
+ { route: "PATCH /api/v1/orgs/:orgId", body: OrgUpdateBody },
11
+ { route: "GET /api/v1/orgs/:orgId/members" },
12
+ ];
13
+ export const ORG_SETTINGS_ROUTES = [
14
+ { route: "GET /api/v1/orgs/:orgId/settings" },
15
+ { route: "PATCH /api/v1/orgs/:orgId/settings", body: OrgSettingsPatchSchema },
16
+ ];
@@ -69,7 +69,9 @@ export declare class OrgsService {
69
69
  update(orgId: string, patch: {
70
70
  name?: string | undefined;
71
71
  slug?: string | undefined;
72
- }, actor: Account, actorTokenId?: string): Promise<Org>;
72
+ }, actor: Account, actorTokenId?: string,
73
+ /** Merged into the audit detail (the Platform tool's `via: "agent"`). */
74
+ auditDetail?: Record<string, unknown>): Promise<Org>;
73
75
  private updateIn;
74
76
  /**
75
77
  * Soft delete (needs owner, decided live under the org lock): in the same transaction revokes
@@ -178,7 +178,9 @@ let OrgsService = class OrgsService {
178
178
  return row && toOrg(row);
179
179
  }
180
180
  /** Renames / re-slugs (needs admin, decided live under the org lock). */
181
- async update(orgId, patch, actor, actorTokenId) {
181
+ async update(orgId, patch, actor, actorTokenId,
182
+ /** Merged into the audit detail (the Platform tool's `via: "agent"`). */
183
+ auditDetail) {
182
184
  const values = {};
183
185
  if (patch.name !== undefined)
184
186
  values.name = checkName(patch.name);
@@ -186,9 +188,9 @@ let OrgsService = class OrgsService {
186
188
  checkSlug(patch.slug);
187
189
  values.slug = patch.slug;
188
190
  }
189
- return slugGuard(this.updateIn(orgId, values, actor, actorTokenId));
191
+ return slugGuard(this.updateIn(orgId, values, actor, actorTokenId, auditDetail));
190
192
  }
191
- async updateIn(orgId, values, actor, actorTokenId) {
193
+ async updateIn(orgId, values, actor, actorTokenId, auditDetail) {
192
194
  const { org: before } = await this.orgLock.lockAndAuthorize(orgId, actor.id, "org.update");
193
195
  if (Object.keys(values).length === 0) {
194
196
  const row = await this.db
@@ -210,7 +212,7 @@ let OrgsService = class OrgsService {
210
212
  orgId,
211
213
  action: "org.updated",
212
214
  target: orgId,
213
- detail: { before, after: values },
215
+ detail: { before, after: values, ...auditDetail },
214
216
  });
215
217
  return toOrg(row);
216
218
  }
@@ -17,6 +17,8 @@ import { OrgLock } from "./org-lock.js";
17
17
  * 见 {@link effectiveSandboxEgress}。存量值非法时按 `none` 读(宁可断网,不悄悄放宽到部署默认)。
18
18
  * - `platformTool`: the `Platform` builtin for the whole org (Platform tool spec §3): `on`,
19
19
  * `read-only` (writes listed as unavailable) or `off` (default `on`).
20
+ * - `timeZone`: the org's default time zone (IANA; absent = UTC) for senders without one of their
21
+ * own (run context spec §3.3); an invalid stored value reads as absent.
20
22
  */
21
23
  /** 组织沙箱出站白名单的主机数上限。 */
22
24
  export declare const ORG_SANDBOX_ALLOW_HOSTS_MAX = 200;
@@ -58,6 +60,7 @@ export declare const OrgSettingsSchema: z.ZodObject<{
58
60
  allowHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
61
  }, z.core.$strict>>>;
60
62
  wakeOnBackgroundTask: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
63
+ timeZone: z.ZodCatch<z.ZodOptional<z.ZodString>>;
61
64
  }, z.core.$strip>;
62
65
  export type OrgSettings = z.infer<typeof OrgSettingsSchema>;
63
66
  /** PATCH 体:只改给出的字段;未知字段 → 400。 */
@@ -87,6 +90,7 @@ export declare const OrgSettingsPatchSchema: z.ZodObject<{
87
90
  }>;
88
91
  allowHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
92
  }, z.core.$strict>>>;
93
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
94
  }, z.core.$strict>;
91
95
  export type OrgSettingsPatch = z.infer<typeof OrgSettingsPatchSchema>;
92
96
  /** 部署的沙箱出站(`sandbox.limits.egress` + `allowHosts`)。 */
@@ -138,6 +142,10 @@ export declare class OrgSettingsService {
138
142
  /** 组织实际生效的沙箱 cpu / 内存(只读;由超级管理员在部署设置里覆盖)。 */
139
143
  sandboxLimits(orgId: string): Promise<OrgSandboxLimits>;
140
144
  get(orgId: string): Promise<OrgSettings>;
141
- update(orgId: string, patch: OrgSettingsPatch, actorAccountId: string, actorTokenId?: string): Promise<OrgSettings>;
145
+ /** The refusals of {@link update} that need no read of the org (the Platform tool's precheck). */
146
+ check(patch: OrgSettingsPatch): void;
147
+ update(orgId: string, patch: OrgSettingsPatch, actorAccountId: string, actorTokenId?: string,
148
+ /** Merged into the audit detail (the Platform tool's `via: "agent"`). */
149
+ auditDetail?: Record<string, unknown>): Promise<OrgSettings>;
142
150
  private updateIn;
143
151
  }
@@ -17,6 +17,7 @@ import { KernelConfigService } from "../infra/config/kernel-config.service.js";
17
17
  import { KernelDb } from "../infra/database/kernel-db.js";
18
18
  import { TransactionHost } from "../infra/database/transaction-host.js";
19
19
  import { Transactional } from "../infra/database/transactional.decorator.js";
20
+ import { IanaTimeZone } from "../time-zone.js";
20
21
  import { OrgLock } from "./org-lock.js";
21
22
  /**
22
23
  * 组织设置(`capybara.orgs.settings` jsonb)。读取宽松:缺失或非法的字段按默认值,未知键保留不动
@@ -30,6 +31,8 @@ import { OrgLock } from "./org-lock.js";
30
31
  * 见 {@link effectiveSandboxEgress}。存量值非法时按 `none` 读(宁可断网,不悄悄放宽到部署默认)。
31
32
  * - `platformTool`: the `Platform` builtin for the whole org (Platform tool spec §3): `on`,
32
33
  * `read-only` (writes listed as unavailable) or `off` (default `on`).
34
+ * - `timeZone`: the org's default time zone (IANA; absent = UTC) for senders without one of their
35
+ * own (run context spec §3.3); an invalid stored value reads as absent.
33
36
  */
34
37
  /** 组织沙箱出站白名单的主机数上限。 */
35
38
  export const ORG_SANDBOX_ALLOW_HOSTS_MAX = 200;
@@ -64,6 +67,8 @@ export const OrgSettingsSchema = z.object({
64
67
  sandboxEgress: SandboxEgressSettingSchema.optional().catch({ mode: "none" }),
65
68
  /** Overrides `runtime.wakeOnBackgroundTask`; absent follows the deployment. */
66
69
  wakeOnBackgroundTask: z.boolean().optional().catch(undefined),
70
+ /** The org's default time zone (run context spec §3.3); absent = UTC. */
71
+ timeZone: IanaTimeZone.optional().catch(undefined),
67
72
  });
68
73
  /** PATCH 体:只改给出的字段;未知字段 → 400。 */
69
74
  export const OrgSettingsPatchSchema = z
@@ -76,6 +81,8 @@ export const OrgSettingsPatchSchema = z
76
81
  wakeOnBackgroundTask: z.boolean().nullable().optional(),
77
82
  /** null 清除(恢复跟随部署默认)。 */
78
83
  sandboxEgress: SandboxEgressSettingSchema.nullable().optional(),
84
+ /** The org's default time zone (IANA); null clears it (UTC). */
85
+ timeZone: IanaTimeZone.nullable().optional(),
79
86
  })
80
87
  .strict();
81
88
  /**
@@ -164,14 +171,20 @@ let OrgSettingsService = class OrgSettingsService {
164
171
  throw new ApiError("org.not_found", "Organization not found");
165
172
  return parseOrgSettings(row.settings);
166
173
  }
167
- async update(orgId, patch, actorAccountId, actorTokenId) {
174
+ /** The refusals of {@link update} that need no read of the org (the Platform tool's precheck). */
175
+ check(patch) {
168
176
  if (patch.sandboxEgress?.mode === "allowlist" &&
169
177
  this.deployment().sandboxEgress.mode === "none") {
170
178
  throw new ApiError("org.sandbox_egress_not_allowed", "This deployment disables sandbox network access (sandbox.limits.egress is none); an organization can only set sandboxEgress to none");
171
179
  }
172
- return this.updateIn(orgId, patch, actorAccountId, actorTokenId);
173
180
  }
174
- async updateIn(orgId, patch, actorAccountId, actorTokenId) {
181
+ async update(orgId, patch, actorAccountId, actorTokenId,
182
+ /** Merged into the audit detail (the Platform tool's `via: "agent"`). */
183
+ auditDetail) {
184
+ this.check(patch);
185
+ return this.updateIn(orgId, patch, actorAccountId, actorTokenId, auditDetail);
186
+ }
187
+ async updateIn(orgId, patch, actorAccountId, actorTokenId, auditDetail) {
175
188
  await this.orgLock.lockAndAuthorize(orgId, actorAccountId, "org.update");
176
189
  const row = await this.db
177
190
  .selectFrom("orgs")
@@ -189,10 +202,12 @@ let OrgSettingsService = class OrgSettingsService {
189
202
  delete after.sandboxEgress;
190
203
  if (after.wakeOnBackgroundTask === undefined)
191
204
  delete after.wakeOnBackgroundTask;
205
+ if (after.timeZone === undefined)
206
+ delete after.timeZone;
192
207
  if (sameSettings(before, after))
193
208
  return before;
194
209
  // 与存量合并:保留本版本不认识的键(清除的 sandboxEgress 不留在存量里)
195
- const { sandboxEgress: _old, wakeOnBackgroundTask: _oldWake, ...rest } = stored;
210
+ const { sandboxEgress: _old, wakeOnBackgroundTask: _oldWake, timeZone: _oldZone, ...rest } = stored;
196
211
  await this.db
197
212
  .updateTable("orgs")
198
213
  .set({ settings: JSON.stringify({ ...rest, ...after }) })
@@ -204,7 +219,7 @@ let OrgSettingsService = class OrgSettingsService {
204
219
  orgId,
205
220
  action: "org.settings_updated",
206
221
  target: orgId,
207
- detail: { before, after },
222
+ detail: { before, after, ...auditDetail },
208
223
  });
209
224
  return after;
210
225
  }
@@ -6,6 +6,7 @@ import { EVAL_REPLAY_HOOKS } from "./evals/worker.js";
6
6
  import { BOOTSTRAP_LOCK_TTL } from "./extensions/bootstrap.js";
7
7
  import { FILE_PREVIEW_TIMEOUT } from "./files/previewers.js";
8
8
  import { LIST_MODELS_TIMEOUT } from "./runtime/providers.js";
9
+ import { RUN_CONTEXT_CLOCK } from "./runtime/run-context.service.js";
9
10
  import { AGENT_LOOP_FACTORY, type AgentLoopFactory } from "./runtime/run-steps.js";
10
11
  import { RUN_HOOKS, type RunHooks } from "./runtime/run-worker.js";
11
12
  import { SUBAGENT_MESSAGES_HOOKS, type SubagentMessagesHooks } from "./runtime/subagents/messages.js";
@@ -25,6 +26,8 @@ import { EMBED_TOKEN_CLOCK } from "./ui/embed-token.js";
25
26
  * - `BOOTSTRAP_LOCK_TTL`, `FILE_PREVIEW_TIMEOUT`, `LIST_MODELS_TIMEOUT`, `USAGE_REPORT_RETRY`,
26
27
  * `SANDBOX_LEASE_TIMINGS`, `CHANNEL_WEBHOOK_TIMINGS`: shorter timings;
27
28
  * - `EMBED_TOKEN_CLOCK`: the clock embed tokens are issued and checked with;
29
+ * - `RUN_CONTEXT_CLOCK`: the clock run start reads the run context's date from, and the
30
+ * `CurrentTime` builtin the time;
28
31
  * - `APP_INTERCEPTOR`: one more global interceptor (a probe of the matched routes).
29
32
  */
30
33
  interface KernelSeams {
@@ -40,6 +43,7 @@ interface KernelSeams {
40
43
  [SANDBOX_LEASE_TIMINGS]: Partial<SandboxLeaseTimings>;
41
44
  [CHANNEL_WEBHOOK_TIMINGS]: Partial<ChannelWebhookTimings>;
42
45
  [EMBED_TOKEN_CLOCK]: () => number;
46
+ [RUN_CONTEXT_CLOCK]: () => number;
43
47
  [APP_INTERCEPTOR]: NestInterceptor;
44
48
  }
45
49
  /**
package/dist/overrides.js CHANGED
@@ -4,6 +4,7 @@ import { EVAL_REPLAY_HOOKS } from "./evals/worker.js";
4
4
  import { BOOTSTRAP_LOCK_TTL } from "./extensions/bootstrap.js";
5
5
  import { FILE_PREVIEW_TIMEOUT } from "./files/previewers.js";
6
6
  import { LIST_MODELS_TIMEOUT } from "./runtime/providers.js";
7
+ import { RUN_CONTEXT_CLOCK } from "./runtime/run-context.service.js";
7
8
  import { AGENT_LOOP_FACTORY } from "./runtime/run-steps.js";
8
9
  import { RUN_HOOKS } from "./runtime/run-worker.js";
9
10
  import { SUBAGENT_MESSAGES_HOOKS, } from "./runtime/subagents/messages.js";
@@ -24,6 +25,7 @@ const SEAM_TOKENS = [
24
25
  SANDBOX_LEASE_TIMINGS,
25
26
  CHANNEL_WEBHOOK_TIMINGS,
26
27
  EMBED_TOKEN_CLOCK,
28
+ RUN_CONTEXT_CLOCK,
27
29
  APP_INTERCEPTOR,
28
30
  ];
29
31
  const allSeamsListed = true;
@@ -1,11 +1,28 @@
1
1
  import { ToolError } from "@capybara-hq/plugin-sdk";
2
+ import type { ActorFacts } from "./actor.js";
3
+ import type { OperationError, OperationErrorNext } from "./operation.js";
2
4
  /** What the model is told to do after an operation refused its input (Platform tool spec §5.2). */
3
5
  export declare const OPERATION_ERROR_NEXT = "Check the input with describe and call again, or ask the person.";
6
+ /** The role an error's next step is written for (spec §14.5 item 7). */
7
+ export type ErrorRole = "superAdmin" | "orgAdmin" | "member";
8
+ /** The actor's role for next steps: the super admin first, then an org admin (admin or owner). */
9
+ export declare function errorRoleOf(facts: Pick<ActorFacts, "role" | "isSuperAdmin">): ErrorRole;
10
+ /** The next step an operation declares for `code`, for this role; undefined when it has none. */
11
+ export declare function nextStepFor(errors: readonly OperationError[] | undefined, code: string, role: ErrorRole): string | undefined;
12
+ /** One next step resolved for this role (the fallbacks of {@link nextStepFor}). */
13
+ export declare function resolveNext(next: OperationErrorNext | undefined, role: ErrorRole): string | undefined;
14
+ /** `errors[]` as `describe` shows them to this actor: each `next` resolved for the role. */
15
+ export declare function errorsFor(errors: readonly OperationError[], role: ErrorRole): {
16
+ code: string;
17
+ next: string;
18
+ }[];
4
19
  /**
5
20
  * An error an operation threw, as the `Platform` tool's error for the model (spec §5.2: errors say
6
21
  * what to do next). A `ToolError` passes as is; an `ApiError` (what the same HTTP route would
7
- * answer) keeps its code, message and details, then says what to do next. Anything else is a
8
- * kernel fault, not the model's: it is rethrown, so the pipeline logs it and reports the generic
9
- * failure.
22
+ * answer) keeps its code, message and details, then gives the next step: `nextOf(code)` (the
23
+ * operation's entry for the actor's role), else the generic one. Anything else is a kernel fault,
24
+ * not the model's: it is rethrown, so the pipeline logs it and reports the generic failure.
10
25
  */
11
- export declare function toToolError(e: unknown): ToolError;
26
+ export declare function toToolError(e: unknown, nextOf?: (code: string) => string | undefined): ToolError;
27
+ /** A text ending with a full stop (`.` added unless it ends with `.`, `!` or `?`). */
28
+ export declare const sentence: (s: string) => string;
@@ -4,23 +4,62 @@ import { ApiError } from "../errors.js";
4
4
  const DETAILS_MAX = 1000;
5
5
  /** What the model is told to do after an operation refused its input (Platform tool spec §5.2). */
6
6
  export const OPERATION_ERROR_NEXT = "Check the input with describe and call again, or ask the person.";
7
+ /** The actor's role for next steps: the super admin first, then an org admin (admin or owner). */
8
+ export function errorRoleOf(facts) {
9
+ if (facts.isSuperAdmin)
10
+ return "superAdmin";
11
+ return facts.role === "admin" || facts.role === "owner" ? "orgAdmin" : "member";
12
+ }
13
+ /**
14
+ * Which keyed texts a role may get, in order. The super admin's text (the admin console path) goes
15
+ * to the super admin only; an org admin falls back to the member's step and a member to the org
16
+ * admin's (both name steps inside the org).
17
+ */
18
+ const FALLBACK = {
19
+ superAdmin: ["superAdmin", "orgAdmin", "member"],
20
+ orgAdmin: ["orgAdmin", "member"],
21
+ member: ["member", "orgAdmin"],
22
+ };
23
+ /** The next step an operation declares for `code`, for this role; undefined when it has none. */
24
+ export function nextStepFor(errors, code, role) {
25
+ return resolveNext(errors?.find((e) => e.code === code)?.next, role);
26
+ }
27
+ /** One next step resolved for this role (the fallbacks of {@link nextStepFor}). */
28
+ export function resolveNext(next, role) {
29
+ if (next === undefined || typeof next === "string")
30
+ return next;
31
+ for (const r of FALLBACK[role]) {
32
+ const text = next[r];
33
+ if (text !== undefined)
34
+ return text;
35
+ }
36
+ return undefined;
37
+ }
38
+ /** `errors[]` as `describe` shows them to this actor: each `next` resolved for the role. */
39
+ export function errorsFor(errors, role) {
40
+ return errors.flatMap((e) => {
41
+ const next = nextStepFor(errors, e.code, role);
42
+ return next === undefined ? [] : [{ code: e.code, next }];
43
+ });
44
+ }
7
45
  /**
8
46
  * An error an operation threw, as the `Platform` tool's error for the model (spec §5.2: errors say
9
47
  * what to do next). A `ToolError` passes as is; an `ApiError` (what the same HTTP route would
10
- * answer) keeps its code, message and details, then says what to do next. Anything else is a
11
- * kernel fault, not the model's: it is rethrown, so the pipeline logs it and reports the generic
12
- * failure.
48
+ * answer) keeps its code, message and details, then gives the next step: `nextOf(code)` (the
49
+ * operation's entry for the actor's role), else the generic one. Anything else is a kernel fault,
50
+ * not the model's: it is rethrown, so the pipeline logs it and reports the generic failure.
13
51
  */
14
- export function toToolError(e) {
52
+ export function toToolError(e, nextOf) {
15
53
  if (e instanceof ToolError)
16
54
  return e;
17
55
  if (e instanceof ApiError) {
18
56
  const details = e.details !== undefined && e.details.length > 0
19
57
  ? ` Details: ${clip(JSON.stringify(e.details))}`
20
58
  : "";
21
- const message = e.message.trim().replace(/[.!]?$/, ".");
22
- return new ToolError(`${e.code}: ${message}${details} ${OPERATION_ERROR_NEXT}`);
59
+ return new ToolError(`${e.code}: ${sentence(e.message)}${details} ${nextOf?.(e.code) ?? OPERATION_ERROR_NEXT}`);
23
60
  }
24
61
  throw e;
25
62
  }
63
+ /** A text ending with a full stop (`.` added unless it ends with `.`, `!` or `?`). */
64
+ export const sentence = (s) => s.trim().replace(/[.!?]?$/, (m) => m || ".");
26
65
  const clip = (s) => (s.length > DETAILS_MAX ? `${s.slice(0, DETAILS_MAX)}…` : s);
@@ -1,12 +1,11 @@
1
- export type ExclusionCategory = "human-only" | "secret" | "transport" | "internal" | "later";
1
+ export type ExclusionCategory = "human-only" | "secret" | "transport" | "internal";
2
2
  /**
3
3
  * Kernel HTTP routes the `Platform` tool does not mirror, each with a reason (spec §9);
4
4
  * `check:platform-ops` fails a route that is neither mirrored by an operation nor listed here.
5
- * `later` needs an `issue` URL.
5
+ * Every exclusion is for good: there is no "later" (rule `platform-op-later`).
6
6
  */
7
7
  export declare const PLATFORM_EXCLUSIONS: readonly {
8
8
  route: string;
9
9
  category: ExclusionCategory;
10
10
  reason: string;
11
- issue?: string;
12
11
  }[];