@superblocksteam/vite-plugin-file-sync 2.0.123 → 2.0.124-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/prompts/build-base-system-prompt.d.ts +16 -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 +27 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +3 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-comparator.js +1 -4
- package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-testing-state.js +7 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +1 -1
- package/dist/ai-service/agent/tools/apis/write-api.d.ts +2 -2
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-capture-screenshot.js +11 -33
- package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +11 -2
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts +41 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.js +208 -0
- 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 +28 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js +78 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js.map +1 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +4 -4
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts +16 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.js +68 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.js.map +1 -0
- package/dist/ai-service/agent/tools/build-write-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts +9 -9
- package/dist/ai-service/agent/tools/index.d.ts +2 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +2 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +3 -3
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +11 -5
- package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/report-security-findings.js +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -1
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +3 -1
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.d.ts +2 -2
- package/dist/ai-service/agent/tools2/tools/grep.d.ts +2 -2
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts +2 -2
- package/dist/ai-service/app-interface/npm-error-parser.d.ts +161 -0
- package/dist/ai-service/app-interface/npm-error-parser.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-error-parser.js +510 -0
- package/dist/ai-service/app-interface/npm-error-parser.js.map +1 -0
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts +286 -0
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-package-lookup.js +793 -0
- package/dist/ai-service/app-interface/npm-package-lookup.js.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts +735 -47
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -1
- package/dist/ai-service/app-interface/npm-registry.js +1882 -153
- package/dist/ai-service/app-interface/npm-registry.js.map +1 -1
- package/dist/ai-service/app-interface/shell.d.ts +118 -1
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +579 -157
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/app-skills/manager.d.ts +1 -1
- package/dist/ai-service/app-skills/manager.d.ts.map +1 -1
- package/dist/ai-service/app-skills/manager.js +39 -7
- package/dist/ai-service/app-skills/manager.js.map +1 -1
- package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts +9 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts.map +1 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.js +30 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.js.map +1 -0
- package/dist/ai-service/checklist/api-migration-origins.d.ts +4 -0
- package/dist/ai-service/checklist/api-migration-origins.d.ts.map +1 -0
- package/dist/ai-service/checklist/api-migration-origins.js +8 -0
- package/dist/ai-service/checklist/api-migration-origins.js.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +2 -3
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -1
- package/dist/ai-service/checklist/persisted-checklist-store.js +6 -7
- package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -1
- package/dist/ai-service/context-archive-paths.d.ts +4 -0
- package/dist/ai-service/context-archive-paths.d.ts.map +1 -0
- package/dist/ai-service/context-archive-paths.js +28 -0
- package/dist/ai-service/context-archive-paths.js.map +1 -0
- package/dist/ai-service/context-download.d.ts +3 -1
- package/dist/ai-service/context-download.d.ts.map +1 -1
- package/dist/ai-service/context-download.js +48 -9
- package/dist/ai-service/context-download.js.map +1 -1
- package/dist/ai-service/context-upload.d.ts +3 -2
- package/dist/ai-service/context-upload.d.ts.map +1 -1
- package/dist/ai-service/context-upload.js +44 -26
- package/dist/ai-service/context-upload.js.map +1 -1
- package/dist/ai-service/dev-database-client.d.ts +3 -11
- package/dist/ai-service/dev-database-client.d.ts.map +1 -1
- package/dist/ai-service/dev-database-client.js.map +1 -1
- package/dist/ai-service/features.d.ts +4 -0
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +8 -0
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts.map +1 -1
- package/dist/ai-service/filter-disabled-tools-for-migration.js +4 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -1
- package/dist/ai-service/index.d.ts +94 -0
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +564 -17
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/llm/client.d.ts +38 -3
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js +73 -22
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/context-v2/adapter.d.ts +3 -1
- package/dist/ai-service/llm/context-v2/adapter.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/adapter.js +11 -11
- package/dist/ai-service/llm/context-v2/adapter.js.map +1 -1
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts +44 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.js +170 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +56 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.js +9 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/index.d.ts +5 -0
- package/dist/ai-service/llm/context-v2/compaction/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/index.js +3 -0
- package/dist/ai-service/llm/context-v2/compaction/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts +30 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.js +130 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context-management.d.ts +203 -0
- package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context-management.js +183 -0
- package/dist/ai-service/llm/context-v2/context-management.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context.d.ts +64 -22
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context.js +233 -157
- package/dist/ai-service/llm/context-v2/context.js.map +1 -1
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts +24 -7
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/conversation-context.js +1 -1
- package/dist/ai-service/llm/context-v2/index.d.ts +0 -4
- package/dist/ai-service/llm/context-v2/index.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/index.js +0 -4
- package/dist/ai-service/llm/context-v2/index.js.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts +24 -3
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.js +146 -4
- package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.d.ts +2 -7
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.js +5 -73
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.js.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/event-store.d.ts +57 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.js +10 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts +50 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.js +10 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts +87 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js +184 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts +49 -0
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/migration.js +126 -0
- package/dist/ai-service/llm/context-v2/storage/migration.js.map +1 -0
- package/dist/ai-service/llm/context-v2/types.d.ts +16 -11
- package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/types.js +2 -2
- package/dist/ai-service/llm/context-v2/types.js.map +1 -1
- package/dist/ai-service/llm/impl/clark.d.ts +8 -0
- package/dist/ai-service/llm/impl/clark.d.ts.map +1 -1
- package/dist/ai-service/llm/impl/clark.js +8 -0
- package/dist/ai-service/llm/impl/clark.js.map +1 -1
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts.map +1 -1
- package/dist/ai-service/llm/interaction/adapters/vercel.js +17 -1
- package/dist/ai-service/llm/interaction/adapters/vercel.js.map +1 -1
- package/dist/ai-service/llm/provider.d.ts.map +1 -1
- package/dist/ai-service/llm/provider.js +1 -3
- package/dist/ai-service/llm/provider.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/context.d.ts +23 -0
- package/dist/ai-service/llm/stream/observers/context.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/context.js +62 -0
- package/dist/ai-service/llm/stream/observers/context.js.map +1 -1
- package/dist/ai-service/llm/tool-context-integrity.d.ts +25 -0
- package/dist/ai-service/llm/tool-context-integrity.d.ts.map +1 -0
- package/dist/ai-service/llm/tool-context-integrity.js +141 -0
- package/dist/ai-service/llm/tool-context-integrity.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +6 -1
- package/dist/ai-service/skills/system/superblocks-migration/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 +3 -2
- 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 +23 -2
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +37 -2
- package/dist/ai-service/state-machine/clark-fsm.js.map +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 +29 -2
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +9 -0
- package/dist/ai-service/state-machine/handlers/awaiting-user.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 +25 -2
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts +6 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js +36 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +30 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.js +85 -2
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts +8 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.js +11 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.js.map +1 -0
- package/dist/ai-service/template-renderer.d.ts +18 -1
- package/dist/ai-service/template-renderer.d.ts.map +1 -1
- package/dist/ai-service/template-renderer.js +73 -12
- package/dist/ai-service/template-renderer.js.map +1 -1
- package/dist/ai-service/types.d.ts +157 -0
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js +137 -0
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/llm-config-utils.d.ts +21 -22
- package/dist/ai-service/util/llm-config-utils.d.ts.map +1 -1
- package/dist/ai-service/util/llm-config-utils.js +40 -67
- package/dist/ai-service/util/llm-config-utils.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +5 -0
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +17 -0
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +22 -0
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/git-service/index.d.ts.map +1 -1
- package/dist/git-service/index.js +15 -1
- package/dist/git-service/index.js.map +1 -1
- package/dist/migration/migration-routes.d.ts.map +1 -1
- package/dist/migration/migration-routes.js +26 -3
- package/dist/migration/migration-routes.js.map +1 -1
- package/dist/migration/translation-prompt.d.ts.map +1 -1
- package/dist/migration/translation-prompt.js +5 -0
- package/dist/migration/translation-prompt.js.map +1 -1
- package/dist/migration-templates/app-fullstack/package.json +2 -2
- package/dist/policy-gate-callback-mapper.d.ts +24 -0
- package/dist/policy-gate-callback-mapper.d.ts.map +1 -0
- package/dist/policy-gate-callback-mapper.js +61 -0
- package/dist/policy-gate-callback-mapper.js.map +1 -0
- package/dist/policy-gate-runner.d.ts +32 -0
- package/dist/policy-gate-runner.d.ts.map +1 -0
- package/dist/policy-gate-runner.js +191 -0
- package/dist/policy-gate-runner.js.map +1 -0
- package/dist/router-parser.d.ts.map +1 -1
- package/dist/router-parser.js +107 -11
- package/dist/router-parser.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +13 -3
- package/dist/sync-service/list-dir.js.map +1 -1
- package/package.json +28 -10
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NpmInstallBlocked, scrubSecrets } from "../types.js";
|
|
3
|
+
/** OpenSSL-style codes Node surfaces on TLS failures. npm v10 propagates these
|
|
4
|
+
* directly into `error.code`; older npm (and pnpm's wrappers) often drop the
|
|
5
|
+
* code and leave only the canonical phrase in the message, so we ALSO scan
|
|
6
|
+
* text — see `detectReasonFromText`. */
|
|
7
|
+
const TLS_ERROR_CODES = new Set([
|
|
8
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
9
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
10
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
11
|
+
"CERT_HAS_EXPIRED",
|
|
12
|
+
"CERT_NOT_YET_VALID",
|
|
13
|
+
"CERT_UNTRUSTED",
|
|
14
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
15
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
16
|
+
]);
|
|
17
|
+
/** Canonical OpenSSL / Node phrases that appear in npm and pnpm error
|
|
18
|
+
* messages when TLS verification fails. Anchored loosely (case-insensitive)
|
|
19
|
+
* because the casing and surrounding punctuation differ across npm versions,
|
|
20
|
+
* pnpm reporters, and Node releases. */
|
|
21
|
+
const TLS_PHRASE_REGEX = /unable to verify (?:the first certificate|leaf signature)|self.signed certificate|certificate has expired|cert has expired|unable to get (?:local )?issuer certificate/i;
|
|
22
|
+
/** Phrases that indicate an HTTP proxy is in the request path and failing.
|
|
23
|
+
* `tunneling socket could not be established` is Node's http-proxy-agent
|
|
24
|
+
* CONNECT-tunnel rejection (often paired with `statusCode=407`); `ProxyError`
|
|
25
|
+
* is the wrapper some proxy stacks emit. Detecting any of these flips the
|
|
26
|
+
* subreason to `proxy` even when the outer code is a generic network reject —
|
|
27
|
+
* the operator's next step is "check the proxy config", not "check the
|
|
28
|
+
* firewall". */
|
|
29
|
+
const PROXY_PHRASE_REGEX = /tunneling socket could not be established|statusCode=407|ProxyError:|could not connect to proxy/i;
|
|
30
|
+
/** Node syscall-error codes that surface as bare tokens in the wrapped
|
|
31
|
+
* message (npm's `network request to … failed, reason: connect ECONNREFUSED
|
|
32
|
+
* …` shape; pnpm's `ERR_PNPM_META_FETCH_FAIL] GET …: getaddrinfo ENOTFOUND
|
|
33
|
+
* …` shape). Grouped by the operator-actionable subreason so the regex set
|
|
34
|
+
* matches the bucket directly. */
|
|
35
|
+
const DNS_CODE_REGEX = /\b(?:ENOTFOUND|EAI_AGAIN)\b/;
|
|
36
|
+
const TIMEOUT_CODE_REGEX = /\b(?:ETIMEDOUT|ESOCKETTIMEDOUT)\b/;
|
|
37
|
+
const NETWORK_CODE_REGEX = /\b(?:ECONNREFUSED|ECONNRESET|ENETUNREACH)\b/;
|
|
38
|
+
/** Scan a free-text blob (`error.summary + error.detail`, or the full stderr
|
|
39
|
+
* buffer) for the narrowest reason signal we can derive. TLS and proxy
|
|
40
|
+
* phrases beat the code-based mapping because both can masquerade behind a
|
|
41
|
+
* generic network code — npm reports `ECONNRESET` for a 407'd proxy tunnel,
|
|
42
|
+
* for instance, and falling back to the code alone would give the operator
|
|
43
|
+
* "check the firewall" guidance for a proxy-config problem. The Node-code
|
|
44
|
+
* fallback inside this same function handles pnpm's `ERR_PNPM_META_FETCH_FAIL`
|
|
45
|
+
* wrapping path, where the outer envelope carries no subreason at all. */
|
|
46
|
+
function detectReasonFromText(text) {
|
|
47
|
+
if (!text)
|
|
48
|
+
return null;
|
|
49
|
+
if (TLS_PHRASE_REGEX.test(text))
|
|
50
|
+
return { reason: "tls_failed" };
|
|
51
|
+
if (PROXY_PHRASE_REGEX.test(text))
|
|
52
|
+
return { reason: "registry_unreachable", subreason: "proxy" };
|
|
53
|
+
if (DNS_CODE_REGEX.test(text))
|
|
54
|
+
return { reason: "registry_unreachable", subreason: "dns" };
|
|
55
|
+
if (TIMEOUT_CODE_REGEX.test(text))
|
|
56
|
+
return { reason: "registry_unreachable", subreason: "timeout" };
|
|
57
|
+
if (NETWORK_CODE_REGEX.test(text))
|
|
58
|
+
return { reason: "registry_unreachable", subreason: "network" };
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
/** Pick the narrower of a code-derived and a text-derived signal. Text wins
|
|
62
|
+
* for the two cases where it's strictly more specific than any code-based
|
|
63
|
+
* mapping can be:
|
|
64
|
+
*
|
|
65
|
+
* - TLS (often arrives under a generic network code; the canonical phrase
|
|
66
|
+
* in the message is the only reliable discriminator)
|
|
67
|
+
* - proxy subreason (the underlying socket code is whichever leg of the
|
|
68
|
+
* CONNECT exchange failed — usually ECONNRESET/ECONNREFUSED — but the
|
|
69
|
+
* operator-actionable signal is the proxy phrase)
|
|
70
|
+
*
|
|
71
|
+
* Outside those two cases, the code mapping is authoritative; we only fall
|
|
72
|
+
* through to text when the code mapping returned nothing (e.g. pnpm
|
|
73
|
+
* `META_FETCH_FAIL` carries no subreason; npm generic `EFETCH` carries no
|
|
74
|
+
* reason at all). When both signals agree on the reason but only text has a
|
|
75
|
+
* subreason, fold the subreason in so callers still get the narrower bucket. */
|
|
76
|
+
function pickSignal(fromCode, fromText) {
|
|
77
|
+
if (fromText?.reason === "tls_failed")
|
|
78
|
+
return fromText;
|
|
79
|
+
if (fromText?.subreason === "proxy")
|
|
80
|
+
return fromText;
|
|
81
|
+
if (!fromCode)
|
|
82
|
+
return fromText;
|
|
83
|
+
if (fromText?.reason === fromCode.reason && !fromCode.subreason) {
|
|
84
|
+
return { ...fromCode, subreason: fromText.subreason };
|
|
85
|
+
}
|
|
86
|
+
return fromCode;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Parser + zod schemas for npm's `--json` output.
|
|
90
|
+
*
|
|
91
|
+
* npm's JSON output is documented as "experimental" and has shifted across
|
|
92
|
+
* major versions, so every parse here is `safeParse` with a fall-back to the
|
|
93
|
+
* legacy stderr-based `NpmInstallError`. The shape we depend on (observed
|
|
94
|
+
* across npm v9 / v10):
|
|
95
|
+
*
|
|
96
|
+
* Error path (exit ≠ 0): stdout = { error: { code, summary, detail } }
|
|
97
|
+
* Success path (exit = 0): stdout = { added, removed, changed, audited, ... }
|
|
98
|
+
*
|
|
99
|
+
* We intentionally use `.passthrough()` everywhere so additional fields don't
|
|
100
|
+
* break parsing — we only assert on the fields we depend on.
|
|
101
|
+
*/
|
|
102
|
+
const NpmJsonErrorSchema = z
|
|
103
|
+
.object({
|
|
104
|
+
error: z
|
|
105
|
+
.object({
|
|
106
|
+
code: z.string().optional(),
|
|
107
|
+
summary: z.string().optional(),
|
|
108
|
+
detail: z.string().optional(),
|
|
109
|
+
})
|
|
110
|
+
.passthrough(),
|
|
111
|
+
})
|
|
112
|
+
.passthrough();
|
|
113
|
+
const NpmJsonSuccessSchema = z
|
|
114
|
+
.object({
|
|
115
|
+
added: z.number().optional(),
|
|
116
|
+
removed: z.number().optional(),
|
|
117
|
+
changed: z.number().optional(),
|
|
118
|
+
audited: z.number().optional(),
|
|
119
|
+
})
|
|
120
|
+
.passthrough();
|
|
121
|
+
/** Map an npm error `code` to our structured reason. Returns null when the
|
|
122
|
+
* code does not correspond to a registry-blocked condition (e.g. EJSONPARSE,
|
|
123
|
+
* ETARGET); callers fall back to the legacy `NpmInstallError`. Network codes
|
|
124
|
+
* carry a `subreason` that narrows them to the operator-actionable bucket
|
|
125
|
+
* (DNS vs TCP-level reject vs timeout); the text-side classifier
|
|
126
|
+
* (`detectReasonFromText`) provides the `proxy` subreason because the proxy
|
|
127
|
+
* signal arrives in the message, not the code. */
|
|
128
|
+
function mapCodeToReason(code) {
|
|
129
|
+
if (!code)
|
|
130
|
+
return null;
|
|
131
|
+
// TLS codes get their own reason — Node surfaces these directly on modern
|
|
132
|
+
// npm; older npm puts the canonical phrase in `summary` instead, which the
|
|
133
|
+
// text classifier picks up.
|
|
134
|
+
if (TLS_ERROR_CODES.has(code))
|
|
135
|
+
return { reason: "tls_failed" };
|
|
136
|
+
switch (code) {
|
|
137
|
+
case "E404":
|
|
138
|
+
return { reason: "not_in_registry" };
|
|
139
|
+
// E401/E403 are the HTTP-shaped auth failures. The EAUTH family covers
|
|
140
|
+
// npm's older / non-HTTP-shaped rejection paths (legacy basic-auth,
|
|
141
|
+
// IP-pinned tokens, opaque failures), and EOTP fires when the registry
|
|
142
|
+
// demands a second factor. Treat all as one reason — the agent-facing
|
|
143
|
+
// guidance ("admin must fix the registry token") fits every variant.
|
|
144
|
+
case "E401":
|
|
145
|
+
case "E403":
|
|
146
|
+
case "EAUTH":
|
|
147
|
+
case "EAUTHIP":
|
|
148
|
+
case "EAUTHUNKNOWN":
|
|
149
|
+
case "EOTP":
|
|
150
|
+
return { reason: "registry_auth_failed" };
|
|
151
|
+
case "ENOTFOUND":
|
|
152
|
+
case "EAI_AGAIN":
|
|
153
|
+
return { reason: "registry_unreachable", subreason: "dns" };
|
|
154
|
+
case "ECONNREFUSED":
|
|
155
|
+
case "ECONNRESET":
|
|
156
|
+
case "ENETUNREACH":
|
|
157
|
+
return { reason: "registry_unreachable", subreason: "network" };
|
|
158
|
+
case "ETIMEDOUT":
|
|
159
|
+
case "ESOCKETTIMEDOUT":
|
|
160
|
+
return { reason: "registry_unreachable", subreason: "timeout" };
|
|
161
|
+
default:
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** Extract the URL from an npm error summary, e.g.
|
|
166
|
+
* "Not Found - GET https://registry.npmjs.org/foo - Not found"
|
|
167
|
+
* "request to https://host.invalid/foo failed, reason: ENOTFOUND ..." */
|
|
168
|
+
function extractUrl(summary) {
|
|
169
|
+
if (!summary)
|
|
170
|
+
return null;
|
|
171
|
+
const match = summary.match(/https?:\/\/[^\s)]+/);
|
|
172
|
+
if (!match)
|
|
173
|
+
return null;
|
|
174
|
+
try {
|
|
175
|
+
return new URL(match[0]);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** Extract the package spec (e.g. "react@^18") from an npm E404 detail line:
|
|
182
|
+
* "The requested resource 'react@^18' could not be found ..." */
|
|
183
|
+
function extractPackageFromDetail(detail) {
|
|
184
|
+
if (!detail)
|
|
185
|
+
return null;
|
|
186
|
+
const match = detail.match(/'([^']+)'/);
|
|
187
|
+
return match?.[1] ?? null;
|
|
188
|
+
}
|
|
189
|
+
/** Extract numeric HTTP status from an npm error summary line:
|
|
190
|
+
* "Not Found - GET https://... - Not found" → null (npm doesn't emit it directly)
|
|
191
|
+
* The code field is more reliable; we infer status from code instead. */
|
|
192
|
+
function inferHttpStatus(code) {
|
|
193
|
+
switch (code) {
|
|
194
|
+
case "E404":
|
|
195
|
+
return 404;
|
|
196
|
+
case "E401":
|
|
197
|
+
return 401;
|
|
198
|
+
case "E403":
|
|
199
|
+
return 403;
|
|
200
|
+
default:
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** Map a pnpm `FetchError` HTTP status (extracted from `ERR_PNPM_FETCH_<NNN>`)
|
|
205
|
+
* to our structured reason. Mirrors `mapCodeToReason` for the npm path:
|
|
206
|
+
*
|
|
207
|
+
* 401 / 403 → registry_auth_failed (HTTP-shaped auth failure)
|
|
208
|
+
* 404 → not_in_registry (pnpm's own hint notes 404 doubles as
|
|
209
|
+
* "no permission to fetch" for registries
|
|
210
|
+
* that mask auth failures as 404)
|
|
211
|
+
* 5xx → registry_unreachable (registry returned an error response)
|
|
212
|
+
*
|
|
213
|
+
* Returns null for non-mapped statuses (e.g. 3xx redirects pnpm gives up on)
|
|
214
|
+
* so callers fall back to the legacy unstructured path. */
|
|
215
|
+
function mapFetchStatusToReason(status) {
|
|
216
|
+
if (status === 401 || status === 403)
|
|
217
|
+
return "registry_auth_failed";
|
|
218
|
+
if (status === 404)
|
|
219
|
+
return "not_in_registry";
|
|
220
|
+
if (status >= 500 && status < 600)
|
|
221
|
+
return "registry_unreachable";
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
/** Map a pnpm error code (the suffix after `ERR_PNPM_`) to our structured
|
|
225
|
+
* reason. pnpm's emitted codes are:
|
|
226
|
+
*
|
|
227
|
+
* FETCH_<NNN> → routed through `mapFetchStatusToReason` (HTTP-shaped)
|
|
228
|
+
* META_FETCH_FAIL → registry_unreachable. pnpm wraps the underlying Node
|
|
229
|
+
* error (`getaddrinfo ENOTFOUND ...`, `connect ECONNREFUSED
|
|
230
|
+
* ...`) in the message; the reason is always "couldn't
|
|
231
|
+
* reach the registry" regardless of which Node code
|
|
232
|
+
* surfaced, so we don't need to parse the embedded code.
|
|
233
|
+
*
|
|
234
|
+
* Returns null for codes outside the registry-blocked surface (e.g.
|
|
235
|
+
* NO_MATCHING_VERSION = dep-graph, NO_OFFLINE_META = offline mode,
|
|
236
|
+
* TARBALL_INTEGRITY = corruption). Callers fall back to the legacy
|
|
237
|
+
* unstructured path the same way they do for npm's ERESOLVE etc. */
|
|
238
|
+
function mapPnpmCodeToReason(pnpmCodeSuffix) {
|
|
239
|
+
const fetchMatch = pnpmCodeSuffix.match(/^FETCH_(\d{3})$/);
|
|
240
|
+
if (fetchMatch) {
|
|
241
|
+
const status = Number(fetchMatch[1]);
|
|
242
|
+
const reason = mapFetchStatusToReason(status);
|
|
243
|
+
return reason ? { reason, httpStatus: status } : null;
|
|
244
|
+
}
|
|
245
|
+
if (pnpmCodeSuffix === "META_FETCH_FAIL") {
|
|
246
|
+
return { reason: "registry_unreachable" };
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Attempt to parse npm `--json` stdout produced by a failed install into a
|
|
252
|
+
* structured `NpmInstallBlocked` error.
|
|
253
|
+
*
|
|
254
|
+
* Returns null when:
|
|
255
|
+
* - stdout is not parseable JSON, or
|
|
256
|
+
* - it doesn't match `NpmJsonErrorSchema`, or
|
|
257
|
+
* - the error code isn't one of our known registry-blocked classes.
|
|
258
|
+
*
|
|
259
|
+
* Callers should fall back to throwing `NpmInstallError(stderr)` in that case.
|
|
260
|
+
*/
|
|
261
|
+
export function parseNpmJsonError(stdout, ctx = {}) {
|
|
262
|
+
let json;
|
|
263
|
+
try {
|
|
264
|
+
json = JSON.parse(stdout);
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
const parsed = NpmJsonErrorSchema.safeParse(json);
|
|
270
|
+
if (!parsed.success)
|
|
271
|
+
return null;
|
|
272
|
+
const { code, summary, detail } = parsed.data.error;
|
|
273
|
+
// Combine the two signals: the code mapping (E404/EAUTH/network bucket) and
|
|
274
|
+
// the text classifier (TLS phrases, proxy phrases, embedded Node codes).
|
|
275
|
+
// Text wins for TLS and proxy because both can hide behind a generic
|
|
276
|
+
// network code (e.g. ECONNRESET for a 407'd proxy tunnel); code wins
|
|
277
|
+
// otherwise. See `pickSignal` for the precedence rationale.
|
|
278
|
+
const fromCode = mapCodeToReason(code);
|
|
279
|
+
const fromText = detectReasonFromText(`${summary ?? ""} ${detail ?? ""}`);
|
|
280
|
+
const signal = pickSignal(fromCode, fromText);
|
|
281
|
+
if (!signal)
|
|
282
|
+
return null;
|
|
283
|
+
const url = extractUrl(summary);
|
|
284
|
+
const registryHost = url?.host;
|
|
285
|
+
const packageFromDetail = extractPackageFromDetail(detail);
|
|
286
|
+
// Prefer the spec npm named in `detail` (most precise — names the actual
|
|
287
|
+
// failing lookup). Otherwise fall back to the caller's input scope. Empty
|
|
288
|
+
// array signals "the parser had no context"; the renderer handles that.
|
|
289
|
+
const packages = packageFromDetail
|
|
290
|
+
? [packageFromDetail]
|
|
291
|
+
: (ctx.requestedPackages?.map((p) => p.name) ?? []);
|
|
292
|
+
// Note: the `NpmInstallBlocked` constructor scrubs auth secrets from all
|
|
293
|
+
// string fields defensively, so we don't pre-scrub here.
|
|
294
|
+
return new NpmInstallBlocked({
|
|
295
|
+
reason: signal.reason,
|
|
296
|
+
subreason: signal.subreason,
|
|
297
|
+
packages,
|
|
298
|
+
registryHost,
|
|
299
|
+
httpStatus: inferHttpStatus(code),
|
|
300
|
+
npmErrorCode: code,
|
|
301
|
+
summary,
|
|
302
|
+
hasAnyRegistryConfigured: ctx.hasAnyRegistryConfigured,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Extract a one-line diagnostic from npm `--json` error stdout for the
|
|
307
|
+
* non-registry-blocked legacy path (ERESOLVE, EPEERINVALID, ETARGET,
|
|
308
|
+
* EJSONPARSE, EEXIST, ENOSPC, …). Under `--json`, npm channels code +
|
|
309
|
+
* summary + detail into stdout while stderr stays sparse — without this,
|
|
310
|
+
* `new NpmInstallError(stderr || message)` collapses to a generic exec
|
|
311
|
+
* failure string and the agent loses the actionable diagnostic.
|
|
312
|
+
*
|
|
313
|
+
* Returns null when stdout isn't a parseable npm-error envelope; callers
|
|
314
|
+
* fall back to whatever stderr/message they already have.
|
|
315
|
+
*/
|
|
316
|
+
export function parseNpmJsonDiagnostic(stdout) {
|
|
317
|
+
let json;
|
|
318
|
+
try {
|
|
319
|
+
json = JSON.parse(stdout);
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
const parsed = NpmJsonErrorSchema.safeParse(json);
|
|
325
|
+
if (!parsed.success)
|
|
326
|
+
return null;
|
|
327
|
+
const { code, summary, detail } = parsed.data.error;
|
|
328
|
+
// Pull only the first non-empty line of `detail` — npm pads detail with
|
|
329
|
+
// multi-paragraph proxy/network hints that bloat the tool result for no
|
|
330
|
+
// diagnostic gain (the agent only needs the actionable line).
|
|
331
|
+
const detailLine = detail
|
|
332
|
+
?.split("\n")
|
|
333
|
+
.map((l) => l.trim())
|
|
334
|
+
.find((l) => l.length > 0);
|
|
335
|
+
const parts = [
|
|
336
|
+
code ? `[${code}]` : null,
|
|
337
|
+
summary?.trim() || null,
|
|
338
|
+
detailLine || null,
|
|
339
|
+
].filter((p) => Boolean(p));
|
|
340
|
+
// The result lands on `new NpmInstallError(...).message`, which `agent-
|
|
341
|
+
// planning.ts`'s POST_PROCESSING_ERRORED branch interpolates into a debug
|
|
342
|
+
// string the model reads. Two hardenings applied, mirroring the structured
|
|
343
|
+
// path's defense-in-depth:
|
|
344
|
+
//
|
|
345
|
+
// 1. `scrubSecrets` — for LinkedIn-class deployments the registry URL is
|
|
346
|
+
// the userinfo-bearing `https://_:<token>@artifactory.corp/...` shape
|
|
347
|
+
// and npm echoes it into `summary` on most failures, so missing this
|
|
348
|
+
// regresses the URL-userinfo AC on the legacy path.
|
|
349
|
+
//
|
|
350
|
+
// 2. Control-char + backtick stripping — without it, a hostile registry
|
|
351
|
+
// could ship `summary` containing `\n---\n` (desyncing the debug
|
|
352
|
+
// message framing) or backticks (forging a markdown code span). The
|
|
353
|
+
// injection surface is weaker than the structured tool result (debug
|
|
354
|
+
// message, not the first thing the model reads), but the harden is
|
|
355
|
+
// cheap and keeps both paths consistent.
|
|
356
|
+
if (parts.length === 0)
|
|
357
|
+
return null;
|
|
358
|
+
// eslint-disable-next-line no-control-regex -- intentional: scrubbing CR/LF/control chars
|
|
359
|
+
return scrubSecrets(parts.join(" ")).replace(/[`\u0000-\u001F\u007F]/g, "");
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Lightweight stderr-only classifier for npm- or pnpm-driven install failures
|
|
363
|
+
* that did NOT pass `--json` (e.g. the dev-server pod's CLI auto-upgrade,
|
|
364
|
+
* which streams progress to the operator-visible crash-loop log).
|
|
365
|
+
*
|
|
366
|
+
* Recognises three error-line shapes and reuses the same reason taxonomy as
|
|
367
|
+
* `parseNpmJsonError`, so the structured `NpmInstallBlocked` thrown here is
|
|
368
|
+
* shape-identical to the AppShell install path:
|
|
369
|
+
*
|
|
370
|
+
* 1. `npm error code <CODE>` (npm v10+, `--json`-less path)
|
|
371
|
+
* 2. `npm ERR! code <CODE>` (npm v8/v9, same path)
|
|
372
|
+
* 3. `ERR_PNPM_<CODE>` (pnpm default reporter; brackets are chalk-
|
|
373
|
+
* wrapped in the source but render as plain
|
|
374
|
+
* text on the non-TTY child_process stderr)
|
|
375
|
+
*
|
|
376
|
+
* pnpm is the local-dev path when the template's package manager is detected
|
|
377
|
+
* as pnpm by `package-manager-detector`; cloud SABS pods boot from synced
|
|
378
|
+
* templates without pnpm indicators, so npm is the path there. Either way,
|
|
379
|
+
* `upgradeCliWithPackageManager` runs whatever `detect()` returns, so the
|
|
380
|
+
* classifier must cover both.
|
|
381
|
+
*
|
|
382
|
+
* Returns null when stderr contains no recognisable error-code line, or when
|
|
383
|
+
* the code does not map to a registry-blocked reason (e.g. ERESOLVE,
|
|
384
|
+
* ERR_PNPM_NO_MATCHING_VERSION — local dep-graph problems, not perimeter
|
|
385
|
+
* blocks).
|
|
386
|
+
*/
|
|
387
|
+
export function classifyNpmExecStderr(stderr, ctx = {}) {
|
|
388
|
+
// npm v10+ prefixes lines with `npm error`; npm v8/v9 use `npm ERR!`. The
|
|
389
|
+
// dev-server pod doesn't pin a specific npm version, so accept both.
|
|
390
|
+
const npmCodeMatch = stderr.match(/npm (?:error|ERR!) code (\S+)/);
|
|
391
|
+
// pnpm's default reporter wraps the code in brackets via `formatErrorSummary`
|
|
392
|
+
// (`[ERR_PNPM_FETCH_404]`); chalk auto-detects the non-TTY child_process and
|
|
393
|
+
// renders plain text. Match the bare `ERR_PNPM_<CODE>` token so the brackets
|
|
394
|
+
// stay optional in case a future pnpm version drops them.
|
|
395
|
+
const pnpmCodeMatch = stderr.match(/\bERR_PNPM_([A-Z0-9_]+)/);
|
|
396
|
+
// The non-null assertions on `[1]` are safe: both regexes have exactly one
|
|
397
|
+
// capture group, so when `.match()` returns a non-null result the group is
|
|
398
|
+
// guaranteed populated. `noUncheckedIndexedAccess` widens indexed access to
|
|
399
|
+
// `string | undefined` regardless, so we narrow back explicitly here.
|
|
400
|
+
//
|
|
401
|
+
// Text-side classification runs on the entire stderr blob — for TLS and
|
|
402
|
+
// proxy phrases that hide behind generic network codes, and for pnpm's
|
|
403
|
+
// `ERR_PNPM_META_FETCH_FAIL` envelope where the only signal lives in the
|
|
404
|
+
// wrapped Node error message.
|
|
405
|
+
const fromText = detectReasonFromText(stderr);
|
|
406
|
+
let code;
|
|
407
|
+
let signal;
|
|
408
|
+
let httpStatus;
|
|
409
|
+
if (npmCodeMatch) {
|
|
410
|
+
code = npmCodeMatch[1];
|
|
411
|
+
const fromCode = mapCodeToReason(code);
|
|
412
|
+
const picked = pickSignal(fromCode, fromText);
|
|
413
|
+
if (!picked)
|
|
414
|
+
return null;
|
|
415
|
+
signal = picked;
|
|
416
|
+
httpStatus = inferHttpStatus(code);
|
|
417
|
+
}
|
|
418
|
+
else if (pnpmCodeMatch) {
|
|
419
|
+
const pnpmCodeSuffix = pnpmCodeMatch[1];
|
|
420
|
+
const pnpmReason = mapPnpmCodeToReason(pnpmCodeSuffix);
|
|
421
|
+
if (!pnpmReason)
|
|
422
|
+
return null;
|
|
423
|
+
// Preserve the full `ERR_PNPM_` prefix on `npmErrorCode` so downstream
|
|
424
|
+
// log readers can tell at a glance that the failure came from pnpm rather
|
|
425
|
+
// than npm — the field name is npm-shaped for legacy reasons, but its
|
|
426
|
+
// value is the raw exec-side code regardless of which manager ran.
|
|
427
|
+
code = `ERR_PNPM_${pnpmCodeSuffix}`;
|
|
428
|
+
// pnpm's outer envelope only sets `registry_unreachable` (no subreason)
|
|
429
|
+
// for META_FETCH_FAIL, and never sets TLS at all. The text classifier
|
|
430
|
+
// looks inside the wrapped message for the actionable bucket. Use
|
|
431
|
+
// `pickSignal` here too so TLS/proxy override the unreachable bucket.
|
|
432
|
+
const picked = pickSignal({ reason: pnpmReason.reason }, fromText);
|
|
433
|
+
signal = picked ?? { reason: pnpmReason.reason };
|
|
434
|
+
httpStatus = pnpmReason.httpStatus;
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
// Pull the first URL we can find in the stderr blob to source the host —
|
|
440
|
+
// npm and pnpm both log it on the network/HTTP-status line right after the
|
|
441
|
+
// code. `extractUrl` understands the surrounding text shapes already.
|
|
442
|
+
const url = extractUrl(stderr);
|
|
443
|
+
const registryHost = url?.host;
|
|
444
|
+
// For a non-JSON exec the only package context we have is what the caller
|
|
445
|
+
// passed in; neither npm nor pnpm prints a spec we can reliably parse here.
|
|
446
|
+
const packages = ctx.requestedPackages?.map((p) => p.name) ?? [];
|
|
447
|
+
// Capture a short human-readable summary: the first non-code error line
|
|
448
|
+
// that names the failure. Falls back to the code line itself. Handles both
|
|
449
|
+
// npm's per-line prefix (`npm error ` / `npm ERR! `) and pnpm's bracketed
|
|
450
|
+
// header line so the summary doesn't leak the framing chrome.
|
|
451
|
+
const summary = stderr
|
|
452
|
+
.split("\n")
|
|
453
|
+
.map((l) => l
|
|
454
|
+
.replace(/^npm (?:error|ERR!) /, "")
|
|
455
|
+
.replace(/^\[ERR_PNPM_[A-Z0-9_]+\]\s*/, "")
|
|
456
|
+
.trim())
|
|
457
|
+
.find((l) => l.length > 0 &&
|
|
458
|
+
!l.startsWith("code ") &&
|
|
459
|
+
!l.startsWith("syscall ") &&
|
|
460
|
+
!l.startsWith("errno ") &&
|
|
461
|
+
!l.startsWith("A complete log"));
|
|
462
|
+
return new NpmInstallBlocked({
|
|
463
|
+
reason: signal.reason,
|
|
464
|
+
subreason: signal.subreason,
|
|
465
|
+
packages,
|
|
466
|
+
registryHost,
|
|
467
|
+
httpStatus,
|
|
468
|
+
npmErrorCode: code,
|
|
469
|
+
summary,
|
|
470
|
+
hasAnyRegistryConfigured: ctx.hasAnyRegistryConfigured,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Attempt to parse npm `--json` stdout produced by a successful install into
|
|
475
|
+
* a compact summary string suitable for inclusion in the tool result message.
|
|
476
|
+
*
|
|
477
|
+
* Returns null only when stdout isn't valid JSON (the `--json` flag should
|
|
478
|
+
* always produce JSON, so this is the surprise path — callers fall back to
|
|
479
|
+
* raw stdout). When JSON parses but no count fields surface (no-op installs,
|
|
480
|
+
* unfamiliar `--json` shape), returns a short sentinel instead of forcing
|
|
481
|
+
* callers to dump the multi-KB JSON blob into the agent's tool result.
|
|
482
|
+
*/
|
|
483
|
+
export function parseNpmJsonSuccess(stdout) {
|
|
484
|
+
let json;
|
|
485
|
+
try {
|
|
486
|
+
json = JSON.parse(stdout);
|
|
487
|
+
}
|
|
488
|
+
catch {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
const parsed = NpmJsonSuccessSchema.safeParse(json);
|
|
492
|
+
// The schema is permissive (all fields optional, passthrough), so a parse
|
|
493
|
+
// failure here only happens if the top-level value isn't an object.
|
|
494
|
+
if (!parsed.success)
|
|
495
|
+
return "install completed";
|
|
496
|
+
const parts = [];
|
|
497
|
+
if (typeof parsed.data.added === "number")
|
|
498
|
+
parts.push(`added ${parsed.data.added}`);
|
|
499
|
+
if (typeof parsed.data.removed === "number" && parsed.data.removed > 0)
|
|
500
|
+
parts.push(`removed ${parsed.data.removed}`);
|
|
501
|
+
if (typeof parsed.data.changed === "number" && parsed.data.changed > 0)
|
|
502
|
+
parts.push(`changed ${parsed.data.changed}`);
|
|
503
|
+
if (typeof parsed.data.audited === "number")
|
|
504
|
+
parts.push(`audited ${parsed.data.audited}`);
|
|
505
|
+
// No count fields produced anything useful (no-op install, or npm changed
|
|
506
|
+
// the shape under us). Returning a short sentinel keeps tool output small
|
|
507
|
+
// — dumping the raw JSON blob can be multi-KB on real projects.
|
|
508
|
+
return parts.length > 0 ? parts.join(", ") : "install completed (no changes)";
|
|
509
|
+
}
|
|
510
|
+
//# sourceMappingURL=npm-error-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-error-parser.js","sourceRoot":"","sources":["../../../src/ai-service/app-interface/npm-error-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc9D;;;yCAGyC;AACzC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS;IACtC,iCAAiC;IACjC,2BAA2B;IAC3B,6BAA6B;IAC7B,kBAAkB;IAClB,oBAAoB;IACpB,gBAAgB;IAChB,2BAA2B;IAC3B,mCAAmC;CACpC,CAAC,CAAC;AAEH;;;yCAGyC;AACzC,MAAM,gBAAgB,GACpB,yKAAyK,CAAC;AAE5K;;;;;;iBAMiB;AACjB,MAAM,kBAAkB,GACtB,kGAAkG,CAAC;AAErG;;;;mCAImC;AACnC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAC/D,MAAM,kBAAkB,GAAG,6CAA6C,CAAC;AAEzE;;;;;;;2EAO2E;AAC3E,SAAS,oBAAoB,CAAC,IAAwB;IACpD,IAAI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