@capybara-hq/kernel 0.1.0-rc.77 → 0.1.0-rc.79

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 (247) hide show
  1. package/bootstrap.json +6 -6
  2. package/dist/admin/outbox-dead.service.js +4 -1
  3. package/dist/agents/admin-agents.js +2 -0
  4. package/dist/agents/agent-lookup.js +4 -0
  5. package/dist/agents/agent-profile.service.js +3 -0
  6. package/dist/agents/agents.service.js +7 -0
  7. package/dist/agents/org-templates.js +1 -0
  8. package/dist/agents/pending-connector-requests.js +6 -0
  9. package/dist/agents/pending-connectors.service.js +2 -0
  10. package/dist/agents/readiness.service.d.ts +9 -3
  11. package/dist/agents/readiness.service.js +3 -3
  12. package/dist/agents/templates.js +1 -0
  13. package/dist/background/finish.js +3 -0
  14. package/dist/background/stop.js +2 -0
  15. package/dist/background/store.js +44 -0
  16. package/dist/background/tasks.service.js +3 -2
  17. package/dist/background/wake-rules.js +1 -0
  18. package/dist/catalog/admin-catalog.controller.d.ts +6 -0
  19. package/dist/catalog/admin-catalog.controller.js +13 -0
  20. package/dist/catalog/catalog-content.d.ts +9 -0
  21. package/dist/catalog/catalog-content.js +3 -1
  22. package/dist/catalog/catalog-items.js +4 -0
  23. package/dist/catalog/catalog-scope.service.js +4 -1
  24. package/dist/catalog/component-promotion.js +2 -0
  25. package/dist/catalog/component-scope.controller.d.ts +9 -15
  26. package/dist/catalog/component-scope.controller.js +14 -9
  27. package/dist/catalog/component-scope.service.js +5 -0
  28. package/dist/catalog/component-state.d.ts +4 -1
  29. package/dist/catalog/component-state.js +4 -2
  30. package/dist/catalog/marketplace-fetch.d.ts +1 -1
  31. package/dist/catalog/marketplace-fetch.js +1 -1
  32. package/dist/catalog/marketplaces.service.d.ts +6 -1
  33. package/dist/catalog/marketplaces.service.js +8 -3
  34. package/dist/catalog/org-catalog.controller.d.ts +9 -0
  35. package/dist/catalog/org-catalog.controller.js +18 -0
  36. package/dist/catalog/org-catalog.schemas.d.ts +2 -4
  37. package/dist/catalog/org-catalog.schemas.js +2 -3
  38. package/dist/catalog/org-catalog.service.d.ts +10 -1
  39. package/dist/catalog/org-catalog.service.js +34 -23
  40. package/dist/catalog/org-extension-switch.d.ts +3 -10
  41. package/dist/catalog/org-extension-switch.js +14 -60
  42. package/dist/catalog/org-extension.controller.d.ts +6 -7
  43. package/dist/catalog/org-extension.controller.js +4 -4
  44. package/dist/catalog/org-extension.schemas.d.ts +1 -2
  45. package/dist/catalog/org-extension.schemas.js +1 -3
  46. package/dist/catalog/owned-items.js +10 -1
  47. package/dist/catalog/ownership.js +2 -0
  48. package/dist/catalog/plugin-import.d.ts +3 -0
  49. package/dist/catalog/plugin-import.js +10 -1
  50. package/dist/catalog/plugin-install.d.ts +1 -4
  51. package/dist/catalog/plugin-install.js +11 -12
  52. package/dist/catalog/plugin-upgrade.js +4 -1
  53. package/dist/catalog/request-rules.js +6 -0
  54. package/dist/catalog/requests.service.js +4 -0
  55. package/dist/catalog/scope-orgs.js +1 -0
  56. package/dist/catalog/scope-sync.d.ts +8 -5
  57. package/dist/catalog/scope-sync.js +21 -23
  58. package/dist/catalog/template-description.d.ts +17 -0
  59. package/dist/catalog/template-description.js +18 -0
  60. package/dist/catalog/unshare.js +3 -0
  61. package/dist/channels/connections.service.js +1 -0
  62. package/dist/channels/inbound.js +1 -0
  63. package/dist/channels/jobs.js +1 -0
  64. package/dist/channels/outbound.js +6 -0
  65. package/dist/channels/supervisor.js +1 -0
  66. package/dist/channels/threads.js +1 -0
  67. package/dist/client/client-reports.service.js +1 -0
  68. package/dist/config/fields.js +20 -4
  69. package/dist/config/schema.d.ts +1 -1
  70. package/dist/config/schema.js +13 -13
  71. package/dist/conversations/access.js +1 -0
  72. package/dist/conversations/attachments.service.js +16 -4
  73. package/dist/conversations/conversations.service.js +17 -3
  74. package/dist/conversations/event-log.js +2 -0
  75. package/dist/conversations/events.d.ts +1 -0
  76. package/dist/conversations/events.js +3 -1
  77. package/dist/conversations/files.js +3 -2
  78. package/dist/conversations/permission-profiles.service.js +1 -0
  79. package/dist/conversations/prompt-suggestions.js +2 -0
  80. package/dist/conversations/queue.js +8 -0
  81. package/dist/conversations/queue.service.js +6 -2
  82. package/dist/conversations/source.js +2 -0
  83. package/dist/conversations/titles.js +10 -2
  84. package/dist/conversations/tree.js +6 -0
  85. package/dist/db/kernel-schema.d.ts +5 -1
  86. package/dist/devices/conversation-devices.js +3 -0
  87. package/dist/devices/device-projects.service.js +2 -0
  88. package/dist/devices/devices.service.js +5 -0
  89. package/dist/devices/legacy-cleanup.job.js +5 -2
  90. package/dist/dial-in/handlers.js +2 -0
  91. package/dist/dial-in/machines.js +11 -2
  92. package/dist/dial-in/targets.d.ts +0 -2
  93. package/dist/dial-in/targets.js +0 -10
  94. package/dist/errors.d.ts +0 -1
  95. package/dist/errors.js +0 -1
  96. package/dist/evals/budget.js +14 -1
  97. package/dist/evals/run-replay.js +4 -0
  98. package/dist/evals/runs.service.js +13 -7
  99. package/dist/evals/sets.service.js +23 -8
  100. package/dist/evals/trajectory.service.d.ts +1 -1
  101. package/dist/evals/trajectory.service.js +1 -0
  102. package/dist/evals/worker.js +5 -1
  103. package/dist/extensions/admin-ops.js +1 -0
  104. package/dist/extensions/admin-view.js +3 -1
  105. package/dist/extensions/bootstrap-packages.d.ts +12 -1
  106. package/dist/extensions/bootstrap-packages.js +49 -9
  107. package/dist/extensions/bootstrap.d.ts +17 -2
  108. package/dist/extensions/bootstrap.js +41 -9
  109. package/dist/extensions/config-json-schema.d.ts +2 -2
  110. package/dist/extensions/config-json-schema.js +1 -3
  111. package/dist/extensions/deployment-config.d.ts +5 -3
  112. package/dist/extensions/deployment-config.js +3 -3
  113. package/dist/extensions/effective-config.d.ts +8 -7
  114. package/dist/extensions/effective-config.js +8 -7
  115. package/dist/extensions/enabled.js +1 -0
  116. package/dist/extensions/host.d.ts +4 -3
  117. package/dist/extensions/host.js +11 -12
  118. package/dist/extensions/instance.d.ts +1 -1
  119. package/dist/extensions/instance.js +17 -2
  120. package/dist/extensions/org-config.d.ts +35 -97
  121. package/dist/extensions/org-config.js +48 -315
  122. package/dist/extensions/org-levels.d.ts +22 -9
  123. package/dist/extensions/org-levels.js +100 -20
  124. package/dist/extensions/org-overrides.d.ts +14 -15
  125. package/dist/extensions/org-overrides.js +20 -20
  126. package/dist/extensions/package.js +1 -1
  127. package/dist/extensions/permission-set.d.ts +1 -3
  128. package/dist/extensions/permission-set.js +3 -7
  129. package/dist/extensions/permission-view.d.ts +3 -1
  130. package/dist/extensions/permission-view.js +5 -4
  131. package/dist/extensions/plugin-icons.d.ts +80 -1
  132. package/dist/extensions/plugin-icons.js +211 -2
  133. package/dist/extensions/point-defaults.d.ts +17 -18
  134. package/dist/extensions/point-defaults.js +25 -28
  135. package/dist/git/gateway.js +1 -1
  136. package/dist/git/identity.d.ts +1 -1
  137. package/dist/git/identity.js +2 -2
  138. package/dist/identity/accounts.js +6 -0
  139. package/dist/identity/api-tokens.js +8 -0
  140. package/dist/infra/outbox/outbox.dispatcher.js +4 -1
  141. package/dist/infra/outbox/outbox.service.js +2 -0
  142. package/dist/net/public-address.d.ts +3 -3
  143. package/dist/net/public-address.js +3 -3
  144. package/dist/orgs/directory-sync.d.ts +9 -6
  145. package/dist/orgs/directory-sync.js +15 -12
  146. package/dist/orgs/invitations.service.js +2 -0
  147. package/dist/orgs/members.service.js +2 -0
  148. package/dist/orgs/offboarding.js +2 -0
  149. package/dist/packages/npm.d.ts +10 -2
  150. package/dist/packages/npm.js +38 -6
  151. package/dist/platform/exclusions.js +20 -0
  152. package/dist/platform/ops/admin-items.ops.js +1 -0
  153. package/dist/platform/ops/agents.ops.js +1 -0
  154. package/dist/platform/ops/connectors.ops.js +7 -1
  155. package/dist/platform/ops/extensions.ops.d.ts +6 -8
  156. package/dist/platform/ops/extensions.ops.js +18 -97
  157. package/dist/platform/ops/org-plugins.ops.d.ts +3 -6
  158. package/dist/platform/ops/org-plugins.ops.js +14 -65
  159. package/dist/platform/ops/outbox.ops.js +1 -0
  160. package/dist/platform/ops/person-inputs.d.ts +0 -4
  161. package/dist/platform/ops/person-inputs.js +0 -8
  162. package/dist/platform/ops/plugins.ops.d.ts +4 -1
  163. package/dist/platform/ops/plugins.ops.js +27 -34
  164. package/dist/platform/person-fields.d.ts +1 -1
  165. package/dist/platform/person-fields.js +1 -1
  166. package/dist/platform/sealed-reveals.js +2 -0
  167. package/dist/push/recipients.js +9 -2
  168. package/dist/runtime/permission-context.service.js +1 -0
  169. package/dist/runtime/plugin-context.service.js +1 -0
  170. package/dist/runtime/project/knowledge.service.js +1 -0
  171. package/dist/runtime/run-context.service.js +1 -0
  172. package/dist/runtime/run-deletion.js +4 -0
  173. package/dist/runtime/run-execution.js +2 -0
  174. package/dist/runtime/run-finish.js +3 -0
  175. package/dist/runtime/run-jobs.js +3 -0
  176. package/dist/runtime/run-orphan-check.job.js +7 -0
  177. package/dist/runtime/run-queue.js +21 -2
  178. package/dist/runtime/run-worker.js +5 -0
  179. package/dist/runtime/step-log.js +1 -0
  180. package/dist/runtime/subagents/child.js +2 -0
  181. package/dist/runtime/subagents/deliveries.js +3 -0
  182. package/dist/runtime/subagents/dispatch.js +5 -1
  183. package/dist/runtime/subagents/messages.js +2 -0
  184. package/dist/runtime/subagents/org-agents.d.ts +1 -1
  185. package/dist/runtime/subagents/org-agents.js +2 -1
  186. package/dist/runtime/usage-report-jobs.js +1 -0
  187. package/dist/runtime/usage-report.js +3 -0
  188. package/dist/runtime/waits.js +5 -0
  189. package/dist/sandbox/cloud-permission-snapshot.js +9 -3
  190. package/dist/sandbox/device-reports.js +3 -0
  191. package/dist/sandbox/legacy-retirement.js +5 -1
  192. package/dist/sandbox/managed-device-context.js +1 -0
  193. package/dist/sandbox/modes.d.ts +5 -2
  194. package/dist/sandbox/modes.js +8 -4
  195. package/dist/sandbox/network-grants.js +2 -0
  196. package/dist/sandbox/operation-intents.js +58 -0
  197. package/dist/sandbox/operation-reconcile.job.js +2 -0
  198. package/dist/sandbox/permission-authority-lock.js +12 -6
  199. package/dist/sandbox/permission-call-grants.js +6 -0
  200. package/dist/sandbox/permission-ceiling-writes.js +5 -0
  201. package/dist/sandbox/permission-config-publication.js +5 -0
  202. package/dist/sandbox/permission-instance-writes.js +4 -0
  203. package/dist/sandbox/permission-runtime-reports.js +10 -1
  204. package/dist/sandbox/permission-transitions.js +3 -0
  205. package/dist/sandbox/review/review.service.js +8 -5
  206. package/dist/sandbox/sandbox.service.d.ts +14 -0
  207. package/dist/sandbox/sandbox.service.js +195 -29
  208. package/dist/sandbox/unreachable.js +4 -1
  209. package/dist/schedules/fire.js +9 -3
  210. package/dist/schedules/pause.js +2 -0
  211. package/dist/schedules/run-tracker.js +16 -1
  212. package/dist/schedules/scheduled-tasks.service.js +4 -2
  213. package/dist/schedules/store.js +8 -0
  214. package/dist/schedules/unattended.js +4 -0
  215. package/dist/setup/setup-checks.service.d.ts +1 -10
  216. package/dist/setup/setup-checks.service.js +19 -29
  217. package/dist/shares/share-open.service.js +1 -0
  218. package/dist/shares/shares.service.js +2 -0
  219. package/dist/skills/agent-skills.service.d.ts +1 -1
  220. package/dist/skills/agent-skills.service.js +13 -2
  221. package/dist/skills/catalog.js +3 -0
  222. package/dist/skills/changes.service.js +10 -2
  223. package/dist/skills/conversation-catalog.js +1 -0
  224. package/dist/skills/skills.service.js +4 -0
  225. package/dist/tools/approvals.service.js +40 -0
  226. package/dist/tools/builtins/schedules.js +11 -6
  227. package/dist/tools/builtins/web/fetch.js +1 -1
  228. package/dist/tools/builtins/web/search.js +1 -1
  229. package/dist/tools/connector-account-policies.js +3 -0
  230. package/dist/tools/connectors.controller.d.ts +37 -9
  231. package/dist/tools/connectors.controller.js +47 -12
  232. package/dist/tools/connectors.schemas.d.ts +4 -0
  233. package/dist/tools/connectors.schemas.js +13 -1
  234. package/dist/tools/connectors.service.d.ts +17 -0
  235. package/dist/tools/connectors.service.js +36 -2
  236. package/dist/tools/drift.js +5 -0
  237. package/dist/tools/git-push-policy.js +3 -0
  238. package/dist/tools/oauth/discovery.d.ts +2 -2
  239. package/dist/tools/oauth/discovery.js +2 -2
  240. package/dist/tools/oauth/flow.js +1 -0
  241. package/dist/tools/outputs.js +2 -0
  242. package/dist/tools/permission-approval-jobs.js +3 -0
  243. package/dist/tools/pipeline.js +2 -0
  244. package/dist/tools/policy.js +3 -0
  245. package/dist/tools/questions.service.js +13 -0
  246. package/package.json +3 -3
  247. package/src/migrations/0181_connector_description.sql +3 -0
@@ -9,10 +9,15 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
9
  };
10
10
  import { Inject, Injectable } from "@nestjs/common";
11
11
  import { sql } from "kysely";
12
+ import { readCatalogDisplayFiles, readCatalogIcon, } from "../catalog/catalog-content.js";
13
+ import { iconProblem } from "../catalog/plugin-package.js";
12
14
  import { requestable } from "../catalog/scope.js";
15
+ import { templateDescription } from "../catalog/template-description.js";
16
+ import { ApiError } from "../errors.js";
13
17
  import { KernelDb } from "../infra/database/kernel-db.js";
14
18
  import { roleAtLeast } from "../orgs/roles.js";
15
19
  import { packagePath } from "../packages/tgz.js";
20
+ import { UUID_RE } from "../ui/registry.js";
16
21
  /** The icon scope of an org route's caller (its org and role). */
17
22
  export const orgIconScope = (org) => ({
18
23
  kind: "org",
@@ -71,6 +76,210 @@ let PluginIcons = class PluginIcons {
71
76
  const icons = await this.resolve("id", ids, scope);
72
77
  return new Map(icons.map((i) => [i.id, i.url]));
73
78
  }
79
+ /**
80
+ * Platform connector template id -> the URL of the template's own icon (`ConnectorTemplateFile.
81
+ * icon`, stored as a catalog display file of the template's current version); templates without
82
+ * one, or that the reader may not see, are absent. The admin scope gets
83
+ * `GET /api/v1/admin/catalog/connector-templates/:templateId/icon` for every live template; an org
84
+ * gets `GET /api/v1/orgs/:orgId/connector-templates/:templateId/icon` only when its catalog shows
85
+ * the template's plugin (the gate of the plugin icon) and the template passes the share gate.
86
+ * The URL carries the template's version (the platform's one version of it).
87
+ */
88
+ async ofTemplates(ids, scope) {
89
+ const out = new Map();
90
+ for (const [id, version] of await this.templateIconVersions(ids, scope)) {
91
+ out.set(id, this.sourceUrl({ kind: "template", id, version }, scope));
92
+ }
93
+ return out;
94
+ }
95
+ /**
96
+ * The icon of each connector template shown (in the order given): its own icon
97
+ * ({@link ofTemplates}), else its plugin's ({@link ofItems}), else null. One lookup each for all
98
+ * rows.
99
+ */
100
+ async ofTemplatesOrItems(refs, scope) {
101
+ return (await this.sources(refs, scope)).map((s) => (s ? this.sourceUrl(s, scope) : null));
102
+ }
103
+ /**
104
+ * The icon of each connector template of a catalog item, by template file id (`connectors/<id>.
105
+ * json`, as the item detail lists them): the platform template's own icon, else the plugin's,
106
+ * else null ({@link ofTemplatesOrItems}). A file id without a live platform template gets the
107
+ * plugin's icon.
108
+ */
109
+ async ofItemTemplates(itemId, templateIds, scope) {
110
+ if (templateIds.length === 0)
111
+ return new Map();
112
+ const platform = new Map((await this.db
113
+ .selectFrom("platform_connector_templates")
114
+ .select(["id", "template_id"])
115
+ .where("catalog_item_id", "=", itemId)
116
+ .where("template_id", "in", [...new Set(templateIds)])
117
+ .where("deleted_at", "is", null)
118
+ .execute()).map((r) => [r.template_id, r.id]));
119
+ const urls = await this.ofTemplatesOrItems(templateIds.map((t) => ({ templateId: platform.get(t) ?? null, itemId })), scope);
120
+ return new Map(templateIds.map((t, i) => [t, urls[i] ?? null]));
121
+ }
122
+ /**
123
+ * The icon of each of an org's connectors (in the order given), resolved as
124
+ * {@link ofTemplatesOrItems} (its platform template's own icon, else its plugin's, else null)
125
+ * but always served by the connector's own route, `GET /api/v1/orgs/:orgId/connectors/:id/icon`
126
+ * (`connectors.use`, see {@link readConnectorIcon}): everyone who sees the connector pages,
127
+ * guests included, can load it, while the catalog's icon route stays `catalog.read`. The URL
128
+ * carries where the icon comes from and its version, so a new icon is not stale-cached.
129
+ */
130
+ async ofConnectors(rows, scope) {
131
+ const sources = await this.sources(rows, scope);
132
+ return rows.map((r, i) => {
133
+ const s = sources[i];
134
+ if (!s)
135
+ return null;
136
+ const v = `${s.kind === "template" ? "t" : "p"}-${s.version}`;
137
+ return `/api/v1/orgs/${enc(scope.orgId)}/connectors/${enc(r.id)}/icon?v=${enc(v)}`;
138
+ });
139
+ }
140
+ /**
141
+ * Platform connector template id -> its description (the template file's current version,
142
+ * {@link templateDescription}), for the templates the reader may see under the same gate as
143
+ * their own icons ({@link ofTemplates}); templates without one, or hidden, are absent. The
144
+ * connector pages show it for connectors made from a template.
145
+ */
146
+ async templateDescriptions(ids, scope) {
147
+ const out = new Map();
148
+ for (const r of await this.visibleTemplates(await this.templateRows(ids), scope)) {
149
+ const d = templateDescription(r.description);
150
+ if (d.description !== null)
151
+ out.set(r.templateId, d);
152
+ }
153
+ return out;
154
+ }
155
+ /**
156
+ * Reads the icon a connector shows ({@link ofConnectors}); the caller has checked that the
157
+ * connector is the org's. No icon the reader may see -> `catalog.icon_not_found`.
158
+ */
159
+ async readConnectorIcon(ref, scope) {
160
+ const [s] = await this.sources([ref], scope);
161
+ if (!s)
162
+ throw new ApiError("catalog.icon_not_found", "This connector has no icon");
163
+ if (s.kind === "template")
164
+ return this.readTemplateIcon(s.id, scope);
165
+ // the item's visibility was decided above (the same gate as the plugin icon route)
166
+ return readCatalogIcon(this.db.db, s.id, true);
167
+ }
168
+ /**
169
+ * Reads a connector template's own icon (served only through kernel routes with nosniff and a
170
+ * CSP sandbox, like the plugin icon). A template that is unknown, removed or not visible to the
171
+ * reader -> `component.not_found` (decided before any file is read, so "no icon" never reveals
172
+ * that it exists); no icon of its own -> `catalog.icon_not_found`; stored content that is not a
173
+ * valid svg / png (checked at import; this guards against tampered storage) -> `internal`.
174
+ */
175
+ async readTemplateIcon(templateId, scope) {
176
+ const [row] = await this.visibleTemplates(await this.templateRows([templateId]), scope);
177
+ if (row === undefined) {
178
+ throw new ApiError("component.not_found", "This connector template does not exist");
179
+ }
180
+ if (row.iconFile === undefined) {
181
+ throw new ApiError("catalog.icon_not_found", "This connector template has no icon");
182
+ }
183
+ const [file] = await readCatalogDisplayFiles(this.db, [row.iconFile]);
184
+ if (!file)
185
+ throw new ApiError("catalog.icon_not_found", "This connector template has no icon");
186
+ const problem = iconProblem(row.iconFile.path, file.data);
187
+ if (problem !== undefined)
188
+ throw new ApiError("internal", `Stored icon is invalid: ${problem}`);
189
+ return {
190
+ data: file.data,
191
+ contentType: /\.svg$/i.test(row.iconFile.path) ? "image/svg+xml" : "image/png",
192
+ };
193
+ }
194
+ /** Where each ref's icon comes from: its template's own icon, else its plugin's, else none. */
195
+ async sources(refs, scope) {
196
+ const nonNull = (xs) => xs.filter((x) => x !== null);
197
+ const [own, plugin] = await Promise.all([
198
+ this.templateIconVersions(nonNull(refs.map((r) => r.templateId)), scope),
199
+ this.resolve("id", nonNull(refs.map((r) => r.itemId)), scope),
200
+ ]);
201
+ const items = new Map(plugin.map((i) => [i.id, i.version]));
202
+ return refs.map((r) => {
203
+ const tv = r.templateId !== null ? own.get(r.templateId) : undefined;
204
+ if (r.templateId !== null && tv !== undefined) {
205
+ return { kind: "template", id: r.templateId, version: tv };
206
+ }
207
+ const iv = r.itemId !== null ? items.get(r.itemId) : undefined;
208
+ return r.itemId !== null && iv !== undefined
209
+ ? { kind: "item", id: r.itemId, version: iv }
210
+ : null;
211
+ });
212
+ }
213
+ /** The URL of an icon source on the reader's routes (template or catalog item route). */
214
+ sourceUrl(s, scope) {
215
+ const path = s.kind === "template"
216
+ ? scope.kind === "admin"
217
+ ? `/api/v1/admin/catalog/connector-templates/${enc(s.id)}/icon`
218
+ : `/api/v1/orgs/${enc(scope.orgId)}/connector-templates/${enc(s.id)}/icon`
219
+ : scope.kind === "admin"
220
+ ? `/api/v1/admin/catalog/items/${enc(s.id)}/icon`
221
+ : `/api/v1/orgs/${enc(scope.orgId)}/catalog/${enc(s.id)}/icon`;
222
+ return `${path}?v=${enc(s.version)}`;
223
+ }
224
+ /** Template id -> its version, for the templates with an own icon the reader may see. */
225
+ async templateIconVersions(ids, scope) {
226
+ const rows = (await this.templateRows(ids)).filter((r) => r.iconFile !== undefined);
227
+ return new Map((await this.visibleTemplates(rows, scope)).map((r) => [r.templateId, r.version]));
228
+ }
229
+ /** Live platform connector templates (of live items) with their item's visibility columns. */
230
+ async templateRows(ids) {
231
+ const unique = [...new Set(ids)].filter((id) => UUID_RE.test(id));
232
+ if (unique.length === 0)
233
+ return [];
234
+ const rows = await this.db
235
+ .selectFrom("platform_connector_templates as t")
236
+ .innerJoin("catalog_items as i", "i.id", "t.catalog_item_id")
237
+ .innerJoin("catalog_item_versions as v", (j) => j.onRef("v.item_id", "=", "t.catalog_item_id").onRef("v.version", "=", "t.current_version"))
238
+ .select([
239
+ "t.id as template_id",
240
+ "t.owner_org_id as template_owner_org_id",
241
+ "t.shareable as template_shareable",
242
+ "t.current_version",
243
+ sql `t.file->>'icon'`.as("icon"),
244
+ sql `t.file->'description'`.as("description"),
245
+ "v.files",
246
+ "i.id",
247
+ "i.scope",
248
+ "i.builtin",
249
+ "i.disabled",
250
+ "i.shown_to_others",
251
+ "i.owner_org_id",
252
+ "i.shareable",
253
+ "i.awaiting_confirmation",
254
+ ])
255
+ .where("t.id", "in", unique)
256
+ .where("t.deleted_at", "is", null)
257
+ .where("i.deleted_at", "is", null)
258
+ .execute();
259
+ return rows.map((r) => {
260
+ const path = r.icon === null ? undefined : packagePath(r.icon);
261
+ const files = r.files;
262
+ return {
263
+ ...r,
264
+ templateId: r.template_id,
265
+ version: r.current_version,
266
+ iconFile: path === undefined ? undefined : files.find((f) => f.path === path),
267
+ };
268
+ });
269
+ }
270
+ /**
271
+ * The templates the reader may see: every one for the admin scope; for an org, those whose
272
+ * plugin its catalog shows ({@link orgVisibleItems}) and that pass the template's own share gate
273
+ * (the platform's, the org's own, or shared by its owner).
274
+ */
275
+ async visibleTemplates(rows, scope) {
276
+ if (scope.kind === "admin")
277
+ return rows;
278
+ const shared = rows.filter((r) => r.template_owner_org_id === null ||
279
+ r.template_owner_org_id === scope.orgId ||
280
+ r.template_shareable);
281
+ return orgVisibleItems(this.db, shared, scope.orgId, scope.isAdmin);
282
+ }
74
283
  async resolve(by, keys, scope) {
75
284
  const out = [];
76
285
  const unique = [...new Set(keys)];
@@ -107,13 +316,13 @@ let PluginIcons = class PluginIcons {
107
316
  if (scope.kind === "admin") {
108
317
  for (const r of withIcon) {
109
318
  const url = `/api/v1/admin/catalog/items/${enc(r.id)}/icon?v=${enc(r.latest_version)}`;
110
- out.push({ id: r.id, name: r.name, url });
319
+ out.push({ id: r.id, name: r.name, url, version: r.latest_version });
111
320
  }
112
321
  return out;
113
322
  }
114
323
  for (const r of await orgVisibleItems(this.db, withIcon, scope.orgId, scope.isAdmin)) {
115
324
  const url = `/api/v1/orgs/${enc(scope.orgId)}/catalog/${enc(r.id)}/icon?v=${enc(r.latest_version)}`;
116
- out.push({ id: r.id, name: r.name, url });
325
+ out.push({ id: r.id, name: r.name, url, version: r.latest_version });
117
326
  }
118
327
  return out;
119
328
  }
@@ -5,14 +5,13 @@ import { EffectiveConfigs } from "./effective-config.js";
5
5
  import { OrgExtensionConfigs } from "./org-config.js";
6
6
  import { ExtensionRegistry } from "./registry.js";
7
7
  /**
8
- * The outcome of {@link ExtensionPointDefaults.resolve}: the provider with its org config and its
9
- * effective deployment config for the org (layering spec A §6), both to pass back to it.
8
+ * The outcome of {@link ExtensionPointDefaults.resolve}: the provider with its effective deployment
9
+ * config for the org (layering spec A §6), to pass back to it.
10
10
  */
11
11
  export type PointResolution<T> = {
12
12
  ok: true;
13
13
  extension: string;
14
14
  impl: T;
15
- orgConfig: unknown;
16
15
  config: unknown;
17
16
  } | {
18
17
  ok: false;
@@ -20,12 +19,11 @@ export type PointResolution<T> = {
20
19
  };
21
20
  /**
22
21
  * One provider of a multi-provider extension point for an org ({@link ExtensionPointDefaults.providersFor}),
23
- * with its org config and its effective deployment config for the org, both to pass back to it.
22
+ * with its effective deployment config for the org, to pass back to it.
24
23
  */
25
24
  export interface PointProvider<T> {
26
25
  extension: string;
27
26
  impl: T;
28
- orgConfig: unknown;
29
27
  config: unknown;
30
28
  }
31
29
  /** One `org-default` extension point of an org (the admin view). */
@@ -41,8 +39,9 @@ export interface OrgPointDefaultView {
41
39
  /**
42
40
  * The org default provider of an `org-default` extension point (web tools spec §6). Per call,
43
41
  * never cached in process: the candidates are the providers loaded on this replica that are
44
- * enabled in the org, whose org config and effective deployment config for the org (layering spec
45
- * A §6) are valid, and whose `configured()` (when present) does not return false. One candidate is used as is; several need the org's stored default
42
+ * enabled in the org, whose effective deployment config for the org (layering spec A §6) is valid,
43
+ * and whose `configured(config)` (when present) does not return false with it. One candidate is
44
+ * used as is; several need the org's stored default
46
45
  * (`capybara.org_extension_point_defaults`), else the choice is ambiguous. A stored default that
47
46
  * is not a candidate (disabled, uninstalled, unconfigured) stays and counts again once it is one.
48
47
  */
@@ -56,18 +55,18 @@ export declare class ExtensionPointDefaults {
56
55
  constructor(kdb: KernelDb, txHost: TransactionHost, registry: Pick<ExtensionRegistry, "list">, orgConfigs: Pick<OrgExtensionConfigs, "get">, effective: Pick<EffectiveConfigs, "get">, log: KernelLogger);
57
56
  /**
58
57
  * The provider of `point` (the name without the major, e.g. `web-search`) for `orgId`, with the
59
- * org's decrypted config and the effective deployment config to pass back to it. Throws when the
60
- * point has no `selection`.
58
+ * effective deployment config for the org to pass back to it. Throws when the point has no
59
+ * `selection`.
61
60
  */
62
61
  resolve<T>(orgId: string, point: string): Promise<PointResolution<T>>;
63
62
  /**
64
63
  * Every provider of `point` (the name without the major, e.g. `context`) that could serve
65
64
  * `orgId` now, in extension-name order: the same candidates {@link resolve} chooses from (loaded
66
- * here, enabled in the org, valid org and effective config, `configured()` not false), for
67
- * points whose every enabled provider is used (no `selection`). `failed`: the providers enabled
68
- * in the org whose status could not be read (reading a config or `configured()` threw, e.g. a
69
- * transient database error); they are neither serving nor known to be off. An invalid stored
70
- * org config ({@link OrgConfigInvalidError}) is not a read error: that provider is off.
65
+ * here, enabled in the org, valid effective config, `configured()` not false), for points whose
66
+ * every enabled provider is used (no `selection`). `failed`: the providers enabled in the org
67
+ * whose status could not be read (reading the effective config or `configured()` threw, e.g. a
68
+ * transient database error); they are neither serving nor known to be off. An invalid effective
69
+ * config is not a read error: that provider is off.
71
70
  */
72
71
  providersFor<T>(orgId: string, point: string): Promise<{
73
72
  providers: PointProvider<T>[];
@@ -90,20 +89,20 @@ export declare class ExtensionPointDefaults {
90
89
  auditDetail?: Record<string, unknown>): Promise<void>;
91
90
  /**
92
91
  * The candidates of `point` in `orgId`, by extension name, and the enabled providers whose status
93
- * could not be read (a read or `configured()` threw: excluded, logged). A provider whose stored
94
- * org config or effective config is invalid is excluded but not `failed`: it is known to be off.
92
+ * could not be read (a read or `configured()` threw: excluded, logged). A provider whose
93
+ * effective config is invalid is excluded but not `failed`: it is known to be off.
95
94
  */
96
95
  private candidates;
97
96
  /**
98
97
  * Whether the one provider `extension` of `point` evaluates as a candidate in `orgId`. The
99
98
  * provider must be loaded on this replica and provide `point`; the org must have it enabled; its
100
- * org config and effective config must be valid; and its `configured()` must not return false.
99
+ * effective config must be valid; and its `configured()` must not return false.
101
100
  * These are exactly the criteria of {@link providersFor} / {@link resolve}, with only that one
102
101
  * provider evaluated. A provider whose status cannot be read counts as not serving (logged).
103
102
  */
104
103
  serves(orgId: string, point: string, extension: string): Promise<boolean>;
105
104
  /**
106
- * One enabled provider's candidacy: valid org config, valid effective config and `configured()`
105
+ * One enabled provider's candidacy: enabled, a valid effective config and `configured(config)`
107
106
  * not false. Undefined when it is off; a provider whose status could not be read is also added
108
107
  * to `failed`.
109
108
  */
@@ -17,7 +17,7 @@ import { Transactional } from "../infra/database/transactional.decorator.js";
17
17
  import { KERNEL_LOGGER } from "../infra/tokens.js";
18
18
  import { EffectiveConfigs } from "./effective-config.js";
19
19
  import { enabledExtensionsQuery, isExtensionEnabled } from "./enabled.js";
20
- import { OrgConfigInvalidError, OrgExtensionConfigs } from "./org-config.js";
20
+ import { OrgExtensionConfigs } from "./org-config.js";
21
21
  import { ExtensionRegistry } from "./registry.js";
22
22
  /** The extension points whose provider each org chooses (`selection: "org-default"`). */
23
23
  function selectionPoints() {
@@ -29,8 +29,9 @@ const hasSelection = (point) => EXTENSION_POINTS[point]?.selection === "org-defa
29
29
  /**
30
30
  * The org default provider of an `org-default` extension point (web tools spec §6). Per call,
31
31
  * never cached in process: the candidates are the providers loaded on this replica that are
32
- * enabled in the org, whose org config and effective deployment config for the org (layering spec
33
- * A §6) are valid, and whose `configured()` (when present) does not return false. One candidate is used as is; several need the org's stored default
32
+ * enabled in the org, whose effective deployment config for the org (layering spec A §6) is valid,
33
+ * and whose `configured(config)` (when present) does not return false with it. One candidate is
34
+ * used as is; several need the org's stored default
34
35
  * (`capybara.org_extension_point_defaults`), else the choice is ambiguous. A stored default that
35
36
  * is not a candidate (disabled, uninstalled, unconfigured) stays and counts again once it is one.
36
37
  */
@@ -51,8 +52,8 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
51
52
  }
52
53
  /**
53
54
  * The provider of `point` (the name without the major, e.g. `web-search`) for `orgId`, with the
54
- * org's decrypted config and the effective deployment config to pass back to it. Throws when the
55
- * point has no `selection`.
55
+ * effective deployment config for the org to pass back to it. Throws when the point has no
56
+ * `selection`.
56
57
  */
57
58
  async resolve(orgId, point) {
58
59
  if (!hasSelection(point)) {
@@ -67,18 +68,17 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
67
68
  ok: true,
68
69
  extension: c.extension,
69
70
  impl: c.impl,
70
- orgConfig: c.orgConfig,
71
71
  config: c.config,
72
72
  };
73
73
  }
74
74
  /**
75
75
  * Every provider of `point` (the name without the major, e.g. `context`) that could serve
76
76
  * `orgId` now, in extension-name order: the same candidates {@link resolve} chooses from (loaded
77
- * here, enabled in the org, valid org and effective config, `configured()` not false), for
78
- * points whose every enabled provider is used (no `selection`). `failed`: the providers enabled
79
- * in the org whose status could not be read (reading a config or `configured()` threw, e.g. a
80
- * transient database error); they are neither serving nor known to be off. An invalid stored
81
- * org config ({@link OrgConfigInvalidError}) is not a read error: that provider is off.
77
+ * here, enabled in the org, valid effective config, `configured()` not false), for points whose
78
+ * every enabled provider is used (no `selection`). `failed`: the providers enabled in the org
79
+ * whose status could not be read (reading the effective config or `configured()` threw, e.g. a
80
+ * transient database error); they are neither serving nor known to be off. An invalid effective
81
+ * config is not a read error: that provider is off.
82
82
  */
83
83
  async providersFor(orgId, point) {
84
84
  const { candidates, failed } = await this.candidates(orgId, point);
@@ -86,7 +86,6 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
86
86
  providers: candidates.map((c) => ({
87
87
  extension: c.extension,
88
88
  impl: c.impl,
89
- orgConfig: c.orgConfig,
90
89
  config: c.config,
91
90
  })),
92
91
  failed,
@@ -151,8 +150,8 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
151
150
  }
152
151
  /**
153
152
  * The candidates of `point` in `orgId`, by extension name, and the enabled providers whose status
154
- * could not be read (a read or `configured()` threw: excluded, logged). A provider whose stored
155
- * org config or effective config is invalid is excluded but not `failed`: it is known to be off.
153
+ * could not be read (a read or `configured()` threw: excluded, logged). A provider whose
154
+ * effective config is invalid is excluded but not `failed`: it is known to be off.
156
155
  */
157
156
  async candidates(orgId, point) {
158
157
  const db = this.kdb.db;
@@ -178,7 +177,7 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
178
177
  /**
179
178
  * Whether the one provider `extension` of `point` evaluates as a candidate in `orgId`. The
180
179
  * provider must be loaded on this replica and provide `point`; the org must have it enabled; its
181
- * org config and effective config must be valid; and its `configured()` must not return false.
180
+ * effective config must be valid; and its `configured()` must not return false.
182
181
  * These are exactly the criteria of {@link providersFor} / {@link resolve}, with only that one
183
182
  * provider evaluated. A provider whose status cannot be read counts as not serving (logged).
184
183
  */
@@ -189,7 +188,7 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
189
188
  return (await this.evaluate(orgId, point, extension, entry.impl, new Set())) !== undefined;
190
189
  }
191
190
  /**
192
- * One enabled provider's candidacy: valid org config, valid effective config and `configured()`
191
+ * One enabled provider's candidacy: enabled, a valid effective config and `configured(config)`
193
192
  * not false. Undefined when it is off; a provider whose status could not be read is also added
194
193
  * to `failed`.
195
194
  */
@@ -199,14 +198,13 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
199
198
  cfg = await this.orgConfigs.get(orgId, extension);
200
199
  }
201
200
  catch (err) {
202
- // a stored org config that no longer validates is a known state: the provider is off
203
- // (as for an invalid effective config below); only a read that failed is `failed`
204
- const invalid = err instanceof OrgConfigInvalidError;
205
- this.log.warn(invalid
206
- ? "extension point provider excluded, its stored org config is invalid"
207
- : "extension point provider excluded, cannot read its org config", { orgId, point, extension, err });
208
- if (!invalid)
209
- failed.add(extension);
201
+ this.log.warn("extension point provider excluded, cannot read whether it is enabled", {
202
+ orgId,
203
+ point,
204
+ extension,
205
+ err,
206
+ });
207
+ failed.add(extension);
210
208
  return undefined;
211
209
  }
212
210
  if (!cfg?.enabled)
@@ -228,12 +226,11 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
228
226
  }
229
227
  if (!effective.ok)
230
228
  return undefined;
231
- const configured = impl
232
- .configured;
229
+ const configured = impl.configured;
233
230
  if (typeof configured === "function") {
234
231
  let ok;
235
232
  try {
236
- ok = configured.call(impl, cfg.config, effective.config) !== false;
233
+ ok = configured.call(impl, effective.config) !== false;
237
234
  }
238
235
  catch (err) {
239
236
  this.log.warn("extension point provider excluded, configured() threw", {
@@ -248,7 +245,7 @@ let ExtensionPointDefaults = class ExtensionPointDefaults {
248
245
  if (!ok)
249
246
  return undefined;
250
247
  }
251
- return { extension, impl, orgConfig: cfg.config, config: effective.config };
248
+ return { extension, impl, config: effective.config };
252
249
  }
253
250
  async choose(orgId, point, candidates) {
254
251
  if (candidates.length < 2)
@@ -600,7 +600,7 @@ let GitGateway = class GitGateway {
600
600
  signal: ac.signal,
601
601
  },
602
602
  // the same rules as the commit identity lookup: the deployment's egress proxy and its
603
- // private host allowance (`marketplaces.allowPrivateHosts`, e.g. an internal GitHub
603
+ // private host allowance (`net.allowPrivateHosts`, e.g. an internal GitHub
604
604
  // Enterprise host), never a redirect
605
605
  gitNetPolicy(this.config.get()));
606
606
  };
@@ -36,7 +36,7 @@ export type GitIdentityApiBase = (host: string) => string | null;
36
36
  export declare function gitIdentityApiBase(host: string): string | null;
37
37
  /**
38
38
  * The kernel's outbound rules for git hosts and their APIs: the deployment's egress proxy, its
39
- * private host exemptions (`marketplaces.allowPrivateHosts`) and loopback http only under
39
+ * private host exemptions (`net.allowPrivateHosts`) and loopback http only under
40
40
  * `tools.oauthAllowInsecureLoopback` (tests), as for OAuth URLs. Redirects are never followed.
41
41
  */
42
42
  export declare function gitNetPolicy(config: KernelConfig): NetPolicy;
@@ -36,13 +36,13 @@ export function gitIdentityApiBase(host) {
36
36
  }
37
37
  /**
38
38
  * The kernel's outbound rules for git hosts and their APIs: the deployment's egress proxy, its
39
- * private host exemptions (`marketplaces.allowPrivateHosts`) and loopback http only under
39
+ * private host exemptions (`net.allowPrivateHosts`) and loopback http only under
40
40
  * `tools.oauthAllowInsecureLoopback` (tests), as for OAuth URLs. Redirects are never followed.
41
41
  */
42
42
  export function gitNetPolicy(config) {
43
43
  return {
44
44
  allowInsecureLoopback: config.tools.oauthAllowInsecureLoopback,
45
- allowPrivateHosts: config.marketplaces.allowPrivateHosts,
45
+ allowPrivateHosts: config.net.allowPrivateHosts,
46
46
  trustedOrigins: [],
47
47
  ...(config.net.httpsProxy !== undefined && {
48
48
  proxy: { url: config.net.httpsProxy, noProxy: config.net.noProxy },
@@ -334,6 +334,8 @@ let AccountsService = class AccountsService {
334
334
  .execute();
335
335
  // the other devices stop receiving push; the current session's registrations stay
336
336
  await deletePushRegistrationsForSessions(this.db.db, sessions.map((r) => r.id));
337
+ // org-filter: a password change revokes the account's personal tokens in every org on purpose
338
+ // (accounts are platform-wide; ruling R24)
337
339
  await this.db
338
340
  .updateTable("api_tokens")
339
341
  .set({ revoked_at: sql `now()` })
@@ -579,6 +581,8 @@ let AccountsService = class AccountsService {
579
581
  if (patch.status !== undefined && patch.status !== before.status) {
580
582
  await this.ceilings.lock({}, "platform");
581
583
  await this.ceilings.publishLocked({}, "platform", patch.status === "disabled" ? (_scope, row) => row.account_id === id : false);
584
+ // org-filter: a super-admin account status change resets Full consent on the account's
585
+ // conversations in every org on purpose (accounts are platform-wide)
582
586
  await this.db
583
587
  .updateTable("conversations")
584
588
  .set((eb) => ({
@@ -623,6 +627,8 @@ let AccountsService = class AccountsService {
623
627
  .where("revoked_at", "is", null)
624
628
  .returning("id")
625
629
  .execute();
630
+ // org-filter: disabling an account (super admin) revokes its personal tokens in every org on
631
+ // purpose (accounts are platform-wide)
626
632
  await this.db
627
633
  .updateTable("api_tokens")
628
634
  .set({ revoked_at: sql `now()` })
@@ -131,6 +131,8 @@ let ApiTokenService = class ApiTokenService {
131
131
  : undefined;
132
132
  if (!kind)
133
133
  return null;
134
+ // org-filter: lookup by the token's secret hash, before any org is known; the record carries
135
+ // the token's org (or none for a personal token)
134
136
  const row = await this.db
135
137
  .selectFrom("api_tokens")
136
138
  .selectAll()
@@ -142,6 +144,7 @@ let ApiTokenService = class ApiTokenService {
142
144
  if (!row)
143
145
  return null;
144
146
  // 节流:同一令牌 5 分钟内最多写一次 last_used_at
147
+ // org-filter: by primary key of the token just authenticated above
145
148
  const touched = await this.db
146
149
  .updateTable("api_tokens")
147
150
  .set({ last_used_at: sql `now()` })
@@ -158,6 +161,8 @@ let ApiTokenService = class ApiTokenService {
158
161
  return record;
159
162
  }
160
163
  /** 列出该 scope 下未吊销的令牌(含已过期),按创建时间升序。 */
164
+ // org-filter: scoped() filters a service token by org_id and a personal one (org_id null) by
165
+ // account_id
161
166
  async list(scope) {
162
167
  const rows = await this.scoped(this.db.selectFrom("api_tokens").selectAll(), scope)
163
168
  .where("revoked_at", "is", null)
@@ -167,6 +172,8 @@ let ApiTokenService = class ApiTokenService {
167
172
  return rows.map(toRecord);
168
173
  }
169
174
  /** Revokes a token (in the context's transaction when there is one); missing, revoked or out of scope → `token.not_found`. */
175
+ // org-filter: scoped() filters a service token by org_id and a personal one (org_id null) by
176
+ // account_id
170
177
  async revoke(id, scope) {
171
178
  const r = await this.scoped(this.db.updateTable("api_tokens").set({ revoked_at: sql `now()` }), scope)
172
179
  .where("id", "=", id)
@@ -185,6 +192,7 @@ let ApiTokenService = class ApiTokenService {
185
192
  .where("revoked_at", "is", null)
186
193
  .execute();
187
194
  }
195
+ // org-filter: personal tokens belong to the account, not an org (org_id null)
188
196
  async revokeAllPersonal(accountId) {
189
197
  await this.db
190
198
  .updateTable("api_tokens")
@@ -299,7 +299,10 @@ __decorate([
299
299
  Transactional({ propagation: "requires_new" })
300
300
  ], OutboxDispatcher.prototype, "claimAndSend", null);
301
301
  OutboxDispatcher = __decorate([
302
- Injectable(),
302
+ Injectable()
303
+ // org-filter: deployment-wide relay; it claims and delivers due outbox rows of every org by row id
304
+ // (kernel-written ids, never caller input), each job carrying its own org in its data
305
+ ,
303
306
  __param(0, Inject(TransactionHost)),
304
307
  __param(1, Inject(KernelDb)),
305
308
  __param(2, Inject(KERNEL_LOGGER)),
@@ -94,6 +94,8 @@ let OutboxService = class OutboxService {
94
94
  this.deliverAfterCommit(row.id);
95
95
  return true;
96
96
  }
97
+ // org-filter: by the unique (queue, job_id) of the conflicting insert just above; job ids are
98
+ // kernel-built and the outbox is deployment-wide
97
99
  const stored = await this.db
98
100
  .selectFrom("outbox")
99
101
  .select(["job_name", "data"])
@@ -16,7 +16,7 @@ export type NetPolicy = {
16
16
  /** Testing only: plain http and loopback addresses for loopback hosts. */
17
17
  allowInsecureLoopback: boolean;
18
18
  /**
19
- * `marketplaces.allowPrivateHosts`: a hostname entry (exact, case-insensitive) exempts that host's
19
+ * `net.allowPrivateHosts`: a hostname entry (exact, case-insensitive) exempts that host's
20
20
  * resolved addresses; an IP or CIDR entry exempts IP-literal URL hosts inside it only, never a DNS
21
21
  * name that resolves there (an attacker's name could point into the range).
22
22
  */
@@ -68,11 +68,11 @@ export declare const MIN_CIDR_PREFIX: {
68
68
  /** A syntactically valid `addr/prefix` CIDR as [address, prefix, family], else undefined. */
69
69
  export declare function parseCidr(s: string): [string, number, "ipv4" | "ipv6"] | undefined;
70
70
  /**
71
- * Why a `marketplaces.allowPrivateHosts` entry is invalid (English), or null when it is a hostname,
71
+ * Why a `net.allowPrivateHosts` entry is invalid (English), or null when it is a hostname,
72
72
  * an IP address or a CIDR no broader than /8 (IPv4) or /16 (IPv6).
73
73
  */
74
74
  export declare function privateHostEntryProblem(entry: string): string | null;
75
- /** A valid `marketplaces.allowPrivateHosts` entry (see {@link privateHostEntryProblem}). */
75
+ /** A valid `net.allowPrivateHosts` entry (see {@link privateHostEntryProblem}). */
76
76
  export declare function isPrivateHostEntry(entry: string): boolean;
77
77
  /**
78
78
  * Whether a host entry of `policy.allowPrivateHosts` (a hostname, a `*.domain` wildcard, an IP or a