@superblocksteam/vite-plugin-file-sync 2.0.160-next.0 → 2.0.161-next.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/dist/ai-service/agent/middleware.d.ts +1 -2
- package/dist/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +2 -3
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +5 -4
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +16 -1
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tool-result-metrics.d.ts +29 -0
- package/dist/ai-service/agent/tool-result-metrics.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-result-metrics.js +162 -0
- package/dist/ai-service/agent/tool-result-metrics.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +50 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +132 -10
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.d.ts +1 -2
- package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.js +2 -0
- package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.d.ts +1 -2
- package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.js +2 -0
- package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts +1 -0
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.js +123 -16
- package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
- package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js +4 -16
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +11 -7
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +18 -9
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +1 -2
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.js +2 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-read-file.js +31 -18
- package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-rename-file.d.ts +1 -2
- package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-rename-file.js +2 -0
- package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.d.ts +1 -2
- package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.js +2 -0
- package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +3 -3
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +5 -7
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -1
- package/dist/ai-service/agent/tools/debug-cache.d.ts +16 -14
- package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/debug-cache.js +200 -42
- package/dist/ai-service/agent/tools/debug-cache.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +13 -13
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js +52 -20
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts +7 -1
- package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/sql-classification.js +229 -11
- package/dist/ai-service/agent/tools/integrations/sql-classification.js.map +1 -1
- package/dist/ai-service/agent/tools/page-edit-guidance.d.ts +2 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.js +11 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.js.map +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +5 -5
- package/dist/ai-service/agent/tools.d.ts +32 -0
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +54 -33
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.js +21 -4
- package/dist/ai-service/agent/tools2/registry.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts +2 -2
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +20 -11
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts +4 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +28 -8
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts +2 -2
- package/dist/ai-service/app-interface/cancellable-exec.d.ts +34 -0
- package/dist/ai-service/app-interface/cancellable-exec.d.ts.map +1 -0
- package/dist/ai-service/app-interface/cancellable-exec.js +98 -0
- package/dist/ai-service/app-interface/cancellable-exec.js.map +1 -0
- package/dist/ai-service/app-interface/shell.d.ts +20 -3
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +139 -65
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/attachment-upload.d.ts.map +1 -1
- package/dist/ai-service/attachment-upload.js +4 -1
- package/dist/ai-service/attachment-upload.js.map +1 -1
- package/dist/ai-service/attachments/parse-data-url.d.ts +5 -0
- package/dist/ai-service/attachments/parse-data-url.d.ts.map +1 -0
- package/dist/ai-service/attachments/parse-data-url.js +14 -0
- package/dist/ai-service/attachments/parse-data-url.js.map +1 -0
- package/dist/ai-service/chat/chat-session-store.d.ts +0 -8
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +34 -611
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/chat/utils.d.ts +2 -6
- package/dist/ai-service/chat/utils.d.ts.map +1 -1
- package/dist/ai-service/chat/utils.js +2 -95
- package/dist/ai-service/chat/utils.js.map +1 -1
- package/dist/ai-service/index.d.ts +3 -2
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +138 -48
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/mention-safe-tag-name.d.ts +12 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.d.ts.map +1 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.js +18 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.js.map +1 -0
- package/dist/ai-service/integrations/store.d.ts +9 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +11 -1
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js +67 -4
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/context-v2/adapter.d.ts +1 -0
- package/dist/ai-service/llm/context-v2/adapter.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/adapter.js +3 -0
- package/dist/ai-service/llm/context-v2/adapter.js.map +1 -1
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts +7 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/compaction/client-side.js +28 -6
- package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -1
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +12 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/compactor.d.ts +8 -0
- package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/compactor.js +15 -3
- package/dist/ai-service/llm/context-v2/compactor.js.map +1 -1
- package/dist/ai-service/llm/context-v2/config.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/config.js +1 -0
- package/dist/ai-service/llm/context-v2/config.js.map +1 -1
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts +44 -1
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context-metrics.js +97 -12
- package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
- package/dist/ai-service/llm/context-v2/context.d.ts +125 -0
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context.js +478 -14
- package/dist/ai-service/llm/context-v2/context.js.map +1 -1
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts +12 -0
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js +2 -1
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js.map +1 -1
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js +3 -3
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js.map +1 -1
- package/dist/ai-service/llm/context-v2/token-tracker.d.ts +49 -1
- package/dist/ai-service/llm/context-v2/token-tracker.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/token-tracker.js +119 -0
- package/dist/ai-service/llm/context-v2/token-tracker.js.map +1 -1
- package/dist/ai-service/llm/context-v2/truncation-fallback.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/truncation-fallback.js +2 -1
- package/dist/ai-service/llm/context-v2/truncation-fallback.js.map +1 -1
- package/dist/ai-service/llm/context-v2/types.d.ts +9 -0
- package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/types.js.map +1 -1
- package/dist/ai-service/llm/context-v2/well-formed-text.d.ts +24 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.js +73 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.js.map +1 -0
- package/dist/ai-service/llm/error.d.ts +22 -1
- package/dist/ai-service/llm/error.d.ts.map +1 -1
- package/dist/ai-service/llm/error.js +159 -22
- package/dist/ai-service/llm/error.js.map +1 -1
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts +4 -3
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.js +5 -4
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.js.map +1 -1
- package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/idle-monitor.js +5 -0
- package/dist/ai-service/llm/stream/idle-monitor.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/logging.d.ts +6 -0
- package/dist/ai-service/llm/stream/observers/logging.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/logging.js +44 -3
- package/dist/ai-service/llm/stream/observers/logging.js.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.js +28 -4
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.js +9 -1
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
- package/dist/ai-service/llm/stream/session.d.ts +6 -0
- package/dist/ai-service/llm/stream/session.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/session.js +6 -0
- package/dist/ai-service/llm/stream/session.js.map +1 -1
- package/dist/ai-service/llm/stream/terminal-reason.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/terminal-reason.js +11 -1
- package/dist/ai-service/llm/stream/terminal-reason.js.map +1 -1
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts +4 -3
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/wait-state-tracker.js +12 -8
- package/dist/ai-service/llm/stream/wait-state-tracker.js.map +1 -1
- package/dist/ai-service/policy-agent-metrics.d.ts +2 -1
- package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
- package/dist/ai-service/policy-agent-metrics.js +11 -2
- package/dist/ai-service/policy-agent-metrics.js.map +1 -1
- package/dist/ai-service/policy-gate-error.d.ts +3 -0
- package/dist/ai-service/policy-gate-error.d.ts.map +1 -0
- package/dist/ai-service/policy-gate-error.js +33 -0
- package/dist/ai-service/policy-gate-error.js.map +1 -0
- package/dist/ai-service/resolve-generation-state-for-ui.js +1 -1
- package/dist/ai-service/resolve-generation-state-for-ui.js.map +1 -1
- package/dist/ai-service/security/secret-scanner-service.d.ts +3 -6
- package/dist/ai-service/security/secret-scanner-service.d.ts.map +1 -1
- package/dist/ai-service/security/secret-scanner-service.js +229 -97
- package/dist/ai-service/security/secret-scanner-service.js.map +1 -1
- package/dist/ai-service/security/secret-scanner.d.ts +28 -5
- package/dist/ai-service/security/secret-scanner.d.ts.map +1 -1
- package/dist/ai-service/security/secret-scanner.js +197 -42
- package/dist/ai-service/security/secret-scanner.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +49 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +2 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +74 -3
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +1 -11
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts +3 -2
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +25 -5
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +4 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.js +6 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
- package/dist/ai-service/test-utils/metrics-harness.d.ts +6 -0
- package/dist/ai-service/test-utils/metrics-harness.d.ts.map +1 -1
- package/dist/ai-service/test-utils/metrics-harness.js.map +1 -1
- package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/shared.js +2 -1
- package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
- package/dist/dev-server-ws-smoke-client.d.ts.map +1 -1
- package/dist/dev-server-ws-smoke-client.js +1 -0
- package/dist/dev-server-ws-smoke-client.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts +21 -0
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +131 -11
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +2 -2
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +2 -12
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/migration-templates/app-fullstack/.gitignore +50 -0
- package/dist/parsing/jsx.d.ts +12 -0
- package/dist/parsing/jsx.d.ts.map +1 -1
- package/dist/parsing/jsx.js +30 -12
- package/dist/parsing/jsx.js.map +1 -1
- package/dist/parsing/page.d.ts.map +1 -1
- package/dist/parsing/page.js +16 -8
- package/dist/parsing/page.js.map +1 -1
- package/dist/parsing/parse-tsx-module.d.ts +4 -0
- package/dist/parsing/parse-tsx-module.d.ts.map +1 -0
- package/dist/parsing/parse-tsx-module.js +13 -0
- package/dist/parsing/parse-tsx-module.js.map +1 -0
- package/dist/plugin-options.d.ts +4 -0
- package/dist/plugin-options.d.ts.map +1 -1
- package/dist/plugin-options.js.map +1 -1
- package/dist/policy-gate-callback-mapper.d.ts +2 -1
- package/dist/policy-gate-callback-mapper.d.ts.map +1 -1
- package/dist/policy-gate-callback-mapper.js +3 -5
- package/dist/policy-gate-callback-mapper.js.map +1 -1
- package/dist/policy-gate-run-registry.d.ts +4 -2
- package/dist/policy-gate-run-registry.d.ts.map +1 -1
- package/dist/policy-gate-run-registry.js +17 -2
- package/dist/policy-gate-run-registry.js.map +1 -1
- package/dist/policy-gate-runner.d.ts +1 -1
- package/dist/policy-gate-runner.d.ts.map +1 -1
- package/dist/policy-gate-runner.js +41 -7
- package/dist/policy-gate-runner.js.map +1 -1
- package/dist/router-parser-metrics.d.ts +2 -0
- package/dist/router-parser-metrics.d.ts.map +1 -0
- package/dist/router-parser-metrics.js +13 -0
- package/dist/router-parser-metrics.js.map +1 -0
- package/dist/router-parser.d.ts +6 -1
- package/dist/router-parser.d.ts.map +1 -1
- package/dist/router-parser.js +72 -17
- package/dist/router-parser.js.map +1 -1
- package/dist/scan-scope-merge.d.ts +1 -1
- package/dist/scan-scope-merge.js +1 -1
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/source-tracker.js +2 -6
- package/dist/source-tracker.js.map +1 -1
- package/dist/sync-service/download.d.ts.map +1 -1
- package/dist/sync-service/download.js +10 -2
- package/dist/sync-service/download.js.map +1 -1
- package/dist/sync-service/index.d.ts +5 -0
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +66 -14
- package/dist/sync-service/index.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +8 -4
- package/dist/sync-service/list-dir.js.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.js +20 -0
- package/dist/sync-service/snapshot/upload-snapshot.js.map +1 -1
- package/dist/util/log-sanitizer.d.ts.map +1 -1
- package/dist/util/log-sanitizer.js +10 -8
- package/dist/util/log-sanitizer.js.map +1 -1
- package/dist/util/logger.d.ts +2 -0
- package/dist/util/logger.d.ts.map +1 -1
- package/dist/util/logger.js +357 -38
- package/dist/util/logger.js.map +1 -1
- package/dist/util.d.ts +3 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +2 -2
- package/dist/util.js.map +1 -1
- package/package.json +9 -9
|
@@ -42,14 +42,17 @@ import JSON5 from "json5";
|
|
|
42
42
|
import { detect, resolveCommand } from "package-manager-detector";
|
|
43
43
|
import semver from "semver";
|
|
44
44
|
import { normalizePath } from "vite";
|
|
45
|
-
import { isProtectedCorePackage } from "@superblocksteam/library-shared/types";
|
|
45
|
+
import { isProtectedCorePackage, isValidNpmPackageName, isValidNpmVersionSpec, } from "@superblocksteam/library-shared/types";
|
|
46
46
|
import { bucketNpmRegistryHost, recordNpmInstall, } from "@superblocksteam/telemetry";
|
|
47
47
|
import { applyPackageJsonSubstitutions, readDeclaredDependencies, } from "../../npm/apply-package-json-substitutions.js";
|
|
48
48
|
import { preparePackageJsonForCloudNpm } from "../../npm/prepare-package-json-for-cloud-npm.js";
|
|
49
|
+
import { parseTsxModule } from "../../parsing/parse-tsx-module.js";
|
|
49
50
|
import { getErrorMeta, getLogger } from "../../util/logger.js";
|
|
51
|
+
import { ToolExecutionError } from "../agent/tools2/types.js";
|
|
50
52
|
import llmobs from "../llmobs/index.js";
|
|
51
53
|
import { fixLucideDynamicTypeImports, isFixableLucidePath, } from "../transform/lucide-dynamic-type-imports/transformer.js";
|
|
52
54
|
import { NpmInstallBlocked, NpmInstallError, scrubSecrets, } from "../types.js";
|
|
55
|
+
import { execCancellable } from "./cancellable-exec.js";
|
|
53
56
|
import { CLARK_APP_BLACKLIST_PATTERNS, APPLICATION_FILE_PATTERNS, STANDARD_IGNORE_PATTERNS, } from "./constants.js";
|
|
54
57
|
import { DraftManager, validateFileOperation, } from "./filesystem/index.js";
|
|
55
58
|
import { Linter } from "./linter.js";
|
|
@@ -86,6 +89,14 @@ function emitIndexUnavailableMetric() {
|
|
|
86
89
|
})
|
|
87
90
|
.add(1);
|
|
88
91
|
}
|
|
92
|
+
function emitWriteTsxParseRejectedMetric(extension) {
|
|
93
|
+
metrics
|
|
94
|
+
.getMeter("superblocks.clark.write")
|
|
95
|
+
.createCounter("superblocks.clark.write.tsx_parse_rejected", {
|
|
96
|
+
description: "Clark write rejected because TypeScript source failed Babel parse",
|
|
97
|
+
})
|
|
98
|
+
.add(1, { extension });
|
|
99
|
+
}
|
|
89
100
|
/**
|
|
90
101
|
* npm `--json` stdout can be prefixed with non-JSON status lines on some
|
|
91
102
|
* versions (`add foo 1.2.3\n{...}`). Slice from the first `{`.
|
|
@@ -272,6 +283,12 @@ let AppShell = (() => {
|
|
|
272
283
|
* The reporter is fire-and-forget — see `maybeReportBlockedInstall`.
|
|
273
284
|
*/
|
|
274
285
|
reportNpmInstallBlocked;
|
|
286
|
+
/**
|
|
287
|
+
* Optional sink for privacy-safe install-gate USER_EVENT reports. One call
|
|
288
|
+
* per gated AppShell install (`install_all` / `install_specific`) with
|
|
289
|
+
* outcome + runner only. Prefetch and uninstall never report.
|
|
290
|
+
*/
|
|
291
|
+
reportNpmInstallOutcome;
|
|
275
292
|
/**
|
|
276
293
|
* Optional deps for the install-time vulnerability index lookup.
|
|
277
294
|
* When absent the malware/CVE gate is skipped (test fixtures / deliberate
|
|
@@ -283,7 +300,7 @@ let AppShell = (() => {
|
|
|
283
300
|
* Used to enforce read-before-write pattern for AI safety.
|
|
284
301
|
*/
|
|
285
302
|
requiredReads = new Set();
|
|
286
|
-
constructor({ appRootDirPath, fsOperationQueue, messageSender, draftInterface, templateRenderer, virtualFileSystem, pathValidator, enableDeletingLockfiles, npmRegistryClient, reportNpmInstallBlocked, packageLookup, }) {
|
|
303
|
+
constructor({ appRootDirPath, fsOperationQueue, messageSender, draftInterface, templateRenderer, virtualFileSystem, pathValidator, enableDeletingLockfiles, npmRegistryClient, reportNpmInstallBlocked, reportNpmInstallOutcome, packageLookup, }) {
|
|
287
304
|
// Normalize path to handle Windows drive letter case
|
|
288
305
|
this.appRootDirPath = normalizePath(appRootDirPath);
|
|
289
306
|
this.fsOperationQueue = fsOperationQueue;
|
|
@@ -298,6 +315,7 @@ let AppShell = (() => {
|
|
|
298
315
|
this.enableDeletingLockfiles = enableDeletingLockfiles ?? false;
|
|
299
316
|
this.npmRegistryClient = npmRegistryClient;
|
|
300
317
|
this.reportNpmInstallBlocked = reportNpmInstallBlocked;
|
|
318
|
+
this.reportNpmInstallOutcome = reportNpmInstallOutcome;
|
|
301
319
|
this.packageLookup = packageLookup;
|
|
302
320
|
}
|
|
303
321
|
/**
|
|
@@ -439,17 +457,15 @@ let AppShell = (() => {
|
|
|
439
457
|
"--tsBuildInfoFile .superblocks/app.tsbuildinfo",
|
|
440
458
|
];
|
|
441
459
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
});
|
|
460
|
+
// execCancellable, not exec: aborting an exec only signals the `/bin/sh`
|
|
461
|
+
// it spawned, leaving `npx` and the `tsc` compiler underneath it running
|
|
462
|
+
// and holding their heap. Cancelled checks therefore never freed memory,
|
|
463
|
+
// and overlapping compilers accumulated until the pod was OOMKilled.
|
|
464
|
+
const output = await execCancellable([command, ...args].join(" "), {
|
|
465
|
+
cwd: this.appRootDirPath,
|
|
466
|
+
signal: abortSignal,
|
|
450
467
|
});
|
|
451
|
-
|
|
452
|
-
if (!output || typeof output !== "string") {
|
|
468
|
+
if (!output) {
|
|
453
469
|
return null;
|
|
454
470
|
}
|
|
455
471
|
return output;
|
|
@@ -708,7 +724,7 @@ let AppShell = (() => {
|
|
|
708
724
|
/**
|
|
709
725
|
* Emit one `superblocks.npm.install.*` observation (APPS-4189 / P6.2) and
|
|
710
726
|
* annotate the active llmobs span with the same dimensions. Shared by
|
|
711
|
-
* every `AppShell
|
|
727
|
+
* every `AppShell` install and uninstall method so metric and span streams join on
|
|
712
728
|
* (runner, registry_host, outcome) without drift. Every value flows
|
|
713
729
|
* through the P6.1 sanitization helpers inside `recordNpmInstall`, so a
|
|
714
730
|
* raw registry hostname or token cannot reach an exported attribute even
|
|
@@ -733,6 +749,24 @@ let AppShell = (() => {
|
|
|
733
749
|
"npm.ignore_scripts_appended": String(shouldIgnoreInstallScripts(registryFetchResult)),
|
|
734
750
|
},
|
|
735
751
|
});
|
|
752
|
+
this.maybeReportInstallOutcome(runner, tags["npm.outcome"]);
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Report a gated install outcome for Snowflake USER_EVENTs. Only
|
|
756
|
+
* `install_all` and `install_specific` run the vulnerability gate.
|
|
757
|
+
* Fire-and-forget: a reporting failure must never break the install.
|
|
758
|
+
*/
|
|
759
|
+
maybeReportInstallOutcome(runner, outcome) {
|
|
760
|
+
if (runner !== "install_all" && runner !== "install_specific")
|
|
761
|
+
return;
|
|
762
|
+
if (!this.reportNpmInstallOutcome)
|
|
763
|
+
return;
|
|
764
|
+
try {
|
|
765
|
+
this.reportNpmInstallOutcome({ outcome, runner });
|
|
766
|
+
}
|
|
767
|
+
catch {
|
|
768
|
+
// USER_EVENT reporting is best-effort and must not affect the install.
|
|
769
|
+
}
|
|
736
770
|
}
|
|
737
771
|
/**
|
|
738
772
|
* Report a blocked controlled install to the server-side audit trail
|
|
@@ -1571,6 +1605,20 @@ let AppShell = (() => {
|
|
|
1571
1605
|
if (!packages || packages.length === 0) {
|
|
1572
1606
|
throw new Error("No packages specified for installation");
|
|
1573
1607
|
}
|
|
1608
|
+
// Specs are interpolated into a command string that `/bin/sh -c` parses,
|
|
1609
|
+
// so the name and version guards belong here rather than in each caller.
|
|
1610
|
+
const invalidRequested = packages
|
|
1611
|
+
.map((pkg) => pkg.name)
|
|
1612
|
+
.filter((name) => !isValidNpmPackageName(name));
|
|
1613
|
+
if (invalidRequested.length > 0) {
|
|
1614
|
+
throw new Error(`Invalid package name(s): ${invalidRequested.join(", ")}.`);
|
|
1615
|
+
}
|
|
1616
|
+
const invalidVersions = packages
|
|
1617
|
+
.filter((pkg) => pkg.version !== undefined && !isValidNpmVersionSpec(pkg.version))
|
|
1618
|
+
.map((pkg) => pkg.name);
|
|
1619
|
+
if (invalidVersions.length > 0) {
|
|
1620
|
+
throw new Error(`Invalid package version(s) for: ${invalidVersions.join(", ")}.`);
|
|
1621
|
+
}
|
|
1574
1622
|
const installStart = Date.now();
|
|
1575
1623
|
let outcome = "success";
|
|
1576
1624
|
let capturedFetchResult;
|
|
@@ -1711,6 +1759,10 @@ let AppShell = (() => {
|
|
|
1711
1759
|
}
|
|
1712
1760
|
}
|
|
1713
1761
|
async uninstallPackages(packages, options) {
|
|
1762
|
+
const invalidRequested = packages.filter((name) => !isValidNpmPackageName(name));
|
|
1763
|
+
if (invalidRequested.length > 0) {
|
|
1764
|
+
throw new Error(`Invalid package name(s): ${invalidRequested.join(", ")}.`);
|
|
1765
|
+
}
|
|
1714
1766
|
// Core-package guard (APPS-4527): refuse to uninstall packages the
|
|
1715
1767
|
// platform itself depends on (`@superblocksteam/*`, react, react-router,
|
|
1716
1768
|
// vite, …). Removing one breaks the dev server, the bundle builder, or
|
|
@@ -1721,6 +1773,9 @@ let AppShell = (() => {
|
|
|
1721
1773
|
throw new Error(`Refusing to uninstall protected core package(s): ${protectedRequested.join(", ")}. ` +
|
|
1722
1774
|
"These are required by the Superblocks platform (dev server, build pipeline, or app runtime) and must remain in the app.");
|
|
1723
1775
|
}
|
|
1776
|
+
const installStart = Date.now();
|
|
1777
|
+
let outcome = "success";
|
|
1778
|
+
let capturedFetchResult;
|
|
1724
1779
|
// Uninstalls hit the same registry resolution rules as installs (the
|
|
1725
1780
|
// dependency-tree solver re-reifies the remaining tree and can re-fetch
|
|
1726
1781
|
// metadata), so they run through the SAME safety wrapper as every
|
|
@@ -1746,56 +1801,67 @@ let AppShell = (() => {
|
|
|
1746
1801
|
// `shouldIgnoreInstallScripts` honours the org's `allowInstallScripts`
|
|
1747
1802
|
// policy on uninstall too — `preuninstall` / `postuninstall` lifecycle
|
|
1748
1803
|
// scripts are just as dangerous as install-time ones.
|
|
1749
|
-
|
|
1750
|
-
this.
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1804
|
+
try {
|
|
1805
|
+
return await this.withAuthFailedRetry(async (registryFetchResult) => {
|
|
1806
|
+
capturedFetchResult = registryFetchResult;
|
|
1807
|
+
this.maybeShortCircuitForUnreachable(registryFetchResult, packages);
|
|
1808
|
+
const ignoreScripts = shouldIgnoreInstallScripts(registryFetchResult);
|
|
1809
|
+
// pnpm in local dev (avoids store/lockfile conflicts with the
|
|
1810
|
+
// surrounding workspace); npm everywhere else so the `--json` error
|
|
1811
|
+
// contract — and therefore the registry-blocked advice matrix —
|
|
1812
|
+
// applies. Mirrors `runNpmInstall` / `installSpecificPackages`.
|
|
1813
|
+
const isNpm = process.env.SUPERBLOCKS_SERVER_ENV !== "local";
|
|
1814
|
+
const packageManager = isNpm ? "npm" : "pnpm";
|
|
1815
|
+
const uninstallCmd = isNpm ? "uninstall" : "remove";
|
|
1816
|
+
const jsonFlag = isNpm ? " --json" : "";
|
|
1817
|
+
const baseCommand = `${packageManager} ${uninstallCmd} ${packages.join(" ")}${jsonFlag}`;
|
|
1818
|
+
const command = ignoreScripts
|
|
1819
|
+
? `${baseCommand} --ignore-scripts`
|
|
1820
|
+
: baseCommand;
|
|
1821
|
+
return await new Promise((resolve, reject) => {
|
|
1822
|
+
exec(command, {
|
|
1823
|
+
cwd: this.appRootDirPath,
|
|
1824
|
+
env: this.installLogEnv(),
|
|
1825
|
+
timeout: 30_000,
|
|
1826
|
+
signal: options?.abortSignal,
|
|
1827
|
+
// `--json` summary can outgrow the default 1 MiB exec buffer.
|
|
1828
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
1829
|
+
}, (error, stdout, stderr) => {
|
|
1830
|
+
if (error) {
|
|
1831
|
+
// Same classifier as the install paths: a registry block
|
|
1832
|
+
// (E404 / E401 / ENOTFOUND, ...) becomes a structured
|
|
1833
|
+
// `NpmInstallBlocked` (with row-aware advice + the
|
|
1834
|
+
// auth-failed retry signal consumed by `withAuthFailedRetry`);
|
|
1835
|
+
// anything else falls back to the legacy `NpmInstallError`.
|
|
1836
|
+
// pnpm doesn't emit the `--json` envelope, so it keeps the
|
|
1837
|
+
// raw-stderr error.
|
|
1838
|
+
if (isNpm) {
|
|
1839
|
+
return reject(this.classifyNpmExecError({ stdout, stderr, message: error.message }, undefined, registryFetchResult));
|
|
1840
|
+
}
|
|
1841
|
+
return reject(new NpmInstallError(stderr || error.message));
|
|
1783
1842
|
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
stderr,
|
|
1843
|
+
// On the npm path stdout is a `--json` blob; collapse it to a
|
|
1844
|
+
// compact human-readable summary (same as
|
|
1845
|
+
// `installSpecificPackages`), falling back to raw stdout on
|
|
1846
|
+
// shape drift.
|
|
1847
|
+
return resolve({
|
|
1848
|
+
stdout: isNpm
|
|
1849
|
+
? (parseNpmJsonSuccess(stdout) ?? stdout)
|
|
1850
|
+
: stdout,
|
|
1851
|
+
stderr,
|
|
1852
|
+
});
|
|
1795
1853
|
});
|
|
1796
1854
|
});
|
|
1797
1855
|
});
|
|
1798
|
-
}
|
|
1856
|
+
}
|
|
1857
|
+
catch (err) {
|
|
1858
|
+
outcome = outcomeFromInstallError(err);
|
|
1859
|
+
this.maybeReportBlockedInstall(err, "uninstall");
|
|
1860
|
+
throw err;
|
|
1861
|
+
}
|
|
1862
|
+
finally {
|
|
1863
|
+
this.observeNpmInstall("uninstall", capturedFetchResult, outcome, Date.now() - installStart);
|
|
1864
|
+
}
|
|
1799
1865
|
}
|
|
1800
1866
|
static MAX_GENERATION_RUNS = 10;
|
|
1801
1867
|
async saveGeneratedArtifact(artifact, stepId, runTimestamp) {
|
|
@@ -1999,21 +2065,29 @@ let AppShell = (() => {
|
|
|
1999
2065
|
if (Buffer.isBuffer(content) && isVirtual) {
|
|
2000
2066
|
throw new Error(`Cannot write binary content to virtual file: ${relativePath}`);
|
|
2001
2067
|
}
|
|
2002
|
-
|
|
2068
|
+
if (!isVirtual) {
|
|
2069
|
+
validateFileOperation("write", relativePath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2070
|
+
if (relativePath.endsWith(".ts") || relativePath.endsWith(".tsx")) {
|
|
2071
|
+
try {
|
|
2072
|
+
parseTsxModule(typeof content === "string" ? content : content.toString("utf8"), relativePath);
|
|
2073
|
+
}
|
|
2074
|
+
catch (error) {
|
|
2075
|
+
getLogger().warn(`TSX parse validation rejected write: ${relativePath}`, getErrorMeta(error));
|
|
2076
|
+
emitWriteTsxParseRejectedMetric(relativePath.endsWith(".tsx") ? "tsx" : "ts");
|
|
2077
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2078
|
+
throw new ToolExecutionError(`${relativePath}: ${message}`);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2003
2082
|
if (isVirtual) {
|
|
2004
2083
|
await this.virtualFs.write(relativePath, content, {
|
|
2005
2084
|
appRootDirPath: this.appRootDirPath,
|
|
2006
2085
|
});
|
|
2007
|
-
// Also create a draft marker for the virtual path
|
|
2008
2086
|
await this.draftManager.createDraftMarker(relativePath);
|
|
2009
2087
|
return;
|
|
2010
2088
|
}
|
|
2011
|
-
// Validate the operation for non-virtual files
|
|
2012
|
-
validateFileOperation("write", relativePath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2013
|
-
// Ensure parent directory exists
|
|
2014
2089
|
const absolutePath = path.join(this.appRootDirPath, relativePath);
|
|
2015
2090
|
await mkdir(path.dirname(absolutePath), { recursive: true });
|
|
2016
|
-
// Create draft (this queues internally via draftInterface)
|
|
2017
2091
|
await this.draftManager.createDraft(relativePath, content);
|
|
2018
2092
|
}
|
|
2019
2093
|
resolveAppRelativePath(relativePath, direction) {
|