@capybara-hq/kernel 0.1.0-rc.15 → 0.1.0-rc.150
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.
- package/bootstrap.json +55 -28
- package/dist/admin/account-erasures.d.ts +37 -0
- package/dist/admin/account-erasures.js +119 -0
- package/dist/admin/admin-agents.controller.d.ts +26 -0
- package/dist/admin/admin-agents.controller.js +79 -0
- package/dist/admin/admin-connectors.controller.d.ts +27 -0
- package/dist/admin/admin-connectors.controller.js +79 -0
- package/dist/admin/admin-items.schemas.d.ts +42 -0
- package/dist/admin/admin-items.schemas.js +44 -0
- package/dist/admin/admin.controller.d.ts +74 -39
- package/dist/admin/admin.controller.js +134 -56
- package/dist/admin/admin.module.d.ts +6 -1
- package/dist/admin/admin.module.js +90 -4
- package/dist/admin/admin.schemas.d.ts +133 -3
- package/dist/admin/admin.schemas.js +43 -8
- package/dist/admin/audit-log.service.d.ts +136 -0
- package/dist/admin/audit-log.service.js +545 -0
- package/dist/admin/audit-targets.d.ts +17 -0
- package/dist/admin/audit-targets.js +84 -0
- package/dist/admin/audit.controller.d.ts +29 -0
- package/dist/admin/audit.controller.js +93 -0
- package/dist/admin/audit.schemas.d.ts +32 -0
- package/dist/admin/audit.schemas.js +62 -0
- package/dist/admin/erasure-dispositions.d.ts +23 -0
- package/dist/admin/erasure-dispositions.js +76 -0
- package/dist/admin/extensions.controller.d.ts +62 -23
- package/dist/admin/extensions.controller.js +132 -55
- package/dist/admin/extensions.schemas.d.ts +29 -0
- package/dist/admin/extensions.schemas.js +54 -0
- package/dist/admin/health.service.d.ts +141 -0
- package/dist/admin/health.service.js +352 -0
- package/dist/admin/login-sources.controller.d.ts +30 -0
- package/dist/admin/login-sources.controller.js +77 -0
- package/dist/admin/login-sources.schemas.d.ts +25 -0
- package/dist/admin/login-sources.schemas.js +49 -0
- package/dist/admin/org-network.controller.d.ts +30 -0
- package/dist/admin/org-network.controller.js +77 -0
- package/dist/admin/org-network.schemas.d.ts +16 -0
- package/dist/admin/org-network.schemas.js +27 -0
- package/dist/admin/org-network.service.d.ts +43 -0
- package/dist/admin/org-network.service.js +109 -0
- package/dist/admin/outbox-dead.controller.d.ts +21 -0
- package/dist/admin/outbox-dead.controller.js +65 -0
- package/dist/admin/outbox-dead.schemas.d.ts +24 -0
- package/dist/admin/outbox-dead.schemas.js +42 -0
- package/dist/admin/outbox-dead.service.d.ts +81 -0
- package/dist/admin/outbox-dead.service.js +264 -0
- package/dist/admin/overview.controller.d.ts +31 -0
- package/dist/admin/overview.controller.js +78 -0
- package/dist/admin/overview.schemas.d.ts +8 -0
- package/dist/admin/overview.schemas.js +13 -0
- package/dist/admin/overview.service.d.ts +147 -0
- package/dist/admin/overview.service.js +256 -0
- package/dist/admin/setup.service.js +6 -1
- package/dist/admin/usage.service.d.ts +139 -0
- package/dist/admin/usage.service.js +337 -0
- package/dist/agents/admin-agents.d.ts +125 -0
- package/dist/agents/admin-agents.js +269 -0
- package/dist/agents/agent-lookup.d.ts +5 -2
- package/dist/agents/agent-lookup.js +11 -11
- package/dist/agents/agent-profile.service.d.ts +5 -2
- package/dist/agents/agent-profile.service.js +16 -2
- package/dist/agents/agents.controller.d.ts +18 -14
- package/dist/agents/agents.controller.js +36 -21
- package/dist/agents/agents.module.d.ts +4 -3
- package/dist/agents/agents.module.js +23 -3
- package/dist/agents/agents.schemas.d.ts +79 -21
- package/dist/agents/agents.schemas.js +21 -1
- package/dist/agents/agents.service.d.ts +76 -9
- package/dist/agents/agents.service.js +238 -72
- package/dist/agents/avatar-view.d.ts +8 -0
- package/dist/agents/avatar-view.js +12 -0
- package/dist/agents/definition.d.ts +53 -37
- package/dist/agents/definition.js +96 -231
- package/dist/agents/from-template.d.ts +6 -3
- package/dist/agents/from-template.js +58 -45
- package/dist/agents/instruction-files.js +0 -3
- package/dist/agents/models.controller.d.ts +11 -4
- package/dist/agents/models.controller.js +35 -4
- package/dist/agents/onboarding-checklist.d.ts +31 -0
- package/dist/agents/onboarding-checklist.js +189 -0
- package/dist/agents/org-templates.d.ts +3 -1
- package/dist/agents/org-templates.js +103 -42
- package/dist/agents/pending-connector-requests.d.ts +10 -4
- package/dist/agents/pending-connector-requests.js +35 -7
- package/dist/agents/pending-connectors.service.js +2 -0
- package/dist/agents/profile.d.ts +38 -13
- package/dist/agents/profile.js +31 -20
- package/dist/agents/readiness.controller.d.ts +10 -19
- package/dist/agents/readiness.controller.js +24 -27
- package/dist/agents/readiness.service.d.ts +90 -0
- package/dist/agents/readiness.service.js +132 -0
- package/dist/agents/templates.js +10 -28
- package/dist/app.d.ts +9 -1
- package/dist/app.js +5 -0
- package/dist/attribution/platform-attribution.d.ts +113 -0
- package/dist/attribution/platform-attribution.js +166 -0
- package/dist/audit/full-access.d.ts +78 -0
- package/dist/audit/full-access.js +283 -0
- package/dist/automations/acceptance.controller.d.ts +29 -0
- package/dist/automations/acceptance.controller.js +87 -0
- package/dist/automations/automations.controller.d.ts +81 -0
- package/dist/automations/automations.controller.js +284 -0
- package/dist/automations/automations.module.d.ts +16 -0
- package/dist/automations/automations.module.js +69 -0
- package/dist/automations/automations.schemas.d.ts +517 -0
- package/dist/automations/automations.schemas.js +293 -0
- package/dist/automations/automations.service.d.ts +424 -0
- package/dist/automations/automations.service.js +1414 -0
- package/dist/automations/calendar.d.ts +134 -0
- package/dist/automations/calendar.js +412 -0
- package/dist/automations/effective-settings.d.ts +22 -0
- package/dist/automations/effective-settings.js +23 -0
- package/dist/automations/errors.d.ts +24 -0
- package/dist/automations/errors.js +24 -0
- package/dist/automations/events/acceptance.d.ts +217 -0
- package/dist/automations/events/acceptance.js +858 -0
- package/dist/automations/events/coalesce.d.ts +28 -0
- package/dist/automations/events/coalesce.js +131 -0
- package/dist/automations/events/deadline.d.ts +10 -0
- package/dist/automations/events/deadline.js +24 -0
- package/dist/automations/events/deliver.d.ts +39 -0
- package/dist/automations/events/deliver.js +112 -0
- package/dist/automations/events/dispatcher.d.ts +90 -0
- package/dist/automations/events/dispatcher.js +352 -0
- package/dist/automations/events/events.module.d.ts +7 -0
- package/dist/automations/events/events.module.js +26 -0
- package/dist/automations/events/guards.d.ts +32 -0
- package/dist/automations/events/guards.js +87 -0
- package/dist/automations/events/sweep.job.d.ts +102 -0
- package/dist/automations/events/sweep.job.js +347 -0
- package/dist/automations/events/token.d.ts +5 -0
- package/dist/automations/events/token.js +5 -0
- package/dist/automations/events/trigger-events.service.d.ts +88 -0
- package/dist/automations/events/trigger-events.service.js +350 -0
- package/dist/automations/fire.d.ts +189 -0
- package/dist/automations/fire.js +966 -0
- package/dist/automations/grant-rules.d.ts +104 -0
- package/dist/automations/grant-rules.js +166 -0
- package/dist/automations/job-ids.d.ts +113 -0
- package/dist/automations/job-ids.js +117 -0
- package/dist/automations/pause.d.ts +9 -0
- package/dist/automations/pause.js +35 -0
- package/dist/automations/run-tracker.d.ts +95 -0
- package/dist/automations/run-tracker.js +362 -0
- package/dist/automations/scan.job.d.ts +49 -0
- package/dist/automations/scan.job.js +211 -0
- package/dist/automations/schedule-math.d.ts +80 -0
- package/dist/automations/schedule-math.js +304 -0
- package/dist/automations/store.d.ts +137 -0
- package/dist/automations/store.js +512 -0
- package/dist/automations/store.module.d.ts +6 -0
- package/dist/automations/store.module.js +21 -0
- package/dist/automations/types.d.ts +183 -0
- package/dist/automations/types.js +1 -0
- package/dist/automations/unattended.d.ts +111 -0
- package/dist/automations/unattended.js +235 -0
- package/dist/background/finish.d.ts +21 -4
- package/dist/background/finish.js +88 -9
- package/dist/background/launch.d.ts +30 -23
- package/dist/background/launch.js +57 -46
- package/dist/background/managed-output.d.ts +110 -0
- package/dist/background/managed-output.js +219 -0
- package/dist/background/managed.d.ts +56 -0
- package/dist/background/managed.js +128 -0
- package/dist/background/poll.job.d.ts +29 -11
- package/dist/background/poll.job.js +141 -71
- package/dist/background/render.d.ts +3 -0
- package/dist/background/render.js +6 -0
- package/dist/background/session.d.ts +3 -44
- package/dist/background/session.js +3 -76
- package/dist/background/stop.d.ts +88 -27
- package/dist/background/stop.js +224 -112
- package/dist/background/store.d.ts +148 -71
- package/dist/background/store.js +348 -154
- package/dist/background/tasks.service.d.ts +56 -5
- package/dist/background/tasks.service.js +125 -67
- package/dist/background/wake-rules.d.ts +5 -0
- package/dist/background/wake-rules.js +22 -6
- package/dist/background/wake.js +3 -2
- package/dist/catalog/admin-catalog.controller.d.ts +106 -29
- package/dist/catalog/admin-catalog.controller.js +89 -44
- package/dist/catalog/admin-catalog.schemas.d.ts +18 -1
- package/dist/catalog/admin-catalog.schemas.js +23 -2
- package/dist/catalog/appearance.service.js +1 -3
- package/dist/catalog/catalog-content.d.ts +63 -28
- package/dist/catalog/catalog-content.js +40 -93
- package/dist/catalog/catalog-import.module.d.ts +1 -1
- package/dist/catalog/catalog-import.module.js +4 -5
- package/dist/catalog/catalog-items.d.ts +14 -20
- package/dist/catalog/catalog-items.js +42 -82
- package/dist/catalog/catalog-scope.service.d.ts +46 -122
- package/dist/catalog/catalog-scope.service.js +187 -702
- package/dist/catalog/catalog.module.d.ts +5 -5
- package/dist/catalog/catalog.module.js +46 -14
- package/dist/catalog/catalog.service.d.ts +45 -16
- package/dist/catalog/catalog.service.js +164 -47
- package/dist/catalog/claude/report.d.ts +9 -2
- package/dist/catalog/claude/report.js +1 -0
- package/dist/catalog/claude/translate.js +2 -2
- package/dist/catalog/cli.d.ts +10 -12
- package/dist/catalog/cli.js +48 -34
- package/dist/catalog/component-promotion.d.ts +3 -1
- package/dist/catalog/component-promotion.js +17 -8
- package/dist/catalog/component-scope.controller.d.ts +10 -15
- package/dist/catalog/component-scope.controller.js +18 -10
- package/dist/catalog/component-scope.schemas.js +2 -0
- package/dist/catalog/component-scope.service.d.ts +31 -2
- package/dist/catalog/component-scope.service.js +147 -140
- package/dist/catalog/component-state.d.ts +47 -8
- package/dist/catalog/component-state.js +92 -29
- package/dist/catalog/credential-key.d.ts +10 -0
- package/dist/catalog/credential-key.js +28 -0
- package/dist/catalog/dependency-edges.d.ts +25 -0
- package/dist/catalog/dependency-edges.js +125 -0
- package/dist/catalog/effect-work.d.ts +27 -0
- package/dist/catalog/effect-work.js +151 -0
- package/dist/catalog/enable-decision.d.ts +34 -0
- package/dist/catalog/enable-decision.js +17 -0
- package/dist/catalog/enable-requests.d.ts +188 -0
- package/dist/catalog/enable-requests.js +786 -0
- package/dist/catalog/enable-targets.d.ts +63 -0
- package/dist/catalog/enable-targets.js +94 -0
- package/dist/catalog/git-source.d.ts +21 -0
- package/dist/catalog/git-source.js +57 -11
- package/dist/catalog/job-ids.d.ts +26 -31
- package/dist/catalog/job-ids.js +26 -26
- package/dist/catalog/jobs.d.ts +15 -3
- package/dist/catalog/jobs.js +38 -7
- package/dist/catalog/marketplace-fetch.d.ts +19 -3
- package/dist/catalog/marketplace-fetch.js +34 -7
- package/dist/catalog/marketplaces.controller.d.ts +3 -2
- package/dist/catalog/marketplaces.controller.js +5 -2
- package/dist/catalog/marketplaces.schemas.d.ts +7 -0
- package/dist/catalog/marketplaces.schemas.js +13 -0
- package/dist/catalog/marketplaces.service.d.ts +73 -14
- package/dist/catalog/marketplaces.service.js +221 -35
- package/dist/catalog/org-catalog.controller.d.ts +34 -40
- package/dist/catalog/org-catalog.controller.js +74 -51
- package/dist/catalog/org-catalog.schemas.d.ts +81 -19
- package/dist/catalog/org-catalog.schemas.js +104 -7
- package/dist/catalog/org-catalog.service.d.ts +23 -2
- package/dist/catalog/org-catalog.service.js +224 -155
- package/dist/catalog/org-extension.controller.d.ts +12 -55
- package/dist/catalog/org-extension.controller.js +26 -110
- package/dist/catalog/org-extension.schemas.d.ts +29 -8
- package/dist/catalog/org-extension.schemas.js +56 -11
- package/dist/catalog/org-intent.d.ts +45 -0
- package/dist/catalog/org-intent.js +205 -0
- package/dist/catalog/org-plugin-uploads.controller.d.ts +4 -19
- package/dist/catalog/org-plugin-uploads.controller.js +6 -35
- package/dist/catalog/org-plugin-uploads.d.ts +9 -19
- package/dist/catalog/org-plugin-uploads.js +13 -33
- package/dist/catalog/org-plugin-uploads.schemas.d.ts +0 -1
- package/dist/catalog/org-plugin-uploads.schemas.js +2 -3
- package/dist/catalog/owned-items.d.ts +18 -22
- package/dist/catalog/owned-items.js +71 -89
- package/dist/catalog/ownership.d.ts +5 -32
- package/dist/catalog/ownership.js +29 -93
- package/dist/catalog/platform-components.d.ts +59 -37
- package/dist/catalog/platform-components.js +98 -92
- package/dist/catalog/platform-import-update.d.ts +52 -0
- package/dist/catalog/platform-import-update.js +123 -0
- package/dist/catalog/plugin-connectors.d.ts +50 -0
- package/dist/catalog/plugin-connectors.js +120 -0
- package/dist/catalog/plugin-import.d.ts +135 -93
- package/dist/catalog/plugin-import.js +395 -385
- package/dist/catalog/plugin-install.d.ts +143 -182
- package/dist/catalog/plugin-install.js +537 -648
- package/dist/catalog/plugin-package.d.ts +16 -12
- package/dist/catalog/plugin-package.js +53 -40
- package/dist/catalog/plugin-upgrade.d.ts +118 -47
- package/dist/catalog/plugin-upgrade.js +431 -245
- package/dist/catalog/provenance.d.ts +71 -0
- package/dist/catalog/provenance.js +112 -0
- package/dist/catalog/publisher-policy.d.ts +9 -0
- package/dist/catalog/publisher-policy.js +12 -0
- package/dist/catalog/request-hints.d.ts +19 -0
- package/dist/catalog/request-hints.js +34 -0
- package/dist/catalog/request-rules.d.ts +15 -9
- package/dist/catalog/request-rules.js +96 -34
- package/dist/catalog/requests.service.d.ts +209 -12
- package/dist/catalog/requests.service.js +826 -40
- package/dist/catalog/reserved-names.js +3 -9
- package/dist/catalog/schema-path.d.ts +4 -6
- package/dist/catalog/schema-path.js +48 -21
- package/dist/catalog/scope-orgs.d.ts +3 -2
- package/dist/catalog/scope-orgs.js +6 -11
- package/dist/catalog/scope-state.d.ts +6 -6
- package/dist/catalog/scope-state.js +24 -43
- package/dist/catalog/scope-sync-workers.d.ts +19 -0
- package/dist/catalog/scope-sync-workers.js +58 -3
- package/dist/catalog/scope-sync.d.ts +35 -152
- package/dist/catalog/scope-sync.js +277 -380
- package/dist/catalog/scope-writer.d.ts +107 -0
- package/dist/catalog/scope-writer.js +286 -0
- package/dist/catalog/scope.d.ts +2 -5
- package/dist/catalog/template-connector-ensure.d.ts +97 -0
- package/dist/catalog/template-connector-ensure.js +281 -0
- package/dist/catalog/template-connector-jobs.d.ts +28 -0
- package/dist/catalog/template-connector-jobs.js +54 -0
- package/dist/catalog/template-connectors.processor.d.ts +32 -0
- package/dist/catalog/template-connectors.processor.js +101 -0
- package/dist/catalog/template-description.d.ts +17 -0
- package/dist/catalog/template-description.js +18 -0
- package/dist/catalog/unshare.d.ts +6 -6
- package/dist/catalog/unshare.js +49 -75
- package/dist/channels/actions.d.ts +2 -0
- package/dist/channels/actions.js +44 -5
- package/dist/channels/cards.d.ts +65 -3
- package/dist/channels/cards.js +224 -12
- package/dist/channels/channels.module.d.ts +13 -9
- package/dist/channels/channels.module.js +38 -11
- package/dist/channels/channels.schemas.d.ts +17 -0
- package/dist/channels/channels.schemas.js +17 -0
- package/dist/channels/connection-summary.d.ts +32 -0
- package/dist/channels/connection-summary.js +67 -0
- package/dist/channels/connections.controller.d.ts +5 -3
- package/dist/channels/connections.controller.js +6 -4
- package/dist/channels/connections.service.d.ts +72 -11
- package/dist/channels/connections.service.js +147 -28
- package/dist/channels/deliver-job.d.ts +32 -0
- package/dist/channels/deliver-job.js +29 -0
- package/dist/channels/features.d.ts +20 -1
- package/dist/channels/features.js +31 -5
- package/dist/channels/file-delivery.d.ts +91 -0
- package/dist/channels/file-delivery.js +197 -0
- package/dist/channels/inbound.d.ts +15 -31
- package/dist/channels/inbound.js +65 -26
- package/dist/channels/job-ids.d.ts +2 -6
- package/dist/channels/job-ids.js +2 -6
- package/dist/channels/jobs.d.ts +39 -22
- package/dist/channels/jobs.js +83 -29
- package/dist/channels/outbound.d.ts +57 -5
- package/dist/channels/outbound.js +907 -40
- package/dist/channels/phrases.d.ts +252 -11
- package/dist/channels/phrases.js +204 -12
- package/dist/channels/progress.d.ts +75 -0
- package/dist/channels/progress.js +216 -0
- package/dist/channels/supervisor.d.ts +9 -4
- package/dist/channels/supervisor.js +61 -31
- package/dist/channels/threads.d.ts +16 -3
- package/dist/channels/threads.js +39 -3
- package/dist/channels/webhook.d.ts +1 -0
- package/dist/channels/webhook.js +10 -5
- package/dist/client/client-access.service.d.ts +3 -2
- package/dist/client/client-access.service.js +48 -19
- package/dist/client/client-files.js +1 -1
- package/dist/client/client-reports.service.js +21 -5
- package/dist/client/client-sign-in.service.d.ts +21 -0
- package/dist/client/client-sign-in.service.js +49 -0
- package/dist/client/client.controller.d.ts +7 -3
- package/dist/client/client.controller.js +17 -9
- package/dist/client/client.module.d.ts +2 -1
- package/dist/client/client.module.js +5 -3
- package/dist/client/client.schemas.d.ts +6 -0
- package/dist/config/auto-approve.d.ts +16 -0
- package/dist/config/auto-approve.js +24 -0
- package/dist/config/capacity-presets.d.ts +243 -0
- package/dist/config/capacity-presets.js +195 -0
- package/dist/config/docs.js +1 -1
- package/dist/config/env.d.ts +2 -1
- package/dist/config/env.js +25 -2
- package/dist/config/fields.js +20 -4
- package/dist/config/load.d.ts +7 -2
- package/dist/config/load.js +63 -4
- package/dist/config/product-name.d.ts +8 -0
- package/dist/config/product-name.js +9 -0
- package/dist/config/schema.d.ts +240 -56
- package/dist/config/schema.js +1153 -136
- package/dist/conversations/access.d.ts +25 -8
- package/dist/conversations/access.js +85 -26
- package/dist/conversations/agent-tree.d.ts +16 -0
- package/dist/conversations/agent-tree.js +36 -0
- package/dist/conversations/approval-profile.d.ts +37 -0
- package/dist/conversations/approval-profile.js +82 -0
- package/dist/conversations/artifacts.d.ts +20 -17
- package/dist/conversations/artifacts.js +30 -37
- package/dist/conversations/attachments.controller.d.ts +12 -17
- package/dist/conversations/attachments.controller.js +19 -57
- package/dist/conversations/attachments.service.d.ts +174 -59
- package/dist/conversations/attachments.service.js +564 -260
- package/dist/conversations/conversation-agent.d.ts +18 -0
- package/dist/conversations/conversation-agent.js +23 -0
- package/dist/conversations/conversation-ref.d.ts +59 -0
- package/dist/conversations/conversation-ref.js +108 -0
- package/dist/conversations/conversations.controller.d.ts +122 -60
- package/dist/conversations/conversations.controller.js +265 -92
- package/dist/conversations/conversations.module.js +30 -0
- package/dist/conversations/conversations.schemas.d.ts +27 -0
- package/dist/conversations/conversations.schemas.js +41 -0
- package/dist/conversations/conversations.service.d.ts +599 -93
- package/dist/conversations/conversations.service.js +1463 -222
- package/dist/conversations/delivery-scope.d.ts +34 -0
- package/dist/conversations/delivery-scope.js +23 -0
- package/dist/conversations/event-log.d.ts +105 -18
- package/dist/conversations/event-log.js +280 -34
- package/dist/conversations/event-people.d.ts +12 -0
- package/dist/conversations/event-people.js +28 -0
- package/dist/conversations/events.d.ts +1244 -60
- package/dist/conversations/events.js +1371 -116
- package/dist/conversations/external/external-calls.d.ts +75 -0
- package/dist/conversations/external/external-calls.js +91 -0
- package/dist/conversations/external/external-calls.processor.d.ts +45 -0
- package/dist/conversations/external/external-calls.processor.js +144 -0
- package/dist/conversations/external/external-conversations.service.d.ts +272 -0
- package/dist/conversations/external/external-conversations.service.js +1196 -0
- package/dist/conversations/external/external.schemas.d.ts +63 -0
- package/dist/conversations/external/external.schemas.js +52 -0
- package/dist/conversations/external/token.d.ts +6 -0
- package/dist/conversations/external/token.js +6 -0
- package/dist/conversations/files.d.ts +98 -26
- package/dist/conversations/files.js +225 -87
- package/dist/conversations/inline-tokens.d.ts +87 -0
- package/dist/conversations/inline-tokens.js +154 -0
- package/dist/conversations/job-org.d.ts +5 -0
- package/dist/conversations/job-org.js +23 -0
- package/dist/conversations/leak-check.d.ts +26 -0
- package/dist/conversations/leak-check.js +70 -0
- package/dist/conversations/media-types.d.ts +25 -0
- package/dist/conversations/media-types.js +38 -0
- package/dist/conversations/message-context.d.ts +6 -3
- package/dist/conversations/message-context.js +14 -10
- package/dist/conversations/model-image.d.ts +39 -0
- package/dist/conversations/model-image.js +80 -0
- package/dist/conversations/permission-profile-store.d.ts +54 -0
- package/dist/conversations/permission-profile-store.js +67 -0
- package/dist/conversations/permission-profile-store.module.d.ts +2 -0
- package/dist/conversations/permission-profile-store.module.js +19 -0
- package/dist/conversations/permission-profiles.controller.d.ts +138 -0
- package/dist/conversations/permission-profiles.controller.js +186 -0
- package/dist/conversations/permission-profiles.schemas.d.ts +36 -0
- package/dist/conversations/permission-profiles.schemas.js +31 -0
- package/dist/conversations/permission-profiles.service.d.ts +76 -0
- package/dist/conversations/permission-profiles.service.js +203 -0
- package/dist/conversations/prompt-suggestion-request.d.ts +95 -0
- package/dist/conversations/prompt-suggestion-request.js +215 -0
- package/dist/conversations/prompt-suggestion-store.d.ts +53 -0
- package/dist/conversations/prompt-suggestion-store.js +141 -0
- package/dist/conversations/prompt-suggestions.d.ts +148 -0
- package/dist/conversations/prompt-suggestions.js +572 -0
- package/dist/conversations/queue.d.ts +21 -5
- package/dist/conversations/queue.js +37 -4
- package/dist/conversations/queue.service.d.ts +20 -9
- package/dist/conversations/queue.service.js +117 -41
- package/dist/conversations/selection.js +1 -0
- package/dist/conversations/source.d.ts +10 -0
- package/dist/conversations/source.js +19 -0
- package/dist/conversations/titles.d.ts +24 -12
- package/dist/conversations/titles.js +89 -54
- package/dist/conversations/tree.d.ts +10 -0
- package/dist/conversations/tree.js +41 -0
- package/dist/ctx/bus.js +6 -3
- package/dist/ctx/create-ctx.d.ts +171 -34
- package/dist/ctx/create-ctx.js +865 -229
- package/dist/ctx/device-provider-check.d.ts +11 -0
- package/dist/ctx/device-provider-check.js +36 -0
- package/dist/ctx/durable-cancellation.d.ts +3 -0
- package/dist/ctx/durable-cancellation.js +8 -0
- package/dist/ctx/durable-effects.service.d.ts +81 -0
- package/dist/ctx/durable-effects.service.js +316 -0
- package/dist/ctx/durable-envelope.d.ts +24 -0
- package/dist/ctx/durable-envelope.js +80 -0
- package/dist/ctx/durable-failure.d.ts +7 -0
- package/dist/ctx/durable-failure.js +32 -0
- package/dist/ctx/durable-job.d.ts +9 -0
- package/dist/ctx/durable-job.js +2 -0
- package/dist/ctx/durable-keys.d.ts +27 -0
- package/dist/ctx/durable-keys.js +138 -0
- package/dist/ctx/durable-relay.d.ts +26 -0
- package/dist/ctx/durable-relay.js +277 -0
- package/dist/ctx/guard-db.d.ts +6 -0
- package/dist/ctx/guard-db.js +55 -0
- package/dist/ctx/net.d.ts +54 -0
- package/dist/ctx/net.js +117 -0
- package/dist/ctx/queue.d.ts +2 -0
- package/dist/ctx/queue.js +28 -16
- package/dist/ctx/secrets.d.ts +41 -5
- package/dist/ctx/secrets.js +140 -30
- package/dist/db/extension-db.d.ts +35 -0
- package/dist/db/extension-db.js +193 -0
- package/dist/db/extension-handoff-schema.d.ts +6 -0
- package/dist/db/extension-handoff-schema.js +115 -0
- package/dist/db/extension-rls-predicate.d.ts +1 -0
- package/dist/db/extension-rls-predicate.js +8 -0
- package/dist/db/extension-role-provision.d.ts +9 -0
- package/dist/db/extension-role-provision.js +89 -0
- package/dist/db/extension-schema-transfer.d.ts +7 -0
- package/dist/db/extension-schema-transfer.js +240 -0
- package/dist/db/kernel-schema.d.ts +1277 -125
- package/dist/db/migrator.d.ts +14 -0
- package/dist/db/migrator.js +89 -8
- package/dist/db/pool.d.ts +10 -0
- package/dist/db/pool.js +43 -2
- package/dist/db/sql-statements.d.ts +3 -0
- package/dist/db/sql-statements.js +15 -5
- package/dist/device-access/conversation-notice-delivery.d.ts +116 -0
- package/dist/device-access/conversation-notice-delivery.js +344 -0
- package/dist/device-access/conversation-notices.d.ts +27 -0
- package/dist/device-access/conversation-notices.js +42 -0
- package/dist/device-access/device-access.module.d.ts +7 -0
- package/dist/device-access/device-access.module.js +53 -0
- package/dist/device-access/device-access.service.d.ts +304 -0
- package/dist/device-access/device-access.service.js +1019 -0
- package/dist/device-access/host-gate.d.ts +45 -0
- package/dist/device-access/host-gate.js +92 -0
- package/dist/device-access/host-service-stop-sweep.d.ts +33 -0
- package/dist/device-access/host-service-stop-sweep.js +112 -0
- package/dist/device-access/host-service-stop.d.ts +78 -0
- package/dist/device-access/host-service-stop.js +144 -0
- package/dist/device-access/host-services.d.ts +217 -0
- package/dist/device-access/host-services.js +807 -0
- package/dist/device-access/person-handles.d.ts +19 -0
- package/dist/device-access/person-handles.js +30 -0
- package/dist/device-access/service-events.d.ts +199 -0
- package/dist/device-access/service-events.js +704 -0
- package/dist/device-access/site-access-request.d.ts +14 -0
- package/dist/device-access/site-access-request.js +35 -0
- package/dist/device-access/site-grants.d.ts +53 -0
- package/dist/device-access/site-grants.js +268 -0
- package/dist/device-access/site-grants.module.d.ts +2 -0
- package/dist/device-access/site-grants.module.js +14 -0
- package/dist/device-access/token.d.ts +11 -0
- package/dist/device-access/token.js +11 -0
- package/dist/device-access/viewer-routes.d.ts +45 -0
- package/dist/device-access/viewer-routes.js +81 -0
- package/dist/device-access/viewer.d.ts +249 -0
- package/dist/device-access/viewer.js +867 -0
- package/dist/devices/access.d.ts +15 -46
- package/dist/devices/access.js +26 -63
- package/dist/devices/access.module.d.ts +2 -0
- package/dist/devices/access.module.js +19 -0
- package/dist/devices/conversation-devices.d.ts +107 -19
- package/dist/devices/conversation-devices.js +194 -56
- package/dist/devices/default-provider-setting.d.ts +45 -0
- package/dist/devices/default-provider-setting.js +59 -0
- package/dist/devices/device-project-files.service.d.ts +88 -0
- package/dist/devices/device-project-files.service.js +249 -0
- package/dist/devices/device-projects.service.d.ts +188 -0
- package/dist/devices/device-projects.service.js +474 -0
- package/dist/devices/device-provider-selection.d.ts +36 -0
- package/dist/devices/device-provider-selection.js +85 -0
- package/dist/devices/device-provider-selection.module.d.ts +3 -0
- package/dist/devices/device-provider-selection.module.js +22 -0
- package/dist/devices/devices.controller.d.ts +36 -11
- package/dist/devices/devices.controller.js +101 -21
- package/dist/devices/devices.module.js +36 -6
- package/dist/devices/devices.schemas.d.ts +5 -1
- package/dist/devices/devices.schemas.js +21 -4
- package/dist/devices/devices.service.d.ts +372 -118
- package/dist/devices/devices.service.js +846 -322
- package/dist/devices/dto.d.ts +97 -3
- package/dist/devices/dto.js +102 -2
- package/dist/devices/errors.d.ts +14 -0
- package/dist/devices/errors.js +14 -0
- package/dist/devices/label.d.ts +3 -5
- package/dist/devices/label.js +3 -14
- package/dist/devices/project-paths.d.ts +29 -0
- package/dist/devices/project-paths.js +66 -0
- package/dist/devices/project-rules.d.ts +34 -0
- package/dist/devices/project-rules.js +20 -0
- package/dist/devices/public-suffix.d.ts +6 -0
- package/dist/devices/public-suffix.js +79 -0
- package/dist/devices/working-root.d.ts +43 -0
- package/dist/devices/working-root.js +56 -0
- package/dist/dial-in/access.d.ts +45 -0
- package/dist/dial-in/access.js +97 -0
- package/dist/{local-devices/device-auth.controller.d.ts → dial-in/auth.controller.d.ts} +13 -7
- package/dist/{local-devices/device-auth.controller.js → dial-in/auth.controller.js} +33 -17
- package/dist/dial-in/auth.module.d.ts +7 -0
- package/dist/dial-in/auth.module.js +27 -0
- package/dist/{local-devices/device-auth.d.ts → dial-in/auth.service.d.ts} +52 -13
- package/dist/{local-devices/device-auth.js → dial-in/auth.service.js} +108 -33
- package/dist/dial-in/dial-in.module.d.ts +9 -0
- package/dist/dial-in/dial-in.module.js +37 -0
- package/dist/{local-devices → dial-in}/dto.d.ts +17 -2
- package/dist/{local-devices → dial-in}/dto.js +14 -2
- package/dist/dial-in/envelope.d.ts +95 -0
- package/dist/dial-in/envelope.js +89 -0
- package/dist/dial-in/gateway.d.ts +278 -0
- package/dist/dial-in/gateway.js +1083 -0
- package/dist/dial-in/handlers.d.ts +56 -0
- package/dist/dial-in/handlers.js +100 -0
- package/dist/{local-devices → dial-in}/keys.d.ts +12 -0
- package/dist/{local-devices → dial-in}/keys.js +12 -0
- package/dist/{local-devices → dial-in}/machines.d.ts +62 -29
- package/dist/{local-devices → dial-in}/machines.js +110 -116
- package/dist/dial-in/relay.d.ts +167 -0
- package/dist/dial-in/relay.js +517 -0
- package/dist/dial-in/relay.module.d.ts +7 -0
- package/dist/dial-in/relay.module.js +24 -0
- package/dist/dial-in/routes.d.ts +56 -0
- package/dist/dial-in/routes.js +133 -0
- package/dist/dial-in/streams.d.ts +66 -0
- package/dist/dial-in/streams.js +296 -0
- package/dist/dial-in/targets.d.ts +45 -0
- package/dist/dial-in/targets.js +91 -0
- package/dist/erasure/account-batches.d.ts +9 -0
- package/dist/erasure/account-batches.js +569 -0
- package/dist/erasure/account-files.d.ts +34 -0
- package/dist/erasure/account-files.js +217 -0
- package/dist/erasure/account-residual.d.ts +15 -0
- package/dist/erasure/account-residual.js +150 -0
- package/dist/erasure/account-worker.d.ts +32 -0
- package/dist/erasure/account-worker.js +392 -0
- package/dist/erasure/device-cleanup.d.ts +23 -0
- package/dist/erasure/device-cleanup.js +233 -0
- package/dist/erasure/erasure.module.d.ts +2 -0
- package/dist/erasure/erasure.module.js +14 -0
- package/dist/erasure/external-evidence.d.ts +4 -0
- package/dist/erasure/external-evidence.js +28 -0
- package/dist/erasure/jobs.d.ts +5 -0
- package/dist/erasure/jobs.js +20 -0
- package/dist/erasure/org-batches.d.ts +11 -0
- package/dist/erasure/org-batches.js +154 -0
- package/dist/erasure/org-catalog.d.ts +2 -0
- package/dist/erasure/org-catalog.js +45 -0
- package/dist/erasure/org-rules.d.ts +14 -0
- package/dist/erasure/org-rules.js +245 -0
- package/dist/erasure/org-worker.d.ts +38 -0
- package/dist/erasure/org-worker.js +488 -0
- package/dist/erasure/requests.d.ts +61 -0
- package/dist/erasure/requests.js +180 -0
- package/dist/erasure/sweep.job.d.ts +19 -0
- package/dist/erasure/sweep.job.js +130 -0
- package/dist/erasure/worker.d.ts +17 -0
- package/dist/erasure/worker.js +110 -0
- package/dist/errors.d.ts +438 -20
- package/dist/errors.js +439 -21
- package/dist/evals/budget.js +14 -1
- package/dist/evals/canonical-json.d.ts +7 -0
- package/dist/evals/canonical-json.js +21 -0
- package/dist/evals/evals.module.js +16 -3
- package/dist/evals/evals.schemas.d.ts +15 -5
- package/dist/evals/evals.schemas.js +17 -10
- package/dist/evals/jobs.d.ts +14 -6
- package/dist/evals/jobs.js +21 -19
- package/dist/evals/judge.d.ts +8 -0
- package/dist/evals/judge.js +16 -1
- package/dist/evals/plan.d.ts +23 -16
- package/dist/evals/plan.js +54 -11
- package/dist/evals/reconstruct.d.ts +103 -23
- package/dist/evals/reconstruct.js +203 -74
- package/dist/evals/recorded-permission-context.d.ts +79 -0
- package/dist/evals/recorded-permission-context.js +155 -0
- package/dist/evals/recorded-tools.d.ts +22 -36
- package/dist/evals/recorded-tools.js +32 -111
- package/dist/evals/run-replay.d.ts +34 -9
- package/dist/evals/run-replay.js +139 -62
- package/dist/evals/runs.controller.d.ts +4 -12
- package/dist/evals/runs.controller.js +14 -11
- package/dist/evals/runs.service.d.ts +34 -31
- package/dist/evals/runs.service.js +100 -103
- package/dist/evals/sets.service.d.ts +18 -11
- package/dist/evals/sets.service.js +71 -30
- package/dist/evals/snapshot.d.ts +34 -6
- package/dist/evals/snapshot.js +121 -74
- package/dist/evals/step-replay.d.ts +14 -4
- package/dist/evals/step-replay.js +26 -8
- package/dist/evals/trajectory.controller.d.ts +10 -6
- package/dist/evals/trajectory.controller.js +11 -4
- package/dist/evals/trajectory.d.ts +26 -13
- package/dist/evals/trajectory.js +46 -24
- package/dist/evals/trajectory.service.d.ts +24 -19
- package/dist/evals/trajectory.service.js +76 -61
- package/dist/evals/worker.d.ts +17 -1
- package/dist/evals/worker.js +162 -51
- package/dist/extensions/admin-ops.d.ts +36 -7
- package/dist/extensions/admin-ops.js +178 -39
- package/dist/extensions/admin-view.d.ts +37 -8
- package/dist/extensions/admin-view.js +125 -46
- package/dist/extensions/blobs.d.ts +2 -0
- package/dist/extensions/blobs.js +11 -0
- package/dist/extensions/bootstrap-defaults.d.ts +24 -0
- package/dist/extensions/bootstrap-defaults.js +78 -0
- package/dist/extensions/bootstrap-extra.d.ts +84 -0
- package/dist/extensions/bootstrap-extra.js +151 -0
- package/dist/extensions/bootstrap-manifest.d.ts +14 -0
- package/dist/extensions/bootstrap-manifest.js +23 -0
- package/dist/extensions/bootstrap-packages.d.ts +103 -0
- package/dist/extensions/bootstrap-packages.js +303 -0
- package/dist/extensions/bootstrap-review.d.ts +251 -0
- package/dist/extensions/bootstrap-review.js +676 -0
- package/dist/extensions/bootstrap.d.ts +182 -52
- package/dist/extensions/bootstrap.js +544 -258
- package/dist/extensions/cli.d.ts +6 -0
- package/dist/extensions/cli.js +5 -1
- package/dist/extensions/config-hash.d.ts +2 -0
- package/dist/extensions/config-hash.js +1 -1
- package/dist/extensions/config-json-schema.d.ts +12 -8
- package/dist/extensions/config-json-schema.js +13 -11
- package/dist/extensions/deployed-snapshots.d.ts +22 -0
- package/dist/extensions/deployed-snapshots.js +64 -0
- package/dist/extensions/deployment-config-store.d.ts +2 -0
- package/dist/extensions/deployment-config-store.js +18 -14
- package/dist/extensions/deployment-config.d.ts +18 -7
- package/dist/extensions/deployment-config.js +56 -30
- package/dist/extensions/effective-config.d.ts +6 -9
- package/dist/extensions/effective-config.js +7 -13
- package/dist/extensions/enabled.d.ts +203 -21
- package/dist/extensions/enabled.js +163 -39
- package/dist/extensions/execution-realm.d.ts +96 -0
- package/dist/extensions/execution-realm.js +141 -0
- package/dist/extensions/extensions.module.js +46 -0
- package/dist/extensions/full-access-disclosure.d.ts +15 -0
- package/dist/extensions/full-access-disclosure.js +57 -0
- package/dist/extensions/grant-epoch.d.ts +124 -0
- package/dist/extensions/grant-epoch.js +248 -0
- package/dist/extensions/guide-places.d.ts +18 -2
- package/dist/extensions/guide-places.js +46 -23
- package/dist/extensions/hooks.d.ts +30 -6
- package/dist/extensions/hooks.js +24 -4
- package/dist/extensions/host.d.ts +268 -62
- package/dist/extensions/host.js +1168 -207
- package/dist/extensions/installs.d.ts +34 -17
- package/dist/extensions/installs.js +68 -33
- package/dist/extensions/instance.d.ts +17 -7
- package/dist/extensions/instance.js +22 -6
- package/dist/extensions/isolated/admission.d.ts +31 -0
- package/dist/extensions/isolated/admission.js +233 -0
- package/dist/extensions/isolated/authorization.d.ts +103 -0
- package/dist/extensions/isolated/authorization.js +312 -0
- package/dist/extensions/isolated/broker.d.ts +18 -0
- package/dist/extensions/isolated/broker.js +507 -0
- package/dist/extensions/isolated/child-protocol.d.ts +84 -0
- package/dist/extensions/isolated/child-protocol.js +21 -0
- package/dist/extensions/isolated/child-registration.d.ts +22 -0
- package/dist/extensions/isolated/child-registration.js +152 -0
- package/dist/extensions/isolated/child-session.d.ts +6 -0
- package/dist/extensions/isolated/child-session.js +342 -0
- package/dist/extensions/isolated/child-streams.d.ts +4 -0
- package/dist/extensions/isolated/child-streams.js +142 -0
- package/dist/extensions/isolated/child.d.ts +1 -0
- package/dist/extensions/isolated/child.js +10 -0
- package/dist/extensions/isolated/configured-package.d.ts +20 -0
- package/dist/extensions/isolated/configured-package.js +75 -0
- package/dist/extensions/isolated/engine-binds.d.ts +9 -0
- package/dist/extensions/isolated/engine-binds.js +82 -0
- package/dist/extensions/isolated/engine-policy.d.ts +85 -0
- package/dist/extensions/isolated/engine-policy.js +75 -0
- package/dist/extensions/isolated/engine-proxy-main.d.ts +1 -0
- package/dist/extensions/isolated/engine-proxy-main.js +20 -0
- package/dist/extensions/isolated/engine-proxy.d.ts +7 -0
- package/dist/extensions/isolated/engine-proxy.js +408 -0
- package/dist/extensions/isolated/engine-vaults.d.ts +12 -0
- package/dist/extensions/isolated/engine-vaults.js +93 -0
- package/dist/extensions/isolated/lanes.d.ts +149 -0
- package/dist/extensions/isolated/lanes.js +909 -0
- package/dist/extensions/isolated/metrics.d.ts +146 -0
- package/dist/extensions/isolated/metrics.js +304 -0
- package/dist/extensions/isolated/postgres-gate.d.ts +15 -0
- package/dist/extensions/isolated/postgres-gate.js +255 -0
- package/dist/extensions/isolated/revision.d.ts +38 -0
- package/dist/extensions/isolated/revision.js +380 -0
- package/dist/extensions/isolated/rpc-frame.d.ts +50 -0
- package/dist/extensions/isolated/rpc-frame.js +193 -0
- package/dist/extensions/isolated/rpc.d.ts +71 -0
- package/dist/extensions/isolated/rpc.js +319 -0
- package/dist/extensions/isolated/sandbox.d.ts +62 -0
- package/dist/extensions/isolated/sandbox.js +406 -0
- package/dist/extensions/isolated/status.d.ts +79 -0
- package/dist/extensions/isolated/status.js +216 -0
- package/dist/extensions/isolated/tier.d.ts +145 -0
- package/dist/extensions/isolated/tier.js +331 -0
- package/dist/extensions/isolated/usage.d.ts +134 -0
- package/dist/extensions/isolated/usage.js +322 -0
- package/dist/extensions/ledger.d.ts +6 -1
- package/dist/extensions/ledger.js +16 -0
- package/dist/extensions/lifecycle-hooks.d.ts +113 -0
- package/dist/extensions/lifecycle-hooks.js +308 -0
- package/dist/extensions/lifecycle-topics.d.ts +2 -0
- package/dist/extensions/lifecycle-topics.js +2 -0
- package/dist/extensions/lifecycle.d.ts +49 -2
- package/dist/extensions/lifecycle.js +158 -7
- package/dist/extensions/locks.d.ts +3 -1
- package/dist/extensions/locks.js +8 -1
- package/dist/extensions/migrate-lock.d.ts +4 -1
- package/dist/extensions/migrate-lock.js +20 -2
- package/dist/extensions/org-config.d.ts +90 -88
- package/dist/extensions/org-config.js +228 -371
- package/dist/extensions/org-levels.d.ts +22 -9
- package/dist/extensions/org-levels.js +100 -20
- package/dist/extensions/org-overrides.d.ts +22 -16
- package/dist/extensions/org-overrides.js +37 -25
- package/dist/extensions/package-digest.job.d.ts +34 -0
- package/dist/extensions/package-digest.job.js +121 -0
- package/dist/extensions/package.d.ts +20 -6
- package/dist/extensions/package.js +36 -15
- package/dist/extensions/permission-set.d.ts +72 -32
- package/dist/extensions/permission-set.js +40 -77
- package/dist/extensions/permission-view.d.ts +66 -19
- package/dist/extensions/permission-view.js +141 -24
- package/dist/extensions/permissions.controller.d.ts +35 -0
- package/dist/extensions/permissions.controller.js +98 -0
- package/dist/extensions/permissions.schemas.d.ts +288 -0
- package/dist/extensions/permissions.schemas.js +96 -0
- package/dist/extensions/permissions.service.d.ts +116 -0
- package/dist/extensions/permissions.service.js +428 -0
- package/dist/extensions/plugin-guides.d.ts +45 -13
- package/dist/extensions/plugin-guides.js +113 -52
- package/dist/extensions/plugin-icons.d.ts +87 -20
- package/dist/extensions/plugin-icons.js +216 -37
- package/dist/extensions/plugin-items.d.ts +24 -0
- package/dist/extensions/plugin-items.js +52 -22
- package/dist/extensions/point-defaults.d.ts +43 -11
- package/dist/extensions/point-defaults.js +62 -51
- package/dist/extensions/point-serving.d.ts +56 -0
- package/dist/extensions/point-serving.js +120 -0
- package/dist/extensions/publisher-proof.job.d.ts +39 -0
- package/dist/extensions/publisher-proof.job.js +160 -0
- package/dist/extensions/realm-retirement.d.ts +65 -0
- package/dist/extensions/realm-retirement.js +150 -0
- package/dist/extensions/registry.d.ts +6 -0
- package/dist/extensions/registry.js +13 -1
- package/dist/extensions/resolve.d.ts +7 -8
- package/dist/extensions/resolve.js +14 -10
- package/dist/extensions/review-hash.d.ts +114 -0
- package/dist/extensions/review-hash.js +145 -0
- package/dist/extensions/revision-approvals.d.ts +222 -0
- package/dist/extensions/revision-approvals.js +474 -0
- package/dist/extensions/revision-grants.d.ts +207 -0
- package/dist/extensions/revision-grants.js +584 -0
- package/dist/extensions/revision-review.d.ts +144 -0
- package/dist/extensions/revision-review.js +297 -0
- package/dist/extensions/revocation-leases.d.ts +273 -0
- package/dist/extensions/revocation-leases.js +533 -0
- package/dist/extensions/revocation.d.ts +78 -0
- package/dist/extensions/revocation.js +205 -0
- package/dist/extensions/run-lifecycle-owe.d.ts +70 -0
- package/dist/extensions/run-lifecycle-owe.js +88 -0
- package/dist/extensions/source-intent.d.ts +14 -0
- package/dist/extensions/source-intent.js +77 -0
- package/dist/extensions/sources.d.ts +1 -0
- package/dist/extensions/sources.js +9 -0
- package/dist/extensions/state.module.js +24 -1
- package/dist/extensions/sync.d.ts +9 -5
- package/dist/extensions/sync.js +33 -32
- package/dist/extensions/unavailable.js +0 -1
- package/dist/extensions/usage-subscribers.d.ts +43 -0
- package/dist/extensions/usage-subscribers.js +108 -0
- package/dist/files/blob-objects.d.ts +128 -0
- package/dist/files/blob-objects.js +358 -0
- package/dist/files/blob-references.d.ts +8 -0
- package/dist/files/blob-references.js +19 -0
- package/dist/files/blob-sweep.job.d.ts +124 -0
- package/dist/files/blob-sweep.job.js +418 -0
- package/dist/files/blobs.service.d.ts +135 -0
- package/dist/files/blobs.service.js +300 -0
- package/dist/files/conversation-media.d.ts +41 -0
- package/dist/files/conversation-media.js +124 -0
- package/dist/files/deliveries.d.ts +64 -0
- package/dist/files/deliveries.js +156 -0
- package/dist/files/deliveries.module.d.ts +6 -0
- package/dist/files/deliveries.module.js +24 -0
- package/dist/files/draft-cleanup.job.d.ts +26 -0
- package/dist/files/draft-cleanup.job.js +93 -0
- package/dist/files/files.module.d.ts +4 -1
- package/dist/files/files.module.js +7 -2
- package/dist/files/hash-job.d.ts +117 -0
- package/dist/files/hash-job.js +428 -0
- package/dist/files/library-files.service.d.ts +268 -0
- package/dist/files/library-files.service.js +914 -0
- package/dist/files/library-jobs.module.d.ts +3 -0
- package/dist/files/library-jobs.module.js +21 -0
- package/dist/files/library-query.d.ts +127 -0
- package/dist/files/library-query.js +322 -0
- package/dist/files/library-read.module.d.ts +9 -0
- package/dist/files/library-read.module.js +30 -0
- package/dist/files/library.controller.d.ts +77 -0
- package/dist/files/library.controller.js +235 -0
- package/dist/files/library.module.d.ts +9 -0
- package/dist/files/library.module.js +29 -0
- package/dist/files/library.schemas.d.ts +46 -0
- package/dist/files/library.schemas.js +49 -0
- package/dist/files/previewers.controller.d.ts +32 -0
- package/dist/files/previewers.controller.js +99 -0
- package/dist/files/previewers.d.ts +112 -11
- package/dist/files/previewers.js +215 -43
- package/dist/files/referenced-files.d.ts +150 -0
- package/dist/files/referenced-files.js +234 -0
- package/dist/git/gateway.d.ts +109 -0
- package/dist/git/gateway.js +828 -0
- package/dist/git/gateway.route.d.ts +16 -0
- package/dist/git/gateway.route.js +39 -0
- package/dist/git/git.module.d.ts +9 -0
- package/dist/git/git.module.js +31 -0
- package/dist/git/identity.d.ts +80 -0
- package/dist/git/identity.js +209 -0
- package/dist/git/pkt-line.d.ts +53 -0
- package/dist/git/pkt-line.js +146 -0
- package/dist/git/run-end.d.ts +57 -0
- package/dist/git/run-end.js +170 -0
- package/dist/git/sources.d.ts +42 -0
- package/dist/git/sources.js +134 -0
- package/dist/git/tickets.d.ts +69 -0
- package/dist/git/tickets.js +199 -0
- package/dist/handoff/app-schemes.d.ts +28 -0
- package/dist/handoff/app-schemes.js +41 -0
- package/dist/handoff/handoff-paths.d.ts +26 -0
- package/dist/handoff/handoff-paths.js +25 -0
- package/dist/handoff/handoff-tickets.d.ts +28 -0
- package/dist/handoff/handoff-tickets.js +111 -0
- package/dist/handoff/handoff.controller.d.ts +24 -0
- package/dist/handoff/handoff.controller.js +74 -0
- package/dist/handoff/handoff.module.d.ts +7 -0
- package/dist/handoff/handoff.module.js +26 -0
- package/dist/handoff/handoff.schemas.d.ts +13 -0
- package/dist/handoff/handoff.schemas.js +3 -0
- package/dist/handoff/handoff.service.d.ts +49 -0
- package/dist/handoff/handoff.service.js +96 -0
- package/dist/html/csp.d.ts +13 -0
- package/dist/html/csp.js +33 -0
- package/dist/html/html-document.controller.d.ts +38 -0
- package/dist/html/html-document.controller.js +96 -0
- package/dist/html/html-document.service.d.ts +64 -0
- package/dist/html/html-document.service.js +166 -0
- package/dist/html/html-token.d.ts +67 -0
- package/dist/html/html-token.js +168 -0
- package/dist/html/html-type.d.ts +15 -0
- package/dist/html/html-type.js +44 -0
- package/dist/html/html.module.d.ts +6 -0
- package/dist/html/html.module.js +33 -0
- package/dist/http/api.module.js +104 -9
- package/dist/http/app.d.ts +14 -2
- package/dist/http/app.js +31 -5
- package/dist/http/error.filter.d.ts +2 -0
- package/dist/http/error.filter.js +11 -2
- package/dist/http/gateway-routes.d.ts +9 -5
- package/dist/http/gateway-routes.js +5 -4
- package/dist/http/meta.controller.d.ts +50 -0
- package/dist/http/meta.controller.js +121 -0
- package/dist/http/plugin-dispatch.d.ts +55 -18
- package/dist/http/plugin-dispatch.js +132 -29
- package/dist/http/plugin-route-access.d.ts +57 -0
- package/dist/http/plugin-route-access.js +213 -0
- package/dist/http/request-signal.d.ts +8 -0
- package/dist/http/request-signal.js +14 -0
- package/dist/identity/account-avatar.controller.d.ts +30 -0
- package/dist/identity/account-avatar.controller.js +119 -0
- package/dist/identity/account-avatar.d.ts +67 -0
- package/dist/identity/account-avatar.js +136 -0
- package/dist/identity/account-avatars.service.d.ts +77 -0
- package/dist/identity/account-avatars.service.js +321 -0
- package/dist/identity/accounts.d.ts +63 -14
- package/dist/identity/accounts.js +191 -29
- package/dist/identity/api-tokens.d.ts +2 -0
- package/dist/identity/api-tokens.js +68 -36
- package/dist/identity/app-auth.controller.d.ts +26 -0
- package/dist/identity/app-auth.controller.js +65 -0
- package/dist/identity/app-auth.d.ts +84 -0
- package/dist/identity/app-auth.js +212 -0
- package/dist/identity/app-auth.schemas.d.ts +60 -0
- package/dist/identity/app-auth.schemas.js +46 -0
- package/dist/identity/audit.d.ts +2 -13
- package/dist/identity/audit.js +4 -39
- package/dist/identity/auth.controller.d.ts +2 -0
- package/dist/identity/auth.controller.js +6 -10
- package/dist/identity/auth.guard.d.ts +27 -12
- package/dist/identity/auth.guard.js +75 -35
- package/dist/identity/binding.d.ts +1 -1
- package/dist/identity/binding.js +19 -10
- package/dist/identity/cookies.d.ts +4 -9
- package/dist/identity/cookies.js +8 -32
- package/dist/identity/erasure-admission.d.ts +3 -0
- package/dist/identity/erasure-admission.js +14 -0
- package/dist/identity/external.d.ts +78 -40
- package/dist/identity/external.js +169 -73
- package/dist/identity/identity.module.d.ts +2 -1
- package/dist/identity/identity.module.js +21 -1
- package/dist/identity/initial-passwords.controller.d.ts +8 -6
- package/dist/identity/initial-passwords.controller.js +13 -7
- package/dist/identity/initial-passwords.d.ts +23 -14
- package/dist/identity/initial-passwords.job.d.ts +3 -2
- package/dist/identity/initial-passwords.job.js +11 -5
- package/dist/identity/initial-passwords.js +26 -31
- package/dist/identity/linked-accounts.d.ts +42 -0
- package/dist/identity/linked-accounts.js +78 -0
- package/dist/identity/login-sources.d.ts +160 -0
- package/dist/identity/login-sources.js +403 -0
- package/dist/identity/me.controller.d.ts +33 -7
- package/dist/identity/me.controller.js +61 -8
- package/dist/identity/me.schemas.d.ts +39 -0
- package/dist/identity/me.schemas.js +35 -0
- package/dist/identity/principal.d.ts +2 -2
- package/dist/identity/principal.js +2 -2
- package/dist/identity/sessions.d.ts +7 -6
- package/dist/identity/sessions.js +38 -25
- package/dist/identity/settings.d.ts +361 -3
- package/dist/identity/settings.js +651 -20
- package/dist/identity/sso-decisions.d.ts +75 -0
- package/dist/identity/sso-decisions.js +42 -0
- package/dist/identity/sso-link.d.ts +61 -0
- package/dist/identity/sso-link.js +157 -0
- package/dist/identity/sso-paths.d.ts +7 -0
- package/dist/identity/sso-paths.js +13 -0
- package/dist/identity/sso.controller.d.ts +122 -14
- package/dist/identity/sso.controller.js +261 -33
- package/dist/identity/sso.d.ts +87 -28
- package/dist/identity/sso.js +155 -69
- package/dist/identity/write-actor.d.ts +11 -0
- package/dist/identity/write-actor.js +7 -0
- package/dist/inbox/inbox-item-actions.d.ts +37 -0
- package/dist/inbox/inbox-item-actions.js +69 -0
- package/dist/inbox/inbox-items.controller.d.ts +27 -0
- package/dist/inbox/inbox-items.controller.js +80 -0
- package/dist/inbox/inbox-items.service.d.ts +133 -0
- package/dist/inbox/inbox-items.service.js +414 -0
- package/dist/inbox/inbox.module.d.ts +2 -1
- package/dist/inbox/inbox.module.js +19 -4
- package/dist/inbox/inbox.schemas.d.ts +20 -1
- package/dist/inbox/inbox.schemas.js +16 -1
- package/dist/inbox/inbox.service.d.ts +57 -32
- package/dist/inbox/inbox.service.js +47 -11
- package/dist/inbox/org-notices.d.ts +5 -18
- package/dist/inbox/org-notices.js +11 -7
- package/dist/inbox/platform-inbox.service.d.ts +57 -43
- package/dist/inbox/platform-inbox.service.js +122 -95
- package/dist/inbox/platform-notices.d.ts +20 -5
- package/dist/inbox/platform-notices.js +27 -1
- package/dist/inbox/token.d.ts +5 -0
- package/dist/inbox/token.js +5 -0
- package/dist/index.d.ts +31 -7
- package/dist/index.js +31 -7
- package/dist/infra/cli/kernel-cli.module.d.ts +2 -2
- package/dist/infra/cli/kernel-cli.module.js +10 -2
- package/dist/infra/cli/master-key-rewrap.d.ts +15 -0
- package/dist/infra/cli/master-key-rewrap.js +24 -0
- package/dist/infra/config/kernel-config.service.d.ts +14 -1
- package/dist/infra/config/kernel-config.service.js +127 -25
- package/dist/infra/database/database.module.js +8 -1
- package/dist/infra/database/extension-effect-key-lock.d.ts +10 -0
- package/dist/infra/database/extension-effect-key-lock.js +76 -0
- package/dist/infra/database/extension-handoff.d.ts +27 -0
- package/dist/infra/database/extension-handoff.js +113 -0
- package/dist/infra/database/kernel-db.d.ts +3 -1
- package/dist/infra/database/kernel-db.js +4 -0
- package/dist/infra/database/org-scope.d.ts +61 -0
- package/dist/infra/database/org-scope.js +74 -0
- package/dist/infra/database/rls-role.d.ts +4 -0
- package/dist/infra/database/rls-role.js +77 -0
- package/dist/infra/database/scoped-dialect.d.ts +21 -0
- package/dist/infra/database/scoped-dialect.js +445 -0
- package/dist/infra/database/startup-activation-transaction.d.ts +38 -0
- package/dist/infra/database/startup-activation-transaction.js +243 -0
- package/dist/infra/database/transaction-host.d.ts +79 -0
- package/dist/infra/database/transaction-host.js +159 -3
- package/dist/infra/database/xact-lock.d.ts +17 -0
- package/dist/infra/database/xact-lock.js +34 -1
- package/dist/infra/events/kernel-events.d.ts +23 -36
- package/dist/infra/health/health.controller.js +8 -0
- package/dist/infra/health/process-fault.d.ts +16 -0
- package/dist/infra/health/process-fault.js +49 -0
- package/dist/infra/lifecycle/process-guards.d.ts +8 -2
- package/dist/infra/lifecycle/process-guards.js +12 -3
- package/dist/infra/lifecycle/shutdown-signals.d.ts +10 -1
- package/dist/infra/lifecycle/shutdown-signals.js +28 -13
- package/dist/infra/lock/lock.service.d.ts +5 -1
- package/dist/infra/lock/lock.service.js +10 -4
- package/dist/infra/metrics/kernel-metrics.d.ts +18 -0
- package/dist/infra/metrics/kernel-metrics.js +54 -0
- package/dist/infra/metrics/operational-metrics.d.ts +31 -0
- package/dist/infra/metrics/operational-metrics.js +188 -0
- package/dist/infra/outbox/outbox-relay.module.d.ts +6 -0
- package/dist/infra/outbox/outbox-relay.module.js +18 -0
- package/dist/infra/outbox/outbox.dispatcher.d.ts +108 -0
- package/dist/infra/outbox/outbox.dispatcher.js +385 -0
- package/dist/infra/outbox/outbox.module.d.ts +24 -0
- package/dist/infra/outbox/outbox.module.js +52 -0
- package/dist/infra/outbox/outbox.relay.d.ts +31 -0
- package/dist/infra/outbox/outbox.relay.js +76 -0
- package/dist/infra/outbox/outbox.service.d.ts +62 -0
- package/dist/infra/outbox/outbox.service.js +176 -0
- package/dist/infra/outbox/registry.d.ts +700 -0
- package/dist/infra/outbox/registry.js +600 -0
- package/dist/infra/paging/paged-read.d.ts +86 -0
- package/dist/infra/paging/paged-read.js +115 -0
- package/dist/infra/presence/presence.module.d.ts +6 -0
- package/dist/infra/presence/presence.module.js +22 -0
- package/dist/infra/presence/replica-presence.d.ts +87 -0
- package/dist/infra/presence/replica-presence.js +189 -0
- package/dist/infra/queue/queue-names.d.ts +8 -0
- package/dist/infra/queue/queue-names.js +24 -0
- package/dist/infra/queue/run-job.d.ts +11 -2
- package/dist/infra/queue/run-job.js +26 -3
- package/dist/infra/schedule/locked-tick.js +12 -4
- package/dist/infra/schedule/scheduled-runs.js +3 -1
- package/dist/infra/throttler/credential-throttler.d.ts +4 -1
- package/dist/infra/throttler/credential-throttler.js +13 -3
- package/dist/infra/throttler/named-throttlers.d.ts +20 -4
- package/dist/infra/throttler/named-throttlers.js +82 -4
- package/dist/infra/throttler/principal-throttler.guard.d.ts +10 -0
- package/dist/infra/throttler/principal-throttler.guard.js +50 -0
- package/dist/infra/throttler/redis-throttler-storage.d.ts +1 -0
- package/dist/infra/throttler/redis-throttler-storage.js +27 -5
- package/dist/infra/throttler/throttler.guard.d.ts +2 -2
- package/dist/infra/throttler/throttler.guard.js +2 -2
- package/dist/infra/throttler/throttler.module.js +3 -2
- package/dist/invalidation/audiences.d.ts +32 -0
- package/dist/invalidation/audiences.js +43 -0
- package/dist/invalidation/hints.d.ts +62 -0
- package/dist/invalidation/hints.js +73 -0
- package/dist/invalidation/invalidation-hints.d.ts +35 -0
- package/dist/invalidation/invalidation-hints.js +100 -0
- package/dist/invalidation/invalidation-hints.module.d.ts +10 -0
- package/dist/invalidation/invalidation-hints.module.js +26 -0
- package/dist/invalidation/me-stream.controller.d.ts +30 -0
- package/dist/invalidation/me-stream.controller.js +100 -0
- package/dist/invalidation/me-stream.d.ts +57 -0
- package/dist/invalidation/me-stream.js +322 -0
- package/dist/invalidation/me-stream.module.d.ts +7 -0
- package/dist/invalidation/me-stream.module.js +22 -0
- package/dist/invalidation/org-intent-bridge.d.ts +18 -0
- package/dist/invalidation/org-intent-bridge.js +46 -0
- package/dist/kernel.d.ts +10 -1
- package/dist/kernel.js +65 -2
- package/dist/kernel.module.js +41 -4
- package/dist/lifecycle/kernel-lifecycle.d.ts +51 -2
- package/dist/lifecycle/kernel-lifecycle.js +263 -56
- package/dist/lifecycle/tokens.d.ts +8 -0
- package/dist/lifecycle/tokens.js +2 -0
- package/dist/log.d.ts +6 -0
- package/dist/log.js +47 -19
- package/dist/media/image-header.d.ts +10 -0
- package/dist/media/image-header.js +87 -0
- package/dist/models/budget-admission.d.ts +31 -0
- package/dist/models/budget-admission.js +149 -0
- package/dist/models/budget-counters.d.ts +28 -0
- package/dist/models/budget-counters.js +117 -0
- package/dist/models/budget-policy.d.ts +88 -0
- package/dist/models/budget-policy.js +78 -0
- package/dist/models/cache-write-usage.d.ts +3 -0
- package/dist/models/cache-write-usage.js +26 -0
- package/dist/models/embeddings.d.ts +10 -14
- package/dist/models/embeddings.js +59 -54
- package/dist/models/enablement.d.ts +20 -7
- package/dist/models/enablement.js +62 -17
- package/dist/models/image-usable.d.ts +46 -0
- package/dist/models/image-usable.js +60 -0
- package/dist/models/images.d.ts +123 -0
- package/dist/models/images.js +448 -0
- package/dist/models/models.module.d.ts +3 -2
- package/dist/models/models.module.js +18 -4
- package/dist/models/org-models.schemas.js +1 -0
- package/dist/models/price-snapshot.d.ts +43 -0
- package/dist/models/price-snapshot.js +145 -0
- package/dist/models/prices.d.ts +8 -6
- package/dist/models/prices.js +28 -3
- package/dist/models/purposes.controller.d.ts +7 -0
- package/dist/models/purposes.controller.js +9 -0
- package/dist/models/purposes.d.ts +73 -52
- package/dist/models/purposes.js +236 -38
- package/dist/net/private-endpoint-preflight.d.ts +159 -0
- package/dist/net/private-endpoint-preflight.js +417 -0
- package/dist/net/private-endpoints.d.ts +68 -0
- package/dist/net/private-endpoints.js +164 -0
- package/dist/net/public-address.d.ts +52 -8
- package/dist/net/public-address.js +97 -24
- package/dist/net/safe-fetch.d.ts +30 -7
- package/dist/net/safe-fetch.js +113 -9
- package/dist/orgs/device-network-setting.d.ts +38 -0
- package/dist/orgs/device-network-setting.js +59 -0
- package/dist/orgs/directory-sync-state.d.ts +125 -0
- package/dist/orgs/directory-sync-state.js +259 -0
- package/dist/orgs/directory-sync.controller.d.ts +16 -3
- package/dist/orgs/directory-sync.controller.js +29 -5
- package/dist/orgs/directory-sync.d.ts +36 -18
- package/dist/orgs/directory-sync.js +265 -129
- package/dist/orgs/directory-sync.schemas.d.ts +26 -0
- package/dist/orgs/directory-sync.schemas.js +50 -0
- package/dist/orgs/invitations.controller.d.ts +6 -17
- package/dist/orgs/invitations.controller.js +15 -13
- package/dist/orgs/invitations.service.d.ts +30 -6
- package/dist/orgs/invitations.service.js +84 -49
- package/dist/orgs/members.service.d.ts +78 -4
- package/dist/orgs/members.service.js +153 -25
- package/dist/orgs/network-allowances.service.d.ts +79 -0
- package/dist/orgs/network-allowances.service.js +371 -0
- package/dist/orgs/offboarding.d.ts +60 -57
- package/dist/orgs/offboarding.js +187 -178
- package/dist/orgs/org-lock.d.ts +36 -2
- package/dist/orgs/org-lock.js +67 -4
- package/dist/orgs/org-owner.d.ts +9 -0
- package/dist/orgs/org-owner.js +31 -0
- package/dist/orgs/org.guard.js +4 -0
- package/dist/orgs/orgs.controller.d.ts +46 -16
- package/dist/orgs/orgs.controller.js +75 -15
- package/dist/orgs/orgs.module.d.ts +3 -2
- package/dist/orgs/orgs.module.js +27 -5
- package/dist/orgs/orgs.schemas.d.ts +52 -0
- package/dist/orgs/orgs.schemas.js +55 -1
- package/dist/orgs/orgs.service.d.ts +47 -9
- package/dist/orgs/orgs.service.js +169 -31
- package/dist/orgs/roles.d.ts +1 -1
- package/dist/orgs/roles.js +7 -0
- package/dist/orgs/security-settings.service.d.ts +102 -0
- package/dist/orgs/security-settings.service.js +228 -0
- package/dist/orgs/settings.controller.d.ts +40 -14
- package/dist/orgs/settings.controller.js +56 -10
- package/dist/orgs/settings.service.d.ts +564 -63
- package/dist/orgs/settings.service.js +790 -88
- package/dist/overrides.d.ts +71 -5
- package/dist/overrides.js +38 -2
- package/dist/packages/npm-publish-keys.json +27 -0
- package/dist/packages/npm.d.ts +37 -10
- package/dist/packages/npm.js +67 -24
- package/dist/packages/official-publisher.d.ts +88 -0
- package/dist/packages/official-publisher.js +298 -0
- package/dist/packages/provenance.d.ts +27 -1
- package/dist/packages/provenance.js +70 -22
- package/dist/packages/sigstore-trusted-root.json +126 -0
- package/dist/packages/tgz.d.ts +0 -2
- package/dist/packages/tgz.js +0 -2
- package/dist/platform/availability.d.ts +5 -0
- package/dist/platform/availability.js +7 -3
- package/dist/platform/connector-person-fields.d.ts +67 -0
- package/dist/platform/connector-person-fields.js +129 -0
- package/dist/platform/exclusions.js +341 -195
- package/dist/platform/file-ref.d.ts +105 -0
- package/dist/platform/file-ref.js +173 -0
- package/dist/platform/method.js +1 -0
- package/dist/platform/operation.d.ts +98 -4
- package/dist/platform/operation.js +23 -7
- package/dist/platform/ops/accounts.ops.d.ts +1 -1
- package/dist/platform/ops/accounts.ops.js +68 -19
- package/dist/platform/ops/admin-items.ops.d.ts +37 -0
- package/dist/platform/ops/admin-items.ops.js +279 -0
- package/dist/platform/ops/admin.ops.d.ts +12 -10
- package/dist/platform/ops/admin.ops.js +349 -56
- package/dist/platform/ops/agent-skills.ops.d.ts +31 -3
- package/dist/platform/ops/agent-skills.ops.js +454 -12
- package/dist/platform/ops/agent-templates.ops.js +2 -2
- package/dist/platform/ops/agents.ops.d.ts +10 -3
- package/dist/platform/ops/agents.ops.js +128 -49
- package/dist/platform/ops/approvals.ops.d.ts +1 -1
- package/dist/platform/ops/approvals.ops.js +7 -2
- package/dist/platform/ops/automations.ops.d.ts +23 -0
- package/dist/platform/ops/automations.ops.js +604 -0
- package/dist/platform/ops/background.ops.js +5 -2
- package/dist/platform/ops/catalog-admin.ops.d.ts +11 -1
- package/dist/platform/ops/catalog-admin.ops.js +143 -19
- package/dist/platform/ops/channels.ops.d.ts +10 -3
- package/dist/platform/ops/channels.ops.js +246 -9
- package/dist/platform/ops/components.ops.d.ts +3 -1
- package/dist/platform/ops/components.ops.js +61 -2
- package/dist/platform/ops/connectors.ops.d.ts +22 -4
- package/dist/platform/ops/connectors.ops.js +738 -13
- package/dist/platform/ops/conversations.ops.d.ts +8 -1
- package/dist/platform/ops/conversations.ops.js +94 -18
- package/dist/platform/ops/devices.ops.d.ts +5 -1
- package/dist/platform/ops/devices.ops.js +312 -36
- package/dist/platform/ops/evals.ops.js +35 -72
- package/dist/platform/ops/extension-permissions.ops.d.ts +11 -0
- package/dist/platform/ops/extension-permissions.ops.js +159 -0
- package/dist/platform/ops/extensions-admin.ops.d.ts +49 -4
- package/dist/platform/ops/extensions-admin.ops.js +475 -16
- package/dist/platform/ops/extensions.ops.d.ts +25 -7
- package/dist/platform/ops/extensions.ops.js +301 -102
- package/dist/platform/ops/files.ops.d.ts +18 -0
- package/dist/platform/ops/files.ops.js +267 -0
- package/dist/platform/ops/inbox.ops.d.ts +4 -2
- package/dist/platform/ops/inbox.ops.js +144 -55
- package/dist/platform/ops/list-handoff.d.ts +10 -0
- package/dist/platform/ops/list-handoff.js +11 -0
- package/dist/platform/ops/marketplaces.ops.js +29 -5
- package/dist/platform/ops/models.ops.js +13 -3
- package/dist/platform/ops/org-plugins.ops.d.ts +13 -5
- package/dist/platform/ops/org-plugins.ops.js +170 -74
- package/dist/platform/ops/org-settings.ops.d.ts +5 -1
- package/dist/platform/ops/org-settings.ops.js +128 -19
- package/dist/platform/ops/orgs.ops.d.ts +48 -3
- package/dist/platform/ops/orgs.ops.js +512 -29
- package/dist/platform/ops/outbox.ops.d.ts +21 -0
- package/dist/platform/ops/outbox.ops.js +126 -0
- package/dist/platform/ops/person-inputs.d.ts +61 -0
- package/dist/platform/ops/person-inputs.js +121 -0
- package/dist/platform/ops/platform-icons.ops.d.ts +14 -0
- package/dist/platform/ops/platform-icons.ops.js +117 -0
- package/dist/platform/ops/platform.ops.d.ts +15 -2
- package/dist/platform/ops/platform.ops.js +111 -21
- package/dist/platform/ops/plugins.ops.d.ts +5 -1
- package/dist/platform/ops/plugins.ops.js +27 -48
- package/dist/platform/ops/requests.ops.js +68 -4
- package/dist/platform/ops/retention.d.ts +16 -0
- package/dist/platform/ops/retention.js +21 -0
- package/dist/platform/ops/setup.ops.js +1 -1
- package/dist/platform/ops/shares.ops.d.ts +16 -0
- package/dist/platform/ops/shares.ops.js +107 -0
- package/dist/platform/ops/skills.ops.d.ts +7 -1
- package/dist/platform/ops/skills.ops.js +111 -48
- package/dist/platform/ops/summary.d.ts +5 -0
- package/dist/platform/ops/summary.js +10 -0
- package/dist/platform/ops/themes.ops.js +1 -1
- package/dist/platform/ops/unavailable.js +2 -2
- package/dist/platform/parity.d.ts +13 -6
- package/dist/platform/parity.js +139 -51
- package/dist/platform/person-fields.d.ts +120 -0
- package/dist/platform/person-fields.js +404 -0
- package/dist/platform/platform-ops.module.d.ts +8 -1
- package/dist/platform/platform-ops.module.js +30 -0
- package/dist/platform/platform.module.d.ts +4 -3
- package/dist/platform/platform.module.js +8 -5
- package/dist/platform/route-schemas.js +38 -0
- package/dist/platform/sealed-inputs.d.ts +44 -0
- package/dist/platform/sealed-inputs.js +116 -0
- package/dist/platform/sealed-reveals.controller.d.ts +17 -0
- package/dist/platform/sealed-reveals.controller.js +48 -0
- package/dist/platform/sealed-reveals.d.ts +54 -0
- package/dist/platform/sealed-reveals.js +155 -0
- package/dist/plugin-reads/plugin-reads.service.d.ts +29 -0
- package/dist/plugin-reads/plugin-reads.service.js +214 -0
- package/dist/plugin-reads/token.d.ts +5 -0
- package/dist/plugin-reads/token.js +5 -0
- package/dist/push/delivery.d.ts +90 -0
- package/dist/push/delivery.js +273 -0
- package/dist/push/fanout.d.ts +30 -0
- package/dist/push/fanout.js +102 -0
- package/dist/push/jobs.d.ts +48 -0
- package/dist/push/jobs.js +21 -0
- package/dist/push/preferences.service.d.ts +18 -0
- package/dist/push/preferences.service.js +88 -0
- package/dist/push/provider-host.d.ts +34 -0
- package/dist/push/provider-host.js +94 -0
- package/dist/push/push-owed.d.ts +35 -0
- package/dist/push/push-owed.js +102 -0
- package/dist/push/push-processor.d.ts +40 -0
- package/dist/push/push-processor.js +121 -0
- package/dist/push/push.controller.d.ts +28 -0
- package/dist/push/push.controller.js +92 -0
- package/dist/push/push.module.d.ts +6 -0
- package/dist/push/push.module.js +29 -0
- package/dist/push/push.schemas.d.ts +91 -0
- package/dist/push/push.schemas.js +54 -0
- package/dist/push/recipients.d.ts +33 -0
- package/dist/push/recipients.js +324 -0
- package/dist/push/registration-cleanup.d.ts +9 -0
- package/dist/push/registration-cleanup.js +16 -0
- package/dist/push/registrations.service.d.ts +55 -0
- package/dist/push/registrations.service.js +254 -0
- package/dist/push/stale.job.d.ts +25 -0
- package/dist/push/stale.job.js +76 -0
- package/dist/push/texts.d.ts +46 -0
- package/dist/push/texts.js +50 -0
- package/dist/push/token-store.d.ts +31 -0
- package/dist/push/token-store.js +52 -0
- package/dist/push/triggers.d.ts +19 -0
- package/dist/push/triggers.js +30 -0
- package/dist/retention/jobs.d.ts +21 -0
- package/dist/retention/jobs.js +48 -0
- package/dist/retention/policy.d.ts +70 -0
- package/dist/retention/policy.js +103 -0
- package/dist/retention/purge-batch.d.ts +17 -0
- package/dist/retention/purge-batch.js +351 -0
- package/dist/retention/report-obligations.d.ts +12 -0
- package/dist/retention/report-obligations.js +71 -0
- package/dist/retention/sweep.job.d.ts +17 -0
- package/dist/retention/sweep.job.js +95 -0
- package/dist/retention/worker.d.ts +29 -0
- package/dist/retention/worker.js +307 -0
- package/dist/roles/gateway-role.d.ts +18 -7
- package/dist/roles/gateway-role.js +37 -11
- package/dist/roles/gateway.module.d.ts +3 -2
- package/dist/roles/gateway.module.js +16 -6
- package/dist/roles/worker-role.d.ts +31 -9
- package/dist/roles/worker-role.js +80 -31
- package/dist/roles/worker.module.d.ts +1 -1
- package/dist/roles/worker.module.js +90 -11
- package/dist/runtime/abort.d.ts +22 -3
- package/dist/runtime/abort.js +37 -17
- package/dist/runtime/checkpointer.d.ts +3 -0
- package/dist/runtime/checkpointer.js +9 -3
- package/dist/runtime/compaction-model.d.ts +57 -0
- package/dist/runtime/compaction-model.js +87 -0
- package/dist/runtime/compaction-progress.d.ts +62 -0
- package/dist/runtime/compaction-progress.js +82 -0
- package/dist/runtime/compaction-settings.service.d.ts +36 -0
- package/dist/runtime/compaction-settings.service.js +63 -0
- package/dist/runtime/compaction.service.d.ts +101 -0
- package/dist/runtime/compaction.service.js +127 -0
- package/dist/runtime/context/build.d.ts +210 -45
- package/dist/runtime/context/build.js +561 -107
- package/dist/runtime/context/cache-expiry.d.ts +31 -0
- package/dist/runtime/context/cache-expiry.js +60 -0
- package/dist/runtime/context/cache-ttl.d.ts +18 -0
- package/dist/runtime/context/cache-ttl.js +30 -0
- package/dist/runtime/context/compaction.d.ts +175 -16
- package/dist/runtime/context/compaction.js +639 -70
- package/dist/runtime/context/device-paths.d.ts +7 -32
- package/dist/runtime/context/device-paths.js +6 -40
- package/dist/runtime/context/fit.d.ts +111 -0
- package/dist/runtime/context/fit.js +278 -0
- package/dist/runtime/context/idle-compaction-rules.d.ts +109 -0
- package/dist/runtime/context/idle-compaction-rules.js +99 -0
- package/dist/runtime/context/in-context-compaction.d.ts +156 -0
- package/dist/runtime/context/in-context-compaction.js +310 -0
- package/dist/runtime/context/output-truncated.d.ts +16 -0
- package/dist/runtime/context/output-truncated.js +19 -0
- package/dist/runtime/context/permission-profile.d.ts +45 -0
- package/dist/runtime/context/permission-profile.js +264 -0
- package/dist/runtime/context/plugin-context.d.ts +20 -0
- package/dist/runtime/context/plugin-context.js +30 -0
- package/dist/runtime/context/project-root.d.ts +43 -0
- package/dist/runtime/context/project-root.js +85 -0
- package/dist/runtime/context/run-context.d.ts +61 -0
- package/dist/runtime/context/run-context.js +134 -0
- package/dist/runtime/context/run-outcome.d.ts +10 -0
- package/dist/runtime/context/run-outcome.js +92 -0
- package/dist/runtime/context/skills.d.ts +38 -54
- package/dist/runtime/context/skills.js +76 -117
- package/dist/runtime/context/tool-changes.d.ts +3 -3
- package/dist/runtime/context/tool-changes.js +6 -16
- package/dist/runtime/conversation-lock.d.ts +4 -11
- package/dist/runtime/conversation-lock.js +14 -18
- package/dist/runtime/hook-calls.d.ts +31 -13
- package/dist/runtime/hook-calls.js +61 -13
- package/dist/runtime/idle-arm.d.ts +48 -0
- package/dist/runtime/idle-arm.js +322 -0
- package/dist/runtime/idle-compaction-jobs.d.ts +46 -0
- package/dist/runtime/idle-compaction-jobs.js +21 -0
- package/dist/runtime/idle-compaction.d.ts +51 -0
- package/dist/runtime/idle-compaction.js +352 -0
- package/dist/runtime/idle-return.d.ts +62 -0
- package/dist/runtime/idle-return.js +173 -0
- package/dist/runtime/langgraph-loop.js +48 -9
- package/dist/runtime/limits.d.ts +15 -0
- package/dist/runtime/limits.js +25 -0
- package/dist/runtime/loop.d.ts +21 -5
- package/dist/runtime/loop.js +2 -1
- package/dist/runtime/maintenance.d.ts +50 -16
- package/dist/runtime/maintenance.js +300 -42
- package/dist/runtime/model-call.d.ts +403 -27
- package/dist/runtime/model-call.js +1472 -393
- package/dist/runtime/permission-context-errors.d.ts +39 -0
- package/dist/runtime/permission-context-errors.js +67 -0
- package/dist/runtime/permission-context.service.d.ts +60 -0
- package/dist/runtime/permission-context.service.js +289 -0
- package/dist/runtime/plugin-context.service.d.ts +75 -0
- package/dist/runtime/plugin-context.service.js +211 -0
- package/dist/runtime/project/knowledge.d.ts +135 -0
- package/dist/runtime/project/knowledge.js +256 -0
- package/dist/runtime/project/knowledge.service.d.ts +103 -0
- package/dist/runtime/project/knowledge.service.js +367 -0
- package/dist/runtime/providers.d.ts +116 -47
- package/dist/runtime/providers.js +266 -131
- package/dist/runtime/queue-lost-jobs.d.ts +24 -0
- package/dist/runtime/queue-lost-jobs.js +51 -0
- package/dist/runtime/quota.d.ts +12 -12
- package/dist/runtime/quota.js +42 -37
- package/dist/runtime/run-context.service.d.ts +21 -4
- package/dist/runtime/run-context.service.js +55 -31
- package/dist/runtime/run-control.d.ts +52 -5
- package/dist/runtime/run-control.js +86 -12
- package/dist/runtime/run-deletion.d.ts +30 -0
- package/dist/runtime/run-deletion.js +161 -0
- package/dist/runtime/run-drafts.d.ts +68 -4
- package/dist/runtime/run-drafts.js +174 -9
- package/dist/runtime/run-execution.d.ts +80 -0
- package/dist/runtime/run-execution.js +191 -0
- package/dist/runtime/run-finish.d.ts +71 -10
- package/dist/runtime/run-finish.js +201 -18
- package/dist/runtime/run-jobs.d.ts +123 -14
- package/dist/runtime/run-jobs.js +277 -29
- package/dist/runtime/run-liveness.d.ts +11 -0
- package/dist/runtime/run-liveness.js +19 -0
- package/dist/runtime/run-orphan-check.job.d.ts +146 -0
- package/dist/runtime/run-orphan-check.job.js +427 -0
- package/dist/runtime/run-principal.d.ts +9 -0
- package/dist/runtime/run-principal.js +18 -0
- package/dist/runtime/run-processors.d.ts +33 -24
- package/dist/runtime/run-processors.js +44 -9
- package/dist/runtime/run-queue.d.ts +155 -70
- package/dist/runtime/run-queue.js +615 -300
- package/dist/runtime/run-status.d.ts +12 -0
- package/dist/runtime/run-status.js +21 -0
- package/dist/runtime/run-steps.d.ts +18 -5
- package/dist/runtime/run-steps.js +51 -16
- package/dist/runtime/run-worker.d.ts +85 -25
- package/dist/runtime/run-worker.js +577 -154
- package/dist/runtime/runtime.module.d.ts +3 -4
- package/dist/runtime/runtime.module.js +74 -7
- package/dist/runtime/step-log.d.ts +24 -6
- package/dist/runtime/step-log.js +42 -14
- package/dist/runtime/stream-limit.d.ts +13 -0
- package/dist/runtime/stream-limit.js +40 -0
- package/dist/runtime/stream.controller.d.ts +11 -9
- package/dist/runtime/stream.controller.js +17 -17
- package/dist/runtime/stream.d.ts +8 -1
- package/dist/runtime/stream.js +115 -15
- package/dist/runtime/subagents/child.js +3 -1
- package/dist/runtime/subagents/definition.d.ts +38 -23
- package/dist/runtime/subagents/definition.js +118 -114
- package/dist/runtime/subagents/deliveries.d.ts +6 -3
- package/dist/runtime/subagents/deliveries.js +26 -8
- package/dist/runtime/subagents/dispatch.d.ts +23 -16
- package/dist/runtime/subagents/dispatch.js +48 -43
- package/dist/runtime/subagents/messages.d.ts +8 -2
- package/dist/runtime/subagents/messages.js +22 -9
- package/dist/runtime/subagents/org-agents.d.ts +1 -1
- package/dist/runtime/subagents/org-agents.js +3 -3
- package/dist/runtime/subagents/preamble.d.ts +3 -1
- package/dist/runtime/subagents/preamble.js +3 -1
- package/dist/runtime/subagents/progress.js +1 -0
- package/dist/runtime/subagents/render.d.ts +1 -2
- package/dist/runtime/subagents/render.js +1 -2
- package/dist/runtime/subagents/skill-fork.d.ts +5 -7
- package/dist/runtime/subagents/skill-fork.js +11 -5
- package/dist/runtime/subagents/status.js +2 -0
- package/dist/runtime/subagents/subagents.service.js +1 -1
- package/dist/runtime/subagents/template-skills.d.ts +47 -0
- package/dist/runtime/subagents/template-skills.js +77 -0
- package/dist/runtime/subagents/tree-jobs.d.ts +62 -0
- package/dist/runtime/subagents/tree-jobs.js +86 -0
- package/dist/runtime/usage-report-jobs.d.ts +24 -46
- package/dist/runtime/usage-report-jobs.js +86 -114
- package/dist/runtime/usage-report.d.ts +47 -84
- package/dist/runtime/usage-report.js +137 -242
- package/dist/runtime/waits.d.ts +65 -205
- package/dist/runtime/waits.js +210 -830
- package/dist/runtime/write-base.d.ts +178 -0
- package/dist/runtime/write-base.js +540 -0
- package/dist/runtime/write-base.service.d.ts +75 -0
- package/dist/runtime/write-base.service.js +216 -0
- package/dist/sandbox/attachments-path.d.ts +15 -0
- package/dist/sandbox/attachments-path.js +15 -0
- package/dist/sandbox/browse-roots.d.ts +8 -0
- package/dist/sandbox/browse-roots.js +22 -0
- package/dist/sandbox/device-reports.d.ts +110 -0
- package/dist/sandbox/device-reports.js +327 -0
- package/dist/sandbox/device-reports.module.d.ts +7 -0
- package/dist/sandbox/device-reports.module.js +25 -0
- package/dist/sandbox/device-sandbox-settings.d.ts +230 -0
- package/dist/sandbox/device-sandbox-settings.js +227 -0
- package/dist/sandbox/device-sandbox.d.ts +230 -0
- package/dist/sandbox/device-sandbox.js +251 -0
- package/dist/sandbox/device-services.d.ts +147 -0
- package/dist/sandbox/device-services.js +377 -0
- package/dist/sandbox/held-operations.d.ts +43 -0
- package/dist/sandbox/held-operations.js +137 -0
- package/dist/sandbox/jobs.d.ts +21 -11
- package/dist/sandbox/jobs.js +24 -18
- package/dist/sandbox/kernel-read.d.ts +85 -0
- package/dist/sandbox/kernel-read.js +87 -0
- package/dist/sandbox/leases.d.ts +25 -5
- package/dist/sandbox/leases.js +92 -12
- package/dist/sandbox/loopback-expiry.job.d.ts +23 -0
- package/dist/sandbox/loopback-expiry.job.js +56 -0
- package/dist/sandbox/loopback-grant-records.d.ts +144 -0
- package/dist/sandbox/loopback-grant-records.js +266 -0
- package/dist/sandbox/loopback-grants.d.ts +119 -0
- package/dist/sandbox/loopback-grants.js +454 -0
- package/dist/sandbox/loopback-live-ports.d.ts +12 -0
- package/dist/sandbox/loopback-live-ports.js +43 -0
- package/dist/sandbox/managed-device-context.d.ts +118 -0
- package/dist/sandbox/managed-device-context.js +375 -0
- package/dist/sandbox/managed-device-context.module.d.ts +6 -0
- package/dist/sandbox/managed-device-context.module.js +37 -0
- package/dist/sandbox/modes.d.ts +170 -0
- package/dist/sandbox/modes.js +196 -0
- package/dist/sandbox/network-grants.d.ts +69 -0
- package/dist/sandbox/network-grants.js +227 -0
- package/dist/sandbox/network-grants.module.d.ts +2 -0
- package/dist/sandbox/network-grants.module.js +14 -0
- package/dist/sandbox/operation-authority-types.d.ts +27 -0
- package/dist/sandbox/operation-authority-types.js +50 -0
- package/dist/sandbox/operation-authority.d.ts +174 -0
- package/dist/sandbox/operation-authority.js +952 -0
- package/dist/sandbox/operation-authority.module.d.ts +2 -0
- package/dist/sandbox/operation-authority.module.js +29 -0
- package/dist/sandbox/operation-intents.d.ts +288 -0
- package/dist/sandbox/operation-intents.js +1685 -0
- package/dist/sandbox/operation-intents.module.d.ts +2 -0
- package/dist/sandbox/operation-intents.module.js +22 -0
- package/dist/sandbox/operation-payloads.d.ts +33 -0
- package/dist/sandbox/operation-payloads.js +332 -0
- package/dist/sandbox/operation-reconcile.job.d.ts +71 -0
- package/dist/sandbox/operation-reconcile.job.js +418 -0
- package/dist/sandbox/operation-revoke.d.ts +20 -0
- package/dist/sandbox/operation-revoke.js +3 -0
- package/dist/sandbox/permission-authority-epochs.d.ts +18 -0
- package/dist/sandbox/permission-authority-epochs.js +83 -0
- package/dist/sandbox/permission-authority-lock.d.ts +44 -0
- package/dist/sandbox/permission-authority-lock.js +167 -0
- package/dist/sandbox/permission-authority.module.d.ts +9 -0
- package/dist/sandbox/permission-authority.module.js +60 -0
- package/dist/sandbox/permission-auto-grants.d.ts +42 -0
- package/dist/sandbox/permission-auto-grants.js +145 -0
- package/dist/sandbox/permission-availability.d.ts +78 -0
- package/dist/sandbox/permission-availability.js +92 -0
- package/dist/sandbox/permission-call-grants.d.ts +47 -0
- package/dist/sandbox/permission-call-grants.js +429 -0
- package/dist/sandbox/permission-call-grants.module.d.ts +2 -0
- package/dist/sandbox/permission-call-grants.module.js +28 -0
- package/dist/sandbox/permission-call-types.d.ts +151 -0
- package/dist/sandbox/permission-call-types.js +1 -0
- package/dist/sandbox/permission-ceiling-writes.d.ts +73 -0
- package/dist/sandbox/permission-ceiling-writes.js +375 -0
- package/dist/sandbox/permission-config-publication.d.ts +109 -0
- package/dist/sandbox/permission-config-publication.js +358 -0
- package/dist/sandbox/permission-context-types.d.ts +60 -0
- package/dist/sandbox/permission-context-types.js +11 -0
- package/dist/sandbox/permission-facts.d.ts +396 -0
- package/dist/sandbox/permission-facts.js +796 -0
- package/dist/sandbox/permission-facts.module.d.ts +2 -0
- package/dist/sandbox/permission-facts.module.js +20 -0
- package/dist/sandbox/permission-instance-writes.d.ts +76 -0
- package/dist/sandbox/permission-instance-writes.js +232 -0
- package/dist/sandbox/permission-runtime-reports.d.ts +92 -0
- package/dist/sandbox/permission-runtime-reports.js +337 -0
- package/dist/sandbox/permission-transitions.d.ts +33 -0
- package/dist/sandbox/permission-transitions.js +173 -0
- package/dist/sandbox/providers.d.ts +48 -32
- package/dist/sandbox/providers.js +68 -48
- package/dist/sandbox/providers.module.d.ts +2 -0
- package/dist/sandbox/providers.module.js +19 -0
- package/dist/sandbox/request-not-sent.d.ts +15 -0
- package/dist/sandbox/request-not-sent.js +20 -0
- package/dist/sandbox/review/classifier.d.ts +252 -0
- package/dist/sandbox/review/classifier.js +635 -0
- package/dist/sandbox/review/index.d.ts +13 -0
- package/dist/sandbox/review/index.js +10 -0
- package/dist/sandbox/review/permission-candidate.d.ts +143 -0
- package/dist/sandbox/review/permission-candidate.js +449 -0
- package/dist/sandbox/review/review.service.d.ts +260 -0
- package/dist/sandbox/review/review.service.js +761 -0
- package/dist/sandbox/review/rules.d.ts +96 -0
- package/dist/sandbox/review/rules.js +5427 -0
- package/dist/sandbox/review/types.d.ts +122 -0
- package/dist/sandbox/review/types.js +48 -0
- package/dist/sandbox/sandbox-file-reader.d.ts +47 -0
- package/dist/sandbox/sandbox-file-reader.js +125 -0
- package/dist/sandbox/sandbox.module.d.ts +3 -2
- package/dist/sandbox/sandbox.module.js +57 -7
- package/dist/sandbox/sandbox.service.d.ts +647 -160
- package/dist/sandbox/sandbox.service.js +2197 -470
- package/dist/sandbox/unreachable.js +20 -3
- package/dist/sandbox/use-context.d.ts +20 -0
- package/dist/sandbox/use-context.js +1 -0
- package/dist/setup/kernel-checks.d.ts +3 -3
- package/dist/setup/kernel-checks.js +7 -6
- package/dist/setup/oauth-token-probe.d.ts +1 -8
- package/dist/setup/oauth-token-probe.js +8 -20
- package/dist/setup/setup-check-registry.d.ts +16 -5
- package/dist/setup/setup-check-registry.js +11 -3
- package/dist/setup/setup-checks.schemas.d.ts +29 -0
- package/dist/setup/setup-checks.schemas.js +32 -0
- package/dist/setup/setup-checks.service.d.ts +35 -12
- package/dist/setup/setup-checks.service.js +159 -59
- package/dist/setup/setup-guides.service.d.ts +19 -4
- package/dist/setup/setup-guides.service.js +44 -11
- package/dist/shares/liveness.d.ts +73 -0
- package/dist/shares/liveness.js +236 -0
- package/dist/shares/revoke.d.ts +31 -0
- package/dist/shares/revoke.js +47 -0
- package/dist/shares/settings.d.ts +76 -0
- package/dist/shares/settings.js +117 -0
- package/dist/shares/share-code.d.ts +4 -0
- package/dist/shares/share-code.js +28 -0
- package/dist/shares/share-open.controller.d.ts +35 -0
- package/dist/shares/share-open.controller.js +107 -0
- package/dist/shares/share-open.service.d.ts +111 -0
- package/dist/shares/share-open.service.js +293 -0
- package/dist/shares/share-previews.controller.d.ts +50 -0
- package/dist/shares/share-previews.controller.js +115 -0
- package/dist/shares/shares.controller.d.ts +45 -0
- package/dist/shares/shares.controller.js +148 -0
- package/dist/shares/shares.module.d.ts +7 -0
- package/dist/shares/shares.module.js +39 -0
- package/dist/shares/shares.schemas.d.ts +35 -0
- package/dist/shares/shares.schemas.js +27 -0
- package/dist/shares/shares.service.d.ts +222 -0
- package/dist/shares/shares.service.js +721 -0
- package/dist/shares/sweep.job.d.ts +53 -0
- package/dist/shares/sweep.job.js +173 -0
- package/dist/skills/agent-skills.controller.d.ts +48 -0
- package/dist/skills/agent-skills.controller.js +131 -0
- package/dist/skills/agent-skills.service.d.ts +263 -0
- package/dist/skills/agent-skills.service.js +980 -0
- package/dist/skills/catalog.d.ts +83 -71
- package/dist/skills/catalog.js +148 -215
- package/dist/skills/changes.controller.d.ts +6 -23
- package/dist/skills/changes.controller.js +8 -56
- package/dist/skills/changes.service.d.ts +75 -115
- package/dist/skills/changes.service.js +269 -606
- package/dist/skills/conversation-catalog.d.ts +55 -0
- package/dist/skills/conversation-catalog.js +144 -0
- package/dist/skills/invocable.controller.d.ts +4 -0
- package/dist/skills/invocable.controller.js +5 -1
- package/dist/skills/invocation-keys.d.ts +1 -1
- package/dist/skills/invocation-keys.js +1 -1
- package/dist/skills/invoke.d.ts +153 -5
- package/dist/skills/invoke.js +288 -6
- package/dist/skills/package.d.ts +0 -5
- package/dist/skills/package.js +0 -14
- package/dist/skills/skill-files.d.ts +91 -0
- package/dist/skills/skill-files.js +144 -0
- package/dist/skills/skills.controller.d.ts +28 -10
- package/dist/skills/skills.controller.js +77 -31
- package/dist/skills/skills.module.js +26 -2
- package/dist/skills/skills.schemas.d.ts +69 -15
- package/dist/skills/skills.schemas.js +117 -18
- package/dist/skills/skills.service.d.ts +108 -71
- package/dist/skills/skills.service.js +335 -205
- package/dist/skills/usable.d.ts +59 -7
- package/dist/skills/usable.js +252 -43
- package/dist/storage/purge.d.ts +1 -1
- package/dist/storage/purge.js +7 -3
- package/dist/storage/storage.service.d.ts +19 -1
- package/dist/storage/storage.service.js +87 -5
- package/dist/themes/avatar-preset-key.d.ts +6 -0
- package/dist/themes/avatar-preset-key.js +9 -0
- package/dist/themes/platform-icon-objects.d.ts +51 -0
- package/dist/themes/platform-icon-objects.js +113 -0
- package/dist/themes/platform-icon-public.controller.d.ts +17 -0
- package/dist/themes/platform-icon-public.controller.js +58 -0
- package/dist/themes/platform-icon.controller.d.ts +22 -0
- package/dist/themes/platform-icon.controller.js +65 -0
- package/dist/themes/platform-icon.schemas.d.ts +48 -0
- package/dist/themes/platform-icon.schemas.js +53 -0
- package/dist/themes/platform-icon.service.d.ts +83 -0
- package/dist/themes/platform-icon.service.js +301 -0
- package/dist/themes/render-css.js +9 -2
- package/dist/themes/theme-delivery.service.d.ts +10 -2
- package/dist/themes/theme-delivery.service.js +26 -11
- package/dist/themes/theme-state.d.ts +43 -2
- package/dist/themes/theme-state.js +88 -20
- package/dist/themes/themes-public.controller.d.ts +3 -3
- package/dist/themes/themes-public.controller.js +3 -3
- package/dist/themes/themes.module.d.ts +4 -1
- package/dist/themes/themes.module.js +9 -4
- package/dist/themes/themes.service.d.ts +28 -1
- package/dist/themes/themes.service.js +36 -2
- package/dist/tools/admin-connectors.d.ts +73 -0
- package/dist/tools/admin-connectors.js +141 -0
- package/dist/tools/approvals.controller.d.ts +6 -2
- package/dist/tools/approvals.controller.js +36 -2
- package/dist/tools/approvals.schemas.d.ts +2 -0
- package/dist/tools/approvals.schemas.js +5 -1
- package/dist/tools/approvals.service.d.ts +680 -18
- package/dist/tools/approvals.service.js +2004 -56
- package/dist/tools/builtin-names.d.ts +29 -20
- package/dist/tools/builtin-names.js +60 -31
- package/dist/tools/builtins/agent.js +13 -5
- package/dist/tools/builtins/artifacts.d.ts +77 -0
- package/dist/tools/builtins/artifacts.js +173 -0
- package/dist/tools/builtins/ask-user.js +3 -2
- package/dist/tools/builtins/automations.d.ts +111 -0
- package/dist/tools/builtins/automations.js +1083 -0
- package/dist/tools/builtins/builtin-tools.d.ts +38 -7
- package/dist/tools/builtins/builtin-tools.js +191 -32
- package/dist/tools/builtins/conversation-files.d.ts +58 -0
- package/dist/tools/builtins/conversation-files.js +141 -0
- package/dist/tools/builtins/image/generate.d.ts +71 -0
- package/dist/tools/builtins/image/generate.js +586 -0
- package/dist/tools/builtins/image/index.d.ts +2 -0
- package/dist/tools/builtins/image/index.js +2 -0
- package/dist/tools/builtins/image/paths.d.ts +12 -0
- package/dist/tools/builtins/image/paths.js +26 -0
- package/dist/tools/builtins/image/size.d.ts +12 -0
- package/dist/tools/builtins/image/size.js +36 -0
- package/dist/tools/builtins/platform.d.ts +47 -2
- package/dist/tools/builtins/platform.js +355 -39
- package/dist/tools/builtins/sandbox/bash.d.ts +53 -1
- package/dist/tools/builtins/sandbox/bash.js +372 -206
- package/dist/tools/builtins/sandbox/common.d.ts +218 -61
- package/dist/tools/builtins/sandbox/common.js +390 -187
- package/dist/tools/builtins/sandbox/deliver.d.ts +3 -0
- package/dist/tools/builtins/sandbox/deliver.js +112 -71
- package/dist/tools/builtins/sandbox/device-code.d.ts +40 -0
- package/dist/tools/builtins/sandbox/device-code.js +57 -0
- package/dist/tools/builtins/sandbox/device-owner.d.ts +12 -0
- package/dist/tools/builtins/sandbox/device-owner.js +13 -0
- package/dist/tools/builtins/sandbox/edit.js +14 -7
- package/dist/tools/builtins/sandbox/fetch-attachment.d.ts +11 -0
- package/dist/tools/builtins/sandbox/fetch-attachment.js +133 -0
- package/dist/tools/builtins/sandbox/file-state.d.ts +31 -1
- package/dist/tools/builtins/sandbox/file-state.js +33 -3
- package/dist/tools/builtins/sandbox/glob.js +15 -10
- package/dist/tools/builtins/sandbox/grep.d.ts +8 -1
- package/dist/tools/builtins/sandbox/grep.js +35 -40
- package/dist/tools/builtins/sandbox/index.d.ts +9 -7
- package/dist/tools/builtins/sandbox/index.js +13 -7
- package/dist/tools/builtins/sandbox/read.d.ts +56 -2
- package/dist/tools/builtins/sandbox/read.js +272 -50
- package/dist/tools/builtins/sandbox/search-command.d.ts +44 -0
- package/dist/tools/builtins/sandbox/search-command.js +94 -0
- package/dist/tools/builtins/sandbox/task-list.d.ts +12 -0
- package/dist/tools/builtins/sandbox/task-list.js +136 -0
- package/dist/tools/builtins/sandbox/task-output.d.ts +22 -41
- package/dist/tools/builtins/sandbox/task-output.js +255 -201
- package/dist/tools/builtins/sandbox/task-stop.d.ts +4 -3
- package/dist/tools/builtins/sandbox/task-stop.js +51 -26
- package/dist/tools/builtins/sandbox/write.js +17 -9
- package/dist/tools/builtins/send-message.d.ts +1 -1
- package/dist/tools/builtins/send-message.js +4 -3
- package/dist/tools/builtins/size-text.d.ts +2 -0
- package/dist/tools/builtins/size-text.js +8 -0
- package/dist/tools/builtins/skill-load.d.ts +57 -5
- package/dist/tools/builtins/skill-load.js +249 -15
- package/dist/tools/builtins/tool-search.d.ts +4 -7
- package/dist/tools/builtins/tool-search.js +10 -13
- package/dist/tools/builtins/vision/read-image.d.ts +59 -0
- package/dist/tools/builtins/vision/read-image.js +222 -0
- package/dist/tools/builtins/web/extract.d.ts +2 -4
- package/dist/tools/builtins/web/extract.js +15 -16
- package/dist/tools/builtins/web/fetch.js +1 -1
- package/dist/tools/builtins/web/search.js +3 -5
- package/dist/tools/call-scope.d.ts +122 -0
- package/dist/tools/call-scope.js +104 -0
- package/dist/tools/connector-account-policies.d.ts +36 -1
- package/dist/tools/connector-account-policies.js +67 -6
- package/dist/tools/connector-content.controller.d.ts +6 -2
- package/dist/tools/connector-content.controller.js +13 -3
- package/dist/tools/connector-content.d.ts +55 -15
- package/dist/tools/connector-content.js +113 -54
- package/dist/tools/connector-setup.d.ts +32 -0
- package/dist/tools/connector-setup.js +47 -0
- package/dist/tools/connector-tools-jobs.d.ts +36 -0
- package/dist/tools/connector-tools-jobs.js +40 -0
- package/dist/tools/connector-tools.processor.d.ts +32 -0
- package/dist/tools/connector-tools.processor.js +97 -0
- package/dist/tools/connectors.controller.d.ts +85 -35
- package/dist/tools/connectors.controller.js +116 -61
- package/dist/tools/connectors.schemas.d.ts +184 -2
- package/dist/tools/connectors.schemas.js +110 -5
- package/dist/tools/connectors.service.d.ts +271 -35
- package/dist/tools/connectors.service.js +827 -142
- package/dist/tools/credentials.d.ts +60 -0
- package/dist/tools/credentials.js +159 -1
- package/dist/tools/credentials.module.d.ts +7 -0
- package/dist/tools/credentials.module.js +22 -0
- package/dist/tools/drift.d.ts +12 -3
- package/dist/tools/drift.js +85 -47
- package/dist/tools/editable-endpoint.d.ts +23 -0
- package/dist/tools/editable-endpoint.js +92 -0
- package/dist/tools/elicitation.d.ts +2 -0
- package/dist/tools/elicitation.js +1 -1
- package/dist/tools/fixed-ask.d.ts +7 -0
- package/dist/tools/fixed-ask.js +9 -0
- package/dist/tools/git-asks.d.ts +113 -0
- package/dist/tools/git-asks.js +174 -0
- package/dist/tools/git-push-policy.d.ts +89 -0
- package/dist/tools/git-push-policy.js +179 -0
- package/dist/tools/info.d.ts +28 -13
- package/dist/tools/info.js +60 -30
- package/dist/tools/job-ids.d.ts +0 -4
- package/dist/tools/job-ids.js +1 -6
- package/dist/tools/loopback-asks.d.ts +52 -0
- package/dist/tools/loopback-asks.js +70 -0
- package/dist/tools/mentionable-connectors.d.ts +88 -0
- package/dist/tools/mentionable-connectors.js +218 -0
- package/dist/tools/network-asks.d.ts +276 -0
- package/dist/tools/network-asks.js +427 -0
- package/dist/tools/oauth/authorization-params.d.ts +7 -0
- package/dist/tools/oauth/authorization-params.js +19 -0
- package/dist/tools/oauth/discovery.d.ts +40 -16
- package/dist/tools/oauth/discovery.js +62 -34
- package/dist/tools/oauth/flow.d.ts +18 -3
- package/dist/tools/oauth/flow.js +42 -9
- package/dist/tools/oauth/oauth.controller.d.ts +20 -11
- package/dist/tools/oauth/oauth.controller.js +44 -23
- package/dist/tools/oauth/oauth.schemas.d.ts +27 -0
- package/dist/tools/oauth/oauth.schemas.js +30 -0
- package/dist/tools/oauth/tokens.js +2 -1
- package/dist/tools/org-tool-policies.d.ts +24 -0
- package/dist/tools/org-tool-policies.js +113 -0
- package/dist/tools/org-tool-switches.d.ts +5 -69
- package/dist/tools/org-tool-switches.js +13 -141
- package/dist/tools/outputs.d.ts +6 -4
- package/dist/tools/outputs.js +33 -29
- package/dist/tools/permission-approval-jobs.d.ts +18 -0
- package/dist/tools/permission-approval-jobs.js +95 -0
- package/dist/tools/pipeline.d.ts +575 -28
- package/dist/tools/pipeline.js +3177 -171
- package/dist/tools/policy.d.ts +31 -15
- package/dist/tools/policy.js +91 -54
- package/dist/tools/questions.controller.js +2 -2
- package/dist/tools/questions.service.d.ts +128 -12
- package/dist/tools/questions.service.js +284 -18
- package/dist/tools/registry.d.ts +180 -21
- package/dist/tools/registry.js +153 -40
- package/dist/tools/result-images.d.ts +91 -0
- package/dist/tools/result-images.js +195 -0
- package/dist/tools/specs.d.ts +13 -4
- package/dist/tools/specs.js +22 -8
- package/dist/tools/tool-review.d.ts +113 -0
- package/dist/tools/tool-review.js +303 -0
- package/dist/tools/tool-watch-queue.d.ts +45 -0
- package/dist/tools/tool-watch-queue.js +28 -0
- package/dist/tools/tool-watch-queue.module.d.ts +7 -0
- package/dist/tools/tool-watch-queue.module.js +24 -0
- package/dist/tools/tool-watch.processor.d.ts +35 -0
- package/dist/tools/tool-watch.processor.js +114 -0
- package/dist/tools/tool-watch.service.d.ts +46 -0
- package/dist/tools/tool-watch.service.js +216 -0
- package/dist/tools/tools.module.js +79 -6
- package/dist/tools/watched-waits-lock.d.ts +15 -0
- package/dist/tools/watched-waits-lock.js +40 -0
- package/dist/ui/admin-ui.controller.d.ts +8 -3
- package/dist/ui/admin-ui.controller.js +17 -2
- package/dist/ui/call-extension.d.ts +6 -4
- package/dist/ui/call-extension.js +5 -4
- package/dist/ui/embed-token.d.ts +2 -2
- package/dist/ui/embed-token.js +83 -6
- package/dist/ui/registry.d.ts +21 -5
- package/dist/ui/registry.js +24 -6
- package/dist/ui/ui-stream.d.ts +2 -0
- package/dist/ui/ui-stream.js +20 -6
- package/dist/ui/ui.schemas.d.ts +34 -0
- package/dist/ui/ui.schemas.js +32 -4
- package/dist/ui/views.controller.d.ts +22 -8
- package/dist/ui/views.controller.js +58 -7
- package/dist/ui/views.d.ts +64 -7
- package/dist/ui/views.js +238 -31
- package/dist/until-aborted.d.ts +5 -0
- package/dist/until-aborted.js +16 -0
- package/package.json +13 -4
- package/src/migrations/0108_question_skipped.sql +6 -0
- package/src/migrations/0109_audit_platform_idx.sql +5 -0
- package/src/migrations/0110_usage_time_idx.sql +8 -0
- package/src/migrations/0111_agent_skill_sharing.sql +22 -0
- package/src/migrations/0112_skill_share_requests.sql +4 -0
- package/src/migrations/0113_scheduled_tasks.sql +108 -0
- package/src/migrations/0114_network_asks.sql +23 -0
- package/src/migrations/0115_network_requests.sql +28 -0
- package/src/migrations/0116_skills_default_on.sql +37 -0
- package/src/migrations/0117_sandbox_tiers.sql +11 -0
- package/src/migrations/0118_device_policy_ops.sql +6 -0
- package/src/migrations/0119_outbox.sql +22 -0
- package/src/migrations/0120_drop_usage_report_sweep.sql +7 -0
- package/src/migrations/0121_drop_platform_migration_runs.sql +12 -0
- package/src/migrations/0122_drop_scheduled_task_runs_rechecked_at.sql +5 -0
- package/src/migrations/0123_pgvector.sql +27 -0
- package/src/migrations/0124_conversation_source.sql +36 -0
- package/src/migrations/0125_conversation_tree_stopped_at.sql +5 -0
- package/src/migrations/0126_git_gateway.sql +10 -0
- package/src/migrations/0127_git_push_policy.sql +12 -0
- package/src/migrations/0128_scheduled_task_plugin_disabled.sql +10 -0
- package/src/migrations/0129_connector_plugin_disabled.sql +5 -0
- package/src/migrations/0130_auto_mode.sql +48 -0
- package/src/migrations/0131_device_mode.sql +9 -0
- package/src/migrations/0132_compact_runs.sql +6 -0
- package/src/migrations/0133_project_root.sql +30 -0
- package/src/migrations/0134_org_cloud_network_delta.sql +38 -0
- package/src/migrations/0135_run_execution_claim.sql +2 -0
- package/src/migrations/0136_run_recovery_cursor.sql +6 -0
- package/src/migrations/0137_audit_org_idx.sql +5 -0
- package/src/migrations/0138_plugin_install_status_no_upgrading.sql +18 -0
- package/src/migrations/0139_retire_legacy_forms.sql +183 -0
- package/src/migrations/0140_retire_history_forms.sql +148 -0
- package/src/migrations/0141_install_ledger_promoted_rows.sql +36 -0
- package/src/migrations/0142_backfill_event_fields.sql +74 -0
- package/src/migrations/0143_backfill_model_call_fields.sql +105 -0
- package/src/migrations/0144_retire_frozen_definition_keys.sql +163 -0
- package/src/migrations/0145_org_network_allowances.sql +12 -0
- package/src/migrations/0146_permission_authority_epochs.sql +6 -0
- package/src/migrations/0147_conversation_permission_profiles.sql +4 -0
- package/src/migrations/0148_first_message_request_hash.sql +2 -0
- package/src/migrations/0149_sandbox_operation_intents.sql +66 -0
- package/src/migrations/0150_permission_call_grants_and_approvals.sql +36 -0
- package/src/migrations/0151_starting_execution_grants.sql +8 -0
- package/src/migrations/0152_background_launch_identity.sql +66 -0
- package/src/migrations/0153_background_cancel_requester.sql +13 -0
- package/src/migrations/0154_cloud_owner_ceiling.sql +14 -0
- package/src/migrations/0155_device_instance_generations.sql +30 -0
- package/src/migrations/0156_device_owner_report.sql +7 -0
- package/src/migrations/0157_legacy_retirement.sql +116 -0
- package/src/migrations/0158_legacy_freeze_enumerated.sql +5 -0
- package/src/migrations/0159_retirement_exact_cancel.sql +9 -0
- package/src/migrations/0160_model_usage_image_kind.sql +10 -0
- package/src/migrations/0161_file_shares.sql +35 -0
- package/src/migrations/0162_permission_call_escalation.sql +9 -0
- package/src/migrations/0163_read_attachments.sql +10 -0
- package/src/migrations/0164_platform_icons.sql +10 -0
- package/src/migrations/0165_device_network_columns.sql +50 -0
- package/src/migrations/0166_permission_grant_full_access.sql +17 -0
- package/src/migrations/0167_device_network_backfill.sql +32 -0
- package/src/migrations/0168_binding_installed_connection.sql +6 -0
- package/src/migrations/0169_platform_sealed_inputs.sql +23 -0
- package/src/migrations/0170_platform_sealed_reveals.sql +27 -0
- package/src/migrations/0171_account_avatar.sql +26 -0
- package/src/migrations/0172_push.sql +40 -0
- package/src/migrations/0173_push_auth_notice.sql +10 -0
- package/src/migrations/0174_marketplace_managed_username.sql +4 -0
- package/src/migrations/0175_secure_input_kind.sql +8 -0
- package/src/migrations/0176_device_report.sql +6 -0
- package/src/migrations/0177_dial_in_contract.sql +32 -0
- package/src/migrations/0178_bootstrap_run_extra.sql +17 -0
- package/src/migrations/0179_device_report_limit_text.sql +28 -0
- package/src/migrations/0180_device_instance_abandoned.sql +6 -0
- package/src/migrations/0181_connector_description.sql +3 -0
- package/src/migrations/0182_rls_policies.sql +202 -0
- package/src/migrations/0183_connectors_created_by_nullable.sql +5 -0
- package/src/migrations/0184_background_cancel_failure.sql +10 -0
- package/src/migrations/0185_channel_process_display.sql +13 -0
- package/src/migrations/0186_question_woken.sql +5 -0
- package/src/migrations/0187_device_conversation_notices.sql +35 -0
- package/src/migrations/0188_automations_rename.sql +309 -0
- package/src/migrations/0189_event_automations.sql +136 -0
- package/src/migrations/0190_file_library.sql +285 -0
- package/src/migrations/0191_file_library_copy.sql +4 -0
- package/src/migrations/0192_inbox_items.sql +50 -0
- package/src/migrations/0193_trigger_cause_handles.sql +49 -0
- package/src/migrations/0194_automation_acceptance.sql +83 -0
- package/src/migrations/0195_idle_compaction.sql +7 -0
- package/src/migrations/0196_conversation_events_compaction_summary_idx.sql +8 -0
- package/src/migrations/0197_inbox_item_localized_text.sql +8 -0
- package/src/migrations/0198_acceptance_prompt.sql +10 -0
- package/src/migrations/0199_device_loopback_grants.sql +59 -0
- package/src/migrations/0200_runs_idle_mode.sql +4 -0
- package/src/migrations/0201_tool_specs_text.sql +8 -0
- package/src/migrations/0202_connector_endpoint_changed_at.sql +1 -0
- package/src/migrations/0203_model_cache_write_pricing.sql +5 -0
- package/src/migrations/0204_device_instance_retirement_identities.sql +46 -0
- package/src/migrations/0205_device_site_grants.sql +30 -0
- package/src/migrations/0206_retire_org_extension_uploads.sql +125 -0
- package/src/migrations/0207_confirm_device_instance_destruction.sql +25 -0
- package/src/migrations/0208_convert_stored_permission_settings.sql +189 -0
- package/src/migrations/0209_onboarding_checklist.sql +5 -0
- package/src/migrations/0210_normalize_conversation_history.sql +1012 -0
- package/src/migrations/0211_pre_release_cleanup.sql +154 -0
- package/src/migrations/0212_org_security_policy.sql +234 -0
- package/src/migrations/0213_contract_org_security_policy.sql +43 -0
- package/src/migrations/0214_model_usage_price_snapshot.sql +2 -0
- package/src/migrations/0215_conversation_events_org_id.sql +48 -0
- package/src/migrations/0216_model_budget_counters.sql +24 -0
- package/src/migrations/0217_retention.sql +44 -0
- package/src/migrations/0218_data_erasure.sql +41 -0
- package/src/migrations/0219_event_org_constraint_check.sql +29 -0
- package/src/migrations/0220_require_event_org.sql +18 -0
- package/src/migrations/0221_drop_connector_declaration_policy.sql +2 -0
- package/src/migrations/0222_device_host_services.sql +27 -0
- package/src/migrations/0223_device_service_events.sql +54 -0
- package/src/migrations/0224_cache_conversation_rls_settings.sql +33 -0
- package/src/migrations/0225_extension_effect_receipts.sql +25 -0
- package/src/migrations/0226_enable_kernel_rls.sql +30 -0
- package/src/migrations/0227_external_conversations.sql +33 -0
- package/src/migrations/0228_extension_org_switches.sql +56 -0
- package/src/migrations/0229_catalog_dependency_edges.sql +17 -0
- package/src/migrations/0230_audit_filter_idx.sql +18 -0
- package/src/migrations/0231_plugin_effect_work.sql +171 -0
- package/src/migrations/0232_contract_plugin_effect_schema.sql +49 -0
- package/src/migrations/0233_enable_request_targets.sql +64 -0
- package/src/migrations/0234_extension_grant_epoch.sql +141 -0
- package/src/migrations/0235_extension_revision_grants.sql +166 -0
- package/src/migrations/0236_paged_table_idx.sql +33 -0
- package/src/migrations/0237_extension_handoff_health.sql +18 -0
- package/src/migrations/0238_extension_usage.sql +40 -0
- package/src/migrations/0239_extension_replica_isolation.sql +28 -0
- package/src/migrations/0240_directory_sync_state.sql +34 -0
- package/dist/background/status.d.ts +0 -35
- package/dist/background/status.js +0 -57
- package/dist/catalog/org-extension-switch.d.ts +0 -41
- package/dist/catalog/org-extension-switch.js +0 -115
- package/dist/catalog/owned-plugin-cleanup.d.ts +0 -56
- package/dist/catalog/owned-plugin-cleanup.js +0 -194
- package/dist/catalog/platform-migration.d.ts +0 -115
- package/dist/catalog/platform-migration.js +0 -583
- package/dist/conversations/job-ids.d.ts +0 -6
- package/dist/conversations/job-ids.js +0 -6
- package/dist/devices/legacy-cleanup.job.d.ts +0 -34
- package/dist/devices/legacy-cleanup.job.js +0 -141
- package/dist/extensions/job-ids.d.ts +0 -6
- package/dist/extensions/job-ids.js +0 -6
- package/dist/infra/queue/add-job-once.d.ts +0 -14
- package/dist/infra/queue/add-job-once.js +0 -16
- package/dist/infra/queue/retired-schedulers.d.ts +0 -7
- package/dist/infra/queue/retired-schedulers.js +0 -9
- package/dist/local-devices/device-auth.module.d.ts +0 -7
- package/dist/local-devices/device-auth.module.js +0 -25
- package/dist/local-devices/device-routes.d.ts +0 -36
- package/dist/local-devices/device-routes.js +0 -90
- package/dist/local-devices/local-device-gateway.d.ts +0 -128
- package/dist/local-devices/local-device-gateway.js +0 -530
- package/dist/local-devices/local-device-provider.d.ts +0 -89
- package/dist/local-devices/local-device-provider.js +0 -151
- package/dist/local-devices/local-devices.module.d.ts +0 -16
- package/dist/local-devices/local-devices.module.js +0 -44
- package/dist/local-devices/relay.d.ts +0 -100
- package/dist/local-devices/relay.js +0 -373
- package/dist/local-devices/targets.d.ts +0 -28
- package/dist/local-devices/targets.js +0 -73
- package/dist/orgs/job-ids.d.ts +0 -8
- package/dist/orgs/job-ids.js +0 -8
- package/dist/runtime/context/legacy-text.d.ts +0 -22
- package/dist/runtime/context/legacy-text.js +0 -37
- package/dist/runtime/job-ids.d.ts +0 -10
- package/dist/runtime/job-ids.js +0 -10
- package/dist/runtime/retired-schedulers.d.ts +0 -7
- package/dist/runtime/retired-schedulers.js +0 -31
- package/dist/storage/job-ids.d.ts +0 -6
- package/dist/storage/job-ids.js +0 -6
- package/dist/tools/builtins/skill-write.d.ts +0 -59
- package/dist/tools/builtins/skill-write.js +0 -244
- package/dist/tools/legacy-data.d.ts +0 -34
- package/dist/tools/legacy-data.js +0 -76
- package/dist/tools/legacy-keys.d.ts +0 -51
- package/dist/tools/legacy-keys.js +0 -115
package/dist/extensions/host.js
CHANGED
|
@@ -11,36 +11,68 @@ import { readFile } from "node:fs/promises";
|
|
|
11
11
|
import { createRequire } from "node:module";
|
|
12
12
|
import { dirname, isAbsolute, join, resolve as resolvePath } from "node:path";
|
|
13
13
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
14
|
-
import { EXTENSION_POINT_CARDINALITY, parseExtensionPoint, SDK_VERSION, } from "@capybara-hq/plugin-sdk";
|
|
15
|
-
import { Inject, Injectable } from "@nestjs/common";
|
|
16
|
-
import {
|
|
14
|
+
import { EXTENSION_POINT_CARDINALITY, extensionPointRefs, OBJECT_STORE_EXTENSION_POINT, parseExtensionPoint, SDK_VERSION, staticPermissionDeclarations, } from "@capybara-hq/plugin-sdk";
|
|
15
|
+
import { Inject, Injectable, Optional } from "@nestjs/common";
|
|
16
|
+
import { ModuleRef } from "@nestjs/core";
|
|
17
|
+
import { TRIGGER_EVENTS_BACKEND } from "../automations/events/token.js";
|
|
18
|
+
import { officialPublisherProofMode } from "../catalog/publisher-policy.js";
|
|
19
|
+
import { resolveCapacity } from "../config/capacity-presets.js";
|
|
20
|
+
import { changedPaths, configFields, getPath, secretValues, unreachableSecrets, } from "../config/fields.js";
|
|
21
|
+
import { EXTERNAL_CONVERSATIONS_BACKEND } from "../conversations/external/token.js";
|
|
17
22
|
import { pluginSchemaName, queryEnabledPlugins, } from "../ctx/create-ctx.js";
|
|
23
|
+
import { ExtensionEffects } from "../ctx/durable-effects.service.js";
|
|
24
|
+
import { ExtensionEffectKeys } from "../ctx/durable-keys.js";
|
|
25
|
+
import { EXTENSION_NET_SEAMS } from "../ctx/net.js";
|
|
26
|
+
import { ConfiguredExtensionDbIdentity, extensionDbIdentity, extensionDbPool, } from "../db/extension-db.js";
|
|
27
|
+
import { ensureLocalExtensionHandoff } from "../db/extension-handoff-schema.js";
|
|
28
|
+
import { transferKnownExtensionSchemas } from "../db/extension-schema-transfer.js";
|
|
18
29
|
import { kernelDb } from "../db/kernel-schema.js";
|
|
19
30
|
import { migrate } from "../db/migrator.js";
|
|
20
31
|
import { createDb } from "../db/pool.js";
|
|
32
|
+
import { DEVICE_ACCESS_BACKEND, SERVICE_EVENTS_BACKEND } from "../device-access/token.js";
|
|
33
|
+
import { DialInAccess } from "../dial-in/access.js";
|
|
34
|
+
import { INBOX_ITEMS_BACKEND } from "../inbox/token.js";
|
|
21
35
|
import { waitWithin } from "../infra/close-within.js";
|
|
22
36
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
23
37
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
38
|
+
import { asPlatform, withOrgScope } from "../infra/database/org-scope.js";
|
|
24
39
|
import { LockService } from "../infra/lock/lock.service.js";
|
|
25
40
|
import { KERNEL_LOGGER, KEYRING, REDIS, REDIS_SUBSCRIBER } from "../infra/tokens.js";
|
|
26
|
-
import { KERNEL_APP_OPTIONS } from "../lifecycle/tokens.js";
|
|
41
|
+
import { KERNEL_APP_OPTIONS, KERNEL_FIXTURE_TRUST, } from "../lifecycle/tokens.js";
|
|
27
42
|
import { ModelEmbeddings } from "../models/embeddings.js";
|
|
43
|
+
import { ModelImages } from "../models/images.js";
|
|
44
|
+
import { OrgNetworkAllowances } from "../orgs/network-allowances.service.js";
|
|
28
45
|
import { packagePath } from "../packages/tgz.js";
|
|
46
|
+
import { PLUGIN_READS_BACKEND } from "../plugin-reads/token.js";
|
|
47
|
+
import { DeviceReports } from "../sandbox/device-reports.js";
|
|
48
|
+
import { ShareLiveness } from "../shares/liveness.js";
|
|
29
49
|
import { EmbedTokens } from "../ui/embed-token.js";
|
|
30
|
-
import { ExtensionApprovals, planApprovals, readSnapshots, withPreApproved, } from "./approvals.js";
|
|
50
|
+
import { ExtensionApprovals, planApprovals, readSnapshots, snapshotCovers, withPreApproved, } from "./approvals.js";
|
|
31
51
|
import { ExtensionBlobIntegrityError } from "./blobs.js";
|
|
32
52
|
import { deploymentConfigHash } from "./config-hash.js";
|
|
33
53
|
import { toIssues } from "./config-issues.js";
|
|
34
54
|
import { configFormSchema, describeConfigUiProblems } from "./config-json-schema.js";
|
|
35
55
|
import { EffectiveConfigs } from "./effective-config.js";
|
|
56
|
+
import { GrantEpoch, grantEpochReader, grantEpochReadTimeoutMs } from "./grant-epoch.js";
|
|
36
57
|
import { HookRegistry } from "./hooks.js";
|
|
37
58
|
import { ExtensionInstalls } from "./installs.js";
|
|
38
59
|
import { ImportTracker, importExtensionModule, ManifestMismatchError, matchesSection, setupInstance, warnUpgrades, } from "./instance.js";
|
|
60
|
+
import { assertIsolatedSection, isolatedDeploymentSchema, } from "./isolated/admission.js";
|
|
61
|
+
import { IsolatedInvocationGrants, readIsolatedGrant, } from "./isolated/authorization.js";
|
|
62
|
+
import { readConfiguredExtensionPackage, stageConfiguredExtensionPackage, } from "./isolated/configured-package.js";
|
|
63
|
+
import { IsolatedExtensionQuota } from "./isolated/lanes.js";
|
|
64
|
+
import { IsolationObserver, OrgLabels, observeGrantEpochLag } from "./isolated/metrics.js";
|
|
65
|
+
import { isolatedRevision } from "./isolated/revision.js";
|
|
66
|
+
import { probeExtensionSandboxChecks, sweepExtensionSandboxOrphans, } from "./isolated/sandbox.js";
|
|
67
|
+
import { GrantReadError, isolatedSectionGrant, keepsServingAdmission, publisherProofMissing, publisherProofRefusal, shadowExecutionOf, } from "./isolated/tier.js";
|
|
68
|
+
import { ExtensionUsageCounters, ExtensionUsageFlusher } from "./isolated/usage.js";
|
|
39
69
|
import { parseLoadGate } from "./org-levels.js";
|
|
40
70
|
import { declaredDisplayName, permissionSetOfSection, readMigrationSql } from "./package.js";
|
|
41
71
|
import { blockingKeys, computePermissionSet, SETUP_CHECK_KEY_PREFIX, UI_VIEW_KEY_PREFIX, } from "./permission-set.js";
|
|
42
72
|
import { ExtensionRegistry } from "./registry.js";
|
|
43
73
|
import { ExtensionResolveError, electSingleProviders, PROVIDER_CONFLICT, providerConflictMessage, resolveExtensions, } from "./resolve.js";
|
|
74
|
+
import { ExtensionRevisionApprovals } from "./revision-approvals.js";
|
|
75
|
+
import { leaseStateOf, REVOCATION_ENFORCEMENT, RevisionLeases, RevocationPendingError, readGrantSurfaceBySha256, readGrantSurfacesBySha256, realmAfterRevocation, } from "./revocation-leases.js";
|
|
44
76
|
import { ReplicaStatusStore, } from "./sources.js";
|
|
45
77
|
import { PackageShaMismatchError, packageRootOf } from "./sync.js";
|
|
46
78
|
export { deploymentConfigHash };
|
|
@@ -89,15 +121,37 @@ function toFileUrl(spec, resolveFrom) {
|
|
|
89
121
|
});
|
|
90
122
|
}
|
|
91
123
|
}
|
|
92
|
-
/**
|
|
93
|
-
async function importEntries(specifiers, resolveFrom) {
|
|
124
|
+
/** Read reviewed static packages. Only the test harness supplies executable fixtures directly. */
|
|
125
|
+
async function importEntries(specifiers, resolveFrom, fixtureTrust, maxBytes, cacheDir) {
|
|
94
126
|
const entries = [];
|
|
95
127
|
for (const spec of specifiers) {
|
|
96
|
-
|
|
128
|
+
if (fixtureTrust) {
|
|
129
|
+
const url = toFileUrl(spec, resolveFrom);
|
|
130
|
+
entries.push({
|
|
131
|
+
manifest: await importExtensionModule(url, spec, resolveFrom),
|
|
132
|
+
dir: dirname(fileURLToPath(url)),
|
|
133
|
+
url,
|
|
134
|
+
});
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const snapshot = await readConfiguredExtensionPackage(spec, resolveFrom, maxBytes);
|
|
138
|
+
const { section, sha256, migrationSql, displayName, packageJson } = snapshot.review;
|
|
139
|
+
const staged = cacheDir === undefined
|
|
140
|
+
? undefined
|
|
141
|
+
: await stageConfiguredExtensionPackage(snapshot, cacheDir);
|
|
142
|
+
const root = staged?.root ?? dirname(fileURLToPath(snapshot.archiveUrl));
|
|
97
143
|
entries.push({
|
|
98
|
-
manifest:
|
|
99
|
-
dir:
|
|
100
|
-
url,
|
|
144
|
+
manifest: manifestOfSection(section.manifest),
|
|
145
|
+
dir: root,
|
|
146
|
+
url: staged?.entryUrl ?? snapshot.archiveUrl,
|
|
147
|
+
isolated: {
|
|
148
|
+
section,
|
|
149
|
+
root,
|
|
150
|
+
digest: sha256,
|
|
151
|
+
migrationSql,
|
|
152
|
+
...(displayName && { displayName }),
|
|
153
|
+
...(typeof packageJson.name === "string" && { npmName: packageJson.name }),
|
|
154
|
+
},
|
|
101
155
|
});
|
|
102
156
|
}
|
|
103
157
|
return entries;
|
|
@@ -124,10 +178,13 @@ async function packageNameOf(dir) {
|
|
|
124
178
|
}
|
|
125
179
|
}
|
|
126
180
|
/** 计算各插件的权限集合(按插件名索引)。 */
|
|
127
|
-
async function permissionSets(ordered, dirs) {
|
|
181
|
+
async function permissionSets(ordered, dirs, isolated = new Map()) {
|
|
128
182
|
const sets = new Map();
|
|
129
183
|
for (const m of ordered) {
|
|
130
|
-
|
|
184
|
+
const source = isolated.get(m.name);
|
|
185
|
+
sets.set(m.name, source
|
|
186
|
+
? permissionSetOfSection(source.section, source.migrationSql ?? (await readMigrationSql(source.root, source.section)))
|
|
187
|
+
: await computePermissionSet(m, dirs.get(m.name)));
|
|
131
188
|
}
|
|
132
189
|
return sets;
|
|
133
190
|
}
|
|
@@ -170,12 +227,17 @@ function warnPending(log, p) {
|
|
|
170
227
|
* 无迁移时返回 undefined。迁移器在会话上持有按 schema 的咨询锁:多副本同时启动时只有一个在执行,其余等它结束后
|
|
171
228
|
* 发现都已应用。
|
|
172
229
|
*/
|
|
173
|
-
async function migratePlugin(
|
|
230
|
+
async function migratePlugin(connection, manifest, migrationsDir, connectTimeoutMs, signal) {
|
|
174
231
|
if (!migrationsDir)
|
|
175
232
|
return undefined;
|
|
176
233
|
const schema = pluginSchemaName(manifest.name);
|
|
177
234
|
try {
|
|
178
|
-
const { applied } = await migrate(
|
|
235
|
+
const { applied } = await migrate(connection.url, { schema, dir: migrationsDir }, {
|
|
236
|
+
connectTimeoutMs,
|
|
237
|
+
signal,
|
|
238
|
+
extensionLogin: connection.separate ? connection.login : undefined,
|
|
239
|
+
extensionDedicated: connection.dedicated,
|
|
240
|
+
});
|
|
179
241
|
return { schema, applied };
|
|
180
242
|
}
|
|
181
243
|
catch (e) {
|
|
@@ -183,42 +245,58 @@ async function migratePlugin(dbUrl, manifest, migrationsDir, connectTimeoutMs, s
|
|
|
183
245
|
}
|
|
184
246
|
}
|
|
185
247
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
248
|
+
* Every `secret()` in an extension's deployment schema must sit on an object field path (see
|
|
249
|
+
* `unreachableSecrets`); otherwise the kernel cannot store and mask it on its own and would keep
|
|
250
|
+
* and echo it in clear, so the load is refused, naming the extension and the path.
|
|
188
251
|
*/
|
|
189
252
|
export function assertSecretsReachable(manifest) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
throw new Error(`plugin ${manifest.name}: config.${level}: ${bad.map((p) => `secret() at "${p}"`).join(", ")} is not on an object field path; secret() inside union / intersection / transform / pipe / lazy / array / record / tuple is not supported — mark the whole enclosing object field secret instead`);
|
|
197
|
-
}
|
|
253
|
+
const schema = manifest.config?.deployment;
|
|
254
|
+
if (!schema)
|
|
255
|
+
return;
|
|
256
|
+
const bad = unreachableSecrets(schema);
|
|
257
|
+
if (bad.length > 0) {
|
|
258
|
+
throw new Error(`plugin ${manifest.name}: config.deployment: ${bad.map((p) => `secret() at "${p}"`).join(", ")} is not on an object field path; secret() inside union / intersection / transform / pipe / lazy / array / record / tuple is not supported — mark the whole enclosing object field secret instead`);
|
|
198
259
|
}
|
|
199
260
|
}
|
|
200
261
|
/** 按模块解析的插件(配置声明)的迁移目录:清单 `migrations` 相对模块所在目录。 */
|
|
201
262
|
const migrationsDirOf = (m, dir) => m.migrations ? resolvePath(dir, m.migrations) : undefined;
|
|
263
|
+
/**
|
|
264
|
+
* A pending status reason: the revision's grant could not be read (plan task 1.3b). It is retried
|
|
265
|
+
* at the next convergence; a serving revision keeps its tier instead.
|
|
266
|
+
*/
|
|
267
|
+
export const GRANT_UNAVAILABLE = "grant_unavailable";
|
|
202
268
|
/**
|
|
203
269
|
* 由审阅过的静态清单拼出解析依赖、判定权限闸门用的清单(没有 setup 与配置 schema,不能用来加载)。
|
|
204
270
|
* 闸门放行后导入的真实模块必须与静态清单一致({@link matchesSection}),两者在依赖解析上等价。
|
|
205
271
|
*/
|
|
206
272
|
function manifestOfSection(m) {
|
|
273
|
+
const declaration = staticPermissionDeclarations(m);
|
|
207
274
|
return {
|
|
208
275
|
name: m.name,
|
|
209
276
|
version: m.version,
|
|
210
277
|
sdk: m.sdk,
|
|
211
|
-
provides:
|
|
212
|
-
requires:
|
|
213
|
-
optional:
|
|
214
|
-
permissions:
|
|
278
|
+
provides: declaration.provides,
|
|
279
|
+
requires: declaration.requires,
|
|
280
|
+
optional: declaration.optional,
|
|
281
|
+
permissions: declaration.permissions,
|
|
215
282
|
...(m.ui !== undefined && { ui: m.ui }),
|
|
216
283
|
setup() {
|
|
217
284
|
throw new Error(`plugin ${m.name}: static manifest cannot be set up`);
|
|
218
285
|
},
|
|
219
286
|
};
|
|
220
287
|
}
|
|
221
|
-
|
|
288
|
+
function isolatedManifestOf(section) {
|
|
289
|
+
const manifest = manifestOfSection(section.manifest);
|
|
290
|
+
const schema = section.configSchemas?.deployment;
|
|
291
|
+
const checked = {
|
|
292
|
+
...manifest,
|
|
293
|
+
...(schema && { config: { deployment: isolatedDeploymentSchema(schema) } }),
|
|
294
|
+
...(section.migrations && { migrations: packagePath(section.migrations) }),
|
|
295
|
+
};
|
|
296
|
+
assertSecretsReachable(checked);
|
|
297
|
+
return checked;
|
|
298
|
+
}
|
|
299
|
+
/** Resolves extensions and their configuration, runs migrations and registers capabilities. */
|
|
222
300
|
let ExtensionHost = class ExtensionHost {
|
|
223
301
|
registry;
|
|
224
302
|
installs;
|
|
@@ -226,7 +304,12 @@ let ExtensionHost = class ExtensionHost {
|
|
|
226
304
|
status;
|
|
227
305
|
config;
|
|
228
306
|
log;
|
|
307
|
+
options;
|
|
229
308
|
effective;
|
|
309
|
+
allowances;
|
|
310
|
+
modules;
|
|
311
|
+
dbIdentity;
|
|
312
|
+
revisionApprovals;
|
|
230
313
|
/**
|
|
231
314
|
* Only resolves extensions and runs migrations in dependency order: no deployment config check, no
|
|
232
315
|
* setup, no Redis (for `capybara migrate`). Like `load()` it checks secret markers first
|
|
@@ -239,14 +322,19 @@ let ExtensionHost = class ExtensionHost {
|
|
|
239
322
|
*/
|
|
240
323
|
static async migrateOnly(specifiers, opts) {
|
|
241
324
|
const from = resolvePath(opts.resolveFrom ?? process.cwd());
|
|
242
|
-
const entries = await importEntries(specifiers, from);
|
|
325
|
+
const entries = await importEntries(specifiers, from, opts[KERNEL_FIXTURE_TRUST] !== undefined, opts.maxPackageBytes, opts.packageCacheDir ?? join(from, ".capybara", "plugins"));
|
|
243
326
|
const dirs = new Map(entries.map((e) => [e.manifest.name, e.dir]));
|
|
327
|
+
const isolation = new Map(entries.flatMap((e) => (e.isolated ? [[e.manifest.name, e.isolated]] : [])));
|
|
244
328
|
const ordered = resolveExtensions(entries.map((e) => e.manifest), SDK_VERSION);
|
|
245
329
|
for (const manifest of ordered)
|
|
246
330
|
assertSecretsReachable(manifest);
|
|
331
|
+
const identity = opts.extensionIdentity ?? extensionDbIdentity({ url: opts.dbUrl });
|
|
332
|
+
if (opts.extensionProvisioning?.extensionProvisioningUrl) {
|
|
333
|
+
await transferKnownExtensionSchemas(opts.extensionProvisioning.extensionProvisioningUrl, identity, dirs.keys(), opts.connectTimeoutMs, opts.extensionProvisioning);
|
|
334
|
+
}
|
|
247
335
|
let toMigrate = ordered;
|
|
248
336
|
if (!opts.autoApprove && ordered.length > 0) {
|
|
249
|
-
const sets = await permissionSets(ordered, dirs);
|
|
337
|
+
const sets = await permissionSets(ordered, dirs, isolation);
|
|
250
338
|
const raw = createDb(opts.dbUrl, 1, () => { }, { connectTimeoutMs: opts.connectTimeoutMs });
|
|
251
339
|
let decisions;
|
|
252
340
|
try {
|
|
@@ -263,20 +351,26 @@ let ExtensionHost = class ExtensionHost {
|
|
|
263
351
|
}
|
|
264
352
|
const out = [];
|
|
265
353
|
for (const manifest of toMigrate) {
|
|
266
|
-
const
|
|
354
|
+
const name = manifest.name;
|
|
355
|
+
const target = identity.resolve(name);
|
|
356
|
+
const source = isolation.get(name);
|
|
357
|
+
if (source) {
|
|
358
|
+
assertIsolatedSection(source.section);
|
|
359
|
+
if (!target.dedicated) {
|
|
360
|
+
throw new Error("Isolated extension migrations require the dedicated login");
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const r = await migratePlugin(target, source ? isolatedManifestOf(source.section) : manifest, source?.section.migrations
|
|
364
|
+
? join(source.root, packagePath(source.section.migrations))
|
|
365
|
+
: migrationsDirOf(manifest, dirs.get(name)), opts.connectTimeoutMs, source ? AbortSignal.timeout(opts.migrationTimeoutMs ?? 300_000) : undefined);
|
|
267
366
|
if (r)
|
|
268
367
|
out.push({ plugin: manifest.name, ...r });
|
|
269
368
|
}
|
|
270
369
|
return out;
|
|
271
370
|
}
|
|
272
|
-
/**
|
|
273
|
-
* The names of the config-declared extensions (`specifiers`, the startup config `extensions`
|
|
274
|
-
* list): imports their modules only (the same modules `load()` imports next, from Node's module
|
|
275
|
-
* cache). The kernel passes them to the bootstrap step before loading, so a bootstrap entry of
|
|
276
|
-
* the same name is kept and gets no install record (config wins, C15).
|
|
277
|
-
*/
|
|
371
|
+
/** Reads configured package identities for bootstrap without starting extension code. */
|
|
278
372
|
static async declaredNames(specifiers, opts = {}) {
|
|
279
|
-
const entries = await importEntries(specifiers, resolvePath(opts.resolveFrom ?? process.cwd()));
|
|
373
|
+
const entries = await importEntries(specifiers, resolvePath(opts.resolveFrom ?? process.cwd()), opts[KERNEL_FIXTURE_TRUST] !== undefined, opts.maxPackageBytes);
|
|
280
374
|
return new Set(entries.map((e) => e.manifest.name));
|
|
281
375
|
}
|
|
282
376
|
/**
|
|
@@ -285,21 +379,35 @@ let ExtensionHost = class ExtensionHost {
|
|
|
285
379
|
*/
|
|
286
380
|
static async inspect(specifiers, opts = {}) {
|
|
287
381
|
const from = resolvePath(opts.resolveFrom ?? process.cwd());
|
|
288
|
-
const entries = await importEntries(specifiers, from);
|
|
382
|
+
const entries = await importEntries(specifiers, from, opts[KERNEL_FIXTURE_TRUST] !== undefined, opts.maxPackageBytes);
|
|
289
383
|
const dirs = new Map(entries.map((e) => [e.manifest.name, e.dir]));
|
|
384
|
+
const isolation = new Map(entries.flatMap((e) => (e.isolated ? [[e.manifest.name, e.isolated]] : [])));
|
|
290
385
|
const ordered = resolveExtensions(entries.map((e) => e.manifest), SDK_VERSION);
|
|
291
386
|
for (const manifest of ordered)
|
|
292
387
|
assertSecretsReachable(manifest);
|
|
293
|
-
const sets = await permissionSets(ordered, dirs);
|
|
388
|
+
const sets = await permissionSets(ordered, dirs, isolation);
|
|
294
389
|
const out = [];
|
|
295
390
|
for (const manifest of ordered) {
|
|
296
391
|
const dir = dirs.get(manifest.name);
|
|
392
|
+
const source = isolation.get(manifest.name);
|
|
393
|
+
let inspected = manifest;
|
|
394
|
+
if (source) {
|
|
395
|
+
try {
|
|
396
|
+
inspected = isolatedManifestOf(source.section);
|
|
397
|
+
}
|
|
398
|
+
catch {
|
|
399
|
+
// The static permission review remains available for an inadmissible config schema.
|
|
400
|
+
}
|
|
401
|
+
}
|
|
297
402
|
out.push({
|
|
298
403
|
source: "config",
|
|
299
|
-
|
|
404
|
+
...(source && { isolated: true }),
|
|
405
|
+
manifest: inspected,
|
|
300
406
|
dir,
|
|
301
407
|
permissions: sets.get(manifest.name),
|
|
302
|
-
displayName:
|
|
408
|
+
displayName: source
|
|
409
|
+
? (source.displayName ?? null)
|
|
410
|
+
: ((await declaredDisplayName(dir, manifest.name)).displayName ?? null),
|
|
303
411
|
});
|
|
304
412
|
}
|
|
305
413
|
return out;
|
|
@@ -308,6 +416,27 @@ let ExtensionHost = class ExtensionHost {
|
|
|
308
416
|
* M-1: plugin → mount points where deployment state expects `policy` hooks. A per-replica copy of PG
|
|
309
417
|
* deployment state (like the registry), rebuilt on every load / converge, never written elsewhere.
|
|
310
418
|
*/
|
|
419
|
+
declaredIsolation = new Map();
|
|
420
|
+
quota = new Map();
|
|
421
|
+
isolatedAuthority = new WeakMap();
|
|
422
|
+
isolatedLanes = new WeakMap();
|
|
423
|
+
isolatedGrants;
|
|
424
|
+
/** The permission leases of this replica's instances (revocation, plan task 1.3e). */
|
|
425
|
+
revisionLeases;
|
|
426
|
+
/**
|
|
427
|
+
* This replica's view of the deployment grant epoch; polls once an isolated grant was issued or
|
|
428
|
+
* an instance with a package opened its permission lease.
|
|
429
|
+
*/
|
|
430
|
+
grantEpoch;
|
|
431
|
+
epochReader;
|
|
432
|
+
/** Which orgs get their own label on the isolation metrics (the largest few). */
|
|
433
|
+
orgLabels;
|
|
434
|
+
/** This replica's isolated usage increments, flushed every 10 s once isolated work started. */
|
|
435
|
+
usageCounters = new ExtensionUsageCounters();
|
|
436
|
+
usageFlusher;
|
|
437
|
+
unobserveEpochLag;
|
|
438
|
+
capacityCache;
|
|
439
|
+
executionTier = new Map();
|
|
311
440
|
policyExpected = new Map();
|
|
312
441
|
/**
|
|
313
442
|
* Runs the hooks of this process's active plugin instances (resolved from the registry on every
|
|
@@ -377,8 +506,8 @@ let ExtensionHost = class ExtensionHost {
|
|
|
377
506
|
deps;
|
|
378
507
|
/** 配置声明插件的部署配置最近一次判定是否合法(后台列表用;没判定过时按启动配置校验)。 */
|
|
379
508
|
configValidity = new Map();
|
|
380
|
-
/**
|
|
381
|
-
|
|
509
|
+
/** The last config diagnostic by plugin, including its level, to deduplicate reconcile logs. */
|
|
510
|
+
configReported = new Map();
|
|
382
511
|
/** `<name>@<version>` whose invalid config UI hints were warned about (a log dedupe only). */
|
|
383
512
|
configUiWarned = new Set();
|
|
384
513
|
/**
|
|
@@ -404,21 +533,58 @@ let ExtensionHost = class ExtensionHost {
|
|
|
404
533
|
*/
|
|
405
534
|
installs, approvals,
|
|
406
535
|
/** This replica's load status table (`extension_replica_status`): every load result writes a row. */
|
|
407
|
-
status, config, kdb, redis, busSubscriber, keyring, embedTokens,
|
|
536
|
+
status, config, kdb, redis, busSubscriber, keyring, embedTokens,
|
|
537
|
+
/** `ctx.ui.verifyEmbedToken`: the live check of a share-scoped token (file sharing spec §7). */
|
|
538
|
+
shares, locks, log, options,
|
|
408
539
|
/**
|
|
409
540
|
* Each hook call's effective config for its organization, and the providers excluded from an
|
|
410
541
|
* org's point resolution (layering spec A §6).
|
|
411
542
|
*/
|
|
412
543
|
effective,
|
|
413
544
|
/** `ctx.models`: the embeddings broker (spec B §5.4). */
|
|
414
|
-
|
|
545
|
+
embeddings,
|
|
546
|
+
/** `ctx.models.generateImage`: the image generation calls (image generation spec §5.5). */
|
|
547
|
+
images,
|
|
548
|
+
/** `ctx.net`: the internal endpoints each org's extension requests may reach (read per call). */
|
|
549
|
+
allowances,
|
|
550
|
+
/** `ctx.dialIn`: the dial-in relay and the check that a device is the extension's own. */
|
|
551
|
+
dialIn,
|
|
552
|
+
/** `ctx.devices`: the stored device reports, read again when a provider says they changed. */
|
|
553
|
+
devices,
|
|
554
|
+
/**
|
|
555
|
+
* Finds `DeviceAccessService` (`ctx.deviceAccess`, {@link DEVICE_ACCESS_BACKEND}) at the time
|
|
556
|
+
* of use: its module imports the sandbox, devices and tools modules, which import this one (a
|
|
557
|
+
* module cycle otherwise).
|
|
558
|
+
* Absent (a hand-built host) or not found (the CLI): `ctx.deviceAccess` calls are refused.
|
|
559
|
+
* `TriggerEventsService` (`ctx.triggers`, {@link TRIGGER_EVENTS_BACKEND}) and
|
|
560
|
+
* `InboxItemsService` (`ctx.inbox`, {@link INBOX_ITEMS_BACKEND}) and `PluginReadsService`
|
|
561
|
+
* (`ctx.agents`, `ctx.conversations`, `ctx.people`, {@link PLUGIN_READS_BACKEND}) and
|
|
562
|
+
* `ExternalConversationsService` (`ctx.conversations`' external methods,
|
|
563
|
+
* {@link EXTERNAL_CONVERSATIONS_BACKEND}) and
|
|
564
|
+
* `ServiceEvents` (`ctx.devices.serviceEvent`, {@link SERVICE_EVENTS_BACKEND}) likewise.
|
|
565
|
+
*/
|
|
566
|
+
modules,
|
|
567
|
+
/** Tests only: `ctx.net`'s DNS and dispatcher seams (`EXTENSION_NET_SEAMS`). */
|
|
568
|
+
netSeams, dbIdentity = extensionDbIdentity(config.get().db),
|
|
569
|
+
/**
|
|
570
|
+
* Shadow revision approvals (plan task 1.2b): reported at start, never refusing. Absent in a
|
|
571
|
+
* hand-built host, which then reports nothing.
|
|
572
|
+
*/
|
|
573
|
+
revisionApprovals,
|
|
574
|
+
/** Kernel tests only: enforce revocation before plan task 1.5a (`REVOCATION_ENFORCEMENT`). */
|
|
575
|
+
revocationEnforcement) {
|
|
415
576
|
this.registry = registry;
|
|
416
577
|
this.installs = installs;
|
|
417
578
|
this.approvals = approvals;
|
|
418
579
|
this.status = status;
|
|
419
580
|
this.config = config;
|
|
420
581
|
this.log = log;
|
|
582
|
+
this.options = options;
|
|
421
583
|
this.effective = effective;
|
|
584
|
+
this.allowances = allowances;
|
|
585
|
+
this.modules = modules;
|
|
586
|
+
this.dbIdentity = dbIdentity;
|
|
587
|
+
this.revisionApprovals = revisionApprovals;
|
|
422
588
|
const c = config.get();
|
|
423
589
|
this.hooks = new HookRegistry({
|
|
424
590
|
instances: () => this.registry.all(),
|
|
@@ -430,6 +596,98 @@ let ExtensionHost = class ExtensionHost {
|
|
|
430
596
|
config: () => ({ hooks: { timeoutMs: this.config.get().hooks.timeoutMs } }),
|
|
431
597
|
log,
|
|
432
598
|
});
|
|
599
|
+
const capacity = this.capacity();
|
|
600
|
+
this.epochReader = grantEpochReader({
|
|
601
|
+
url: c.db.url,
|
|
602
|
+
readTimeoutMs: grantEpochReadTimeoutMs(capacity.grantEpochMaxAgeMs),
|
|
603
|
+
connectTimeoutMs: c.db.connectTimeoutMs,
|
|
604
|
+
onError: (err) => this.log.warn("grant epoch connection error", { err }),
|
|
605
|
+
});
|
|
606
|
+
this.grantEpoch = new GrantEpoch({
|
|
607
|
+
read: this.epochReader.read,
|
|
608
|
+
maxAgeMs: capacity.grantEpochMaxAgeMs,
|
|
609
|
+
onChange: () => {
|
|
610
|
+
void this.isolatedGrants
|
|
611
|
+
.epochChanged()
|
|
612
|
+
.catch((err) => this.log.warn("isolated extension grant revalidation failed", { err }));
|
|
613
|
+
void this.revisionLeases
|
|
614
|
+
.epochChanged()
|
|
615
|
+
.catch((err) => this.log.warn("extension permission lease revalidation failed", { err }));
|
|
616
|
+
},
|
|
617
|
+
onSettleDeadline: () => {
|
|
618
|
+
this.isolatedGrants.fenceStale();
|
|
619
|
+
this.revisionLeases.fenceStale();
|
|
620
|
+
},
|
|
621
|
+
onExpired: () => {
|
|
622
|
+
this.log.warn("isolated extension grants fenced: the grant epoch could not be read");
|
|
623
|
+
this.isolatedGrants.fenceAll();
|
|
624
|
+
this.revisionLeases.fenceAll();
|
|
625
|
+
},
|
|
626
|
+
onFault: (err) => this.log.warn("reading the extension grant epoch failed", { err }),
|
|
627
|
+
});
|
|
628
|
+
this.isolatedGrants = new IsolatedInvocationGrants(this.grantEpoch, capacity.grantCacheEntries, () => performance.now(), capacity.grantFullRevalidationMs);
|
|
629
|
+
const grantReads = kernelDb(kdb.pool);
|
|
630
|
+
this.revisionLeases = new RevisionLeases({
|
|
631
|
+
epochs: this.grantEpoch,
|
|
632
|
+
// one query for every lease of a fence or epoch change
|
|
633
|
+
read: async (sha256s) => {
|
|
634
|
+
const grants = await readGrantSurfacesBySha256(grantReads, sha256s);
|
|
635
|
+
return new Map(sha256s.map((sha256) => [sha256, leaseStateOf(grants.get(sha256))]));
|
|
636
|
+
},
|
|
637
|
+
...(revocationEnforcement === true && { enforce: true }),
|
|
638
|
+
onUnload: (plugin) => {
|
|
639
|
+
this.log.warn("extension grant revoked: unloading its generation", { plugin });
|
|
640
|
+
void this.converge().catch((err) => this.log.error("converging after a grant revocation failed", { plugin, err }));
|
|
641
|
+
},
|
|
642
|
+
onRestored: (plugin) => {
|
|
643
|
+
// withdrawn registrations come back only with a new setup
|
|
644
|
+
this.log.info("extension grant restored withdrawn keys: reloading it", { plugin });
|
|
645
|
+
void this.reload(plugin).catch((err) => this.log.error("reloading after a restored grant failed", { plugin, err }));
|
|
646
|
+
},
|
|
647
|
+
onFault: (plugin, err) => this.log.warn("reading an extension's revision grant failed", { plugin, err }),
|
|
648
|
+
// shadow mode until plan task 1.5a: what enforcement would do, logged and never enforced
|
|
649
|
+
onShadow: (plugin, decision) => this.log.warn("extension revocation computed (shadow mode, not enforced)", {
|
|
650
|
+
plugin,
|
|
651
|
+
...("refusedCall" in decision
|
|
652
|
+
? { wouldRefuseCall: decision.refusedCall }
|
|
653
|
+
: {
|
|
654
|
+
wouldWithdrawOrRefuse: decision.refused,
|
|
655
|
+
wouldUnloadInProcess: decision.lostServerFullAccess,
|
|
656
|
+
wouldUnload: decision.revoked,
|
|
657
|
+
status: decision.state.status,
|
|
658
|
+
}),
|
|
659
|
+
}),
|
|
660
|
+
});
|
|
661
|
+
this.unobserveEpochLag = observeGrantEpochLag(() => this.grantEpoch.lagSeconds());
|
|
662
|
+
this.orgLabels = new OrgLabels({
|
|
663
|
+
limits: () => ({
|
|
664
|
+
minMembers: this.config.get().metrics?.orgLabelMinMembers ?? 1_000,
|
|
665
|
+
maxOrgs: this.config.get().metrics?.orgLabelMaxOrgs ?? 20,
|
|
666
|
+
}),
|
|
667
|
+
read: (minMembers, maxOrgs) => asPlatform("pick the org labels of the isolation metrics", async () => {
|
|
668
|
+
const rows = await kernelDb(this.deps.db)
|
|
669
|
+
.selectFrom("memberships")
|
|
670
|
+
.innerJoin("orgs", "orgs.id", "memberships.org_id")
|
|
671
|
+
.where("orgs.deleted_at", "is", null)
|
|
672
|
+
// Guests are not members for sizing: they do not make an org large.
|
|
673
|
+
.where("memberships.role", "!=", "guest")
|
|
674
|
+
.select(["memberships.org_id as orgId", (eb) => eb.fn.countAll().as("members")])
|
|
675
|
+
.groupBy("memberships.org_id")
|
|
676
|
+
.having((eb) => eb.fn.countAll(), ">=", minMembers)
|
|
677
|
+
.orderBy("members", "desc")
|
|
678
|
+
.orderBy("memberships.org_id")
|
|
679
|
+
.limit(maxOrgs)
|
|
680
|
+
.execute();
|
|
681
|
+
return rows.map((row) => ({ orgId: row.orgId, members: Number(row.members) }));
|
|
682
|
+
}),
|
|
683
|
+
onError: (err) => this.log.warn("reading the isolation metrics org labels failed", { err }),
|
|
684
|
+
});
|
|
685
|
+
this.usageFlusher = new ExtensionUsageFlusher({
|
|
686
|
+
db: kdb.pool,
|
|
687
|
+
counters: this.usageCounters,
|
|
688
|
+
onError: (err) => this.log.warn("flushing isolated extension usage failed", { err }),
|
|
689
|
+
onDropped: (detail) => this.log.warn("isolated extension usage increments were dropped", detail),
|
|
690
|
+
});
|
|
433
691
|
this.deps = {
|
|
434
692
|
db: kdb.pool,
|
|
435
693
|
dbUrl: c.db.url,
|
|
@@ -439,10 +697,72 @@ let ExtensionHost = class ExtensionHost {
|
|
|
439
697
|
redisUrl: c.redis.url,
|
|
440
698
|
keyring,
|
|
441
699
|
embedTokens,
|
|
442
|
-
models,
|
|
443
|
-
// ctx.models.embed
|
|
700
|
+
models: { embeddings, images },
|
|
701
|
+
// ctx.models.embed and generateImage fire model.request through the same registry
|
|
444
702
|
hooks: this.hooks,
|
|
703
|
+
shares,
|
|
704
|
+
net: { config, allowances, ...(netSeams !== undefined && { seams: netSeams }) },
|
|
705
|
+
dialIn,
|
|
706
|
+
devices,
|
|
707
|
+
deviceAccess: () => {
|
|
708
|
+
try {
|
|
709
|
+
return modules?.get(DEVICE_ACCESS_BACKEND, { strict: false });
|
|
710
|
+
}
|
|
711
|
+
catch {
|
|
712
|
+
return undefined;
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
serviceEvents: () => {
|
|
716
|
+
try {
|
|
717
|
+
return modules?.get(SERVICE_EVENTS_BACKEND, { strict: false });
|
|
718
|
+
}
|
|
719
|
+
catch {
|
|
720
|
+
return undefined;
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
durableEffects: () => {
|
|
724
|
+
try {
|
|
725
|
+
return modules?.get(ExtensionEffects, { strict: false });
|
|
726
|
+
}
|
|
727
|
+
catch {
|
|
728
|
+
return undefined;
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
triggers: () => {
|
|
732
|
+
try {
|
|
733
|
+
return modules?.get(TRIGGER_EVENTS_BACKEND, { strict: false });
|
|
734
|
+
}
|
|
735
|
+
catch {
|
|
736
|
+
return undefined;
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
inbox: () => {
|
|
740
|
+
try {
|
|
741
|
+
return modules?.get(INBOX_ITEMS_BACKEND, { strict: false });
|
|
742
|
+
}
|
|
743
|
+
catch {
|
|
744
|
+
return undefined;
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
pluginReads: () => {
|
|
748
|
+
try {
|
|
749
|
+
return modules?.get(PLUGIN_READS_BACKEND, { strict: false });
|
|
750
|
+
}
|
|
751
|
+
catch {
|
|
752
|
+
return undefined;
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
externalConversations: () => {
|
|
756
|
+
try {
|
|
757
|
+
return modules?.get(EXTERNAL_CONVERSATIONS_BACKEND, { strict: false });
|
|
758
|
+
}
|
|
759
|
+
catch {
|
|
760
|
+
return undefined;
|
|
761
|
+
}
|
|
762
|
+
},
|
|
445
763
|
locks,
|
|
764
|
+
leases: this.revisionLeases,
|
|
765
|
+
registrationsChanged: (plugin) => this.registry.registrationsChanged(plugin),
|
|
446
766
|
runWorkers: c.roles.includes("worker"),
|
|
447
767
|
log,
|
|
448
768
|
};
|
|
@@ -539,7 +859,29 @@ let ExtensionHost = class ExtensionHost {
|
|
|
539
859
|
this.didLoad = true;
|
|
540
860
|
const p = Array.isArray(plan) ? { config: plan } : plan;
|
|
541
861
|
this.installLoader = p.installs;
|
|
542
|
-
const
|
|
862
|
+
const isolation = this.config.get().extensionHost.isolation;
|
|
863
|
+
if (isolation) {
|
|
864
|
+
await sweepExtensionSandboxOrphans(isolation.engineUrl).catch(() => {
|
|
865
|
+
this.log.error("Could not sweep exited isolated extension sandboxes");
|
|
866
|
+
});
|
|
867
|
+
// off the startup path: the probe can take up to the Engine deadline
|
|
868
|
+
void this.probeIsolation();
|
|
869
|
+
}
|
|
870
|
+
const entries = await importEntries(p.config ?? [], this.resolveFrom, this.options[KERNEL_FIXTURE_TRUST] !== undefined, this.config.get().packages.maxBytes, this.config.get().extensionHost.dir);
|
|
871
|
+
for (const { manifest, isolated } of entries) {
|
|
872
|
+
if (!isolated)
|
|
873
|
+
continue;
|
|
874
|
+
try {
|
|
875
|
+
assertIsolatedSection(isolated.section);
|
|
876
|
+
}
|
|
877
|
+
catch (cause) {
|
|
878
|
+
await this.reportAdmissionRefusal(manifest.name, isolated.digest, errMsg(cause), "Install a revision that declares supported isolated capabilities and configuration.");
|
|
879
|
+
throw new Error(`Configured extension ${manifest.name} was refused: ${errMsg(cause)}`, {
|
|
880
|
+
cause,
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
this.declaredIsolation.set(manifest.name, isolated);
|
|
884
|
+
}
|
|
543
885
|
await this.claimNames(entries);
|
|
544
886
|
await this.noteDisplayNames(entries);
|
|
545
887
|
const dirs = new Map(entries.map((e) => [e.manifest.name, e.dir]));
|
|
@@ -550,11 +892,11 @@ let ExtensionHost = class ExtensionHost {
|
|
|
550
892
|
: { ready: entries.map((e) => e.manifest), deferred: [] };
|
|
551
893
|
const ordered = resolveExtensions(ready, SDK_VERSION);
|
|
552
894
|
for (const e of entries)
|
|
553
|
-
this.sources.set(e.manifest.name, { source: "config", sha256: null });
|
|
895
|
+
this.sources.set(e.manifest.name, { source: "config", sha256: e.isolated?.digest ?? null });
|
|
554
896
|
this.registry.declare(entries.map((e) => e.manifest.name));
|
|
555
897
|
for (const e of entries)
|
|
556
898
|
assertSecretsReachable(e.manifest);
|
|
557
|
-
const sets = await permissionSets(ordered, dirs);
|
|
899
|
+
const sets = await permissionSets(ordered, dirs, this.declaredIsolation);
|
|
558
900
|
this.noteDeclared(ordered, sets);
|
|
559
901
|
const approvals = this.approvals;
|
|
560
902
|
if (this.autoApprove) {
|
|
@@ -568,9 +910,10 @@ let ExtensionHost = class ExtensionHost {
|
|
|
568
910
|
await this.activate(approvals, {
|
|
569
911
|
manifest,
|
|
570
912
|
source: this.sourceOf(manifest.name),
|
|
571
|
-
|
|
913
|
+
isolated: this.declaredIsolation.get(manifest.name),
|
|
914
|
+
sha256: this.declaredIsolation.get(manifest.name)?.digest ?? null,
|
|
572
915
|
entryUrl: urls.get(manifest.name),
|
|
573
|
-
migrationsDir:
|
|
916
|
+
migrationsDir: this.declaredMigrationDirectory(manifest, dirs),
|
|
574
917
|
set: sets.get(manifest.name),
|
|
575
918
|
decision: this.blockedByUnloaded(manifest, decisions.get(manifest.name)),
|
|
576
919
|
fatal: true,
|
|
@@ -584,9 +927,8 @@ let ExtensionHost = class ExtensionHost {
|
|
|
584
927
|
desired = await p.installs.desired();
|
|
585
928
|
}
|
|
586
929
|
catch (e) {
|
|
587
|
-
this.log.error("
|
|
588
|
-
|
|
589
|
-
});
|
|
930
|
+
this.log.error("Cannot load the authoritative extension policy inventory", { err: e });
|
|
931
|
+
throw new Error("Extension policy inventory is unavailable during startup", { cause: e });
|
|
590
932
|
}
|
|
591
933
|
if (desired) {
|
|
592
934
|
// Packages kept in PG first: the object store serving the others may be one of them (a
|
|
@@ -602,7 +944,9 @@ let ExtensionHost = class ExtensionHost {
|
|
|
602
944
|
if (deferred.length > 0) {
|
|
603
945
|
await this.loadDeferred(deferred, dirs, urls, snapshots, approvals, installProviders);
|
|
604
946
|
}
|
|
605
|
-
await this.refreshPolicyExpectations(
|
|
947
|
+
await this.refreshPolicyExpectations(desired ?? []);
|
|
948
|
+
if (p.installs)
|
|
949
|
+
void this.reportShadowStartGate();
|
|
606
950
|
const orphans = Object.keys(this.extensionConfig).filter((k) => !this.sources.has(k));
|
|
607
951
|
if (orphans.length > 0) {
|
|
608
952
|
this.log.warn("extensionConfig has keys for extensions that are not loaded", {
|
|
@@ -610,6 +954,147 @@ let ExtensionHost = class ExtensionHost {
|
|
|
610
954
|
});
|
|
611
955
|
}
|
|
612
956
|
}
|
|
957
|
+
/**
|
|
958
|
+
* This replica's isolation supervisor as last observed (plan task 1.3b): `not_configured`
|
|
959
|
+
* without `extensionHost.isolation`; otherwise `available` only after the Engine answered
|
|
960
|
+
* ({@link probeIsolation}), `failing` when it did not. Configuration alone is never readiness.
|
|
961
|
+
*/
|
|
962
|
+
isolationState;
|
|
963
|
+
hostIsolation() {
|
|
964
|
+
if (!this.config.get().extensionHost.isolation)
|
|
965
|
+
return "not_configured";
|
|
966
|
+
return this.isolationState ?? "failing";
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* Probes the isolation supervisor with the same read-only Engine and image checks a sandbox start
|
|
970
|
+
* runs (Linux, cgroup v2, the mandatory security options, the local runtime image): the positive
|
|
971
|
+
* readiness signal host-reason retirement waits for. Called at load and on each periodic
|
|
972
|
+
* convergence, so the reported state may lag a failure by one period (reporting only: a sandbox
|
|
973
|
+
* start runs the checks again and fails closed).
|
|
974
|
+
*/
|
|
975
|
+
async probeIsolation() {
|
|
976
|
+
const isolation = this.config.get().extensionHost.isolation;
|
|
977
|
+
if (!isolation) {
|
|
978
|
+
this.isolationState = undefined;
|
|
979
|
+
this.lastProbe = undefined;
|
|
980
|
+
return "not_configured";
|
|
981
|
+
}
|
|
982
|
+
const result = await probeExtensionSandboxChecks(isolation);
|
|
983
|
+
this.lastProbe = { result, at: new Date() };
|
|
984
|
+
this.isolationState = result.ok ? "available" : "failing";
|
|
985
|
+
return this.isolationState;
|
|
986
|
+
}
|
|
987
|
+
/** The last probe with its named checks (plan task 1.4j), undefined before any or unconfigured. */
|
|
988
|
+
lastProbe;
|
|
989
|
+
/**
|
|
990
|
+
* What this replica records for the isolation status projection (`ReplicaIsolationStore`): its
|
|
991
|
+
* last probe and the shadow placements of its last convergence.
|
|
992
|
+
*/
|
|
993
|
+
isolationRecord() {
|
|
994
|
+
return { probe: this.lastProbe, shadow: this.executions };
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* The newest grant of each install's revision, or undefined when the read failed: a revision
|
|
998
|
+
* already serving then keeps its admission (a read error is never a refusal), and any other
|
|
999
|
+
* revision is admitted as without a grant (today's admission).
|
|
1000
|
+
*/
|
|
1001
|
+
async grantSurfaces(desired) {
|
|
1002
|
+
try {
|
|
1003
|
+
return await readGrantSurfacesBySha256(kernelDb(this.deps.db), desired.map((d) => d.sha256));
|
|
1004
|
+
}
|
|
1005
|
+
catch (err) {
|
|
1006
|
+
this.log.warn("reading extension revision grants for admission failed", { err });
|
|
1007
|
+
return undefined;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
/** The last shadow execution report logged by this replica (log de-duplication, not state). */
|
|
1011
|
+
lastExecutionReport;
|
|
1012
|
+
/** The shadow execution decisions of the last convergence on this replica (for the inventory). */
|
|
1013
|
+
executions = [];
|
|
1014
|
+
/** This replica's shadow execution decisions of the installs it last converged. */
|
|
1015
|
+
shadowExecutions() {
|
|
1016
|
+
return this.executions;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Shadow mode (plan task 1.3b, rollout fence until 1.5a): where each admitted install would run
|
|
1020
|
+
* under the execution-realm decision and whether its grant covers the forcing keys, including
|
|
1021
|
+
* the kernel's `host.no-isolation` on a host without isolation. Logged when it changes; never
|
|
1022
|
+
* refuses or moves a revision: the legacy tier governs.
|
|
1023
|
+
*/
|
|
1024
|
+
reportShadowExecution(desired, tiers, grants) {
|
|
1025
|
+
try {
|
|
1026
|
+
const host = this.hostIsolation();
|
|
1027
|
+
const executions = [];
|
|
1028
|
+
for (const d of desired) {
|
|
1029
|
+
const tier = tiers.get(d.name);
|
|
1030
|
+
if (tier === undefined || tier === "refused")
|
|
1031
|
+
continue;
|
|
1032
|
+
executions.push(shadowExecutionOf(d, tier, host, grants.get(d.sha256)));
|
|
1033
|
+
}
|
|
1034
|
+
this.executions = executions;
|
|
1035
|
+
const notable = executions.filter((e) => e.diverges || e.hostReasonRetired || e.retireHostReason);
|
|
1036
|
+
const report = notable.map((e) => ({
|
|
1037
|
+
plugin: `${e.plugin}@${e.version}`,
|
|
1038
|
+
legacy: e.legacy,
|
|
1039
|
+
would: e.would,
|
|
1040
|
+
uncovered: e.uncovered,
|
|
1041
|
+
...(e.hostReasonRetired && {
|
|
1042
|
+
hostReasonRetired: "host.no-isolation was retired when isolation was available; it is not restored, the revision needs a new review",
|
|
1043
|
+
}),
|
|
1044
|
+
...(e.retireHostReason && { retireHostReason: true }),
|
|
1045
|
+
}));
|
|
1046
|
+
const digest = JSON.stringify({ host, report });
|
|
1047
|
+
if (digest === this.lastExecutionReport)
|
|
1048
|
+
return;
|
|
1049
|
+
this.lastExecutionReport = digest;
|
|
1050
|
+
if (report.length > 0) {
|
|
1051
|
+
this.log.info("shadow execution realms: the enforcing cutover would place these differently", {
|
|
1052
|
+
host,
|
|
1053
|
+
revisions: report,
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
catch (err) {
|
|
1058
|
+
this.log.warn("shadow execution decisions failed", { err });
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
/** The last shadow report logged by this replica (a log de-duplication, not state). */
|
|
1062
|
+
lastShadowReport;
|
|
1063
|
+
/**
|
|
1064
|
+
* Shadow mode (plan task 1.2b, rollout fence until 1.5a): what the enforcing start gate would
|
|
1065
|
+
* decide from revision grants, reported in the log after the start and after each install
|
|
1066
|
+
* convergence, when it changes. The legacy snapshots govern; this never refuses, never blocks
|
|
1067
|
+
* the start (it runs after it, reading packages in the background) and its failures only warn.
|
|
1068
|
+
* An info line, not a warning: until the first reviews (plan tasks 1.3a and 1.3c) every install
|
|
1069
|
+
* is listed. Config-declared extensions have no stored package digest and are left to the
|
|
1070
|
+
* bootstrap review (1.3c) and the cutover preflight (1.5a).
|
|
1071
|
+
*/
|
|
1072
|
+
async reportShadowStartGate() {
|
|
1073
|
+
try {
|
|
1074
|
+
if (!this.revisionApprovals)
|
|
1075
|
+
return;
|
|
1076
|
+
const gate = await this.revisionApprovals.startGate();
|
|
1077
|
+
if (this.closed)
|
|
1078
|
+
return;
|
|
1079
|
+
const name = (d) => `${d.revision.plugin}@${d.revision.version} (${d.status}, legacy ${d.legacy})`;
|
|
1080
|
+
const report = {
|
|
1081
|
+
missingRequired: gate.missingRequired.map(name),
|
|
1082
|
+
pending: gate.pending.map(name),
|
|
1083
|
+
diverging: gate.diverging.length,
|
|
1084
|
+
};
|
|
1085
|
+
const digest = JSON.stringify(report);
|
|
1086
|
+
if (digest === this.lastShadowReport)
|
|
1087
|
+
return;
|
|
1088
|
+
this.lastShadowReport = digest;
|
|
1089
|
+
if (report.missingRequired.length > 0 || report.pending.length > 0) {
|
|
1090
|
+
this.log.info("shadow revision grants: the enforcing start gate would hold these back", report);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
catch (err) {
|
|
1094
|
+
if (!this.closed)
|
|
1095
|
+
this.log.warn("shadow revision grant decisions failed", { err });
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
613
1098
|
/**
|
|
614
1099
|
* Records each config-declared extension's display name from its plugin directory's plugin.json
|
|
615
1100
|
* (spec §2.2); an invalid plugin.json only warns (no display name).
|
|
@@ -636,7 +1121,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
636
1121
|
async claimNames(entries) {
|
|
637
1122
|
const rows = [];
|
|
638
1123
|
for (const e of entries) {
|
|
639
|
-
const pkg = await packageNameOf(e.dir);
|
|
1124
|
+
const pkg = e.isolated?.npmName ?? (await packageNameOf(e.dir));
|
|
640
1125
|
if (pkg === undefined) {
|
|
641
1126
|
this.log.warn("plugin module has no package.json name; its plugin name is not claimed", {
|
|
642
1127
|
plugin: e.manifest.name,
|
|
@@ -713,18 +1198,81 @@ let ExtensionHost = class ExtensionHost {
|
|
|
713
1198
|
if (values.length > 0)
|
|
714
1199
|
this.log.addSecrets(values);
|
|
715
1200
|
}
|
|
1201
|
+
tierOf(loader, revision, verifyBytes) {
|
|
1202
|
+
const fixtures = this.options[KERNEL_FIXTURE_TRUST];
|
|
1203
|
+
// Shadow mode (plan task 1.3b, until 1.5a): a pin-only revision is placed by its grant at
|
|
1204
|
+
// admission only. While its generation serves, a grant change (a retired host reason, a
|
|
1205
|
+
// revoked realm or grant) moves or refuses nothing; 1.3e's afterRevocation does that once
|
|
1206
|
+
// enforcing. Its bytes were verified at admission and a package sha256 never changes.
|
|
1207
|
+
const serving = this.servingTier(revision);
|
|
1208
|
+
// An extra-manifest pin placed by its grant (#1371) likewise keeps its serving tier
|
|
1209
|
+
const cause = publisherProofMissing(revision)
|
|
1210
|
+
? "pin_only_grant"
|
|
1211
|
+
: revision.source === "bootstrap"
|
|
1212
|
+
? "extra_pin_grant"
|
|
1213
|
+
: undefined;
|
|
1214
|
+
if (cause !== undefined &&
|
|
1215
|
+
keepsServingAdmission({ serving, enforced: this.revisionLeases.enforced, cause })) {
|
|
1216
|
+
return Promise.resolve(serving);
|
|
1217
|
+
}
|
|
1218
|
+
const tier = fixtures === true || fixtures?.installDigests.includes(revision.sha256)
|
|
1219
|
+
? Promise.resolve("trusted")
|
|
1220
|
+
: (loader.tier?.(revision, verifyBytes) ?? Promise.resolve("isolated"));
|
|
1221
|
+
return tier.then((t) => (t === "refused" ? t : this.afterRevocation(revision, t)));
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* What the isolated admission of an instance start takes from its grant. In shadow mode the
|
|
1225
|
+
* activation's decision (a reload reuses it; a grant change is reported, not enforced); once
|
|
1226
|
+
* enforcing (task 1.5a) the grant is read again, so a reload follows a revoked browser realm.
|
|
1227
|
+
*/
|
|
1228
|
+
async isolatedGrantFor(spec) {
|
|
1229
|
+
const isolated = spec.isolated;
|
|
1230
|
+
if (!isolated || !this.revisionLeases.enforced || !spec.sha256)
|
|
1231
|
+
return isolated?.grant;
|
|
1232
|
+
const grant = await readGrantSurfaceBySha256(kernelDb(this.deps.db), spec.sha256);
|
|
1233
|
+
return isolatedSectionGrant({ name: spec.manifest.name, version: spec.manifest.version, section: isolated.section }, grant);
|
|
1234
|
+
}
|
|
1235
|
+
/** The tier this replica serves the exact revision in, or undefined when it does not serve it. */
|
|
1236
|
+
servingTier(revision) {
|
|
1237
|
+
return this.registry.current(revision.name)?.sha256 === revision.sha256
|
|
1238
|
+
? this.executionTier.get(revision.name)
|
|
1239
|
+
: undefined;
|
|
1240
|
+
}
|
|
716
1241
|
/**
|
|
717
|
-
*
|
|
718
|
-
*
|
|
719
|
-
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
1242
|
+
* The tier after a revocation (plan task 1.3e; enforced from task 1.5a, until then the leases
|
|
1243
|
+
* only report it). A revision whose whole grant is revoked waits for a new review. A trusted
|
|
1244
|
+
* (in-process) revision whose grant no longer serves server full access runs isolated when the
|
|
1245
|
+
* remaining grant fits the sandbox and the package has an isolated form, and otherwise waits for
|
|
1246
|
+
* a new review ({@link RevocationPendingError}: reported pending, not failed).
|
|
1247
|
+
*/
|
|
1248
|
+
async afterRevocation(revision, tier) {
|
|
1249
|
+
if (!this.revisionLeases.enforced)
|
|
1250
|
+
return tier;
|
|
1251
|
+
const grant = await readGrantSurfaceBySha256(kernelDb(this.deps.db), revision.sha256);
|
|
1252
|
+
if (!grant)
|
|
1253
|
+
return tier;
|
|
1254
|
+
if (grant.state === "revoked") {
|
|
1255
|
+
throw new RevocationPendingError("The revision's grant was revoked; it waits for a new review");
|
|
1256
|
+
}
|
|
1257
|
+
if (tier !== "trusted" || !leaseStateOf(grant).realmsRevoked.includes("server"))
|
|
1258
|
+
return tier;
|
|
1259
|
+
if (realmAfterRevocation(grant, "server") === "isolated") {
|
|
1260
|
+
try {
|
|
1261
|
+
assertIsolatedSection(revision.section, isolatedSectionGrant(revision, grant));
|
|
1262
|
+
return "isolated";
|
|
1263
|
+
}
|
|
1264
|
+
catch {
|
|
1265
|
+
throw new RevocationPendingError("Full access for the server realm was revoked and the package has no isolated form; it waits for a new review");
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
throw new RevocationPendingError("Full access for the server realm was revoked and the remaining grant still needs it; it waits for a new review");
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Reconciles enabled installs from PostgreSQL at startup and during convergence. It removes
|
|
1272
|
+
* withdrawn revisions, verifies the tier, and prepares replacements in dependency order.
|
|
1273
|
+
* Permission or dependency waits keep the same-tier serving revision. Import, migration and
|
|
1274
|
+
* setup failures report the stage that failed. Successful replacements drain the old instance
|
|
1275
|
+
* and changed providers trigger dependency reconciliation.
|
|
728
1276
|
*/
|
|
729
1277
|
async applyInstalls(loader, desired, startup,
|
|
730
1278
|
/**
|
|
@@ -736,13 +1284,75 @@ let ExtensionHost = class ExtensionHost {
|
|
|
736
1284
|
const declared = this.declared();
|
|
737
1285
|
const installProviders = new Map();
|
|
738
1286
|
const wanted = new Map();
|
|
1287
|
+
const tiers = new Map();
|
|
1288
|
+
const rejected = new Map();
|
|
1289
|
+
const rejectedActions = new Map();
|
|
1290
|
+
let proofMode;
|
|
1291
|
+
/** Revisions a revocation sends back to review: pending, not failed (plan task 1.3e). */
|
|
1292
|
+
const awaitingReview = new Map();
|
|
1293
|
+
/** Revisions whose grant could not be read: they wait for the next convergence. */
|
|
1294
|
+
const grantUnavailable = new Set();
|
|
1295
|
+
const grantsBySha = await this.grantSurfaces(electAmong);
|
|
1296
|
+
for (const d of electAmong) {
|
|
1297
|
+
if (declared.has(d.name))
|
|
1298
|
+
continue;
|
|
1299
|
+
try {
|
|
1300
|
+
const tier = await this.tierOf(loader, d, false);
|
|
1301
|
+
if (tier === "refused") {
|
|
1302
|
+
if (publisherProofMissing(d)) {
|
|
1303
|
+
proofMode ??= await officialPublisherProofMode(kernelDb(this.deps.db));
|
|
1304
|
+
const refusal = publisherProofRefusal(proofMode);
|
|
1305
|
+
rejected.set(d.name, refusal.detail);
|
|
1306
|
+
rejectedActions.set(d.name, refusal.action);
|
|
1307
|
+
}
|
|
1308
|
+
else {
|
|
1309
|
+
rejected.set(d.name, "The extension revision did not pass trust admission");
|
|
1310
|
+
}
|
|
1311
|
+
continue;
|
|
1312
|
+
}
|
|
1313
|
+
// A serving revision keeps its isolated admission when the grant read failed (a read
|
|
1314
|
+
// error is no refusal) and, in shadow mode, when its grant changed (the browser realm
|
|
1315
|
+
// revoked): reported now, enforced from task 1.5a.
|
|
1316
|
+
const serving = this.servingTier(d);
|
|
1317
|
+
const keep = serving === tier &&
|
|
1318
|
+
keepsServingAdmission({
|
|
1319
|
+
serving,
|
|
1320
|
+
tier,
|
|
1321
|
+
enforced: this.revisionLeases.enforced,
|
|
1322
|
+
cause: grantsBySha === undefined ? "grant_read_failed" : "browser_grant",
|
|
1323
|
+
});
|
|
1324
|
+
if (tier === "isolated" && !keep) {
|
|
1325
|
+
assertIsolatedSection(d.section, isolatedSectionGrant(d, grantsBySha?.get(d.sha256)));
|
|
1326
|
+
}
|
|
1327
|
+
tiers.set(d.name, tier);
|
|
1328
|
+
}
|
|
1329
|
+
catch (error) {
|
|
1330
|
+
const serving = this.servingTier(d);
|
|
1331
|
+
const keep = error instanceof GrantReadError &&
|
|
1332
|
+
keepsServingAdmission({
|
|
1333
|
+
serving,
|
|
1334
|
+
enforced: this.revisionLeases.enforced,
|
|
1335
|
+
cause: "grant_read_failed",
|
|
1336
|
+
});
|
|
1337
|
+
if (keep)
|
|
1338
|
+
tiers.set(d.name, serving);
|
|
1339
|
+
else if (error instanceof GrantReadError)
|
|
1340
|
+
grantUnavailable.add(d.name);
|
|
1341
|
+
else if (error instanceof RevocationPendingError)
|
|
1342
|
+
awaitingReview.set(d.name, error.message);
|
|
1343
|
+
else
|
|
1344
|
+
rejected.set(d.name, errMsg(error));
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
if (grantsBySha)
|
|
1348
|
+
this.reportShadowExecution(electAmong, tiers, grantsBySha);
|
|
739
1349
|
// Single-provider election: of the enabled install records providing one single-provider
|
|
740
1350
|
// extension point, only the earliest enabled is loaded (desired() order: enabled_at, install
|
|
741
1351
|
// time, name). Decided from PG alone, never from what loaded here, so every replica and every
|
|
742
1352
|
// restart picks the same one. Two enabled providers only remain from before a second enable
|
|
743
1353
|
// was refused; the others are pending / conflict until the super admin disables one. A loser
|
|
744
1354
|
// provides nothing (left out of `installProviders`, so `blockedBy` never names it).
|
|
745
|
-
const { losers } = electSingleProviders(electAmong.filter((d) =>
|
|
1355
|
+
const { losers } = electSingleProviders(electAmong.filter((d) => tiers.has(d.name)));
|
|
746
1356
|
for (const d of desired) {
|
|
747
1357
|
const taken = declared.get(d.name);
|
|
748
1358
|
if (taken) {
|
|
@@ -754,18 +1364,24 @@ let ExtensionHost = class ExtensionHost {
|
|
|
754
1364
|
}
|
|
755
1365
|
continue;
|
|
756
1366
|
}
|
|
757
|
-
if (losers.has(d.name))
|
|
1367
|
+
if (losers.has(d.name) || !tiers.has(d.name))
|
|
758
1368
|
continue;
|
|
759
1369
|
wanted.set(d.name, d);
|
|
760
1370
|
// 按审阅过的静态清单(不论随后加载成败)
|
|
761
|
-
for (const cap of d.section.manifest.provides) {
|
|
1371
|
+
for (const cap of extensionPointRefs(d.section.manifest.provides)) {
|
|
762
1372
|
installProviders.set(cap, [...(installProviders.get(cap) ?? []), d.name]);
|
|
763
1373
|
}
|
|
764
1374
|
}
|
|
765
1375
|
this.installProvides = installProviders;
|
|
1376
|
+
for (const name of this.unloadedForDependency) {
|
|
1377
|
+
if (this.specs.get(name)?.source !== "install" || wanted.has(name))
|
|
1378
|
+
continue;
|
|
1379
|
+
this.unloadedForDependency.delete(name);
|
|
1380
|
+
this.specs.delete(name);
|
|
1381
|
+
}
|
|
766
1382
|
const drainMs = this.drainMs();
|
|
767
1383
|
const changed = [];
|
|
768
|
-
//
|
|
1384
|
+
// Unload withdrawn instances and clear stale serving status.
|
|
769
1385
|
for (const inst of this.registry.all()) {
|
|
770
1386
|
if (inst.source !== "install" || wanted.has(inst.name))
|
|
771
1387
|
continue;
|
|
@@ -789,18 +1405,106 @@ let ExtensionHost = class ExtensionHost {
|
|
|
789
1405
|
detail: null,
|
|
790
1406
|
});
|
|
791
1407
|
}
|
|
792
|
-
|
|
1408
|
+
for (const d of desired) {
|
|
1409
|
+
if (!grantUnavailable.has(d.name))
|
|
1410
|
+
continue;
|
|
1411
|
+
await this.writeStatus({
|
|
1412
|
+
plugin: d.name,
|
|
1413
|
+
version: d.version,
|
|
1414
|
+
sha256: d.sha256,
|
|
1415
|
+
source: "install",
|
|
1416
|
+
state: "pending",
|
|
1417
|
+
reason: GRANT_UNAVAILABLE,
|
|
1418
|
+
detail: "The revision's grant could not be read; retried at the next convergence",
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
for (const d of desired) {
|
|
1422
|
+
const waiting = awaitingReview.get(d.name);
|
|
1423
|
+
if (waiting === undefined)
|
|
1424
|
+
continue;
|
|
1425
|
+
await this.writeStatus({
|
|
1426
|
+
plugin: d.name,
|
|
1427
|
+
version: d.version,
|
|
1428
|
+
sha256: d.sha256,
|
|
1429
|
+
source: "install",
|
|
1430
|
+
state: "pending",
|
|
1431
|
+
reason: "approval",
|
|
1432
|
+
detail: waiting,
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
for (const d of desired) {
|
|
1436
|
+
const detail = rejected.get(d.name);
|
|
1437
|
+
if (!detail)
|
|
1438
|
+
continue;
|
|
1439
|
+
await this.reportAdmissionRefusal(d.name, d.sha256, detail, rejectedActions.get(d.name) ??
|
|
1440
|
+
"Review the plugin revision and install a package eligible for this deployment.");
|
|
1441
|
+
await this.writeStatus({
|
|
1442
|
+
plugin: d.name,
|
|
1443
|
+
version: d.version,
|
|
1444
|
+
sha256: d.sha256,
|
|
1445
|
+
source: "install",
|
|
1446
|
+
state: "failed",
|
|
1447
|
+
reason: "import_failed",
|
|
1448
|
+
detail,
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
793
1451
|
const candidates = [];
|
|
794
1452
|
for (const d of wanted.values()) {
|
|
795
1453
|
if (this.closed)
|
|
796
1454
|
throw new Error(CLOSED_DURING_LOAD);
|
|
797
|
-
|
|
1455
|
+
const tier = tiers.get(d.name);
|
|
1456
|
+
const current = this.registry.current(d.name);
|
|
1457
|
+
if (current && this.executionTier.get(d.name) !== tier) {
|
|
1458
|
+
const removed = await this.doUnload(d.name, drainMs, null);
|
|
1459
|
+
if (removed)
|
|
1460
|
+
changed.push(...removed.manifest.provides);
|
|
1461
|
+
}
|
|
1462
|
+
else if (current?.sha256 === d.sha256) {
|
|
798
1463
|
continue;
|
|
1464
|
+
}
|
|
1465
|
+
// a pin-only revision (no publisher proof) is verified whatever tier its grant gives it
|
|
1466
|
+
if (tier === "trusted" || publisherProofMissing(d)) {
|
|
1467
|
+
let verified = "refused";
|
|
1468
|
+
try {
|
|
1469
|
+
verified = await this.tierOf(loader, d, true);
|
|
1470
|
+
}
|
|
1471
|
+
catch (error) {
|
|
1472
|
+
if (error instanceof GrantReadError) {
|
|
1473
|
+
await this.writeStatus({
|
|
1474
|
+
plugin: d.name,
|
|
1475
|
+
version: d.version,
|
|
1476
|
+
sha256: d.sha256,
|
|
1477
|
+
source: "install",
|
|
1478
|
+
state: "pending",
|
|
1479
|
+
reason: GRANT_UNAVAILABLE,
|
|
1480
|
+
detail: "The revision's grant could not be read; retried at the next convergence",
|
|
1481
|
+
});
|
|
1482
|
+
continue;
|
|
1483
|
+
}
|
|
1484
|
+
// The refusal below reports the failed integrity check without logging verifier internals.
|
|
1485
|
+
}
|
|
1486
|
+
if (verified !== tier) {
|
|
1487
|
+
const detail = "The extension package did not match its verified integrity";
|
|
1488
|
+
await this.reportAdmissionRefusal(d.name, d.sha256, detail, "Check publisher verification and reimport the verified package.");
|
|
1489
|
+
await this.writeStatus({
|
|
1490
|
+
plugin: d.name,
|
|
1491
|
+
version: d.version,
|
|
1492
|
+
sha256: d.sha256,
|
|
1493
|
+
source: "install",
|
|
1494
|
+
state: "failed",
|
|
1495
|
+
reason: "sha_mismatch",
|
|
1496
|
+
detail,
|
|
1497
|
+
});
|
|
1498
|
+
continue;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
799
1501
|
const c = await this.prepare(loader, d);
|
|
800
1502
|
if (c)
|
|
801
1503
|
candidates.push(c);
|
|
802
1504
|
}
|
|
803
|
-
//
|
|
1505
|
+
// Resolve dependencies together with the serving extensions: a replaced old instance still
|
|
1506
|
+
// counts as a provider until its replacement is accepted; candidates that fail to resolve are
|
|
1507
|
+
// retried until no new one can be added
|
|
804
1508
|
const accepted = [];
|
|
805
1509
|
const base = () => {
|
|
806
1510
|
const replaced = new Set(accepted.map((a) => a.d.name));
|
|
@@ -887,9 +1591,18 @@ let ExtensionHost = class ExtensionHost {
|
|
|
887
1591
|
continue;
|
|
888
1592
|
if (this.closed)
|
|
889
1593
|
throw new Error(CLOSED_DURING_LOAD);
|
|
1594
|
+
const isolated = tiers.get(m.name) === "isolated";
|
|
890
1595
|
const a = {
|
|
891
1596
|
manifest: c.manifest,
|
|
1597
|
+
...(isolated && {
|
|
1598
|
+
isolated: {
|
|
1599
|
+
root: c.root,
|
|
1600
|
+
section: c.d.section,
|
|
1601
|
+
grant: isolatedSectionGrant(c.d, grantsBySha?.get(c.d.sha256)),
|
|
1602
|
+
},
|
|
1603
|
+
}),
|
|
892
1604
|
source: "install",
|
|
1605
|
+
optionalBootstrap: c.d.source === "bootstrap" && !c.d.required,
|
|
893
1606
|
sha256: c.d.sha256,
|
|
894
1607
|
entryUrl: c.entryUrl,
|
|
895
1608
|
migrationsDir: c.migrationsDir,
|
|
@@ -897,13 +1610,14 @@ let ExtensionHost = class ExtensionHost {
|
|
|
897
1610
|
decision: { plugin: m.name, action: "pending" },
|
|
898
1611
|
fatal: false,
|
|
899
1612
|
migrate: () => loader.migrate(c.d, c.migrationsDir, this.abort.signal),
|
|
900
|
-
importModule: () => this.importInstalled(c),
|
|
1613
|
+
...(!isolated && { importModule: () => this.importInstalled(c) }),
|
|
901
1614
|
};
|
|
902
1615
|
a.decision = this.decidePending(m.name, a, snapshots, installProviders);
|
|
903
1616
|
const old = this.registry.current(m.name);
|
|
904
1617
|
// 安装记录不受信任:启动时 setup 同样限时(I3),挂住的 setup 不卡住内核启动;配置声明的启动时不限
|
|
905
1618
|
const inst = await this.activate(approvals, a, this.reloadSetupTimeoutMs());
|
|
906
1619
|
if (inst) {
|
|
1620
|
+
this.executionTier.set(m.name, isolated ? "isolated" : "trusted");
|
|
907
1621
|
activated.add(m.name);
|
|
908
1622
|
changed.push(...inst.manifest.provides, ...(old?.manifest.provides ?? []));
|
|
909
1623
|
}
|
|
@@ -950,8 +1664,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
950
1664
|
* `permissionSetOfPackage` at review; the migrations directory comes only from
|
|
951
1665
|
* `extension.migrations`). Does not import the module: that happens after the permission gate
|
|
952
1666
|
* ({@link importInstalled}). A failure is recorded as failed (`sync_failed` / `sha_mismatch`, the
|
|
953
|
-
* detail is the error message only
|
|
954
|
-
* returns undefined. The result for a package never changes, so successes are cached by sha (a
|
|
1667
|
+
* detail is the error message only) and returns undefined. The result for a package never changes, so successes are cached by sha (a
|
|
955
1668
|
* reconcile cycle does not unpack again).
|
|
956
1669
|
*/
|
|
957
1670
|
async prepare(loader, d) {
|
|
@@ -1026,6 +1739,22 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1026
1739
|
/**
|
|
1027
1740
|
* 安装记录加载失败的 error 日志:每个周期都会重试,同一个包、同一个原因只记一次(状态行每次照写)。
|
|
1028
1741
|
*/
|
|
1742
|
+
async reportAdmissionRefusal(plugin, sha256, detail, action) {
|
|
1743
|
+
const recorded = await kernelDb(this.deps.db)
|
|
1744
|
+
.insertInto("extension_admission_refusals")
|
|
1745
|
+
.values({ plugin, sha256 })
|
|
1746
|
+
.onConflict((conflict) => conflict.doNothing())
|
|
1747
|
+
.returning("plugin")
|
|
1748
|
+
.executeTakeFirst();
|
|
1749
|
+
if (recorded) {
|
|
1750
|
+
this.log.error("Extension revision refused", {
|
|
1751
|
+
plugin,
|
|
1752
|
+
sha256,
|
|
1753
|
+
detail: this.log.redact(detail).slice(0, 500),
|
|
1754
|
+
action,
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1029
1758
|
logFailure(plugin, sha256, reason, err, fields) {
|
|
1030
1759
|
const key = `${sha256}:${reason}`;
|
|
1031
1760
|
if (this.loggedFailures.get(plugin) === key)
|
|
@@ -1047,7 +1776,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1047
1776
|
else
|
|
1048
1777
|
this.pendingPlugins.push(p);
|
|
1049
1778
|
}
|
|
1050
|
-
/**
|
|
1779
|
+
/** Removes an extension from the pending list. */
|
|
1051
1780
|
dropPending(plugin) {
|
|
1052
1781
|
const at = this.pendingPlugins.findIndex((x) => x.plugin === plugin);
|
|
1053
1782
|
if (at >= 0)
|
|
@@ -1060,12 +1789,21 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1060
1789
|
* 与「配置声明插件依赖待批准的配置声明插件」一致,内核照常启动;
|
|
1061
1790
|
* - 缺的能力没有任何提供方 → 与此前一样抛错(内核启动失败)。
|
|
1062
1791
|
*/
|
|
1792
|
+
declaredMigrationDirectory(manifest, dirs) {
|
|
1793
|
+
const source = this.declaredIsolation.get(manifest.name);
|
|
1794
|
+
if (source) {
|
|
1795
|
+
return source.section.migrations
|
|
1796
|
+
? join(source.root, packagePath(source.section.migrations))
|
|
1797
|
+
: undefined;
|
|
1798
|
+
}
|
|
1799
|
+
return migrationsDirOf(manifest, dirs.get(manifest.name));
|
|
1800
|
+
}
|
|
1063
1801
|
async loadDeferred(deferred, dirs, urls, snapshots, approvals, installProviders) {
|
|
1064
1802
|
if (this.closed)
|
|
1065
1803
|
throw new Error(CLOSED_DURING_LOAD);
|
|
1066
1804
|
const loaded = this.registry.all();
|
|
1067
1805
|
const { ready, deferred: blocked } = splitDeferred([...loaded.map((i) => i.manifest), ...deferred], new Set(deferred.map((m) => m.name)));
|
|
1068
|
-
const deferredSets = await permissionSets(deferred, dirs);
|
|
1806
|
+
const deferredSets = await permissionSets(deferred, dirs, this.declaredIsolation);
|
|
1069
1807
|
this.noteDeclared(deferred, deferredSets);
|
|
1070
1808
|
const sets = new Map([...loaded.map((i) => [i.name, i.permissions]), ...deferredSets]);
|
|
1071
1809
|
const blockedProvides = new Set(blocked.flatMap((m) => m.provides));
|
|
@@ -1090,9 +1828,10 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1090
1828
|
await this.activate(approvals, {
|
|
1091
1829
|
manifest: m,
|
|
1092
1830
|
source: "config",
|
|
1093
|
-
|
|
1831
|
+
isolated: this.declaredIsolation.get(m.name),
|
|
1832
|
+
sha256: this.declaredIsolation.get(m.name)?.digest ?? null,
|
|
1094
1833
|
entryUrl: urls.get(m.name),
|
|
1095
|
-
migrationsDir:
|
|
1834
|
+
migrationsDir: this.declaredMigrationDirectory(m, dirs),
|
|
1096
1835
|
set: sets.get(m.name),
|
|
1097
1836
|
decision: {
|
|
1098
1837
|
plugin: m.name,
|
|
@@ -1121,9 +1860,10 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1121
1860
|
await this.activate(approvals, {
|
|
1122
1861
|
manifest,
|
|
1123
1862
|
source: "config",
|
|
1124
|
-
|
|
1863
|
+
isolated: this.declaredIsolation.get(manifest.name),
|
|
1864
|
+
sha256: this.declaredIsolation.get(manifest.name)?.digest ?? null,
|
|
1125
1865
|
entryUrl: urls.get(manifest.name),
|
|
1126
|
-
migrationsDir:
|
|
1866
|
+
migrationsDir: this.declaredMigrationDirectory(manifest, dirs),
|
|
1127
1867
|
set: sets.get(manifest.name),
|
|
1128
1868
|
// 同一批里的提供方可能刚记为待配置:依赖方改为待定,不让启动失败
|
|
1129
1869
|
decision: this.blockedByUnloaded(manifest, decisions.get(manifest.name)),
|
|
@@ -1132,7 +1872,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1132
1872
|
}
|
|
1133
1873
|
}
|
|
1134
1874
|
/**
|
|
1135
|
-
* Checks the config UI hints of a loaded module's deployment
|
|
1875
|
+
* Checks the config UI hints of a loaded module's deployment schema (spec §4.1). Invalid
|
|
1136
1876
|
* hints never fail the load: the form schemas drop their `x-ui` (`configFormSchema`), one warning
|
|
1137
1877
|
* per `<name>@<version>` is logged, and the returned text goes into the status detail (null when
|
|
1138
1878
|
* every hint is valid). The packer refuses such a package; this covers hand-made ones. It never
|
|
@@ -1141,12 +1881,14 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1141
1881
|
*/
|
|
1142
1882
|
checkConfigUi(manifest) {
|
|
1143
1883
|
const parts = [];
|
|
1144
|
-
for (const level of ["deployment"
|
|
1884
|
+
for (const level of ["deployment"]) {
|
|
1145
1885
|
const schema = manifest.config?.[level];
|
|
1146
1886
|
if (!schema)
|
|
1147
1887
|
continue;
|
|
1148
1888
|
try {
|
|
1149
|
-
const { problems } = configFormSchema(schema, level
|
|
1889
|
+
const { problems } = configFormSchema(schema, level, {
|
|
1890
|
+
provides: manifest.provides,
|
|
1891
|
+
});
|
|
1150
1892
|
if (problems.length > 0)
|
|
1151
1893
|
parts.push(describeConfigUiProblems(level, problems));
|
|
1152
1894
|
}
|
|
@@ -1208,22 +1950,37 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1208
1950
|
}
|
|
1209
1951
|
}
|
|
1210
1952
|
/**
|
|
1211
|
-
*
|
|
1212
|
-
*
|
|
1213
|
-
*
|
|
1214
|
-
* 返回新登记的实例(没有加载时返回 undefined)。
|
|
1953
|
+
* Admit a reviewed revision, resolve deployment config, migrate, and register it. Ineligible
|
|
1954
|
+
* config leaves the extension pending. A same-tier replacement keeps the previous instance
|
|
1955
|
+
* available until the new instance registers. Tier transitions drain before replacement.
|
|
1215
1956
|
*/
|
|
1216
1957
|
async activate(approvals, a, setupTimeoutMs) {
|
|
1217
1958
|
const { decision } = a;
|
|
1218
1959
|
let manifest = a.manifest;
|
|
1219
1960
|
const name = manifest.name;
|
|
1220
1961
|
const base = { plugin: name, version: manifest.version, sha256: a.sha256, source: a.source };
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1962
|
+
// Install records are reconciled from PostgreSQL, while declarations need a local retry.
|
|
1963
|
+
const retryLater = () => {
|
|
1964
|
+
if (a.source !== "install")
|
|
1965
|
+
this.pendingActivations.set(name, a);
|
|
1966
|
+
};
|
|
1967
|
+
const failSoft = async (reason, e, admission) => {
|
|
1968
|
+
const detail = errMsg(e);
|
|
1969
|
+
if (admission && a.sha256) {
|
|
1970
|
+
await this.reportAdmissionRefusal(name, a.sha256, detail, admission.action);
|
|
1971
|
+
}
|
|
1972
|
+
else {
|
|
1973
|
+
this.logFailure(name, a.sha256, reason, e, { version: manifest.version });
|
|
1974
|
+
}
|
|
1975
|
+
await this.writeStatus({ ...base, state: "failed", reason, detail });
|
|
1976
|
+
if (a.fatal && a.isolated && admission?.refuseDeclaration) {
|
|
1977
|
+
throw new Error(`Configured extension ${name} was refused: ${errMsg(e)}`, { cause: e });
|
|
1978
|
+
}
|
|
1979
|
+
if (a.isolated)
|
|
1980
|
+
retryLater();
|
|
1224
1981
|
return undefined;
|
|
1225
1982
|
};
|
|
1226
|
-
//
|
|
1983
|
+
// Approved trusted installs may import here. Pending installs use only their static manifest.
|
|
1227
1984
|
if (a.importModule && decision.action !== "pending") {
|
|
1228
1985
|
try {
|
|
1229
1986
|
manifest = await a.importModule();
|
|
@@ -1234,13 +1991,20 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1234
1991
|
return failSoft(e instanceof ManifestMismatchError ? "manifest_mismatch" : "import_failed", e);
|
|
1235
1992
|
}
|
|
1236
1993
|
}
|
|
1994
|
+
if (a.isolated && decision.action !== "pending") {
|
|
1995
|
+
try {
|
|
1996
|
+
assertIsolatedSection(a.isolated.section, a.isolated.grant);
|
|
1997
|
+
manifest = isolatedManifestOf(a.isolated.section);
|
|
1998
|
+
}
|
|
1999
|
+
catch (error) {
|
|
2000
|
+
return failSoft("import_failed", error, {
|
|
2001
|
+
action: "Install a revision that declares supported isolated capabilities and configuration.",
|
|
2002
|
+
refuseDeclaration: true,
|
|
2003
|
+
});
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
1237
2006
|
const schema = manifest.config?.deployment;
|
|
1238
|
-
|
|
1239
|
-
const retryLater = () => {
|
|
1240
|
-
if (a.source !== "install")
|
|
1241
|
-
this.pendingActivations.set(name, a);
|
|
1242
|
-
};
|
|
1243
|
-
const readConfig = !(a.importModule && decision.action === "pending");
|
|
2007
|
+
const readConfig = !((a.importModule || a.isolated) && decision.action === "pending");
|
|
1244
2008
|
let raw;
|
|
1245
2009
|
try {
|
|
1246
2010
|
if (readConfig)
|
|
@@ -1312,29 +2076,59 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1312
2076
|
}
|
|
1313
2077
|
if (schema && parsed) {
|
|
1314
2078
|
if (!parsed.success) {
|
|
1315
|
-
//
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
2079
|
+
// Report schema paths and issue kinds only, since custom messages can expose input values.
|
|
2080
|
+
const issues = toIssues(parsed.error);
|
|
2081
|
+
const detail = issues.map((i) => `${i.path || "<root>"}: ${i.message}`).join("; ");
|
|
2082
|
+
const unconfigured = a.optionalBootstrap === true &&
|
|
2083
|
+
issues.every((issue) => {
|
|
2084
|
+
const value = issue.path === "" ? raw : getPath(raw, issue.path);
|
|
2085
|
+
return value === undefined || value === "";
|
|
2086
|
+
});
|
|
2087
|
+
const level = unconfigured ? "info" : "warn";
|
|
2088
|
+
const report = `${level}:${detail}`;
|
|
2089
|
+
if (this.configReported.get(name) !== report) {
|
|
2090
|
+
this.configReported.set(name, report);
|
|
2091
|
+
const next = "set it on its Extension tab in Admin → Plugins or in the startup config; it loads without a restart";
|
|
2092
|
+
this.log[level](unconfigured
|
|
2093
|
+
? `optional preinstalled extension is waiting for deployment config (${next})`
|
|
2094
|
+
: `extension not loaded: its deployment config is missing or invalid (${next})`, { plugin: name, source: a.source, detail });
|
|
1323
2095
|
}
|
|
1324
2096
|
retryLater();
|
|
1325
2097
|
await this.writeStatus({ ...base, state: "pending", reason: "config", detail });
|
|
1326
2098
|
return undefined;
|
|
1327
2099
|
}
|
|
1328
|
-
this.
|
|
2100
|
+
this.configReported.delete(name);
|
|
1329
2101
|
config = parsed.data;
|
|
1330
2102
|
this.reportSecrets(schema, config);
|
|
1331
2103
|
}
|
|
1332
2104
|
if (this.closed)
|
|
1333
2105
|
throw new Error(CLOSED_DURING_LOAD);
|
|
1334
|
-
//
|
|
2106
|
+
// The isolated runner must be available before an isolated revision can migrate or activate.
|
|
2107
|
+
if (a.isolated && !this.config.get().extensionHost.isolation) {
|
|
2108
|
+
return failSoft("setup_failed", new Error("The isolated extension supervisor is not configured"), {
|
|
2109
|
+
action: "Configure extensionHost.isolation and restart the replica.",
|
|
2110
|
+
refuseDeclaration: true,
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
if (a.isolated) {
|
|
2114
|
+
try {
|
|
2115
|
+
const identity = this.dbIdentity.resolve(name);
|
|
2116
|
+
if (!identity.dedicated) {
|
|
2117
|
+
throw new Error("Isolated extension migrations require the dedicated login");
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
catch {
|
|
2121
|
+
return failSoft("migration_failed", new Error("The isolated extension has no dedicated database identity"), { action: "Provision the extension database login with capybara migrate." });
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
1335
2124
|
const migrating = a.migrate
|
|
1336
2125
|
? a.migrate()
|
|
1337
|
-
: migratePlugin(this.
|
|
2126
|
+
: migratePlugin(this.dbIdentity.resolve(name), manifest, a.migrationsDir, this.deps.connectTimeoutMs, a.isolated
|
|
2127
|
+
? AbortSignal.any([
|
|
2128
|
+
this.abort.signal,
|
|
2129
|
+
AbortSignal.timeout(this.config.get().extensionHost.migrationTimeoutSeconds * 1000),
|
|
2130
|
+
])
|
|
2131
|
+
: this.abort.signal);
|
|
1338
2132
|
this.migrating = migrating;
|
|
1339
2133
|
try {
|
|
1340
2134
|
if ((await migrating) === "busy") {
|
|
@@ -1350,7 +2144,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1350
2144
|
catch (e) {
|
|
1351
2145
|
if (this.closed)
|
|
1352
2146
|
throw new Error(CLOSED_DURING_LOAD, { cause: e });
|
|
1353
|
-
if (a.fatal)
|
|
2147
|
+
if (a.fatal && !a.isolated)
|
|
1354
2148
|
throw e;
|
|
1355
2149
|
return failSoft("migration_failed", e);
|
|
1356
2150
|
}
|
|
@@ -1361,6 +2155,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1361
2155
|
throw new Error(CLOSED_DURING_LOAD);
|
|
1362
2156
|
const spec = {
|
|
1363
2157
|
manifest,
|
|
2158
|
+
isolated: a.isolated,
|
|
1364
2159
|
entryUrl: a.entryUrl,
|
|
1365
2160
|
source: a.source,
|
|
1366
2161
|
sha256: a.sha256,
|
|
@@ -1375,7 +2170,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1375
2170
|
catch (e) {
|
|
1376
2171
|
if (this.closed)
|
|
1377
2172
|
throw new Error(CLOSED_DURING_LOAD, { cause: e });
|
|
1378
|
-
if (a.fatal)
|
|
2173
|
+
if (a.fatal && !a.isolated)
|
|
1379
2174
|
throw e;
|
|
1380
2175
|
return failSoft("setup_failed", e);
|
|
1381
2176
|
}
|
|
@@ -1391,6 +2186,8 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1391
2186
|
this.declaredActivations.set(name, a);
|
|
1392
2187
|
this.unloadedForDependency.delete(name);
|
|
1393
2188
|
const old = this.registry.activate(inst);
|
|
2189
|
+
if (old)
|
|
2190
|
+
this.isolatedAuthority.get(old)?.abort();
|
|
1394
2191
|
this.loggedFailures.delete(name);
|
|
1395
2192
|
await this.writeStatus({
|
|
1396
2193
|
...base,
|
|
@@ -1445,6 +2242,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1445
2242
|
configValid: this.configValidity.get(name) ??
|
|
1446
2243
|
(schema ? parseLoadGate(schema, this.extensionConfig[name] ?? {}).success : true),
|
|
1447
2244
|
displayName: this.declaredDisplayNames.get(name) ?? null,
|
|
2245
|
+
provides: extensionPointRefs(d.manifest.provides),
|
|
1448
2246
|
};
|
|
1449
2247
|
});
|
|
1450
2248
|
}
|
|
@@ -1455,66 +2253,60 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1455
2253
|
activatePending() {
|
|
1456
2254
|
return this.serial(() => this.activatePendingNow());
|
|
1457
2255
|
}
|
|
2256
|
+
revokeIsolatedInvocations(scope) {
|
|
2257
|
+
this.isolatedGrants.revoke(scope);
|
|
2258
|
+
for (const instance of this.registry.all()) {
|
|
2259
|
+
if (scope.plugin !== undefined && scope.plugin !== instance.name)
|
|
2260
|
+
continue;
|
|
2261
|
+
this.isolatedLanes.get(instance)?.revokeOrg(scope.orgId);
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
1458
2264
|
/**
|
|
1459
|
-
*
|
|
1460
|
-
* 1.
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
2265
|
+
* A committed grant revocation (the local fence after the commit, or a sibling's hint): this
|
|
2266
|
+
* replica's leases of the plugin revalidate now (plan task 1.3e).
|
|
2267
|
+
*/
|
|
2268
|
+
fenceRevocation(plugin) {
|
|
2269
|
+
return this.revisionLeases.fence(plugin);
|
|
2270
|
+
}
|
|
2271
|
+
/** The revocation decisions this replica's leases computed for a plugin's instances. */
|
|
2272
|
+
revocationDecisions(plugin) {
|
|
2273
|
+
// the computed decisions of every instance of the plugin on this replica
|
|
2274
|
+
return this.revisionLeases.statesOf(plugin);
|
|
2275
|
+
}
|
|
2276
|
+
refreshIsolatedOrgIntent(orgId) {
|
|
2277
|
+
return this.isolatedGrants.refreshOrgIntent(orgId);
|
|
2278
|
+
}
|
|
2279
|
+
revalidateIsolatedInvocations() {
|
|
2280
|
+
return this.isolatedGrants.revalidate();
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Publish approved policy expectations before doing work that might leave a handler temporarily
|
|
2284
|
+
* unavailable. Re-read after activation, which may have persisted new permission approvals.
|
|
1465
2285
|
*/
|
|
1466
2286
|
converge() {
|
|
1467
2287
|
return this.serial(async () => {
|
|
1468
|
-
await this.activatePendingNow();
|
|
1469
2288
|
const loader = this.installLoader;
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
await this.activatePendingNow();
|
|
2289
|
+
const desired = (await loader?.desired()) ?? [];
|
|
2290
|
+
await this.refreshPolicyExpectations(desired);
|
|
2291
|
+
await this.activatePendingNow();
|
|
2292
|
+
if (loader) {
|
|
2293
|
+
await this.applyInstalls(loader, desired, false);
|
|
2294
|
+
if (this.pendingActivations.size > 0)
|
|
2295
|
+
await this.activatePendingNow();
|
|
2296
|
+
void this.reportShadowStartGate();
|
|
2297
|
+
}
|
|
1480
2298
|
await this.refreshPolicyExpectations(desired);
|
|
1481
2299
|
});
|
|
1482
2300
|
}
|
|
1483
|
-
/**
|
|
1484
|
-
|
|
1485
|
-
* config-declared plugins and enabled installs (`desired`) from their approved permission snapshot.
|
|
1486
|
-
* `desired` undefined (install records unreadable) keeps the previous install entries.
|
|
1487
|
-
* `shrinkOnly`: only remove entries (a plugin no longer desired or approved), never add new ones.
|
|
1488
|
-
*/
|
|
1489
|
-
async refreshPolicyExpectations(desired, opts = {}) {
|
|
2301
|
+
/** Policy expectations follow approval and deployment state for every execution tier. */
|
|
2302
|
+
async refreshPolicyExpectations(desired) {
|
|
1490
2303
|
const snapshots = await this.approvals.all();
|
|
2304
|
+
const names = new Set([...this.declaredInfo.keys(), ...desired.map(({ name }) => name)]);
|
|
1491
2305
|
const next = new Map();
|
|
1492
|
-
const
|
|
1493
|
-
const mounts =
|
|
2306
|
+
for (const name of names) {
|
|
2307
|
+
const mounts = snapshots.get(name)?.permissions.permissions.policyHooks ?? [];
|
|
1494
2308
|
if (mounts.length > 0)
|
|
1495
2309
|
next.set(name, [...mounts]);
|
|
1496
|
-
};
|
|
1497
|
-
for (const name of this.declaredInfo.keys()) {
|
|
1498
|
-
add(name, snapshots.get(name)?.permissions);
|
|
1499
|
-
}
|
|
1500
|
-
const declared = this.declared();
|
|
1501
|
-
if (desired === undefined) {
|
|
1502
|
-
for (const [name, mounts] of this.policyExpected) {
|
|
1503
|
-
if (!this.declaredInfo.has(name))
|
|
1504
|
-
next.set(name, mounts);
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
else {
|
|
1508
|
-
for (const d of desired) {
|
|
1509
|
-
if (!declared.has(d.name))
|
|
1510
|
-
add(d.name, snapshots.get(d.name)?.permissions);
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
if (opts.shrinkOnly) {
|
|
1514
|
-
for (const name of [...next.keys()]) {
|
|
1515
|
-
if (!this.policyExpected.has(name))
|
|
1516
|
-
next.delete(name);
|
|
1517
|
-
}
|
|
1518
2310
|
}
|
|
1519
2311
|
this.policyExpected = next;
|
|
1520
2312
|
}
|
|
@@ -1662,8 +2454,9 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1662
2454
|
return this.registry.declared();
|
|
1663
2455
|
}
|
|
1664
2456
|
/**
|
|
1665
|
-
* Extensions enabled in the org:
|
|
1666
|
-
*
|
|
2457
|
+
* Extensions enabled in the org: the org intent projection
|
|
2458
|
+
* (required bootstrap plugins, builtin plugins' extensions; see `enabled.ts`); queried every
|
|
2459
|
+
* time, not cached.
|
|
1667
2460
|
* Cost (M-4): hooks call this on every run, so one PG query per model attempt and per tool call.
|
|
1668
2461
|
* Acceptable for now; if a cache is ever added, give it a short TTL so an org disabling a plugin
|
|
1669
2462
|
* takes effect quickly.
|
|
@@ -1671,23 +2464,12 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1671
2464
|
async enabledPlugins(orgId) {
|
|
1672
2465
|
return queryEnabledPlugins(this.deps.db, orgId);
|
|
1673
2466
|
}
|
|
1674
|
-
/**
|
|
1675
|
-
* The access behind an extension's `ctx.extensionPoints`: only active instances in the registry
|
|
1676
|
-
* (dependencies load in topological order, so the depended-on are ready first); org enablement is
|
|
1677
|
-
* read from `extension_org_configs` every time, not cached. Resolved live on every call: once a
|
|
1678
|
-
* provider is revoked it is no longer returned.
|
|
1679
|
-
*/
|
|
1680
|
-
extensionPointAccess = {
|
|
1681
|
-
providers: (ref) => this.registry
|
|
1682
|
-
.all()
|
|
1683
|
-
.flatMap((i) => i.provided.has(ref) ? [{ plugin: i.name, impl: i.provided.get(ref) }] : []),
|
|
1684
|
-
enabledPlugins: (orgId) => this.enabledPlugins(orgId),
|
|
1685
|
-
configOk: async (orgId, plugin) => (await this.effective.get(orgId, plugin)).ok,
|
|
1686
|
-
};
|
|
1687
2467
|
get loadDeps() {
|
|
1688
2468
|
return {
|
|
1689
2469
|
kernel: this.deps,
|
|
1690
|
-
|
|
2470
|
+
objectStore: () => this.registry
|
|
2471
|
+
.list("object-store")
|
|
2472
|
+
.find((entry) => entry.capability === OBJECT_STORE_EXTENSION_POINT)?.impl,
|
|
1691
2473
|
nextGeneration: (name) => {
|
|
1692
2474
|
const g = (this.generations.get(name) ?? 0) + 1;
|
|
1693
2475
|
this.generations.set(name, g);
|
|
@@ -1697,28 +2479,152 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1697
2479
|
};
|
|
1698
2480
|
}
|
|
1699
2481
|
/**
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
1702
|
-
* 配置声明的插件启动时不设时限(见 {@link load})。
|
|
2482
|
+
* Build a new generation. Track its context during setup so shutdown can close it immediately.
|
|
2483
|
+
* A reload deadline closes incomplete setup and any late instance that reaches registration.
|
|
1703
2484
|
*/
|
|
1704
2485
|
async setup(spec, timeoutMs) {
|
|
1705
2486
|
if (this.imports.record(spec.manifest.name, spec.entryUrl)) {
|
|
1706
2487
|
warnUpgrades(this.log, this.imports);
|
|
1707
2488
|
}
|
|
1708
2489
|
let ctx;
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
if (
|
|
1720
|
-
|
|
1721
|
-
|
|
2490
|
+
let active;
|
|
2491
|
+
let lanes;
|
|
2492
|
+
const authority = spec.isolated ? new AbortController() : undefined;
|
|
2493
|
+
const name = spec.manifest.name;
|
|
2494
|
+
const identity = this.dbIdentity.resolve(name);
|
|
2495
|
+
const extensionDb = extensionDbPool(identity, name, this.config.get().db, (err) => this.log.warn("extension database pool error", { plugin: name, err }));
|
|
2496
|
+
const p = (async () => {
|
|
2497
|
+
let manifest = spec.manifest;
|
|
2498
|
+
if (spec.isolated && authority) {
|
|
2499
|
+
const isolation = this.config.get().extensionHost.isolation;
|
|
2500
|
+
if (!isolation)
|
|
2501
|
+
throw new Error("The isolated extension supervisor is not configured");
|
|
2502
|
+
let quota = this.quota.get(name);
|
|
2503
|
+
if (!quota) {
|
|
2504
|
+
quota = new IsolatedExtensionQuota(() => this.capacity());
|
|
2505
|
+
this.quota.set(name, quota);
|
|
2506
|
+
}
|
|
2507
|
+
this.usageFlusher.start();
|
|
2508
|
+
const revision = spec.sha256 ?? spec.entryUrl;
|
|
2509
|
+
const observer = new IsolationObserver(name, revision, this.orgLabels.label, this.usageCounters);
|
|
2510
|
+
const modules = this.modules;
|
|
2511
|
+
const db = kernelDb(this.deps.db);
|
|
2512
|
+
const current = () => active !== undefined &&
|
|
2513
|
+
!authority.signal.aborted &&
|
|
2514
|
+
!this.closed &&
|
|
2515
|
+
this.registry.current(name) === active;
|
|
2516
|
+
const authorize = (orgId) => {
|
|
2517
|
+
if (!current())
|
|
2518
|
+
return Promise.resolve(undefined);
|
|
2519
|
+
const scope = orgId === undefined ? { plugin: name } : { plugin: name, orgId };
|
|
2520
|
+
const check = async () => current() &&
|
|
2521
|
+
(await readIsolatedGrant(db, {
|
|
2522
|
+
plugin: name,
|
|
2523
|
+
installedSha: spec.source === "install" ? spec.sha256 : undefined,
|
|
2524
|
+
permissions: spec.permissions,
|
|
2525
|
+
orgId,
|
|
2526
|
+
})) &&
|
|
2527
|
+
current();
|
|
2528
|
+
return this.isolatedGrants.issue(scope, () => (orgId === undefined ? check() : withOrgScope(orgId, check)), () => lanes?.revokeOrg(orgId), authority.signal);
|
|
2529
|
+
};
|
|
2530
|
+
const declared = spec.manifest.permissions?.network ?? [];
|
|
2531
|
+
manifest = await isolatedRevision({
|
|
2532
|
+
manifest,
|
|
2533
|
+
revision,
|
|
2534
|
+
observer,
|
|
2535
|
+
section: spec.isolated.section,
|
|
2536
|
+
grant: await this.isolatedGrantFor(spec),
|
|
2537
|
+
identity,
|
|
2538
|
+
sandbox: {
|
|
2539
|
+
engineUrl: isolation.engineUrl,
|
|
2540
|
+
image: isolation.image,
|
|
2541
|
+
postgresSocket: isolation.postgresSocket,
|
|
2542
|
+
packageRoot: spec.isolated.root,
|
|
2543
|
+
},
|
|
2544
|
+
socketDir: isolation.socketDir,
|
|
2545
|
+
runtimeUrl: this.config.get().db.url,
|
|
2546
|
+
signal: AbortSignal.any([this.abort.signal, authority.signal]),
|
|
2547
|
+
quota,
|
|
2548
|
+
onLanes: (value) => {
|
|
2549
|
+
lanes = value;
|
|
2550
|
+
},
|
|
2551
|
+
onCrash: (retryAfterMs, cause) => {
|
|
2552
|
+
const exited = cause === "exited";
|
|
2553
|
+
this.log.warn(exited
|
|
2554
|
+
? "Isolated extension sandbox exited unexpectedly"
|
|
2555
|
+
: "Isolated extension sandbox failed to start", { plugin: name, retryAfterMs });
|
|
2556
|
+
void this.status
|
|
2557
|
+
.note(name, exited
|
|
2558
|
+
? `Isolated sandbox crashed. Retry is delayed by ${retryAfterMs} ms.`
|
|
2559
|
+
: `Isolated sandbox failed to start. Retry is delayed by ${retryAfterMs} ms.`)
|
|
2560
|
+
.catch(() => { });
|
|
2561
|
+
},
|
|
2562
|
+
cleanupFault: () => {
|
|
2563
|
+
this.log.error("Isolated extension sandbox removal could not be confirmed", {
|
|
2564
|
+
plugin: name,
|
|
2565
|
+
});
|
|
2566
|
+
void this.status
|
|
2567
|
+
.note(name, "Isolated sandbox cleanup could not be confirmed")
|
|
2568
|
+
.catch(() => { });
|
|
2569
|
+
},
|
|
2570
|
+
rls: this.config.get().db.rls,
|
|
2571
|
+
roles: this.config.get().roles,
|
|
2572
|
+
effective: (orgId) => this.effective.get(orgId, name),
|
|
2573
|
+
authorize,
|
|
2574
|
+
broker: {
|
|
2575
|
+
plugin: name,
|
|
2576
|
+
current,
|
|
2577
|
+
effects: () => {
|
|
2578
|
+
if (!modules)
|
|
2579
|
+
throw new Error("Extension effects are unavailable");
|
|
2580
|
+
return modules.get(ExtensionEffects, { strict: false });
|
|
2581
|
+
},
|
|
2582
|
+
keys: () => {
|
|
2583
|
+
if (!modules)
|
|
2584
|
+
throw new Error("Extension effect keys are unavailable");
|
|
2585
|
+
return modules.get(ExtensionEffectKeys, { strict: false });
|
|
2586
|
+
},
|
|
2587
|
+
network: async (url, orgId) => {
|
|
2588
|
+
const approved = (value) => value === url.hostname || value === url.origin;
|
|
2589
|
+
if (declared.some(approved))
|
|
2590
|
+
return true;
|
|
2591
|
+
if (orgId === undefined)
|
|
2592
|
+
return false;
|
|
2593
|
+
const policy = await this.allowances.policyFor(orgId);
|
|
2594
|
+
return (policy.trustedOrigins.some(approved) || policy.allowPrivateHosts.some(approved));
|
|
2595
|
+
},
|
|
2596
|
+
},
|
|
2597
|
+
});
|
|
2598
|
+
}
|
|
2599
|
+
if (!identity.separate) {
|
|
2600
|
+
await ensureLocalExtensionHandoff(this.deps.db, this.deps.dbUrl, pluginSchemaName(name), this.deps.connectTimeoutMs);
|
|
2601
|
+
}
|
|
2602
|
+
active = await setupInstance(this.loadDeps, manifest, {
|
|
2603
|
+
entryUrl: spec.entryUrl,
|
|
2604
|
+
source: spec.source,
|
|
2605
|
+
sha256: spec.sha256,
|
|
2606
|
+
config: spec.config,
|
|
2607
|
+
configHash: spec.configHash,
|
|
2608
|
+
permissions: spec.permissions,
|
|
2609
|
+
extensionDb,
|
|
2610
|
+
inProcess: !spec.isolated,
|
|
2611
|
+
onCtx: (c) => {
|
|
2612
|
+
if (c)
|
|
2613
|
+
ctx = c;
|
|
2614
|
+
if (c || this.settingUp === ctx)
|
|
2615
|
+
this.settingUp = c;
|
|
2616
|
+
},
|
|
2617
|
+
});
|
|
2618
|
+
if (authority)
|
|
2619
|
+
this.isolatedAuthority.set(active, authority);
|
|
2620
|
+
if (lanes)
|
|
2621
|
+
this.isolatedLanes.set(active, lanes);
|
|
2622
|
+
return active;
|
|
2623
|
+
})().catch(async (error) => {
|
|
2624
|
+
authority?.abort();
|
|
2625
|
+
if (!ctx)
|
|
2626
|
+
await extensionDb.destroy();
|
|
2627
|
+
throw error;
|
|
1722
2628
|
});
|
|
1723
2629
|
if (timeoutMs === undefined)
|
|
1724
2630
|
return p.then((inst) => this.logUiResolution(inst));
|
|
@@ -1762,9 +2668,6 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1762
2668
|
if (inst.uiUnknownAnchors.length > 0) {
|
|
1763
2669
|
this.log.warn("plugin ui anchors unknown", { ...at, anchors: inst.uiUnknownAnchors });
|
|
1764
2670
|
}
|
|
1765
|
-
if (inst.uiDeprecatedPlace.length > 0) {
|
|
1766
|
-
this.log.info("plugin ui uses the deprecated place", { ...at, ids: inst.uiDeprecatedPlace });
|
|
1767
|
-
}
|
|
1768
2671
|
return inst;
|
|
1769
2672
|
}
|
|
1770
2673
|
/** 取能力实现:单选能力无需 providerName,多选能力必须指定。 */
|
|
@@ -1822,7 +2725,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1822
2725
|
const m = this.registry.current(plugin)?.manifest ??
|
|
1823
2726
|
this.declaredInfo.get(plugin)?.manifest ??
|
|
1824
2727
|
this.importedManifests.get(plugin)?.manifest;
|
|
1825
|
-
return m && { version: m.version, schema: m.config?.deployment };
|
|
2728
|
+
return m && { version: m.version, schema: m.config?.deployment, provides: m.provides };
|
|
1826
2729
|
}
|
|
1827
2730
|
/** 在本副本生效、声明了部署级配置的插件。 */
|
|
1828
2731
|
configurablePlugins() {
|
|
@@ -1969,7 +2872,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
1969
2872
|
if (declared)
|
|
1970
2873
|
this.pendingActivations.set(p.plugin, { ...declared, fatal: false });
|
|
1971
2874
|
}
|
|
1972
|
-
this.
|
|
2875
|
+
this.configReported.set(p.plugin, `warn:${detail}`);
|
|
1973
2876
|
this.log.warn(message, { plugin: p.plugin, source: p.source, detail });
|
|
1974
2877
|
await this.writeStatus({ ...p, state: "pending", reason: "config", detail });
|
|
1975
2878
|
}
|
|
@@ -2103,6 +3006,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2103
3006
|
plugin: i.name,
|
|
2104
3007
|
spec: t.spec,
|
|
2105
3008
|
handler: t.handler,
|
|
3009
|
+
...(t.watch !== undefined && { watch: t.watch }),
|
|
2106
3010
|
inflight: i.inflight,
|
|
2107
3011
|
})));
|
|
2108
3012
|
}
|
|
@@ -2116,6 +3020,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2116
3020
|
const served = c.kind === "view" || c.kind === "component";
|
|
2117
3021
|
const render = served ? i.uiViews.get(c.id) : undefined;
|
|
2118
3022
|
const action = served ? i.uiActions.get(c.id) : undefined;
|
|
3023
|
+
const query = c.kind === "component" ? i.uiQueries.get(c.id) : undefined;
|
|
2119
3024
|
return {
|
|
2120
3025
|
plugin: i.name,
|
|
2121
3026
|
contribution: c,
|
|
@@ -2123,6 +3028,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2123
3028
|
...(after !== undefined && { after }),
|
|
2124
3029
|
...(render !== undefined && { render }),
|
|
2125
3030
|
...(action !== undefined && { action }),
|
|
3031
|
+
...(query !== undefined && { query }),
|
|
2126
3032
|
};
|
|
2127
3033
|
}));
|
|
2128
3034
|
}
|
|
@@ -2180,6 +3086,7 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2180
3086
|
const inst = this.registry.deactivate(plugin);
|
|
2181
3087
|
if (!inst)
|
|
2182
3088
|
return undefined;
|
|
3089
|
+
this.isolatedAuthority.get(inst)?.abort();
|
|
2183
3090
|
if (reason === "dependency")
|
|
2184
3091
|
this.unloadedForDependency.add(plugin);
|
|
2185
3092
|
else
|
|
@@ -2197,6 +3104,22 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2197
3104
|
this.log.info("plugin unloaded", { plugin, generation: inst.generation, reason });
|
|
2198
3105
|
return inst;
|
|
2199
3106
|
}
|
|
3107
|
+
async assertCurrentInstall(spec) {
|
|
3108
|
+
const name = spec.manifest.name;
|
|
3109
|
+
const loader = this.installLoader;
|
|
3110
|
+
const revision = loader && (await loader.desired()).find((d) => d.name === name);
|
|
3111
|
+
if (!loader || !revision || revision.sha256 !== spec.sha256) {
|
|
3112
|
+
throw new Error("The cached extension revision is no longer desired");
|
|
3113
|
+
}
|
|
3114
|
+
const tier = await this.tierOf(loader, revision, true);
|
|
3115
|
+
if (tier !== (spec.isolated ? "isolated" : "trusted")) {
|
|
3116
|
+
throw new Error("The cached extension revision no longer passes trust admission");
|
|
3117
|
+
}
|
|
3118
|
+
const snapshots = await this.approvals.all();
|
|
3119
|
+
if (!snapshotCovers(snapshots.get(name), spec.permissions)) {
|
|
3120
|
+
throw new Error("The cached extension revision no longer has its approved permissions");
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
2200
3123
|
/** 新建实例并原子替换、撤销旧实例(不做连锁)。 */
|
|
2201
3124
|
async doReload(plugin, drainMs) {
|
|
2202
3125
|
if (this.closed)
|
|
@@ -2204,6 +3127,8 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2204
3127
|
const spec = this.specs.get(plugin);
|
|
2205
3128
|
if (!spec)
|
|
2206
3129
|
throw new Error(`plugin ${plugin} has never been loaded in this process`);
|
|
3130
|
+
if (spec.source === "install")
|
|
3131
|
+
await this.assertCurrentInstall(spec);
|
|
2207
3132
|
const available = new Set(this.registry
|
|
2208
3133
|
.all()
|
|
2209
3134
|
.filter((i) => i.name !== plugin)
|
|
@@ -2219,6 +3144,8 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2219
3144
|
}
|
|
2220
3145
|
this.unloadedForDependency.delete(plugin);
|
|
2221
3146
|
const old = this.registry.activate(inst);
|
|
3147
|
+
if (old)
|
|
3148
|
+
this.isolatedAuthority.get(old)?.abort();
|
|
2222
3149
|
await this.writeStatus({
|
|
2223
3150
|
plugin,
|
|
2224
3151
|
version: inst.version,
|
|
@@ -2341,7 +3268,13 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2341
3268
|
*/
|
|
2342
3269
|
async close(opts = {}) {
|
|
2343
3270
|
this.closed = true;
|
|
3271
|
+
this.grantEpoch.stop();
|
|
3272
|
+
this.unobserveEpochLag();
|
|
3273
|
+
await this.epochReader
|
|
3274
|
+
.close()
|
|
3275
|
+
.catch((err) => this.log.warn("closing the grant epoch connection failed", { err }));
|
|
2344
3276
|
this.abort.abort();
|
|
3277
|
+
this.revokeIsolatedInvocations({});
|
|
2345
3278
|
await this.migrating?.catch(() => { });
|
|
2346
3279
|
const lifecycleWaitMs = opts.lifecycleWaitMs ?? CLOSE_LIFECYCLE_WAIT_MS;
|
|
2347
3280
|
await waitWithin(this.lifecycle.catch(() => { }), lifecycleWaitMs);
|
|
@@ -2372,6 +3305,20 @@ let ExtensionHost = class ExtensionHost {
|
|
|
2372
3305
|
this.log.error("plugin close failed", { plugin: inst.name, err: e });
|
|
2373
3306
|
}
|
|
2374
3307
|
}
|
|
3308
|
+
// Every isolated call has ended: book and flush this replica's last usage increments.
|
|
3309
|
+
await this.usageFlusher.stop();
|
|
3310
|
+
}
|
|
3311
|
+
/**
|
|
3312
|
+
* The resolved `extensionHost.capacity` (preset plus explicit fields), read at every isolated
|
|
3313
|
+
* admission and lane start so hot fields apply at once. Invalid fields fell back to the preset
|
|
3314
|
+
* when the config was parsed; the config service logs them.
|
|
3315
|
+
*/
|
|
3316
|
+
capacity() {
|
|
3317
|
+
const from = this.config.get().extensionHost?.capacity;
|
|
3318
|
+
if (this.capacityCache?.from !== from || this.capacityCache === undefined) {
|
|
3319
|
+
this.capacityCache = { from, limits: resolveCapacity(from) };
|
|
3320
|
+
}
|
|
3321
|
+
return this.capacityCache.limits;
|
|
2375
3322
|
}
|
|
2376
3323
|
};
|
|
2377
3324
|
ExtensionHost = __decorate([
|
|
@@ -2386,10 +3333,24 @@ ExtensionHost = __decorate([
|
|
|
2386
3333
|
__param(7, Inject(REDIS_SUBSCRIBER)),
|
|
2387
3334
|
__param(8, Inject(KEYRING)),
|
|
2388
3335
|
__param(9, Inject(EmbedTokens)),
|
|
2389
|
-
__param(10, Inject(
|
|
2390
|
-
__param(11, Inject(
|
|
2391
|
-
__param(12, Inject(
|
|
2392
|
-
__param(13, Inject(
|
|
2393
|
-
__param(14, Inject(
|
|
3336
|
+
__param(10, Inject(ShareLiveness)),
|
|
3337
|
+
__param(11, Inject(LockService)),
|
|
3338
|
+
__param(12, Inject(KERNEL_LOGGER)),
|
|
3339
|
+
__param(13, Inject(KERNEL_APP_OPTIONS)),
|
|
3340
|
+
__param(14, Inject(EffectiveConfigs)),
|
|
3341
|
+
__param(15, Inject(ModelEmbeddings)),
|
|
3342
|
+
__param(16, Inject(ModelImages)),
|
|
3343
|
+
__param(17, Inject(OrgNetworkAllowances)),
|
|
3344
|
+
__param(18, Inject(DialInAccess)),
|
|
3345
|
+
__param(19, Inject(DeviceReports)),
|
|
3346
|
+
__param(20, Optional()),
|
|
3347
|
+
__param(20, Inject(ModuleRef)),
|
|
3348
|
+
__param(21, Optional()),
|
|
3349
|
+
__param(21, Inject(EXTENSION_NET_SEAMS)),
|
|
3350
|
+
__param(22, Inject(ConfiguredExtensionDbIdentity)),
|
|
3351
|
+
__param(23, Optional()),
|
|
3352
|
+
__param(23, Inject(ExtensionRevisionApprovals)),
|
|
3353
|
+
__param(24, Optional()),
|
|
3354
|
+
__param(24, Inject(REVOCATION_ENFORCEMENT))
|
|
2394
3355
|
], ExtensionHost);
|
|
2395
3356
|
export { ExtensionHost };
|