glirastes 0.4.0 → 0.5.0
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 +361 -1
- package/README.md +304 -853
- package/adapter/nextjs/package.json +5 -0
- package/ai-sdk/package.json +5 -0
- package/browser/package.json +5 -0
- package/contracts/package.json +5 -0
- package/dist/agent/git.d.ts +65 -0
- package/dist/agent/git.js +122 -0
- package/dist/agent/git.js.map +1 -0
- package/dist/agent/openrouter.d.ts +56 -0
- package/dist/agent/openrouter.js +74 -0
- package/dist/agent/openrouter.js.map +1 -0
- package/dist/agent/platform-jobs.d.ts +102 -0
- package/dist/agent/platform-jobs.js +122 -0
- package/dist/agent/platform-jobs.js.map +1 -0
- package/dist/agent/runner.d.ts +150 -0
- package/dist/agent/runner.js +250 -0
- package/dist/agent/runner.js.map +1 -0
- package/dist/agent/workspace.d.ts +65 -0
- package/dist/agent/workspace.js +264 -0
- package/dist/agent/workspace.js.map +1 -0
- package/dist/browser/client-actions.d.ts +26 -0
- package/dist/browser/client-actions.js +42 -0
- package/dist/browser/client-actions.js.map +1 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.js +5 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/navigation.d.ts +32 -0
- package/dist/browser/navigation.js +79 -0
- package/dist/browser/navigation.js.map +1 -0
- package/dist/browser/query-filters.d.ts +30 -0
- package/dist/browser/query-filters.js +85 -0
- package/dist/browser/query-filters.js.map +1 -0
- package/dist/browser/ui-action-bus.d.ts +26 -0
- package/dist/browser/ui-action-bus.js +66 -0
- package/dist/browser/ui-action-bus.js.map +1 -0
- package/dist/cjs/browser/client-actions.d.ts +26 -0
- package/dist/cjs/browser/client-actions.js +45 -0
- package/dist/cjs/browser/index.d.ts +4 -0
- package/dist/cjs/browser/index.js +16 -0
- package/dist/cjs/browser/navigation.d.ts +32 -0
- package/dist/cjs/browser/navigation.js +84 -0
- package/dist/cjs/browser/query-filters.d.ts +30 -0
- package/dist/cjs/browser/query-filters.js +87 -0
- package/dist/cjs/browser/ui-action-bus.d.ts +26 -0
- package/dist/cjs/browser/ui-action-bus.js +70 -0
- package/dist/cjs/codegen/execution-inventory.d.ts +63 -0
- package/dist/cjs/codegen/execution-inventory.js +312 -0
- package/dist/cjs/codegen/index.d.ts +4 -13
- package/dist/cjs/codegen/index.js +13 -31
- package/dist/cjs/codegen/inventory-generation.d.ts +104 -0
- package/dist/cjs/codegen/inventory-generation.js +122 -0
- package/dist/cjs/codegen/next-source-generation.d.ts +17 -0
- package/dist/cjs/codegen/next-source-generation.js +51 -0
- package/dist/cjs/codegen/openapi-document.d.ts +53 -0
- package/dist/cjs/codegen/openapi-document.js +127 -0
- package/dist/cjs/codegen/route-exports.d.ts +13 -0
- package/dist/cjs/codegen/route-exports.js +122 -0
- package/dist/cjs/codegen/route-fingerprint.d.ts +2 -0
- package/dist/cjs/codegen/route-fingerprint.js +11 -0
- package/dist/cjs/codegen/route-scanner.d.ts +57 -0
- package/dist/cjs/codegen/route-scanner.js +239 -0
- package/dist/cjs/codegen/tools/canonical.d.ts +12 -0
- package/dist/cjs/codegen/tools/canonical.js +49 -0
- package/dist/cjs/codegen/tools/sources/nest-decorators.d.ts +27 -0
- package/dist/cjs/codegen/tools/sources/nest-decorators.js +73 -0
- package/dist/cjs/contracts/app-setup.d.ts +346 -0
- package/dist/cjs/contracts/app-setup.js +208 -0
- package/dist/cjs/contracts/chat-command.d.ts +65 -0
- package/dist/cjs/contracts/chat-command.js +128 -0
- package/dist/cjs/contracts/chat-interactions.d.ts +126 -0
- package/dist/cjs/contracts/chat-interactions.js +439 -0
- package/dist/cjs/contracts/clarification.d.ts +53 -0
- package/dist/cjs/contracts/clarification.js +91 -0
- package/dist/cjs/contracts/content-boundary.d.ts +3 -0
- package/dist/cjs/contracts/content-boundary.js +95 -0
- package/dist/cjs/contracts/events.d.ts +273 -0
- package/dist/cjs/contracts/events.js +229 -0
- package/dist/cjs/contracts/index.d.ts +18 -0
- package/dist/cjs/contracts/index.js +83 -0
- package/dist/cjs/contracts/plan.d.ts +20 -0
- package/dist/cjs/contracts/plan.js +38 -0
- package/dist/cjs/contracts/platform-connection.d.ts +44 -0
- package/dist/cjs/contracts/platform-connection.js +66 -0
- package/dist/cjs/contracts/platform-prompt-revision.d.ts +27 -0
- package/dist/cjs/contracts/platform-prompt-revision.js +46 -0
- package/dist/cjs/contracts/prompt-bundle.d.ts +46 -0
- package/dist/cjs/contracts/prompt-bundle.js +74 -0
- package/dist/cjs/contracts/revisions.d.ts +716 -0
- package/dist/cjs/contracts/revisions.js +301 -0
- package/dist/cjs/contracts/runtime.d.ts +55 -0
- package/dist/cjs/contracts/runtime.js +67 -0
- package/dist/cjs/contracts/semantic-change.d.ts +27 -0
- package/dist/cjs/contracts/semantic-change.js +103 -0
- package/dist/cjs/contracts/tool-exclude-pattern.d.ts +12 -0
- package/dist/cjs/contracts/tool-exclude-pattern.js +29 -0
- package/dist/cjs/contracts/tool-policy-entry.d.ts +107 -0
- package/dist/cjs/contracts/tool-policy-entry.js +42 -0
- package/dist/cjs/contracts/tool-policy.d.ts +198 -0
- package/dist/cjs/contracts/tool-policy.js +500 -0
- package/dist/cjs/contracts/url.d.ts +2 -0
- package/dist/cjs/contracts/url.js +10 -0
- package/dist/cjs/diagnostics/foundation-diagnostic.d.ts +34 -0
- package/dist/cjs/diagnostics/foundation-diagnostic.js +52 -0
- package/dist/cjs/diagnostics/index.d.ts +2 -0
- package/dist/cjs/diagnostics/index.js +7 -0
- package/dist/cjs/embed/chat-styles.generated.d.ts +1 -0
- package/dist/cjs/embed/chat-styles.generated.js +6 -0
- package/dist/cjs/embed/glirastes-chat-element.d.ts +67 -0
- package/dist/cjs/embed/glirastes-chat-element.js +282 -0
- package/dist/cjs/embed/index.d.ts +4 -0
- package/dist/cjs/embed/index.js +20 -0
- package/dist/cjs/embed/theme.d.ts +10 -0
- package/dist/cjs/embed/theme.js +45 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/react/assistant/assistant-layout.d.ts +55 -0
- package/dist/cjs/react/assistant/assistant-layout.js +107 -0
- package/dist/cjs/react/assistant/assistant-shell.d.ts +132 -0
- package/dist/cjs/react/assistant/assistant-shell.js +267 -0
- package/dist/cjs/react/assistant/assistant-shortcut-list.d.ts +24 -0
- package/dist/cjs/react/assistant/assistant-shortcut-list.js +35 -0
- package/dist/cjs/react/assistant/assistant-workspace.d.ts +31 -0
- package/dist/cjs/react/assistant/assistant-workspace.js +33 -0
- package/dist/cjs/react/completions/completion-search.d.ts +21 -0
- package/dist/cjs/react/completions/completion-search.js +111 -0
- package/dist/cjs/react/completions/ui-tool-command-provider.d.ts +15 -0
- package/dist/cjs/react/completions/ui-tool-command-provider.js +84 -0
- package/dist/cjs/react/components/activity-log.d.ts +17 -0
- package/dist/cjs/react/components/activity-log.js +70 -0
- package/dist/cjs/react/components/ai-chat-panel.js +13 -6
- package/dist/cjs/react/components/ai-trigger-button.d.ts +1 -1
- package/dist/cjs/react/components/ai-trigger-button.js +11 -66
- package/dist/cjs/react/components/chat-input.js +6 -4
- package/dist/cjs/react/components/chat-window-visibility.d.ts +3 -0
- package/dist/cjs/react/components/chat-window-visibility.js +7 -0
- package/dist/cjs/react/components/chat-window.d.ts +1 -1
- package/dist/cjs/react/components/chat-window.js +124 -57
- package/dist/cjs/react/components/clarification-card.d.ts +10 -0
- package/dist/cjs/react/components/clarification-card.js +35 -0
- package/dist/cjs/react/components/command-arguments-form.d.ts +10 -0
- package/dist/cjs/react/components/command-arguments-form.js +153 -0
- package/dist/cjs/react/components/confirm-dialog.js +1 -1
- package/dist/cjs/react/components/floating-chat-ui.d.ts +3 -3
- package/dist/cjs/react/components/floating-chat-ui.js +30 -4
- package/dist/cjs/react/components/mention-input.d.ts +5 -4
- package/dist/cjs/react/components/mention-input.js +64 -7
- package/dist/cjs/react/components/message-bubble.js +90 -14
- package/dist/cjs/react/components/plan-checklist.d.ts +14 -0
- package/dist/cjs/react/components/plan-checklist.js +20 -0
- package/dist/cjs/react/components/recording-bar.js +44 -58
- package/dist/cjs/react/components/rich-mention-input.js +197 -45
- package/dist/cjs/react/components/session-switcher.d.ts +3 -1
- package/dist/cjs/react/components/session-switcher.js +26 -11
- package/dist/cjs/react/components/status-icon.d.ts +8 -0
- package/dist/cjs/react/components/status-icon.js +11 -0
- package/dist/cjs/react/components/stream-waveform.d.ts +4 -0
- package/dist/cjs/react/components/stream-waveform.js +49 -0
- package/dist/cjs/react/components/voice-input-addon.d.ts +16 -1
- package/dist/cjs/react/components/voice-input-addon.js +255 -18
- package/dist/cjs/react/components/voice-input-button.js +1 -1
- package/dist/cjs/react/hooks/use-chat-shortcuts.d.ts +33 -0
- package/dist/cjs/react/hooks/use-chat-shortcuts.js +139 -0
- package/dist/cjs/react/hooks/use-deepgram-transcription.d.ts +4 -0
- package/dist/cjs/react/hooks/use-deepgram-transcription.js +31 -321
- package/dist/cjs/react/hooks/use-drag-resize-panel.d.ts +1 -0
- package/dist/cjs/react/hooks/use-drag-resize-panel.js +246 -121
- package/dist/cjs/react/hooks/use-floating-panel.d.ts +57 -0
- package/dist/cjs/react/hooks/use-floating-panel.js +217 -0
- package/dist/cjs/react/hooks/use-keyboard-shortcut.js +2 -1
- package/dist/cjs/react/hooks/use-push-to-talk-hotkey.d.ts +24 -0
- package/dist/cjs/react/hooks/use-push-to-talk-hotkey.js +116 -0
- package/dist/cjs/react/hooks/use-sidebar-resize.d.ts +19 -0
- package/dist/cjs/react/hooks/use-sidebar-resize.js +109 -0
- package/dist/cjs/react/index.d.ts +30 -1
- package/dist/cjs/react/index.js +91 -1
- package/dist/cjs/react/interactions/definitions.d.ts +67 -0
- package/dist/cjs/react/interactions/definitions.js +83 -0
- package/dist/cjs/react/interactions/registry.d.ts +74 -0
- package/dist/cjs/react/interactions/registry.js +250 -0
- package/dist/cjs/react/interactions/use-chat-interactions-data.d.ts +15 -0
- package/dist/cjs/react/interactions/use-chat-interactions-data.js +43 -0
- package/dist/cjs/react/locale-de.d.ts +3 -0
- package/dist/cjs/react/locale-de.js +66 -0
- package/dist/cjs/react/provider/ai-chat-provider.d.ts +1 -1
- package/dist/cjs/react/provider/ai-chat-provider.js +407 -106
- package/dist/cjs/react/provider/chat-context.d.ts +52 -1
- package/dist/cjs/react/stt/controller.d.ts +60 -0
- package/dist/cjs/react/stt/controller.js +268 -0
- package/dist/cjs/react/stt/deepgram.d.ts +30 -0
- package/dist/cjs/react/stt/deepgram.js +204 -0
- package/dist/cjs/react/stt/recorded.d.ts +29 -0
- package/dist/cjs/react/stt/recorded.js +115 -0
- package/dist/cjs/react/stt/segments.d.ts +18 -0
- package/dist/cjs/react/stt/segments.js +32 -0
- package/dist/cjs/react/stt/use-stt.d.ts +17 -0
- package/dist/cjs/react/stt/use-stt.js +41 -0
- package/dist/cjs/react/stt/waveform.d.ts +5 -0
- package/dist/cjs/react/stt/waveform.js +31 -0
- package/dist/cjs/react/styles.css +1529 -0
- package/dist/cjs/react/tool-renderers/registry.d.ts +31 -0
- package/dist/cjs/react/tool-renderers/registry.js +50 -0
- package/dist/cjs/react/tool-renderers/renderer-boundary.d.ts +18 -0
- package/dist/cjs/react/tool-renderers/renderer-boundary.js +15 -0
- package/dist/cjs/react/transports/vercel/vercel-ai-chat.d.ts +1 -1
- package/dist/cjs/react/transports/vercel/vercel-ai-chat.js +2 -2
- package/dist/cjs/react/transports/vercel.d.ts +6 -0
- package/dist/cjs/react/transports/vercel.js +12 -6
- package/dist/cjs/react/types.d.ts +264 -6
- package/dist/cjs/react/ui.d.ts +18 -17
- package/dist/cjs/react/ui.js +50 -45
- package/dist/cjs/react/unstyled.d.ts +7 -0
- package/dist/cjs/react/unstyled.js +10 -0
- package/dist/cjs/react/utils/activity.d.ts +16 -0
- package/dist/cjs/react/utils/activity.js +80 -0
- package/dist/cjs/react/utils/clarification.d.ts +31 -0
- package/dist/cjs/react/utils/clarification.js +104 -0
- package/dist/cjs/react/utils/create-approval-description.d.ts +6 -0
- package/dist/cjs/react/utils/create-approval-description.js +32 -3
- package/dist/cjs/react/utils/create-tool-result-handler.d.ts +1 -1
- package/dist/cjs/react/utils/create-tool-result-handler.js +1 -1
- package/dist/cjs/react/utils/entity-names.d.ts +6 -0
- package/dist/cjs/react/utils/entity-names.js +57 -0
- package/dist/cjs/react/utils/followup-suggestions.d.ts +11 -0
- package/dist/cjs/react/utils/followup-suggestions.js +39 -0
- package/dist/cjs/react/utils/local-session-store.d.ts +30 -0
- package/dist/cjs/react/utils/local-session-store.js +165 -0
- package/dist/cjs/react/utils/mention-markup.d.ts +44 -1
- package/dist/cjs/react/utils/mention-markup.js +144 -10
- package/dist/cjs/react/utils/tool-presentation.d.ts +23 -0
- package/dist/cjs/react/utils/tool-presentation.js +46 -0
- package/dist/cjs/react/utils/tool-result-config.d.ts +10 -0
- package/dist/cjs/react/utils/tool-result-config.js +14 -0
- package/dist/cjs/runtime/ai-sdk/engine.d.ts +66 -0
- package/dist/cjs/runtime/ai-sdk/engine.js +192 -0
- package/dist/cjs/runtime/ai-sdk/index.d.ts +1 -0
- package/dist/cjs/runtime/ai-sdk/index.js +5 -0
- package/dist/cjs/runtime/authorization.d.ts +16 -0
- package/dist/cjs/runtime/authorization.js +35 -0
- package/dist/cjs/runtime/budget.d.ts +39 -0
- package/dist/cjs/runtime/budget.js +100 -0
- package/dist/cjs/runtime/contract-bindings.d.ts +52 -0
- package/dist/cjs/runtime/contract-bindings.js +95 -0
- package/dist/cjs/runtime/engine.d.ts +52 -0
- package/dist/cjs/runtime/engine.js +2 -0
- package/dist/cjs/runtime/fingerprint.d.ts +6 -0
- package/dist/cjs/runtime/fingerprint.js +31 -0
- package/dist/cjs/runtime/glirastes.d.ts +112 -0
- package/dist/cjs/runtime/glirastes.js +287 -0
- package/dist/cjs/runtime/index.d.ts +23 -0
- package/dist/cjs/runtime/index.js +71 -0
- package/dist/cjs/runtime/json-schema.d.ts +13 -0
- package/dist/cjs/runtime/json-schema.js +46 -0
- package/dist/cjs/runtime/local-runtime-source.d.ts +76 -0
- package/dist/cjs/runtime/local-runtime-source.js +0 -0
- package/dist/cjs/runtime/local-signer.d.ts +17 -0
- package/dist/cjs/runtime/local-signer.js +34 -0
- package/dist/cjs/runtime/local-tool-bindings.d.ts +57 -0
- package/dist/cjs/runtime/local-tool-bindings.js +197 -0
- package/dist/cjs/runtime/managed-turn.d.ts +29 -0
- package/dist/cjs/runtime/managed-turn.js +99 -0
- package/dist/cjs/runtime/metrics/cost.d.ts +64 -0
- package/dist/cjs/runtime/metrics/cost.js +98 -0
- package/dist/cjs/runtime/metrics/sink.d.ts +56 -0
- package/dist/cjs/runtime/metrics/sink.js +217 -0
- package/dist/cjs/runtime/metrics/turn-recorder.d.ts +62 -0
- package/dist/cjs/runtime/metrics/turn-recorder.js +172 -0
- package/dist/cjs/runtime/offline-execution-lease.d.ts +27 -0
- package/dist/cjs/runtime/offline-execution-lease.js +49 -0
- package/dist/cjs/runtime/policy-overlay.d.ts +86 -0
- package/dist/cjs/runtime/policy-overlay.js +122 -0
- package/dist/cjs/runtime/postgres-store.d.ts +111 -0
- package/dist/cjs/runtime/postgres-store.js +368 -0
- package/dist/cjs/runtime/prompt-bundle-store.d.ts +58 -0
- package/dist/cjs/runtime/prompt-bundle-store.js +123 -0
- package/dist/cjs/runtime/runtime-mode.d.ts +23 -0
- package/dist/cjs/runtime/runtime-mode.js +46 -0
- package/dist/cjs/runtime/tool-discovery.d.ts +51 -0
- package/dist/cjs/runtime/tool-discovery.js +141 -0
- package/dist/cjs/runtime/tool-search.d.ts +31 -0
- package/dist/cjs/runtime/tool-search.js +149 -0
- package/dist/cjs/runtime/turn-snapshot.d.ts +44 -0
- package/dist/cjs/runtime/turn-snapshot.js +112 -0
- package/dist/cjs/server/adapters/nextjs/approval-binding.d.ts +334 -0
- package/dist/cjs/server/adapters/nextjs/approval-binding.js +724 -0
- package/dist/cjs/server/adapters/nextjs/chat-interactions-handler.d.ts +26 -0
- package/dist/cjs/server/adapters/nextjs/chat-interactions-handler.js +67 -0
- package/dist/cjs/server/adapters/nextjs/clarification-resume.d.ts +21 -0
- package/dist/cjs/server/adapters/nextjs/clarification-resume.js +112 -0
- package/dist/cjs/server/adapters/nextjs/context-helpers.d.ts +49 -8
- package/dist/cjs/server/adapters/nextjs/context-helpers.js +76 -21
- package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.d.ts +59 -1
- package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.js +648 -94
- package/dist/cjs/server/adapters/nextjs/direct-command.d.ts +75 -0
- package/dist/cjs/server/adapters/nextjs/direct-command.js +322 -0
- package/dist/cjs/server/adapters/nextjs/index.d.ts +10 -2
- package/dist/cjs/server/adapters/nextjs/index.js +24 -1
- package/dist/cjs/server/adapters/nextjs/prepare-model-messages.d.ts +2 -1
- package/dist/cjs/server/adapters/nextjs/prepare-model-messages.js +6 -14
- package/dist/cjs/server/adapters/nextjs/recording-transcription-handler.d.ts +31 -0
- package/dist/cjs/server/adapters/nextjs/recording-transcription-handler.js +58 -0
- package/dist/cjs/server/adapters/nextjs/request-guards.d.ts +41 -0
- package/dist/cjs/server/adapters/nextjs/request-guards.js +112 -0
- package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.js +12 -6
- package/dist/cjs/server/adapters/nextjs/scope-pipeline-tools.d.ts +17 -0
- package/dist/cjs/server/adapters/nextjs/scope-pipeline-tools.js +28 -0
- package/dist/cjs/server/adapters/nextjs/tool-discovery.d.ts +39 -0
- package/dist/cjs/server/adapters/nextjs/tool-discovery.js +50 -0
- package/dist/cjs/server/adapters/nextjs/tool-presentation.d.ts +26 -0
- package/dist/cjs/server/adapters/nextjs/tool-presentation.js +21 -0
- package/dist/cjs/server/adapters/nextjs/types.d.ts +229 -13
- package/dist/cjs/server/adapters/nextjs/with-ai-tool.d.ts +2 -2
- package/dist/cjs/server/core/adaptive-fast-path.d.ts +3 -0
- package/dist/cjs/server/core/adaptive-fast-path.js +188 -0
- package/dist/cjs/server/core/clarification-tool.d.ts +29 -0
- package/dist/cjs/server/core/clarification-tool.js +64 -0
- package/dist/cjs/server/core/generated-ui-tool.d.ts +31 -0
- package/dist/cjs/server/core/generated-ui-tool.js +89 -0
- package/dist/cjs/server/core/index.d.ts +49 -8
- package/dist/cjs/server/core/index.js +208 -17
- package/dist/cjs/server/core/local-guardrails.d.ts +6 -0
- package/dist/cjs/server/core/local-guardrails.js +70 -0
- package/dist/cjs/server/core/module-router.d.ts +3 -1
- package/dist/cjs/server/core/module-router.js +22 -2
- package/dist/cjs/server/core/plan-tool.d.ts +23 -0
- package/dist/cjs/server/core/plan-tool.js +35 -0
- package/dist/cjs/server/core/zod-compact.d.ts +2 -2
- package/dist/cjs/server/core/zod-compact.js +56 -7
- package/dist/cjs/server/index.d.ts +2 -4
- package/dist/cjs/server/index.js +4 -5
- package/dist/cjs/server/local-pipeline.d.ts +14 -0
- package/dist/cjs/server/local-pipeline.js +154 -0
- package/dist/cjs/server/pii-shield/index.d.ts +1 -0
- package/dist/cjs/server/pii-shield/index.js +3 -1
- package/dist/cjs/server/pii-shield/regex-detector.d.ts +13 -0
- package/dist/cjs/server/pii-shield/regex-detector.js +111 -0
- package/dist/cjs/server/testing/guardrails.js +2 -66
- package/dist/cjs/server/testing/helpers.js +1 -62
- package/dist/cjs/server/testing/index.d.ts +1 -0
- package/dist/cjs/server/testing/index.js +3 -1
- package/dist/cjs/server/testing/registry-parity.d.ts +18 -0
- package/dist/cjs/server/testing/registry-parity.js +40 -0
- package/dist/cjs/server/testing/smoke.d.ts +2 -1
- package/dist/cjs/server/testing/smoke.js +7 -3
- package/dist/cjs/server/testing/types.d.ts +1 -1
- package/dist/cjs/server/testing/zod-introspect.d.ts +1 -1
- package/dist/cjs/server/testing/zod-introspect.js +178 -5
- package/dist/cjs/stt/index.d.ts +5 -0
- package/dist/cjs/stt/index.js +16 -0
- package/dist/cjs/sync/app-setup-client.d.ts +46 -0
- package/dist/cjs/sync/app-setup-client.js +140 -0
- package/dist/cjs/sync/capability-report.d.ts +41 -0
- package/dist/cjs/sync/capability-report.js +52 -0
- package/dist/cjs/sync/connection-lookup.d.ts +19 -0
- package/dist/cjs/sync/connection-lookup.js +58 -0
- package/dist/cjs/sync/control-plane-client.d.ts +69 -0
- package/dist/cjs/sync/control-plane-client.js +186 -0
- package/dist/cjs/sync/deployment-selector.d.ts +9 -0
- package/dist/cjs/sync/deployment-selector.js +29 -0
- package/dist/cjs/sync/fetch-sse-push.d.ts +6 -0
- package/dist/cjs/sync/fetch-sse-push.js +45 -0
- package/dist/cjs/sync/index.d.ts +26 -0
- package/dist/cjs/sync/index.js +43 -0
- package/dist/cjs/sync/jwks-provider.d.ts +14 -0
- package/dist/cjs/sync/jwks-provider.js +56 -0
- package/dist/cjs/sync/local-deployment-validator.d.ts +30 -0
- package/dist/cjs/sync/local-deployment-validator.js +62 -0
- package/dist/cjs/sync/managed-sync.d.ts +40 -0
- package/dist/cjs/sync/managed-sync.js +96 -0
- package/dist/cjs/sync/materialize-deployment.d.ts +7 -0
- package/dist/cjs/sync/materialize-deployment.js +65 -0
- package/dist/cjs/sync/runtime-connect-client.d.ts +23 -0
- package/dist/cjs/sync/runtime-connect-client.js +185 -0
- package/dist/cjs/sync/runtime-setup-client.d.ts +62 -0
- package/dist/cjs/sync/runtime-setup-client.js +157 -0
- package/dist/cjs/sync/signature-verifier.d.ts +39 -0
- package/dist/cjs/sync/signature-verifier.js +102 -0
- package/dist/cjs/sync/state-store.d.ts +24 -0
- package/dist/cjs/sync/state-store.js +51 -0
- package/dist/cjs/sync/sync-manager.d.ts +27 -0
- package/dist/cjs/sync/sync-manager.js +173 -0
- package/dist/cjs/types.d.ts +68 -16
- package/dist/cjs/types.js +30 -2
- package/dist/cli/bin.js +34 -23
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/commands/agent-setup.d.ts +27 -0
- package/dist/cli/commands/agent-setup.js +149 -0
- package/dist/cli/commands/agent-setup.js.map +1 -0
- package/dist/cli/commands/apply-setup-plan.d.ts +21 -0
- package/dist/cli/commands/apply-setup-plan.js +100 -0
- package/dist/cli/commands/apply-setup-plan.js.map +1 -0
- package/dist/cli/commands/atomic-artifact-write.d.ts +19 -0
- package/dist/cli/commands/atomic-artifact-write.js +106 -0
- package/dist/cli/commands/atomic-artifact-write.js.map +1 -0
- package/dist/cli/commands/ci-workflow.d.ts +48 -0
- package/dist/cli/commands/ci-workflow.js +209 -0
- package/dist/cli/commands/ci-workflow.js.map +1 -0
- package/dist/cli/commands/connect.d.ts +47 -0
- package/dist/cli/commands/connect.js +216 -0
- package/dist/cli/commands/connect.js.map +1 -0
- package/dist/cli/commands/connection-descriptor.d.ts +4 -0
- package/dist/cli/commands/connection-descriptor.js +47 -0
- package/dist/cli/commands/connection-descriptor.js.map +1 -0
- package/dist/cli/commands/connection-environment.d.ts +25 -0
- package/dist/cli/commands/connection-environment.js +151 -0
- package/dist/cli/commands/connection-environment.js.map +1 -0
- package/dist/cli/commands/current-setup-manifests.d.ts +7 -0
- package/dist/cli/commands/current-setup-manifests.js +16 -0
- package/dist/cli/commands/current-setup-manifests.js.map +1 -0
- package/dist/cli/commands/doctor-presentation.d.ts +5 -0
- package/dist/cli/commands/doctor-presentation.js +86 -0
- package/dist/cli/commands/doctor-presentation.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +27 -0
- package/dist/cli/commands/doctor.js +220 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init-scaffold.d.ts +25 -0
- package/dist/cli/commands/init-scaffold.js +214 -0
- package/dist/cli/commands/init-scaffold.js.map +1 -0
- package/dist/cli/commands/install-skills.d.ts +26 -4
- package/dist/cli/commands/install-skills.js +165 -80
- package/dist/cli/commands/install-skills.js.map +1 -1
- package/dist/cli/commands/installed-skills-manifest.d.ts +87 -0
- package/dist/cli/commands/installed-skills-manifest.js +124 -0
- package/dist/cli/commands/installed-skills-manifest.js.map +1 -0
- package/dist/cli/commands/installer-parts.d.ts +31 -0
- package/dist/cli/commands/installer-parts.js +94 -0
- package/dist/cli/commands/installer-parts.js.map +1 -0
- package/dist/cli/commands/project-inspection.d.ts +35 -0
- package/dist/cli/commands/project-inspection.js +199 -0
- package/dist/cli/commands/project-inspection.js.map +1 -0
- package/dist/cli/commands/setup-plan.d.ts +65 -0
- package/dist/cli/commands/setup-plan.js +234 -0
- package/dist/cli/commands/setup-plan.js.map +1 -0
- package/dist/cli/commands/setup-profile.d.ts +28 -0
- package/dist/cli/commands/setup-profile.js +152 -0
- package/dist/cli/commands/setup-profile.js.map +1 -0
- package/dist/cli/commands/setup-wizard.d.ts +66 -0
- package/dist/cli/commands/setup-wizard.js +241 -0
- package/dist/cli/commands/setup-wizard.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +58 -0
- package/dist/cli/commands/sync.js +233 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/tools/args.d.ts +14 -0
- package/dist/cli/commands/tools/args.js +33 -0
- package/dist/cli/commands/tools/args.js.map +1 -0
- package/dist/cli/commands/tools/check.d.ts +7 -0
- package/dist/cli/commands/tools/check.js +35 -0
- package/dist/cli/commands/tools/check.js.map +1 -0
- package/dist/cli/commands/tools/describe.d.ts +12 -0
- package/dist/cli/commands/tools/describe.js +43 -0
- package/dist/cli/commands/tools/describe.js.map +1 -0
- package/dist/cli/commands/tools/enrich.d.ts +50 -0
- package/dist/cli/commands/tools/enrich.js +597 -0
- package/dist/cli/commands/tools/enrich.js.map +1 -0
- package/dist/cli/commands/tools/eval.d.ts +13 -0
- package/dist/cli/commands/tools/eval.js +49 -0
- package/dist/cli/commands/tools/eval.js.map +1 -0
- package/dist/cli/commands/tools/format.d.ts +42 -0
- package/dist/cli/commands/tools/format.js +155 -0
- package/dist/cli/commands/tools/format.js.map +1 -0
- package/dist/cli/commands/tools/index.d.ts +26 -0
- package/dist/cli/commands/tools/index.js +107 -0
- package/dist/cli/commands/tools/index.js.map +1 -0
- package/dist/cli/commands/tools/policy.d.ts +11 -0
- package/dist/cli/commands/tools/policy.js +355 -0
- package/dist/cli/commands/tools/policy.js.map +1 -0
- package/dist/cli/commands/tools/refresh.d.ts +6 -0
- package/dist/cli/commands/tools/refresh.js +87 -0
- package/dist/cli/commands/tools/refresh.js.map +1 -0
- package/dist/cli/commands/tools/resolve.d.ts +10 -0
- package/dist/cli/commands/tools/resolve.js +19 -0
- package/dist/cli/commands/tools/resolve.js.map +1 -0
- package/dist/cli/commands/tools/status.d.ts +11 -0
- package/dist/cli/commands/tools/status.js +76 -0
- package/dist/cli/commands/tools/status.js.map +1 -0
- package/dist/cli/commands/tools/verify.d.ts +13 -0
- package/dist/cli/commands/tools/verify.js +168 -0
- package/dist/cli/commands/tools/verify.js.map +1 -0
- package/dist/cli/commands/tools/watch.d.ts +27 -0
- package/dist/cli/commands/tools/watch.js +148 -0
- package/dist/cli/commands/tools/watch.js.map +1 -0
- package/dist/cli/commands/validate-build.d.ts +88 -0
- package/dist/cli/commands/validate-build.js +213 -0
- package/dist/cli/commands/validate-build.js.map +1 -0
- package/dist/cli/commands/workspace-sources.d.ts +27 -0
- package/dist/cli/commands/workspace-sources.js +159 -0
- package/dist/cli/commands/workspace-sources.js.map +1 -0
- package/dist/cli/environment-loading.d.ts +6 -0
- package/dist/cli/environment-loading.js +18 -0
- package/dist/cli/environment-loading.js.map +1 -0
- package/dist/cli/index.d.ts +14 -1
- package/dist/cli/index.js +558 -574
- package/dist/cli/index.js.map +1 -1
- package/dist/codegen/execution-inventory.d.ts +63 -0
- package/dist/codegen/execution-inventory.js +306 -0
- package/dist/codegen/execution-inventory.js.map +1 -0
- package/dist/codegen/index.d.ts +4 -13
- package/dist/codegen/index.js +4 -12
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/inventory-generation.d.ts +104 -0
- package/dist/codegen/inventory-generation.js +119 -0
- package/dist/codegen/inventory-generation.js.map +1 -0
- package/dist/codegen/next-source-generation.d.ts +17 -0
- package/dist/codegen/next-source-generation.js +49 -0
- package/dist/codegen/next-source-generation.js.map +1 -0
- package/dist/codegen/openapi-document.d.ts +53 -0
- package/dist/codegen/openapi-document.js +120 -0
- package/dist/codegen/openapi-document.js.map +1 -0
- package/dist/codegen/route-exports.d.ts +13 -0
- package/dist/codegen/route-exports.js +117 -0
- package/dist/codegen/route-exports.js.map +1 -0
- package/dist/codegen/route-fingerprint.d.ts +2 -0
- package/dist/codegen/route-fingerprint.js +9 -0
- package/dist/codegen/route-fingerprint.js.map +1 -0
- package/dist/codegen/route-scanner.d.ts +57 -0
- package/dist/codegen/route-scanner.js +233 -0
- package/dist/codegen/route-scanner.js.map +1 -0
- package/dist/codegen/tools/agentic.d.ts +31 -0
- package/dist/codegen/tools/agentic.js +110 -0
- package/dist/codegen/tools/agentic.js.map +1 -0
- package/dist/codegen/tools/artifact.d.ts +139 -0
- package/dist/codegen/tools/artifact.js +199 -0
- package/dist/codegen/tools/artifact.js.map +1 -0
- package/dist/codegen/tools/canonical.d.ts +12 -0
- package/dist/codegen/tools/canonical.js +41 -0
- package/dist/codegen/tools/canonical.js.map +1 -0
- package/dist/codegen/tools/chat-interactions.d.ts +27 -0
- package/dist/codegen/tools/chat-interactions.js +377 -0
- package/dist/codegen/tools/chat-interactions.js.map +1 -0
- package/dist/codegen/tools/config.d.ts +116 -0
- package/dist/codegen/tools/config.js +172 -0
- package/dist/codegen/tools/config.js.map +1 -0
- package/dist/codegen/tools/contract-tiers.d.ts +64 -0
- package/dist/codegen/tools/contract-tiers.js +518 -0
- package/dist/codegen/tools/contract-tiers.js.map +1 -0
- package/dist/codegen/tools/emit-module.d.ts +13 -0
- package/dist/codegen/tools/emit-module.js +182 -0
- package/dist/codegen/tools/emit-module.js.map +1 -0
- package/dist/codegen/tools/evidence.d.ts +13 -0
- package/dist/codegen/tools/evidence.js +138 -0
- package/dist/codegen/tools/evidence.js.map +1 -0
- package/dist/codegen/tools/exclusions.d.ts +30 -0
- package/dist/codegen/tools/exclusions.js +95 -0
- package/dist/codegen/tools/exclusions.js.map +1 -0
- package/dist/codegen/tools/files.d.ts +195 -0
- package/dist/codegen/tools/files.js +119 -0
- package/dist/codegen/tools/files.js.map +1 -0
- package/dist/codegen/tools/findings.d.ts +7 -0
- package/dist/codegen/tools/findings.js +106 -0
- package/dist/codegen/tools/findings.js.map +1 -0
- package/dist/codegen/tools/handler-analysis.d.ts +49 -0
- package/dist/codegen/tools/handler-analysis.js +375 -0
- package/dist/codegen/tools/handler-analysis.js.map +1 -0
- package/dist/codegen/tools/handler-locator.d.ts +21 -0
- package/dist/codegen/tools/handler-locator.js +152 -0
- package/dist/codegen/tools/handler-locator.js.map +1 -0
- package/dist/codegen/tools/identity.d.ts +18 -0
- package/dist/codegen/tools/identity.js +100 -0
- package/dist/codegen/tools/identity.js.map +1 -0
- package/dist/codegen/tools/input-roles.d.ts +32 -0
- package/dist/codegen/tools/input-roles.js +283 -0
- package/dist/codegen/tools/input-roles.js.map +1 -0
- package/dist/codegen/tools/inputs.d.ts +33 -0
- package/dist/codegen/tools/inputs.js +101 -0
- package/dist/codegen/tools/inputs.js.map +1 -0
- package/dist/codegen/tools/interface-digest.d.ts +14 -0
- package/dist/codegen/tools/interface-digest.js +24 -0
- package/dist/codegen/tools/interface-digest.js.map +1 -0
- package/dist/codegen/tools/mcp-names.d.ts +23 -0
- package/dist/codegen/tools/mcp-names.js +59 -0
- package/dist/codegen/tools/mcp-names.js.map +1 -0
- package/dist/codegen/tools/mode.d.ts +7 -0
- package/dist/codegen/tools/mode.js +27 -0
- package/dist/codegen/tools/mode.js.map +1 -0
- package/dist/codegen/tools/output-inference.d.ts +6 -0
- package/dist/codegen/tools/output-inference.js +99 -0
- package/dist/codegen/tools/output-inference.js.map +1 -0
- package/dist/codegen/tools/pipeline.d.ts +85 -0
- package/dist/codegen/tools/pipeline.js +733 -0
- package/dist/codegen/tools/pipeline.js.map +1 -0
- package/dist/codegen/tools/probe-child.mjs +155 -0
- package/dist/codegen/tools/probe-loader.mjs +105 -0
- package/dist/codegen/tools/program.d.ts +16 -0
- package/dist/codegen/tools/program.js +80 -0
- package/dist/codegen/tools/program.js.map +1 -0
- package/dist/codegen/tools/prose.d.ts +42 -0
- package/dist/codegen/tools/prose.js +211 -0
- package/dist/codegen/tools/prose.js.map +1 -0
- package/dist/codegen/tools/resolutions.d.ts +117 -0
- package/dist/codegen/tools/resolutions.js +195 -0
- package/dist/codegen/tools/resolutions.js.map +1 -0
- package/dist/codegen/tools/routing-eval.d.ts +50 -0
- package/dist/codegen/tools/routing-eval.js +81 -0
- package/dist/codegen/tools/routing-eval.js.map +1 -0
- package/dist/codegen/tools/schema-probe.d.ts +62 -0
- package/dist/codegen/tools/schema-probe.js +209 -0
- package/dist/codegen/tools/schema-probe.js.map +1 -0
- package/dist/codegen/tools/semantics.d.ts +134 -0
- package/dist/codegen/tools/semantics.js +206 -0
- package/dist/codegen/tools/semantics.js.map +1 -0
- package/dist/codegen/tools/sources/app-files.d.ts +35 -0
- package/dist/codegen/tools/sources/app-files.js +109 -0
- package/dist/codegen/tools/sources/app-files.js.map +1 -0
- package/dist/codegen/tools/sources/fastapi-routes.py +177 -0
- package/dist/codegen/tools/sources/nest-decorators.d.ts +27 -0
- package/dist/codegen/tools/sources/nest-decorators.js +65 -0
- package/dist/codegen/tools/sources/nest-decorators.js.map +1 -0
- package/dist/codegen/tools/sources/nest-endpoints.d.ts +10 -0
- package/dist/codegen/tools/sources/nest-endpoints.js +522 -0
- package/dist/codegen/tools/sources/nest-endpoints.js.map +1 -0
- package/dist/codegen/tools/sources/next-endpoints.d.ts +5 -0
- package/dist/codegen/tools/sources/next-endpoints.js +389 -0
- package/dist/codegen/tools/sources/next-endpoints.js.map +1 -0
- package/dist/codegen/tools/sources/next-pages.d.ts +18 -0
- package/dist/codegen/tools/sources/next-pages.js +88 -0
- package/dist/codegen/tools/sources/next-pages.js.map +1 -0
- package/dist/codegen/tools/sources/openapi-endpoints.d.ts +17 -0
- package/dist/codegen/tools/sources/openapi-endpoints.js +395 -0
- package/dist/codegen/tools/sources/openapi-endpoints.js.map +1 -0
- package/dist/codegen/tools/sources/page-tree.d.ts +49 -0
- package/dist/codegen/tools/sources/page-tree.js +152 -0
- package/dist/codegen/tools/sources/page-tree.js.map +1 -0
- package/dist/codegen/tools/sources/react-actions.d.ts +12 -0
- package/dist/codegen/tools/sources/react-actions.js +341 -0
- package/dist/codegen/tools/sources/react-actions.js.map +1 -0
- package/dist/codegen/tools/sources/route-config.d.ts +49 -0
- package/dist/codegen/tools/sources/route-config.js +427 -0
- package/dist/codegen/tools/sources/route-config.js.map +1 -0
- package/dist/codegen/tools/sources/ui-controls.d.ts +41 -0
- package/dist/codegen/tools/sources/ui-controls.js +360 -0
- package/dist/codegen/tools/sources/ui-controls.js.map +1 -0
- package/dist/codegen/tools/sources/ui-tools.d.ts +79 -0
- package/dist/codegen/tools/sources/ui-tools.js +207 -0
- package/dist/codegen/tools/sources/ui-tools.js.map +1 -0
- package/dist/codegen/tools/sources/url-filters.d.ts +41 -0
- package/dist/codegen/tools/sources/url-filters.js +813 -0
- package/dist/codegen/tools/sources/url-filters.js.map +1 -0
- package/dist/codegen/tools/sources/vue-sfc.d.ts +22 -0
- package/dist/codegen/tools/sources/vue-sfc.js +65 -0
- package/dist/codegen/tools/sources/vue-sfc.js.map +1 -0
- package/dist/codegen/tools/state.d.ts +37 -0
- package/dist/codegen/tools/state.js +249 -0
- package/dist/codegen/tools/state.js.map +1 -0
- package/dist/codegen/tools/types.d.ts +137 -0
- package/dist/codegen/tools/types.js +2 -0
- package/dist/codegen/tools/types.js.map +1 -0
- package/dist/codegen/tools/worklist.d.ts +157 -0
- package/dist/codegen/tools/worklist.js +406 -0
- package/dist/codegen/tools/worklist.js.map +1 -0
- package/dist/contracts/app-setup.d.ts +346 -0
- package/dist/contracts/app-setup.js +205 -0
- package/dist/contracts/app-setup.js.map +1 -0
- package/dist/contracts/chat-command.d.ts +65 -0
- package/dist/contracts/chat-command.js +121 -0
- package/dist/contracts/chat-command.js.map +1 -0
- package/dist/contracts/chat-interactions.d.ts +126 -0
- package/dist/contracts/chat-interactions.js +431 -0
- package/dist/contracts/chat-interactions.js.map +1 -0
- package/dist/contracts/clarification.d.ts +53 -0
- package/dist/contracts/clarification.js +86 -0
- package/dist/contracts/clarification.js.map +1 -0
- package/dist/contracts/content-boundary.d.ts +3 -0
- package/dist/contracts/content-boundary.js +91 -0
- package/dist/contracts/content-boundary.js.map +1 -0
- package/dist/contracts/events.d.ts +273 -0
- package/dist/contracts/events.js +227 -0
- package/dist/contracts/events.js.map +1 -0
- package/dist/contracts/index.d.ts +18 -0
- package/dist/contracts/index.js +10 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/plan.d.ts +20 -0
- package/dist/contracts/plan.js +35 -0
- package/dist/contracts/plan.js.map +1 -0
- package/dist/contracts/platform-connection.d.ts +44 -0
- package/dist/contracts/platform-connection.js +64 -0
- package/dist/contracts/platform-connection.js.map +1 -0
- package/dist/contracts/platform-prompt-revision.d.ts +27 -0
- package/dist/contracts/platform-prompt-revision.js +44 -0
- package/dist/contracts/platform-prompt-revision.js.map +1 -0
- package/dist/contracts/prompt-bundle.d.ts +46 -0
- package/dist/contracts/prompt-bundle.js +70 -0
- package/dist/contracts/prompt-bundle.js.map +1 -0
- package/dist/contracts/revisions.d.ts +716 -0
- package/dist/contracts/revisions.js +298 -0
- package/dist/contracts/revisions.js.map +1 -0
- package/dist/contracts/runtime.d.ts +55 -0
- package/dist/contracts/runtime.js +65 -0
- package/dist/contracts/runtime.js.map +1 -0
- package/dist/contracts/semantic-change.d.ts +27 -0
- package/dist/contracts/semantic-change.js +101 -0
- package/dist/contracts/semantic-change.js.map +1 -0
- package/dist/contracts/tool-exclude-pattern.d.ts +12 -0
- package/dist/contracts/tool-exclude-pattern.js +27 -0
- package/dist/contracts/tool-exclude-pattern.js.map +1 -0
- package/dist/contracts/tool-policy-entry.d.ts +107 -0
- package/dist/contracts/tool-policy-entry.js +40 -0
- package/dist/contracts/tool-policy-entry.js.map +1 -0
- package/dist/contracts/tool-policy.d.ts +198 -0
- package/dist/contracts/tool-policy.js +485 -0
- package/dist/contracts/tool-policy.js.map +1 -0
- package/dist/contracts/url.d.ts +2 -0
- package/dist/contracts/url.js +8 -0
- package/dist/contracts/url.js.map +1 -0
- package/dist/diagnostics/foundation-diagnostic.d.ts +34 -0
- package/dist/diagnostics/foundation-diagnostic.js +47 -0
- package/dist/diagnostics/foundation-diagnostic.js.map +1 -0
- package/dist/diagnostics/index.d.ts +2 -0
- package/dist/diagnostics/index.js +2 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/embed/chat-styles.generated.d.ts +1 -0
- package/dist/embed/chat-styles.generated.js +4 -0
- package/dist/embed/chat-styles.generated.js.map +1 -0
- package/dist/embed/glirastes-chat-element.d.ts +67 -0
- package/dist/embed/glirastes-chat-element.js +278 -0
- package/dist/embed/glirastes-chat-element.js.map +1 -0
- package/dist/embed/index.d.ts +4 -0
- package/dist/embed/index.js +11 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/embed/theme.d.ts +10 -0
- package/dist/embed/theme.js +41 -0
- package/dist/embed/theme.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/react/assistant/assistant-layout.d.ts +55 -0
- package/dist/react/assistant/assistant-layout.js +99 -0
- package/dist/react/assistant/assistant-layout.js.map +1 -0
- package/dist/react/assistant/assistant-shell.d.ts +132 -0
- package/dist/react/assistant/assistant-shell.js +262 -0
- package/dist/react/assistant/assistant-shell.js.map +1 -0
- package/dist/react/assistant/assistant-shortcut-list.d.ts +24 -0
- package/dist/react/assistant/assistant-shortcut-list.js +32 -0
- package/dist/react/assistant/assistant-shortcut-list.js.map +1 -0
- package/dist/react/assistant/assistant-workspace.d.ts +31 -0
- package/dist/react/assistant/assistant-workspace.js +31 -0
- package/dist/react/assistant/assistant-workspace.js.map +1 -0
- package/dist/react/completions/completion-search.d.ts +21 -0
- package/dist/react/completions/completion-search.js +109 -0
- package/dist/react/completions/completion-search.js.map +1 -0
- package/dist/react/completions/ui-tool-command-provider.d.ts +15 -0
- package/dist/react/completions/ui-tool-command-provider.js +82 -0
- package/dist/react/completions/ui-tool-command-provider.js.map +1 -0
- package/dist/react/components/activity-log.d.ts +17 -0
- package/dist/react/components/activity-log.js +68 -0
- package/dist/react/components/activity-log.js.map +1 -0
- package/dist/react/components/ai-chat-panel.js +13 -6
- package/dist/react/components/ai-chat-panel.js.map +1 -1
- package/dist/react/components/ai-trigger-button.d.ts +1 -1
- package/dist/react/components/ai-trigger-button.js +13 -68
- package/dist/react/components/ai-trigger-button.js.map +1 -1
- package/dist/react/components/chat-input.js +7 -5
- package/dist/react/components/chat-input.js.map +1 -1
- package/dist/react/components/chat-window-visibility.d.ts +3 -0
- package/dist/react/components/chat-window-visibility.js +5 -0
- package/dist/react/components/chat-window-visibility.js.map +1 -0
- package/dist/react/components/chat-window.d.ts +1 -1
- package/dist/react/components/chat-window.js +124 -57
- package/dist/react/components/chat-window.js.map +1 -1
- package/dist/react/components/clarification-card.d.ts +10 -0
- package/dist/react/components/clarification-card.js +33 -0
- package/dist/react/components/clarification-card.js.map +1 -0
- package/dist/react/components/command-arguments-form.d.ts +10 -0
- package/dist/react/components/command-arguments-form.js +151 -0
- package/dist/react/components/command-arguments-form.js.map +1 -0
- package/dist/react/components/confirm-dialog.js +1 -1
- package/dist/react/components/confirm-dialog.js.map +1 -1
- package/dist/react/components/floating-chat-ui.d.ts +3 -3
- package/dist/react/components/floating-chat-ui.js +31 -5
- package/dist/react/components/floating-chat-ui.js.map +1 -1
- package/dist/react/components/mention-input.d.ts +5 -4
- package/dist/react/components/mention-input.js +65 -8
- package/dist/react/components/mention-input.js.map +1 -1
- package/dist/react/components/message-bubble.js +90 -14
- package/dist/react/components/message-bubble.js.map +1 -1
- package/dist/react/components/plan-checklist.d.ts +14 -0
- package/dist/react/components/plan-checklist.js +18 -0
- package/dist/react/components/plan-checklist.js.map +1 -0
- package/dist/react/components/recording-bar.js +45 -59
- package/dist/react/components/recording-bar.js.map +1 -1
- package/dist/react/components/rich-mention-input.js +199 -47
- package/dist/react/components/rich-mention-input.js.map +1 -1
- package/dist/react/components/session-switcher.d.ts +3 -1
- package/dist/react/components/session-switcher.js +27 -12
- package/dist/react/components/session-switcher.js.map +1 -1
- package/dist/react/components/status-icon.d.ts +8 -0
- package/dist/react/components/status-icon.js +9 -0
- package/dist/react/components/status-icon.js.map +1 -0
- package/dist/react/components/stream-waveform.d.ts +4 -0
- package/dist/react/components/stream-waveform.js +47 -0
- package/dist/react/components/stream-waveform.js.map +1 -0
- package/dist/react/components/voice-input-addon.d.ts +16 -1
- package/dist/react/components/voice-input-addon.js +256 -19
- package/dist/react/components/voice-input-addon.js.map +1 -1
- package/dist/react/components/voice-input-button.js +1 -1
- package/dist/react/components/voice-input-button.js.map +1 -1
- package/dist/react/hooks/use-chat-shortcuts.d.ts +33 -0
- package/dist/react/hooks/use-chat-shortcuts.js +133 -0
- package/dist/react/hooks/use-chat-shortcuts.js.map +1 -0
- package/dist/react/hooks/use-deepgram-transcription.d.ts +4 -0
- package/dist/react/hooks/use-deepgram-transcription.js +32 -322
- package/dist/react/hooks/use-deepgram-transcription.js.map +1 -1
- package/dist/react/hooks/use-drag-resize-panel.d.ts +1 -0
- package/dist/react/hooks/use-drag-resize-panel.js +246 -121
- package/dist/react/hooks/use-drag-resize-panel.js.map +1 -1
- package/dist/react/hooks/use-floating-panel.d.ts +57 -0
- package/dist/react/hooks/use-floating-panel.js +215 -0
- package/dist/react/hooks/use-floating-panel.js.map +1 -0
- package/dist/react/hooks/use-keyboard-shortcut.js +2 -1
- package/dist/react/hooks/use-keyboard-shortcut.js.map +1 -1
- package/dist/react/hooks/use-push-to-talk-hotkey.d.ts +24 -0
- package/dist/react/hooks/use-push-to-talk-hotkey.js +112 -0
- package/dist/react/hooks/use-push-to-talk-hotkey.js.map +1 -0
- package/dist/react/hooks/use-sidebar-resize.d.ts +19 -0
- package/dist/react/hooks/use-sidebar-resize.js +107 -0
- package/dist/react/hooks/use-sidebar-resize.js.map +1 -0
- package/dist/react/index.d.ts +30 -1
- package/dist/react/index.js +31 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/interactions/definitions.d.ts +67 -0
- package/dist/react/interactions/definitions.js +78 -0
- package/dist/react/interactions/definitions.js.map +1 -0
- package/dist/react/interactions/registry.d.ts +74 -0
- package/dist/react/interactions/registry.js +248 -0
- package/dist/react/interactions/registry.js.map +1 -0
- package/dist/react/interactions/use-chat-interactions-data.d.ts +15 -0
- package/dist/react/interactions/use-chat-interactions-data.js +41 -0
- package/dist/react/interactions/use-chat-interactions-data.js.map +1 -0
- package/dist/react/locale-de.d.ts +3 -0
- package/dist/react/locale-de.js +64 -0
- package/dist/react/locale-de.js.map +1 -0
- package/dist/react/provider/ai-chat-provider.d.ts +1 -1
- package/dist/react/provider/ai-chat-provider.js +408 -107
- package/dist/react/provider/ai-chat-provider.js.map +1 -1
- package/dist/react/provider/chat-context.d.ts +52 -1
- package/dist/react/provider/chat-context.js.map +1 -1
- package/dist/react/stt/controller.d.ts +60 -0
- package/dist/react/stt/controller.js +265 -0
- package/dist/react/stt/controller.js.map +1 -0
- package/dist/react/stt/deepgram.d.ts +30 -0
- package/dist/react/stt/deepgram.js +199 -0
- package/dist/react/stt/deepgram.js.map +1 -0
- package/dist/react/stt/recorded.d.ts +29 -0
- package/dist/react/stt/recorded.js +111 -0
- package/dist/react/stt/recorded.js.map +1 -0
- package/dist/react/stt/segments.d.ts +18 -0
- package/dist/react/stt/segments.js +29 -0
- package/dist/react/stt/segments.js.map +1 -0
- package/dist/react/stt/use-stt.d.ts +17 -0
- package/dist/react/stt/use-stt.js +39 -0
- package/dist/react/stt/use-stt.js.map +1 -0
- package/dist/react/stt/waveform.d.ts +5 -0
- package/dist/react/stt/waveform.js +29 -0
- package/dist/react/stt/waveform.js.map +1 -0
- package/dist/react/styles.css +758 -126
- package/dist/react/tool-renderers/registry.d.ts +31 -0
- package/dist/react/tool-renderers/registry.js +47 -0
- package/dist/react/tool-renderers/registry.js.map +1 -0
- package/dist/react/tool-renderers/renderer-boundary.d.ts +18 -0
- package/dist/react/tool-renderers/renderer-boundary.js +12 -0
- package/dist/react/tool-renderers/renderer-boundary.js.map +1 -0
- package/dist/react/transports/vercel/vercel-ai-chat.d.ts +1 -1
- package/dist/react/transports/vercel/vercel-ai-chat.js +2 -2
- package/dist/react/transports/vercel/vercel-ai-chat.js.map +1 -1
- package/dist/react/transports/vercel.d.ts +6 -0
- package/dist/react/transports/vercel.js +11 -6
- package/dist/react/transports/vercel.js.map +1 -1
- package/dist/react/types.d.ts +264 -6
- package/dist/react/ui.d.ts +18 -17
- package/dist/react/ui.js +46 -43
- package/dist/react/ui.js.map +1 -1
- package/dist/react/unstyled.d.ts +7 -0
- package/dist/react/unstyled.js +8 -0
- package/dist/react/unstyled.js.map +1 -0
- package/dist/react/utils/activity.d.ts +16 -0
- package/dist/react/utils/activity.js +77 -0
- package/dist/react/utils/activity.js.map +1 -0
- package/dist/react/utils/clarification.d.ts +31 -0
- package/dist/react/utils/clarification.js +99 -0
- package/dist/react/utils/clarification.js.map +1 -0
- package/dist/react/utils/create-approval-description.d.ts +6 -0
- package/dist/react/utils/create-approval-description.js +32 -3
- package/dist/react/utils/create-approval-description.js.map +1 -1
- package/dist/react/utils/create-tool-result-handler.d.ts +1 -1
- package/dist/react/utils/create-tool-result-handler.js +1 -1
- package/dist/react/utils/create-tool-result-handler.js.map +1 -1
- package/dist/react/utils/entity-names.d.ts +6 -0
- package/dist/react/utils/entity-names.js +55 -0
- package/dist/react/utils/entity-names.js.map +1 -0
- package/dist/react/utils/followup-suggestions.d.ts +11 -0
- package/dist/react/utils/followup-suggestions.js +37 -0
- package/dist/react/utils/followup-suggestions.js.map +1 -0
- package/dist/react/utils/local-session-store.d.ts +30 -0
- package/dist/react/utils/local-session-store.js +163 -0
- package/dist/react/utils/local-session-store.js.map +1 -0
- package/dist/react/utils/mention-markup.d.ts +44 -1
- package/dist/react/utils/mention-markup.js +140 -10
- package/dist/react/utils/mention-markup.js.map +1 -1
- package/dist/react/utils/tool-presentation.d.ts +23 -0
- package/dist/react/utils/tool-presentation.js +41 -0
- package/dist/react/utils/tool-presentation.js.map +1 -0
- package/dist/react/utils/tool-result-config.d.ts +10 -0
- package/dist/react/utils/tool-result-config.js +12 -0
- package/dist/react/utils/tool-result-config.js.map +1 -0
- package/dist/runtime/ai-sdk/engine.d.ts +66 -0
- package/dist/runtime/ai-sdk/engine.js +188 -0
- package/dist/runtime/ai-sdk/engine.js.map +1 -0
- package/dist/runtime/ai-sdk/index.d.ts +1 -0
- package/dist/runtime/ai-sdk/index.js +2 -0
- package/dist/runtime/ai-sdk/index.js.map +1 -0
- package/dist/runtime/authorization.d.ts +16 -0
- package/dist/runtime/authorization.js +33 -0
- package/dist/runtime/authorization.js.map +1 -0
- package/dist/runtime/budget.d.ts +39 -0
- package/dist/runtime/budget.js +97 -0
- package/dist/runtime/budget.js.map +1 -0
- package/dist/runtime/contract-bindings.d.ts +52 -0
- package/dist/runtime/contract-bindings.js +92 -0
- package/dist/runtime/contract-bindings.js.map +1 -0
- package/dist/runtime/engine.d.ts +52 -0
- package/dist/runtime/engine.js +2 -0
- package/dist/runtime/engine.js.map +1 -0
- package/dist/runtime/fingerprint.d.ts +6 -0
- package/dist/runtime/fingerprint.js +29 -0
- package/dist/runtime/fingerprint.js.map +1 -0
- package/dist/runtime/glirastes.d.ts +112 -0
- package/dist/runtime/glirastes.js +285 -0
- package/dist/runtime/glirastes.js.map +1 -0
- package/dist/runtime/index.d.ts +23 -0
- package/dist/runtime/index.js +23 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/json-schema.d.ts +13 -0
- package/dist/runtime/json-schema.js +41 -0
- package/dist/runtime/json-schema.js.map +1 -0
- package/dist/runtime/local-runtime-source.d.ts +76 -0
- package/dist/runtime/local-runtime-source.js +0 -0
- package/dist/runtime/local-runtime-source.js.map +1 -0
- package/dist/runtime/local-signer.d.ts +17 -0
- package/dist/runtime/local-signer.js +32 -0
- package/dist/runtime/local-signer.js.map +1 -0
- package/dist/runtime/local-tool-bindings.d.ts +57 -0
- package/dist/runtime/local-tool-bindings.js +190 -0
- package/dist/runtime/local-tool-bindings.js.map +1 -0
- package/dist/runtime/managed-turn.d.ts +29 -0
- package/dist/runtime/managed-turn.js +97 -0
- package/dist/runtime/managed-turn.js.map +1 -0
- package/dist/runtime/metrics/cost.d.ts +64 -0
- package/dist/runtime/metrics/cost.js +92 -0
- package/dist/runtime/metrics/cost.js.map +1 -0
- package/dist/runtime/metrics/sink.d.ts +56 -0
- package/dist/runtime/metrics/sink.js +214 -0
- package/dist/runtime/metrics/sink.js.map +1 -0
- package/dist/runtime/metrics/turn-recorder.d.ts +62 -0
- package/dist/runtime/metrics/turn-recorder.js +170 -0
- package/dist/runtime/metrics/turn-recorder.js.map +1 -0
- package/dist/runtime/offline-execution-lease.d.ts +27 -0
- package/dist/runtime/offline-execution-lease.js +46 -0
- package/dist/runtime/offline-execution-lease.js.map +1 -0
- package/dist/runtime/policy-overlay.d.ts +86 -0
- package/dist/runtime/policy-overlay.js +117 -0
- package/dist/runtime/policy-overlay.js.map +1 -0
- package/dist/runtime/postgres-store.d.ts +111 -0
- package/dist/runtime/postgres-store.js +363 -0
- package/dist/runtime/postgres-store.js.map +1 -0
- package/dist/runtime/prompt-bundle-store.d.ts +58 -0
- package/dist/runtime/prompt-bundle-store.js +120 -0
- package/dist/runtime/prompt-bundle-store.js.map +1 -0
- package/dist/runtime/runtime-mode.d.ts +23 -0
- package/dist/runtime/runtime-mode.js +42 -0
- package/dist/runtime/runtime-mode.js.map +1 -0
- package/dist/runtime/tool-discovery.d.ts +51 -0
- package/dist/runtime/tool-discovery.js +138 -0
- package/dist/runtime/tool-discovery.js.map +1 -0
- package/dist/runtime/tool-search.d.ts +31 -0
- package/dist/runtime/tool-search.js +145 -0
- package/dist/runtime/tool-search.js.map +1 -0
- package/dist/runtime/turn-snapshot.d.ts +44 -0
- package/dist/runtime/turn-snapshot.js +108 -0
- package/dist/runtime/turn-snapshot.js.map +1 -0
- package/dist/server/adapters/nextjs/approval-binding.d.ts +334 -0
- package/dist/server/adapters/nextjs/approval-binding.js +707 -0
- package/dist/server/adapters/nextjs/approval-binding.js.map +1 -0
- package/dist/server/adapters/nextjs/chat-interactions-handler.d.ts +26 -0
- package/dist/server/adapters/nextjs/chat-interactions-handler.js +65 -0
- package/dist/server/adapters/nextjs/chat-interactions-handler.js.map +1 -0
- package/dist/server/adapters/nextjs/clarification-resume.d.ts +21 -0
- package/dist/server/adapters/nextjs/clarification-resume.js +109 -0
- package/dist/server/adapters/nextjs/clarification-resume.js.map +1 -0
- package/dist/server/adapters/nextjs/context-helpers.d.ts +49 -8
- package/dist/server/adapters/nextjs/context-helpers.js +75 -21
- package/dist/server/adapters/nextjs/context-helpers.js.map +1 -1
- package/dist/server/adapters/nextjs/create-ai-chat-handler.d.ts +59 -1
- package/dist/server/adapters/nextjs/create-ai-chat-handler.js +647 -95
- package/dist/server/adapters/nextjs/create-ai-chat-handler.js.map +1 -1
- package/dist/server/adapters/nextjs/direct-command.d.ts +75 -0
- package/dist/server/adapters/nextjs/direct-command.js +316 -0
- package/dist/server/adapters/nextjs/direct-command.js.map +1 -0
- package/dist/server/adapters/nextjs/index.d.ts +10 -2
- package/dist/server/adapters/nextjs/index.js +7 -0
- package/dist/server/adapters/nextjs/index.js.map +1 -1
- package/dist/server/adapters/nextjs/prepare-model-messages.d.ts +2 -1
- package/dist/server/adapters/nextjs/prepare-model-messages.js +7 -15
- package/dist/server/adapters/nextjs/prepare-model-messages.js.map +1 -1
- package/dist/server/adapters/nextjs/recording-transcription-handler.d.ts +31 -0
- package/dist/server/adapters/nextjs/recording-transcription-handler.js +55 -0
- package/dist/server/adapters/nextjs/recording-transcription-handler.js.map +1 -0
- package/dist/server/adapters/nextjs/request-guards.d.ts +41 -0
- package/dist/server/adapters/nextjs/request-guards.js +108 -0
- package/dist/server/adapters/nextjs/request-guards.js.map +1 -0
- package/dist/server/adapters/nextjs/sanitize-model-messages.js +12 -6
- package/dist/server/adapters/nextjs/sanitize-model-messages.js.map +1 -1
- package/dist/server/adapters/nextjs/scope-pipeline-tools.d.ts +17 -0
- package/dist/server/adapters/nextjs/scope-pipeline-tools.js +26 -0
- package/dist/server/adapters/nextjs/scope-pipeline-tools.js.map +1 -0
- package/dist/server/adapters/nextjs/tool-discovery.d.ts +39 -0
- package/dist/server/adapters/nextjs/tool-discovery.js +47 -0
- package/dist/server/adapters/nextjs/tool-discovery.js.map +1 -0
- package/dist/server/adapters/nextjs/tool-presentation.d.ts +26 -0
- package/dist/server/adapters/nextjs/tool-presentation.js +19 -0
- package/dist/server/adapters/nextjs/tool-presentation.js.map +1 -0
- package/dist/server/adapters/nextjs/types.d.ts +229 -13
- package/dist/server/adapters/nextjs/with-ai-tool.d.ts +2 -2
- package/dist/server/core/adaptive-fast-path.d.ts +3 -0
- package/dist/server/core/adaptive-fast-path.js +185 -0
- package/dist/server/core/adaptive-fast-path.js.map +1 -0
- package/dist/server/core/clarification-tool.d.ts +29 -0
- package/dist/server/core/clarification-tool.js +61 -0
- package/dist/server/core/clarification-tool.js.map +1 -0
- package/dist/server/core/generated-ui-tool.d.ts +31 -0
- package/dist/server/core/generated-ui-tool.js +87 -0
- package/dist/server/core/generated-ui-tool.js.map +1 -0
- package/dist/server/core/index.d.ts +49 -8
- package/dist/server/core/index.js +198 -16
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/core/local-guardrails.d.ts +6 -0
- package/dist/server/core/local-guardrails.js +68 -0
- package/dist/server/core/local-guardrails.js.map +1 -0
- package/dist/server/core/module-router.d.ts +3 -1
- package/dist/server/core/module-router.js +22 -2
- package/dist/server/core/module-router.js.map +1 -1
- package/dist/server/core/plan-tool.d.ts +23 -0
- package/dist/server/core/plan-tool.js +32 -0
- package/dist/server/core/plan-tool.js.map +1 -0
- package/dist/server/core/zod-compact.d.ts +2 -2
- package/dist/server/core/zod-compact.js +56 -7
- package/dist/server/core/zod-compact.js.map +1 -1
- package/dist/server/index.d.ts +2 -4
- package/dist/server/index.js +2 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/local-pipeline.d.ts +14 -0
- package/dist/server/local-pipeline.js +152 -0
- package/dist/server/local-pipeline.js.map +1 -0
- package/dist/server/pii-shield/index.d.ts +1 -0
- package/dist/server/pii-shield/index.js +1 -0
- package/dist/server/pii-shield/index.js.map +1 -1
- package/dist/server/pii-shield/regex-detector.d.ts +13 -0
- package/dist/server/pii-shield/regex-detector.js +109 -0
- package/dist/server/pii-shield/regex-detector.js.map +1 -0
- package/dist/server/testing/guardrails.js +1 -65
- package/dist/server/testing/guardrails.js.map +1 -1
- package/dist/server/testing/helpers.js +1 -62
- package/dist/server/testing/helpers.js.map +1 -1
- package/dist/server/testing/index.d.ts +1 -0
- package/dist/server/testing/index.js +1 -0
- package/dist/server/testing/index.js.map +1 -1
- package/dist/server/testing/registry-parity.d.ts +18 -0
- package/dist/server/testing/registry-parity.js +38 -0
- package/dist/server/testing/registry-parity.js.map +1 -0
- package/dist/server/testing/smoke.d.ts +2 -1
- package/dist/server/testing/smoke.js +5 -3
- package/dist/server/testing/smoke.js.map +1 -1
- package/dist/server/testing/types.d.ts +1 -1
- package/dist/server/testing/zod-introspect.d.ts +1 -1
- package/dist/server/testing/zod-introspect.js +178 -5
- package/dist/server/testing/zod-introspect.js.map +1 -1
- package/dist/stt/index.d.ts +5 -0
- package/dist/stt/index.js +6 -0
- package/dist/stt/index.js.map +1 -0
- package/dist/sync/app-setup-client.d.ts +46 -0
- package/dist/sync/app-setup-client.js +137 -0
- package/dist/sync/app-setup-client.js.map +1 -0
- package/dist/sync/capability-report.d.ts +41 -0
- package/dist/sync/capability-report.js +48 -0
- package/dist/sync/capability-report.js.map +1 -0
- package/dist/sync/connection-lookup.d.ts +19 -0
- package/dist/sync/connection-lookup.js +56 -0
- package/dist/sync/connection-lookup.js.map +1 -0
- package/dist/sync/control-plane-client.d.ts +69 -0
- package/dist/sync/control-plane-client.js +182 -0
- package/dist/sync/control-plane-client.js.map +1 -0
- package/dist/sync/deployment-selector.d.ts +9 -0
- package/dist/sync/deployment-selector.js +26 -0
- package/dist/sync/deployment-selector.js.map +1 -0
- package/dist/sync/fetch-sse-push.d.ts +6 -0
- package/dist/sync/fetch-sse-push.js +42 -0
- package/dist/sync/fetch-sse-push.js.map +1 -0
- package/dist/sync/index.d.ts +26 -0
- package/dist/sync/index.js +17 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/jwks-provider.d.ts +14 -0
- package/dist/sync/jwks-provider.js +53 -0
- package/dist/sync/jwks-provider.js.map +1 -0
- package/dist/sync/local-deployment-validator.d.ts +30 -0
- package/dist/sync/local-deployment-validator.js +60 -0
- package/dist/sync/local-deployment-validator.js.map +1 -0
- package/dist/sync/managed-sync.d.ts +40 -0
- package/dist/sync/managed-sync.js +94 -0
- package/dist/sync/managed-sync.js.map +1 -0
- package/dist/sync/materialize-deployment.d.ts +7 -0
- package/dist/sync/materialize-deployment.js +63 -0
- package/dist/sync/materialize-deployment.js.map +1 -0
- package/dist/sync/runtime-connect-client.d.ts +23 -0
- package/dist/sync/runtime-connect-client.js +182 -0
- package/dist/sync/runtime-connect-client.js.map +1 -0
- package/dist/sync/runtime-setup-client.d.ts +62 -0
- package/dist/sync/runtime-setup-client.js +153 -0
- package/dist/sync/runtime-setup-client.js.map +1 -0
- package/dist/sync/signature-verifier.d.ts +39 -0
- package/dist/sync/signature-verifier.js +97 -0
- package/dist/sync/signature-verifier.js.map +1 -0
- package/dist/sync/state-store.d.ts +24 -0
- package/dist/sync/state-store.js +47 -0
- package/dist/sync/state-store.js.map +1 -0
- package/dist/sync/sync-manager.d.ts +27 -0
- package/dist/sync/sync-manager.js +170 -0
- package/dist/sync/sync-manager.js.map +1 -0
- package/dist/types.d.ts +68 -16
- package/dist/types.js +30 -2
- package/dist/types.js.map +1 -1
- package/embed/package.json +5 -0
- package/package.json +187 -46
- package/runtime/ai-sdk/package.json +5 -0
- package/runtime/package.json +5 -0
- package/skills/README.md +26 -92
- package/skills/building-glirastes-chat-ui/SKILL.md +358 -343
- package/skills/describing-glirastes-tools/SKILL.md +180 -0
- package/skills/integrating-glirastes-nextjs/SKILL.md +149 -302
- package/skills/integrating-glirastes-web/SKILL.md +165 -0
- package/skills/maintaining-glirastes-tools/SKILL.md +133 -461
- package/skills/migrating-to-glirastes/SKILL.md +112 -0
- package/skills/setting-up-glirastes/SKILL.md +158 -0
- package/skills/setting-up-glirastes/agents/openai.yaml +4 -0
- package/skills/setting-up-glirastes/references/artifact-contract.md +40 -0
- package/skills/setting-up-glirastes/scripts/validate-artifact.ts +23 -0
- package/skills/setting-up-glirastes/templates/interview.md +19 -0
- package/stt/package.json +5 -0
- package/dist/cjs/codegen/asset-sync.d.ts +0 -20
- package/dist/cjs/codegen/asset-sync.js +0 -28
- package/dist/cjs/codegen/coverage.d.ts +0 -66
- package/dist/cjs/codegen/coverage.js +0 -408
- package/dist/cjs/codegen/endpoint-scanner.d.ts +0 -16
- package/dist/cjs/codegen/endpoint-scanner.js +0 -197
- package/dist/cjs/codegen/mcp-generator.d.ts +0 -50
- package/dist/cjs/codegen/mcp-generator.js +0 -803
- package/dist/cjs/codegen/module-generator.d.ts +0 -11
- package/dist/cjs/codegen/module-generator.js +0 -353
- package/dist/cjs/codegen/nestjs-scanner.d.ts +0 -43
- package/dist/cjs/codegen/nestjs-scanner.js +0 -241
- package/dist/cjs/codegen/output-recommender.d.ts +0 -23
- package/dist/cjs/codegen/output-recommender.js +0 -33
- package/dist/cjs/codegen/scaffolder.d.ts +0 -36
- package/dist/cjs/codegen/scaffolder.js +0 -262
- package/dist/cjs/codegen/skill-generator.d.ts +0 -49
- package/dist/cjs/codegen/skill-generator.js +0 -967
- package/dist/cjs/codegen/ui-scanner.d.ts +0 -24
- package/dist/cjs/codegen/ui-scanner.js +0 -202
- package/dist/cjs/codegen/validator.d.ts +0 -35
- package/dist/cjs/codegen/validator.js +0 -292
- package/dist/cjs/openapi/index.d.ts +0 -78
- package/dist/cjs/openapi/index.js +0 -347
- package/dist/cjs/react/components/wavesurfer-loader.d.ts +0 -5
- package/dist/cjs/react/components/wavesurfer-loader.js +0 -36
- package/dist/cjs/react/transports/langgraph/index.d.ts +0 -2
- package/dist/cjs/react/transports/langgraph/index.js +0 -8
- package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.d.ts +0 -62
- package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.js +0 -94
- package/dist/cjs/react/transports/langgraph.d.ts +0 -71
- package/dist/cjs/react/transports/langgraph.js +0 -369
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.d.ts +0 -10
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.js +0 -42
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.d.ts +0 -32
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.js +0 -4
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.d.ts +0 -11
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.js +0 -80
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.d.ts +0 -9
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.js +0 -119
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.d.ts +0 -13
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.js +0 -131
- package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.d.ts +0 -7
- package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.js +0 -52
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.d.ts +0 -19
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.js +0 -108
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.d.ts +0 -8
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.js +0 -59
- package/dist/cjs/server/adapters/nestjs/chat/dto/index.d.ts +0 -3
- package/dist/cjs/server/adapters/nestjs/chat/dto/index.js +0 -9
- package/dist/cjs/server/adapters/nestjs/chat/index.d.ts +0 -3
- package/dist/cjs/server/adapters/nestjs/chat/index.js +0 -9
- package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +0 -4
- package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.js +0 -73
- package/dist/cjs/server/adapters/nestjs/chat/ws-loader.d.ts +0 -5
- package/dist/cjs/server/adapters/nestjs/chat/ws-loader.js +0 -72
- package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.d.ts +0 -6
- package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.js +0 -13
- package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.d.ts +0 -5
- package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.js +0 -15
- package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.d.ts +0 -6
- package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.js +0 -22
- package/dist/cjs/server/adapters/nestjs/decorators/constants.d.ts +0 -4
- package/dist/cjs/server/adapters/nestjs/decorators/constants.js +0 -7
- package/dist/cjs/server/adapters/nestjs/index.d.ts +0 -14
- package/dist/cjs/server/adapters/nestjs/index.js +0 -42
- package/dist/cjs/server/adapters/nestjs/metadata.d.ts +0 -39
- package/dist/cjs/server/adapters/nestjs/metadata.js +0 -36
- package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.d.ts +0 -36
- package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.js +0 -159
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.d.ts +0 -37
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.js +0 -44
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.d.ts +0 -28
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.js +0 -41
- package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.d.ts +0 -16
- package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.js +0 -117
- package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.d.ts +0 -26
- package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.js +0 -259
- package/dist/cjs/server/adapters/nestjs/swagger.d.ts +0 -7
- package/dist/cjs/server/adapters/nestjs/swagger.js +0 -39
- package/dist/cli/commands/check-upgrade.d.ts +0 -15
- package/dist/cli/commands/check-upgrade.js +0 -138
- package/dist/cli/commands/check-upgrade.js.map +0 -1
- package/dist/cli/commands/test.d.ts +0 -8
- package/dist/cli/commands/test.js +0 -76
- package/dist/cli/commands/test.js.map +0 -1
- package/dist/cli/utils/changelog-parser.d.ts +0 -13
- package/dist/cli/utils/changelog-parser.js +0 -89
- package/dist/cli/utils/changelog-parser.js.map +0 -1
- package/dist/cli/utils/commit-parser.d.ts +0 -8
- package/dist/cli/utils/commit-parser.js +0 -23
- package/dist/cli/utils/commit-parser.js.map +0 -1
- package/dist/cli/utils/gap-detector.d.ts +0 -14
- package/dist/cli/utils/gap-detector.js +0 -65
- package/dist/cli/utils/gap-detector.js.map +0 -1
- package/dist/cli/utils/get-cli-version.d.ts +0 -2
- package/dist/cli/utils/get-cli-version.js +0 -10
- package/dist/cli/utils/get-cli-version.js.map +0 -1
- package/dist/codegen/asset-sync.d.ts +0 -20
- package/dist/codegen/asset-sync.js +0 -26
- package/dist/codegen/asset-sync.js.map +0 -1
- package/dist/codegen/coverage.d.ts +0 -66
- package/dist/codegen/coverage.js +0 -372
- package/dist/codegen/coverage.js.map +0 -1
- package/dist/codegen/endpoint-scanner.d.ts +0 -16
- package/dist/codegen/endpoint-scanner.js +0 -161
- package/dist/codegen/endpoint-scanner.js.map +0 -1
- package/dist/codegen/mcp-generator.d.ts +0 -50
- package/dist/codegen/mcp-generator.js +0 -801
- package/dist/codegen/mcp-generator.js.map +0 -1
- package/dist/codegen/module-generator.d.ts +0 -11
- package/dist/codegen/module-generator.js +0 -351
- package/dist/codegen/module-generator.js.map +0 -1
- package/dist/codegen/nestjs-scanner.d.ts +0 -43
- package/dist/codegen/nestjs-scanner.js +0 -239
- package/dist/codegen/nestjs-scanner.js.map +0 -1
- package/dist/codegen/output-recommender.d.ts +0 -23
- package/dist/codegen/output-recommender.js +0 -31
- package/dist/codegen/output-recommender.js.map +0 -1
- package/dist/codegen/scaffolder.d.ts +0 -36
- package/dist/codegen/scaffolder.js +0 -259
- package/dist/codegen/scaffolder.js.map +0 -1
- package/dist/codegen/skill-generator.d.ts +0 -49
- package/dist/codegen/skill-generator.js +0 -965
- package/dist/codegen/skill-generator.js.map +0 -1
- package/dist/codegen/ui-scanner.d.ts +0 -24
- package/dist/codegen/ui-scanner.js +0 -197
- package/dist/codegen/ui-scanner.js.map +0 -1
- package/dist/codegen/validator.d.ts +0 -35
- package/dist/codegen/validator.js +0 -256
- package/dist/codegen/validator.js.map +0 -1
- package/dist/openapi/demo-generate.d.ts +0 -1
- package/dist/openapi/demo-generate.js +0 -15
- package/dist/openapi/demo-generate.js.map +0 -1
- package/dist/openapi/index.d.ts +0 -78
- package/dist/openapi/index.js +0 -341
- package/dist/openapi/index.js.map +0 -1
- package/dist/react/components/wavesurfer-loader.d.ts +0 -5
- package/dist/react/components/wavesurfer-loader.js +0 -34
- package/dist/react/components/wavesurfer-loader.js.map +0 -1
- package/dist/react/transports/langgraph/index.d.ts +0 -2
- package/dist/react/transports/langgraph/index.js +0 -3
- package/dist/react/transports/langgraph/index.js.map +0 -1
- package/dist/react/transports/langgraph/langgraph-ai-chat.d.ts +0 -62
- package/dist/react/transports/langgraph/langgraph-ai-chat.js +0 -92
- package/dist/react/transports/langgraph/langgraph-ai-chat.js.map +0 -1
- package/dist/react/transports/langgraph.d.ts +0 -71
- package/dist/react/transports/langgraph.js +0 -366
- package/dist/react/transports/langgraph.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/ai-chat-auth.guard.d.ts +0 -10
- package/dist/server/adapters/nestjs/chat/ai-chat-auth.guard.js +0 -40
- package/dist/server/adapters/nestjs/chat/ai-chat-auth.guard.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/ai-chat-module-options.interface.d.ts +0 -32
- package/dist/server/adapters/nestjs/chat/ai-chat-module-options.interface.js +0 -2
- package/dist/server/adapters/nestjs/chat/ai-chat-module-options.interface.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/ai-chat.controller.d.ts +0 -11
- package/dist/server/adapters/nestjs/chat/ai-chat.controller.js +0 -78
- package/dist/server/adapters/nestjs/chat/ai-chat.controller.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/ai-chat.module.d.ts +0 -9
- package/dist/server/adapters/nestjs/chat/ai-chat.module.js +0 -117
- package/dist/server/adapters/nestjs/chat/ai-chat.module.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/ai-chat.service.d.ts +0 -13
- package/dist/server/adapters/nestjs/chat/ai-chat.service.js +0 -129
- package/dist/server/adapters/nestjs/chat/ai-chat.service.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/dto/ai-chat-request.dto.d.ts +0 -7
- package/dist/server/adapters/nestjs/chat/dto/ai-chat-request.dto.js +0 -49
- package/dist/server/adapters/nestjs/chat/dto/ai-chat-request.dto.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/dto/chat-message-part.dto.d.ts +0 -19
- package/dist/server/adapters/nestjs/chat/dto/chat-message-part.dto.js +0 -105
- package/dist/server/adapters/nestjs/chat/dto/chat-message-part.dto.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/dto/chat-message.dto.d.ts +0 -8
- package/dist/server/adapters/nestjs/chat/dto/chat-message.dto.js +0 -56
- package/dist/server/adapters/nestjs/chat/dto/chat-message.dto.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/dto/index.d.ts +0 -3
- package/dist/server/adapters/nestjs/chat/dto/index.js +0 -4
- package/dist/server/adapters/nestjs/chat/dto/index.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/index.d.ts +0 -3
- package/dist/server/adapters/nestjs/chat/index.js +0 -3
- package/dist/server/adapters/nestjs/chat/index.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +0 -4
- package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js +0 -71
- package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js.map +0 -1
- package/dist/server/adapters/nestjs/chat/ws-loader.d.ts +0 -5
- package/dist/server/adapters/nestjs/chat/ws-loader.js +0 -37
- package/dist/server/adapters/nestjs/chat/ws-loader.js.map +0 -1
- package/dist/server/adapters/nestjs/decorators/ai-module.decorator.d.ts +0 -6
- package/dist/server/adapters/nestjs/decorators/ai-module.decorator.js +0 -11
- package/dist/server/adapters/nestjs/decorators/ai-module.decorator.js.map +0 -1
- package/dist/server/adapters/nestjs/decorators/ai-param.decorator.d.ts +0 -5
- package/dist/server/adapters/nestjs/decorators/ai-param.decorator.js +0 -13
- package/dist/server/adapters/nestjs/decorators/ai-param.decorator.js.map +0 -1
- package/dist/server/adapters/nestjs/decorators/ai-tool.decorator.d.ts +0 -6
- package/dist/server/adapters/nestjs/decorators/ai-tool.decorator.js +0 -20
- package/dist/server/adapters/nestjs/decorators/ai-tool.decorator.js.map +0 -1
- package/dist/server/adapters/nestjs/decorators/constants.d.ts +0 -4
- package/dist/server/adapters/nestjs/decorators/constants.js +0 -5
- package/dist/server/adapters/nestjs/decorators/constants.js.map +0 -1
- package/dist/server/adapters/nestjs/index.d.ts +0 -14
- package/dist/server/adapters/nestjs/index.js +0 -20
- package/dist/server/adapters/nestjs/index.js.map +0 -1
- package/dist/server/adapters/nestjs/metadata.d.ts +0 -39
- package/dist/server/adapters/nestjs/metadata.js +0 -30
- package/dist/server/adapters/nestjs/metadata.js.map +0 -1
- package/dist/server/adapters/nestjs/module/ai-tools-explorer.service.d.ts +0 -36
- package/dist/server/adapters/nestjs/module/ai-tools-explorer.service.js +0 -156
- package/dist/server/adapters/nestjs/module/ai-tools-explorer.service.js.map +0 -1
- package/dist/server/adapters/nestjs/module/ai-tools.module.d.ts +0 -37
- package/dist/server/adapters/nestjs/module/ai-tools.module.js +0 -42
- package/dist/server/adapters/nestjs/module/ai-tools.module.js.map +0 -1
- package/dist/server/adapters/nestjs/module/ai-tools.service.d.ts +0 -28
- package/dist/server/adapters/nestjs/module/ai-tools.service.js +0 -38
- package/dist/server/adapters/nestjs/module/ai-tools.service.js.map +0 -1
- package/dist/server/adapters/nestjs/scanner/nestjs-scanner.d.ts +0 -16
- package/dist/server/adapters/nestjs/scanner/nestjs-scanner.js +0 -115
- package/dist/server/adapters/nestjs/scanner/nestjs-scanner.js.map +0 -1
- package/dist/server/adapters/nestjs/scanner/schema-builder.d.ts +0 -26
- package/dist/server/adapters/nestjs/scanner/schema-builder.js +0 -255
- package/dist/server/adapters/nestjs/scanner/schema-builder.js.map +0 -1
- package/dist/server/adapters/nestjs/swagger.d.ts +0 -7
- package/dist/server/adapters/nestjs/swagger.js +0 -37
- package/dist/server/adapters/nestjs/swagger.js.map +0 -1
- package/openapi/package.json +0 -5
- package/react/langgraph/package.json +0 -5
- package/server/nestjs/package.json +0 -5
- package/skills/integrating-glirastes-nestjs/SKILL.md +0 -346
- package/skills/integrating-glirastes-nextjs-with-nestjs-backend/SKILL.md +0 -359
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RevisionSignature } from '../contracts/revisions.js';
|
|
2
|
+
import { type RuntimePublicJwk } from '../sync/signature-verifier.js';
|
|
3
|
+
export interface LocalRevisionSigner {
|
|
4
|
+
readonly keyId: string;
|
|
5
|
+
readonly publicKeyJwk: RuntimePublicJwk;
|
|
6
|
+
sign<T extends object>(unsigned: T): T & {
|
|
7
|
+
signature: RevisionSignature;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Standalone mode has no control plane and therefore no platform signing
|
|
12
|
+
* key. It still never lets unsigned data into the runtime: every locally
|
|
13
|
+
* materialized revision is signed with an ephemeral Ed25519 key generated
|
|
14
|
+
* at boot, and verifies through the exact same verifier chain managed
|
|
15
|
+
* revisions use. The key never leaves the process and dies with it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createEphemeralLocalSigner(): LocalRevisionSigner;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEphemeralLocalSigner = createEphemeralLocalSigner;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const signature_verifier_js_1 = require("../sync/signature-verifier.js");
|
|
6
|
+
/**
|
|
7
|
+
* Standalone mode has no control plane and therefore no platform signing
|
|
8
|
+
* key. It still never lets unsigned data into the runtime: every locally
|
|
9
|
+
* materialized revision is signed with an ephemeral Ed25519 key generated
|
|
10
|
+
* at boot, and verifies through the exact same verifier chain managed
|
|
11
|
+
* revisions use. The key never leaves the process and dies with it.
|
|
12
|
+
*/
|
|
13
|
+
function createEphemeralLocalSigner() {
|
|
14
|
+
const { publicKey, privateKey } = (0, node_crypto_1.generateKeyPairSync)('ed25519');
|
|
15
|
+
const keyId = (0, node_crypto_1.createHash)('sha256')
|
|
16
|
+
.update(publicKey.export({ type: 'spki', format: 'der' }))
|
|
17
|
+
.digest('hex')
|
|
18
|
+
.slice(0, 16);
|
|
19
|
+
const publicKeyJwk = {
|
|
20
|
+
...publicKey.export({ format: 'jwk' }),
|
|
21
|
+
kid: keyId,
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
keyId,
|
|
25
|
+
publicKeyJwk,
|
|
26
|
+
sign(unsigned) {
|
|
27
|
+
const value = (0, node_crypto_1.sign)(null, Buffer.from((0, signature_verifier_js_1.canonicalRuntimeJson)(unsigned)), privateKey).toString('base64url');
|
|
28
|
+
return {
|
|
29
|
+
...unsigned,
|
|
30
|
+
signature: { algorithm: 'Ed25519', keyId, value },
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ManifestTool } from '../contracts/revisions.js';
|
|
2
|
+
import type { EndpointMethod, SchemaLike, Tool, ToolRegistry } from '../types.js';
|
|
3
|
+
import type { TurnSnapshot } from './turn-snapshot.js';
|
|
4
|
+
export declare function createLocalSchemaDigest(schema: SchemaLike | undefined): string;
|
|
5
|
+
interface LocalToolBindingBase {
|
|
6
|
+
/** Stable UUID assigned by the control plane and synced into the target app. */
|
|
7
|
+
toolId: string;
|
|
8
|
+
/** Fingerprint derived locally from the bound source route. */
|
|
9
|
+
sourceFingerprint: string;
|
|
10
|
+
inputSchemaDigest: string;
|
|
11
|
+
outputSchemaDigest: string;
|
|
12
|
+
/** Local schema and executor; never transmitted to the control plane. */
|
|
13
|
+
tool: Tool;
|
|
14
|
+
}
|
|
15
|
+
export interface LocalEndpointToolBinding extends LocalToolBindingBase {
|
|
16
|
+
executionKind: 'endpoint';
|
|
17
|
+
method: EndpointMethod;
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LocalUiToolBinding extends LocalToolBindingBase {
|
|
21
|
+
executionKind: 'ui';
|
|
22
|
+
actionBindingRef: string;
|
|
23
|
+
}
|
|
24
|
+
export type LocalToolBinding = LocalEndpointToolBinding | LocalUiToolBinding;
|
|
25
|
+
/**
|
|
26
|
+
* Names of the technical facts on which a local binding disagrees with its
|
|
27
|
+
* signed manifest entry. Names only, never values or content.
|
|
28
|
+
*/
|
|
29
|
+
export declare function localToolBindingMismatches(binding: LocalToolBinding, manifestTool: ManifestTool): string[];
|
|
30
|
+
export declare function assertLocalToolBindingMatches(binding: LocalToolBinding, manifestTool: ManifestTool): void;
|
|
31
|
+
/**
|
|
32
|
+
* Tool names are either dotted definitionIds with camelCase segments
|
|
33
|
+
* (`ui.navigate`, `tasks.bulkUpdateStatus`) — the managed manifest's name
|
|
34
|
+
* domain — or historical snake_case names.
|
|
35
|
+
*/
|
|
36
|
+
export declare const TOOL_NAME_PATTERN: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* Model providers reject '.' in function names (^[a-zA-Z0-9_-]+$). The signed
|
|
39
|
+
* manifest name stays the identity; this is only its deterministic model-safe
|
|
40
|
+
* encoding. Collisions after encoding fail closed at materialization.
|
|
41
|
+
*/
|
|
42
|
+
export declare function modelFacingToolName(manifestName: string): string;
|
|
43
|
+
export type ToolRegistryDiagnosticReason = 'local-binding-missing' | 'local-binding-mismatch' | 'runtime-policy-missing' | 'runtime-policy-risk-below-manifest';
|
|
44
|
+
export interface ToolRegistryDiagnostic {
|
|
45
|
+
code: 'E-BINDING-010' | 'E-BINDING-011' | 'E-POLICY-010' | 'E-POLICY-011';
|
|
46
|
+
reason: ToolRegistryDiagnosticReason;
|
|
47
|
+
toolId: string;
|
|
48
|
+
/** Names of mismatched technical facts; never values or content. */
|
|
49
|
+
mismatches?: string[];
|
|
50
|
+
}
|
|
51
|
+
export declare function materializeManifestToolRegistry(options: {
|
|
52
|
+
snapshot: TurnSnapshot;
|
|
53
|
+
bindings: ReadonlyArray<LocalToolBinding>;
|
|
54
|
+
/** Receives one content-free diagnostic per tool that stays unavailable. */
|
|
55
|
+
onToolUnavailable?: (diagnostic: ToolRegistryDiagnostic) => void;
|
|
56
|
+
}): ToolRegistry;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_NAME_PATTERN = void 0;
|
|
4
|
+
exports.createLocalSchemaDigest = createLocalSchemaDigest;
|
|
5
|
+
exports.localToolBindingMismatches = localToolBindingMismatches;
|
|
6
|
+
exports.assertLocalToolBindingMatches = assertLocalToolBindingMatches;
|
|
7
|
+
exports.modelFacingToolName = modelFacingToolName;
|
|
8
|
+
exports.materializeManifestToolRegistry = materializeManifestToolRegistry;
|
|
9
|
+
const node_crypto_1 = require("node:crypto");
|
|
10
|
+
const tool_policy_js_1 = require("../contracts/tool-policy.js");
|
|
11
|
+
function canonicalSchemaValue(value, ancestors = []) {
|
|
12
|
+
if (value === null
|
|
13
|
+
|| typeof value === 'string'
|
|
14
|
+
|| typeof value === 'number'
|
|
15
|
+
|| typeof value === 'boolean') {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
if (value === undefined)
|
|
19
|
+
return { type: 'undefined' };
|
|
20
|
+
if (typeof value === 'bigint')
|
|
21
|
+
return { bigint: value.toString() };
|
|
22
|
+
if (typeof value === 'function')
|
|
23
|
+
return { function: true };
|
|
24
|
+
if (typeof value !== 'object')
|
|
25
|
+
return { type: typeof value };
|
|
26
|
+
if (value instanceof Date)
|
|
27
|
+
return { date: value.toISOString() };
|
|
28
|
+
if (value instanceof RegExp)
|
|
29
|
+
return { regexp: value.toString() };
|
|
30
|
+
if (ancestors.includes(value))
|
|
31
|
+
return { circular: true };
|
|
32
|
+
const nextAncestors = [...ancestors, value];
|
|
33
|
+
const schemaDefinition = value._zod?.def ?? value._def;
|
|
34
|
+
if (schemaDefinition) {
|
|
35
|
+
return {
|
|
36
|
+
schema: canonicalSchemaValue(schemaDefinition, nextAncestors),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (Array.isArray(value)) {
|
|
40
|
+
return value.map((entry) => canonicalSchemaValue(entry, nextAncestors));
|
|
41
|
+
}
|
|
42
|
+
if (value instanceof Map) {
|
|
43
|
+
return [...value.entries()]
|
|
44
|
+
.map(([key, entry]) => [
|
|
45
|
+
canonicalSchemaValue(key, nextAncestors),
|
|
46
|
+
canonicalSchemaValue(entry, nextAncestors),
|
|
47
|
+
])
|
|
48
|
+
.sort(([left], [right]) => JSON.stringify(left).localeCompare(JSON.stringify(right)));
|
|
49
|
+
}
|
|
50
|
+
if (value instanceof Set) {
|
|
51
|
+
return [...value]
|
|
52
|
+
.map((entry) => canonicalSchemaValue(entry, nextAncestors))
|
|
53
|
+
.sort((left, right) => JSON.stringify(left).localeCompare(JSON.stringify(right)));
|
|
54
|
+
}
|
|
55
|
+
return Object.fromEntries(Object.keys(value)
|
|
56
|
+
.sort()
|
|
57
|
+
.map((key) => {
|
|
58
|
+
const child = value[key];
|
|
59
|
+
const canonicalChild = ((key === 'shape' || key === 'getter')
|
|
60
|
+
&& typeof child === 'function')
|
|
61
|
+
? canonicalSchemaValue(child(), nextAncestors)
|
|
62
|
+
: canonicalSchemaValue(child, nextAncestors);
|
|
63
|
+
return [key, canonicalChild];
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
function createLocalSchemaDescriptor(schema) {
|
|
67
|
+
return JSON.stringify(canonicalSchemaValue(schema));
|
|
68
|
+
}
|
|
69
|
+
function createLocalSchemaDigest(schema) {
|
|
70
|
+
const canonical = createLocalSchemaDescriptor(schema);
|
|
71
|
+
return `sha256:${(0, node_crypto_1.createHash)('sha256')
|
|
72
|
+
.update(canonical)
|
|
73
|
+
.digest('base64url')}`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Names of the technical facts on which a local binding disagrees with its
|
|
77
|
+
* signed manifest entry. Names only, never values or content.
|
|
78
|
+
*/
|
|
79
|
+
function localToolBindingMismatches(binding, manifestTool) {
|
|
80
|
+
const mismatches = [];
|
|
81
|
+
if (binding.executionKind !== manifestTool.executionKind) {
|
|
82
|
+
mismatches.push('execution kind');
|
|
83
|
+
}
|
|
84
|
+
if (binding.sourceFingerprint !== manifestTool.sourceFingerprint) {
|
|
85
|
+
mismatches.push('source fingerprint');
|
|
86
|
+
}
|
|
87
|
+
if (binding.inputSchemaDigest !== manifestTool.inputSchemaDigest) {
|
|
88
|
+
mismatches.push('input schema digest');
|
|
89
|
+
}
|
|
90
|
+
if (binding.outputSchemaDigest !== manifestTool.outputSchemaDigest) {
|
|
91
|
+
mismatches.push('output schema digest');
|
|
92
|
+
}
|
|
93
|
+
if (binding.executionKind === 'endpoint'
|
|
94
|
+
&& manifestTool.executionKind === 'endpoint') {
|
|
95
|
+
if (binding.method !== manifestTool.method)
|
|
96
|
+
mismatches.push('method');
|
|
97
|
+
if (binding.path !== manifestTool.path)
|
|
98
|
+
mismatches.push('path');
|
|
99
|
+
}
|
|
100
|
+
if (binding.executionKind === 'ui'
|
|
101
|
+
&& manifestTool.executionKind === 'ui'
|
|
102
|
+
&& binding.actionBindingRef !== manifestTool.actionBindingRef) {
|
|
103
|
+
mismatches.push('action binding');
|
|
104
|
+
}
|
|
105
|
+
return mismatches;
|
|
106
|
+
}
|
|
107
|
+
function assertLocalToolBindingMatches(binding, manifestTool) {
|
|
108
|
+
const mismatches = localToolBindingMismatches(binding, manifestTool);
|
|
109
|
+
if (mismatches.length > 0) {
|
|
110
|
+
throw new Error(`Local tool binding mismatch (${manifestTool.toolId}): `
|
|
111
|
+
+ mismatches.join(', '));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Tool names are either dotted definitionIds with camelCase segments
|
|
116
|
+
* (`ui.navigate`, `tasks.bulkUpdateStatus`) — the managed manifest's name
|
|
117
|
+
* domain — or historical snake_case names.
|
|
118
|
+
*/
|
|
119
|
+
exports.TOOL_NAME_PATTERN = /^[a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*$/;
|
|
120
|
+
/**
|
|
121
|
+
* Model providers reject '.' in function names (^[a-zA-Z0-9_-]+$). The signed
|
|
122
|
+
* manifest name stays the identity; this is only its deterministic model-safe
|
|
123
|
+
* encoding. Collisions after encoding fail closed at materialization.
|
|
124
|
+
*/
|
|
125
|
+
function modelFacingToolName(manifestName) {
|
|
126
|
+
return manifestName.replace(/\./g, '_');
|
|
127
|
+
}
|
|
128
|
+
function reportUnavailableTool(diagnostic) {
|
|
129
|
+
console.warn('[glirastes] tool disabled for this turn', diagnostic);
|
|
130
|
+
}
|
|
131
|
+
function materializeManifestToolRegistry(options) {
|
|
132
|
+
const report = options.onToolUnavailable ?? reportUnavailableTool;
|
|
133
|
+
const bindingsByToolId = new Map();
|
|
134
|
+
for (const binding of options.bindings) {
|
|
135
|
+
if (bindingsByToolId.has(binding.toolId)) {
|
|
136
|
+
throw new Error(`Duplicate local tool binding: ${binding.toolId}`);
|
|
137
|
+
}
|
|
138
|
+
bindingsByToolId.set(binding.toolId, binding);
|
|
139
|
+
}
|
|
140
|
+
const policiesByToolId = new Map(options.snapshot.policyRevision.toolPolicies.map((policy) => [policy.toolId, policy]));
|
|
141
|
+
const allowedToolIds = new Set(options.snapshot.agentRevision.toolAllowlist);
|
|
142
|
+
const registry = {};
|
|
143
|
+
for (const manifestTool of options.snapshot.manifestRevision.tools) {
|
|
144
|
+
if (!manifestTool.enabled
|
|
145
|
+
|| manifestTool.tombstone
|
|
146
|
+
|| !allowedToolIds.has(manifestTool.toolId)) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const toolId = manifestTool.toolId;
|
|
150
|
+
// Each failure below disables only this tool; the rest keep working.
|
|
151
|
+
const policy = policiesByToolId.get(toolId);
|
|
152
|
+
if (!policy) {
|
|
153
|
+
report({ code: 'E-POLICY-010', reason: 'runtime-policy-missing', toolId });
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (!policy.enabled)
|
|
157
|
+
continue;
|
|
158
|
+
// A policy may raise the manifest risk (overlay), never lower it.
|
|
159
|
+
if ((0, tool_policy_js_1.riskTier)(policy.riskClass) < (0, tool_policy_js_1.riskTier)(manifestTool.riskClass)) {
|
|
160
|
+
report({
|
|
161
|
+
code: 'E-POLICY-011',
|
|
162
|
+
reason: 'runtime-policy-risk-below-manifest',
|
|
163
|
+
toolId,
|
|
164
|
+
});
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const binding = bindingsByToolId.get(toolId);
|
|
168
|
+
if (!binding) {
|
|
169
|
+
report({ code: 'E-BINDING-010', reason: 'local-binding-missing', toolId });
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const mismatches = localToolBindingMismatches(binding, manifestTool);
|
|
173
|
+
if (mismatches.length > 0) {
|
|
174
|
+
report({
|
|
175
|
+
code: 'E-BINDING-011',
|
|
176
|
+
reason: 'local-binding-mismatch',
|
|
177
|
+
toolId,
|
|
178
|
+
mismatches,
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const modelName = modelFacingToolName(manifestTool.name);
|
|
183
|
+
if (registry[modelName]) {
|
|
184
|
+
throw new Error(`Manifest tool names collide after model-safe encoding: ${modelName}`);
|
|
185
|
+
}
|
|
186
|
+
registry[modelName] = {
|
|
187
|
+
...binding.tool,
|
|
188
|
+
id: toolId,
|
|
189
|
+
description: manifestTool.description,
|
|
190
|
+
method: manifestTool.executionKind === 'endpoint'
|
|
191
|
+
? manifestTool.method
|
|
192
|
+
: undefined,
|
|
193
|
+
needsApproval: (0, tool_policy_js_1.confirmationFloor)(policy.riskClass, policy.requiresApproval),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return registry;
|
|
197
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Principal, SecurityRevocation } from '../contracts/index.js';
|
|
2
|
+
import type { AiSdkToolCall, AiSdkToolFailure, AiSdkToolSuccess } from './ai-sdk/engine.js';
|
|
3
|
+
import { ExecutionBudgetTracker, type BudgetEvaluation, type ExecutionUsage } from './budget.js';
|
|
4
|
+
import { type TurnSnapshot } from './turn-snapshot.js';
|
|
5
|
+
export interface ManagedTurnBudgetSignal {
|
|
6
|
+
evaluation: BudgetEvaluation;
|
|
7
|
+
usage: ExecutionUsage;
|
|
8
|
+
}
|
|
9
|
+
export interface ManagedTurnGuardOptions {
|
|
10
|
+
snapshot: TurnSnapshot;
|
|
11
|
+
resolvePrincipal: () => Principal | undefined | Promise<Principal | undefined>;
|
|
12
|
+
loadRevocations?: (snapshot: TurnSnapshot) => ReadonlyArray<SecurityRevocation> | Promise<ReadonlyArray<SecurityRevocation>>;
|
|
13
|
+
onBudgetSignal?: (signal: ManagedTurnBudgetSignal) => void | Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface ManagedTurnGuard {
|
|
16
|
+
readonly snapshot: TurnSnapshot;
|
|
17
|
+
readonly tracker: ExecutionBudgetTracker;
|
|
18
|
+
readonly toolTimeoutMs: number;
|
|
19
|
+
beforeToolCall(call: AiSdkToolCall): Promise<void>;
|
|
20
|
+
afterModelStep(usage: {
|
|
21
|
+
inputTokens: number;
|
|
22
|
+
outputTokens: number;
|
|
23
|
+
estimatedCostUsd?: number;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
afterToolCall(call: AiSdkToolSuccess): Promise<void>;
|
|
26
|
+
onToolError(call: AiSdkToolFailure): Promise<void>;
|
|
27
|
+
resolveApproval(call: AiSdkToolCall): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export declare function createManagedTurnGuard(options: ManagedTurnGuardOptions): ManagedTurnGuard;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createManagedTurnGuard = createManagedTurnGuard;
|
|
4
|
+
const authorization_js_1 = require("./authorization.js");
|
|
5
|
+
const local_tool_bindings_js_1 = require("./local-tool-bindings.js");
|
|
6
|
+
const budget_js_1 = require("./budget.js");
|
|
7
|
+
const fingerprint_js_1 = require("./fingerprint.js");
|
|
8
|
+
const turn_snapshot_js_1 = require("./turn-snapshot.js");
|
|
9
|
+
function errorResult(result) {
|
|
10
|
+
return typeof result === 'object'
|
|
11
|
+
&& result !== null
|
|
12
|
+
&& 'error' in result
|
|
13
|
+
&& typeof result.error === 'string';
|
|
14
|
+
}
|
|
15
|
+
function createManagedTurnGuard(options) {
|
|
16
|
+
const tracker = new budget_js_1.ExecutionBudgetTracker(options.snapshot.budget);
|
|
17
|
+
const resolveManifestTool = (toolName) => {
|
|
18
|
+
// Calls arrive under the model-safe encoding of the signed manifest name.
|
|
19
|
+
const tool = options.snapshot.manifestRevision.tools.find((candidate) => (0, local_tool_bindings_js_1.modelFacingToolName)(candidate.name) === toolName);
|
|
20
|
+
if (!tool) {
|
|
21
|
+
throw new Error(`Tool execution denied: manifest_tool_unavailable (${toolName})`);
|
|
22
|
+
}
|
|
23
|
+
return tool;
|
|
24
|
+
};
|
|
25
|
+
const authorize = async (call) => {
|
|
26
|
+
const manifestTool = resolveManifestTool(call.toolName);
|
|
27
|
+
const principal = await options.resolvePrincipal();
|
|
28
|
+
const authorization = (0, authorization_js_1.authorizeToolCall)({
|
|
29
|
+
principal,
|
|
30
|
+
agentRevision: options.snapshot.agentRevision,
|
|
31
|
+
manifestRevision: options.snapshot.manifestRevision,
|
|
32
|
+
policyRevision: options.snapshot.policyRevision,
|
|
33
|
+
toolId: manifestTool.toolId,
|
|
34
|
+
});
|
|
35
|
+
if (!authorization.allowed) {
|
|
36
|
+
throw new Error(`Tool execution denied: ${authorization.reason} (${call.toolName})`);
|
|
37
|
+
}
|
|
38
|
+
const revocations = await options.loadRevocations?.(options.snapshot) ?? [];
|
|
39
|
+
if ((0, turn_snapshot_js_1.isToolRevoked)(options.snapshot, manifestTool.toolId, revocations)) {
|
|
40
|
+
throw new Error(`Tool execution denied: revoked (${call.toolName})`);
|
|
41
|
+
}
|
|
42
|
+
return { authorization, manifestTool };
|
|
43
|
+
};
|
|
44
|
+
const emitBudgetSignal = async () => {
|
|
45
|
+
const evaluation = tracker.evaluate();
|
|
46
|
+
if (evaluation.state !== 'within-budget') {
|
|
47
|
+
await options.onBudgetSignal?.({
|
|
48
|
+
evaluation,
|
|
49
|
+
usage: tracker.usage,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return evaluation;
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
snapshot: options.snapshot,
|
|
56
|
+
tracker,
|
|
57
|
+
toolTimeoutMs: options.snapshot.budget.toolTimeoutMs,
|
|
58
|
+
async beforeToolCall(call) {
|
|
59
|
+
const currentBudget = await emitBudgetSignal();
|
|
60
|
+
if (currentBudget.state === 'hard-limit') {
|
|
61
|
+
throw new Error(`Tool execution denied: budget_exhausted (${currentBudget.reasons.join(',')})`);
|
|
62
|
+
}
|
|
63
|
+
await authorize(call);
|
|
64
|
+
tracker.recordToolCall();
|
|
65
|
+
await emitBudgetSignal();
|
|
66
|
+
},
|
|
67
|
+
async afterModelStep(usage) {
|
|
68
|
+
tracker.recordModelStep();
|
|
69
|
+
tracker.recordTokens(usage.inputTokens, usage.outputTokens);
|
|
70
|
+
if (usage.estimatedCostUsd !== undefined) {
|
|
71
|
+
tracker.recordEstimatedCost(usage.estimatedCostUsd);
|
|
72
|
+
}
|
|
73
|
+
await emitBudgetSignal();
|
|
74
|
+
},
|
|
75
|
+
async afterToolCall(call) {
|
|
76
|
+
const { manifestTool } = await authorize(call);
|
|
77
|
+
tracker.recordFingerprint((0, fingerprint_js_1.createExecutionFingerprint)({
|
|
78
|
+
toolId: manifestTool.toolId,
|
|
79
|
+
arguments: call.input,
|
|
80
|
+
result: call.result,
|
|
81
|
+
}));
|
|
82
|
+
if (errorResult(call.result)) {
|
|
83
|
+
tracker.recordError();
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
tracker.recordSuccess();
|
|
87
|
+
}
|
|
88
|
+
await emitBudgetSignal();
|
|
89
|
+
},
|
|
90
|
+
async onToolError() {
|
|
91
|
+
tracker.recordError();
|
|
92
|
+
await emitBudgetSignal();
|
|
93
|
+
},
|
|
94
|
+
async resolveApproval(call) {
|
|
95
|
+
const { authorization } = await authorize(call);
|
|
96
|
+
return authorization.requiresApproval;
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type RuntimeTurnCost } from '../../contracts/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Prices for models whose provider reports no cost. A provider-reported cost
|
|
5
|
+
* always wins; the table only fills gaps and every estimate names its
|
|
6
|
+
* `version`. Glirastes ships no default table: prices change, and a stale
|
|
7
|
+
* table would be wrong without anyone noticing.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RuntimePriceTableSchema: z.ZodObject<{
|
|
10
|
+
version: z.ZodString;
|
|
11
|
+
models: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
12
|
+
inputUsdPerMillion: z.ZodNumber;
|
|
13
|
+
outputUsdPerMillion: z.ZodNumber;
|
|
14
|
+
}, z.core.$strict>>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type RuntimePriceTable = z.infer<typeof RuntimePriceTableSchema>;
|
|
17
|
+
export declare const UNKNOWN_TURN_COST: RuntimeTurnCost;
|
|
18
|
+
export interface StepCostInput {
|
|
19
|
+
model: string | null;
|
|
20
|
+
inputTokens: number;
|
|
21
|
+
outputTokens: number;
|
|
22
|
+
/** AI SDK `providerMetadata` of the step. */
|
|
23
|
+
providerMetadata?: unknown;
|
|
24
|
+
/** AI SDK `usage.raw` of the step (the provider's own usage object). */
|
|
25
|
+
usageRaw?: unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Cost found in the step's raw stream chunks (`rawChunkCostUsd`). The
|
|
28
|
+
* OpenAI-compatible provider strips OpenRouter's `usage.cost` from
|
|
29
|
+
* `usage.raw`; only the raw chunk keeps it.
|
|
30
|
+
*/
|
|
31
|
+
rawChunkCostUsd?: number | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The cost an OpenRouter stream chunk carries (`usage.cost` of the final
|
|
35
|
+
* chunk), as delivered by `streamText({ includeRawChunks: true })`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function rawChunkCostUsd(rawValue: unknown): number | null;
|
|
38
|
+
/**
|
|
39
|
+
* The cost the provider reported for one model step, in USD. Three locations
|
|
40
|
+
* are read in this order, and they are not equally verified:
|
|
41
|
+
*
|
|
42
|
+
* - `providerMetadata.openrouter.usage.cost`, where OpenRouter's official
|
|
43
|
+
* provider is documented to put it. Modelled, not measured:
|
|
44
|
+
* `@openrouter/ai-sdk-provider` is not a dependency of this package and
|
|
45
|
+
* no test runs against it, only hand-written metadata objects.
|
|
46
|
+
* - `usage.raw.cost`, for a provider that keeps unknown usage fields. Also
|
|
47
|
+
* modelled. The OpenAI-compatible provider is not such a provider.
|
|
48
|
+
* - the raw stream chunk (`rawChunkCostUsd`), the path
|
|
49
|
+
* `createOpenAI({ baseURL: 'https://openrouter.ai/api/v1' })` needs.
|
|
50
|
+
* Measured in the source of `@ai-sdk/openai` 3.0.53, whose chunk schema
|
|
51
|
+
* strips `cost` from `usage.raw`. Whether a live OpenRouter response sends
|
|
52
|
+
* `usage.cost` in the final chunk is not verified here.
|
|
53
|
+
*/
|
|
54
|
+
export declare function providerReportedCostUsd(input: {
|
|
55
|
+
providerMetadata?: unknown;
|
|
56
|
+
usageRaw?: unknown;
|
|
57
|
+
rawChunkCostUsd?: number | null;
|
|
58
|
+
}): number | null;
|
|
59
|
+
export declare function resolveStepCost(input: StepCostInput, priceTable?: RuntimePriceTable): RuntimeTurnCost;
|
|
60
|
+
/**
|
|
61
|
+
* A turn's cost is known only when every model step's cost is known. Any
|
|
62
|
+
* estimated step makes the whole turn a price-table cost.
|
|
63
|
+
*/
|
|
64
|
+
export declare function combineTurnCost(steps: ReadonlyArray<RuntimeTurnCost>): RuntimeTurnCost;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNKNOWN_TURN_COST = exports.RuntimePriceTableSchema = void 0;
|
|
4
|
+
exports.rawChunkCostUsd = rawChunkCostUsd;
|
|
5
|
+
exports.providerReportedCostUsd = providerReportedCostUsd;
|
|
6
|
+
exports.resolveStepCost = resolveStepCost;
|
|
7
|
+
exports.combineTurnCost = combineTurnCost;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const index_js_1 = require("../../contracts/index.js");
|
|
10
|
+
const usdPerMillion = zod_1.z.number().finite().nonnegative().max(10_000);
|
|
11
|
+
/**
|
|
12
|
+
* Prices for models whose provider reports no cost. A provider-reported cost
|
|
13
|
+
* always wins; the table only fills gaps and every estimate names its
|
|
14
|
+
* `version`. Glirastes ships no default table: prices change, and a stale
|
|
15
|
+
* table would be wrong without anyone noticing.
|
|
16
|
+
*/
|
|
17
|
+
exports.RuntimePriceTableSchema = zod_1.z.object({
|
|
18
|
+
version: zod_1.z.string().regex(index_js_1.RUNTIME_PRICING_VERSION_PATTERN),
|
|
19
|
+
models: zod_1.z.record(zod_1.z.string().regex(index_js_1.RUNTIME_METRIC_LABEL_PATTERN), zod_1.z.object({
|
|
20
|
+
inputUsdPerMillion: usdPerMillion,
|
|
21
|
+
outputUsdPerMillion: usdPerMillion,
|
|
22
|
+
}).strict()),
|
|
23
|
+
}).strict();
|
|
24
|
+
exports.UNKNOWN_TURN_COST = Object.freeze({
|
|
25
|
+
usd: null,
|
|
26
|
+
source: null,
|
|
27
|
+
pricingVersion: null,
|
|
28
|
+
});
|
|
29
|
+
function child(value, key) {
|
|
30
|
+
return value !== null && typeof value === 'object'
|
|
31
|
+
? value[key]
|
|
32
|
+
: undefined;
|
|
33
|
+
}
|
|
34
|
+
function usableAmount(value) {
|
|
35
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0
|
|
36
|
+
? value
|
|
37
|
+
: null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The cost an OpenRouter stream chunk carries (`usage.cost` of the final
|
|
41
|
+
* chunk), as delivered by `streamText({ includeRawChunks: true })`.
|
|
42
|
+
*/
|
|
43
|
+
function rawChunkCostUsd(rawValue) {
|
|
44
|
+
return usableAmount(child(child(rawValue, 'usage'), 'cost'));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The cost the provider reported for one model step, in USD. Three locations
|
|
48
|
+
* are read in this order, and they are not equally verified:
|
|
49
|
+
*
|
|
50
|
+
* - `providerMetadata.openrouter.usage.cost`, where OpenRouter's official
|
|
51
|
+
* provider is documented to put it. Modelled, not measured:
|
|
52
|
+
* `@openrouter/ai-sdk-provider` is not a dependency of this package and
|
|
53
|
+
* no test runs against it, only hand-written metadata objects.
|
|
54
|
+
* - `usage.raw.cost`, for a provider that keeps unknown usage fields. Also
|
|
55
|
+
* modelled. The OpenAI-compatible provider is not such a provider.
|
|
56
|
+
* - the raw stream chunk (`rawChunkCostUsd`), the path
|
|
57
|
+
* `createOpenAI({ baseURL: 'https://openrouter.ai/api/v1' })` needs.
|
|
58
|
+
* Measured in the source of `@ai-sdk/openai` 3.0.53, whose chunk schema
|
|
59
|
+
* strips `cost` from `usage.raw`. Whether a live OpenRouter response sends
|
|
60
|
+
* `usage.cost` in the final chunk is not verified here.
|
|
61
|
+
*/
|
|
62
|
+
function providerReportedCostUsd(input) {
|
|
63
|
+
return usableAmount(child(child(child(input.providerMetadata, 'openrouter'), 'usage'), 'cost'))
|
|
64
|
+
?? usableAmount(child(input.usageRaw, 'cost'))
|
|
65
|
+
?? usableAmount(input.rawChunkCostUsd);
|
|
66
|
+
}
|
|
67
|
+
function resolveStepCost(input, priceTable) {
|
|
68
|
+
const reported = providerReportedCostUsd(input);
|
|
69
|
+
if (reported !== null) {
|
|
70
|
+
return { usd: reported, source: 'provider-reported', pricingVersion: null };
|
|
71
|
+
}
|
|
72
|
+
const price = input.model && priceTable
|
|
73
|
+
&& Object.hasOwn(priceTable.models, input.model)
|
|
74
|
+
? priceTable.models[input.model]
|
|
75
|
+
: undefined;
|
|
76
|
+
if (!price || !priceTable)
|
|
77
|
+
return exports.UNKNOWN_TURN_COST;
|
|
78
|
+
return {
|
|
79
|
+
usd: (input.inputTokens * price.inputUsdPerMillion
|
|
80
|
+
+ input.outputTokens * price.outputUsdPerMillion) / 1_000_000,
|
|
81
|
+
source: 'price-table',
|
|
82
|
+
pricingVersion: priceTable.version,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A turn's cost is known only when every model step's cost is known. Any
|
|
87
|
+
* estimated step makes the whole turn a price-table cost.
|
|
88
|
+
*/
|
|
89
|
+
function combineTurnCost(steps) {
|
|
90
|
+
if (steps.length === 0 || steps.some((step) => step.usd === null)) {
|
|
91
|
+
return exports.UNKNOWN_TURN_COST;
|
|
92
|
+
}
|
|
93
|
+
const usd = steps.reduce((sum, step) => sum + (step.usd ?? 0), 0);
|
|
94
|
+
const estimated = steps.find((step) => step.source === 'price-table');
|
|
95
|
+
return estimated
|
|
96
|
+
? { usd, source: 'price-table', pricingVersion: estimated.pricingVersion }
|
|
97
|
+
: { usd, source: 'provider-reported', pricingVersion: null };
|
|
98
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { RuntimeMetricsSink } from './turn-recorder.js';
|
|
2
|
+
export type RuntimeMetricsDropReason = 'invalid' | 'queue-full' | 'send-failed' | 'closed';
|
|
3
|
+
export interface RuntimeMetricsSinkOptions {
|
|
4
|
+
/** Control-plane base URL (HTTPS, or loopback HTTP for local tests). */
|
|
5
|
+
controlPlaneUrl: string;
|
|
6
|
+
/** The app-bound runtime key; sent only in the Authorization header. */
|
|
7
|
+
apiKey: string;
|
|
8
|
+
appId: string;
|
|
9
|
+
environmentId: string;
|
|
10
|
+
/** Build identifier of the deployed code, e.g. a commit; null if unknown. */
|
|
11
|
+
buildId?: string | null;
|
|
12
|
+
/** This process; defaults to a random id per sink. */
|
|
13
|
+
instanceId?: string;
|
|
14
|
+
fetch?: typeof globalThis.fetch;
|
|
15
|
+
/** Events per request, 1–50 (default 50). */
|
|
16
|
+
maxBatchSize?: number;
|
|
17
|
+
/** Events waiting for delivery before new ones are dropped (default 1,000). */
|
|
18
|
+
maxQueueSize?: number;
|
|
19
|
+
/** Delivery interval (default 5 s). */
|
|
20
|
+
flushIntervalMs?: number;
|
|
21
|
+
/** Per-request timeout; a slower Platform loses the batch (default 5 s). */
|
|
22
|
+
requestTimeoutMs?: number;
|
|
23
|
+
/** Content-free notice about dropped events, e.g. for local logging. */
|
|
24
|
+
onDrop?: (drop: {
|
|
25
|
+
reason: RuntimeMetricsDropReason;
|
|
26
|
+
count: number;
|
|
27
|
+
}) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface BatchingRuntimeMetricsSink extends RuntimeMetricsSink {
|
|
30
|
+
/** Events waiting for delivery. */
|
|
31
|
+
readonly pending: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Batches turn events and delivers them to the Platform off the turn path.
|
|
35
|
+
* `record` validates and queues synchronously and never throws; delivery
|
|
36
|
+
* runs on an unref'd interval or when a batch is full. A failed, rejected or
|
|
37
|
+
* timed-out request drops its batch: metrics never retry, never block a turn
|
|
38
|
+
* and never hold the process open.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createRuntimeMetricsSink(options: RuntimeMetricsSinkOptions): BatchingRuntimeMetricsSink;
|
|
41
|
+
/**
|
|
42
|
+
* The sink of a connected app, or undefined. The key (and the optional
|
|
43
|
+
* self-hosting URL) come from the environment; the app and environment come
|
|
44
|
+
* from the connection the runtime looked up (`lookupRuntimeConnection`), so
|
|
45
|
+
* the sink exists only once that lookup resolved. Standalone apps (no
|
|
46
|
+
* `GLIRASTES_API_KEY`) get no sink and stay network-silent; an invalid
|
|
47
|
+
* connection also yields none, because metrics must never stop a chat from
|
|
48
|
+
* starting. `GLIRASTES_BUILD_ID` (optional) names the deployed build.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createRuntimeMetricsSinkFromEnv(env?: Record<string, string | undefined>, options?: Omit<RuntimeMetricsSinkOptions, 'controlPlaneUrl' | 'apiKey' | 'appId' | 'environmentId' | 'buildId'> & {
|
|
51
|
+
/** The resolved connection; without it the sink stays absent. */
|
|
52
|
+
connection?: {
|
|
53
|
+
appId: string;
|
|
54
|
+
environmentId: string;
|
|
55
|
+
};
|
|
56
|
+
}): BatchingRuntimeMetricsSink | undefined;
|