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
package/dist/cli/index.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync, mkdirSync, writeFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { createInterface } from 'node:readline/promises';
|
|
4
|
+
import { AppSetupArtifactSchema } from '../contracts/app-setup.js';
|
|
5
|
+
import { discoverFoundationExecutions, FoundationExecutionInventorySchema, } from '../codegen/execution-inventory.js';
|
|
6
|
+
import { writeNextAppRouteScan } from '../codegen/route-scanner.js';
|
|
7
|
+
import { buildManifests, validateWorkspace, } from './commands/validate-build.js';
|
|
8
|
+
import { AppSetupClient } from '../sync/app-setup-client.js';
|
|
9
|
+
import { installSkills, } from './commands/install-skills.js';
|
|
10
|
+
import { parseLocalExecutionInventory, RuntimeSetupClient, } from '../sync/runtime-setup-client.js';
|
|
11
|
+
import { defaultWizardDependencies, isWizardInvocation, runSetupWizard, WizardStopped, } from './commands/setup-wizard.js';
|
|
12
|
+
import { FoundationDiagnosticError } from '../diagnostics/index.js';
|
|
13
|
+
import { assertSetupPlanConfirmation, createSetupPlan, } from './commands/setup-plan.js';
|
|
14
|
+
import { applySetupPlan } from './commands/apply-setup-plan.js';
|
|
15
|
+
import { createDoctorReport, formatDoctorReport, } from './commands/doctor.js';
|
|
16
|
+
import { runConnect, } from './commands/connect.js';
|
|
17
|
+
import { runSync } from './commands/sync.js';
|
|
18
|
+
import { inspectSetupProject, formatSetupProjectInspection } from './commands/project-inspection.js';
|
|
19
|
+
import { runAgentSetup } from './commands/agent-setup.js';
|
|
20
|
+
import { writeCiWorkflow } from './commands/ci-workflow.js';
|
|
21
|
+
import { runToolsCommand } from './commands/tools/index.js';
|
|
2
22
|
function getFlagValue(args, flag) {
|
|
3
23
|
const index = args.indexOf(flag);
|
|
4
24
|
return index >= 0 ? args[index + 1] : undefined;
|
|
@@ -6,629 +26,593 @@ function getFlagValue(args, flag) {
|
|
|
6
26
|
function hasFlag(args, flag) {
|
|
7
27
|
return args.includes(flag);
|
|
8
28
|
}
|
|
29
|
+
/** The command overview printed by `glirastes --help`. */
|
|
30
|
+
export const CLI_USAGE = 'Usage: glirastes init [--agent codex|claude] [--root] [--dry-run] [--json]\n'
|
|
31
|
+
+ ' start integration with your existing coding agent\n'
|
|
32
|
+
+ ' glirastes init --ci github [--enrich-on <branch,...>] [--enrich-on-main] [--ci-environment <name>] [--force] [--root] [--json]\n'
|
|
33
|
+
+ ' write the GitHub workflow: model-free tool check, Pro managed tool job\n'
|
|
34
|
+
+ ' glirastes setup [--dry-run] [--managed] [--json]\n'
|
|
35
|
+
+ ' detect, validate and atomically install local artifacts\n'
|
|
36
|
+
+ ' glirastes connect --base-url <url> [--json]\n'
|
|
37
|
+
+ ' pair an existing local setup with the Platform\n'
|
|
38
|
+
+ ' glirastes sync [--json]\n'
|
|
39
|
+
+ ' upload the current local setup without reassessment\n'
|
|
40
|
+
+ ' glirastes setup guided [options]\n'
|
|
41
|
+
+ ' run the legacy interactive setup interview\n'
|
|
42
|
+
+ ' glirastes setup inspect [--root] [--json]\n'
|
|
43
|
+
+ ' inspect local manifests before app integration\n'
|
|
44
|
+
+ ' glirastes setup <scan|sync|status> [options]\n'
|
|
45
|
+
+ ' the same steps, one at a time\n'
|
|
46
|
+
+ ' glirastes scan [--output] [--sync] [--execution-inventory]\n'
|
|
47
|
+
+ ' glirastes install [--host a,b] [--symlink] [--force] '
|
|
48
|
+
+ '[--dry-run]\n'
|
|
49
|
+
+ ' glirastes validate [--root] [--app-id]\n'
|
|
50
|
+
+ ' glirastes doctor [--root] [--managed] [--json] [--verbose]\n'
|
|
51
|
+
+ ' glirastes build [--root] [--app-id] [--output]\n'
|
|
52
|
+
+ ' glirastes tools <refresh|check|status|resolve|describe|eval|policy|verify|enrich> [options]\n'
|
|
53
|
+
+ ' derive chat tools from the code, check them, show them and print agent work lists\n';
|
|
54
|
+
const HELP_FLAGS = new Set(['--help', '-h', 'help']);
|
|
55
|
+
/** The usage entries of one command, cut out of the overview (an entry is its line plus indented notes). */
|
|
56
|
+
function commandUsage(command) {
|
|
57
|
+
const entries = [];
|
|
58
|
+
for (const line of CLI_USAGE.trimEnd().split('\n')) {
|
|
59
|
+
if (/^(Usage:|\s{7})\s*glirastes /.test(line))
|
|
60
|
+
entries.push([line]);
|
|
61
|
+
else
|
|
62
|
+
entries.at(-1)?.push(line);
|
|
63
|
+
}
|
|
64
|
+
const mine = entries.filter((entry) => new RegExp(`glirastes ${command}( |$)`).test(entry[0]));
|
|
65
|
+
return mine.flat().map((line) => line.replace(/^Usage: /, '')).join('\n');
|
|
66
|
+
}
|
|
67
|
+
const VERSION_FLAGS = new Set(['--version', '-v']);
|
|
68
|
+
/** Version of the installed glirastes package (src/cli and dist/cli both sit two levels below it). */
|
|
69
|
+
function packageVersion() {
|
|
70
|
+
const manifest = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
|
|
71
|
+
return manifest.version;
|
|
72
|
+
}
|
|
9
73
|
function parseCommand(args) {
|
|
10
74
|
const [command, ...rest] = args;
|
|
11
|
-
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'install
|
|
22
|
-
'validate
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
` generate Generate endpoint tools from OpenAPI spec\n` +
|
|
32
|
-
` validate Validate OpenAPI spec\n` +
|
|
33
|
-
` generate-tools Generate all registries (endpoint + UI + modules)\n` +
|
|
34
|
-
` generate-endpoint-tools Generate endpoint tool registry\n` +
|
|
35
|
-
` generate-ui-tools Generate UI tool registry + action IDs\n` +
|
|
36
|
-
` generate-modules Generate module registry\n` +
|
|
37
|
-
` generate-skills Generate agent skill files (Claude Code / Codex) [--sync] [--remote]\n` +
|
|
38
|
-
` generate-mcp-server Generate MCP server project from tool definitions [--sync] [--remote]\n` +
|
|
39
|
-
` generate-auto Auto-detect best output format and generate\n` +
|
|
40
|
-
` install-skills Install bundled agent skills (default: ./.claude/skills) [-g/--global ~/.claude/skills] [--target <dir>] [--stack nextjs|nestjs|nextjs+nestjs|all] [--symlink] [--force] [--dry-run]\n` +
|
|
41
|
-
` validate-tools Validate AI tool configuration\n` +
|
|
42
|
-
` coverage Check AI tool coverage\n` +
|
|
43
|
-
` scaffold Scaffold ai-tool.ts from route.ts\n` +
|
|
44
|
-
` test Scaffold AI behavior test file\n` +
|
|
45
|
-
` check-upgrade Analyze upgrade gaps from release notes (--from-version)\n` +
|
|
46
|
-
` sync Sync tool schemas to Glirastes platform\n`);
|
|
47
|
-
}
|
|
48
|
-
return { command: command, rest };
|
|
49
|
-
}
|
|
50
|
-
export async function runCli(args) {
|
|
51
|
-
const { command, rest } = parseCommand(args);
|
|
52
|
-
// OpenAPI commands — lazy-load openapi-gen to avoid requiring it at startup
|
|
53
|
-
if (command === 'validate') {
|
|
54
|
-
const { validateOpenApiFile } = await import('../openapi/index.js');
|
|
55
|
-
const inputPath = getFlagValue(rest, '--input');
|
|
56
|
-
if (!inputPath)
|
|
57
|
-
throw new Error('--input is required.');
|
|
58
|
-
const validation = await validateOpenApiFile({ inputPath });
|
|
59
|
-
for (const warning of validation.warnings)
|
|
60
|
-
console.warn(warning);
|
|
61
|
-
if (validation.errors.length > 0) {
|
|
62
|
-
throw new Error(`OpenAPI validation failed:\n${validation.errors.join('\n')}`);
|
|
63
|
-
}
|
|
64
|
-
console.log(`OpenAPI valid. Enabled AI tools: ${validation.enabledTools}. Warnings: ${validation.warnings.length}.`);
|
|
65
|
-
return;
|
|
75
|
+
if (command === undefined || HELP_FLAGS.has(command))
|
|
76
|
+
return { command: 'help', rest };
|
|
77
|
+
if (VERSION_FLAGS.has(command))
|
|
78
|
+
return { command: 'version', rest };
|
|
79
|
+
if (command !== 'init'
|
|
80
|
+
&& command !== 'scan'
|
|
81
|
+
&& command !== 'setup'
|
|
82
|
+
&& command !== 'connect'
|
|
83
|
+
&& command !== 'sync'
|
|
84
|
+
&& command !== 'doctor'
|
|
85
|
+
&& command !== 'install'
|
|
86
|
+
&& command !== 'validate'
|
|
87
|
+
&& command !== 'build'
|
|
88
|
+
&& command !== 'tools') {
|
|
89
|
+
throw new FoundationDiagnosticError({
|
|
90
|
+
code: 'E-SETUP-030',
|
|
91
|
+
operation: 'cli',
|
|
92
|
+
message: `Unknown command '${command}'.`,
|
|
93
|
+
remediation: 'Run glirastes --help to list the commands.',
|
|
94
|
+
});
|
|
66
95
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (!outputPath)
|
|
74
|
-
throw new Error('--output is required for generate.');
|
|
75
|
-
const validation = await generateFromOpenApiFile({ inputPath, outputPath });
|
|
76
|
-
for (const warning of validation.warnings)
|
|
77
|
-
console.warn(warning);
|
|
78
|
-
console.log(`Generated endpoint tools at ${outputPath}`);
|
|
79
|
-
console.log(`Enabled AI tools: ${validation.enabledTools}. Warnings: ${validation.warnings.length}.`);
|
|
80
|
-
return;
|
|
96
|
+
return { command, rest };
|
|
97
|
+
}
|
|
98
|
+
async function terminalAsk(question) {
|
|
99
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
100
|
+
throw new Error('Interactive input is unavailable. Pass --with-setup-skills or '
|
|
101
|
+
+ '--without-setup-skills and --host when required.');
|
|
81
102
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// Read glirastes config from package.json (supports monorepo scan/output config)
|
|
87
|
-
const { readFileSync, existsSync } = await import('node:fs');
|
|
88
|
-
const { join } = await import('node:path');
|
|
89
|
-
const pkgJsonPath = join(rootDir, 'package.json');
|
|
90
|
-
let glirastesConfig = {};
|
|
103
|
+
const prompt = createInterface({
|
|
104
|
+
input: process.stdin,
|
|
105
|
+
output: process.stdout,
|
|
106
|
+
});
|
|
91
107
|
try {
|
|
92
|
-
|
|
93
|
-
glirastesConfig = (pkg.glirastes ?? {});
|
|
108
|
+
return await prompt.question(question);
|
|
94
109
|
}
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
finally {
|
|
111
|
+
prompt.close();
|
|
97
112
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
}
|
|
114
|
+
function parseHost(value) {
|
|
115
|
+
if (value === undefined)
|
|
116
|
+
return undefined;
|
|
117
|
+
if (value === 'codex' || value === 'claude' || value === 'gemini') {
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
throw new Error('Choose a host: codex, claude, or gemini.');
|
|
121
|
+
}
|
|
122
|
+
/** `--host claude,codex` — several agent hosts share one install. */
|
|
123
|
+
function parseHosts(value) {
|
|
124
|
+
if (value === undefined)
|
|
125
|
+
return undefined;
|
|
126
|
+
const hosts = value
|
|
127
|
+
.split(',')
|
|
128
|
+
.map((entry) => entry.trim())
|
|
129
|
+
.filter(Boolean)
|
|
130
|
+
.map((entry) => {
|
|
131
|
+
const parsed = parseHost(entry);
|
|
132
|
+
if (!parsed)
|
|
133
|
+
throw new Error('Choose a host: codex, claude, or gemini.');
|
|
134
|
+
return parsed;
|
|
135
|
+
});
|
|
136
|
+
return hosts.length > 0 ? [...new Set(hosts)] : undefined;
|
|
137
|
+
}
|
|
138
|
+
async function runInstall(rest, dependencies) {
|
|
139
|
+
if (hasFlag(rest, '--with-setup-skills')
|
|
140
|
+
&& hasFlag(rest, '--without-setup-skills')) {
|
|
141
|
+
throw new Error('Choose either --with-setup-skills or --without-setup-skills.');
|
|
142
|
+
}
|
|
143
|
+
const ask = dependencies.ask ?? terminalAsk;
|
|
144
|
+
let includeSetupSkills = hasFlag(rest, '--with-setup-skills');
|
|
145
|
+
if (!includeSetupSkills
|
|
146
|
+
&& !hasFlag(rest, '--without-setup-skills')) {
|
|
147
|
+
const consent = (await ask('Install the optional local Glirastes setup skills? [y/N] ')).trim().toLowerCase();
|
|
148
|
+
if (!['y', 'yes', 'n', 'no', ''].includes(consent)) {
|
|
149
|
+
throw new Error('Answer yes or no for setup skills.');
|
|
124
150
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
151
|
+
includeSetupSkills = consent === 'y' || consent === 'yes';
|
|
152
|
+
}
|
|
153
|
+
let hosts = parseHosts(getFlagValue(rest, '--host'));
|
|
154
|
+
if (includeSetupSkills && !hosts) {
|
|
155
|
+
hosts = parseHosts((await ask('Choose the setup hosts (codex, claude, gemini; comma-separated): ')).trim().toLowerCase());
|
|
156
|
+
}
|
|
157
|
+
await installSkills({
|
|
158
|
+
rootDir: getFlagValue(rest, '--root') ?? process.cwd(),
|
|
159
|
+
target: getFlagValue(rest, '--target'),
|
|
160
|
+
global: hasFlag(rest, '--global'),
|
|
161
|
+
symlink: hasFlag(rest, '--symlink'),
|
|
162
|
+
force: hasFlag(rest, '--force'),
|
|
163
|
+
dryRun: hasFlag(rest, '--dry-run'),
|
|
164
|
+
includeSetupSkills,
|
|
165
|
+
hosts,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function setupConnection(rest) {
|
|
169
|
+
const baseUrl = getFlagValue(rest, '--base-url')
|
|
170
|
+
?? process.env.GLIRASTES_CONTROL_PLANE_URL;
|
|
171
|
+
const appId = getFlagValue(rest, '--app-id')
|
|
172
|
+
?? process.env.GLIRASTES_APP_ID;
|
|
173
|
+
// One key, one variable: GLIRASTES_API_KEY.
|
|
174
|
+
const setupApiKey = process.env.GLIRASTES_API_KEY;
|
|
175
|
+
if (!baseUrl) {
|
|
176
|
+
throw new FoundationDiagnosticError({
|
|
177
|
+
code: 'E-SETUP-001',
|
|
178
|
+
operation: 'setup.connection',
|
|
179
|
+
message: 'GLIRASTES_CONTROL_PLANE_URL is not configured for setup.',
|
|
180
|
+
remediation: 'configure-control-plane-url',
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (!appId) {
|
|
184
|
+
throw new FoundationDiagnosticError({
|
|
185
|
+
code: 'E-SCOPE-001',
|
|
186
|
+
operation: 'setup.connection',
|
|
187
|
+
message: 'GLIRASTES_APP_ID is not configured for setup.',
|
|
188
|
+
remediation: 'configure-app-id',
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (!setupApiKey) {
|
|
192
|
+
throw new FoundationDiagnosticError({
|
|
193
|
+
code: 'E-SETUP-002',
|
|
194
|
+
operation: 'setup.connection',
|
|
195
|
+
message: 'GLIRASTES_API_KEY is not configured for setup.',
|
|
196
|
+
remediation: 'configure-app-api-key',
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return { baseUrl, appId, setupApiKey };
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Explicit `glirastes setup guided` legacy interview. It delegates to the same
|
|
203
|
+
* steps the subcommands expose and adds no second implementation of them.
|
|
204
|
+
*/
|
|
205
|
+
async function runSetupWizardCommand(rest) {
|
|
206
|
+
const rootDir = resolve(getFlagValue(rest, '--root') ?? process.cwd());
|
|
207
|
+
try {
|
|
208
|
+
const artifactPath = artifactPathFrom(rest);
|
|
209
|
+
if (existsSync(join(rootDir, artifactPath))) {
|
|
210
|
+
const plan = await createSetupPlan({
|
|
211
|
+
rootDir,
|
|
212
|
+
artifactPath,
|
|
213
|
+
previousArtifactPath: getFlagValue(rest, '--previous-artifact'),
|
|
214
|
+
});
|
|
215
|
+
assertSetupPlanConfirmation(plan, {
|
|
216
|
+
confirmLoosening: hasFlag(rest, '--confirm-loosening'),
|
|
217
|
+
planDigest: getFlagValue(rest, '--plan-digest'),
|
|
218
|
+
});
|
|
131
219
|
}
|
|
132
|
-
|
|
133
|
-
|
|
220
|
+
await runSetupWizard({
|
|
221
|
+
rootDir,
|
|
222
|
+
io: {
|
|
223
|
+
isInteractive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
224
|
+
log: (message) => { console.log(message); },
|
|
225
|
+
ask: terminalAsk,
|
|
226
|
+
},
|
|
227
|
+
hosts: parseHosts(getFlagValue(rest, '--host')),
|
|
228
|
+
assessmentMode: parseAssessmentMode(getFlagValue(rest, '--assessment')),
|
|
229
|
+
deps: {
|
|
230
|
+
...defaultWizardDependencies(),
|
|
231
|
+
discover: async (root) => {
|
|
232
|
+
await runSetup(['scan', '--root', root, '--quiet']);
|
|
233
|
+
const discovery = JSON.parse(readFileSync(join(root, '.glirastes/setup-discovery.json'), 'utf8'));
|
|
234
|
+
return { executionCount: discovery.executions?.length ?? 0 };
|
|
235
|
+
},
|
|
236
|
+
assessmentArtifactExists: async (root) => existsSync(join(root, artifactPathFrom(rest))),
|
|
237
|
+
validate: async (root) => {
|
|
238
|
+
const appId = getFlagValue(rest, '--app-id');
|
|
239
|
+
if (!appId) {
|
|
240
|
+
throw new Error('--app-id is required to validate the workspace.');
|
|
241
|
+
}
|
|
242
|
+
await validateWorkspace({ rootDir: root, appId });
|
|
243
|
+
},
|
|
244
|
+
sync: async (root) => {
|
|
245
|
+
const run = await syncExplicitSetupArtifact(root, [
|
|
246
|
+
...rest,
|
|
247
|
+
'--artifact', artifactPathFrom(rest),
|
|
248
|
+
]);
|
|
249
|
+
return { runId: run.runId };
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
if (error instanceof WizardStopped) {
|
|
256
|
+
process.exitCode = 1;
|
|
257
|
+
return;
|
|
134
258
|
}
|
|
135
|
-
|
|
259
|
+
throw error;
|
|
136
260
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
261
|
+
}
|
|
262
|
+
/** Preserve the guided interview's explicit assessed-artifact upload path. */
|
|
263
|
+
async function syncExplicitSetupArtifact(rootDir, options) {
|
|
264
|
+
const artifactPath = getFlagValue(options, '--artifact');
|
|
265
|
+
if (!artifactPath) {
|
|
266
|
+
throw new Error('--artifact is required for setup sync.');
|
|
140
267
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
268
|
+
const artifact = AppSetupArtifactSchema.parse(JSON.parse(readFileSync(resolve(rootDir, artifactPath), 'utf8')));
|
|
269
|
+
const connection = setupConnection(options);
|
|
270
|
+
if (artifact.appId !== connection.appId) {
|
|
271
|
+
throw new Error('App setup artifact targets a different app');
|
|
272
|
+
}
|
|
273
|
+
const client = new AppSetupClient(connection);
|
|
274
|
+
await client.createRun({
|
|
275
|
+
runId: artifact.runId,
|
|
276
|
+
assessmentMode: artifact.assessmentMode,
|
|
277
|
+
discoveryDigest: artifact.discoveryDigest,
|
|
278
|
+
});
|
|
279
|
+
return client.uploadArtifact(artifact);
|
|
280
|
+
}
|
|
281
|
+
function artifactPathFrom(rest) {
|
|
282
|
+
return getFlagValue(rest, '--artifact')
|
|
283
|
+
?? '.glirastes/app-setup-artifact.json';
|
|
284
|
+
}
|
|
285
|
+
function parseAssessmentMode(value) {
|
|
286
|
+
if (value === undefined)
|
|
287
|
+
return undefined;
|
|
288
|
+
if (value !== 'interview'
|
|
289
|
+
&& value !== 'autonomous'
|
|
290
|
+
&& value !== 'manual') {
|
|
291
|
+
throw new Error(`Unknown --assessment value: '${value}'. `
|
|
292
|
+
+ 'Use interview, autonomous, or manual.');
|
|
145
293
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
294
|
+
return value;
|
|
295
|
+
}
|
|
296
|
+
async function runSetup(rest, dependencies = {}) {
|
|
297
|
+
if (rest[0] === 'inspect') {
|
|
298
|
+
const inspection = await inspectSetupProject(getFlagValue(rest, '--root') ?? process.cwd());
|
|
299
|
+
console.log(hasFlag(rest, '--json')
|
|
300
|
+
? JSON.stringify(inspection)
|
|
301
|
+
: formatSetupProjectInspection(inspection));
|
|
149
302
|
return;
|
|
150
303
|
}
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (!baseUrl)
|
|
161
|
-
throw new Error('--base-url is required for generate-skills.');
|
|
162
|
-
const authStrategy = buildAuthStrategy(authType, tokenEnvVar, rest);
|
|
163
|
-
const formats = format === 'markdown' ? ['markdown'] :
|
|
164
|
-
format === 'json' ? ['json'] :
|
|
165
|
-
['markdown', 'json'];
|
|
166
|
-
const skillConfig = { appName, baseUrl, auth: authStrategy };
|
|
167
|
-
const result = await generateAgentSkills({
|
|
168
|
-
...options,
|
|
169
|
-
skillConfig,
|
|
170
|
-
formats,
|
|
171
|
-
skillOutputDir: outputDir,
|
|
304
|
+
if (hasFlag(rest, '--dry-run')) {
|
|
305
|
+
const rootDir = resolve(getFlagValue(rest, '--root') ?? process.cwd());
|
|
306
|
+
const plan = await createSetupPlan({
|
|
307
|
+
rootDir,
|
|
308
|
+
artifactPath: getFlagValue(rest, '--artifact'),
|
|
309
|
+
previousArtifactPath: getFlagValue(rest, '--previous-artifact'),
|
|
310
|
+
inventoryPath: getFlagValue(rest, '--execution-inventory'),
|
|
311
|
+
promptBundlePath: getFlagValue(rest, '--prompt-bundle'),
|
|
312
|
+
managed: hasFlag(rest, '--managed'),
|
|
172
313
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (shouldSync) {
|
|
176
|
-
const apiKey = getFlagValue(rest, '--glirastes-key') ?? process.env.GLIRASTES_API_KEY;
|
|
177
|
-
const glirasterUrl = getFlagValue(rest, '--glirastes-url') ?? process.env.GLIRASTES_URL ?? 'https://api.glirastes.chainmatics.io';
|
|
178
|
-
if (!apiKey) {
|
|
179
|
-
console.warn('⚠ --sync/--remote requires GLIRASTES_API_KEY or --glirastes-key');
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
const syncResult = await syncAssetToGlirastes({
|
|
183
|
-
apiKey,
|
|
184
|
-
glirasterUrl,
|
|
185
|
-
name: appName,
|
|
186
|
-
type: 'skill',
|
|
187
|
-
version: '1.0.0',
|
|
188
|
-
toolCount: result.toolCount,
|
|
189
|
-
config: { appName, baseUrl, auth: authStrategy },
|
|
190
|
-
toolManifest: { tools: result.tools },
|
|
191
|
-
});
|
|
192
|
-
console.log(`✓ Synced to Glirastes: skill "${appName}" (${syncResult.action})`);
|
|
193
|
-
if (remote) {
|
|
194
|
-
const generateRes = await fetch(`${glirasterUrl}/v1/registry/assets/${syncResult.assetId}/generate`, {
|
|
195
|
-
method: 'POST',
|
|
196
|
-
headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' },
|
|
197
|
-
});
|
|
198
|
-
if (!generateRes.ok) {
|
|
199
|
-
console.warn(`⚠ Remote generation failed (${generateRes.status})`);
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
const genResult = await generateRes.json();
|
|
203
|
-
console.log(`✓ Remote generation complete: v${genResult.version}, ${genResult.files.length} files`);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
314
|
+
if (hasFlag(rest, '--json')) {
|
|
315
|
+
console.log(JSON.stringify(plan));
|
|
207
316
|
}
|
|
208
|
-
|
|
209
|
-
console.log(
|
|
210
|
-
|
|
317
|
+
else {
|
|
318
|
+
console.log(`Setup plan ${plan.planDigest}: ${plan.operations.length} operations, `
|
|
319
|
+
+ `${plan.counts.tools} tools, confirmation `
|
|
320
|
+
+ `${plan.requiresConfirmation ? 'required' : 'not required'}.`);
|
|
211
321
|
}
|
|
212
322
|
return;
|
|
213
323
|
}
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
324
|
+
if (isWizardInvocation(rest)) {
|
|
325
|
+
await runSetupWizardCommand(rest.slice(1));
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (rest[0] === undefined || rest[0]?.startsWith('--')) {
|
|
329
|
+
const rootDir = resolve(getFlagValue(rest, '--root') ?? process.cwd());
|
|
330
|
+
const plan = await createSetupPlan({
|
|
331
|
+
rootDir,
|
|
332
|
+
artifactPath: getFlagValue(rest, '--artifact'),
|
|
333
|
+
previousArtifactPath: getFlagValue(rest, '--previous-artifact'),
|
|
334
|
+
inventoryPath: getFlagValue(rest, '--execution-inventory'),
|
|
335
|
+
promptBundlePath: getFlagValue(rest, '--prompt-bundle'),
|
|
336
|
+
managed: hasFlag(rest, '--managed'),
|
|
337
|
+
});
|
|
338
|
+
assertSetupPlanConfirmation(plan, {
|
|
339
|
+
confirmLoosening: hasFlag(rest, '--confirm-loosening'),
|
|
340
|
+
planDigest: getFlagValue(rest, '--plan-digest'),
|
|
341
|
+
});
|
|
342
|
+
const applied = await applySetupPlan({
|
|
343
|
+
rootDir,
|
|
344
|
+
plan,
|
|
345
|
+
artifactPath: getFlagValue(rest, '--artifact'),
|
|
346
|
+
previousArtifactPath: getFlagValue(rest, '--previous-artifact'),
|
|
347
|
+
inventoryPath: getFlagValue(rest, '--execution-inventory'),
|
|
348
|
+
promptBundlePath: getFlagValue(rest, '--prompt-bundle'),
|
|
231
349
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (!remote) {
|
|
235
|
-
for (const file of result.files) {
|
|
236
|
-
const fullPath = join(rootDir, file.path);
|
|
237
|
-
await mkdir(dirname(fullPath), { recursive: true });
|
|
238
|
-
await writeFile(fullPath, file.content, 'utf-8');
|
|
239
|
-
if (!quiet)
|
|
240
|
-
console.log(` wrote ${file.path}`);
|
|
241
|
-
}
|
|
242
|
-
if (!quiet) {
|
|
243
|
-
console.log(`\nMCP server generated: ${result.toolCount} tools across ${result.modulesUsed.length} modules`);
|
|
244
|
-
}
|
|
350
|
+
if (applied.mode === 'managed') {
|
|
351
|
+
await runSync({ rootDir, quiet: true }, dependencies.sync);
|
|
245
352
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const apiKey = getFlagValue(rest, '--glirastes-key') ?? process.env.GLIRASTES_API_KEY;
|
|
249
|
-
const glirasterUrl = getFlagValue(rest, '--glirastes-url') ?? process.env.GLIRASTES_URL ?? 'https://api.glirastes.chainmatics.io';
|
|
250
|
-
if (!apiKey) {
|
|
251
|
-
console.warn('⚠ --sync/--remote requires GLIRASTES_API_KEY or --glirastes-key');
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
const syncResult = await syncAssetToGlirastes({
|
|
255
|
-
apiKey,
|
|
256
|
-
glirasterUrl,
|
|
257
|
-
name: appName,
|
|
258
|
-
type: 'mcp-server',
|
|
259
|
-
version: '1.0.0',
|
|
260
|
-
toolCount: result.toolCount,
|
|
261
|
-
config: { appName, baseUrl, auth: authStrategy },
|
|
262
|
-
toolManifest: { tools: result.tools, modules: result.modulesUsed },
|
|
263
|
-
});
|
|
264
|
-
console.log(`✓ Synced to Glirastes: mcp-server "${appName}" (${syncResult.action})`);
|
|
265
|
-
if (remote) {
|
|
266
|
-
const generateRes = await fetch(`${glirasterUrl}/v1/registry/assets/${syncResult.assetId}/generate`, {
|
|
267
|
-
method: 'POST',
|
|
268
|
-
headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' },
|
|
269
|
-
});
|
|
270
|
-
if (!generateRes.ok) {
|
|
271
|
-
console.warn(`⚠ Remote generation failed (${generateRes.status})`);
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
const genResult = await generateRes.json();
|
|
275
|
-
console.log(`✓ Remote generation complete: v${genResult.version}, ${genResult.files.length} files`);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
353
|
+
if (hasFlag(rest, '--json')) {
|
|
354
|
+
console.log(JSON.stringify({ schemaVersion: 1, ...applied }));
|
|
279
355
|
}
|
|
280
|
-
|
|
281
|
-
console.log(
|
|
356
|
+
else {
|
|
357
|
+
console.log('Glirastes setup');
|
|
358
|
+
console.log(` ${applied.toolCount} tools validated`);
|
|
359
|
+
console.log(` ${applied.mode === 'standalone' ? 'Standalone' : 'Managed'} artifacts installed`);
|
|
360
|
+
console.log(' Security policy unchanged');
|
|
361
|
+
console.log('');
|
|
362
|
+
console.log('Restart the application, then run: glirastes doctor');
|
|
282
363
|
}
|
|
283
364
|
return;
|
|
284
365
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
throw new Error('--app-name is required for generate-auto.');
|
|
296
|
-
if (!baseUrl)
|
|
297
|
-
throw new Error('--base-url is required for generate-auto.');
|
|
298
|
-
const authStrategy = buildAuthStrategy(authType, tokenEnvVar, rest);
|
|
299
|
-
const hasStreaming = hasFlag(rest, '--streaming');
|
|
300
|
-
const hasWebSocket = hasFlag(rest, '--websocket');
|
|
301
|
-
const multiAgentAccess = hasFlag(rest, '--multi-agent');
|
|
302
|
-
const toolCountStr = getFlagValue(rest, '--tool-count');
|
|
303
|
-
const toolCount = toolCountStr ? parseInt(toolCountStr, 10) : undefined;
|
|
304
|
-
const recommendation = recommendOutputFormat({
|
|
305
|
-
auth: authStrategy,
|
|
306
|
-
hasStreaming,
|
|
307
|
-
hasWebSocket,
|
|
308
|
-
multiAgentAccess,
|
|
309
|
-
toolCount,
|
|
366
|
+
const [subcommand, ...options] = rest;
|
|
367
|
+
const rootDir = getFlagValue(options, '--root') ?? process.cwd();
|
|
368
|
+
const quiet = hasFlag(options, '--quiet');
|
|
369
|
+
if (subcommand === 'scan') {
|
|
370
|
+
const inventoryPath = resolve(rootDir, getFlagValue(options, '--execution-inventory')
|
|
371
|
+
?? '.glirastes/local-execution-inventory.v2.json');
|
|
372
|
+
const inventory = FoundationExecutionInventorySchema.parse(JSON.parse(readFileSync(inventoryPath, 'utf8')));
|
|
373
|
+
const discovery = await discoverFoundationExecutions({
|
|
374
|
+
rootDir,
|
|
375
|
+
inventory,
|
|
310
376
|
});
|
|
377
|
+
const outputPath = resolve(rootDir, getFlagValue(options, '--output')
|
|
378
|
+
?? '.glirastes/setup-discovery.json');
|
|
379
|
+
mkdirSync(dirname(outputPath), { recursive: true });
|
|
380
|
+
writeFileSync(outputPath, `${JSON.stringify(discovery, null, 2)}\n`, 'utf8');
|
|
311
381
|
if (!quiet) {
|
|
312
|
-
console.log(`
|
|
313
|
-
|
|
314
|
-
console.log('');
|
|
315
|
-
}
|
|
316
|
-
const skillConfig = { appName, baseUrl, auth: authStrategy };
|
|
317
|
-
if (recommendation.format === 'skill' || recommendation.format === 'both') {
|
|
318
|
-
await generateAgentSkills({
|
|
319
|
-
...options,
|
|
320
|
-
skillConfig,
|
|
321
|
-
formats: ['markdown', 'json'],
|
|
322
|
-
skillOutputDir,
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
if (recommendation.format === 'mcp' || recommendation.format === 'both') {
|
|
326
|
-
const result = await generateMcpServer({
|
|
327
|
-
...options,
|
|
328
|
-
skillConfig,
|
|
329
|
-
mcpOutputDir,
|
|
330
|
-
});
|
|
331
|
-
// Write generated MCP files to disk
|
|
332
|
-
for (const file of result.files) {
|
|
333
|
-
const fullPath = join(rootDir, file.path);
|
|
334
|
-
await mkdir(dirname(fullPath), { recursive: true });
|
|
335
|
-
await writeFile(fullPath, file.content, 'utf-8');
|
|
336
|
-
if (!quiet)
|
|
337
|
-
console.log(` wrote ${file.path}`);
|
|
338
|
-
}
|
|
382
|
+
console.log(`Discovered ${discovery.executions.length} local executions to `
|
|
383
|
+
+ outputPath);
|
|
339
384
|
}
|
|
340
385
|
return;
|
|
341
386
|
}
|
|
342
|
-
if (
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
387
|
+
if (subcommand === 'sync') {
|
|
388
|
+
await runSync({
|
|
389
|
+
rootDir,
|
|
390
|
+
json: hasFlag(options, '--json'),
|
|
391
|
+
quiet,
|
|
392
|
+
}, dependencies.sync);
|
|
349
393
|
return;
|
|
350
394
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
395
|
+
const connection = setupConnection(options);
|
|
396
|
+
const client = new AppSetupClient(connection);
|
|
397
|
+
if (subcommand === 'status') {
|
|
398
|
+
const runId = getFlagValue(options, '--run-id');
|
|
399
|
+
if (!runId) {
|
|
400
|
+
throw new Error('--run-id is required for setup status.');
|
|
401
|
+
}
|
|
402
|
+
const run = await client.getRun(runId);
|
|
403
|
+
if (!quiet) {
|
|
404
|
+
console.log(`Setup run ${run.runId}: ${run.status}`);
|
|
360
405
|
}
|
|
361
406
|
return;
|
|
362
407
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
408
|
+
const run = await syncExplicitSetupArtifact(rootDir, options);
|
|
409
|
+
if (!quiet) {
|
|
410
|
+
console.log(`Synced setup run ${run.runId}: ${run.status}`);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
async function runLegacyScan(rest) {
|
|
414
|
+
const rootDir = getFlagValue(rest, '--root') ?? process.cwd();
|
|
415
|
+
const quiet = hasFlag(rest, '--quiet');
|
|
416
|
+
let config = {};
|
|
417
|
+
try {
|
|
418
|
+
const packageJson = JSON.parse(readFileSync(resolve(rootDir, 'package.json'), 'utf8'));
|
|
419
|
+
config = packageJson.glirastes ?? {};
|
|
420
|
+
}
|
|
421
|
+
catch {
|
|
422
|
+
// The scanner defaults cover projects without package metadata.
|
|
423
|
+
}
|
|
424
|
+
const artifact = await writeNextAppRouteScan({
|
|
425
|
+
rootDir,
|
|
426
|
+
apiDir: config.apiDir,
|
|
427
|
+
outputPath: getFlagValue(rest, '--output'),
|
|
428
|
+
});
|
|
429
|
+
if (!quiet) {
|
|
430
|
+
console.log(`Scanned ${artifact.result.candidates.length} route operations to `
|
|
431
|
+
+ artifact.outputPath);
|
|
432
|
+
}
|
|
433
|
+
if (!hasFlag(rest, '--sync'))
|
|
434
|
+
return;
|
|
435
|
+
if (artifact.result.findings?.length) {
|
|
436
|
+
throw new FoundationDiagnosticError({
|
|
437
|
+
code: 'E-INVENTORY-001',
|
|
438
|
+
operation: 'scan.sync',
|
|
439
|
+
message: 'Route scan is incomplete. Review findings in the local scan artifact before syncing.',
|
|
440
|
+
remediation: 'resolve-route-scan-findings',
|
|
374
441
|
});
|
|
375
|
-
|
|
442
|
+
}
|
|
443
|
+
const baseUrl = getFlagValue(rest, '--base-url')
|
|
444
|
+
?? process.env.GLIRASTES_CONTROL_PLANE_URL;
|
|
445
|
+
const appId = getFlagValue(rest, '--app-id')
|
|
446
|
+
?? process.env.GLIRASTES_APP_ID;
|
|
447
|
+
const environmentId = getFlagValue(rest, '--environment-id')
|
|
448
|
+
?? process.env.GLIRASTES_ENVIRONMENT_ID;
|
|
449
|
+
const apiKey = process.env.GLIRASTES_SETUP_API_KEY;
|
|
450
|
+
if (!baseUrl) {
|
|
451
|
+
throw new Error('--base-url or GLIRASTES_CONTROL_PLANE_URL is required for scan --sync.');
|
|
452
|
+
}
|
|
453
|
+
if (!appId) {
|
|
454
|
+
throw new Error('--app-id or GLIRASTES_APP_ID is required for scan --sync.');
|
|
455
|
+
}
|
|
456
|
+
if (!environmentId) {
|
|
457
|
+
throw new Error('--environment-id or GLIRASTES_ENVIRONMENT_ID is required for scan --sync.');
|
|
458
|
+
}
|
|
459
|
+
if (!apiKey) {
|
|
460
|
+
throw new Error('GLIRASTES_SETUP_API_KEY is required for scan --sync.');
|
|
461
|
+
}
|
|
462
|
+
const scan = JSON.parse(readFileSync(artifact.outputPath, 'utf8'));
|
|
463
|
+
const executionInventoryPath = getFlagValue(rest, '--execution-inventory');
|
|
464
|
+
if (executionInventoryPath) {
|
|
465
|
+
scan.executions = parseLocalExecutionInventory(JSON.parse(readFileSync(resolve(rootDir, executionInventoryPath), 'utf8'))).executions;
|
|
466
|
+
}
|
|
467
|
+
const imported = await new RuntimeSetupClient({
|
|
468
|
+
baseUrl,
|
|
469
|
+
apiKey,
|
|
470
|
+
appId,
|
|
471
|
+
environmentId,
|
|
472
|
+
}).importRouteScan(scan);
|
|
473
|
+
const bindingsOutput = resolve(rootDir, getFlagValue(rest, '--bindings-output')
|
|
474
|
+
?? '.glirastes/platform-tool-bindings.json');
|
|
475
|
+
mkdirSync(dirname(bindingsOutput), { recursive: true });
|
|
476
|
+
writeFileSync(bindingsOutput, `${JSON.stringify({
|
|
477
|
+
schemaVersion: 1,
|
|
478
|
+
targetAppId: appId,
|
|
479
|
+
environmentId,
|
|
480
|
+
bindings: [...imported.bindings].sort((left, right) => (left.stableKey.localeCompare(right.stableKey))),
|
|
481
|
+
}, null, 2)}\n`, 'utf8');
|
|
482
|
+
if (!quiet) {
|
|
483
|
+
console.log(`Imported ${imported.createdDrafts} review drafts; `
|
|
484
|
+
+ `${imported.unchanged} unchanged; `
|
|
485
|
+
+ `${imported.tombstoneCandidates.length} tombstone candidates.`);
|
|
486
|
+
console.log(`Wrote authoritative tool bindings to ${bindingsOutput}.`);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
async function runValidate(rest) {
|
|
490
|
+
const rootDir = getFlagValue(rest, '--root') ?? process.cwd();
|
|
491
|
+
const appId = getFlagValue(rest, '--app-id') ?? process.env.GLIRASTES_APP_ID;
|
|
492
|
+
if (!appId) {
|
|
493
|
+
throw new FoundationDiagnosticError({
|
|
494
|
+
code: 'E-SCOPE-001',
|
|
495
|
+
operation: 'validate.scope',
|
|
496
|
+
message: 'GLIRASTES_APP_ID is not configured for validation.',
|
|
497
|
+
remediation: 'configure-app-id',
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
const workspace = await validateWorkspace({
|
|
501
|
+
rootDir,
|
|
502
|
+
appId,
|
|
503
|
+
inventoryPath: getFlagValue(rest, '--execution-inventory'),
|
|
504
|
+
promptBundlePath: getFlagValue(rest, '--prompt-bundle'),
|
|
505
|
+
});
|
|
506
|
+
if (!hasFlag(rest, '--quiet')) {
|
|
507
|
+
console.log(`Validated ${workspace.executions.length} executions and the local `
|
|
508
|
+
+ 'prompt bundle without network access.');
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
async function runBuild(rest) {
|
|
512
|
+
const rootDir = getFlagValue(rest, '--root') ?? process.cwd();
|
|
513
|
+
const appId = getFlagValue(rest, '--app-id') ?? process.env.GLIRASTES_APP_ID;
|
|
514
|
+
if (!appId) {
|
|
515
|
+
throw new Error('--app-id or GLIRASTES_APP_ID is required for build.');
|
|
516
|
+
}
|
|
517
|
+
const built = await buildManifests({
|
|
518
|
+
rootDir,
|
|
519
|
+
appId,
|
|
520
|
+
outputDir: getFlagValue(rest, '--output'),
|
|
521
|
+
inventoryPath: getFlagValue(rest, '--execution-inventory'),
|
|
522
|
+
promptBundlePath: getFlagValue(rest, '--prompt-bundle'),
|
|
523
|
+
});
|
|
524
|
+
if (!hasFlag(rest, '--quiet')) {
|
|
525
|
+
console.log(`Runtime manifest ${built.runtimeDigest}`);
|
|
526
|
+
console.log(`Prompt manifest ${built.promptDigest}`);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
export async function runCli(args, dependencies = {}) {
|
|
530
|
+
const { command, rest } = parseCommand(args);
|
|
531
|
+
if (command === 'help') {
|
|
532
|
+
console.log(CLI_USAGE.trimEnd());
|
|
376
533
|
return;
|
|
377
534
|
}
|
|
378
|
-
if (command === '
|
|
379
|
-
|
|
380
|
-
const outputPath = getFlagValue(rest, '--output');
|
|
381
|
-
const force = hasFlag(rest, '--force');
|
|
382
|
-
const dryRun = hasFlag(rest, '--dry-run');
|
|
383
|
-
await scaffoldTestFile({ rootDir, outputPath, force, dryRun });
|
|
535
|
+
if (command === 'version') {
|
|
536
|
+
console.log(packageVersion());
|
|
384
537
|
return;
|
|
385
538
|
}
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
await checkUpgrade({ rootDir, fromVersion });
|
|
539
|
+
if (rest.some((arg) => arg === '--help' || arg === '-h')) {
|
|
540
|
+
// Every command answers --help/-h before it parses or writes anything.
|
|
541
|
+
console.log(commandUsage(command));
|
|
390
542
|
return;
|
|
391
543
|
}
|
|
392
|
-
if (command === '
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
544
|
+
if (command === 'init') {
|
|
545
|
+
const ci = getFlagValue(rest, '--ci');
|
|
546
|
+
if (ci !== undefined) {
|
|
547
|
+
// CI setup is its own step: the workflow lands once the app is set up.
|
|
548
|
+
const written = await writeCiWorkflow({
|
|
549
|
+
root: resolve(getFlagValue(rest, '--root') ?? process.cwd()),
|
|
550
|
+
provider: ci,
|
|
551
|
+
enrichOnMain: hasFlag(rest, '--enrich-on-main'),
|
|
552
|
+
enrichOn: (getFlagValue(rest, '--enrich-on') ?? '').split(',').map((branch) => branch.trim()).filter(Boolean),
|
|
553
|
+
...(getFlagValue(rest, '--ci-environment') !== undefined ? { environment: getFlagValue(rest, '--ci-environment') } : {}),
|
|
554
|
+
force: hasFlag(rest, '--force'),
|
|
555
|
+
});
|
|
556
|
+
console.log(hasFlag(rest, '--json') ? JSON.stringify(written) : `${written.path}: ${written.status}`);
|
|
557
|
+
return;
|
|
399
558
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
559
|
+
await runAgentSetup({
|
|
560
|
+
rootDir: getFlagValue(rest, '--root') ?? process.cwd(),
|
|
561
|
+
agent: getFlagValue(rest, '--agent'), dryRun: hasFlag(rest, '--dry-run'),
|
|
562
|
+
json: hasFlag(rest, '--json'), managed: hasFlag(rest, '--managed'),
|
|
563
|
+
}, { ask: terminalAsk, ...dependencies.init });
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (command === 'tools') {
|
|
567
|
+
const exitCode = await runToolsCommand(rest, dependencies.tools);
|
|
568
|
+
if (exitCode !== 0)
|
|
569
|
+
process.exitCode = exitCode;
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (command === 'connect') {
|
|
573
|
+
await runConnect({
|
|
574
|
+
rootDir: resolve(getFlagValue(rest, '--root') ?? process.cwd()),
|
|
575
|
+
baseUrl: getFlagValue(rest, '--base-url'),
|
|
576
|
+
json: hasFlag(rest, '--json'),
|
|
577
|
+
}, dependencies.connect);
|
|
413
578
|
return;
|
|
414
579
|
}
|
|
415
|
-
// Sync tool schemas to Glirastes platform
|
|
416
580
|
if (command === 'sync') {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
for (const file of scanResult.files) {
|
|
429
|
-
const content = await readFile(file.absolutePath, 'utf-8');
|
|
430
|
-
// Match defineEndpointTool({ id: '...' }) or defineAiEndpointTool({ id: '...' })
|
|
431
|
-
const idMatches = content.matchAll(/define(?:Ai)?EndpointTool\(\s*\{[^}]*?id:\s*['"]([^'"]+)['"]/gs);
|
|
432
|
-
for (const match of idMatches) {
|
|
433
|
-
const toolId = match[1];
|
|
434
|
-
// Try to extract description
|
|
435
|
-
const descMatch = content.match(new RegExp(`id:\\s*['"]${toolId}['"][^}]*?description:\\s*['"]([^'"]+)['"]`, 's'));
|
|
436
|
-
// Try to extract allowedRoles array
|
|
437
|
-
const allowedRoles = extractAllowedRoles(content);
|
|
438
|
-
// Try to extract module
|
|
439
|
-
const moduleMatch = content.match(/module:\s*['"]([^'"]+)['"]/);
|
|
440
|
-
tools.push({
|
|
441
|
-
toolId,
|
|
442
|
-
version: '1.0.0',
|
|
443
|
-
type: 'endpoint',
|
|
444
|
-
schema: {},
|
|
445
|
-
moduleId: moduleMatch?.[1] ?? undefined,
|
|
446
|
-
metadata: {
|
|
447
|
-
description: descMatch?.[1] ?? '',
|
|
448
|
-
sourceFile: file.relativePath,
|
|
449
|
-
allowedRoles,
|
|
450
|
-
},
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
// Also match single tool: defineEndpointTool({ ... }) with withAiTool pattern
|
|
454
|
-
if (tools.length === 0 && file.exportType === 'single') {
|
|
455
|
-
const singleId = content.match(/id:\s*['"]([^'"]+)['"]/);
|
|
456
|
-
if (singleId) {
|
|
457
|
-
const allowedRoles = extractAllowedRoles(content);
|
|
458
|
-
const moduleMatch = content.match(/module:\s*['"]([^'"]+)['"]/);
|
|
459
|
-
tools.push({
|
|
460
|
-
toolId: singleId[1],
|
|
461
|
-
version: '1.0.0',
|
|
462
|
-
type: 'endpoint',
|
|
463
|
-
schema: {},
|
|
464
|
-
moduleId: moduleMatch?.[1] ?? undefined,
|
|
465
|
-
metadata: {
|
|
466
|
-
sourceFile: file.relativePath,
|
|
467
|
-
allowedRoles,
|
|
468
|
-
},
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
// --- UI tools ---
|
|
474
|
-
const uiScanResult = await scanUiTools(options);
|
|
475
|
-
for (const file of uiScanResult.files) {
|
|
476
|
-
const content = await readFile(file.absolutePath, 'utf-8');
|
|
477
|
-
// Extract each toolName from defineUiTool / defineAiUiTool blocks
|
|
478
|
-
const toolNameMatches = content.matchAll(/toolName\s*:\s*['"]([^'"]+)['"]/g);
|
|
479
|
-
for (const match of toolNameMatches) {
|
|
480
|
-
const toolName = match[1];
|
|
481
|
-
const descMatch = content.match(/description\s*:\s*`([^`]+)`/s) ??
|
|
482
|
-
content.match(/description\s*:\s*['"]([^'"]+)['"]/);
|
|
483
|
-
const allowedRoles = extractAllowedRoles(content);
|
|
484
|
-
const moduleMatch = content.match(/module:\s*['"]([^'"]+)['"]/);
|
|
485
|
-
tools.push({
|
|
486
|
-
toolId: toolName,
|
|
487
|
-
version: '1.0.0',
|
|
488
|
-
type: 'ui',
|
|
489
|
-
schema: {},
|
|
490
|
-
moduleId: moduleMatch?.[1] ?? undefined,
|
|
491
|
-
metadata: {
|
|
492
|
-
description: descMatch?.[1]?.trim().slice(0, 200) ?? '',
|
|
493
|
-
sourceFile: file.relativePath,
|
|
494
|
-
allowedRoles,
|
|
495
|
-
},
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
// --- NestJS @AiTool decorated controllers ---
|
|
500
|
-
if (options.nestjsDirs && options.nestjsDirs.length > 0) {
|
|
501
|
-
const { scanNestControllers } = await import('../codegen/index.js');
|
|
502
|
-
const nestResult = await scanNestControllers(options.nestjsDirs, options.nestjsApiPrefix ?? '/api');
|
|
503
|
-
for (const tool of nestResult.tools) {
|
|
504
|
-
tools.push({
|
|
505
|
-
toolId: tool.name,
|
|
506
|
-
version: '1.0.0',
|
|
507
|
-
type: 'endpoint',
|
|
508
|
-
schema: {},
|
|
509
|
-
moduleId: tool.module ?? undefined,
|
|
510
|
-
metadata: {
|
|
511
|
-
description: tool.description?.slice(0, 200) ?? '',
|
|
512
|
-
sourceFile: tool.controllerFile,
|
|
513
|
-
allowedRoles: tool.allowedRoles ?? [],
|
|
514
|
-
...(tool.needsApproval ? { needsApproval: true } : {}),
|
|
515
|
-
},
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
if (tools.length === 0) {
|
|
520
|
-
console.log('No tools found. Run "glirastes generate-tools" first.');
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
const endpointCount = tools.filter(t => t.type === 'endpoint').length;
|
|
524
|
-
const uiCount = tools.filter(t => t.type === 'ui').length;
|
|
525
|
-
// POST to Glirastes Registry
|
|
526
|
-
console.log(`Syncing ${tools.length} tools (${endpointCount} endpoint, ${uiCount} UI) to ${baseUrl}...`);
|
|
527
|
-
const response = await fetch(`${baseUrl}/v1/registry/sync`, {
|
|
528
|
-
method: 'POST',
|
|
529
|
-
headers: {
|
|
530
|
-
'Content-Type': 'application/json',
|
|
531
|
-
Authorization: `Bearer ${apiKey}`,
|
|
532
|
-
},
|
|
533
|
-
body: JSON.stringify({ tools }),
|
|
581
|
+
await runSync({
|
|
582
|
+
rootDir: resolve(getFlagValue(rest, '--root') ?? process.cwd()),
|
|
583
|
+
json: hasFlag(rest, '--json'),
|
|
584
|
+
quiet: hasFlag(rest, '--quiet'),
|
|
585
|
+
}, dependencies.sync);
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
if (command === 'doctor') {
|
|
589
|
+
const report = await createDoctorReport({
|
|
590
|
+
rootDir: resolve(getFlagValue(rest, '--root') ?? process.cwd()),
|
|
591
|
+
managed: hasFlag(rest, '--managed'),
|
|
534
592
|
});
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
console.log(`Synced ${tools.length} tools to Glirastes:`);
|
|
541
|
-
if (result.added.length > 0)
|
|
542
|
-
console.log(` Added: ${result.added.join(', ')}`);
|
|
543
|
-
if (result.updated.length > 0)
|
|
544
|
-
console.log(` Updated: ${result.updated.join(', ')}`);
|
|
545
|
-
if (result.unchanged.length > 0)
|
|
546
|
-
console.log(` Unchanged: ${result.unchanged.length} tools`);
|
|
547
|
-
// Sync module prompts as baseline overrides (optional --meta flag)
|
|
548
|
-
const metaPath = getFlagValue(rest, '--meta');
|
|
549
|
-
if (metaPath) {
|
|
550
|
-
const { readFile } = await import('fs/promises');
|
|
551
|
-
const { resolve } = await import('path');
|
|
552
|
-
const metaFile = resolve(rootDir, metaPath);
|
|
553
|
-
try {
|
|
554
|
-
const metaContent = await readFile(metaFile, 'utf-8');
|
|
555
|
-
// Extract systemPrompt per module from metadata file
|
|
556
|
-
const modulePrompts = [];
|
|
557
|
-
// Match patterns like: moduleId: { ... systemPrompt: `...` }
|
|
558
|
-
const moduleBlocks = metaContent.matchAll(/(\w+)\s*:\s*\{[^}]*systemPrompt\s*:\s*`([^`]+)`/gs);
|
|
559
|
-
for (const match of moduleBlocks) {
|
|
560
|
-
modulePrompts.push({
|
|
561
|
-
moduleId: match[1],
|
|
562
|
-
systemPrompt: match[2].trim(),
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
if (modulePrompts.length > 0) {
|
|
566
|
-
console.log(`\nSyncing ${modulePrompts.length} module prompt baselines...`);
|
|
567
|
-
for (const mp of modulePrompts) {
|
|
568
|
-
const promptRes = await fetch(`${baseUrl}/v1/primus/modules/${encodeURIComponent(mp.moduleId)}/prompt`, {
|
|
569
|
-
method: 'PUT',
|
|
570
|
-
headers: {
|
|
571
|
-
'Content-Type': 'application/json',
|
|
572
|
-
Authorization: `Bearer ${apiKey}`,
|
|
573
|
-
},
|
|
574
|
-
body: JSON.stringify({
|
|
575
|
-
mode: 'replace',
|
|
576
|
-
systemPrompt: mp.systemPrompt,
|
|
577
|
-
}),
|
|
578
|
-
});
|
|
579
|
-
if (promptRes.ok) {
|
|
580
|
-
console.log(` Synced prompt for module: ${mp.moduleId}`);
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
console.warn(` Failed to sync prompt for module: ${mp.moduleId} (${promptRes.status})`);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
catch {
|
|
589
|
-
// Meta file not found or unreadable — skip prompt sync silently
|
|
590
|
-
}
|
|
591
|
-
}
|
|
593
|
+
console.log(hasFlag(rest, '--json')
|
|
594
|
+
? JSON.stringify(report)
|
|
595
|
+
: formatDoctorReport(report, { verbose: hasFlag(rest, '--verbose') }));
|
|
596
|
+
if (report.status === 'fail')
|
|
597
|
+
process.exitCode = 1;
|
|
592
598
|
return;
|
|
593
599
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
return roles;
|
|
610
|
-
}
|
|
611
|
-
function buildAuthStrategy(authType, tokenEnvVar, args) {
|
|
612
|
-
switch (authType) {
|
|
613
|
-
case 'api-key':
|
|
614
|
-
return {
|
|
615
|
-
type: 'api-key',
|
|
616
|
-
headerName: getFlagValue(args, '--header-name') ?? 'X-API-Key',
|
|
617
|
-
keyEnvVar: tokenEnvVar,
|
|
618
|
-
};
|
|
619
|
-
case 'oauth2':
|
|
620
|
-
return {
|
|
621
|
-
type: 'oauth2',
|
|
622
|
-
tokenUrl: getFlagValue(args, '--token-url') ?? '',
|
|
623
|
-
clientIdEnvVar: getFlagValue(args, '--client-id-env') ?? 'OAUTH_CLIENT_ID',
|
|
624
|
-
clientSecretEnvVar: getFlagValue(args, '--client-secret-env') ?? 'OAUTH_CLIENT_SECRET',
|
|
625
|
-
scopes: getFlagValue(args, '--scopes')?.split(','),
|
|
626
|
-
};
|
|
627
|
-
case 'cookie':
|
|
628
|
-
return { type: 'cookie' };
|
|
629
|
-
case 'bearer':
|
|
630
|
-
default:
|
|
631
|
-
return { type: 'bearer', tokenEnvVar };
|
|
600
|
+
if (command === 'validate') {
|
|
601
|
+
await runValidate(rest);
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (command === 'build') {
|
|
605
|
+
await runBuild(rest);
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
if (command === 'install') {
|
|
609
|
+
await runInstall(rest, dependencies);
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
if (command === 'setup') {
|
|
613
|
+
await runSetup(rest, dependencies);
|
|
614
|
+
return;
|
|
632
615
|
}
|
|
616
|
+
await runLegacyScan(rest);
|
|
633
617
|
}
|
|
634
618
|
//# sourceMappingURL=index.js.map
|