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

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 (331) 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 +14 -0
  172. package/dist/identity/me.controller.js +39 -1
  173. package/dist/identity/principal.d.ts +8 -0
  174. package/dist/identity/principal.js +8 -0
  175. package/dist/identity/settings.d.ts +3 -1
  176. package/dist/identity/settings.js +6 -4
  177. package/dist/inbox/inbox.schemas.d.ts +8 -0
  178. package/dist/inbox/inbox.schemas.js +11 -0
  179. package/dist/inbox/platform-inbox.controller.d.ts +1 -1
  180. package/dist/inbox/platform-inbox.controller.js +2 -2
  181. package/dist/index.d.ts +4 -0
  182. package/dist/index.js +6 -0
  183. package/dist/lifecycle/kernel-lifecycle.js +4 -0
  184. package/dist/models/enablement.d.ts +2 -0
  185. package/dist/models/enablement.js +1 -0
  186. package/dist/models/org-models.schemas.d.ts +8 -0
  187. package/dist/models/org-models.schemas.js +22 -0
  188. package/dist/models/prices.d.ts +3 -1
  189. package/dist/models/prices.js +7 -5
  190. package/dist/models/purposes.d.ts +12 -2
  191. package/dist/models/purposes.js +22 -8
  192. package/dist/orgs/orgs.controller.d.ts +2 -5
  193. package/dist/orgs/orgs.controller.js +3 -6
  194. package/dist/orgs/orgs.schemas.d.ts +8 -0
  195. package/dist/orgs/orgs.schemas.js +16 -0
  196. package/dist/orgs/orgs.service.d.ts +3 -1
  197. package/dist/orgs/orgs.service.js +6 -4
  198. package/dist/orgs/settings.service.d.ts +9 -1
  199. package/dist/orgs/settings.service.js +20 -5
  200. package/dist/overrides.d.ts +4 -0
  201. package/dist/overrides.js +2 -0
  202. package/dist/platform/errors.d.ts +21 -4
  203. package/dist/platform/errors.js +45 -6
  204. package/dist/platform/exclusions.d.ts +2 -3
  205. package/dist/platform/exclusions.js +68 -849
  206. package/dist/platform/method.js +1 -1
  207. package/dist/platform/operation.d.ts +82 -5
  208. package/dist/platform/operation.js +62 -7
  209. package/dist/platform/ops/accounts.ops.d.ts +32 -0
  210. package/dist/platform/ops/accounts.ops.js +291 -0
  211. package/dist/platform/ops/admin.ops.d.ts +36 -0
  212. package/dist/platform/ops/admin.ops.js +389 -0
  213. package/dist/platform/ops/agent-skills.ops.d.ts +24 -0
  214. package/dist/platform/ops/agent-skills.ops.js +226 -0
  215. package/dist/platform/ops/agent-templates.ops.d.ts +4 -1
  216. package/dist/platform/ops/agent-templates.ops.js +194 -14
  217. package/dist/platform/ops/agents.ops.d.ts +19 -1
  218. package/dist/platform/ops/agents.ops.js +481 -58
  219. package/dist/platform/ops/approvals.ops.d.ts +30 -0
  220. package/dist/platform/ops/approvals.ops.js +116 -0
  221. package/dist/platform/ops/background.ops.d.ts +14 -0
  222. package/dist/platform/ops/background.ops.js +134 -0
  223. package/dist/platform/ops/catalog-admin.ops.d.ts +74 -0
  224. package/dist/platform/ops/catalog-admin.ops.js +587 -0
  225. package/dist/platform/ops/channels.ops.d.ts +16 -0
  226. package/dist/platform/ops/channels.ops.js +195 -0
  227. package/dist/platform/ops/components.ops.d.ts +46 -0
  228. package/dist/platform/ops/components.ops.js +853 -0
  229. package/dist/platform/ops/connectors.ops.d.ts +4 -2
  230. package/dist/platform/ops/connectors.ops.js +68 -6
  231. package/dist/platform/ops/conversations.ops.d.ts +30 -0
  232. package/dist/platform/ops/conversations.ops.js +470 -0
  233. package/dist/platform/ops/environments.ops.d.ts +26 -0
  234. package/dist/platform/ops/environments.ops.js +289 -0
  235. package/dist/platform/ops/errors.d.ts +10 -5
  236. package/dist/platform/ops/errors.js +19 -11
  237. package/dist/platform/ops/evals.ops.d.ts +28 -0
  238. package/dist/platform/ops/evals.ops.js +783 -0
  239. package/dist/platform/ops/extensions-admin.ops.d.ts +25 -0
  240. package/dist/platform/ops/extensions-admin.ops.js +344 -0
  241. package/dist/platform/ops/extensions.ops.d.ts +7 -1
  242. package/dist/platform/ops/extensions.ops.js +248 -17
  243. package/dist/platform/ops/inbox.ops.d.ts +25 -0
  244. package/dist/platform/ops/inbox.ops.js +378 -0
  245. package/dist/platform/ops/marketplaces.ops.d.ts +7 -1
  246. package/dist/platform/ops/marketplaces.ops.js +326 -17
  247. package/dist/platform/ops/models.ops.d.ts +25 -0
  248. package/dist/platform/ops/models.ops.js +232 -0
  249. package/dist/platform/ops/org-plugins.ops.d.ts +29 -0
  250. package/dist/platform/ops/org-plugins.ops.js +329 -0
  251. package/dist/platform/ops/org-settings.ops.d.ts +16 -0
  252. package/dist/platform/ops/org-settings.ops.js +102 -0
  253. package/dist/platform/ops/orgs.ops.d.ts +28 -0
  254. package/dist/platform/ops/orgs.ops.js +295 -0
  255. package/dist/platform/ops/other-orgs.d.ts +20 -0
  256. package/dist/platform/ops/other-orgs.js +72 -0
  257. package/dist/platform/ops/platform.ops.d.ts +4 -4
  258. package/dist/platform/ops/platform.ops.js +23 -24
  259. package/dist/platform/ops/plugins.ops.d.ts +10 -8
  260. package/dist/platform/ops/plugins.ops.js +176 -77
  261. package/dist/platform/ops/previewers.ops.d.ts +14 -0
  262. package/dist/platform/ops/previewers.ops.js +109 -0
  263. package/dist/platform/ops/requests.ops.js +57 -19
  264. package/dist/platform/ops/skills.ops.d.ts +5 -1
  265. package/dist/platform/ops/skills.ops.js +129 -11
  266. package/dist/platform/ops/unavailable.d.ts +23 -0
  267. package/dist/platform/ops/unavailable.js +111 -0
  268. package/dist/platform/parity.d.ts +33 -0
  269. package/dist/platform/parity.js +272 -0
  270. package/dist/platform/platform-ops.module.d.ts +32 -0
  271. package/dist/platform/platform-ops.module.js +78 -11
  272. package/dist/platform/route-schemas.d.ts +18 -0
  273. package/dist/platform/route-schemas.js +60 -0
  274. package/dist/roles/worker.module.js +2 -0
  275. package/dist/runtime/context/build.d.ts +2 -0
  276. package/dist/runtime/context/build.js +28 -2
  277. package/dist/runtime/context/compaction.js +10 -1
  278. package/dist/runtime/context/run-context.d.ts +65 -0
  279. package/dist/runtime/context/run-context.js +215 -0
  280. package/dist/runtime/model-call.js +2 -1
  281. package/dist/runtime/providers.js +8 -1
  282. package/dist/runtime/run-context.service.d.ts +65 -0
  283. package/dist/runtime/run-context.service.js +220 -0
  284. package/dist/runtime/run-worker.d.ts +5 -0
  285. package/dist/runtime/run-worker.js +31 -6
  286. package/dist/runtime/runtime.module.js +2 -0
  287. package/dist/runtime/subagents/definition.d.ts +15 -15
  288. package/dist/runtime/subagents/definition.js +46 -115
  289. package/dist/skills/changes.controller.js +2 -1
  290. package/dist/skills/changes.service.d.ts +1 -1
  291. package/dist/skills/changes.service.js +4 -4
  292. package/dist/skills/invocable.controller.d.ts +1 -1
  293. package/dist/skills/invocable.controller.js +2 -2
  294. package/dist/skills/invoke.d.ts +2 -2
  295. package/dist/skills/invoke.js +8 -1
  296. package/dist/skills/skills.controller.d.ts +4 -13
  297. package/dist/skills/skills.controller.js +8 -24
  298. package/dist/skills/skills.schemas.d.ts +48 -0
  299. package/dist/skills/skills.schemas.js +61 -0
  300. package/dist/skills/skills.service.d.ts +11 -1
  301. package/dist/skills/skills.service.js +37 -14
  302. package/dist/time-zone.d.ts +5 -0
  303. package/dist/time-zone.js +19 -0
  304. package/dist/tools/approvals.controller.js +2 -3
  305. package/dist/tools/approvals.schemas.d.ts +21 -0
  306. package/dist/tools/approvals.schemas.js +15 -0
  307. package/dist/tools/builtin-names.d.ts +10 -8
  308. package/dist/tools/builtin-names.js +16 -11
  309. package/dist/tools/builtins/builtin-tools.d.ts +3 -1
  310. package/dist/tools/builtins/builtin-tools.js +15 -3
  311. package/dist/tools/builtins/current-time.d.ts +26 -0
  312. package/dist/tools/builtins/current-time.js +99 -0
  313. package/dist/tools/builtins/platform.d.ts +19 -2
  314. package/dist/tools/builtins/platform.js +105 -16
  315. package/dist/tools/connectors.controller.d.ts +1 -2
  316. package/dist/tools/connectors.controller.js +1 -4
  317. package/dist/tools/connectors.schemas.d.ts +12 -0
  318. package/dist/tools/connectors.schemas.js +19 -0
  319. package/dist/tools/connectors.service.d.ts +5 -2
  320. package/dist/tools/connectors.service.js +7 -5
  321. package/dist/tools/org-tool-switches.d.ts +16 -2
  322. package/dist/tools/org-tool-switches.js +26 -9
  323. package/dist/tools/pipeline.js +3 -1
  324. package/dist/tools/registry.d.ts +48 -51
  325. package/dist/tools/registry.js +222 -233
  326. package/package.json +3 -3
  327. package/src/migrations/0090_initial_passwords.sql +27 -0
  328. package/src/migrations/0091_account_time_zone.sql +4 -0
  329. package/src/migrations/0092_tools_default_on.sql +27 -0
  330. package/dist/platform/redact-orgs.d.ts +0 -7
  331. package/dist/platform/redact-orgs.js +0 -52
@@ -18,7 +18,7 @@ import { Transactional } from "../infra/database/transactional.decorator.js";
18
18
  import { roleAtLeast } from "../orgs/roles.js";
19
19
  import { AgentLookup, isAgentVisibleTo } from "./agent-lookup.js";
20
20
  import { AgentsService } from "./agents.service.js";
21
- import { normalizeStoredDefinition, } from "./definition.js";
21
+ import { canonicalDisabledTools, normalizeStoredDefinition, } from "./definition.js";
22
22
  import { PendingConnectorRequests } from "./pending-connector-requests.js";
23
23
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
24
24
  const RANK = { ask: 1, deny: 2 };
@@ -71,7 +71,7 @@ let PendingConnectorsService = class PendingConnectorsService {
71
71
  * authorized) or none of the entry's tools -> 400 `agent.pending_connector_mismatch`.
72
72
  * Audits `agent.pending_connector_bound`.
73
73
  */
74
- async bind(orgId, agentId, key, connectorId, actor, actorTokenId) {
74
+ async bind(orgId, agentId, key, connectorId, actor, actorTokenId, auditDetail) {
75
75
  const t = this.kdb.db;
76
76
  const before = await this.agents.lockForWrite(orgId, agentId, actor);
77
77
  const def = await this.currentDefinition(agentId, before.current_version);
@@ -137,25 +137,18 @@ let PendingConnectorsService = class PendingConnectorsService {
137
137
  if (prev === undefined || RANK[p] > RANK[prev])
138
138
  toolPolicies[k] = p;
139
139
  }
140
- let merged = false;
141
- const tools = def.tools.map((r) => {
142
- if (r.kind !== "connector" || r.connectorId !== c.id || merged)
143
- return r;
144
- merged = true;
145
- if (r.tools === "all")
146
- return r;
147
- return {
148
- ...r,
149
- tools: names === "all" ? "all" : [...new Set([...r.tools, ...names])],
150
- };
151
- });
152
- if (!merged)
153
- tools.push({ kind: "connector", connectorId: c.id, tools: names });
140
+ // tools are on by default (tools default-on spec §3): binding an entry that names some tools
141
+ // turns the connector's other tools off for this agent; one taking them all leaves it all on
142
+ const off = names === "all" ? [] : offered.filter((n) => !names.includes(n));
143
+ const disabledTools = [
144
+ ...(def.disabledTools ?? []).filter((r) => r.kind !== "connector" || r.connectorId !== c.id),
145
+ ...(off.length > 0 ? [{ kind: "connector", connectorId: c.id, tools: off }] : []),
146
+ ];
154
147
  const left = pending.filter((x) => x.key !== key);
155
148
  const { pendingConnectors: _old, ...rest } = def;
156
149
  const next = {
157
150
  ...rest,
158
- tools,
151
+ disabledTools: canonicalDisabledTools(disabledTools),
159
152
  toolPolicies,
160
153
  ...(left.length > 0 && { pendingConnectors: left }),
161
154
  };
@@ -180,7 +173,13 @@ let PendingConnectorsService = class PendingConnectorsService {
180
173
  orgId,
181
174
  action: "agent.pending_connector_bound",
182
175
  target: agentId,
183
- detail: { key, connectorId: c.id, fromVersion: before.current_version, toVersion },
176
+ detail: {
177
+ key,
178
+ connectorId: c.id,
179
+ fromVersion: before.current_version,
180
+ toVersion,
181
+ ...auditDetail,
182
+ },
184
183
  });
185
184
  await this.requests.settleIn({
186
185
  orgId,
@@ -198,7 +197,7 @@ let PendingConnectorsService = class PendingConnectorsService {
198
197
  * keys, requested by the agent's owner (P4-T6-4). No pending connectors -> 409
199
198
  * `agent.no_pending_connectors`.
200
199
  */
201
- async reopen(orgId, agentId, actor, actorTokenId) {
200
+ async reopen(orgId, agentId, actor, actorTokenId, auditDetail) {
202
201
  const before = await this.agents.lockForWrite(orgId, agentId, actor);
203
202
  const def = await this.currentDefinition(agentId, before.current_version);
204
203
  const keys = (def.pendingConnectors ?? []).map((c) => c.key);
@@ -216,6 +215,7 @@ let PendingConnectorsService = class PendingConnectorsService {
216
215
  requestedBy: owner.owner_account_id,
217
216
  actor,
218
217
  actorTokenId,
218
+ ...(auditDetail !== undefined && { auditDetail }),
219
219
  });
220
220
  // the agent row is locked above, so the keys read there are still pending
221
221
  if (r === null)
@@ -44,6 +44,22 @@ export declare const QuickActionsSchema: z.ZodArray<z.ZodObject<{
44
44
  body: z.ZodString;
45
45
  }, z.core.$strict>>;
46
46
  /** What a client may write (`external` is migrated data only). */
47
+ /** A preset avatar: the only kind the `Platform` tool sets (an upload is the web's). */
48
+ export declare const PresetAvatarSchema: z.ZodObject<{
49
+ kind: z.ZodLiteral<"preset">;
50
+ id: z.ZodEnum<{
51
+ "black-bear": "black-bear";
52
+ capybara: "capybara";
53
+ elephant: "elephant";
54
+ fox: "fox";
55
+ owl: "owl";
56
+ panda: "panda";
57
+ penguin: "penguin";
58
+ rabbit: "rabbit";
59
+ turtle: "turtle";
60
+ whale: "whale";
61
+ }>;
62
+ }, z.core.$strict>;
47
63
  export declare const AvatarInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
48
64
  kind: z.ZodLiteral<"preset">;
49
65
  id: z.ZodEnum<{
@@ -88,6 +104,8 @@ export declare const ProfileInputSchema: z.ZodObject<{
88
104
  }, z.core.$strict>>>;
89
105
  }, z.core.$strict>;
90
106
  export type ProfileInput = z.infer<typeof ProfileInputSchema>;
107
+ /** What `PATCH …/profile` writes: the description is saved with the definition (run context §3.5). */
108
+ export type ProfilePatch = Omit<ProfileInput, "description">;
91
109
  export interface AgentProfile {
92
110
  avatar: AgentAvatar;
93
111
  description: string;
@@ -38,8 +38,12 @@ export const QuickActionSchema = z
38
38
  export const DescriptionSchema = z.string().max(PROFILE_LIMITS.description);
39
39
  export const QuickActionsSchema = z.array(QuickActionSchema).max(PROFILE_LIMITS.quickActions);
40
40
  /** What a client may write (`external` is migrated data only). */
41
+ /** A preset avatar: the only kind the `Platform` tool sets (an upload is the web's). */
42
+ export const PresetAvatarSchema = z
43
+ .object({ kind: z.literal("preset"), id: z.enum(PRESET_IDS) })
44
+ .strict();
41
45
  export const AvatarInputSchema = z.discriminatedUnion("kind", [
42
- z.object({ kind: z.literal("preset"), id: z.enum(PRESET_IDS) }).strict(),
46
+ PresetAvatarSchema,
43
47
  z.object({ kind: z.literal("upload"), uploadId: z.string().min(1).max(200) }).strict(),
44
48
  ]);
45
49
  export const ProfileInputSchema = z
@@ -1,22 +1,13 @@
1
- import { z } from "zod";
1
+ import type { z } from "zod";
2
2
  import { OwnedItems, type OwnedSkillDeletePreview } from "../catalog/owned-items.js";
3
3
  import { type Principal } from "../identity/principal.js";
4
4
  import { type OrgContext } from "../orgs/org.guard.js";
5
5
  import { type AgentTemplateDetail, OrgAgentTemplates, type SaveAsOmission } from "./org-templates.js";
6
6
  import { AgentTemplatesService, type AgentTemplateView } from "./templates.js";
7
- declare const IdParams: z.ZodObject<{
8
- id: z.ZodString;
9
- }, z.core.$strip>;
10
- declare const AgentIdParams: z.ZodObject<{
11
- agentId: z.ZodString;
12
- }, z.core.$strip>;
7
+ import { AgentTemplateIdParams, SaveAsAgentIdParams, SaveAsTemplateBody } from "./templates.schemas.js";
13
8
  declare const ShareableBody: z.ZodObject<{
14
9
  shareable: z.ZodBoolean;
15
10
  }, z.core.$strict>;
16
- declare const SaveAsBody: z.ZodObject<{
17
- name: z.ZodString;
18
- description: z.ZodString;
19
- }, z.core.$strict>;
20
11
  declare const UpdateBody: z.ZodObject<{
21
12
  definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
22
13
  expectedVersion: z.ZodNumber;
@@ -42,7 +33,7 @@ export declare class AgentTemplatesController {
42
33
  * the org) with its definition, owner and the org's flags (`owned`, `shareable`, `promoted`).
43
34
  * Not usable here -> 404 `component.not_found`.
44
35
  */
45
- get(principal: Principal, org: OrgContext, params: z.infer<typeof IdParams>): Promise<{
36
+ get(principal: Principal, org: OrgContext, params: z.infer<typeof AgentTemplateIdParams>): Promise<{
46
37
  template: AgentTemplateDetail;
47
38
  }>;
48
39
  /**
@@ -50,7 +41,7 @@ export declare class AgentTemplatesController {
50
41
  * 200 `{ template }`; a stale version -> 409 `agent_template.version_conflict`; a template the
51
42
  * org does not own -> 409 `catalog.not_owned`.
52
43
  */
53
- update(principal: Principal, org: OrgContext, params: z.infer<typeof IdParams>, body: z.infer<typeof UpdateBody>): Promise<{
44
+ update(principal: Principal, org: OrgContext, params: z.infer<typeof AgentTemplateIdParams>, body: z.infer<typeof UpdateBody>): Promise<{
54
45
  template: AgentTemplateDetail;
55
46
  }>;
56
47
  /**
@@ -58,12 +49,12 @@ export declare class AgentTemplatesController {
58
49
  * was shared and another org uses it (`orgs`), else `removed`; `agents` the org's agents whose
59
50
  * roster loses it.
60
51
  */
61
- deletePreview(principal: Principal, org: OrgContext, params: z.infer<typeof IdParams>): Promise<OwnedSkillDeletePreview>;
52
+ deletePreview(principal: Principal, org: OrgContext, params: z.infer<typeof AgentTemplateIdParams>): Promise<OwnedSkillDeletePreview>;
62
53
  /**
63
54
  * Deletes the org's own template (the P3 owner rules, ruling P4-12): one it shared that another
64
55
  * org uses becomes the platform's (platform notice `ownership_transferred`). 200 `{ outcome }`.
65
56
  */
66
- remove(principal: Principal, org: OrgContext, params: z.infer<typeof IdParams>): Promise<{
57
+ remove(principal: Principal, org: OrgContext, params: z.infer<typeof AgentTemplateIdParams>): Promise<{
67
58
  outcome: "transferred" | "removed";
68
59
  }>;
69
60
  /**
@@ -71,7 +62,7 @@ export declare class AgentTemplatesController {
71
62
  * template, ruling P4-13): a plugin's template or a copy of another owner's platform template
72
63
  * -> 409 `catalog.not_owned`; one the org promoted writes its platform row too (ruling P3-2).
73
64
  */
74
- setShareable(principal: Principal, org: OrgContext, params: z.infer<typeof IdParams>, body: z.infer<typeof ShareableBody>): Promise<{
65
+ setShareable(principal: Principal, org: OrgContext, params: z.infer<typeof AgentTemplateIdParams>, body: z.infer<typeof ShareableBody>): Promise<{
75
66
  id: string;
76
67
  shareable: boolean;
77
68
  }>;
@@ -88,7 +79,7 @@ export declare class AgentTemplatesController {
88
79
  export declare class AgentSaveAsTemplateController {
89
80
  private readonly orgTemplates;
90
81
  constructor(orgTemplates: OrgAgentTemplates);
91
- saveAs(principal: Principal, org: OrgContext, params: z.infer<typeof AgentIdParams>, body: z.infer<typeof SaveAsBody>): Promise<{
82
+ saveAs(principal: Principal, org: OrgContext, params: z.infer<typeof SaveAsAgentIdParams>, body: z.infer<typeof SaveAsTemplateBody>): Promise<{
92
83
  template: AgentTemplateDetail;
93
84
  omitted: SaveAsOmission[];
94
85
  }>;
@@ -7,9 +7,7 @@ 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 { AGENT_TEMPLATE_NAME_RE } from "@capybara-hq/plugin-sdk";
11
10
  import { Controller, Delete, Get, Inject, Post, Put } from "@nestjs/common";
12
- import { z } from "zod";
13
11
  import { OwnedItems } from "../catalog/owned-items.js";
14
12
  import { CurrentPrincipal, patTokenId, requireUser, } from "../identity/principal.js";
15
13
  import { createZodDto } from "../infra/validation/create-zod-dto.js";
@@ -17,32 +15,16 @@ import { ZBody, ZParam } from "../infra/validation/zod-params.js";
17
15
  import { CurrentOrg, OrgAction } from "../orgs/org.guard.js";
18
16
  import { OrgAgentTemplates, } from "./org-templates.js";
19
17
  import { AgentTemplatesService } from "./templates.js";
20
- const IdParams = z.object({ id: z.string().min(1).max(100) });
21
- const AgentIdParams = z.object({ agentId: z.string().min(1).max(100) });
22
- const ShareableBody = z.object({ shareable: z.boolean() }).strict();
23
- const SaveAsBody = z
24
- .object({
25
- /** The bare template name (the template name rule); unique in the org's usable set. */
26
- name: z.string().regex(AGENT_TEMPLATE_NAME_RE),
27
- /** When to use it (trimmed, as a template file's). */
28
- description: z.string().trim().min(1).max(4096),
29
- })
30
- .strict();
31
- const UpdateBody = z
32
- .object({
33
- /** The whole definition (the `AgentTemplate` shape), validated like a template file. */
34
- definition: z.record(z.string(), z.unknown()),
35
- /** The `version` the editor read; another one -> 409 `agent_template.version_conflict`. */
36
- expectedVersion: z.number().int().min(1),
37
- })
38
- .strict();
39
- class AgentTemplateIdParams extends createZodDto(IdParams, "AgentTemplateIdParams") {
18
+ import { AgentTemplateIdParams, SaveAsAgentIdParams, SaveAsTemplateBody, AgentTemplateShareableBody as ShareableBodySchema, AgentTemplateUpdateBody as UpdateBodySchema, } from "./templates.schemas.js";
19
+ const ShareableBody = ShareableBodySchema;
20
+ const UpdateBody = UpdateBodySchema;
21
+ class AgentTemplateIdParamsDto extends createZodDto(AgentTemplateIdParams, "AgentTemplateIdParams") {
40
22
  }
41
- class SaveAsAgentIdParams extends createZodDto(AgentIdParams, "SaveAsAgentIdParams") {
23
+ class SaveAsAgentIdParamsDto extends createZodDto(SaveAsAgentIdParams, "SaveAsAgentIdParams") {
42
24
  }
43
25
  class AgentTemplateShareableBody extends createZodDto(ShareableBody, "AgentTemplateShareableBody") {
44
26
  }
45
- class SaveAsTemplateBody extends createZodDto(SaveAsBody, "SaveAsTemplateBody") {
27
+ class SaveAsTemplateBodyDto extends createZodDto(SaveAsTemplateBody, "SaveAsTemplateBody") {
46
28
  }
47
29
  class AgentTemplateUpdateBody extends createZodDto(UpdateBody, "AgentTemplateUpdateBody") {
48
30
  }
@@ -128,14 +110,14 @@ __decorate([
128
110
  OrgAction("agents.create"),
129
111
  __param(0, CurrentPrincipal()),
130
112
  __param(1, CurrentOrg()),
131
- __param(2, ZParam(AgentTemplateIdParams))
113
+ __param(2, ZParam(AgentTemplateIdParamsDto))
132
114
  ], AgentTemplatesController.prototype, "get", null);
133
115
  __decorate([
134
116
  Put(":id"),
135
117
  OrgAction("agents.manage"),
136
118
  __param(0, CurrentPrincipal()),
137
119
  __param(1, CurrentOrg()),
138
- __param(2, ZParam(AgentTemplateIdParams)),
120
+ __param(2, ZParam(AgentTemplateIdParamsDto)),
139
121
  __param(3, ZBody(AgentTemplateUpdateBody))
140
122
  ], AgentTemplatesController.prototype, "update", null);
141
123
  __decorate([
@@ -143,21 +125,21 @@ __decorate([
143
125
  OrgAction("agents.manage"),
144
126
  __param(0, CurrentPrincipal()),
145
127
  __param(1, CurrentOrg()),
146
- __param(2, ZParam(AgentTemplateIdParams))
128
+ __param(2, ZParam(AgentTemplateIdParamsDto))
147
129
  ], AgentTemplatesController.prototype, "deletePreview", null);
148
130
  __decorate([
149
131
  Delete(":id"),
150
132
  OrgAction("agents.manage"),
151
133
  __param(0, CurrentPrincipal()),
152
134
  __param(1, CurrentOrg()),
153
- __param(2, ZParam(AgentTemplateIdParams))
135
+ __param(2, ZParam(AgentTemplateIdParamsDto))
154
136
  ], AgentTemplatesController.prototype, "remove", null);
155
137
  __decorate([
156
138
  Put(":id/shareable"),
157
139
  OrgAction("agents.manage"),
158
140
  __param(0, CurrentPrincipal()),
159
141
  __param(1, CurrentOrg()),
160
- __param(2, ZParam(AgentTemplateIdParams)),
142
+ __param(2, ZParam(AgentTemplateIdParamsDto)),
161
143
  __param(3, ZBody(AgentTemplateShareableBody))
162
144
  ], AgentTemplatesController.prototype, "setShareable", null);
163
145
  AgentTemplatesController = __decorate([
@@ -191,8 +173,8 @@ __decorate([
191
173
  OrgAction("agents.manage"),
192
174
  __param(0, CurrentPrincipal()),
193
175
  __param(1, CurrentOrg()),
194
- __param(2, ZParam(SaveAsAgentIdParams)),
195
- __param(3, ZBody(SaveAsTemplateBody))
176
+ __param(2, ZParam(SaveAsAgentIdParamsDto)),
177
+ __param(3, ZBody(SaveAsTemplateBodyDto))
196
178
  ], AgentSaveAsTemplateController.prototype, "saveAs", null);
197
179
  AgentSaveAsTemplateController = __decorate([
198
180
  Controller("api/v1/orgs/:orgId/agents"),
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ import type { RouteSchemas } from "../platform/route-schemas.js";
3
+ export declare const AgentTemplateIdParams: z.ZodObject<{
4
+ id: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const SaveAsAgentIdParams: z.ZodObject<{
7
+ agentId: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const SaveAsTemplateBody: z.ZodObject<{
10
+ name: z.ZodString;
11
+ description: z.ZodString;
12
+ }, z.core.$strict>;
13
+ export declare const AgentTemplateShareableBody: z.ZodObject<{
14
+ shareable: z.ZodBoolean;
15
+ }, z.core.$strict>;
16
+ export declare const AgentTemplateUpdateBody: z.ZodObject<{
17
+ definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
18
+ expectedVersion: z.ZodNumber;
19
+ }, z.core.$strict>;
20
+ export declare const AGENT_TEMPLATE_ROUTES: readonly RouteSchemas[];
@@ -0,0 +1,45 @@
1
+ import { AGENT_TEMPLATE_NAME_RE } from "@capybara-hq/plugin-sdk";
2
+ import { z } from "zod";
3
+ export const AgentTemplateIdParams = z.object({ id: z.string().min(1).max(100) });
4
+ export const SaveAsAgentIdParams = z.object({ agentId: z.string().min(1).max(100) });
5
+ export const SaveAsTemplateBody = z
6
+ .object({
7
+ /** The bare template name (the template name rule); unique in the org's usable set. */
8
+ name: z.string().regex(AGENT_TEMPLATE_NAME_RE),
9
+ /** When to use it (trimmed, as a template file's). */
10
+ description: z.string().trim().min(1).max(4096),
11
+ })
12
+ .strict();
13
+ export const AgentTemplateShareableBody = z.object({ shareable: z.boolean() }).strict();
14
+ export const AgentTemplateUpdateBody = z
15
+ .object({
16
+ /** The whole definition (the `AgentTemplate` shape), validated like a template file. */
17
+ definition: z.record(z.string(), z.unknown()),
18
+ /** The `version` the editor read; another one -> 409 `agent_template.version_conflict`. */
19
+ expectedVersion: z.number().int().min(1),
20
+ })
21
+ .strict();
22
+ export const AGENT_TEMPLATE_ROUTES = [
23
+ { route: "GET /api/v1/orgs/:orgId/agent-templates" },
24
+ { route: "GET /api/v1/orgs/:orgId/agent-templates/:id", params: AgentTemplateIdParams },
25
+ {
26
+ route: "POST /api/v1/orgs/:orgId/agents/:agentId/save-as-template",
27
+ params: SaveAsAgentIdParams,
28
+ body: SaveAsTemplateBody,
29
+ },
30
+ {
31
+ route: "PUT /api/v1/orgs/:orgId/agent-templates/:id",
32
+ params: AgentTemplateIdParams,
33
+ body: AgentTemplateUpdateBody,
34
+ },
35
+ {
36
+ route: "GET /api/v1/orgs/:orgId/agent-templates/:id/delete-preview",
37
+ params: AgentTemplateIdParams,
38
+ },
39
+ { route: "DELETE /api/v1/orgs/:orgId/agent-templates/:id", params: AgentTemplateIdParams },
40
+ {
41
+ route: "PUT /api/v1/orgs/:orgId/agent-templates/:id/shareable",
42
+ params: AgentTemplateIdParams,
43
+ body: AgentTemplateShareableBody,
44
+ },
45
+ ];
@@ -13,9 +13,10 @@ import { CurrentPrincipal, patTokenId, requireUser, } from "../identity/principa
13
13
  import { createZodDto } from "../infra/validation/create-zod-dto.js";
14
14
  import { ZParam, ZQuery } from "../infra/validation/zod-params.js";
15
15
  import { CurrentOrg, OrgAction } from "../orgs/org.guard.js";
16
+ import { BackgroundConversationParams, BackgroundTaskParams } from "./background.schemas.js";
16
17
  import { BackgroundTasks, OUTPUT_TAIL_MAX_BYTES, } from "./tasks.service.js";
17
- const ConversationParams = z.object({ id: z.string().min(1).max(100) });
18
- const TaskParams = z.object({ id: z.string().min(1).max(100), taskId: z.string().min(1).max(100) });
18
+ const ConversationParams = BackgroundConversationParams;
19
+ const TaskParams = BackgroundTaskParams;
19
20
  const OutputQuery = z.object({
20
21
  tail: z.coerce.number().int().min(1).max(OUTPUT_TAIL_MAX_BYTES).default(OUTPUT_TAIL_MAX_BYTES),
21
22
  });
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ import type { RouteSchemas } from "../platform/route-schemas.js";
3
+ export declare const BackgroundConversationParams: z.ZodObject<{
4
+ id: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const BackgroundTaskParams: z.ZodObject<{
7
+ id: z.ZodString;
8
+ taskId: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export declare const BACKGROUND_ROUTES: readonly RouteSchemas[];
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ export const BackgroundConversationParams = z.object({ id: z.string().min(1).max(100) });
3
+ export const BackgroundTaskParams = z.object({
4
+ id: z.string().min(1).max(100),
5
+ taskId: z.string().min(1).max(100),
6
+ });
7
+ export const BACKGROUND_ROUTES = [
8
+ {
9
+ route: "GET /api/v1/orgs/:orgId/conversations/:id/background-tasks",
10
+ params: BackgroundConversationParams,
11
+ },
12
+ {
13
+ route: "POST /api/v1/orgs/:orgId/conversations/:id/background-tasks/:taskId/stop",
14
+ params: BackgroundTaskParams,
15
+ },
16
+ ];
@@ -61,7 +61,7 @@ export declare class BackgroundTasks {
61
61
  * stop already claimed the task (or the task is a reservation still launching, which its launch
62
62
  * then kills); a stop that fails throws. Writes the `background_task.stopped` audit event.
63
63
  */
64
- stop(orgId: string, conversationId: string, accountId: string, taskId: string, actorTokenId?: string): Promise<BackgroundTaskView>;
64
+ stop(orgId: string, conversationId: string, accountId: string, taskId: string, actorTokenId?: string, auditDetail?: Record<string, unknown>): Promise<BackgroundTaskView>;
65
65
  /**
66
66
  * Whether the task's environment may still be used by its conversation's owner (the access
67
67
  * re-check every sandbox tool call makes); when it may not, the live read is skipped.
@@ -100,7 +100,7 @@ let BackgroundTasks = class BackgroundTasks {
100
100
  * stop already claimed the task (or the task is a reservation still launching, which its launch
101
101
  * then kills); a stop that fails throws. Writes the `background_task.stopped` audit event.
102
102
  */
103
- async stop(orgId, conversationId, accountId, taskId, actorTokenId) {
103
+ async stop(orgId, conversationId, accountId, taskId, actorTokenId, auditDetail) {
104
104
  const task = await this.owned(orgId, conversationId, accountId, taskId);
105
105
  const after = await this.stopper.stop(task, "person");
106
106
  await audit(this.db.db, {
@@ -109,7 +109,12 @@ let BackgroundTasks = class BackgroundTasks {
109
109
  orgId,
110
110
  action: "background_task.stopped",
111
111
  target: task.id,
112
- detail: { taskId: task.id, conversationId: task.conversationId, status: after.status },
112
+ detail: {
113
+ taskId: task.id,
114
+ conversationId: task.conversationId,
115
+ status: after.status,
116
+ ...auditDetail,
117
+ },
113
118
  });
114
119
  return this.view(after, conversationId);
115
120
  }
@@ -1,20 +1,12 @@
1
1
  import type { FastifyReply } from "fastify";
2
2
  import { z } from "zod";
3
3
  import { type Principal } from "../identity/principal.js";
4
+ import { CatalogItemsQuery, CatalogUpdateBody, CatalogUpdatePreviewBody, CatalogDisabledBody as DisabledBody, CatalogGitImportBody as GitBody, CatalogNpmImportBody as NpmBody, CatalogScopeBody as ScopeBody, CatalogScopePreviewBody as ScopePreviewBody, CatalogShownBody as ShownBody } from "./admin-catalog.schemas.js";
4
5
  import { type CatalogItemDetail, type CatalogItemView, CatalogService, type PermissionsMismatch } from "./catalog.service.js";
5
6
  import { CatalogScopeService, type ScopePreview } from "./catalog-scope.service.js";
6
7
  import { OrgCatalogService } from "./org-catalog.service.js";
7
8
  import { type PluginConfirmResult, PluginImport, type PluginReview } from "./plugin-import.js";
8
9
  import { PlatformPluginUpdater, type PlatformUpdatePreview, type PlatformUpdateResult } from "./plugin-upgrade.js";
9
- declare const NpmBody: z.ZodObject<{
10
- package: z.ZodString;
11
- version: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>;
13
- declare const GitBody: z.ZodObject<{
14
- url: z.ZodString;
15
- ref: z.ZodOptional<z.ZodString>;
16
- path: z.ZodOptional<z.ZodString>;
17
- }, z.core.$strict>;
18
10
  declare const ConfirmBody: z.ZodObject<{
19
11
  reviewHash: z.ZodString;
20
12
  scope: z.ZodOptional<z.ZodEnum<{
@@ -25,44 +17,6 @@ declare const ConfirmBody: z.ZodObject<{
25
17
  orgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
18
  pinnedSuggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
19
  }, z.core.$strict>;
28
- /** `{ scope, orgs? }` (a scope change) or `{ disabled: true }` (a disable), not both. */
29
- declare const ScopePreviewBody: z.ZodObject<{
30
- scope: z.ZodOptional<z.ZodEnum<{
31
- all: "all";
32
- named: "named";
33
- optional: "optional";
34
- }>>;
35
- orgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
- disabled: z.ZodOptional<z.ZodLiteral<true>>;
37
- }, z.core.$strict>;
38
- declare const ScopeBody: z.ZodObject<{
39
- scope: z.ZodEnum<{
40
- all: "all";
41
- named: "named";
42
- optional: "optional";
43
- }>;
44
- orgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
- scopeHash: z.ZodString;
46
- }, z.core.$strict>;
47
- declare const DisabledBody: z.ZodObject<{
48
- disabled: z.ZodBoolean;
49
- scopeHash: z.ZodOptional<z.ZodString>;
50
- }, z.core.$strict>;
51
- declare const ShownBody: z.ZodObject<{
52
- shownToOthers: z.ZodBoolean;
53
- }, z.core.$strict>;
54
- declare const ListQuery: z.ZodObject<{
55
- includeDeleted: z.ZodOptional<z.ZodEnum<{
56
- false: "false";
57
- true: "true";
58
- }>>;
59
- limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
60
- offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
61
- pending: z.ZodOptional<z.ZodEnum<{
62
- false: "false";
63
- true: "true";
64
- }>>;
65
- }, z.core.$strip>;
66
20
  declare const ConfirmPermissionsBody: z.ZodObject<{
67
21
  permissionsHash: z.ZodString;
68
22
  }, z.core.$strict>;
@@ -70,13 +24,6 @@ declare const ConfirmPermissionsBody: z.ZodObject<{
70
24
  declare const RejectBody: z.ZodObject<{
71
25
  reason: z.ZodOptional<z.ZodString>;
72
26
  }, z.core.$strict>;
73
- declare const UpdatePreviewBody: z.ZodObject<{
74
- version: z.ZodString;
75
- }, z.core.$strict>;
76
- declare const UpdateBody: z.ZodObject<{
77
- version: z.ZodString;
78
- diffHash: z.ZodString;
79
- }, z.core.$strict>;
80
27
  /**
81
28
  * The platform catalog (`/api/v1/admin/catalog/*`, super admins): plugin import (upload / npm
82
29
  * prepare, then confirm, which installs the plugin's extension), the item list and detail, scope and
@@ -157,7 +104,7 @@ export declare class AdminCatalogController {
157
104
  * The item list (`includeDeleted=true` includes deleted items). Paging: `limit` (default 200, at
158
105
  * most 1000) and `offset`; `nextOffset` is the next page's offset, null when there is none.
159
106
  */
160
- list(q: z.infer<typeof ListQuery>): Promise<{
107
+ list(q: z.infer<typeof CatalogItemsQuery>): Promise<{
161
108
  items: CatalogItemView[];
162
109
  nextOffset: number | null;
163
110
  }>;
@@ -226,7 +173,7 @@ export declare class AdminCatalogController {
226
173
  * `plugin.upgrade_target_invalid`; an added skill named like one in use where the plugin is on
227
174
  * -> 409 `plugin.skill_conflict`; disabled -> 403 `catalog.item_disabled`.
228
175
  */
229
- previewUpdate(id: string, body: z.infer<typeof UpdatePreviewBody>): Promise<PlatformUpdatePreview>;
176
+ previewUpdate(id: string, body: z.infer<typeof CatalogUpdatePreviewBody>): Promise<PlatformUpdatePreview>;
230
177
  /**
231
178
  * Updates the platform plugin, confirmed with the preview's `diffHash` (recomputed under the item
232
179
  * lock; a difference -> 409 `plugin.upgrade_stale`; another update running -> 409
@@ -235,7 +182,7 @@ export declare class AdminCatalogController {
235
182
  * version waits) -> 409 `catalog.item_pending`: confirm it in 待确认 (pre-flight F8); the
236
183
  * preview answers the same.
237
184
  */
238
- update(principal: Principal, id: string, body: z.infer<typeof UpdateBody>): Promise<PlatformUpdateResult>;
185
+ update(principal: Principal, id: string, body: z.infer<typeof CatalogUpdateBody>): Promise<PlatformUpdateResult>;
239
186
  /** 删除条目(软删除,已安装的组件不受影响)。 */
240
187
  remove(principal: Principal, id: string): Promise<void>;
241
188
  }