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,813 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import ts from 'typescript';
|
|
3
|
+
import { compareCodeUnits } from '../canonical.js';
|
|
4
|
+
import { MAX_FILTER_KEYS } from '../files.js';
|
|
5
|
+
import { toolFinding } from '../findings.js';
|
|
6
|
+
import { createAppProgram } from '../program.js';
|
|
7
|
+
import { scanAppSources } from './app-files.js';
|
|
8
|
+
import { navigationBridgeMissing, scanForNavigationBridge } from './next-pages.js';
|
|
9
|
+
import { enumeratePages, pathExclusion } from './page-tree.js';
|
|
10
|
+
import { componentDeclaration, enumerateRouteConfigPages } from './route-config.js';
|
|
11
|
+
import { filterStableKey, hasNavigationBridge, importBindings, importedCalls, importedName, incompleteUiSource, NAVIGATE_ACTION_BINDING, uiObservation, uniqueDefinitionIds, viewName, } from './ui-tools.js';
|
|
12
|
+
import { programFileName } from './vue-sfc.js';
|
|
13
|
+
const NUQS_STATE = ['useQueryState', 'useQueryStates', 'createSearchParamsCache', 'createLoader', 'createSerializer'];
|
|
14
|
+
const SIMPLE_PARSERS = {
|
|
15
|
+
parseAsString: { kind: 'string' },
|
|
16
|
+
parseAsInteger: { kind: 'integer' },
|
|
17
|
+
parseAsIndex: { kind: 'integer' },
|
|
18
|
+
parseAsFloat: { kind: 'number' },
|
|
19
|
+
parseAsBoolean: { kind: 'boolean' },
|
|
20
|
+
};
|
|
21
|
+
const LITERAL_PARSERS = new Set(['parseAsStringLiteral', 'parseAsStringEnum', 'parseAsNumberLiteral']);
|
|
22
|
+
const ARRAY_PARSERS = { parseAsArrayOf: 'comma', parseAsNativeArrayOf: 'repeat' };
|
|
23
|
+
/** Every nuqs export the source reads; anything else imported from nuqs is reported, not guessed. */
|
|
24
|
+
const NUQS_NAMES = [
|
|
25
|
+
...NUQS_STATE, ...Object.keys(SIMPLE_PARSERS), ...LITERAL_PARSERS, ...Object.keys(ARRAY_PARSERS),
|
|
26
|
+
'parseAsIsoDate', 'parseAsIsoDateTime', 'parseAsTimestamp', 'parseAsJson', 'parseAsHex', 'createParser',
|
|
27
|
+
];
|
|
28
|
+
const NUQS_SPECS = ['nuqs', 'nuqs/server'].map((module) => ({ module, names: NUQS_NAMES }));
|
|
29
|
+
const SEARCH_PARAMS_SPECS = [{ module: 'next/navigation', names: ['useSearchParams'] }];
|
|
30
|
+
const DEFINE_SPECS = [{ module: 'glirastes/browser', names: ['defineQueryFilters'] }];
|
|
31
|
+
const MAX_DEPTH = 6;
|
|
32
|
+
/** How many declarations deep a page's references are followed (page → component → hook → parser …). */
|
|
33
|
+
const MAX_REFERENCE_DEPTH = 8;
|
|
34
|
+
const MAX_UNITS_PER_VIEW = 1_000;
|
|
35
|
+
/**
|
|
36
|
+
* A name every model provider takes as a tool input property (Anthropic rejects
|
|
37
|
+
* keys outside `[a-zA-Z0-9_.-]{1,64}` with a 400 that fails the whole request),
|
|
38
|
+
* and the name `defineQueryFilters` enforces at app runtime, so a generated tool
|
|
39
|
+
* never offers a key the runtime helper would refuse.
|
|
40
|
+
*/
|
|
41
|
+
const FILTER_KEY_NAME = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/;
|
|
42
|
+
const SCALAR_KINDS = new Set(['string', 'integer', 'number', 'boolean']);
|
|
43
|
+
function unwrap(expression) {
|
|
44
|
+
let current = expression;
|
|
45
|
+
while (ts.isParenthesizedExpression(current) || ts.isAsExpression(current) || ts.isSatisfiesExpression(current)
|
|
46
|
+
|| ts.isNonNullExpression(current) || ts.isTypeAssertionExpression(current)) {
|
|
47
|
+
current = current.expression;
|
|
48
|
+
}
|
|
49
|
+
return current;
|
|
50
|
+
}
|
|
51
|
+
function stringLiteral(expression) {
|
|
52
|
+
if (!expression)
|
|
53
|
+
return undefined;
|
|
54
|
+
const value = unwrap(expression);
|
|
55
|
+
return ts.isStringLiteralLike(value) ? value.text : undefined;
|
|
56
|
+
}
|
|
57
|
+
function propertyName(name) {
|
|
58
|
+
return ts.isIdentifier(name) || ts.isStringLiteralLike(name) || ts.isNumericLiteral(name) ? name.text : undefined;
|
|
59
|
+
}
|
|
60
|
+
function sortedUnique(values) {
|
|
61
|
+
return [...new Set(values)].sort((left, right) => (typeof left === 'number' && typeof right === 'number' ? left - right : compareCodeUnits(String(left), String(right))));
|
|
62
|
+
}
|
|
63
|
+
/** Two readings of one key: the closed one wins; incompatible ones become open text. */
|
|
64
|
+
export function mergeDomains(left, right) {
|
|
65
|
+
if (left.kind === 'string')
|
|
66
|
+
return right;
|
|
67
|
+
if (right.kind === 'string')
|
|
68
|
+
return left;
|
|
69
|
+
if (left.kind === 'enum' && right.kind === 'enum')
|
|
70
|
+
return { kind: 'enum', values: sortedUnique([...left.values, ...right.values]) };
|
|
71
|
+
if (left.kind === 'number-enum' && right.kind === 'number-enum') {
|
|
72
|
+
return { kind: 'number-enum', values: sortedUnique([...left.values, ...right.values]) };
|
|
73
|
+
}
|
|
74
|
+
return left.kind === right.kind ? left : undefined;
|
|
75
|
+
}
|
|
76
|
+
export function isFilterKeyName(key) {
|
|
77
|
+
return FILTER_KEY_NAME.test(key);
|
|
78
|
+
}
|
|
79
|
+
function scalarSchema(domain) {
|
|
80
|
+
switch (domain.kind) {
|
|
81
|
+
case 'enum':
|
|
82
|
+
return { type: 'string', enum: domain.values };
|
|
83
|
+
case 'number-enum':
|
|
84
|
+
return { type: 'number', enum: domain.values };
|
|
85
|
+
default:
|
|
86
|
+
return { type: domain.kind };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function filterKeySchema(key) {
|
|
90
|
+
const scalar = scalarSchema(key.domain);
|
|
91
|
+
return key.array ? { type: 'array', items: scalar } : scalar;
|
|
92
|
+
}
|
|
93
|
+
/** Reads nuqs parsers, typed `searchParams` and `useSearchParams()` through one bounded program. */
|
|
94
|
+
class FilterReader {
|
|
95
|
+
app;
|
|
96
|
+
bindings = new Map();
|
|
97
|
+
units = new Map();
|
|
98
|
+
calls = new Map();
|
|
99
|
+
constructor(app) {
|
|
100
|
+
this.app = app;
|
|
101
|
+
}
|
|
102
|
+
nuqs(file) {
|
|
103
|
+
let bindings = this.bindings.get(file);
|
|
104
|
+
if (!bindings) {
|
|
105
|
+
bindings = importBindings(file, NUQS_SPECS);
|
|
106
|
+
this.bindings.set(file, bindings);
|
|
107
|
+
}
|
|
108
|
+
return bindings;
|
|
109
|
+
}
|
|
110
|
+
nuqsName(node) {
|
|
111
|
+
return importedName(node, this.nuqs(node.getSourceFile()));
|
|
112
|
+
}
|
|
113
|
+
/** The symbol a name stands for, through imports and re-exports to the declaring module. */
|
|
114
|
+
symbolOf(node) {
|
|
115
|
+
const checker = this.app.checker;
|
|
116
|
+
const symbol = ts.isShorthandPropertyAssignment(node.parent) && node.parent.name === node
|
|
117
|
+
? checker.getShorthandAssignmentValueSymbol(node.parent)
|
|
118
|
+
: checker.getSymbolAtLocation(ts.isPropertyAccessExpression(node) ? node.name : node);
|
|
119
|
+
return symbol && symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
|
|
120
|
+
}
|
|
121
|
+
/** The expression a name stands for: a variable initializer, also across app modules. */
|
|
122
|
+
initializerOf(node) {
|
|
123
|
+
const symbol = this.symbolOf(node);
|
|
124
|
+
const declaration = symbol?.valueDeclaration ?? symbol?.declarations?.[0];
|
|
125
|
+
if (!declaration)
|
|
126
|
+
return undefined;
|
|
127
|
+
if (ts.isVariableDeclaration(declaration) || ts.isPropertyAssignment(declaration))
|
|
128
|
+
return declaration.initializer;
|
|
129
|
+
if (ts.isShorthandPropertyAssignment(declaration))
|
|
130
|
+
return declaration.name;
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
literalValues(raw, kind, depth = 0) {
|
|
134
|
+
if (!raw || depth > MAX_DEPTH)
|
|
135
|
+
return undefined;
|
|
136
|
+
const expression = unwrap(raw);
|
|
137
|
+
if (ts.isArrayLiteralExpression(expression)) {
|
|
138
|
+
const values = [];
|
|
139
|
+
for (const element of expression.elements) {
|
|
140
|
+
const value = unwrap(element);
|
|
141
|
+
if (kind === 'string' && ts.isStringLiteralLike(value))
|
|
142
|
+
values.push(value.text);
|
|
143
|
+
else if (kind === 'number' && ts.isNumericLiteral(value))
|
|
144
|
+
values.push(Number(value.text));
|
|
145
|
+
else
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
return values.length > 0 ? values : undefined;
|
|
149
|
+
}
|
|
150
|
+
if (ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression)) {
|
|
151
|
+
const initializer = this.initializerOf(expression);
|
|
152
|
+
const fromSyntax = initializer ? this.literalValues(initializer, kind, depth + 1) : undefined;
|
|
153
|
+
if (fromSyntax)
|
|
154
|
+
return fromSyntax;
|
|
155
|
+
}
|
|
156
|
+
return this.literalValuesOfType(this.app.checker.getTypeAtLocation(expression), kind);
|
|
157
|
+
}
|
|
158
|
+
literalValuesOfType(type, kind) {
|
|
159
|
+
const checker = this.app.checker;
|
|
160
|
+
const elements = checker.isTupleType(type)
|
|
161
|
+
? checker.getTypeArguments(type)
|
|
162
|
+
: checker.isArrayType(type) ? checker.getTypeArguments(type) : [];
|
|
163
|
+
const members = elements.flatMap((element) => (element.isUnion() ? element.types : [element]));
|
|
164
|
+
if (members.length === 0)
|
|
165
|
+
return undefined;
|
|
166
|
+
const values = [];
|
|
167
|
+
for (const member of members) {
|
|
168
|
+
if (kind === 'string' && member.isStringLiteral())
|
|
169
|
+
values.push(member.value);
|
|
170
|
+
else if (kind === 'number' && member.isNumberLiteral())
|
|
171
|
+
values.push(member.value);
|
|
172
|
+
else
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
return values;
|
|
176
|
+
}
|
|
177
|
+
/** A nuqs parser expression → domain; `undefined` for a parser this source does not read. */
|
|
178
|
+
parser(raw, notes, key, depth = 0) {
|
|
179
|
+
if (depth > MAX_DEPTH)
|
|
180
|
+
return undefined;
|
|
181
|
+
const expression = unwrap(raw);
|
|
182
|
+
if (ts.isCallExpression(expression)) {
|
|
183
|
+
const callee = unwrap(expression.expression);
|
|
184
|
+
if (ts.isPropertyAccessExpression(callee) && ['withDefault', 'withOptions'].includes(callee.name.text)) {
|
|
185
|
+
return this.parser(callee.expression, notes, key, depth + 1);
|
|
186
|
+
}
|
|
187
|
+
const name = this.nuqsName(callee);
|
|
188
|
+
if (name !== undefined && LITERAL_PARSERS.has(name)) {
|
|
189
|
+
const numeric = name === 'parseAsNumberLiteral';
|
|
190
|
+
const values = this.literalValues(expression.arguments[0], numeric ? 'number' : 'string');
|
|
191
|
+
if (!values)
|
|
192
|
+
return { domain: { kind: numeric ? 'number' : 'string' } };
|
|
193
|
+
return numeric
|
|
194
|
+
? { domain: { kind: 'number-enum', values: sortedUnique(values) } }
|
|
195
|
+
: { domain: { kind: 'enum', values: sortedUnique(values) } };
|
|
196
|
+
}
|
|
197
|
+
if (name !== undefined && Object.hasOwn(ARRAY_PARSERS, name)) {
|
|
198
|
+
const separator = expression.arguments[1];
|
|
199
|
+
if (separator && stringLiteral(separator) !== ',') {
|
|
200
|
+
notes.push({ code: 'filter-parser-unsupported', message: `${key} uses parseAsArrayOf with a custom separator.` });
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
const inner = expression.arguments[0] ? this.parser(expression.arguments[0], notes, key, depth + 1) : undefined;
|
|
204
|
+
if (!inner || inner.array)
|
|
205
|
+
return undefined;
|
|
206
|
+
return { domain: inner.domain, array: ARRAY_PARSERS[name] };
|
|
207
|
+
}
|
|
208
|
+
if (name !== undefined) {
|
|
209
|
+
notes.push({ code: 'filter-parser-unsupported', message: `${key} uses ${name}, which the chat cannot set.` });
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
notes.push({ code: 'filter-parser-unsupported', message: `${key} uses a custom parser.` });
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
if (ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression)) {
|
|
216
|
+
const name = this.nuqsName(expression);
|
|
217
|
+
if (name !== undefined) {
|
|
218
|
+
if (Object.hasOwn(SIMPLE_PARSERS, name))
|
|
219
|
+
return { domain: SIMPLE_PARSERS[name] };
|
|
220
|
+
notes.push({ code: 'filter-parser-unsupported', message: `${key} uses ${name}, which the chat cannot set.` });
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
const initializer = this.initializerOf(expression);
|
|
224
|
+
if (initializer)
|
|
225
|
+
return this.parser(initializer, notes, key, depth + 1);
|
|
226
|
+
}
|
|
227
|
+
notes.push({ code: 'filter-definition-unreadable', message: `The parser of ${key} cannot be read from code.` });
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
/** `{ status: parseAs…, page: parseAs… }`, also behind a name or spread. */
|
|
231
|
+
parserMap(raw, notes, depth = 0) {
|
|
232
|
+
if (!raw || depth > MAX_DEPTH)
|
|
233
|
+
return [];
|
|
234
|
+
const expression = unwrap(raw);
|
|
235
|
+
if (ts.isObjectLiteralExpression(expression)) {
|
|
236
|
+
const entries = [];
|
|
237
|
+
for (const property of expression.properties) {
|
|
238
|
+
if (ts.isPropertyAssignment(property)) {
|
|
239
|
+
const key = propertyName(property.name);
|
|
240
|
+
if (key !== undefined) {
|
|
241
|
+
entries.push({ key, parser: property.initializer });
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else if (ts.isShorthandPropertyAssignment(property)) {
|
|
246
|
+
entries.push({ key: property.name.text, parser: property.name });
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
else if (ts.isSpreadAssignment(property)) {
|
|
250
|
+
entries.push(...this.parserMap(property.expression, notes, depth + 1));
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
notes.push({ code: 'filter-definition-unreadable', message: 'A URL parameter map has an entry that is not a plain key.' });
|
|
254
|
+
}
|
|
255
|
+
return entries;
|
|
256
|
+
}
|
|
257
|
+
if (ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression)) {
|
|
258
|
+
return this.parserMap(this.initializerOf(expression), notes, depth + 1);
|
|
259
|
+
}
|
|
260
|
+
notes.push({ code: 'filter-definition-unreadable', message: 'A URL parameter map cannot be read from code.' });
|
|
261
|
+
return [];
|
|
262
|
+
}
|
|
263
|
+
urlKeys(options) {
|
|
264
|
+
const keys = new Map();
|
|
265
|
+
const value = options ? unwrap(options) : undefined;
|
|
266
|
+
if (!value || !ts.isObjectLiteralExpression(value))
|
|
267
|
+
return keys;
|
|
268
|
+
for (const property of value.properties) {
|
|
269
|
+
if (!ts.isPropertyAssignment(property) || propertyName(property.name) !== 'urlKeys')
|
|
270
|
+
continue;
|
|
271
|
+
const map = unwrap(property.initializer);
|
|
272
|
+
if (!ts.isObjectLiteralExpression(map))
|
|
273
|
+
continue;
|
|
274
|
+
for (const entry of map.properties) {
|
|
275
|
+
if (!ts.isPropertyAssignment(entry))
|
|
276
|
+
continue;
|
|
277
|
+
const from = propertyName(entry.name);
|
|
278
|
+
const to = stringLiteral(entry.initializer);
|
|
279
|
+
if (from !== undefined && to !== undefined)
|
|
280
|
+
keys.set(from, to);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return keys;
|
|
284
|
+
}
|
|
285
|
+
/** The calls of nuqs or `useSearchParams` that sit inside `root`. */
|
|
286
|
+
callsWithin(root, kind) {
|
|
287
|
+
const file = root.getSourceFile();
|
|
288
|
+
let cached = this.calls.get(file);
|
|
289
|
+
if (!cached) {
|
|
290
|
+
cached = { nuqs: importedCalls(file, NUQS_SPECS), search: importedCalls(file, SEARCH_PARAMS_SPECS) };
|
|
291
|
+
this.calls.set(file, cached);
|
|
292
|
+
}
|
|
293
|
+
return cached[kind].filter(({ call }) => call.pos >= root.pos && call.end <= root.end);
|
|
294
|
+
}
|
|
295
|
+
nuqsKeys(root, evidence) {
|
|
296
|
+
for (const { name, call } of this.callsWithin(root, 'nuqs')) {
|
|
297
|
+
if (name === 'useQueryState') {
|
|
298
|
+
const key = stringLiteral(call.arguments[0]);
|
|
299
|
+
if (key === undefined) {
|
|
300
|
+
evidence.notes.push({ code: 'filter-definition-unreadable', message: 'useQueryState is called with a key that is not a literal.' });
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
const parsed = call.arguments[1] ? this.parser(call.arguments[1], evidence.notes, key) : { domain: { kind: 'string' } };
|
|
304
|
+
if (parsed)
|
|
305
|
+
evidence.keys.push({ key, ...parsed });
|
|
306
|
+
}
|
|
307
|
+
else if (NUQS_STATE.includes(name)) {
|
|
308
|
+
const renamed = this.urlKeys(call.arguments[1]);
|
|
309
|
+
for (const entry of this.parserMap(call.arguments[0], evidence.notes)) {
|
|
310
|
+
const key = renamed.get(entry.key) ?? entry.key;
|
|
311
|
+
const parsed = this.parser(entry.parser, evidence.notes, key);
|
|
312
|
+
if (parsed)
|
|
313
|
+
evidence.keys.push({ key, ...parsed });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
searchParamsKeys(root, evidence) {
|
|
319
|
+
const calls = this.callsWithin(root, 'search').map(({ call }) => call);
|
|
320
|
+
if (calls.length === 0)
|
|
321
|
+
return;
|
|
322
|
+
const checker = this.app.checker;
|
|
323
|
+
const holders = new Set();
|
|
324
|
+
for (const call of calls) {
|
|
325
|
+
const parent = call.parent;
|
|
326
|
+
if (ts.isVariableDeclaration(parent) && parent.initializer === call && ts.isIdentifier(parent.name)) {
|
|
327
|
+
const symbol = checker.getSymbolAtLocation(parent.name);
|
|
328
|
+
if (symbol)
|
|
329
|
+
holders.add(symbol);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const callSet = new Set(calls);
|
|
333
|
+
const visit = (node) => {
|
|
334
|
+
if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression)
|
|
335
|
+
&& ['get', 'getAll'].includes(node.expression.name.text)) {
|
|
336
|
+
const target = unwrap(node.expression.expression);
|
|
337
|
+
const symbol = ts.isIdentifier(target) ? checker.getSymbolAtLocation(target) : undefined;
|
|
338
|
+
if (callSet.has(target) || (symbol && holders.has(symbol))) {
|
|
339
|
+
const key = stringLiteral(node.arguments[0]);
|
|
340
|
+
if (key !== undefined) {
|
|
341
|
+
evidence.keys.push(node.expression.name.text === 'getAll'
|
|
342
|
+
? { key, domain: { kind: 'string' }, array: 'repeat' }
|
|
343
|
+
: { key, domain: { kind: 'string' } });
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
ts.forEachChild(node, visit);
|
|
348
|
+
};
|
|
349
|
+
visit(root);
|
|
350
|
+
}
|
|
351
|
+
typeDomain(type) {
|
|
352
|
+
const checker = this.app.checker;
|
|
353
|
+
const members = (type.isUnion() ? type.types : [type])
|
|
354
|
+
.filter((member) => !(member.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null)));
|
|
355
|
+
if (members.length === 0)
|
|
356
|
+
return undefined;
|
|
357
|
+
const scalars = members.filter((member) => !checker.isArrayType(member));
|
|
358
|
+
const arrays = members.filter((member) => checker.isArrayType(member));
|
|
359
|
+
const elementTypes = arrays.flatMap((member) => checker.getTypeArguments(member))
|
|
360
|
+
.flatMap((element) => (element.isUnion() ? element.types : [element]));
|
|
361
|
+
const all = [...scalars, ...elementTypes];
|
|
362
|
+
if (all.some((member) => member.flags & ts.TypeFlags.String)) {
|
|
363
|
+
return scalars.length === 0 ? { domain: { kind: 'string' }, array: 'repeat' } : { domain: { kind: 'string' } };
|
|
364
|
+
}
|
|
365
|
+
if (all.length > 0 && all.every((member) => member.isStringLiteral())) {
|
|
366
|
+
const domain = { kind: 'enum', values: sortedUnique(all.map((member) => member.value)) };
|
|
367
|
+
return scalars.length === 0 ? { domain, array: 'repeat' } : { domain };
|
|
368
|
+
}
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
/** Keys of a typed `searchParams` prop of the page's default export. */
|
|
372
|
+
typedSearchParams(file, evidence) {
|
|
373
|
+
const component = defaultExportFunction(file);
|
|
374
|
+
const parameter = component?.parameters[0];
|
|
375
|
+
if (!parameter)
|
|
376
|
+
return;
|
|
377
|
+
const checker = this.app.checker;
|
|
378
|
+
const props = checker.getTypeAtLocation(parameter);
|
|
379
|
+
const property = checker.getPropertyOfType(props, 'searchParams');
|
|
380
|
+
if (!property)
|
|
381
|
+
return;
|
|
382
|
+
const declared = checker.getNonNullableType(checker.getTypeOfSymbolAtLocation(property, parameter));
|
|
383
|
+
const params = checker.getAwaitedType(declared) ?? declared;
|
|
384
|
+
for (const entry of checker.getPropertiesOfType(params)) {
|
|
385
|
+
const parsed = this.typeDomain(checker.getTypeOfSymbolAtLocation(entry, parameter));
|
|
386
|
+
if (parsed)
|
|
387
|
+
evidence.keys.push({ key: entry.name, ...parsed });
|
|
388
|
+
else
|
|
389
|
+
evidence.notes.push({ code: 'filter-parser-unsupported', message: `searchParams.${entry.name} has a type the chat cannot set.` });
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/** The app declarations (not libraries, not types) a symbol is declared by. */
|
|
393
|
+
declarationUnits(symbol) {
|
|
394
|
+
return (symbol?.declarations ?? []).flatMap((declaration) => {
|
|
395
|
+
const unit = unitRoot(declaration);
|
|
396
|
+
return unit && this.app.appRelative(unit.getSourceFile().fileName) !== undefined ? [unit] : [];
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
/** The declarations outside `root` that its code refers to; imports are followed to where they are declared. */
|
|
400
|
+
references(root) {
|
|
401
|
+
const found = new Set();
|
|
402
|
+
const file = root.getSourceFile();
|
|
403
|
+
const add = (units) => {
|
|
404
|
+
for (const unit of units) {
|
|
405
|
+
const inside = unit.getSourceFile() === file && unit.pos >= root.pos && unit.end <= root.end;
|
|
406
|
+
if (!inside)
|
|
407
|
+
found.add(unit);
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
const visit = (node) => {
|
|
411
|
+
if (ts.isImportDeclaration(node) || ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)
|
|
412
|
+
|| (ts.isTypeNode(node) && !ts.isExpressionWithTypeArguments(node))) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (ts.isIdentifier(node)) {
|
|
416
|
+
add(this.declarationUnits(this.symbolOf(node)));
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
420
|
+
const member = this.declarationUnits(this.symbolOf(node));
|
|
421
|
+
add(member);
|
|
422
|
+
// `caches.people`: the object only matters through the property the code reads.
|
|
423
|
+
if (member.length > 0 && member.every(ts.isPropertyAssignment) && isNameChain(node.expression))
|
|
424
|
+
return;
|
|
425
|
+
visit(node.expression);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
ts.forEachChild(node, visit);
|
|
429
|
+
};
|
|
430
|
+
visit(root);
|
|
431
|
+
return [...found];
|
|
432
|
+
}
|
|
433
|
+
unit(root) {
|
|
434
|
+
let unit = this.units.get(root);
|
|
435
|
+
if (!unit) {
|
|
436
|
+
const evidence = { keys: [], notes: [] };
|
|
437
|
+
this.nuqsKeys(root, evidence);
|
|
438
|
+
this.searchParamsKeys(root, evidence);
|
|
439
|
+
if (ts.isSourceFile(root))
|
|
440
|
+
this.typedSearchParams(root, evidence);
|
|
441
|
+
unit = { evidence, references: this.references(root) };
|
|
442
|
+
this.units.set(root, unit);
|
|
443
|
+
}
|
|
444
|
+
return unit;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* What the page reads from the URL: its own code and the declarations it
|
|
448
|
+
* refers to (components, hooks, caches, parser maps), breadth first and
|
|
449
|
+
* bounded. A binding is resolved to where it is declared, so a barrel, a
|
|
450
|
+
* module's other exports and a cache another page uses are not credited.
|
|
451
|
+
*/
|
|
452
|
+
viewEvidence(page) {
|
|
453
|
+
const found = { keys: [], notes: [] };
|
|
454
|
+
const seen = new Set([page]);
|
|
455
|
+
let frontier = [page];
|
|
456
|
+
for (let depth = 0; frontier.length > 0; depth += 1) {
|
|
457
|
+
const next = [];
|
|
458
|
+
for (const root of frontier) {
|
|
459
|
+
const unit = this.unit(root);
|
|
460
|
+
found.keys.push(...unit.evidence.keys);
|
|
461
|
+
found.notes.push(...unit.evidence.notes);
|
|
462
|
+
if (depth === MAX_REFERENCE_DEPTH)
|
|
463
|
+
continue;
|
|
464
|
+
for (const reference of unit.references) {
|
|
465
|
+
if (seen.has(reference) || seen.size >= MAX_UNITS_PER_VIEW)
|
|
466
|
+
continue;
|
|
467
|
+
seen.add(reference);
|
|
468
|
+
next.push(reference);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
frontier = next;
|
|
472
|
+
}
|
|
473
|
+
return found;
|
|
474
|
+
}
|
|
475
|
+
/** `defineQueryFilters({ path, filters })` literals of `glirastes/browser`. */
|
|
476
|
+
definitions(file, notes) {
|
|
477
|
+
const definitions = [];
|
|
478
|
+
const local = this.app.appRelative(file.fileName) ?? file.fileName;
|
|
479
|
+
for (const { call } of importedCalls(file, DEFINE_SPECS)) {
|
|
480
|
+
let argument = call.arguments[0] ? unwrap(call.arguments[0]) : undefined;
|
|
481
|
+
if (argument && (ts.isIdentifier(argument) || ts.isPropertyAccessExpression(argument))) {
|
|
482
|
+
const initializer = this.initializerOf(argument);
|
|
483
|
+
argument = initializer ? unwrap(initializer) : undefined;
|
|
484
|
+
}
|
|
485
|
+
const property = (name) => (argument && ts.isObjectLiteralExpression(argument)
|
|
486
|
+
? argument.properties.find((entry) => (ts.isPropertyAssignment(entry) && propertyName(entry.name) === name))
|
|
487
|
+
: undefined);
|
|
488
|
+
const path = stringLiteral(property('path')?.initializer);
|
|
489
|
+
const filters = property('filters')?.initializer;
|
|
490
|
+
const map = filters ? unwrap(filters) : undefined;
|
|
491
|
+
if (path === undefined || !path.startsWith('/') || !map || !ts.isObjectLiteralExpression(map)) {
|
|
492
|
+
notes.push({ file: local, code: 'filter-definition-unreadable', message: 'A defineQueryFilters call has no literal path and filters.' });
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
const keys = [];
|
|
496
|
+
for (const entry of map.properties) {
|
|
497
|
+
const key = ts.isPropertyAssignment(entry) ? propertyName(entry.name) : undefined;
|
|
498
|
+
const spec = key !== undefined && ts.isPropertyAssignment(entry) ? specKey(key, entry.initializer) : undefined;
|
|
499
|
+
if (spec)
|
|
500
|
+
keys.push(spec);
|
|
501
|
+
else
|
|
502
|
+
notes.push({ file: local, code: 'filter-definition-unreadable', message: `A filter of ${path} is not a literal spec.` });
|
|
503
|
+
}
|
|
504
|
+
definitions.push({ path: normalizedDefinitionPath(path), keys });
|
|
505
|
+
}
|
|
506
|
+
return definitions;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
/** The node whose code a declaration stands for: the variable, function, class or property, never a type or a parameter. */
|
|
510
|
+
function unitRoot(declaration) {
|
|
511
|
+
let node = declaration;
|
|
512
|
+
while (ts.isBindingElement(node))
|
|
513
|
+
node = node.parent.parent;
|
|
514
|
+
return ts.isVariableDeclaration(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)
|
|
515
|
+
|| ts.isExportAssignment(node) || ts.isPropertyAssignment(node) || ts.isMethodDeclaration(node)
|
|
516
|
+
|| ts.isPropertyDeclaration(node)
|
|
517
|
+
? node
|
|
518
|
+
: undefined;
|
|
519
|
+
}
|
|
520
|
+
function isNameChain(expression) {
|
|
521
|
+
return ts.isIdentifier(expression) || (ts.isPropertyAccessExpression(expression) && isNameChain(expression.expression));
|
|
522
|
+
}
|
|
523
|
+
function scalarSpec(raw) {
|
|
524
|
+
const expression = unwrap(raw);
|
|
525
|
+
const kind = stringLiteral(expression);
|
|
526
|
+
if (kind !== undefined)
|
|
527
|
+
return SCALAR_KINDS.has(kind) ? { kind: kind } : undefined;
|
|
528
|
+
if (ts.isArrayLiteralExpression(expression)) {
|
|
529
|
+
const values = expression.elements.map((element) => stringLiteral(element));
|
|
530
|
+
if (values.length === 0 || values.some((value) => value === undefined || value.length === 0))
|
|
531
|
+
return undefined;
|
|
532
|
+
return { kind: 'enum', values: sortedUnique(values) };
|
|
533
|
+
}
|
|
534
|
+
return undefined;
|
|
535
|
+
}
|
|
536
|
+
function specKey(key, raw) {
|
|
537
|
+
const expression = unwrap(raw);
|
|
538
|
+
if (ts.isObjectLiteralExpression(expression)) {
|
|
539
|
+
const get = (name) => expression.properties.find((entry) => (ts.isPropertyAssignment(entry) && propertyName(entry.name) === name))?.initializer;
|
|
540
|
+
const inner = get('arrayOf');
|
|
541
|
+
const domain = inner ? scalarSpec(inner) : undefined;
|
|
542
|
+
const format = get('format') ? stringLiteral(get('format')) : 'comma';
|
|
543
|
+
if (!domain || (format !== 'comma' && format !== 'repeat'))
|
|
544
|
+
return undefined;
|
|
545
|
+
return { key, domain, array: format };
|
|
546
|
+
}
|
|
547
|
+
const domain = scalarSpec(expression);
|
|
548
|
+
return domain ? { key, domain } : undefined;
|
|
549
|
+
}
|
|
550
|
+
/** `/projects/[projectId]` is accepted like `/projects/:projectId`. */
|
|
551
|
+
function normalizedDefinitionPath(path) {
|
|
552
|
+
return path.split('/').map((segment) => segment.replace(/^\[([^\].]+)\]$/, ':$1')).join('/');
|
|
553
|
+
}
|
|
554
|
+
function defaultExportFunction(file) {
|
|
555
|
+
const locals = new Map();
|
|
556
|
+
for (const statement of file.statements) {
|
|
557
|
+
if (ts.isFunctionDeclaration(statement) && statement.name)
|
|
558
|
+
locals.set(statement.name.text, statement);
|
|
559
|
+
if (ts.isVariableStatement(statement)) {
|
|
560
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
561
|
+
if (ts.isIdentifier(declaration.name) && declaration.initializer)
|
|
562
|
+
locals.set(declaration.name.text, declaration.initializer);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
const asFunction = (node) => {
|
|
567
|
+
if (!node)
|
|
568
|
+
return undefined;
|
|
569
|
+
if (ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) || ts.isArrowFunction(node))
|
|
570
|
+
return node;
|
|
571
|
+
if (ts.isParenthesizedExpression(node))
|
|
572
|
+
return asFunction(node.expression);
|
|
573
|
+
if (ts.isIdentifier(node))
|
|
574
|
+
return asFunction(locals.get(node.text));
|
|
575
|
+
return undefined;
|
|
576
|
+
};
|
|
577
|
+
for (const statement of file.statements) {
|
|
578
|
+
if (ts.isFunctionDeclaration(statement)
|
|
579
|
+
&& statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword)) {
|
|
580
|
+
return statement;
|
|
581
|
+
}
|
|
582
|
+
if (ts.isExportAssignment(statement) && !statement.isExportEquals)
|
|
583
|
+
return asFunction(statement.expression);
|
|
584
|
+
}
|
|
585
|
+
return undefined;
|
|
586
|
+
}
|
|
587
|
+
function describeKey(key, german) {
|
|
588
|
+
const domain = key.domain;
|
|
589
|
+
const scalar = domain.kind === 'enum' || domain.kind === 'number-enum'
|
|
590
|
+
? domain.values.join('|')
|
|
591
|
+
: german
|
|
592
|
+
? { string: 'Text', integer: 'Ganzzahl', number: 'Zahl', boolean: 'ja/nein' }[domain.kind]
|
|
593
|
+
: { string: 'text', integer: 'integer', number: 'number', boolean: 'true/false' }[domain.kind];
|
|
594
|
+
return `${key.key} (${key.array ? `${german ? 'Liste von' : 'list of'} ${scalar}` : scalar})`;
|
|
595
|
+
}
|
|
596
|
+
function filterProse(locale, view, keys) {
|
|
597
|
+
const german = locale.toLowerCase().startsWith('de');
|
|
598
|
+
const listed = keys.map((key) => describeKey(key, german)).join(', ');
|
|
599
|
+
const params = view.params.map((name) => `params.${name}`).join(', ');
|
|
600
|
+
const label = (text) => (text.length <= 200 ? text : `${text.slice(0, 199)}…`);
|
|
601
|
+
return german
|
|
602
|
+
? {
|
|
603
|
+
contractDescription: `Zeigt die Seite ${view.path} mit URL-Filtern: ${listed}.${params ? ` Braucht ${params}.` : ''}`,
|
|
604
|
+
presentation: { locale, singular: label(`${view.path} filtern`), plural: label(`${view.path} filtern`), approval: label(`${view.path} filtern`) },
|
|
605
|
+
}
|
|
606
|
+
: {
|
|
607
|
+
contractDescription: `Show the ${view.path} page with URL filters: ${listed}.${params ? ` Needs ${params}.` : ''}`,
|
|
608
|
+
presentation: { locale, singular: label(`Filter ${view.path}`), plural: label(`Filter ${view.path}`), approval: label(`Filter ${view.path}`) },
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
function addNote(view, note) {
|
|
612
|
+
if (!view.notes.some((entry) => entry.code === note.code && entry.message === note.message))
|
|
613
|
+
view.notes.push(note);
|
|
614
|
+
}
|
|
615
|
+
function addKey(view, key) {
|
|
616
|
+
if (key.key === 'params') {
|
|
617
|
+
addNote(view, { code: 'filter-key-reserved', message: 'The URL parameter params is reserved for route parameters.' });
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
if (!isFilterKeyName(key.key)) {
|
|
621
|
+
const shown = key.key.length > 64 ? `${key.key.slice(0, 63)}…` : key.key;
|
|
622
|
+
addNote(view, {
|
|
623
|
+
code: 'filter-key-invalid',
|
|
624
|
+
message: `The URL parameter ${JSON.stringify(shown)} is not a plain name (letters, digits, _ and -, starting with a letter or _, at most 64 characters), so the chat cannot set it.`,
|
|
625
|
+
});
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
const existing = view.keys.get(key.key);
|
|
629
|
+
if (!existing) {
|
|
630
|
+
view.keys.set(key.key, key);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
const domain = mergeDomains(existing.domain, key.domain);
|
|
634
|
+
if (!domain || (existing.array ?? null) !== (key.array ?? null)) {
|
|
635
|
+
view.keys.set(key.key, { key: key.key, domain: { kind: 'string' }, ...(existing.array ? { array: existing.array } : {}) });
|
|
636
|
+
addNote(view, { code: 'filter-domain-conflict', message: `${key.key} is read with different parsers; it accepts any text.` });
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
view.keys.set(key.key, { ...existing, domain });
|
|
640
|
+
}
|
|
641
|
+
/** How many left-out keys `filter-keys-capped` names before it only counts them. */
|
|
642
|
+
const SHOWN_CAPPED_KEYS = 10;
|
|
643
|
+
function cappedKeysMessage(total, leftOut) {
|
|
644
|
+
const shown = leftOut.slice(0, SHOWN_CAPPED_KEYS).join(', ');
|
|
645
|
+
const more = leftOut.length > SHOWN_CAPPED_KEYS ? ` and ${leftOut.length - SHOWN_CAPPED_KEYS} more` : '';
|
|
646
|
+
return `The view reads ${total} URL parameters; a filter tool takes at most ${MAX_FILTER_KEYS}, so the chat cannot set ${shown}${more}.`;
|
|
647
|
+
}
|
|
648
|
+
function pathParams(path) {
|
|
649
|
+
return path.split('/').filter((segment) => segment.startsWith(':')).map((segment) => segment.slice(1));
|
|
650
|
+
}
|
|
651
|
+
/** A path with its parameter names left out: `/tasks/:id` and `/tasks/:taskId` are the same page. */
|
|
652
|
+
function routeShape(path) {
|
|
653
|
+
return path.split('/').map((segment) => (segment.startsWith(':') ? ':' : segment)).join('/');
|
|
654
|
+
}
|
|
655
|
+
async function observeFilters(root, locale, options, policyExcludes) {
|
|
656
|
+
const routeConfig = options.pages === 'react-router' || options.pages === 'vue-router' ? options.pages : undefined;
|
|
657
|
+
const tree = routeConfig
|
|
658
|
+
? await enumerateRouteConfigPages(root, options, policyExcludes, routeConfig)
|
|
659
|
+
: await enumeratePages(root, options, policyExcludes);
|
|
660
|
+
if (!tree.complete)
|
|
661
|
+
return incompleteUiSource('url-filters', tree.reason);
|
|
662
|
+
const defined = await scanAppSources(root, {
|
|
663
|
+
...(options.srcDir ? { srcDir: options.srcDir } : {}),
|
|
664
|
+
matches: (source) => source.includes('defineQueryFilters'),
|
|
665
|
+
});
|
|
666
|
+
if (!defined.complete)
|
|
667
|
+
return incompleteUiSource('url-filters', defined.reason);
|
|
668
|
+
if (tree.pages.length === 0 && defined.files.length === 0) {
|
|
669
|
+
return { observations: [], findings: [], complete: true, excluded: [] };
|
|
670
|
+
}
|
|
671
|
+
const app = createAppProgram({
|
|
672
|
+
root,
|
|
673
|
+
rootNames: [
|
|
674
|
+
...tree.pages.map((page) => programFileName(join(root, page.file))),
|
|
675
|
+
...defined.files.map((file) => file.absolute),
|
|
676
|
+
],
|
|
677
|
+
});
|
|
678
|
+
const reader = new FilterReader(app);
|
|
679
|
+
const views = new Map();
|
|
680
|
+
const viewOf = (path, params) => {
|
|
681
|
+
let view = views.get(path);
|
|
682
|
+
if (!view) {
|
|
683
|
+
view = { path, params, keys: new Map(), notes: [] };
|
|
684
|
+
views.set(path, view);
|
|
685
|
+
}
|
|
686
|
+
return view;
|
|
687
|
+
};
|
|
688
|
+
for (const page of tree.pages) {
|
|
689
|
+
const source = app.sourceFile(programFileName(join(root, page.file)));
|
|
690
|
+
const rendered = source && page.component ? componentDeclaration(source, page.component) : source;
|
|
691
|
+
if (!rendered)
|
|
692
|
+
continue;
|
|
693
|
+
const found = reader.viewEvidence(rendered);
|
|
694
|
+
if (found.keys.length === 0 && found.notes.length === 0)
|
|
695
|
+
continue;
|
|
696
|
+
const pageView = viewOf(page.path, page.params);
|
|
697
|
+
for (const key of found.keys)
|
|
698
|
+
addKey(pageView, key);
|
|
699
|
+
for (const note of found.notes)
|
|
700
|
+
addNote(pageView, note);
|
|
701
|
+
}
|
|
702
|
+
const findings = [];
|
|
703
|
+
const definitionNotes = [];
|
|
704
|
+
const excludedPaths = new Map(tree.excluded.map((entry) => [entry.stableKey.slice('PAGE '.length), entry]));
|
|
705
|
+
const excluded = [];
|
|
706
|
+
// A route config lists every page the SPA serves; a filter for any other path would navigate nowhere.
|
|
707
|
+
const routed = routeConfig ? new Set(tree.pages.map((page) => routeShape(page.path))) : undefined;
|
|
708
|
+
for (const file of defined.files) {
|
|
709
|
+
const source = app.sourceFile(file.absolute);
|
|
710
|
+
if (!source)
|
|
711
|
+
continue;
|
|
712
|
+
for (const definition of reader.definitions(source, definitionNotes)) {
|
|
713
|
+
// A view outside the page tree (an SPA path) follows the same default and policy exclusions.
|
|
714
|
+
const pageExclusion = excludedPaths.get(definition.path) ?? pathExclusion(definition.path, policyExcludes);
|
|
715
|
+
if (pageExclusion) {
|
|
716
|
+
excluded.push({ stableKey: filterStableKey(definition.path), reason: pageExclusion.reason, origin: pageExclusion.origin });
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
if (routed && !routed.has(routeShape(definition.path))) {
|
|
720
|
+
findings.push(toolFinding('filter-path-unrouted', 'warning', filterStableKey(definition.path), `${file.path} defines query filters for ${definition.path}, which no route serves; no filter tool is generated for it.`));
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
const view = viewOf(definition.path, pathParams(definition.path));
|
|
724
|
+
for (const key of definition.keys)
|
|
725
|
+
addKey(view, key);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
excluded.sort((left, right) => compareCodeUnits(left.stableKey, right.stableKey));
|
|
729
|
+
for (const note of definitionNotes)
|
|
730
|
+
findings.push(toolFinding(note.code, 'warning', note.file, note.message));
|
|
731
|
+
const withKeys = [...views.values()].filter((view) => view.keys.size > 0)
|
|
732
|
+
.sort((left, right) => compareCodeUnits(left.path, right.path));
|
|
733
|
+
for (const view of views.values()) {
|
|
734
|
+
if (view.keys.size === 0) {
|
|
735
|
+
for (const note of view.notes)
|
|
736
|
+
findings.push(toolFinding(note.code, 'warning', filterStableKey(view.path), note.message));
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
if (withKeys.length === 0)
|
|
740
|
+
return { observations: [], findings, complete: true, excluded };
|
|
741
|
+
const bridge = await scanForNavigationBridge(root, options.srcDir);
|
|
742
|
+
if (!bridge.complete)
|
|
743
|
+
return incompleteUiSource('url-filters', bridge.reason);
|
|
744
|
+
const bridged = hasNavigationBridge(bridge.files);
|
|
745
|
+
const ids = uniqueDefinitionIds(withKeys.map((view) => ({
|
|
746
|
+
stableKey: filterStableKey(view.path), base: `ui.filter.${viewName(view.path)}`,
|
|
747
|
+
})));
|
|
748
|
+
const observations = withKeys.map((view) => {
|
|
749
|
+
const stableKey = filterStableKey(view.path);
|
|
750
|
+
const sorted = [...view.keys.values()].sort((left, right) => compareCodeUnits(left.key, right.key));
|
|
751
|
+
// The committed contract takes at most MAX_FILTER_KEYS keys; the rest are reported, never written.
|
|
752
|
+
const keys = sorted.slice(0, MAX_FILTER_KEYS);
|
|
753
|
+
const leftOut = sorted.slice(MAX_FILTER_KEYS).map((key) => key.key);
|
|
754
|
+
const open = keys.filter((key) => key.domain.kind === 'string').map((key) => key.key);
|
|
755
|
+
const toolFindings = [
|
|
756
|
+
...view.notes.map((note) => toolFinding(note.code, 'warning', stableKey, note.message)),
|
|
757
|
+
...(leftOut.length > 0
|
|
758
|
+
? [toolFinding('filter-keys-capped', 'warning', stableKey, cappedKeysMessage(sorted.length, leftOut))]
|
|
759
|
+
: []),
|
|
760
|
+
...(open.length > 0
|
|
761
|
+
? [toolFinding('filter-domain-open', 'warning', stableKey, `${open.join(', ')} accept any text.`)]
|
|
762
|
+
: []),
|
|
763
|
+
...(bridged ? [] : [navigationBridgeMissing(stableKey)]),
|
|
764
|
+
];
|
|
765
|
+
const input = {
|
|
766
|
+
type: 'object',
|
|
767
|
+
properties: {
|
|
768
|
+
...Object.fromEntries(keys.map((key) => [key.key, filterKeySchema(key)])),
|
|
769
|
+
...(view.params.length > 0
|
|
770
|
+
? {
|
|
771
|
+
params: {
|
|
772
|
+
type: 'object',
|
|
773
|
+
properties: Object.fromEntries(view.params.map((name) => [name, { type: 'string', minLength: 1 }])),
|
|
774
|
+
required: [...view.params],
|
|
775
|
+
additionalProperties: false,
|
|
776
|
+
},
|
|
777
|
+
}
|
|
778
|
+
: {}),
|
|
779
|
+
},
|
|
780
|
+
...(view.params.length > 0 ? { required: ['params'] } : {}),
|
|
781
|
+
additionalProperties: false,
|
|
782
|
+
};
|
|
783
|
+
return uiObservation({
|
|
784
|
+
stableKey,
|
|
785
|
+
definitionId: ids.get(stableKey),
|
|
786
|
+
actionBindingRef: NAVIGATE_ACTION_BINDING,
|
|
787
|
+
input,
|
|
788
|
+
uiAction: {
|
|
789
|
+
kind: 'filter',
|
|
790
|
+
destination: view.path,
|
|
791
|
+
keys: keys.map((key) => ({ key: key.key, ...(key.array ? { array: key.array } : {}) })),
|
|
792
|
+
},
|
|
793
|
+
params: { path: [...view.params], query: keys.map((key) => key.key), body: [] },
|
|
794
|
+
facts: { path: view.path, params: view.params, keys },
|
|
795
|
+
findings: toolFindings,
|
|
796
|
+
prose: filterProse(locale, view, keys),
|
|
797
|
+
});
|
|
798
|
+
});
|
|
799
|
+
return { observations, findings, complete: true, excluded };
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* The `url-filters` source: one `ui.filter.<view>` tool per page or
|
|
803
|
+
* `defineQueryFilters` view whose URL filters the code reads (nuqs parsers,
|
|
804
|
+
* typed `searchParams`, `useSearchParams().get`), executed by the navigation
|
|
805
|
+
* bridge as a URL push.
|
|
806
|
+
*/
|
|
807
|
+
export function createUrlFilterSource(options = {}) {
|
|
808
|
+
return {
|
|
809
|
+
kind: 'url-filters',
|
|
810
|
+
observe: (ctx) => observeFilters(ctx.root, ctx.config.locale, options, ctx.policy.exclude ?? []),
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
//# sourceMappingURL=url-filters.js.map
|