@jini-ai/core 0.7.3-next.2 → 0.7.3-next.3
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/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/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 +7 -2
- 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 +7 -3
- 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 +449 -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 +28 -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 +166 -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/errors/catalog.js +2 -2
- 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/redaction-collectors.js +60 -39
- 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 +3 -1
- package/dist/redaction-patterns.js +1 -1
- package/dist/redaction-spans.d.ts +5 -1
- package/dist/redaction-spans.js +2 -2
- package/dist/registration-kit.d.ts +12 -0
- package/dist/registration-kit.js +14 -0
- 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/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 +24 -0
- package/dist/tool-metadata/media-generation.js +29 -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 +1381 -5
package/dist/errors/reporter.js
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* words, with no incident. Anything else is an incident: one error ID, one host record, one tracker
|
|
5
5
|
* report, and the caller gets the boundary's own fallback words with the ID.
|
|
6
6
|
*
|
|
7
|
-
* Stateless
|
|
8
|
-
*
|
|
7
|
+
* Stateless apart from one per-reporter mark of the error objects it already recorded, so a failure
|
|
8
|
+
* that crosses two boundaries keeps one ID. Every dependency is a port the host passes; there is no
|
|
9
|
+
* optional sink, so an incident cannot be dropped for lack of wiring. Nothing here throws: a failing ID, clock, catalog, logger or
|
|
9
10
|
* tracker port must not replace the failure being reported; its adapter blanks secrets before anything leaves the process.
|
|
10
11
|
*/
|
|
11
|
-
import { ClientFacingError } from '../contracts/server/
|
|
12
|
+
import { ClientFacingError } from '../contracts/server/client-facing-error.js';
|
|
12
13
|
import { statusForError } from '../contracts/server/api-error.js';
|
|
13
14
|
import { createErrorDescriber, describeErrorForLog, describeErrorParts } from '../model-facing-tool-errors.js';
|
|
14
15
|
import { toIsoDateTime } from '../primitives/time.js';
|
|
@@ -22,10 +23,20 @@ export const UNAVAILABLE_ERROR_ID = 'ERR-0000-0000-0000-0000';
|
|
|
22
23
|
const MAX_RECORD_TEXT = 8192;
|
|
23
24
|
const MAX_PARAM_TEXT = 128;
|
|
24
25
|
const MAX_CAUSES = 3;
|
|
26
|
+
/** One short fixed-shape label: route patterns, dotted names, ids. `?`, `=`, `&`, spaces and quotes are
|
|
27
|
+
* outside it, so a raw URL with a query, a body field or free text cannot pass. It does not redact. */
|
|
28
|
+
const ATTRIBUTE_VALUE = /^[\w.:/-]{1,128}$/;
|
|
29
|
+
const ATTRIBUTE_NAME = /^[\w.-]{1,64}$/;
|
|
30
|
+
// Attributes become provider-side indexed fields; a bounded count keeps one incident from fanning out.
|
|
31
|
+
const MAX_ATTRIBUTES = 16;
|
|
25
32
|
function redactionFor({ context, exactSecrets }) {
|
|
26
33
|
// Whole fields are redacted before they are cut. PII stays readable in the operator record unless the host asks otherwise.
|
|
27
34
|
return { redactPii: false, ...context.redaction, exactSecrets: [...(context.redaction.exactSecrets ?? []), ...(exactSecrets ?? [])] };
|
|
28
35
|
}
|
|
36
|
+
/** The non-empty exact secrets of a merged policy; the policy type admits blank entries a caller may pass. */
|
|
37
|
+
function knownSecrets({ redaction }) {
|
|
38
|
+
return (redaction.exactSecrets ?? []).filter((secret) => typeof secret === 'string' && secret.length > 0);
|
|
39
|
+
}
|
|
29
40
|
function attempt({ read, fallback }) {
|
|
30
41
|
try {
|
|
31
42
|
return read();
|
|
@@ -50,15 +61,19 @@ function headLabel({ error, describer }) {
|
|
|
50
61
|
return parts.code === undefined ? parts.label : `${parts.label}(${parts.code})`;
|
|
51
62
|
}
|
|
52
63
|
function reportToTracker(required) {
|
|
53
|
-
const { context, incident,
|
|
64
|
+
const { context, incident, operation, tracker, error, level, exactSecrets, attributes } = required;
|
|
54
65
|
const failed = (trackerError) => {
|
|
55
66
|
// The host record above already holds the incident; say that the tracker copy is missing.
|
|
56
67
|
attempt({ fallback: undefined, read: () => context.ports.logger.warn({ message: `[incident] the tracker did not accept the report for error ${incident.errorId}` }, { meta: { errorId: incident.errorId, tracker: describeErrorForLog({ err: trackerError }) } }) });
|
|
57
68
|
};
|
|
58
69
|
try {
|
|
59
|
-
const
|
|
70
|
+
const trace = tracker?.traceIds?.();
|
|
71
|
+
const sent = context.ports.observability.reportError({
|
|
60
72
|
error,
|
|
61
|
-
|
|
73
|
+
// The original error goes to the adapter, so it also needs the exact values to blank; without
|
|
74
|
+
// them a token the request carried would leave the process verbatim in message or stack.
|
|
75
|
+
context: { operation, level, incidentId: incident.errorId, label: incident.label, ...(trace === undefined ? {} : { trace }),
|
|
76
|
+
...(attributes === undefined ? {} : { attributes }), ...(exactSecrets.length === 0 ? {} : { exactSecrets }) },
|
|
62
77
|
});
|
|
63
78
|
if (sent instanceof Promise)
|
|
64
79
|
sent.then(undefined, failed);
|
|
@@ -67,44 +82,109 @@ function reportToTracker(required) {
|
|
|
67
82
|
failed(trackerError);
|
|
68
83
|
}
|
|
69
84
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
85
|
+
function isObjectLike(value) {
|
|
86
|
+
return (typeof value === 'object' && value !== null) || typeof value === 'function';
|
|
87
|
+
}
|
|
88
|
+
function admissibleValue({ value, redaction, secrets }) {
|
|
89
|
+
// OperationAttributes admits strings and numbers only, so a boolean or object is dropped here too.
|
|
90
|
+
if (typeof value === 'number')
|
|
91
|
+
return Number.isFinite(value);
|
|
92
|
+
if (typeof value !== 'string' || !ATTRIBUTE_VALUE.test(value))
|
|
93
|
+
return false;
|
|
94
|
+
// The shape check does not redact: `[\w.:/-]` still fits a bearer token. A value holding a known
|
|
95
|
+
// exact secret, or one the redactor would change (a recognised token shape), is dropped whole.
|
|
96
|
+
// The redactor also blanks exact secrets; the explicit check states the rule without depending on
|
|
97
|
+
// how the redactor matches them.
|
|
98
|
+
return !secrets.some(secret => value.includes(secret)) && redactSecrets({ input: value }, redaction) === value;
|
|
99
|
+
}
|
|
100
|
+
/** The attributes allowed into a record and a report, or undefined so the field is omitted entirely. */
|
|
101
|
+
function admitAttributes({ attributes, redaction }) {
|
|
102
|
+
if (attributes === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
const secrets = knownSecrets({ redaction });
|
|
105
|
+
const accepted = [];
|
|
106
|
+
for (const [name, value] of attempt({ read: () => Object.entries(attributes), fallback: [] })) {
|
|
107
|
+
if (accepted.length >= MAX_ATTRIBUTES)
|
|
108
|
+
break;
|
|
109
|
+
if (ATTRIBUTE_NAME.test(name) && admissibleValue({ value, redaction, secrets }))
|
|
110
|
+
accepted.push([name, value]);
|
|
111
|
+
}
|
|
112
|
+
return accepted.length === 0 ? undefined : Object.freeze(Object.fromEntries(accepted));
|
|
113
|
+
}
|
|
114
|
+
/** The incident this reporter already wrote for this very error object, if any. Primitives are never
|
|
115
|
+
* matched: two thrown equal strings are indistinguishable from two separate failures. */
|
|
116
|
+
function priorIncident({ context, error }) {
|
|
117
|
+
const errorId = isObjectLike(error) ? context.reported.get(error) : undefined;
|
|
118
|
+
if (errorId === undefined)
|
|
119
|
+
return undefined;
|
|
120
|
+
return { errorId, label: attempt({ read: () => headLabel({ error, describer: context.describer }), fallback: 'Error' }) };
|
|
121
|
+
}
|
|
122
|
+
function writeHostRecord(required) {
|
|
123
|
+
const { context, error, incident, step, level, redaction, attributes } = required;
|
|
73
124
|
const { ports, describer } = context;
|
|
74
|
-
const
|
|
75
|
-
const errorId = optional.errorId ?? attempt({ read: () => ports.ids.newId(), fallback: UNAVAILABLE_ERROR_ID });
|
|
76
|
-
const time = attempt({ read: () => toIsoDateTime({ epochMs: ports.clock.nowMs() }), fallback: undefined });
|
|
77
|
-
const step = redactSecrets({ input: required.step }, redaction).slice(0, 512);
|
|
78
|
-
const label = attempt({ read: () => headLabel({ error, describer }), fallback: 'Error' });
|
|
125
|
+
const { errorId, label, time } = incident;
|
|
79
126
|
const diagnostic = redactSecrets({ input: describeThrownValue({ value: error }) }, redaction).slice(0, MAX_RECORD_TEXT);
|
|
80
|
-
const incident = { errorId, label, ...(time === undefined ? {} : { time }) };
|
|
81
|
-
const level = optional.level ?? 'error';
|
|
82
127
|
const meta = {
|
|
83
128
|
errorId, step, label, causes: attempt({ read: () => causeLabels({ error, describer }), fallback: [] }),
|
|
84
129
|
appVersion: ports.versions.app, jiniVersion: ports.versions.jini, ...(time === undefined ? {} : { time }), diagnostic,
|
|
130
|
+
...(attributes === undefined ? {} : { attributes }),
|
|
85
131
|
};
|
|
132
|
+
attempt({ fallback: undefined, read: () => ports.logger[level === 'warning' ? 'warn' : 'error']({ message: `[incident] ${step} failed (error ${errorId})` }, { meta }) });
|
|
133
|
+
}
|
|
134
|
+
/** Mints the ID, writes the one host record and (unless skipped) the one tracker report. The same
|
|
135
|
+
* error object a second time returns the first ID and writes nothing: the dedupe check runs before
|
|
136
|
+
* minting, so a second boundary cannot spend an ID or send a second report. */
|
|
137
|
+
function recordIncident(required, optional = {}) {
|
|
138
|
+
const { context, error } = required;
|
|
139
|
+
const prior = priorIncident({ context, error });
|
|
140
|
+
if (prior !== undefined)
|
|
141
|
+
return prior;
|
|
142
|
+
const redaction = redactionFor({ context, exactSecrets: optional.exactSecrets });
|
|
143
|
+
const errorId = optional.errorId ?? attempt({ read: () => context.ports.ids.newId(), fallback: UNAVAILABLE_ERROR_ID });
|
|
144
|
+
// Marked before any port is called, so a logger or tracker that re-enters this reporter with the same error finds the ID.
|
|
145
|
+
if (isObjectLike(error))
|
|
146
|
+
context.reported.set(error, errorId);
|
|
147
|
+
const time = attempt({ read: () => toIsoDateTime({ epochMs: context.ports.clock.nowMs() }), fallback: undefined });
|
|
148
|
+
const step = redactSecrets({ input: required.step }, redaction).slice(0, 512);
|
|
149
|
+
const label = attempt({ read: () => headLabel({ error, describer: context.describer }), fallback: 'Error' });
|
|
150
|
+
const incident = { errorId, label, ...(time === undefined ? {} : { time }) };
|
|
151
|
+
const level = optional.level ?? 'error';
|
|
152
|
+
const attributes = admitAttributes({ attributes: optional.attributes, redaction });
|
|
86
153
|
// `diagnostic` is the operator-only record. The tracker gets the original `error` and the call's `exactSecrets`; the tracker adapter blanks secrets before anything leaves the process.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
154
|
+
// Standing host secrets travel with them on `ErrorReport.context.exactSecrets` (see `reportToTracker`).
|
|
155
|
+
writeHostRecord({ context, error, incident, step, level, redaction, attributes });
|
|
156
|
+
if (optional.tracker !== 'skip') {
|
|
157
|
+
reportToTracker({ context, incident, operation: required.operation, tracker: required.tracker, error, level, exactSecrets: knownSecrets({ redaction }), attributes });
|
|
158
|
+
}
|
|
90
159
|
return incident;
|
|
91
160
|
}
|
|
92
161
|
function redactedParams({ params, redaction }) {
|
|
93
162
|
return Object.fromEntries(Object.entries(params).map(([name, value]) => [name, typeof value === 'number' ? value : redactSecrets({ input: value }, redaction).slice(0, MAX_PARAM_TEXT)]));
|
|
94
163
|
}
|
|
164
|
+
function refusalMessage(required, _optional = {}) {
|
|
165
|
+
const { match, fallback, audience } = required;
|
|
166
|
+
if (match.sentence?.audience === 'authorized' && audience !== 'authorized')
|
|
167
|
+
return { kind: 'text', message: fallback.message };
|
|
168
|
+
switch (match.mode) {
|
|
169
|
+
case 'own-message':
|
|
170
|
+
// Injected catalogs may supply the original exception text.
|
|
171
|
+
return { kind: 'text', message: fallback.message };
|
|
172
|
+
case 'fixed':
|
|
173
|
+
return { kind: 'text', message: match.message ?? fallback.message };
|
|
174
|
+
case 'sentence':
|
|
175
|
+
return match.sentence === undefined ? { kind: 'text', message: fallback.message } : { kind: 'sentence', sentence: match.sentence };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
95
178
|
/** The wire error of a refusal. Words a sentence reserves for authorised callers are replaced by the boundary's fallback words. */
|
|
96
179
|
function refusalError(required) {
|
|
97
180
|
const { match, fallback, audience, redaction } = required;
|
|
98
181
|
const { sentence } = match;
|
|
99
182
|
const base = { code: match.code, ...(sentence === undefined ? {} : { retryable: sentence.retryable }) };
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return { ...base, message: match.message ?? fallback.message };
|
|
104
|
-
if (sentence === undefined)
|
|
105
|
-
return { ...base, message: fallback.message };
|
|
183
|
+
const selected = refusalMessage({ match, fallback, audience });
|
|
184
|
+
if (selected.kind === 'text')
|
|
185
|
+
return { ...base, message: selected.message };
|
|
106
186
|
const params = redactedParams({ params: match.params ?? {}, redaction });
|
|
107
|
-
const message = interpolateSentence({ text: sentence.message }, { params });
|
|
187
|
+
const message = interpolateSentence({ text: selected.sentence.message }, { params });
|
|
108
188
|
return Object.keys(params).length === 0 ? { ...base, message } : { ...base, message, details: { params } };
|
|
109
189
|
}
|
|
110
190
|
function refusal(required) {
|
|
@@ -118,19 +198,26 @@ function refusal(required) {
|
|
|
118
198
|
const match = attempt({ read: () => catalog.match({ error, scope: required.scope }), fallback: undefined });
|
|
119
199
|
if (match === undefined)
|
|
120
200
|
return undefined;
|
|
121
|
-
const wire = refusalError({ match, fallback: required.fallback, audience: required.audience, redaction: redactionFor({ context }) });
|
|
201
|
+
const wire = refusalError({ match, fallback: required.fallback, audience: required.audience, redaction: redactionFor({ context, exactSecrets: required.exactSecrets }) });
|
|
122
202
|
return { kind: 'refusal', status: match.sentence?.status ?? statusForError({ error: wire }), error: wire };
|
|
123
203
|
}
|
|
204
|
+
function recordOptionsOf(optional) {
|
|
205
|
+
return { ...(optional.exactSecrets === undefined ? {} : { exactSecrets: optional.exactSecrets }), ...(optional.attributes === undefined ? {} : { attributes: optional.attributes }) };
|
|
206
|
+
}
|
|
124
207
|
function describeFailure(required, optional = {}) {
|
|
125
208
|
const { context } = required;
|
|
126
209
|
const audience = optional.audience ?? 'anonymous';
|
|
127
|
-
const refused = attempt({ read: () => refusal({ context, error: required.error, scope: required.scope, fallback: required.fallback, audience }), fallback: undefined });
|
|
210
|
+
const refused = attempt({ read: () => refusal({ context, error: required.error, scope: required.scope, fallback: required.fallback, audience, exactSecrets: optional.exactSecrets }), fallback: undefined });
|
|
128
211
|
if (refused !== undefined)
|
|
129
212
|
return refused;
|
|
130
|
-
|
|
213
|
+
// A supplied ID means another path already wrote this incident; otherwise recordIncident returns this
|
|
214
|
+
// reporter's earlier ID for the same error object, or writes the one record.
|
|
215
|
+
const incident = optional.errorId === undefined
|
|
216
|
+
? recordIncident({ context, error: required.error, step: required.step, operation: required.operation, tracker: required.tracker }, recordOptionsOf(optional))
|
|
217
|
+
: { errorId: optional.errorId, label: attempt({ read: () => headLabel({ error: required.error, describer: context.describer }), fallback: 'Error' }) };
|
|
131
218
|
const failure = attempt({ fallback: undefined, read: () => discloseIncident({ audience, step: required.step, label: incident.label, errorId: incident.errorId, fallback: required.fallback, versions: context.ports.versions }, { redaction: redactionFor({ context, exactSecrets: optional.exactSecrets }), ...(optional.approvedCause === undefined ? {} : { approvedCause: optional.approvedCause }), ...(incident.time === undefined ? {} : { time: incident.time }) }) });
|
|
132
219
|
// The ID is part of the words, so it survives a consumer that keeps only a message string.
|
|
133
|
-
const error = { code: 'INTERNAL_ERROR', message: `${required.fallback.message} (error ${incident.errorId})`, requestId: incident.errorId };
|
|
220
|
+
const error = { code: 'INTERNAL_ERROR', message: `${required.fallback.message} ${required.fallback.action} (error ${incident.errorId})`, requestId: incident.errorId };
|
|
134
221
|
return { kind: 'incident', status: 500, error, ...(failure === undefined ? {} : { failure }) };
|
|
135
222
|
}
|
|
136
223
|
/**
|
|
@@ -143,10 +230,111 @@ export function createErrorReporter(required, optional = {}) {
|
|
|
143
230
|
// The catalog's codes and labelled classes extend what a record may name; a catalog whose
|
|
144
231
|
// vocabulary cannot be read still leaves the built-in describer.
|
|
145
232
|
const describer = attempt({ read: () => createErrorDescriber(required.catalog.describerVocabulary()), fallback: { describeErrorParts, describeErrorForLog } });
|
|
146
|
-
|
|
233
|
+
// The dedupe mark is per reporter, never module-wide: two reporters (two hosts, two tests) share no hidden state.
|
|
234
|
+
const context = { ports: required, redaction: optional.redaction ?? {}, describer, reported: new WeakMap() };
|
|
147
235
|
return {
|
|
148
236
|
describe: (args, options = {}) => describeFailure({ context, ...args }, options),
|
|
149
|
-
record: (args, options = {}) => ({ errorId: recordIncident({ context,
|
|
237
|
+
record: (args, options = {}) => ({ errorId: recordIncident({ context, ...args }, options).errorId }),
|
|
150
238
|
};
|
|
151
239
|
}
|
|
240
|
+
/** Stands in when no tracker is wired or the host's tracker could not start one. Shared and frozen: it holds nothing. */
|
|
241
|
+
export const NOOP_OPERATION_TRACKER = Object.freeze({ run: (fn) => fn(), end: () => { } });
|
|
242
|
+
const COMPLETED = Object.freeze({ outcome: 'completed', failed: false });
|
|
243
|
+
/** Ports are typed synchronous, but an adapter may still hand back a promise; observe it so a rejection is never unhandled. */
|
|
244
|
+
function observe({ value }) {
|
|
245
|
+
if (value instanceof Promise)
|
|
246
|
+
value.then(undefined, () => undefined);
|
|
247
|
+
}
|
|
248
|
+
function isTracker(value) {
|
|
249
|
+
return isObjectLike(value) && typeof value.run === 'function' && typeof value.end === 'function';
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Starts one operation's tracker. A missing port, a throwing `trackOperation` or one that returns
|
|
253
|
+
* something other than a tracker (a promise, nothing) gives the noop tracker: telemetry failing must
|
|
254
|
+
* never stop the work it would have described. A pure helper, imported directly; not a port.
|
|
255
|
+
* @example const tracker = startOperation({ observability, name: 'tool.call', attributes: { 'tool.id': id } });
|
|
256
|
+
*/
|
|
257
|
+
export function startOperation(required, _optional = {}) {
|
|
258
|
+
const { observability, name, attributes } = required;
|
|
259
|
+
if (observability === undefined)
|
|
260
|
+
return NOOP_OPERATION_TRACKER;
|
|
261
|
+
const started = attempt({ fallback: undefined, read: () => observability.trackOperation({ name, ...(attributes === undefined ? {} : { attributes }) }) });
|
|
262
|
+
observe({ value: started });
|
|
263
|
+
return isTracker(started) ? started : NOOP_OPERATION_TRACKER;
|
|
264
|
+
}
|
|
265
|
+
// Trackers already ended. A tracker belongs to one operation, so "once per tracker" is "once per operation".
|
|
266
|
+
// Weak, so ended trackers are freed; the shared noop trackers end as no-ops, so marking them changes nothing.
|
|
267
|
+
const endedTrackers = new WeakSet();
|
|
268
|
+
/**
|
|
269
|
+
* Ends a tracker exactly once: a second call is a no-op, and a throwing `end` is contained, because
|
|
270
|
+
* the operation's result is already decided and telemetry must not change it. Takes the core outcome
|
|
271
|
+
* shape, so a feature's own labels (`timed-out`, `denied`) keep their names.
|
|
272
|
+
* @example endOnce({ tracker, verdict: { outcome: 'timed-out', failed: true } });
|
|
273
|
+
*/
|
|
274
|
+
export function endOnce(required, _optional = {}) {
|
|
275
|
+
const { tracker, verdict } = required;
|
|
276
|
+
if (endedTrackers.has(tracker))
|
|
277
|
+
return;
|
|
278
|
+
endedTrackers.add(tracker);
|
|
279
|
+
attempt({ fallback: undefined, read: () => observe({ value: tracker.end(verdict) }) });
|
|
280
|
+
}
|
|
281
|
+
/** The words a caller gets when the reporter itself broke: fixed text and the stand-in ID, nothing from the error. */
|
|
282
|
+
function reporterBreach({ fallback }) {
|
|
283
|
+
return { kind: 'incident', status: 500, error: { code: 'INTERNAL_ERROR', message: `${fallback.message} ${fallback.action} (error ${UNAVAILABLE_ERROR_ID})`, requestId: UNAVAILABLE_ERROR_ID } };
|
|
284
|
+
}
|
|
285
|
+
function settleThrown(required, optional) {
|
|
286
|
+
const { run, tracker, error } = required;
|
|
287
|
+
const settled = attempt({ fallback: undefined, read: () => run.settle?.(error) });
|
|
288
|
+
// Only cancellation may skip the reporter. Any other answer is ignored, so a settle hook cannot
|
|
289
|
+
// relabel an incident as a refusal and hide it from the host record.
|
|
290
|
+
if (settled?.outcome === 'cancelled')
|
|
291
|
+
return { ok: false, cancelled: true, verdict: settled };
|
|
292
|
+
const { reporter } = run.deps;
|
|
293
|
+
const options = optional.attributes === undefined && run.attributes !== undefined ? { ...optional, attributes: run.attributes } : optional;
|
|
294
|
+
const failure = attempt({ fallback: reporterBreach({ fallback: run.fallback }),
|
|
295
|
+
read: () => reporter.describe({ error, operation: run.operation, scope: run.scope, step: run.step, fallback: run.fallback, tracker }, options) });
|
|
296
|
+
const failed = failure.kind === 'incident';
|
|
297
|
+
return { ok: false, failure, verdict: { outcome: failed ? 'failed' : 'refused', failed } };
|
|
298
|
+
}
|
|
299
|
+
/** The verdict of a resolved value. A throwing classifier leaves the value standing (the work did
|
|
300
|
+
* finish and must not be retried) and is itself recorded, so the bug is visible to the operator. */
|
|
301
|
+
function classifyValue(required) {
|
|
302
|
+
const { run, tracker, value } = required;
|
|
303
|
+
if (run.classify === undefined)
|
|
304
|
+
return COMPLETED;
|
|
305
|
+
try {
|
|
306
|
+
return run.classify(value);
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
attempt({ fallback: undefined, read: () => run.deps.reporter.record({ error, step: `${run.step} (judge the result)`, operation: run.operation, tracker }) });
|
|
310
|
+
return COMPLETED;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
async function settleWork(required, optional) {
|
|
314
|
+
const { run, tracker } = required;
|
|
315
|
+
let value;
|
|
316
|
+
try {
|
|
317
|
+
// A throw from the tracker's own run() is indistinguishable from the work's, and is reported as it;
|
|
318
|
+
// the work is never started a second time without the tracker.
|
|
319
|
+
value = await tracker.run(run.work);
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
return settleThrown({ run, tracker, error }, optional);
|
|
323
|
+
}
|
|
324
|
+
return { ok: true, value, verdict: classifyValue({ run, tracker, value }) };
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Runs one feature operation under a tracker: the work's value, its refusal, its incident (one ID,
|
|
328
|
+
* one record, one report), or a cancellation that reports nothing. The tracker ends exactly once,
|
|
329
|
+
* after the result is settled and outside the work's catch, so a broken tracker can neither turn a
|
|
330
|
+
* success into an incident nor reject this call.
|
|
331
|
+
* @example const run = await runOperation({ deps: { reporter, observability }, operation: 'site.export', scope: 'sites', step: 'Export site', fallback, work });
|
|
332
|
+
*/
|
|
333
|
+
export async function runOperation(required, optional = {}) {
|
|
334
|
+
const { deps, operation, attributes } = required;
|
|
335
|
+
const tracker = startOperation({ observability: deps.observability, name: operation, attributes });
|
|
336
|
+
const result = await settleWork({ run: required, tracker }, optional);
|
|
337
|
+
endOnce({ tracker, verdict: result.verdict });
|
|
338
|
+
return result;
|
|
339
|
+
}
|
|
152
340
|
//# sourceMappingURL=reporter.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A route's deliberate, caller-visible refusal: thrown by a host guard or handler and turned
|
|
3
|
+
* into the host's own wire envelope by its `onError` port.
|
|
4
|
+
*/
|
|
5
|
+
/** Only deliberate HTTP rejections carry caller-visible text; other errors use the host's error mappings. */
|
|
6
|
+
export declare class RouteRefusalError extends Error {
|
|
7
|
+
readonly response: {
|
|
8
|
+
status: number;
|
|
9
|
+
body: unknown;
|
|
10
|
+
};
|
|
11
|
+
constructor(response: {
|
|
12
|
+
status: number;
|
|
13
|
+
body: unknown;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Reject with the host's flat JSON envelope, preserving absent code/details fields.
|
|
17
|
+
* @returns Never; the injected adapter error port writes the response.
|
|
18
|
+
* @complexity O(1) time/space.
|
|
19
|
+
*/
|
|
20
|
+
export declare function rejectRoute(required: {
|
|
21
|
+
status: number;
|
|
22
|
+
error: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
details?: {
|
|
25
|
+
permission: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
};
|
|
28
|
+
}, _optional?: Record<string, never>): never;
|
|
29
|
+
//# sourceMappingURL=route-refusal.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A route's deliberate, caller-visible refusal: thrown by a host guard or handler and turned
|
|
3
|
+
* into the host's own wire envelope by its `onError` port.
|
|
4
|
+
*/
|
|
5
|
+
/** Only deliberate HTTP rejections carry caller-visible text; other errors use the host's error mappings. */
|
|
6
|
+
export class RouteRefusalError extends Error {
|
|
7
|
+
response;
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super("settings request rejected");
|
|
10
|
+
this.response = response;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Reject with the host's flat JSON envelope, preserving absent code/details fields.
|
|
14
|
+
* @returns Never; the injected adapter error port writes the response.
|
|
15
|
+
* @complexity O(1) time/space.
|
|
16
|
+
*/
|
|
17
|
+
export function rejectRoute(required, _optional = {}) {
|
|
18
|
+
const body = { error: required.error };
|
|
19
|
+
if (required.code !== undefined)
|
|
20
|
+
body.code = required.code;
|
|
21
|
+
if (required.details !== undefined)
|
|
22
|
+
body.details = required.details;
|
|
23
|
+
throw new RouteRefusalError({ status: required.status, body });
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=route-refusal.js.map
|
package/dist/errors/testing.d.ts
CHANGED
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
* never a mock of another package's internals.
|
|
4
4
|
*/
|
|
5
5
|
import type { IdGenerator } from '../primitives/ids.js';
|
|
6
|
+
import type { ErrorReport, ObservabilityPort } from '../contracts/observability.js';
|
|
6
7
|
import type { LogDiagnosticRecord, Logger } from '../primitives/logger.js';
|
|
7
8
|
import type { Clock } from '../primitives/time.js';
|
|
8
9
|
import { type ErrorCatalog } from './catalog.js';
|
|
9
|
-
import { type ErrorReporter, type ErrorReporterOptions
|
|
10
|
+
import { type ErrorReporter, type ErrorReporterOptions } from './reporter.js';
|
|
10
11
|
/** A logger that keeps every call exactly as made, original error objects included. */
|
|
11
12
|
export declare function createRecordingLogger(): {
|
|
12
13
|
readonly logger: Logger;
|
|
13
14
|
readonly entries: LogDiagnosticRecord[];
|
|
14
15
|
};
|
|
15
16
|
/** A tracker that keeps every report. */
|
|
16
|
-
export declare function
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
readonly reports: IncidentTrackerReport[];
|
|
17
|
+
export declare function createRecordingObservability(): {
|
|
18
|
+
readonly observability: Pick<ObservabilityPort, 'reportError' | 'trackOperation'>;
|
|
19
|
+
readonly reports: ErrorReport[];
|
|
21
20
|
};
|
|
22
21
|
/** Hands out the given IDs in order; throws when a test asks for more than it listed. */
|
|
23
22
|
export declare function createSequenceIds(required: {
|
|
@@ -45,6 +44,6 @@ export declare function createRecordingReporter(required: {
|
|
|
45
44
|
}, optional?: RecordingReporterOptions): {
|
|
46
45
|
readonly reporter: ErrorReporter;
|
|
47
46
|
readonly entries: LogDiagnosticRecord[];
|
|
48
|
-
readonly reports:
|
|
47
|
+
readonly reports: ErrorReport[];
|
|
49
48
|
};
|
|
50
49
|
//# sourceMappingURL=testing.d.ts.map
|
package/dist/errors/testing.js
CHANGED
|
@@ -9,9 +9,12 @@ export function createRecordingLogger() {
|
|
|
9
9
|
return { logger: { info: write('info'), warn: write('warn'), error: write('error') }, entries };
|
|
10
10
|
}
|
|
11
11
|
/** A tracker that keeps every report. */
|
|
12
|
-
export function
|
|
12
|
+
export function createRecordingObservability() {
|
|
13
13
|
const reports = [];
|
|
14
|
-
return {
|
|
14
|
+
return { observability: {
|
|
15
|
+
reportError: report => { reports.push(report); },
|
|
16
|
+
trackOperation: () => ({ run: fn => fn(), end() { }, traceIds: () => ({ traceId: 'test-trace', spanId: 'test-span' }) }),
|
|
17
|
+
}, reports };
|
|
15
18
|
}
|
|
16
19
|
/** Hands out the given IDs in order; throws when a test asks for more than it listed. */
|
|
17
20
|
export function createSequenceIds(required) {
|
|
@@ -36,9 +39,9 @@ export function createFixedClock(required) {
|
|
|
36
39
|
*/
|
|
37
40
|
export function createRecordingReporter(required, optional = {}) {
|
|
38
41
|
const { logger, entries } = createRecordingLogger();
|
|
39
|
-
const {
|
|
42
|
+
const { observability, reports } = createRecordingObservability();
|
|
40
43
|
const { catalog = createErrorCatalog({ sentences: [], scopes: [] }), versions = { app: '0.0.0-test', jini: '0.0.0-test' }, ...reporterOptions } = optional;
|
|
41
|
-
const reporter = createErrorReporter({ ids: createSequenceIds({ ids: required.ids }), clock: createFixedClock({ iso: required.iso }), logger,
|
|
44
|
+
const reporter = createErrorReporter({ ids: createSequenceIds({ ids: required.ids }), clock: createFixedClock({ iso: required.iso }), logger, observability, catalog, versions }, reporterOptions);
|
|
42
45
|
return { reporter, entries, reports };
|
|
43
46
|
}
|
|
44
47
|
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The three capability strings common to a host's two extension mechanisms —
|
|
3
|
+
* `plugin-runtime` and `site-glue` — declared exactly once.
|
|
4
|
+
*
|
|
5
|
+
* Both mechanisms' own manifest validators (`packages/plugins/src/host/manifest.ts`,
|
|
6
|
+
* `packages/plugins/src/glue/manifest.ts`) independently need `content.read` / `content.extend` /
|
|
7
|
+
* `hooks.attach`: `plugin-runtime`'s is its entire v1 capability vocabulary; `site-glue`'s is the
|
|
8
|
+
* first three members of its own eight-member superset (the remaining five —
|
|
9
|
+
* `tools.register`, `events.subscribe`, `admin.nav.register`, `render.contribute`,
|
|
10
|
+
* `http.route.register` — are glue-only and never cross into `plugin-runtime`'s surface).
|
|
11
|
+
*
|
|
12
|
+
* This module exists so that overlap is a single declaration, imported by both, rather than two
|
|
13
|
+
* independent by-value literals that happen to agree today and can silently drift tomorrow
|
|
14
|
+
* below both features. Neither feature imports the other; both import this neutral module,
|
|
15
|
+
* preserving the deliberate boundary each feature's own
|
|
16
|
+
* manifest.ts documents in its own header (no plugin-runtime dependency inside site-glue, and
|
|
17
|
+
* vice versa).
|
|
18
|
+
*
|
|
19
|
+
* Dependency-free, no I/O — a "policy constant `core/` module", kept out of `src/contracts` because the
|
|
20
|
+
* frozen array is a runtime value.
|
|
21
|
+
*/
|
|
22
|
+
/** The capability vocabulary `plugin-runtime` and `site-glue` declare identically. */
|
|
23
|
+
export type SharedExtensionCapability = "content.read" | "content.extend" | "hooks.attach";
|
|
24
|
+
/** Iterable form of {@link SharedExtensionCapability}, so both features build their own
|
|
25
|
+
* (possibly wider) `Set`/vocabulary from this array rather than retyping the three string
|
|
26
|
+
* literals. Frozen — a shared array a caller could mutate would defeat the point of a single
|
|
27
|
+
* source of truth. */
|
|
28
|
+
export declare const SHARED_EXTENSION_CAPABILITIES: readonly SharedExtensionCapability[];
|
|
29
|
+
//# sourceMappingURL=extension-capability-vocabulary.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The three capability strings common to a host's two extension mechanisms —
|
|
3
|
+
* `plugin-runtime` and `site-glue` — declared exactly once.
|
|
4
|
+
*
|
|
5
|
+
* Both mechanisms' own manifest validators (`packages/plugins/src/host/manifest.ts`,
|
|
6
|
+
* `packages/plugins/src/glue/manifest.ts`) independently need `content.read` / `content.extend` /
|
|
7
|
+
* `hooks.attach`: `plugin-runtime`'s is its entire v1 capability vocabulary; `site-glue`'s is the
|
|
8
|
+
* first three members of its own eight-member superset (the remaining five —
|
|
9
|
+
* `tools.register`, `events.subscribe`, `admin.nav.register`, `render.contribute`,
|
|
10
|
+
* `http.route.register` — are glue-only and never cross into `plugin-runtime`'s surface).
|
|
11
|
+
*
|
|
12
|
+
* This module exists so that overlap is a single declaration, imported by both, rather than two
|
|
13
|
+
* independent by-value literals that happen to agree today and can silently drift tomorrow
|
|
14
|
+
* below both features. Neither feature imports the other; both import this neutral module,
|
|
15
|
+
* preserving the deliberate boundary each feature's own
|
|
16
|
+
* manifest.ts documents in its own header (no plugin-runtime dependency inside site-glue, and
|
|
17
|
+
* vice versa).
|
|
18
|
+
*
|
|
19
|
+
* Dependency-free, no I/O — a "policy constant `core/` module", kept out of `src/contracts` because the
|
|
20
|
+
* frozen array is a runtime value.
|
|
21
|
+
*/
|
|
22
|
+
/** Iterable form of {@link SharedExtensionCapability}, so both features build their own
|
|
23
|
+
* (possibly wider) `Set`/vocabulary from this array rather than retyping the three string
|
|
24
|
+
* literals. Frozen — a shared array a caller could mutate would defeat the point of a single
|
|
25
|
+
* source of truth. */
|
|
26
|
+
export const SHARED_EXTENSION_CAPABILITIES = Object.freeze([
|
|
27
|
+
"content.read",
|
|
28
|
+
"content.extend",
|
|
29
|
+
"hooks.attach",
|
|
30
|
+
]);
|
|
31
|
+
//# sourceMappingURL=extension-capability-vocabulary.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export * from './origin-validation.js';
|
|
|
17
17
|
export * from './principal.js';
|
|
18
18
|
export * from './surface-exchanges.js';
|
|
19
19
|
export type * from './surface-cards.js';
|
|
20
|
-
export type { AuthorizationDecision, RunRef, SurfaceEmission, SurfaceEmitter, ToolAuthorizationContext, ToolDescriptor, ToolExecutionContext, ToolExecutionOptions, ToolApprovalDecision, ToolHandler, ToolPolicy, ToolRegistration, ToolRegistry, } from './tool-registry.js';
|
|
20
|
+
export type { AuthorizationDecision, RunRef, SurfaceEmission, SurfaceEmitter, ToolAuthorizationContext, ToolDescriptor, ToolExecutionContext, ToolExecutionOptions, ToolApprovalDecision, ToolHandler, ToolOutputMismatchDiagnostic, ToolOutputMismatchReporter, ToolOutputValidator, ToolPolicy, ToolRegistration, ToolRegistry, } from './tool-registry.js';
|
|
21
21
|
export { createToolRegistrationScope, toolRegistryRevision, createToolRegistry, isReadOnlyTool, toolDiscoveryMetadata, ToolInputError } from './tool-registry.js';
|
|
22
22
|
export * from './tool-tokens.js';
|
|
23
23
|
export * from './tool-exposure.js';
|
|
@@ -38,6 +38,7 @@ export { ForbiddenError as ToolPermissionDeniedError, requireToolPermission, ada
|
|
|
38
38
|
export { evaluateFeatureFlag, type FeatureFlagDecision } from './feature-flags.js';
|
|
39
39
|
export { normalizeToolInput, withNormalizationNotes, ToolInputNormalizationError, type NormalizedToolInput, type ToolInputNormalizer } from './tool-input-normalization.js';
|
|
40
40
|
export { decodeToolInputObject, unwrapToolInputEnvelope } from './tool-input-envelope.js';
|
|
41
|
+
export { dispatchByIdPresence, renameInputSelector, renameInputSelectors, renameSchemaSelector, rewriteSchemaDescriptions, unionInputSchema, valueAtPath, type ReadCardSchema } from './tool-read-cards.js';
|
|
41
42
|
export { applyBatchInputs, BATCH_GUIDANCE_MARKER, withoutBatchGuidance, batchOutcomeFor, batchDescriptorFor, batchItemRequiredFields, batchEligibilityFor, defaultBatchableTools, withBatchInput, DEFAULT_MAX_BATCH_ITEMS, type BatchableTool, type BatchEligibility, type BatchOptOut, type BatchResult, type BatchItemResult } from './batch-tool-inputs.js';
|
|
42
43
|
export type { MediaProviderCatalogPolicy, MediaProviderOption, ProviderPreset, ProviderPresetKind } from './provider-catalog.js';
|
|
43
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -32,5 +32,6 @@ export { ForbiddenError as ToolPermissionDeniedError, requireToolPermission, ada
|
|
|
32
32
|
export { evaluateFeatureFlag } from './feature-flags.js';
|
|
33
33
|
export { normalizeToolInput, withNormalizationNotes, ToolInputNormalizationError } from './tool-input-normalization.js';
|
|
34
34
|
export { decodeToolInputObject, unwrapToolInputEnvelope } from './tool-input-envelope.js';
|
|
35
|
+
export { dispatchByIdPresence, renameInputSelector, renameInputSelectors, renameSchemaSelector, rewriteSchemaDescriptions, unionInputSchema, valueAtPath } from './tool-read-cards.js';
|
|
35
36
|
export { applyBatchInputs, BATCH_GUIDANCE_MARKER, withoutBatchGuidance, batchOutcomeFor, batchDescriptorFor, batchItemRequiredFields, batchEligibilityFor, defaultBatchableTools, withBatchInput, DEFAULT_MAX_BATCH_ITEMS } from './batch-tool-inputs.js';
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The opaque `${createdAt}::${id}` keyset cursor shared by the `(created_at, id)`-ordered
|
|
3
|
+
* list queries (the database ledger, the comment moderation queue).
|
|
4
|
+
*
|
|
5
|
+
* The cursor carries the position itself rather than naming a row to look up, so a page resumes
|
|
6
|
+
* correctly even after the row it ended on was deleted: the comment queue's cursor used to be the
|
|
7
|
+
* last comment's id, and once another moderator purged that comment, every "Load more" was refused
|
|
8
|
+
* with "invalid cursor" and retrying sent the same cursor forever.
|
|
9
|
+
*/
|
|
10
|
+
/** A position in a `(created_at, id)` order. */
|
|
11
|
+
export type KeysetPosition = {
|
|
12
|
+
createdAt: string;
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
/** Builds the cursor for the row a page ended on. @complexity O(1). */
|
|
16
|
+
export declare function encodeKeysetCursor(required: KeysetPosition, _optional?: Record<string, never>): string;
|
|
17
|
+
/** Splits a cursor {@link encodeKeysetCursor} built. A cursor it could not have built used to decode
|
|
18
|
+
* to `null` and read as "no cursor", silently restarting the scan from its first page (the newest
|
|
19
|
+
* ledger row; the oldest queued comment).
|
|
20
|
+
* @throws {ToolInputError} `invalid cursor` (a 400 to the tool and admin transports alike).
|
|
21
|
+
* @complexity O(cursor length). */
|
|
22
|
+
export declare function decodeKeysetCursor(required: {
|
|
23
|
+
cursor: string;
|
|
24
|
+
}, _optional?: Record<string, never>): KeysetPosition;
|
|
25
|
+
//# sourceMappingURL=keyset-cursor.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ToolInputError } from "./tool-input-errors.js";
|
|
2
|
+
/** Builds the cursor for the row a page ended on. @complexity O(1). */
|
|
3
|
+
export function encodeKeysetCursor(required, _optional = {}) {
|
|
4
|
+
return `${required.createdAt}::${required.id}`;
|
|
5
|
+
}
|
|
6
|
+
/** Splits a cursor {@link encodeKeysetCursor} built. A cursor it could not have built used to decode
|
|
7
|
+
* to `null` and read as "no cursor", silently restarting the scan from its first page (the newest
|
|
8
|
+
* ledger row; the oldest queued comment).
|
|
9
|
+
* @throws {ToolInputError} `invalid cursor` (a 400 to the tool and admin transports alike).
|
|
10
|
+
* @complexity O(cursor length). */
|
|
11
|
+
export function decodeKeysetCursor(required, _optional = {}) {
|
|
12
|
+
const separatorIndex = required.cursor.indexOf("::");
|
|
13
|
+
const createdAt = required.cursor.slice(0, separatorIndex);
|
|
14
|
+
const id = required.cursor.slice(separatorIndex + 2);
|
|
15
|
+
if (separatorIndex < 0 || id.length === 0 || Number.isNaN(Date.parse(createdAt))) {
|
|
16
|
+
throw new ToolInputError({ message: "invalid cursor" });
|
|
17
|
+
}
|
|
18
|
+
return { createdAt, id };
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=keyset-cursor.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RememberedApprovalPort } from './approval.js';
|
|
2
|
+
import type { Clock } from './primitives/index.js';
|
|
3
|
+
import type { ConversationToolApprovalStore } from './contracts/site/assistant-mcp-services.js';
|
|
4
|
+
/** Adapt native escalation grants to the existing external-MCP remembered approval store.
|
|
5
|
+
* Real conversations remain the persistence/revocation parents; the content store's server FK
|
|
6
|
+
* cannot hold a native plugin. Identity keys are host-generated and never taken from callback input.
|
|
7
|
+
* @param required.store The existing durable chat grant repository (or its shared memory fake).
|
|
8
|
+
* @returns A core grant port scoped to workspace, delegating human, plugin and version/digest.
|
|
9
|
+
* @throws ToolInputError if the host cannot bind a real conversation or store identity lookups.
|
|
10
|
+
* @complexity One bounded SQL lookup/write; the memory adapter scans its grant rows.
|
|
11
|
+
* @example createNativeApprovalMemory({ store, workspaceId, conversationIdForRun, clock });
|
|
12
|
+
*/
|
|
13
|
+
export declare function createNativeApprovalMemory({ store, workspaceId, conversationIdForRun, clock }: {
|
|
14
|
+
store: ConversationToolApprovalStore;
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
clock: Clock;
|
|
17
|
+
conversationIdForRun: (required: {
|
|
18
|
+
runId: string;
|
|
19
|
+
principalId: string;
|
|
20
|
+
}) => string | undefined;
|
|
21
|
+
}, _optional?: {}): RememberedApprovalPort;
|
|
22
|
+
//# sourceMappingURL=native-approval-memory.d.ts.map
|