@jini-ai/core 0.7.3-next.2 → 0.7.4
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/CHANGELOG.md +7 -0
- package/README.md +68 -0
- package/dist/admin-runtime/admin-http.d.ts +43 -0
- package/dist/admin-runtime/admin-http.js +11 -0
- package/dist/admin-runtime/index.d.ts +1 -0
- package/dist/batch-tool-inputs.d.ts +3 -3
- package/dist/batch-tool-inputs.js +18 -6
- package/dist/config/env-schema.d.ts +31 -0
- package/dist/config/env-schema.js +29 -0
- package/dist/contracts/agents/definition.d.ts +9 -1
- package/dist/contracts/agents/index.d.ts +1 -0
- package/dist/contracts/agents/inventory.d.ts +29 -0
- package/dist/contracts/agents/inventory.js +8 -0
- package/dist/contracts/agents/provider-ports.d.ts +117 -0
- package/dist/contracts/agents/provider-ports.js +2 -0
- package/dist/contracts/agents/proxy-provider-kit.d.ts +122 -0
- package/dist/contracts/agents/proxy-provider-kit.js +119 -0
- package/dist/contracts/agents/proxy-provider.d.ts +34 -0
- package/dist/contracts/agents/proxy-provider.js +2 -0
- package/dist/contracts/blob-gc.d.ts +69 -0
- package/dist/contracts/blob-gc.js +13 -0
- package/dist/contracts/credentials.d.ts +5 -19
- package/dist/contracts/desktop-zoom.d.ts +7 -0
- package/dist/contracts/desktop-zoom.js +6 -0
- package/dist/contracts/events/change-set.d.ts +12 -3
- package/dist/contracts/events/command.d.ts +11 -5
- package/dist/contracts/events/ports.d.ts +38 -0
- package/dist/contracts/events/ports.js +8 -1
- package/dist/contracts/events.d.ts +2 -1
- package/dist/contracts/events.js +1 -1
- package/dist/contracts/execution.d.ts +541 -0
- package/dist/contracts/execution.js +2 -0
- package/dist/contracts/find-in-page.d.ts +12 -0
- package/dist/contracts/find-in-page.js +7 -0
- package/dist/contracts/headless/chart-providers.d.ts +12 -0
- package/dist/contracts/headless/chart-providers.js +2 -0
- package/dist/contracts/headless/chat-attachment.d.ts +21 -0
- package/dist/contracts/headless/chat-attachment.js +9 -0
- package/dist/contracts/headless/contracts.d.ts +179 -0
- package/dist/contracts/headless/contracts.js +2 -0
- package/dist/contracts/headless/form-delivery-status.d.ts +35 -0
- package/dist/contracts/headless/form-delivery-status.js +2 -0
- package/dist/contracts/headless/member-login.d.ts +3 -0
- package/dist/contracts/headless/member-login.js +3 -0
- package/dist/contracts/headless/operator-locale.d.ts +17 -0
- package/dist/contracts/headless/operator-locale.js +2 -0
- package/dist/contracts/headless/plugin-export-catalog.d.ts +21 -0
- package/dist/contracts/headless/plugin-export-catalog.js +2 -0
- package/dist/contracts/headless/plugin-host.d.ts +128 -0
- package/dist/contracts/headless/plugin-host.js +2 -0
- package/dist/contracts/headless/plugin-install-source.d.ts +82 -0
- package/dist/contracts/headless/plugin-install-source.js +12 -0
- package/dist/contracts/headless/site-cookie-consent.d.ts +41 -0
- package/dist/contracts/headless/site-cookie-consent.js +2 -0
- package/dist/contracts/hosted-mcp/admissions.d.ts +125 -0
- package/dist/contracts/hosted-mcp/admissions.js +3 -0
- package/dist/contracts/hosted-mcp/record.d.ts +9 -3
- package/dist/contracts/hosted-mcp.d.ts +1 -0
- package/dist/contracts/mail.d.ts +28 -2
- package/dist/contracts/mail.js +3 -0
- package/dist/contracts/observability.d.ts +12 -0
- package/dist/contracts/run-attempt.d.ts +14 -0
- package/dist/contracts/run-attempt.js +7 -0
- package/dist/contracts/server/api-error.js +1 -0
- package/dist/contracts/server/client-facing-error.d.ts +25 -0
- package/dist/contracts/server/client-facing-error.js +21 -0
- package/dist/contracts/server/deferred-body.d.ts +65 -0
- package/dist/contracts/server/deferred-body.js +2 -0
- package/dist/contracts/server/failure-copy.d.ts +19 -0
- package/dist/contracts/server/failure-copy.js +26 -0
- package/dist/contracts/server/json-route.d.ts +52 -26
- package/dist/contracts/server/json-route.js +128 -32
- package/dist/contracts/server/request-body.d.ts +12 -0
- package/dist/contracts/server/request-body.js +8 -4
- package/dist/contracts/server/route-reply.d.ts +32 -0
- package/dist/contracts/server/route-reply.js +26 -0
- package/dist/contracts/server.d.ts +4 -0
- package/dist/contracts/server.js +4 -0
- package/dist/contracts/site/admin-sites.d.ts +134 -0
- package/dist/contracts/site/admin-sites.js +7 -0
- package/dist/contracts/site/admin-surfaces-connections.d.ts +128 -0
- package/dist/contracts/site/admin-surfaces-connections.js +2 -0
- package/dist/contracts/site/agent-plugins-admin-surfaces.d.ts +218 -0
- package/dist/contracts/site/agent-plugins-admin-surfaces.js +2 -0
- package/dist/contracts/site/agent-plugins-connect.d.ts +25 -0
- package/dist/contracts/site/agent-plugins-connect.js +2 -0
- package/dist/contracts/site/agent-plugins-lifecycle.d.ts +151 -0
- package/dist/contracts/site/agent-plugins-lifecycle.js +2 -0
- package/dist/contracts/site/agent-plugins-manifest.d.ts +41 -0
- package/dist/contracts/site/agent-plugins-manifest.js +11 -0
- package/dist/contracts/site/agent-runtime.d.ts +110 -0
- package/dist/contracts/site/agent-runtime.js +2 -0
- package/dist/contracts/site/agentic-core.d.ts +44 -0
- package/dist/contracts/site/agentic-core.js +9 -0
- package/dist/contracts/site/agentic-dom.d.ts +27 -0
- package/dist/contracts/site/agentic-dom.js +2 -0
- package/dist/contracts/site/agentic.d.ts +37 -0
- package/dist/contracts/site/agentic.js +8 -0
- package/dist/contracts/site/analytics.d.ts +81 -0
- package/dist/contracts/site/analytics.js +2 -0
- package/dist/contracts/site/api-ai-assistant-api-types.d.ts +182 -0
- package/dist/contracts/site/api-ai-assistant-api-types.js +2 -0
- package/dist/contracts/site/api-connections-hosted-mcp.d.ts +176 -0
- package/dist/contracts/site/api-connections-hosted-mcp.js +2 -0
- package/dist/contracts/site/api-security-api-types.d.ts +177 -0
- package/dist/contracts/site/api-security-api-types.js +2 -0
- package/dist/contracts/site/approval-i18n.d.ts +32 -0
- package/dist/contracts/site/approval-i18n.js +156 -0
- package/dist/contracts/site/asset-transfer-tool-ports.d.ts +54 -0
- package/dist/contracts/site/asset-transfer-tool-ports.js +2 -0
- package/dist/contracts/site/assistant-host-ports.d.ts +23 -0
- package/dist/contracts/site/assistant-host-ports.js +2 -0
- package/dist/contracts/site/assistant-mcp-services.d.ts +26 -0
- package/dist/contracts/site/assistant-mcp-services.js +8 -0
- package/dist/contracts/site/assistant-tool-contributions.d.ts +45 -0
- package/dist/contracts/site/assistant-tool-contributions.js +2 -0
- package/dist/contracts/site/chat-core.d.ts +93 -0
- package/dist/contracts/site/chat-core.js +13 -0
- package/dist/contracts/site/client-directives.d.ts +21 -0
- package/dist/contracts/site/client-directives.js +8 -0
- package/dist/contracts/site/cms-admin-media.d.ts +61 -0
- package/dist/contracts/site/cms-admin-media.js +7 -0
- package/dist/contracts/site/cms-agent-plugins.d.ts +114 -0
- package/dist/contracts/site/cms-agent-plugins.js +17 -0
- package/dist/contracts/site/cms-assistant.d.ts +74 -0
- package/dist/contracts/site/cms-assistant.js +17 -0
- package/dist/contracts/site/cms-core.d.ts +17 -0
- package/dist/contracts/site/cms-core.js +12 -0
- package/dist/contracts/site/cms-external-mcp.d.ts +206 -0
- package/dist/contracts/site/cms-external-mcp.js +13 -0
- package/dist/contracts/site/cms-forms.d.ts +192 -0
- package/dist/contracts/site/cms-forms.js +15 -0
- package/dist/contracts/site/cms-integrations.d.ts +47 -0
- package/dist/contracts/site/cms-integrations.js +8 -0
- package/dist/contracts/site/cms-mail.d.ts +39 -0
- package/dist/contracts/site/cms-mail.js +12 -0
- package/dist/contracts/site/cms-media.d.ts +464 -0
- package/dist/contracts/site/cms-media.js +3 -0
- package/dist/contracts/site/cms-menus.d.ts +109 -0
- package/dist/contracts/site/cms-menus.js +13 -0
- package/dist/contracts/site/cms-plugins.d.ts +81 -0
- package/dist/contracts/site/cms-plugins.js +13 -0
- package/dist/contracts/site/cms-publish-content.d.ts +129 -0
- package/dist/contracts/site/cms-publish-content.js +13 -0
- package/dist/contracts/site/cms-recovery.d.ts +37 -0
- package/dist/contracts/site/cms-recovery.js +13 -0
- package/dist/contracts/site/cms-seo.d.ts +124 -0
- package/dist/contracts/site/cms-seo.js +17 -0
- package/dist/contracts/site/cms-settings.d.ts +47 -0
- package/dist/contracts/site/cms-settings.js +15 -0
- package/dist/contracts/site/cms-sites.d.ts +24 -0
- package/dist/contracts/site/cms-sites.js +12 -0
- package/dist/contracts/site/cms-system-deploy.d.ts +37 -0
- package/dist/contracts/site/cms-system-deploy.js +9 -0
- package/dist/contracts/site/cms-trash.d.ts +235 -0
- package/dist/contracts/site/cms-trash.js +10 -0
- package/dist/contracts/site/cms-workspace.d.ts +14 -0
- package/dist/contracts/site/cms-workspace.js +7 -0
- package/dist/contracts/site/comments-providers.d.ts +187 -0
- package/dist/contracts/site/comments-providers.js +2 -0
- package/dist/contracts/site/commerce.d.ts +35 -0
- package/dist/contracts/site/commerce.js +12 -0
- package/dist/contracts/site/composition-provider-config-source.d.ts +46 -0
- package/dist/contracts/site/composition-provider-config-source.js +2 -0
- package/dist/contracts/site/content-editor-ports.d.ts +239 -0
- package/dist/contracts/site/content-editor-ports.js +2 -0
- package/dist/contracts/site/contracts-resources.d.ts +21 -0
- package/dist/contracts/site/contracts-resources.js +7 -0
- package/dist/contracts/site/cookie-consent-react.d.ts +44 -0
- package/dist/contracts/site/cookie-consent-react.js +8 -0
- package/dist/contracts/site/cookie-consent.d.ts +100 -0
- package/dist/contracts/site/cookie-consent.js +9 -0
- package/dist/contracts/site/core-commands.d.ts +66 -0
- package/dist/contracts/site/core-commands.js +15 -0
- package/dist/contracts/site/core-consent-refusal.d.ts +7 -0
- package/dist/contracts/site/core-consent-refusal.js +2 -0
- package/dist/contracts/site/core-custom-credential-categories.d.ts +14 -0
- package/dist/contracts/site/core-custom-credential-categories.js +7 -0
- package/dist/contracts/site/core-public-page-security-headers.d.ts +13 -0
- package/dist/contracts/site/core-public-page-security-headers.js +3 -0
- package/dist/contracts/site/core-run-events.d.ts +49 -0
- package/dist/contracts/site/core-run-events.js +11 -0
- package/dist/contracts/site/core-runtime-mode.d.ts +9 -0
- package/dist/contracts/site/core-runtime-mode.js +2 -0
- package/dist/contracts/site/core-theme-slots.d.ts +31 -0
- package/dist/contracts/site/core-theme-slots.js +3 -0
- package/dist/contracts/site/credential-project-half.d.ts +18 -0
- package/dist/contracts/site/credential-project-half.js +2 -0
- package/dist/contracts/site/custom-credential-publish-compatibility.d.ts +11 -0
- package/dist/contracts/site/custom-credential-publish-compatibility.js +2 -0
- package/dist/contracts/site/daemon-core-rpc.d.ts +114 -0
- package/dist/contracts/site/daemon-core-rpc.js +2 -0
- package/dist/contracts/site/daemon-http.d.ts +197 -0
- package/dist/contracts/site/daemon-http.js +11 -0
- package/dist/contracts/site/daemon-surface-exchanges.d.ts +46 -0
- package/dist/contracts/site/daemon-surface-exchanges.js +2 -0
- package/dist/contracts/site/daemon-tool-audit.d.ts +43 -0
- package/dist/contracts/site/daemon-tool-audit.js +9 -0
- package/dist/contracts/site/daemon-tool-recovery.d.ts +36 -0
- package/dist/contracts/site/daemon-tool-recovery.js +9 -0
- package/dist/contracts/site/daemon.d.ts +45 -0
- package/dist/contracts/site/daemon.js +2 -0
- package/dist/contracts/site/database-introspection.d.ts +46 -0
- package/dist/contracts/site/database-introspection.js +2 -0
- package/dist/contracts/site/db-data-modules.d.ts +61 -0
- package/dist/contracts/site/db-data-modules.js +6 -0
- package/dist/contracts/site/deployment-admin.d.ts +74 -0
- package/dist/contracts/site/deployment-admin.js +2 -0
- package/dist/contracts/site/dev-supervisor-dev-restart.d.ts +26 -0
- package/dist/contracts/site/dev-supervisor-dev-restart.js +10 -0
- package/dist/contracts/site/devops-deploy.d.ts +77 -0
- package/dist/contracts/site/devops-deploy.js +9 -0
- package/dist/contracts/site/diagnostics-domain-dns.d.ts +10 -0
- package/dist/contracts/site/diagnostics-domain-dns.js +7 -0
- package/dist/contracts/site/diagnostics-observability.d.ts +66 -0
- package/dist/contracts/site/diagnostics-observability.js +2 -0
- package/dist/contracts/site/events-outbox.d.ts +56 -0
- package/dist/contracts/site/events-outbox.js +10 -0
- package/dist/contracts/site/export-run.d.ts +54 -0
- package/dist/contracts/site/export-run.js +9 -0
- package/dist/contracts/site/external-mcp-tool-ports.d.ts +30 -0
- package/dist/contracts/site/external-mcp-tool-ports.js +2 -0
- package/dist/contracts/site/fs-durable-json.d.ts +22 -0
- package/dist/contracts/site/fs-durable-json.js +7 -0
- package/dist/contracts/site/gated-mutations/watermark.d.ts +44 -0
- package/dist/contracts/site/gated-mutations/watermark.js +37 -0
- package/dist/contracts/site/gated-mutations-ports.d.ts +45 -0
- package/dist/contracts/site/gated-mutations-ports.js +6 -0
- package/dist/contracts/site/gated-results.d.ts +17 -0
- package/dist/contracts/site/gated-results.js +8 -0
- package/dist/contracts/site/headless-assistant-permanent-deletes-policy.d.ts +16 -0
- package/dist/contracts/site/headless-assistant-permanent-deletes-policy.js +8 -0
- package/dist/contracts/site/hooks-sites-port-hooks.d.ts +151 -0
- package/dist/contracts/site/hooks-sites-port-hooks.js +7 -0
- package/dist/contracts/site/host-node.d.ts +213 -0
- package/dist/contracts/site/host-node.js +2 -0
- package/dist/contracts/site/html-region-ports.d.ts +103 -0
- package/dist/contracts/site/html-region-ports.js +2 -0
- package/dist/contracts/site/http-kit-rate-limit.d.ts +21 -0
- package/dist/contracts/site/http-kit-rate-limit.js +8 -0
- package/dist/contracts/site/http-kit-settings.d.ts +12 -0
- package/dist/contracts/site/http-kit-settings.js +8 -0
- package/dist/contracts/site/human-confirm.d.ts +42 -0
- package/dist/contracts/site/human-confirm.js +2 -0
- package/dist/contracts/site/installed-skill.d.ts +16 -0
- package/dist/contracts/site/installed-skill.js +2 -0
- package/dist/contracts/site/integrations-api-connections.d.ts +19 -0
- package/dist/contracts/site/integrations-api-connections.js +7 -0
- package/dist/contracts/site/integrations-credentialed-http.d.ts +16 -0
- package/dist/contracts/site/integrations-credentialed-http.js +8 -0
- package/dist/contracts/site/legacy-owner-store.d.ts +15 -0
- package/dist/contracts/site/legacy-owner-store.js +5 -0
- package/dist/contracts/site/lifecycle-boot-lifecycle.d.ts +27 -0
- package/dist/contracts/site/lifecycle-boot-lifecycle.js +10 -0
- package/dist/contracts/site/lifecycle-host-tools.d.ts +64 -0
- package/dist/contracts/site/lifecycle-host-tools.js +2 -0
- package/dist/contracts/site/media-provider-contribution.d.ts +118 -0
- package/dist/contracts/site/media-provider-contribution.js +3 -0
- package/dist/contracts/site/media-providers-catalog.d.ts +42 -0
- package/dist/contracts/site/media-providers-catalog.js +7 -0
- package/dist/contracts/site/media-tool-ports.d.ts +170 -0
- package/dist/contracts/site/media-tool-ports.js +2 -0
- package/dist/contracts/site/media-upload-limits.d.ts +6 -0
- package/dist/contracts/site/media-upload-limits.js +7 -0
- package/dist/contracts/site/nav.d.ts +46 -0
- package/dist/contracts/site/nav.js +10 -0
- package/dist/contracts/site/oauth-callback-page.d.ts +47 -0
- package/dist/contracts/site/oauth-callback-page.js +31 -0
- package/dist/contracts/site/packaging-electron.d.ts +20 -0
- package/dist/contracts/site/packaging-electron.js +7 -0
- package/dist/contracts/site/page-html-store.d.ts +138 -0
- package/dist/contracts/site/page-html-store.js +2 -0
- package/dist/contracts/site/platform-mail.d.ts +221 -0
- package/dist/contracts/site/platform-mail.js +2 -0
- package/dist/contracts/site/platform-process.d.ts +23 -0
- package/dist/contracts/site/platform-process.js +7 -0
- package/dist/contracts/site/platform-server-logs.d.ts +51 -0
- package/dist/contracts/site/platform-server-logs.js +15 -0
- package/dist/contracts/site/platform-site-dir.d.ts +58 -0
- package/dist/contracts/site/platform-site-dir.js +7 -0
- package/dist/contracts/site/plugin-directory.d.ts +29 -0
- package/dist/contracts/site/plugin-directory.js +2 -0
- package/dist/contracts/site/plugins-host.d.ts +92 -0
- package/dist/contracts/site/plugins-host.js +2 -0
- package/dist/contracts/site/post-author.d.ts +8 -0
- package/dist/contracts/site/post-author.js +5 -0
- package/dist/contracts/site/post-kind.d.ts +10 -0
- package/dist/contracts/site/post-kind.js +2 -0
- package/dist/contracts/site/post-revision-lock.d.ts +17 -0
- package/dist/contracts/site/post-revision-lock.js +16 -0
- package/dist/contracts/site/project-key-attachments.d.ts +78 -0
- package/dist/contracts/site/project-key-attachments.js +2 -0
- package/dist/contracts/site/protocol-mcp-ui.d.ts +37 -0
- package/dist/contracts/site/protocol-mcp-ui.js +12 -0
- package/dist/contracts/site/public-origin.d.ts +9 -0
- package/dist/contracts/site/public-origin.js +22 -0
- package/dist/contracts/site/publish-ports.d.ts +42 -0
- package/dist/contracts/site/publish-ports.js +31 -0
- package/dist/contracts/site/recovery-operation-lock.d.ts +27 -0
- package/dist/contracts/site/recovery-operation-lock.js +11 -0
- package/dist/contracts/site/recovery-reconcile-interrupted-migration.d.ts +16 -0
- package/dist/contracts/site/recovery-reconcile-interrupted-migration.js +12 -0
- package/dist/contracts/site/request-facts.d.ts +28 -0
- package/dist/contracts/site/request-facts.js +28 -0
- package/dist/contracts/site/routines.d.ts +64 -0
- package/dist/contracts/site/routines.js +2 -0
- package/dist/contracts/site/sandbox-node-worker.d.ts +15 -0
- package/dist/contracts/site/sandbox-node-worker.js +9 -0
- package/dist/contracts/site/search.d.ts +181 -0
- package/dist/contracts/site/search.js +2 -0
- package/dist/contracts/site/secrets-credential-sets.d.ts +117 -0
- package/dist/contracts/site/secrets-credential-sets.js +2 -0
- package/dist/contracts/site/secrets-credential-token.d.ts +11 -0
- package/dist/contracts/site/secrets-credential-token.js +7 -0
- package/dist/contracts/site/seo-content-analysis.d.ts +18 -0
- package/dist/contracts/site/seo-content-analysis.js +7 -0
- package/dist/contracts/site/site-assistant-visitor-tools-management.d.ts +85 -0
- package/dist/contracts/site/site-assistant-visitor-tools-management.js +8 -0
- package/dist/contracts/site/site-import-history.d.ts +67 -0
- package/dist/contracts/site/site-import-history.js +2 -0
- package/dist/contracts/site/site-key.d.ts +133 -0
- package/dist/contracts/site/site-key.js +9 -0
- package/dist/contracts/site/site-serving-gate.d.ts +13 -0
- package/dist/contracts/site/site-serving-gate.js +22 -0
- package/dist/contracts/site/skill-install.d.ts +17 -0
- package/dist/contracts/site/skill-install.js +2 -0
- package/dist/contracts/site/skills-install.d.ts +21 -0
- package/dist/contracts/site/skills-install.js +7 -0
- package/dist/contracts/site/soft-delete.d.ts +13 -0
- package/dist/contracts/site/soft-delete.js +13 -0
- package/dist/contracts/site/source-control-credentials.d.ts +197 -0
- package/dist/contracts/site/source-control-credentials.js +2 -0
- package/dist/contracts/site/strict-base64.d.ts +30 -0
- package/dist/contracts/site/strict-base64.js +33 -0
- package/dist/contracts/site/tool-metadata-approval-policy.d.ts +13 -0
- package/dist/contracts/site/tool-metadata-approval-policy.js +2 -0
- package/dist/contracts/site/ui-sections.d.ts +27 -0
- package/dist/contracts/site/ui-sections.js +13 -0
- package/dist/contracts/site/user-management-react.d.ts +276 -0
- package/dist/contracts/site/user-management-react.js +9 -0
- package/dist/contracts/site/user-management-server.d.ts +104 -0
- package/dist/contracts/site/user-management-server.js +2 -0
- package/dist/contracts/site/user-management.d.ts +379 -0
- package/dist/contracts/site/user-management.js +2 -0
- package/dist/contracts/site/vault-context.d.ts +15 -0
- package/dist/contracts/site/vault-context.js +6 -0
- package/dist/contracts/site/vendor-credentials.d.ts +37 -0
- package/dist/contracts/site/vendor-credentials.js +2 -0
- package/dist/contracts/site/web-evidence-capture-budget.d.ts +16 -0
- package/dist/contracts/site/web-evidence-capture-budget.js +7 -0
- package/dist/contracts/site/web-evidence-playwright.d.ts +38 -0
- package/dist/contracts/site/web-evidence-playwright.js +9 -0
- package/dist/contracts/site/web-screenshot.d.ts +58 -0
- package/dist/contracts/site/web-screenshot.js +7 -0
- package/dist/contracts/site/widgets-html.d.ts +40 -0
- package/dist/contracts/site/widgets-html.js +7 -0
- package/dist/contracts/speech-transcription.d.ts +27 -0
- package/dist/contracts/speech-transcription.js +8 -0
- package/dist/contracts/standing-draft.d.ts +38 -0
- package/dist/contracts/standing-draft.js +2 -0
- package/dist/contracts/storage/cleanup-preview.d.ts +23 -0
- package/dist/contracts/storage/cleanup-preview.js +2 -0
- package/dist/contracts/storage/rows.d.ts +6 -2
- package/dist/contracts/storage/rows.js +3 -3
- package/dist/contracts/storage/sqlite-compaction.d.ts +108 -0
- package/dist/contracts/storage/sqlite-compaction.js +7 -0
- package/dist/contracts/storage.d.ts +2 -0
- package/dist/contracts/tool-result-block.d.ts +21 -0
- package/dist/contracts/tool-result-block.js +8 -0
- package/dist/contracts/vault/vendor-credential-sets.d.ts +12 -0
- package/dist/errors/catalog.js +3 -3
- package/dist/errors/reporter.d.ts +81 -13
- package/dist/errors/reporter.js +220 -32
- package/dist/errors/route-refusal.d.ts +29 -0
- package/dist/errors/route-refusal.js +25 -0
- package/dist/errors/testing.d.ts +6 -7
- package/dist/errors/testing.js +7 -4
- package/dist/extension-capability-vocabulary.d.ts +29 -0
- package/dist/extension-capability-vocabulary.js +31 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/keyset-cursor.d.ts +25 -0
- package/dist/keyset-cursor.js +20 -0
- package/dist/native-approval-memory.d.ts +22 -0
- package/dist/native-approval-memory.js +32 -0
- package/dist/net/public-dns-vocabulary.d.ts +17 -0
- package/dist/net/public-dns-vocabulary.js +14 -0
- package/dist/object-store.d.ts +7 -0
- package/dist/object-store.js +1 -0
- package/dist/operator-locale.d.ts +29 -0
- package/dist/operator-locale.js +27 -0
- package/dist/optimistic-concurrency.d.ts +23 -0
- package/dist/origin-validation.d.ts +7 -0
- package/dist/origin-validation.js +8 -1
- package/dist/primitives/creator-kind.d.ts +27 -0
- package/dist/primitives/creator-kind.js +20 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/lazy-proxy.d.ts +5 -0
- package/dist/primitives/lazy-proxy.js +17 -0
- package/dist/records.d.ts +1 -1
- package/dist/records.js +1 -1
- package/dist/redaction-collectors.js +84 -40
- package/dist/redaction-exact-secrets.js +4 -4
- package/dist/redaction-labels.d.ts +3 -1
- package/dist/redaction-labels.js +3 -3
- package/dist/redaction-patterns.d.ts +5 -2
- package/dist/redaction-patterns.js +19 -10
- package/dist/redaction-spans.d.ts +5 -1
- package/dist/redaction-spans.js +2 -2
- package/dist/redaction.d.ts +5 -0
- package/dist/redaction.js +5 -0
- package/dist/registration-kit.d.ts +12 -0
- package/dist/registration-kit.js +21 -4
- package/dist/scheduled-publish.d.ts +57 -0
- package/dist/scheduled-publish.js +33 -0
- package/dist/settings/ensure-definitions.d.ts +8 -0
- package/dist/settings/guarded-reads.d.ts +58 -0
- package/dist/settings/guarded-reads.js +48 -0
- package/dist/settings/index.d.ts +3 -2
- package/dist/settings/index.js +1 -0
- package/dist/settings/settings.d.ts +8 -0
- package/dist/settings/write-definition-rename.js +2 -2
- package/dist/settings/write-definition-retype.js +4 -4
- package/dist/settings/write-definition-status.js +4 -4
- package/dist/settings/write-service.d.ts +14 -6
- package/dist/settings/write-service.js +2 -2
- package/dist/surface-exchanges.d.ts +32 -1
- package/dist/text/descriptor-i18n.d.ts +4 -1
- package/dist/text/descriptor-i18n.js +4 -1
- package/dist/text/format-timestamp.js +3 -2
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.js +2 -0
- package/dist/text/merge-locale-overlays.d.ts +25 -0
- package/dist/text/merge-locale-overlays.js +23 -0
- package/dist/text/upload-limit-message.d.ts +19 -0
- package/dist/text/upload-limit-message.js +29 -0
- package/dist/tool-access-change.d.ts +12 -0
- package/dist/tool-access-change.js +6 -0
- package/dist/tool-metadata/agent-pause.d.ts +21 -0
- package/dist/tool-metadata/agent-pause.js +9 -0
- package/dist/tool-metadata/agent-plugins.d.ts +72 -0
- package/dist/tool-metadata/agent-plugins.js +54 -0
- package/dist/tool-metadata/analytics.d.ts +14 -0
- package/dist/tool-metadata/analytics.js +17 -0
- package/dist/tool-metadata/change-sets.d.ts +24 -0
- package/dist/tool-metadata/change-sets.js +19 -0
- package/dist/tool-metadata/comments.d.ts +105 -0
- package/dist/tool-metadata/comments.js +106 -0
- package/dist/tool-metadata/commerce.d.ts +30 -0
- package/dist/tool-metadata/commerce.js +11 -0
- package/dist/tool-metadata/consent.d.ts +57 -0
- package/dist/tool-metadata/consent.js +16 -0
- package/dist/tool-metadata/content-duplication.d.ts +13 -0
- package/dist/tool-metadata/content-duplication.js +14 -0
- package/dist/tool-metadata/content-types.d.ts +74 -0
- package/dist/tool-metadata/content-types.js +96 -0
- package/dist/tool-metadata/custom-credentials.d.ts +117 -0
- package/dist/tool-metadata/custom-credentials.js +105 -0
- package/dist/tool-metadata/database-transfer.d.ts +48 -0
- package/dist/tool-metadata/database-transfer.js +32 -0
- package/dist/tool-metadata/database.d.ts +90 -0
- package/dist/tool-metadata/database.js +111 -0
- package/dist/tool-metadata/deploy-ops.d.ts +99 -0
- package/dist/tool-metadata/deploy-ops.js +96 -0
- package/dist/tool-metadata/deployments.d.ts +101 -0
- package/dist/tool-metadata/deployments.js +81 -0
- package/dist/tool-metadata/domain-dns.d.ts +84 -0
- package/dist/tool-metadata/domain-dns.js +99 -0
- package/dist/tool-metadata/email-templates.d.ts +54 -0
- package/dist/tool-metadata/email-templates.js +41 -0
- package/dist/tool-metadata/entries.d.ts +54 -0
- package/dist/tool-metadata/entries.js +70 -0
- package/dist/tool-metadata/external-mcp.d.ts +86 -0
- package/dist/tool-metadata/external-mcp.js +80 -0
- package/dist/tool-metadata/files-copy.d.ts +14 -0
- package/dist/tool-metadata/files-copy.js +18 -0
- package/dist/tool-metadata/forms.d.ts +94 -0
- package/dist/tool-metadata/forms.js +117 -0
- package/dist/tool-metadata/frontend-control.d.ts +118 -0
- package/dist/tool-metadata/frontend-control.js +78 -0
- package/dist/tool-metadata/fs-files.d.ts +36 -0
- package/dist/tool-metadata/fs-files.js +46 -0
- package/dist/tool-metadata/identity.d.ts +184 -0
- package/dist/tool-metadata/identity.js +226 -0
- package/dist/tool-metadata/image-transform.d.ts +14 -0
- package/dist/tool-metadata/image-transform.js +18 -0
- package/dist/tool-metadata/mail-status.d.ts +132 -0
- package/dist/tool-metadata/mail-status.js +104 -0
- package/dist/tool-metadata/media-generation.d.ts +25 -0
- package/dist/tool-metadata/media-generation.js +30 -0
- package/dist/tool-metadata/media-import.d.ts +34 -0
- package/dist/tool-metadata/media-import.js +40 -0
- package/dist/tool-metadata/media-video-conversion.d.ts +19 -0
- package/dist/tool-metadata/media-video-conversion.js +20 -0
- package/dist/tool-metadata/media.d.ts +106 -0
- package/dist/tool-metadata/media.js +103 -0
- package/dist/tool-metadata/members.d.ts +71 -0
- package/dist/tool-metadata/members.js +69 -0
- package/dist/tool-metadata/navigation.d.ts +54 -0
- package/dist/tool-metadata/navigation.js +71 -0
- package/dist/tool-metadata/newsletter.d.ts +190 -0
- package/dist/tool-metadata/newsletter.js +246 -0
- package/dist/tool-metadata/observability.d.ts +13 -0
- package/dist/tool-metadata/observability.js +8 -0
- package/dist/tool-metadata/pages.d.ts +47 -0
- package/dist/tool-metadata/pages.js +67 -0
- package/dist/tool-metadata/permanent-delete.d.ts +139 -0
- package/dist/tool-metadata/permanent-delete.js +121 -0
- package/dist/tool-metadata/plugin-runtime.d.ts +144 -0
- package/dist/tool-metadata/plugin-runtime.js +88 -0
- package/dist/tool-metadata/post.d.ts +87 -0
- package/dist/tool-metadata/post.js +117 -0
- package/dist/tool-metadata/recovery.d.ts +65 -0
- package/dist/tool-metadata/recovery.js +78 -0
- package/dist/tool-metadata/redirects.d.ts +73 -0
- package/dist/tool-metadata/redirects.js +93 -0
- package/dist/tool-metadata/routines.d.ts +61 -0
- package/dist/tool-metadata/routines.js +40 -0
- package/dist/tool-metadata/search.d.ts +49 -0
- package/dist/tool-metadata/search.js +33 -0
- package/dist/tool-metadata/seo.d.ts +64 -0
- package/dist/tool-metadata/seo.js +83 -0
- package/dist/tool-metadata/server-logs.d.ts +14 -0
- package/dist/tool-metadata/server-logs.js +11 -0
- package/dist/tool-metadata/settings.d.ts +90 -0
- package/dist/tool-metadata/settings.js +117 -0
- package/dist/tool-metadata/site-backup.d.ts +84 -0
- package/dist/tool-metadata/site-backup.js +30 -0
- package/dist/tool-metadata/site-evidence.d.ts +13 -0
- package/dist/tool-metadata/site-evidence.js +10 -0
- package/dist/tool-metadata/site-guide.d.ts +18 -0
- package/dist/tool-metadata/site-guide.js +15 -0
- package/dist/tool-metadata/site-inspection.d.ts +44 -0
- package/dist/tool-metadata/site-inspection.js +53 -0
- package/dist/tool-metadata/site-update.d.ts +30 -0
- package/dist/tool-metadata/site-update.js +22 -0
- package/dist/tool-metadata/sites.d.ts +52 -0
- package/dist/tool-metadata/sites.js +55 -0
- package/dist/tool-metadata/skills.d.ts +13 -0
- package/dist/tool-metadata/skills.js +10 -0
- package/dist/tool-metadata/source-control.d.ts +26 -0
- package/dist/tool-metadata/source-control.js +23 -0
- package/dist/tool-metadata/trash.d.ts +32 -0
- package/dist/tool-metadata/trash.js +27 -0
- package/dist/tool-metadata/visitor-tools.d.ts +49 -0
- package/dist/tool-metadata/visitor-tools.js +12 -0
- package/dist/tool-metadata/web-screenshot.d.ts +14 -0
- package/dist/tool-metadata/web-screenshot.js +23 -0
- package/dist/tool-metadata/web.d.ts +14 -0
- package/dist/tool-metadata/web.js +21 -0
- package/dist/tool-metadata/webhooks.d.ts +65 -0
- package/dist/tool-metadata/webhooks.js +77 -0
- package/dist/tool-metadata/widgets.d.ts +124 -0
- package/dist/tool-metadata/widgets.js +161 -0
- package/dist/tool-metadata/workspace.d.ts +43 -0
- package/dist/tool-metadata/workspace.js +49 -0
- package/dist/tool-read-cards.d.ts +88 -0
- package/dist/tool-read-cards.js +158 -0
- package/dist/tool-registry.d.ts +25 -0
- package/package.json +1430 -5
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/** @agent-note Types only. The admin wire shape of the external-MCP admission report (a connection's advertised remote tools, which of them the admission gate admitted or refused, and saved rows that never connected), moved from the host admin so a Jini admin screen can type it. The runtime gate lives in `@jini-ai/mcp/federation`. */
|
|
2
|
+
/**
|
|
3
|
+
* MCP's per-tool behaviour hints, exactly as a remote server declares them — mirrors
|
|
4
|
+
* `packages/mcp/src/federation/ports.ts`'s `RemoteToolAnnotations` verbatim. Self-declared by the
|
|
5
|
+
* thing being classified, so `mcp-federation/trust.ts` only ever lets these make a tool LESS
|
|
6
|
+
* available, never more; see {@link AdminRemoteToolSurfaceEntry.hintsAbsent} for the gap that leaves.
|
|
7
|
+
*/
|
|
8
|
+
export interface AdminRemoteToolAnnotations {
|
|
9
|
+
title?: string;
|
|
10
|
+
readOnlyHint?: boolean;
|
|
11
|
+
destructiveHint?: boolean;
|
|
12
|
+
idempotentHint?: boolean;
|
|
13
|
+
openWorldHint?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** One of `packages/mcp/src/federation/trust.ts`'s `ToolRefusalReason` members — why the admission
|
|
16
|
+
* gate would not admit a given tool today. */
|
|
17
|
+
export type AdminToolRefusalReason = "not-in-operator-allowlist" | "remote-declares-destructive" | "remote-declares-not-read-only" | "missing-or-invalid-input-schema" | "invalid-remote-tool-name" | "duplicate-remote-tool-name" | "connection-tool-cap-reached";
|
|
18
|
+
/**
|
|
19
|
+
* One ADVERTISED remote tool, described as an operator-facing record for the (not-yet-built)
|
|
20
|
+
* write-tool picker — mirrors `packages/mcp/src/federation/trust.ts`'s `RemoteToolSurfaceEntry` verbatim, field
|
|
21
|
+
* names included, per `probeExternalMcpServer`'s response (C-007).
|
|
22
|
+
*
|
|
23
|
+
* Covers every tool the remote listed, admitted or not, so a future picker can show the operator
|
|
24
|
+
* what they are choosing between rather than only what already cleared the gate.
|
|
25
|
+
*
|
|
26
|
+
* `hintsAbsent` MUST NOT be rendered as "read-only" by any consumer — it means the remote said
|
|
27
|
+
* nothing about this tool, which is exactly the case a write can slip through unmarked today (see
|
|
28
|
+
* `external-mcp-i18n.ts`'s header for the copy discipline this drives).
|
|
29
|
+
*/
|
|
30
|
+
export interface AdminRemoteToolSurfaceEntry {
|
|
31
|
+
remoteName: string;
|
|
32
|
+
description: string;
|
|
33
|
+
declaredAnnotations?: AdminRemoteToolAnnotations;
|
|
34
|
+
writeDeclared: boolean;
|
|
35
|
+
destructiveDeclared: boolean;
|
|
36
|
+
hintsAbsent: boolean;
|
|
37
|
+
allowlisted: boolean;
|
|
38
|
+
writeAllowed: boolean;
|
|
39
|
+
admitted: boolean;
|
|
40
|
+
refusalReason: AdminToolRefusalReason | null;
|
|
41
|
+
}
|
|
42
|
+
/** `POST .../mcp-servers/:serverId/probe`'s response shape (C-007) — a live, on-demand read of what
|
|
43
|
+
* the remote currently advertises. Never persisted server-side (a cache of third-party data does
|
|
44
|
+
* not belong on the security row — see `schema-decision.md` Part 1), so `probedAt` is this call's
|
|
45
|
+
* own timestamp, not a stored one. */
|
|
46
|
+
export interface AdminExternalMcpProbeResult {
|
|
47
|
+
tools: AdminRemoteToolSurfaceEntry[];
|
|
48
|
+
probedAt: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* One connection's live admission accounting from the RUNNING agent daemon — a subset of
|
|
52
|
+
* `packages/mcp/src/federation/trust.ts`'s `FederatedAdmissionReport`, FLATTENED per connection by
|
|
53
|
+
* `getExternalMcpAdmissions` (see {@link RawAdmissionConnection} for why that flattening
|
|
54
|
+
* step exists and is not optional).
|
|
55
|
+
*
|
|
56
|
+
* `admitted` intentionally carries only what a drift banner needs (a name and whether it is
|
|
57
|
+
* write-authorized), not the full `AdmittedFederatedTool` the daemon holds (which also carries a
|
|
58
|
+
* `toolId` and the remote's raw input schema) — same "richer server shape, unread extra fields"
|
|
59
|
+
* precedent {@link AdminMediaProviderCredentials} follows.
|
|
60
|
+
*/
|
|
61
|
+
export interface AdminFederatedAdmissionEntry {
|
|
62
|
+
connectionId: string;
|
|
63
|
+
admitted: {
|
|
64
|
+
remoteName: string;
|
|
65
|
+
writeAuthorized: boolean;
|
|
66
|
+
}[];
|
|
67
|
+
refused: {
|
|
68
|
+
remoteName: string;
|
|
69
|
+
reason: AdminToolRefusalReason;
|
|
70
|
+
}[];
|
|
71
|
+
/** Allowlisted names the remote never advertised — an operator's config drifting from the
|
|
72
|
+
* server's real surface. */
|
|
73
|
+
allowlistedButAbsent: string[];
|
|
74
|
+
/** Names write-authorized but not also allowlisted — a write grant that can never take effect. */
|
|
75
|
+
writeAllowedButNotAllowlisted: string[];
|
|
76
|
+
/**
|
|
77
|
+
* Whether this connection came from a first-party plugin preset (`mcp-federation/presets.ts`)
|
|
78
|
+
* rather than this workspace's editable roster — `AttachFederatedToolsResult.reports`'s own field,
|
|
79
|
+
* relayed verbatim through two passthrough hops. `external-mcp-admissions-rules.ts` reads this to
|
|
80
|
+
* tell "no roster card because this is a preset, by design" apart from "no roster card because the
|
|
81
|
+
* operator deleted it" — both used to look identical (no roster card either way), which is why a
|
|
82
|
+
* genuinely-deleted-but-still-live connection was silently reported as agreeing instead of as
|
|
83
|
+
* drift (2026-09-07). Optional, not defaulted at this type's boundary: an older daemon build that
|
|
84
|
+
* predates this field omits it, and `!entry.isPreset` already reads `undefined` the same as
|
|
85
|
+
* `false` — the safe direction, since it means "warn about a live connection" rather than "stay
|
|
86
|
+
* silent about one that might not be a preset".
|
|
87
|
+
*/
|
|
88
|
+
isPreset?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* One SAVED, enabled external-MCP row the daemon could not even attempt to connect — it never
|
|
92
|
+
* reached `attachFederatedMcpTools` at all, so it has no matching {@link AdminFederatedAdmissionEntry}
|
|
93
|
+
* either. Most commonly a sealed env block that failed to decrypt because the site key is not
|
|
94
|
+
* available (`assistant/external-mcp-store.ts`'s `openExternalMcpEnv`).
|
|
95
|
+
*
|
|
96
|
+
* `reason` is the daemon's own operator-facing failure string
|
|
97
|
+
* (`readEnabledExternalMcpConfigs`/`external-mcp-store.ts`) — already guaranteed secret-free by that
|
|
98
|
+
* module's own contract (`admin-http/routes/external-mcp/probe.ts`'s INV-006 doc relays the
|
|
99
|
+
* identical string to an operator today), never a raw stack trace or provider error. Even so,
|
|
100
|
+
* `external-mcp-admissions-rules.ts` does not interpolate this string into the banner verbatim — it
|
|
101
|
+
* classifies known reasons (today: a decrypt failure) into fixed, translated-or-English copy, and
|
|
102
|
+
* falls back to the pre-existing generic message for anything it does not recognize, rather than
|
|
103
|
+
* rendering server-authored text straight into UI copy.
|
|
104
|
+
*/
|
|
105
|
+
export interface AdminExternalMcpConfigFailure {
|
|
106
|
+
connectionId: string;
|
|
107
|
+
reason: string;
|
|
108
|
+
}
|
|
109
|
+
/** `GET .../mcp-servers/admissions`'s response shape (C-008), AFTER `getExternalMcpAdmissions`
|
|
110
|
+
* has flattened it — see {@link RawAdmissionConnection}. A down daemon is a 503 — see
|
|
111
|
+
* `getExternalMcpAdmissions`'s own doc — never an empty `connections` array, so "the
|
|
112
|
+
* assistant is not running" and "it is running with nothing admitted" stay distinguishable. */
|
|
113
|
+
export interface AdminExternalMcpAdmissionsSnapshot {
|
|
114
|
+
connections: AdminFederatedAdmissionEntry[];
|
|
115
|
+
/**
|
|
116
|
+
* Optional and NOT defaulted to `[]` at this type's boundary — absent for an older daemon build
|
|
117
|
+
* that predates this field (`federation-admissions-route.ts`'s own doc), the same "absent means
|
|
118
|
+
* unknown, not zero" reasoning {@link AdminFederatedAdmissionEntry.isPreset} already uses one field
|
|
119
|
+
* over. `external-mcp-admissions-rules.ts`'s `describeAdmissionDrift` treats a missing array the
|
|
120
|
+
* same as an empty one (no known failures to report), so callers that never populate this — every
|
|
121
|
+
* pre-existing test fixture included — keep behaving exactly as before.
|
|
122
|
+
*/
|
|
123
|
+
configFailures?: AdminExternalMcpConfigFailure[];
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=admissions.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** @agent-note Types only. The admin wire shape of the external-MCP admission report (a connection's advertised remote tools, which of them the admission gate admitted or refused, and saved rows that never connected), moved from the host admin so a Jini admin screen can type it. The runtime gate lives in `@jini-ai/mcp/federation`. */
|
|
2
|
+
export {};
|
|
3
|
+
//# sourceMappingURL=admissions.js.map
|
|
@@ -148,7 +148,8 @@ export interface ExternalMcpOAuthRuntimePatch {
|
|
|
148
148
|
* than a single-row find/upsert. */
|
|
149
149
|
/** @agent-note Fulfilled by the host (SQL or memory adapter). The store, the sign-in service and the plugin connect seam must receive the SAME repository instance, because sealed envelopes carry private repository context only that repository rebuilds. */
|
|
150
150
|
export interface ExternalMcpServerRepoPort {
|
|
151
|
-
/** @agent-note Workspace-scoped; returns whole saved rows
|
|
151
|
+
/** @agent-note Workspace-scoped; returns whole saved rows in ascending serverId UTF-8 byte
|
|
152
|
+
* order (SQLite BINARY / PostgreSQL C), never views. No insertion-order or locale dependency. */
|
|
152
153
|
listByWorkspaceId(workspaceId: UUID): Promise<ExternalMcpServerRecord[]>;
|
|
153
154
|
/** @agent-note Returns the whole saved row or `null`; at most one row read per call. */
|
|
154
155
|
findByServerId(input: {
|
|
@@ -167,22 +168,27 @@ export interface ExternalMcpServerRepoPort {
|
|
|
167
168
|
/**
|
|
168
169
|
* The edit write: replaces the editable columns and both credential pointers iff the stored
|
|
169
170
|
* `version` equals `expectedVersion` AND both stored envelopes are the ones in `replaces`; sets
|
|
170
|
-
* `version` to `expectedVersion + 1`.
|
|
171
|
+
* `version` to `expectedVersion + 1`. When supplied, `expectedCreatedAt` must also match.
|
|
172
|
+
* `false` when nothing was written (the row is gone, moved on, or a credential was replaced since the read).
|
|
171
173
|
* @agent-note Compare-and-set in the write statement under the same writer lock the credential writers take. `record.version` is ignored; the repository assigns the next version.
|
|
172
174
|
*/
|
|
173
175
|
updateIfVersion(required: {
|
|
174
176
|
readonly record: ExternalMcpServerRecord;
|
|
175
177
|
readonly expectedVersion: number;
|
|
178
|
+
readonly expectedCreatedAt?: string;
|
|
176
179
|
readonly replaces: ExternalMcpReplacedSecrets;
|
|
177
180
|
}): Promise<boolean>;
|
|
178
181
|
/**
|
|
179
182
|
* The runtime write: sets only the sealed-OAuth pointer, `oauthStatus`, `oauthExpiresAt`,
|
|
180
|
-
* `oauthRefreshLeaseUntil`, `oauthAadVersion` and `updatedAt`, iff the stored sealed-OAuth envelope is `expectedSealedOAuth`.
|
|
183
|
+
* `oauthRefreshLeaseUntil`, `oauthAadVersion` and `updatedAt`, iff the stored sealed-OAuth envelope is `expectedSealedOAuth`.
|
|
184
|
+
* When supplied, `expectedConfig` also compares creation time and version in the write.
|
|
185
|
+
* Leaves `version` and every other column alone. `false` when the credential or guarded configuration changed, or the row is gone.
|
|
181
186
|
* @agent-note A late token set for a credential that no longer exists is dropped, never written onto its replacement. The caller reports it as "reauthorization required".
|
|
182
187
|
*/
|
|
183
188
|
updateOAuthRuntime(required: {
|
|
184
189
|
readonly key: ExternalMcpServerKey;
|
|
185
190
|
readonly expectedSealedOAuth: SealedSecret | null;
|
|
191
|
+
readonly expectedConfig?: Pick<ExternalMcpServerRecord, "createdAt" | "version">;
|
|
186
192
|
readonly patch: ExternalMcpOAuthRuntimePatch;
|
|
187
193
|
}): Promise<boolean>;
|
|
188
194
|
/** Compare the approved snapshot and update access atomically, preserving credential columns. */
|
package/dist/contracts/mail.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export interface OutboundEmail {
|
|
|
7
7
|
replyTo?: EmailAddress;
|
|
8
8
|
subject: string;
|
|
9
9
|
/** At least one of html/text must be supplied; the transport does not render missing content. */
|
|
10
|
-
html?: string;
|
|
10
|
+
html?: string | undefined;
|
|
11
11
|
/** A plain-text alternative improves accessibility and deliverability. */
|
|
12
|
-
text?: string;
|
|
12
|
+
text?: string | undefined;
|
|
13
13
|
/** Allows caller-owned List-Unsubscribe and RFC 8058 one-click headers without provider coupling. */
|
|
14
14
|
headers?: Readonly<Record<string, string>>;
|
|
15
15
|
/** Additive/optional for existing consumers; content is base64 so no live stream/path crosses the ABI. */
|
|
@@ -127,4 +127,30 @@ export interface PluginMailHttpClient {
|
|
|
127
127
|
}
|
|
128
128
|
export * from "./mail/email-sender.js";
|
|
129
129
|
export type * from "./mail/smtp-payload.js";
|
|
130
|
+
/** Owner-only grant to delete this workspace's captured test emails (test/capture mode's sink). */
|
|
131
|
+
export declare const MAIL_CAPTURE_CLEAR_PERMISSION = "mail.capture.clear";
|
|
132
|
+
/** Body of a captured-mail clear: without `confirmed: true` it only previews; a confirm carries the previewed `revision`. */
|
|
133
|
+
export interface MailCaptureClearRequest {
|
|
134
|
+
confirmed?: boolean;
|
|
135
|
+
revision?: string;
|
|
136
|
+
}
|
|
137
|
+
/** What a clear would delete, as the owner reviews it: how many, and the newest one's time (`null` when none). */
|
|
138
|
+
export interface MailCaptureClearPlan {
|
|
139
|
+
count: number;
|
|
140
|
+
newestAt: string | null;
|
|
141
|
+
}
|
|
142
|
+
/** The preview: nothing is deleted; `revision` names the exact reviewed set of captures and is what a confirm must carry. */
|
|
143
|
+
export interface MailCaptureClearPreview {
|
|
144
|
+
cleared: false;
|
|
145
|
+
confirmationRequired: true;
|
|
146
|
+
plan: MailCaptureClearPlan;
|
|
147
|
+
revision: string;
|
|
148
|
+
}
|
|
149
|
+
/** The confirmed clear: `deleted` counts the reviewed captures removed (captures that arrived after review are kept). */
|
|
150
|
+
export interface MailCaptureClearResult {
|
|
151
|
+
cleared: true;
|
|
152
|
+
deleted: number;
|
|
153
|
+
}
|
|
154
|
+
/** Either answer of the captured-mail clear. */
|
|
155
|
+
export type MailCaptureClearAnswer = MailCaptureClearPreview | MailCaptureClearResult;
|
|
130
156
|
//# sourceMappingURL=mail.d.ts.map
|
package/dist/contracts/mail.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/** @agent-note Types only. The runtime parts come from the host; this area usually from `@jini-ai/platform`. */
|
|
2
2
|
export * from "./mail/email-sender.js";
|
|
3
|
+
// --- captured test emails: the owner's reviewed "clear all" --------------------------------
|
|
4
|
+
/** Owner-only grant to delete this workspace's captured test emails (test/capture mode's sink). */
|
|
5
|
+
export const MAIL_CAPTURE_CLEAR_PERMISSION = "mail.capture.clear";
|
|
3
6
|
//# sourceMappingURL=mail.js.map
|
|
@@ -70,6 +70,11 @@ export type AgentRunStatus = 'succeeded' | 'failed' | 'canceled' | 'interrupted'
|
|
|
70
70
|
export interface AgentRunTrackingOutcome {
|
|
71
71
|
status: AgentRunStatus;
|
|
72
72
|
error?: unknown;
|
|
73
|
+
usage?: {
|
|
74
|
+
inputTokens?: number;
|
|
75
|
+
outputTokens?: number;
|
|
76
|
+
costUsd?: number;
|
|
77
|
+
};
|
|
73
78
|
}
|
|
74
79
|
export interface AgentRunTracker extends TrackerScope {
|
|
75
80
|
end(outcome: AgentRunTrackingOutcome): void;
|
|
@@ -95,6 +100,7 @@ export interface OperationTrackingOutcome {
|
|
|
95
100
|
}
|
|
96
101
|
export interface OperationTracker extends TrackerScope {
|
|
97
102
|
end(outcome: OperationTrackingOutcome): void;
|
|
103
|
+
traceIds?(): TraceIds | undefined;
|
|
98
104
|
}
|
|
99
105
|
/** Correlation assigned by an active tracing implementation; readers never generate IDs. */
|
|
100
106
|
export interface TraceIds {
|
|
@@ -113,6 +119,12 @@ export interface ErrorReport {
|
|
|
113
119
|
attributes?: OperationAttributes;
|
|
114
120
|
level?: 'warning' | 'error';
|
|
115
121
|
trace?: TraceIds;
|
|
122
|
+
incidentId?: string;
|
|
123
|
+
label?: string;
|
|
124
|
+
/** Private, in-process redaction input: exact values (a token the request carried) the adapter
|
|
125
|
+
* blanks from the error before export. An adapter consumes it before projecting provider-bound
|
|
126
|
+
* context and never serializes, logs or forwards the array itself. */
|
|
127
|
+
exactSecrets?: readonly string[];
|
|
116
128
|
};
|
|
117
129
|
}
|
|
118
130
|
/** Native crash upload configuration. Provider-specific field names stay opaque to hosts. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The slice of a durable run attempt that run-start decisions read. A host's durable-run
|
|
3
|
+
* store (chat's `DurableRun`, a product's own row type) satisfies it structurally, so the daemon
|
|
4
|
+
* decides who owns an answer without importing any store's type.
|
|
5
|
+
*/
|
|
6
|
+
/** The fields of a durable attempt the "does it still own its answer" check reads. */
|
|
7
|
+
export interface DurableAttemptStatus {
|
|
8
|
+
/** Why the attempt was cancelled; a non-empty value means a stop took over. */
|
|
9
|
+
readonly cancelReason: string | null;
|
|
10
|
+
readonly message: {
|
|
11
|
+
readonly runStatus?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=run-attempt.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The slice of a durable run attempt that run-start decisions read. A host's durable-run
|
|
3
|
+
* store (chat's `DurableRun`, a product's own row type) satisfies it structurally, so the daemon
|
|
4
|
+
* decides who owns an answer without importing any store's type.
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=run-attempt.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The one carrier a route uses to disclose an error it has already classified as safe for the
|
|
3
|
+
* caller. A leaf module with no runtime imports, so both the error reporter and the JSON route
|
|
4
|
+
* binding can depend on it without importing each other.
|
|
5
|
+
*/
|
|
6
|
+
import type { ServerApiError } from './api-error.js';
|
|
7
|
+
/**
|
|
8
|
+
* Thrown by a route's `handle` — or by anything it calls, at any depth — to bypass the SEC-005
|
|
9
|
+
* redaction below with an error the throwing code has already decided is safe for the caller
|
|
10
|
+
* to see. Prefer returning `err(...)` from `handle` when the failure is anticipated at that point;
|
|
11
|
+
* this class is for the same kind of failure discovered a level deeper, inside an awaited call
|
|
12
|
+
* `handle` did not wrap in its own `try`.
|
|
13
|
+
*
|
|
14
|
+
* Not a way to defeat SEC-005: the only way to reach the branch that reads this class is for code to
|
|
15
|
+
* construct one itself, naming the exact error — code and message — it is choosing to disclose.
|
|
16
|
+
* Any thrown value that is not this class (including a plain `Error` with an actionable-looking
|
|
17
|
+
* message) still redacts; nothing here widens what a route can leak by accident.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ClientFacingError extends Error {
|
|
20
|
+
readonly apiError: ServerApiError;
|
|
21
|
+
constructor({ apiError }: {
|
|
22
|
+
readonly apiError: ServerApiError;
|
|
23
|
+
}, _optional?: Record<string, never>);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=client-facing-error.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown by a route's `handle` — or by anything it calls, at any depth — to bypass the SEC-005
|
|
3
|
+
* redaction below with an error the throwing code has already decided is safe for the caller
|
|
4
|
+
* to see. Prefer returning `err(...)` from `handle` when the failure is anticipated at that point;
|
|
5
|
+
* this class is for the same kind of failure discovered a level deeper, inside an awaited call
|
|
6
|
+
* `handle` did not wrap in its own `try`.
|
|
7
|
+
*
|
|
8
|
+
* Not a way to defeat SEC-005: the only way to reach the branch that reads this class is for code to
|
|
9
|
+
* construct one itself, naming the exact error — code and message — it is choosing to disclose.
|
|
10
|
+
* Any thrown value that is not this class (including a plain `Error` with an actionable-looking
|
|
11
|
+
* message) still redacts; nothing here widens what a route can leak by accident.
|
|
12
|
+
*/
|
|
13
|
+
export class ClientFacingError extends Error {
|
|
14
|
+
apiError;
|
|
15
|
+
constructor({ apiError }, _optional = {}) {
|
|
16
|
+
super(apiError.message);
|
|
17
|
+
this.name = 'ClientFacingError';
|
|
18
|
+
this.apiError = apiError;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=client-facing-error.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The deferred request body of a raw route: a handler that must refuse an unauthorized request
|
|
3
|
+
* WITHOUT reading its body (an upload, a form post) asks for the body only after its own gates, through
|
|
4
|
+
* `readBody`, instead of a host parser registered ahead of the mount reading it first. Neutral: the host
|
|
5
|
+
* adapter backs the reader with its own parser; a route sees only these shapes.
|
|
6
|
+
*/
|
|
7
|
+
import type { RouteInputContext } from './json-route.js';
|
|
8
|
+
/**
|
|
9
|
+
* What to read. `raw`: the bytes of a request whose media type matches `mediaType` (e.g. `application/zip`).
|
|
10
|
+
* `urlencoded`: a flat form (`a=1&b=2`, no nested keys; a repeated key gives its values in order) of an
|
|
11
|
+
* `application/x-www-form-urlencoded` request.
|
|
12
|
+
* `limit` is the byte ceiling. A compressed body (`Content-Encoding` other than identity) is never unzipped:
|
|
13
|
+
* it is refused as `unsupported-encoding`.
|
|
14
|
+
*/
|
|
15
|
+
export type RouteBodyReadOptions = {
|
|
16
|
+
readonly type: 'raw';
|
|
17
|
+
readonly mediaType: string;
|
|
18
|
+
readonly limit: number;
|
|
19
|
+
} | {
|
|
20
|
+
readonly type: 'urlencoded';
|
|
21
|
+
readonly limit: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Why a body could not be read. `media-type`: the request has no body, or its media type is not the one
|
|
25
|
+
* asked for (nothing was read). `too-large`: over `limit` (which it carries). `unsupported-encoding`: a
|
|
26
|
+
* compressed body. `malformed`: the bytes did not parse. `aborted`: the client stopped sending.
|
|
27
|
+
* `size-mismatch`: the body did not match its `Content-Length`. `unreadable`: any other read failure.
|
|
28
|
+
* `incompatible-read`: the stream was already consumed by an earlier read of this request that asked
|
|
29
|
+
* for different options (another parser, media type or limit), so this read cannot be answered; only
|
|
30
|
+
* a call with the first call's exact options reuses its outcome.
|
|
31
|
+
*/
|
|
32
|
+
export type RouteBodyRefusal = {
|
|
33
|
+
readonly reason: 'too-large';
|
|
34
|
+
readonly limit: number;
|
|
35
|
+
} | {
|
|
36
|
+
readonly reason: 'media-type' | 'unsupported-encoding' | 'malformed' | 'aborted' | 'size-mismatch' | 'unreadable' | 'incompatible-read';
|
|
37
|
+
};
|
|
38
|
+
/** A flat urlencoded form: each field's value, or its values in order when the key repeats. */
|
|
39
|
+
export type RouteFormFields = Readonly<Record<string, string | readonly string[]>>;
|
|
40
|
+
/** A body read's outcome: the bytes (`raw`) or the flat form (`urlencoded`), or why it was refused. */
|
|
41
|
+
export type RouteBodyRead<T> = {
|
|
42
|
+
readonly ok: true;
|
|
43
|
+
readonly value: T;
|
|
44
|
+
} | {
|
|
45
|
+
readonly ok: false;
|
|
46
|
+
readonly refusal: RouteBodyRefusal;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Reads the request body once, on demand. Method syntax keeps the overloads; the stream is consumed once,
|
|
50
|
+
* so a later call with options identical to the first answers what the first read, and a later call with
|
|
51
|
+
* different options is refused as `incompatible-read`.
|
|
52
|
+
*/
|
|
53
|
+
export interface RouteBodyReader {
|
|
54
|
+
(options: Extract<RouteBodyReadOptions, {
|
|
55
|
+
type: 'raw';
|
|
56
|
+
}>): Promise<RouteBodyRead<Uint8Array>>;
|
|
57
|
+
(options: Extract<RouteBodyReadOptions, {
|
|
58
|
+
type: 'urlencoded';
|
|
59
|
+
}>): Promise<RouteBodyRead<RouteFormFields>>;
|
|
60
|
+
}
|
|
61
|
+
/** A raw route's input: the parsed request context plus the deferred body reader. */
|
|
62
|
+
export interface RawRouteInputContext extends RouteInputContext {
|
|
63
|
+
readonly readBody: RouteBodyReader;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=deferred-body.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The caller-facing words for a request the server could not finish, chosen by HTTP method.
|
|
3
|
+
* A read (GET/HEAD/OPTIONS) changed nothing, so telling its caller to "check whether your change was
|
|
4
|
+
* saved" sends them hunting for a write that never happened (live-found on a failed page load,
|
|
5
|
+
* 2026-11-25); a read says nothing was changed. A write still asks the caller to check, because a
|
|
6
|
+
* failure after the write committed is indistinguishable from one before it.
|
|
7
|
+
*/
|
|
8
|
+
/** The `{message, action}` fallback a route's operation reports for an unanticipated failure. @complexity O(1). */
|
|
9
|
+
export declare function httpFallbackCopy({ method }: {
|
|
10
|
+
readonly method: string;
|
|
11
|
+
}, _optional?: Record<string, never>): {
|
|
12
|
+
readonly message: string;
|
|
13
|
+
readonly action: string;
|
|
14
|
+
};
|
|
15
|
+
/** The one-line INTERNAL_ERROR message sent when no reporter describes the failure. @complexity O(1). */
|
|
16
|
+
export declare function internalErrorMessage({ method }: {
|
|
17
|
+
readonly method: string;
|
|
18
|
+
}, _optional?: Record<string, never>): string;
|
|
19
|
+
//# sourceMappingURL=failure-copy.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The caller-facing words for a request the server could not finish, chosen by HTTP method.
|
|
3
|
+
* A read (GET/HEAD/OPTIONS) changed nothing, so telling its caller to "check whether your change was
|
|
4
|
+
* saved" sends them hunting for a write that never happened (live-found on a failed page load,
|
|
5
|
+
* 2026-11-25); a read says nothing was changed. A write still asks the caller to check, because a
|
|
6
|
+
* failure after the write committed is indistinguishable from one before it.
|
|
7
|
+
*/
|
|
8
|
+
const READ_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);
|
|
9
|
+
const MESSAGE = 'The server could not finish this request.';
|
|
10
|
+
const READ_FALLBACK = { message: MESSAGE, action: 'Nothing was changed. Try again; if it keeps failing, report the error ID.' };
|
|
11
|
+
const WRITE_FALLBACK = { message: MESSAGE, action: 'Check whether your change was saved, then try again. If it keeps failing, report the error ID.' };
|
|
12
|
+
/** Whether `method` only reads, case-insensitively. @complexity O(1). */
|
|
13
|
+
function isReadMethod({ method }) {
|
|
14
|
+
return READ_METHODS.has(method.toUpperCase());
|
|
15
|
+
}
|
|
16
|
+
/** The `{message, action}` fallback a route's operation reports for an unanticipated failure. @complexity O(1). */
|
|
17
|
+
export function httpFallbackCopy({ method }, _optional = {}) {
|
|
18
|
+
return isReadMethod({ method }) ? READ_FALLBACK : WRITE_FALLBACK;
|
|
19
|
+
}
|
|
20
|
+
/** The one-line INTERNAL_ERROR message sent when no reporter describes the failure. @complexity O(1). */
|
|
21
|
+
export function internalErrorMessage({ method }, _optional = {}) {
|
|
22
|
+
return isReadMethod({ method })
|
|
23
|
+
? `${MESSAGE} Nothing was changed. Try again; if it keeps failing, copy the request ID and report this problem.`
|
|
24
|
+
: `${MESSAGE} Check whether your change was saved, then copy the request ID and report this problem.`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=failure-copy.js.map
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* host mounts them on whatever adapter it runs.
|
|
5
5
|
*/
|
|
6
6
|
import type { ServerRoute } from '../server.js';
|
|
7
|
+
import type { ObservabilityPort } from '../observability.js';
|
|
8
|
+
import { type ErrorReporter } from '../../errors/reporter.js';
|
|
7
9
|
import { type ServerApiError } from './api-error.js';
|
|
8
10
|
import { type OriginContext } from './origin.js';
|
|
9
11
|
import type { Result } from './result.js';
|
|
@@ -16,16 +18,46 @@ export interface RouteInputContext {
|
|
|
16
18
|
body: unknown;
|
|
17
19
|
query: Record<string, unknown>;
|
|
18
20
|
params: Record<string, string>;
|
|
21
|
+
/** Only the request headers the route opted into, keyed by lower-cased name; an absent header has no key. Absent unless the route opted in. */
|
|
22
|
+
headers?: Readonly<Record<string, string>>;
|
|
23
|
+
/** The host-resolved request facts. Absent unless the route opted in. */
|
|
24
|
+
facts?: RouteRequestFacts;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Per-request facts only the host can resolve, for a route that opted in: who the client is (a rate
|
|
28
|
+
* limit key, a probe's identity), its user agent, and the host it addressed. Neutral: no server framework.
|
|
29
|
+
*/
|
|
30
|
+
export interface RouteRequestFacts {
|
|
31
|
+
/** The host's answer to "who is the client" under its proxy-trust policy. Never defaulted inside Jini. */
|
|
32
|
+
readonly clientAddress: string;
|
|
33
|
+
readonly userAgent?: string;
|
|
34
|
+
readonly host?: string;
|
|
35
|
+
/** The protocol the host says the request was served over (Express `req.protocol` under its trust-proxy
|
|
36
|
+
* policy) — with `host`, what a route needs to rebuild its own public origin (publish-trust identity). */
|
|
37
|
+
readonly protocol?: string;
|
|
38
|
+
/** The origin (`scheme://authority`) the host says this request was served from, under its own proxy-trust
|
|
39
|
+
* policy, for a route that formats absolute URLs in its answer (sitemap, feed). Absent when the request
|
|
40
|
+
* carries no authority that can form an origin (a malformed `Host`): the route then keeps its stored origin. */
|
|
41
|
+
readonly servingOrigin?: string;
|
|
19
42
|
}
|
|
20
43
|
/** Parses a `RouteInputContext` into a typed `Input`, or fails with an error. */
|
|
21
44
|
export type InputParser<Input> = (raw: RouteInputContext) => Result<Input>;
|
|
22
45
|
/** HTTP verbs a `JsonRouteSpec` can be mounted under. */
|
|
23
46
|
export type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch';
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
}
|
|
47
|
+
/** The optional scope of one authorization: a by-id route names the entity it acts on, so the
|
|
48
|
+
* host's authorizer can decide per entity; list/import routes leave it out. */
|
|
49
|
+
export interface JsonRouteAuthorizeScope {
|
|
50
|
+
readonly entityId?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Explicit authorization remains at the route's chosen point, preserving validation precedence.
|
|
53
|
+
* `entityType` is optional for a permission that names no entity kind (list roles); the host port then
|
|
54
|
+
* receives no `entityType` key at all. */
|
|
55
|
+
export type JsonRouteAuthorize = {
|
|
56
|
+
authorize(requiredArgs: {
|
|
57
|
+
readonly permission: string;
|
|
58
|
+
readonly entityType?: string;
|
|
59
|
+
}, optionalArgs?: JsonRouteAuthorizeScope): Promise<void>;
|
|
60
|
+
}['authorize'];
|
|
29
61
|
/**
|
|
30
62
|
* Handles a parsed `Input` (plus injected `Deps`) and produces a `Result<Output>`.
|
|
31
63
|
*
|
|
@@ -67,13 +99,25 @@ export type ReportRouteInternalError = <E extends {
|
|
|
67
99
|
readonly logSource: string;
|
|
68
100
|
}) => void) | undefined;
|
|
69
101
|
}) => ServerApiError;
|
|
102
|
+
/**
|
|
103
|
+
* The ports that put a host's routes in reporter mode: an unanticipated throw goes through the one
|
|
104
|
+
* incident path (one error ID, one host record, one tracker report), and each request is one
|
|
105
|
+
* `http.route` operation. The lifecycle helpers are pure functions imported from core, not ports.
|
|
106
|
+
*/
|
|
107
|
+
export interface RouteErrorPorts {
|
|
108
|
+
readonly reporter: ErrorReporter;
|
|
109
|
+
readonly observability: Pick<ObservabilityPort, 'trackOperation'>;
|
|
110
|
+
}
|
|
70
111
|
/** Server startup state a route needs to evaluate its same-origin guard and report incidents. */
|
|
71
112
|
export interface RouteHostContext extends OriginContext {
|
|
72
113
|
/**
|
|
73
114
|
* Host-owned sink for the real exception behind a generic `INTERNAL_ERROR` response (SEC-005).
|
|
74
|
-
* The catch-all for a route that throws outside its own guarded path.
|
|
115
|
+
* The catch-all for a route that throws outside its own guarded path. Legacy mode only: with
|
|
116
|
+
* `errors` present the reporter owns that record and this sink is never called.
|
|
75
117
|
*/
|
|
76
118
|
readonly onInternalError?: (context: RouteHostInternalErrorContext) => void;
|
|
119
|
+
/** Reporter mode, chosen once when the route is built. Absent → the legacy SEC-005 path. */
|
|
120
|
+
readonly errors?: RouteErrorPorts;
|
|
77
121
|
}
|
|
78
122
|
/**
|
|
79
123
|
* Host-owned workspace, authentication/authorization and exception policy.
|
|
@@ -96,8 +140,8 @@ export interface JsonRoutePorts<Deps, Context = undefined> {
|
|
|
96
140
|
readonly context: Context | undefined;
|
|
97
141
|
readonly deps: Deps;
|
|
98
142
|
readonly permission: string;
|
|
99
|
-
readonly entityType
|
|
100
|
-
}) => void | Promise<void>;
|
|
143
|
+
readonly entityType?: string;
|
|
144
|
+
}, optional?: JsonRouteAuthorizeScope) => void | Promise<void>;
|
|
101
145
|
/** Host error policy; returns the answer instead of writing it. */
|
|
102
146
|
readonly onError?: (required: {
|
|
103
147
|
readonly error: unknown;
|
|
@@ -116,24 +160,6 @@ export interface JsonRouteSpec<Input, Output, Deps, Context = undefined> {
|
|
|
116
160
|
successStatus?: number;
|
|
117
161
|
ports?: JsonRoutePorts<Deps, Context>;
|
|
118
162
|
}
|
|
119
|
-
/**
|
|
120
|
-
* Thrown by a route's `handle` — or by anything it calls, at any depth — to bypass the SEC-005
|
|
121
|
-
* redaction below with an error the throwing code has already decided is safe for the caller
|
|
122
|
-
* to see. Prefer returning `err(...)` from `handle` when the failure is anticipated at that point;
|
|
123
|
-
* this class is for the same kind of failure discovered a level deeper, inside an awaited call
|
|
124
|
-
* `handle` did not wrap in its own `try`.
|
|
125
|
-
*
|
|
126
|
-
* Not a way to defeat SEC-005: the only way to reach the branch that reads this class is for code to
|
|
127
|
-
* construct one itself, naming the exact error — code and message — it is choosing to disclose.
|
|
128
|
-
* Any thrown value that is not this class (including a plain `Error` with an actionable-looking
|
|
129
|
-
* message) still redacts; nothing here widens what a route can leak by accident.
|
|
130
|
-
*/
|
|
131
|
-
export declare class ClientFacingError extends Error {
|
|
132
|
-
readonly apiError: ServerApiError;
|
|
133
|
-
constructor({ apiError }: {
|
|
134
|
-
readonly apiError: ServerApiError;
|
|
135
|
-
}, _optional?: Record<string, never>);
|
|
136
|
-
}
|
|
137
163
|
/**
|
|
138
164
|
* Combines required route fields and optional settings into a fresh spec while pinning its generic
|
|
139
165
|
* parameters at the definition site so callers do not have to repeat them. Optional settings take
|