@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
@@ -9,12 +9,12 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
9
  };
10
10
  import { Inject, Injectable } from "@nestjs/common";
11
11
  import { z } from "zod";
12
+ import { CatalogItemPathParams, CatalogMarketplaceRequestBody, CatalogRequestBody, CatalogRequestsListQuery, } from "../../catalog/org-catalog.schemas.js";
12
13
  import { CatalogRequestsService } from "../../catalog/requests.service.js";
13
14
  import { defineOperation } from "../operation.js";
14
15
  import { PlatformOperations } from "../registry.js";
15
- import { asToolError, viaAgent } from "./errors.js";
16
+ import { viaAgent } from "./errors.js";
16
17
  import { Cursor, pageOf, startOf } from "./paging.js";
17
- const Note = z.string().max(1000);
18
18
  /** A request as the requester reads it (no org name: it is this org's). */
19
19
  const view = (r) => ({
20
20
  id: r.id,
@@ -28,6 +28,25 @@ const view = (r) => ({
28
28
  decidedAt: r.decidedAt,
29
29
  createdAt: r.createdAt,
30
30
  });
31
+ /** A platform request as the super admin's list shows it: a compact row (the inbox's summary). */
32
+ const platformRow = (r) => ({
33
+ id: r.id,
34
+ name: r.item?.name ?? r.entry?.name ?? r.kind,
35
+ state: r.status,
36
+ kind: r.kind,
37
+ org: r.orgName,
38
+ createdAt: r.createdAt,
39
+ });
40
+ /** A member's pending request as the org admins' list shows it: a compact row (the inbox's). */
41
+ const pendingRow = (r) => ({
42
+ id: r.id,
43
+ name: r.item?.name ?? r.entry?.name ?? r.agent?.name ?? r.kind,
44
+ state: r.status,
45
+ kind: r.kind,
46
+ requestedBy: r.requestedByName,
47
+ note: r.note,
48
+ next: "Decide it on the web, in the inbox; agents never decide requests.",
49
+ });
31
50
  /**
32
51
  * Request operations of the `Platform` tool (spec §7): a member asks the org admins to switch a
33
52
  * plugin on, an org admin asks the super admin for access to a plugin or for an import from a
@@ -59,11 +78,8 @@ let RequestsOperations = class RequestsOperations {
59
78
  id: "requests.create",
60
79
  description: 'Ask for a plugin: kind "enable" asks the org admins to switch on a plugin that is off in this org (members and up); kind "access" asks the super admin to offer this org a plugin it sees as not_offered (org admins). Take the plugin id and state from plugins.list. An optional note says why.',
61
80
  input: z
62
- .object({
63
- itemId: z.string().min(1).max(100),
64
- kind: z.enum(["enable", "access"]),
65
- note: Note.optional(),
66
- })
81
+ .object({ itemId: CatalogItemPathParams.shape.itemId.max(100) })
82
+ .extend(CatalogRequestBody.shape)
67
83
  .strict(),
68
84
  example: {
69
85
  itemId: "3f1c2a9e-5b7d-4e21-9c0a-1d2e3f4a5b6c",
@@ -96,21 +112,14 @@ let RequestsOperations = class RequestsOperations {
96
112
  zh: `向超级管理员申请插件 ${i.itemId} 的使用权`,
97
113
  en: `Request access to plugin ${i.itemId} from the super admin`,
98
114
  },
99
- run: async (input, ctx) => asToolError(async () => ({
115
+ run: async (input, ctx) => ({
100
116
  request: view(await this.requests.requestItem(ctx.orgId, ctx.actorAccountId, input.itemId, { kind: input.kind, ...(input.note !== undefined && { note: input.note }) }, { auditDetail: viaAgent("requests.create", ctx) })),
101
- })),
117
+ }),
102
118
  }),
103
119
  defineOperation({
104
120
  id: "requests.create-import",
105
121
  description: "Ask the super admin to import a plugin from a marketplace into the platform catalog (org admins, when the platform lets orgs browse): the marketplaceId, name and version from marketplaces.entries, and an optional note.",
106
- input: z
107
- .object({
108
- marketplaceId: z.string().min(1).max(100),
109
- name: z.string().min(1).max(214),
110
- version: z.string().min(1).max(100),
111
- note: Note.optional(),
112
- })
113
- .strict(),
122
+ input: CatalogMarketplaceRequestBody,
114
123
  example: { marketplaceId: "official", name: "github", version: "1.4.0" },
115
124
  authz: { orgAction: "catalog.decide" },
116
125
  mirrors: ["POST /api/v1/orgs/:orgId/marketplace-requests"],
@@ -133,14 +142,43 @@ let RequestsOperations = class RequestsOperations {
133
142
  zh: `申请从市场导入插件 ${i.name} ${i.version}`,
134
143
  en: `Request the import of plugin ${i.name} ${i.version} from a marketplace`,
135
144
  }),
136
- run: async (input, ctx) => asToolError(async () => ({
145
+ run: async (input, ctx) => ({
137
146
  request: view(await this.requests.requestImport(ctx.orgId, ctx.actorAccountId, {
138
147
  marketplaceId: input.marketplaceId,
139
148
  name: input.name,
140
149
  version: input.version,
141
150
  ...(input.note !== undefined && { note: input.note }),
142
151
  }, { auditDetail: viaAgent("requests.create-import", ctx) })),
143
- })),
152
+ }),
153
+ }),
154
+ defineOperation({
155
+ id: "requests.pending",
156
+ description: "List the requests members sent this org's admins that wait for a decision (org admins), as the inbox shows them, newest first: kind enable (switch a plugin on) or connector_setup (set up an agent's connectors), what it is about (the plugin or the agent), who asked and their note. Deciding them is done on the web. Pages by 50: pass the returned next as params.cursor.",
157
+ input: z.object({ cursor: Cursor.optional() }).strict(),
158
+ example: {},
159
+ authz: { orgAction: "catalog.decide" },
160
+ mirrors: [],
161
+ confirm: "read",
162
+ run: async (input, ctx) => {
163
+ const all = await this.requests.listForOrgAdmin(ctx.orgId, ctx.actorAccountId);
164
+ return pageOf(all.map(pendingRow), startOf(input.cursor), 50);
165
+ },
166
+ }),
167
+ defineOperation({
168
+ id: "requests.platform-list",
169
+ description: "List the requests orgs sent the super admin (super admin): access to a plugin and imports from a marketplace, one compact row each (what, status, kind, the requesting org, when), newest first; pending by default, or filter by status. Deciding them is done on the web. Pages by 50: pass the returned next as params.cursor.",
170
+ input: z
171
+ .object({ status: CatalogRequestsListQuery.shape.status, cursor: Cursor.optional() })
172
+ .strict(),
173
+ example: {},
174
+ authz: { superAdmin: true },
175
+ mirrors: ["GET /api/v1/admin/catalog/requests"],
176
+ extras: ["cursor"],
177
+ confirm: "read",
178
+ run: async (input) => {
179
+ const all = await this.requests.listDeployment(input.status !== undefined ? { status: input.status } : {});
180
+ return pageOf(all.map(platformRow), startOf(input.cursor), 50);
181
+ },
144
182
  }),
145
183
  ]);
146
184
  }
@@ -1,4 +1,5 @@
1
1
  import { type OnModuleInit } from "@nestjs/common";
2
+ import { OwnedItems } from "../../catalog/owned-items.js";
2
3
  import { SkillsService } from "../../skills/skills.service.js";
3
4
  import { PlatformOperations } from "../registry.js";
4
5
  /**
@@ -8,6 +9,9 @@ import { PlatformOperations } from "../registry.js";
8
9
  export declare class SkillsOperations implements OnModuleInit {
9
10
  private readonly registry;
10
11
  private readonly skills;
11
- constructor(registry: PlatformOperations, skills: SkillsService);
12
+ private readonly owned;
13
+ constructor(registry: PlatformOperations, skills: SkillsService, owned: OwnedItems);
14
+ /** The skill's name for a card summary; its id when it cannot be read. */
15
+ private skillName;
12
16
  onModuleInit(): void;
13
17
  }
@@ -9,12 +9,17 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
9
  };
10
10
  import { Inject, Injectable } from "@nestjs/common";
11
11
  import { z } from "zod";
12
+ import { OwnedItems } from "../../catalog/owned-items.js";
13
+ import { SkillCreateFields, SkillIdParams, SkillPathParams, SkillShareableSchema, } from "../../skills/skills.schemas.js";
12
14
  import { SkillsService } from "../../skills/skills.service.js";
13
15
  import { defineOperation } from "../operation.js";
14
16
  import { PlatformOperations } from "../registry.js";
15
- import { asToolError, viaAgent } from "./errors.js";
17
+ import { precheckBy, viaAgent } from "./errors.js";
18
+ import { named, orElse } from "./summary.js";
16
19
  const NoInput = z.object({}).strict();
17
- const SkillId = z.object({ skillId: z.string().min(1).max(100) }).strict();
20
+ const SkillId = z.object({ skillId: SkillPathParams.shape.id.max(100) }).strict();
21
+ const Create = SkillCreateFields.shape;
22
+ const OwnedSkillId = z.object({ skillId: SkillIdParams.shape.id }).strict();
18
23
  /**
19
24
  * Skill library operations of the `Platform` tool (spec §7). The skill body can be long; `get`
20
25
  * returns it whole because reading it is the point of the call.
@@ -22,9 +27,15 @@ const SkillId = z.object({ skillId: z.string().min(1).max(100) }).strict();
22
27
  let SkillsOperations = class SkillsOperations {
23
28
  registry;
24
29
  skills;
25
- constructor(registry, skills) {
30
+ owned;
31
+ constructor(registry, skills, owned) {
26
32
  this.registry = registry;
27
33
  this.skills = skills;
34
+ this.owned = owned;
35
+ }
36
+ /** The skill's name for a card summary; its id when it cannot be read. */
37
+ skillName(orgId, skillId) {
38
+ return orElse(async () => named((await this.skills.get(orgId, skillId)).name), skillId);
28
39
  }
29
40
  onModuleInit() {
30
41
  this.registry.register([
@@ -45,18 +56,20 @@ let SkillsOperations = class SkillsOperations {
45
56
  example: { skillId: "0b9f2c4e-1d3a-4c55-9e0a-7a2f6d1c8b11" },
46
57
  authz: { orgAction: "skills.read" },
47
58
  mirrors: ["GET /api/v1/orgs/:orgId/skills/:id"],
59
+ renames: { skillId: "id" },
48
60
  confirm: "read",
49
- run: async (input, ctx) => asToolError(() => this.skills.get(ctx.orgId, input.skillId)),
61
+ run: async (input, ctx) => this.skills.get(ctx.orgId, input.skillId),
50
62
  }),
51
63
  defineOperation({
52
64
  id: "skills.create",
53
65
  description: "Create an org skill from text: a name, a one-line description of when to use it, and the SKILL.md body. A skill of that name must not exist yet. Uploads of packages are done on the web.",
66
+ // the route's text form, its bounds tightened for the model (a SKILL.md up to 100k chars)
54
67
  input: z
55
68
  .object({
56
- name: z.string().min(1).max(64),
57
- description: z.string().min(1).max(1024),
58
- body: z.string().min(1).max(100_000),
59
- shareable: z.boolean().optional(),
69
+ name: Create.name.unwrap().max(64),
70
+ description: Create.description.unwrap(),
71
+ body: Create.body.unwrap().min(1).max(100_000),
72
+ shareable: Create.shareable,
60
73
  })
61
74
  .strict(),
62
75
  example: {
@@ -66,26 +79,130 @@ let SkillsOperations = class SkillsOperations {
66
79
  },
67
80
  authz: { orgAction: "skills.manage" },
68
81
  mirrors: ["POST /api/v1/orgs/:orgId/skills"],
82
+ // packages are uploaded on the web
83
+ omits: ["uploadId"],
69
84
  confirm: "org",
70
85
  errors: [
71
86
  {
72
87
  code: "skill.name_exists",
73
88
  next: "A skill of that name exists: pick another name, or read the existing one with skills.get.",
74
89
  },
90
+ {
91
+ code: "validation_failed",
92
+ next: "Fix the SKILL.md as the message says (name, description, body), then call again.",
93
+ },
94
+ {
95
+ code: "catalog.custom_disabled",
96
+ next: {
97
+ superAdmin: "The platform does not allow custom skills: allow them in the admin console under Settings, then call again.",
98
+ orgAdmin: "The platform does not allow custom skills; ask the super admin, or use a platform skill from skills.list.",
99
+ member: "The platform does not allow custom skills; use a platform skill from skills.list, or ask an org admin.",
100
+ },
101
+ },
75
102
  ],
103
+ precheck: (i, ctx) => precheckBy(() => this.skills.checkCreateFromText(ctx.orgId, i)),
76
104
  summary: (i) => i.shareable === true
77
105
  ? {
78
106
  zh: `新建组织技能「${i.name}」(可共享给其他组织)`,
79
107
  en: `Create org skill "${i.name}" (shared with other orgs)`,
80
108
  }
81
109
  : { zh: `新建组织技能「${i.name}」`, en: `Create org skill "${i.name}"` },
82
- run: async (input, ctx) => asToolError(() => this.skills.createFromText(ctx.orgId, ctx.actorAccountId, {
110
+ run: async (input, ctx) => this.skills.createFromText(ctx.orgId, ctx.actorAccountId, {
83
111
  name: input.name,
84
112
  description: input.description,
85
113
  body: input.body,
86
114
  ...(input.shareable !== undefined && { shareable: input.shareable }),
87
115
  auditDetail: viaAgent("skills.create", ctx),
88
- })),
116
+ }),
117
+ }),
118
+ defineOperation({
119
+ id: "skills.set-shareable",
120
+ description: "Set whether an org skill may be shared with other orgs. Only the org's own skills can be changed; a skill that came from a platform plugin cannot.",
121
+ input: OwnedSkillId.extend({ shareable: SkillShareableSchema.shape.shareable }).strict(),
122
+ example: { skillId: "0b9f2c4e-1d3a-4c55-9e0a-7a2f6d1c8b11", shareable: true },
123
+ authz: { orgAction: "skills.manage" },
124
+ mirrors: ["PUT /api/v1/orgs/:orgId/skills/:id/shareable"],
125
+ renames: { skillId: "id" },
126
+ confirm: "org",
127
+ errors: [
128
+ {
129
+ code: "skill.not_found",
130
+ next: "Check the skill id with skills.list; only the org's own skills can be changed or deleted here.",
131
+ },
132
+ {
133
+ code: "catalog.not_owned",
134
+ next: "Only a skill the org created can be shared; a platform skill or a copy of another owner's is not the org's to share.",
135
+ },
136
+ ],
137
+ precheck: (i, ctx) => precheckBy(() => this.owned.previewSkillDelete(ctx.orgId, i.skillId)),
138
+ summary: async (i, ctx) => {
139
+ const n = await this.skillName(ctx.orgId, i.skillId);
140
+ return i.shareable
141
+ ? {
142
+ zh: `允许把组织技能「${n}」共享给其他组织`,
143
+ en: `Allow org skill "${n}" to be shared with other orgs`,
144
+ }
145
+ : {
146
+ zh: `不再把组织技能「${n}」共享给其他组织`,
147
+ en: `Stop sharing org skill "${n}" with other orgs`,
148
+ };
149
+ },
150
+ run: async (input, ctx) => {
151
+ await this.owned.setShareable(ctx.orgId, ctx.actorAccountId, { kind: "skill", id: input.skillId }, input.shareable, { auditDetail: viaAgent("skills.set-shareable", ctx) });
152
+ return { id: input.skillId, shareable: input.shareable };
153
+ },
154
+ }),
155
+ defineOperation({
156
+ id: "skills.delete-preview",
157
+ description: "Preview deleting an org skill (org admins): whether it is removed or handed to the platform because another org uses it, and which of the org's agents lose it. Show it to the person before skills.delete.",
158
+ input: OwnedSkillId,
159
+ example: { skillId: "0b9f2c4e-1d3a-4c55-9e0a-7a2f6d1c8b11" },
160
+ authz: { orgAction: "skills.manage" },
161
+ mirrors: ["GET /api/v1/orgs/:orgId/skills/:id/delete-preview"],
162
+ renames: { skillId: "id" },
163
+ confirm: "read",
164
+ errors: [
165
+ {
166
+ code: "skill.not_found",
167
+ next: "Check the skill id with skills.list; only the org's own skills can be changed or deleted here.",
168
+ },
169
+ ],
170
+ run: async (input, ctx) => ({
171
+ preview: await this.owned.previewSkillDelete(ctx.orgId, input.skillId),
172
+ }),
173
+ }),
174
+ defineOperation({
175
+ id: "skills.delete",
176
+ description: "Delete an org skill. Agents of the org that use it lose it; a skill another org uses is handed to the platform instead of removed. Read skills.delete-preview first and show it to the person.",
177
+ input: OwnedSkillId,
178
+ example: { skillId: "0b9f2c4e-1d3a-4c55-9e0a-7a2f6d1c8b11" },
179
+ authz: { orgAction: "skills.manage" },
180
+ mirrors: ["DELETE /api/v1/orgs/:orgId/skills/:id"],
181
+ renames: { skillId: "id" },
182
+ confirm: "org",
183
+ errors: [
184
+ {
185
+ code: "skill.not_found",
186
+ next: "Check the skill id with skills.list; only the org's own skills can be changed or deleted here.",
187
+ },
188
+ ],
189
+ precheck: (i, ctx) => precheckBy(() => this.owned.previewSkillDelete(ctx.orgId, i.skillId)),
190
+ summary: async (i, ctx) => {
191
+ const n = await this.skillName(ctx.orgId, i.skillId);
192
+ const p = await orElse(() => this.owned.previewSkillDelete(ctx.orgId, i.skillId), null);
193
+ const agents = p?.agents.length ?? 0;
194
+ const handed = p?.outcome === "transferred";
195
+ return {
196
+ zh: `删除组织技能「${n}」:${agents} 个智能体将失去它${handed ? ";其他组织在用,将转为平台技能" : ""}`,
197
+ en: `Delete org skill "${n}": ${agents} agents lose it${handed ? "; another org uses it, so it becomes a platform skill" : ""}`,
198
+ };
199
+ },
200
+ run: async (input, ctx) => ({
201
+ id: input.skillId,
202
+ outcome: await this.owned.deleteSkill(ctx.orgId, ctx.actorAccountId, input.skillId, {
203
+ auditDetail: viaAgent("skills.delete", ctx),
204
+ }),
205
+ }),
89
206
  }),
90
207
  ]);
91
208
  }
@@ -93,6 +210,7 @@ let SkillsOperations = class SkillsOperations {
93
210
  SkillsOperations = __decorate([
94
211
  Injectable(),
95
212
  __param(0, Inject(PlatformOperations)),
96
- __param(1, Inject(SkillsService))
213
+ __param(1, Inject(SkillsService)),
214
+ __param(2, Inject(OwnedItems))
97
215
  ], SkillsOperations);
98
216
  export { SkillsOperations };
@@ -0,0 +1,23 @@
1
+ import type { PluginUnavailableReason } from "../../catalog/catalog-content.js";
2
+ import type { KernelSchemaDb } from "../../db/kernel-schema.js";
3
+ import { type ErrorRole } from "../errors.js";
4
+ import type { OperationContext, OperationErrorNext } from "../operation.js";
5
+ /** The next step for an unavailable plugin or extension, keyed by role. */
6
+ export declare function unavailableNext(reason: PluginUnavailableReason, name: string): OperationErrorNext;
7
+ /** Why it cannot be used: "The extension of plugin "X" is not running on the platform: … (reason)." */
8
+ export declare function unavailableMessage(reason: PluginUnavailableReason, name: string): string;
9
+ /** The fields an unavailable list row or detail adds: the reason and the role's next step. */
10
+ export declare function unavailableFields(reason: PluginUnavailableReason | undefined, name: string, role: ErrorRole): {
11
+ reason?: PluginUnavailableReason;
12
+ next?: string;
13
+ };
14
+ /**
15
+ * The actor's role for next steps: the one the tool derived from this call's actor facts
16
+ * (`ctx.errorRole`), else read now with {@link errorRoleFor} (a context no tool call is behind).
17
+ */
18
+ export declare function roleFor(db: KernelSchemaDb, ctx: OperationContext): Promise<ErrorRole>;
19
+ /**
20
+ * The actor's role for next steps, read now (the super admin first, then an org admin): the
21
+ * fallback of {@link roleFor}, the same rule as `errorRoleOf` over `PlatformActor` facts.
22
+ */
23
+ export declare function errorRoleFor(db: KernelSchemaDb, orgId: string, accountId: string): Promise<ErrorRole>;
@@ -0,0 +1,111 @@
1
+ import { errorRoleOf, resolveNext } from "../errors.js";
2
+ /**
3
+ * What an unavailable plugin or extension tells the model (Platform tool spec §14.2 problems 1
4
+ * and 3): what is missing, and the next step for the actor's role. Only the super admin gets the
5
+ * admin console path; nothing names a config field or carries a value.
6
+ */
7
+ /** What is missing, per reason (model-visible English, completes "…is not running on the platform: "). */
8
+ const MISSING = {
9
+ plugin_disabled: "the super admin stopped the plugin on the platform",
10
+ not_deployed: "its extension is not installed on the platform",
11
+ needs_deployment_config: "it is installed, but its deployment config is missing or invalid",
12
+ pending_approval: "it is installed, but its permissions wait for the super admin's approval",
13
+ pending_migration: "the platform is still preparing it (database migration)",
14
+ loading: "the platform is still loading it",
15
+ dependency: "it requires an extension point that no running extension provides",
16
+ failed: "it failed to load on the platform",
17
+ deployment_disabled: "the super admin disabled it on the platform",
18
+ };
19
+ /** No request operation reaches the super admin for these (requests.create: enable / access only). */
20
+ const TELL_SUPER_ADMIN = "There is no request operation for this (requests.create covers enabling and access only), so tell the super admin directly.";
21
+ /** The member's step: inside the org, never the admin console. */
22
+ const memberNext = (name) => `Ask an org admin: the super admin must set up ${name} on the platform before anyone in the org can use it.`;
23
+ /** The next step for an unavailable plugin or extension, keyed by role. */
24
+ export function unavailableNext(reason, name) {
25
+ const adminPath = `Open the admin console → Extensions → ${name}`;
26
+ switch (reason) {
27
+ case "loading":
28
+ case "pending_migration":
29
+ return `The platform is still bringing ${name} up; wait a minute and check again with plugins.get or extensions.list.`;
30
+ case "plugin_disabled":
31
+ return {
32
+ superAdmin: "The plugin is stopped on the platform: turn it back on in the admin console under Plugins, then call again.",
33
+ orgAdmin: "The super admin stopped this plugin on the platform; ask them.",
34
+ member: "The super admin stopped this plugin on the platform; nothing can switch it on here.",
35
+ };
36
+ case "needs_deployment_config":
37
+ return {
38
+ superAdmin: `${adminPath} → fill in the deployment config; once it loads, switch the plugin on again.`,
39
+ orgAdmin: `Only the super admin can fill in the deployment config of ${name}. ${TELL_SUPER_ADMIN}`,
40
+ member: memberNext(name),
41
+ };
42
+ case "pending_approval":
43
+ return {
44
+ superAdmin: `${adminPath} → review and approve its permissions; once it loads, switch the plugin on again.`,
45
+ orgAdmin: `Only the super admin can approve the permissions of ${name}. ${TELL_SUPER_ADMIN}`,
46
+ member: memberNext(name),
47
+ };
48
+ case "dependency":
49
+ return {
50
+ superAdmin: `${adminPath} to see the extension point it requires, then install or enable an extension that provides it.`,
51
+ orgAdmin: `Only the super admin can provide what ${name} requires. ${TELL_SUPER_ADMIN}`,
52
+ member: memberNext(name),
53
+ };
54
+ case "failed":
55
+ return {
56
+ superAdmin: `${adminPath} to see why it failed to load; fix its deployment config or reinstall it.`,
57
+ orgAdmin: `Only the super admin can fix ${name}, which failed to load. ${TELL_SUPER_ADMIN}`,
58
+ member: memberNext(name),
59
+ };
60
+ case "deployment_disabled":
61
+ return {
62
+ superAdmin: `${adminPath} → enable it; once it loads, switch the plugin on again.`,
63
+ orgAdmin: `Only the super admin can enable ${name} on the platform. ${TELL_SUPER_ADMIN}`,
64
+ member: memberNext(name),
65
+ };
66
+ case "not_deployed":
67
+ return {
68
+ superAdmin: `Install the extension of ${name}: admin console → Extensions (or update the plugin in the admin console under Plugins), then switch it on again.`,
69
+ orgAdmin: `Only the super admin can install the extension of ${name}. ${TELL_SUPER_ADMIN}`,
70
+ member: memberNext(name),
71
+ };
72
+ }
73
+ }
74
+ /** Why it cannot be used: "The extension of plugin "X" is not running on the platform: … (reason)." */
75
+ export function unavailableMessage(reason, name) {
76
+ if (reason === "plugin_disabled")
77
+ return `Plugin "${name}" is unavailable: ${MISSING[reason]}.`;
78
+ return `The extension of "${name}" is not running on the platform: ${MISSING[reason]} (${reason}).`;
79
+ }
80
+ /** The fields an unavailable list row or detail adds: the reason and the role's next step. */
81
+ export function unavailableFields(reason, name, role) {
82
+ if (reason === undefined)
83
+ return {};
84
+ const next = resolveNext(unavailableNext(reason, name), role);
85
+ return { reason, ...(next !== undefined && { next }) };
86
+ }
87
+ /**
88
+ * The actor's role for next steps: the one the tool derived from this call's actor facts
89
+ * (`ctx.errorRole`), else read now with {@link errorRoleFor} (a context no tool call is behind).
90
+ */
91
+ export function roleFor(db, ctx) {
92
+ return ctx.errorRole !== undefined
93
+ ? Promise.resolve(ctx.errorRole)
94
+ : errorRoleFor(db, ctx.orgId, ctx.actorAccountId);
95
+ }
96
+ /**
97
+ * The actor's role for next steps, read now (the super admin first, then an org admin): the
98
+ * fallback of {@link roleFor}, the same rule as `errorRoleOf` over `PlatformActor` facts.
99
+ */
100
+ export async function errorRoleFor(db, orgId, accountId) {
101
+ const row = await db
102
+ .selectFrom("accounts")
103
+ .leftJoin("memberships", (j) => j.onRef("memberships.account_id", "=", "accounts.id").on("memberships.org_id", "=", orgId))
104
+ .select(["accounts.is_super_admin", "accounts.status", "memberships.role"])
105
+ .where("accounts.id", "=", accountId)
106
+ .executeTakeFirst();
107
+ return errorRoleOf({
108
+ role: row?.role ?? null,
109
+ isSuperAdmin: row?.is_super_admin === true && row.status === "active",
110
+ });
111
+ }
@@ -0,0 +1,33 @@
1
+ import type { PlatformOperation } from "./operation.js";
2
+ import type { RouteSchemas } from "./route-schemas.js";
3
+ /** One difference between an operation's input and its mirrored route (spec §14.5 item 3). */
4
+ export interface ParityFinding {
5
+ op: string;
6
+ route: string;
7
+ /** The operation field (or declaration entry) it is about; absent when about the whole route. */
8
+ field?: string;
9
+ message: string;
10
+ }
11
+ /** What {@link inputParity} reads of an operation. */
12
+ export type ParityOperation = Pick<PlatformOperation, "id" | "input" | "mirrors"> & Partial<Pick<PlatformOperation, "omits" | "extras" | "renames" | "loosens">>;
13
+ /**
14
+ * Compares an operation's input with one mirrored route's body + query + path params (spec
15
+ * §14.5 item 3), on their input JSON Schemas:
16
+ * - each input field is compared with the route field of the same name, or the route path its
17
+ * `renames` entry names (`skillId` → `id`, `name` → `definition.name`): the same type (an
18
+ * operation `integer` fits a route `number`), enum values a subset, bounds no looser
19
+ * (`maxLength` / `maximum` / `maxItems` at most the route's, the lower bounds at least), the
20
+ * same `pattern` and `format`, and required where the route requires it; nested objects,
21
+ * arrays and records recursively (a nested optional route field the operation leaves out is
22
+ * allowed, a required one is not);
23
+ * - a `loosens` entry names an input field allowed to accept more than the route (with the
24
+ * reason); it is still compared by type, and an entry that loosens nothing is stale;
25
+ * - a top-level route field the input neither has nor renames into is listed in `omits`, an input
26
+ * field with no route counterpart in `extras`; stale entries of either are findings.
27
+ */
28
+ export declare function inputParity(op: ParityOperation, route: RouteSchemas): ParityFinding[];
29
+ /**
30
+ * {@link inputParity} of every operation against each route it mirrors; a mirrored route whose
31
+ * schemas are not registered is a finding too (a removed route is `check:platform-ops`'s orphan).
32
+ */
33
+ export declare function checkInputParity(ops: readonly ParityOperation[], routes: readonly RouteSchemas[]): ParityFinding[];