@bastani/atomic 0.9.11-alpha.8 → 0.9.11-alpha.9
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 +75 -1
- package/dist/builtin/intercom/package.json +3 -3
- package/dist/builtin/mcp/CHANGELOG.md +6 -0
- package/dist/builtin/mcp/commands.ts +7 -3
- package/dist/builtin/mcp/package.json +6 -6
- package/dist/builtin/subagents/CHANGELOG.md +9 -0
- package/dist/builtin/subagents/package.json +5 -5
- package/dist/builtin/subagents/src/agents/agent-discovery.ts +26 -15
- package/dist/builtin/subagents/src/agents/agent-loaders.ts +48 -34
- package/dist/builtin/subagents/src/agents/agent-management-helpers.ts +80 -31
- package/dist/builtin/subagents/src/agents/agent-management.ts +194 -55
- package/dist/builtin/subagents/src/agents/agent-overrides.ts +85 -32
- package/dist/builtin/subagents/src/agents/agent-paths.ts +4 -1
- package/dist/builtin/subagents/src/agents/agent-selection.ts +1 -1
- package/dist/builtin/subagents/src/agents/agent-serializer.ts +1 -4
- package/dist/builtin/subagents/src/agents/agents.ts +9 -9
- package/dist/builtin/subagents/src/agents/chain-serializer.ts +9 -5
- package/dist/builtin/subagents/src/agents/identity.ts +12 -3
- package/dist/builtin/subagents/src/agents/skills-paths.ts +64 -24
- package/dist/builtin/subagents/src/agents/skills.ts +29 -26
- package/dist/builtin/subagents/src/extension/doctor.ts +31 -20
- package/dist/builtin/subagents/src/extension/fanout-child.ts +27 -12
- package/dist/builtin/subagents/src/extension/index.ts +119 -43
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +0 -1
- package/dist/builtin/subagents/src/extension/schemas.ts +304 -177
- package/dist/builtin/subagents/src/extension/startup-maintenance.ts +137 -73
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +49 -21
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +76 -38
- package/dist/builtin/subagents/src/runs/background/async-event-journal.ts +12 -6
- package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +164 -57
- package/dist/builtin/subagents/src/runs/background/async-execution-common.ts +15 -18
- package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +66 -27
- package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +4 -14
- package/dist/builtin/subagents/src/runs/background/async-execution.ts +1 -1
- package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +86 -32
- package/dist/builtin/subagents/src/runs/background/async-resume.ts +93 -36
- package/dist/builtin/subagents/src/runs/background/async-status.ts +82 -27
- package/dist/builtin/subagents/src/runs/background/completion-claims.ts +12 -5
- package/dist/builtin/subagents/src/runs/background/completion-dedupe.ts +3 -1
- package/dist/builtin/subagents/src/runs/background/completion-notification.ts +3 -1
- package/dist/builtin/subagents/src/runs/background/notify.ts +36 -18
- package/dist/builtin/subagents/src/runs/background/parallel-groups.ts +28 -14
- package/dist/builtin/subagents/src/runs/background/result-delivery-processor.ts +147 -79
- package/dist/builtin/subagents/src/runs/background/result-file-claims.ts +20 -5
- package/dist/builtin/subagents/src/runs/background/result-quarantine.ts +7 -2
- package/dist/builtin/subagents/src/runs/background/result-status.ts +11 -5
- package/dist/builtin/subagents/src/runs/background/result-watcher-data.ts +18 -5
- package/dist/builtin/subagents/src/runs/background/result-watcher.ts +104 -35
- package/dist/builtin/subagents/src/runs/background/run-id-resolver.ts +28 -7
- package/dist/builtin/subagents/src/runs/background/run-status.ts +120 -32
- package/dist/builtin/subagents/src/runs/background/stale-run-reconciler.ts +98 -39
- package/dist/builtin/subagents/src/runs/background/subagent-runner-dynamic.ts +185 -37
- package/dist/builtin/subagents/src/runs/background/subagent-runner-finalize.ts +23 -9
- package/dist/builtin/subagents/src/runs/background/subagent-runner-output.ts +6 -2
- package/dist/builtin/subagents/src/runs/background/subagent-runner-parallel-helpers.ts +34 -18
- package/dist/builtin/subagents/src/runs/background/subagent-runner-parallel.ts +175 -26
- package/dist/builtin/subagents/src/runs/background/subagent-runner-sequential.ts +68 -23
- package/dist/builtin/subagents/src/runs/background/subagent-runner-state.ts +200 -49
- package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +81 -49
- package/dist/builtin/subagents/src/runs/background/subagent-runner-streaming.ts +33 -11
- package/dist/builtin/subagents/src/runs/background/subagent-runner-types.ts +16 -6
- package/dist/builtin/subagents/src/runs/background/subagent-runner-utils.ts +2 -3
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +11 -8
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-details.ts +5 -2
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +113 -31
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +64 -55
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +103 -37
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +97 -62
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +22 -10
- package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +9 -6
- package/dist/builtin/subagents/src/runs/foreground/detached-cleanup-barrier.ts +22 -22
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt-control.ts +45 -40
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt-finalize.ts +6 -5
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +118 -43
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-reservations.ts +17 -7
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-route.ts +5 -3
- package/dist/builtin/subagents/src/runs/foreground/execution-intercom-detach.ts +39 -35
- package/dist/builtin/subagents/src/runs/foreground/execution-run-sync.ts +81 -42
- package/dist/builtin/subagents/src/runs/foreground/execution-structured-retries.ts +27 -21
- package/dist/builtin/subagents/src/runs/foreground/execution-updates.ts +2 -5
- package/dist/builtin/subagents/src/runs/foreground/execution-utils.ts +9 -4
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +64 -27
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +31 -18
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +95 -62
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +30 -9
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +106 -96
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +68 -37
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +260 -84
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-runtime.ts +6 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +63 -40
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +110 -59
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +20 -3
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-worktree.ts +8 -6
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +65 -47
- package/dist/builtin/subagents/src/runs/shared/chain-outputs.ts +37 -12
- package/dist/builtin/subagents/src/runs/shared/dynamic-fanout.ts +120 -34
- package/dist/builtin/subagents/src/runs/shared/final-drain.ts +12 -7
- package/dist/builtin/subagents/src/runs/shared/intercom-group.ts +3 -2
- package/dist/builtin/subagents/src/runs/shared/long-running-guard.ts +8 -3
- package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +42 -19
- package/dist/builtin/subagents/src/runs/shared/model-candidate-filter.ts +8 -4
- package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +103 -38
- package/dist/builtin/subagents/src/runs/shared/nested-events-control.ts +30 -20
- package/dist/builtin/subagents/src/runs/shared/nested-events-core.ts +45 -20
- package/dist/builtin/subagents/src/runs/shared/nested-events-projection.ts +57 -23
- package/dist/builtin/subagents/src/runs/shared/nested-events-registry.ts +77 -29
- package/dist/builtin/subagents/src/runs/shared/nested-events-sanitize.ts +99 -42
- package/dist/builtin/subagents/src/runs/shared/nested-events.ts +32 -26
- package/dist/builtin/subagents/src/runs/shared/nested-path.ts +22 -17
- package/dist/builtin/subagents/src/runs/shared/nested-render.ts +31 -10
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +9 -8
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +54 -30
- package/dist/builtin/subagents/src/runs/shared/pi-spawn.ts +17 -13
- package/dist/builtin/subagents/src/runs/shared/run-history.ts +13 -6
- package/dist/builtin/subagents/src/runs/shared/single-output.ts +11 -6
- package/dist/builtin/subagents/src/runs/shared/spawn-env.ts +21 -0
- package/dist/builtin/subagents/src/runs/shared/structured-output.ts +33 -19
- package/dist/builtin/subagents/src/runs/shared/subagent-control.ts +59 -48
- package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +18 -11
- package/dist/builtin/subagents/src/runs/shared/workflow-graph.ts +41 -11
- package/dist/builtin/subagents/src/runs/shared/worktree-post-create.ts +46 -10
- package/dist/builtin/subagents/src/runs/shared/worktree-root.ts +21 -5
- package/dist/builtin/subagents/src/runs/shared/worktree.ts +89 -34
- package/dist/builtin/subagents/src/shared/artifacts.ts +137 -7
- package/dist/builtin/subagents/src/shared/event-jsonl-writer.ts +49 -13
- package/dist/builtin/subagents/src/shared/fast-mode.ts +13 -6
- package/dist/builtin/subagents/src/shared/fork-context.ts +7 -4
- package/dist/builtin/subagents/src/shared/formatters.ts +14 -9
- package/dist/builtin/subagents/src/shared/jsonl-writer.ts +2 -1
- package/dist/builtin/subagents/src/shared/model-info.ts +10 -3
- package/dist/builtin/subagents/src/shared/post-exit-stdio-guard.ts +7 -6
- package/dist/builtin/subagents/src/shared/session-tokens.ts +2 -1
- package/dist/builtin/subagents/src/shared/settings.ts +39 -43
- package/dist/builtin/subagents/src/shared/status-format.ts +10 -2
- package/dist/builtin/subagents/src/shared/types-async.ts +22 -19
- package/dist/builtin/subagents/src/shared/types-config.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-depth.ts +23 -11
- package/dist/builtin/subagents/src/shared/types-results.ts +49 -6
- package/dist/builtin/subagents/src/shared/types-runtime.ts +16 -17
- package/dist/builtin/subagents/src/shared/types.ts +2 -2
- package/dist/builtin/subagents/src/shared/utils.ts +34 -20
- package/dist/builtin/subagents/src/slash/prompt-template-bridge.ts +44 -47
- package/dist/builtin/subagents/src/slash/saved-chain-mapping.ts +5 -7
- package/dist/builtin/subagents/src/slash/slash-bridge.ts +3 -3
- package/dist/builtin/subagents/src/slash/slash-commands.ts +78 -52
- package/dist/builtin/subagents/src/slash/slash-live-state.ts +59 -32
- package/dist/builtin/subagents/src/tui/render-chain-graph.ts +120 -32
- package/dist/builtin/subagents/src/tui/render-event-formatting.ts +85 -22
- package/dist/builtin/subagents/src/tui/render-helpers.ts +16 -6
- package/dist/builtin/subagents/src/tui/render-layout.ts +8 -3
- package/dist/builtin/subagents/src/tui/render-result-compact.ts +125 -43
- package/dist/builtin/subagents/src/tui/render-result.ts +128 -85
- package/dist/builtin/subagents/src/tui/render-stable-output.ts +17 -13
- package/dist/builtin/subagents/src/tui/render-status-progress.ts +52 -20
- package/dist/builtin/subagents/src/tui/render-widget-graph.ts +130 -28
- package/dist/builtin/subagents/src/tui/render-widget.ts +54 -27
- package/dist/builtin/subagents/src/tui/render.ts +10 -3
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +30 -0
- package/dist/builtin/workflows/README.md +6 -0
- package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +104 -40
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +57 -26
- package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +125 -12
- package/dist/builtin/workflows/package.json +3 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +4 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-dom.js +5 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +7 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-manual-edit-evidence.mjs +5 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +7 -1
- package/dist/builtin/workflows/src/authoring/typebox-defaults.d.ts +5 -5
- package/dist/builtin/workflows/src/authoring/typebox-defaults.ts +160 -197
- package/dist/builtin/workflows/src/authoring/workflow.ts +137 -133
- package/dist/builtin/workflows/src/authoring.d.ts +3 -3
- package/dist/builtin/workflows/src/durable/backend.ts +507 -439
- package/dist/builtin/workflows/src/durable/boundary-lifecycle.ts +142 -118
- package/dist/builtin/workflows/src/durable/boundary-topology.ts +410 -355
- package/dist/builtin/workflows/src/durable/child-invocation.ts +6 -6
- package/dist/builtin/workflows/src/durable/child-primitive.ts +109 -101
- package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +234 -194
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +379 -372
- package/dist/builtin/workflows/src/durable/completed-inspection.ts +118 -116
- package/dist/builtin/workflows/src/durable/completed-subtree.ts +24 -20
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +484 -418
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres-root.ts +86 -87
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts +171 -149
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +400 -324
- package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +117 -121
- package/dist/builtin/workflows/src/durable/dbos-local-postgres.ts +75 -68
- package/dist/builtin/workflows/src/durable/dbos-metadata.ts +138 -119
- package/dist/builtin/workflows/src/durable/dbos-prompt-reservations.ts +316 -259
- package/dist/builtin/workflows/src/durable/dbos-sdk-handle.ts +138 -117
- package/dist/builtin/workflows/src/durable/dbos-status-transition.ts +48 -43
- package/dist/builtin/workflows/src/durable/dbos-tombstone.ts +14 -14
- package/dist/builtin/workflows/src/durable/durable-hash.ts +9 -11
- package/dist/builtin/workflows/src/durable/factory.ts +45 -46
- package/dist/builtin/workflows/src/durable/format-version.ts +1 -1
- package/dist/builtin/workflows/src/durable/index.ts +69 -70
- package/dist/builtin/workflows/src/durable/local-command.ts +47 -43
- package/dist/builtin/workflows/src/durable/prompt-reservation-state.ts +156 -149
- package/dist/builtin/workflows/src/durable/prompt-reservations.ts +16 -16
- package/dist/builtin/workflows/src/durable/resume-catalog.ts +11 -11
- package/dist/builtin/workflows/src/durable/resume-eligibility.ts +27 -25
- package/dist/builtin/workflows/src/durable/resume-runtime.ts +261 -226
- package/dist/builtin/workflows/src/durable/retention-policy.ts +31 -30
- package/dist/builtin/workflows/src/durable/run-timing.ts +42 -41
- package/dist/builtin/workflows/src/durable/scoped-backend.ts +249 -228
- package/dist/builtin/workflows/src/durable/stage-primitive.ts +456 -398
- package/dist/builtin/workflows/src/durable/stage-topology-validation.ts +199 -186
- package/dist/builtin/workflows/src/durable/stage-topology.ts +40 -40
- package/dist/builtin/workflows/src/durable/tool-failure-checkpoint.ts +37 -37
- package/dist/builtin/workflows/src/durable/tool-outcome.ts +95 -85
- package/dist/builtin/workflows/src/durable/tool-primitive.ts +606 -410
- package/dist/builtin/workflows/src/durable/types.ts +219 -216
- package/dist/builtin/workflows/src/durable/ui-primitive.ts +241 -208
- package/dist/builtin/workflows/src/durable/workflow-child-result.ts +40 -37
- package/dist/builtin/workflows/src/durable/workflow-status-transition.ts +16 -15
- package/dist/builtin/workflows/src/engine/graph-inference.ts +76 -76
- package/dist/builtin/workflows/src/engine/options.ts +35 -36
- package/dist/builtin/workflows/src/engine/primitives/chain.ts +27 -22
- package/dist/builtin/workflows/src/engine/primitives/exit.ts +1 -1
- package/dist/builtin/workflows/src/engine/primitives/parallel.ts +64 -52
- package/dist/builtin/workflows/src/engine/primitives/task.ts +110 -95
- package/dist/builtin/workflows/src/engine/primitives/ui.ts +46 -50
- package/dist/builtin/workflows/src/engine/primitives/workflow.ts +194 -160
- package/dist/builtin/workflows/src/engine/replay.ts +6 -6
- package/dist/builtin/workflows/src/engine/run-durable-admission.ts +30 -30
- package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +64 -47
- package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +29 -23
- package/dist/builtin/workflows/src/engine/run-durable-topology.ts +246 -219
- package/dist/builtin/workflows/src/engine/run-returned-status.ts +60 -57
- package/dist/builtin/workflows/src/engine/run-terminal-event.ts +25 -23
- package/dist/builtin/workflows/src/engine/run-terminal-failure.ts +45 -42
- package/dist/builtin/workflows/src/engine/run-tool-admission-boundary.ts +99 -0
- package/dist/builtin/workflows/src/engine/run-tool-control-registry.ts +179 -0
- package/dist/builtin/workflows/src/engine/run-tool-execution-tracker.ts +144 -132
- package/dist/builtin/workflows/src/engine/run-tool-node-lifecycle.ts +134 -69
- package/dist/builtin/workflows/src/engine/run.ts +678 -473
- package/dist/builtin/workflows/src/engine/runtime.ts +160 -153
- package/dist/builtin/workflows/src/engine/workflow-activity.ts +7 -3
- package/dist/builtin/workflows/src/engine/workflow-tool-abort.ts +92 -0
- package/dist/builtin/workflows/src/extension/atomic-stage-session.ts +123 -120
- package/dist/builtin/workflows/src/extension/background-ui-adapter.ts +108 -112
- package/dist/builtin/workflows/src/extension/companions.ts +116 -116
- package/dist/builtin/workflows/src/extension/completed-stage-intercom-ask.ts +123 -111
- package/dist/builtin/workflows/src/extension/config-file-loader.ts +153 -148
- package/dist/builtin/workflows/src/extension/config-loader.ts +264 -283
- package/dist/builtin/workflows/src/extension/discovery-loaders.ts +81 -84
- package/dist/builtin/workflows/src/extension/discovery.ts +267 -272
- package/dist/builtin/workflows/src/extension/dispatcher.ts +214 -217
- package/dist/builtin/workflows/src/extension/extension-factory.ts +102 -108
- package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +118 -116
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +413 -396
- package/dist/builtin/workflows/src/extension/hil-answer-notifications.ts +270 -261
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +33724 -32828
- package/dist/builtin/workflows/src/extension/index.ts +37 -37
- package/dist/builtin/workflows/src/extension/lifecycle-notification-delivery.ts +64 -64
- package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +384 -378
- package/dist/builtin/workflows/src/extension/mcp.ts +35 -35
- package/dist/builtin/workflows/src/extension/postmortem-deps.ts +31 -35
- package/dist/builtin/workflows/src/extension/public-types.ts +160 -182
- package/dist/builtin/workflows/src/extension/render-call.ts +85 -88
- package/dist/builtin/workflows/src/extension/render-component.ts +9 -11
- package/dist/builtin/workflows/src/extension/render-result.ts +447 -386
- package/dist/builtin/workflows/src/extension/renderers.ts +35 -35
- package/dist/builtin/workflows/src/extension/runtime-active-block-claim.ts +37 -37
- package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +145 -143
- package/dist/builtin/workflows/src/extension/runtime.ts +346 -264
- package/dist/builtin/workflows/src/extension/status-writer.ts +95 -95
- package/dist/builtin/workflows/src/extension/ui-surface.ts +224 -222
- package/dist/builtin/workflows/src/extension/wiring.ts +307 -283
- package/dist/builtin/workflows/src/extension/workflow-command-completions.ts +109 -108
- package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +257 -227
- package/dist/builtin/workflows/src/extension/workflow-command-surfaces.ts +84 -84
- package/dist/builtin/workflows/src/extension/workflow-command-utils.ts +126 -132
- package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +213 -205
- package/dist/builtin/workflows/src/extension/workflow-model-catalog.ts +19 -21
- package/dist/builtin/workflows/src/extension/workflow-module-loader.ts +104 -104
- package/dist/builtin/workflows/src/extension/workflow-policy.ts +7 -9
- package/dist/builtin/workflows/src/extension/workflow-ports.ts +30 -34
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +13 -13
- package/dist/builtin/workflows/src/extension/workflow-reload-coordinator.ts +46 -46
- package/dist/builtin/workflows/src/extension/workflow-reload-report.ts +28 -25
- package/dist/builtin/workflows/src/extension/workflow-resume-picker-rows.ts +48 -45
- package/dist/builtin/workflows/src/extension/workflow-resume-shadow.ts +28 -31
- package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +539 -453
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +149 -92
- package/dist/builtin/workflows/src/extension/workflow-stage-results.ts +182 -194
- package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +150 -155
- package/dist/builtin/workflows/src/extension/workflow-targets.ts +151 -121
- package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +204 -224
- package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +512 -372
- package/dist/builtin/workflows/src/extension/workflow-tool-inspection.ts +146 -150
- package/dist/builtin/workflows/src/extension/workflow-tool-registration.ts +43 -46
- package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +341 -292
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +122 -129
- package/dist/builtin/workflows/src/intercom/intercom-bridge.ts +17 -20
- package/dist/builtin/workflows/src/intercom/intercom-routing.ts +62 -62
- package/dist/builtin/workflows/src/intercom/result-intercom.ts +123 -123
- package/dist/builtin/workflows/src/runs/background/cancellation-registry.ts +72 -59
- package/dist/builtin/workflows/src/runs/background/durable-resume-transition.ts +45 -45
- package/dist/builtin/workflows/src/runs/background/job-tracker.ts +69 -34
- package/dist/builtin/workflows/src/runs/background/quit-tool-node.ts +71 -0
- package/dist/builtin/workflows/src/runs/background/quit.ts +359 -138
- package/dist/builtin/workflows/src/runs/background/resume-acknowledgements.ts +70 -69
- package/dist/builtin/workflows/src/runs/background/run-inspect.ts +85 -80
- package/dist/builtin/workflows/src/runs/background/runner.ts +122 -121
- package/dist/builtin/workflows/src/runs/background/startup-admission.ts +56 -60
- package/dist/builtin/workflows/src/runs/background/status.ts +324 -294
- package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +23 -17
- package/dist/builtin/workflows/src/runs/foreground/executor-abort.ts +311 -309
- package/dist/builtin/workflows/src/runs/foreground/executor-child-boundary.ts +228 -201
- package/dist/builtin/workflows/src/runs/foreground/executor-child-helpers.ts +56 -51
- package/dist/builtin/workflows/src/runs/foreground/executor-continuation.ts +168 -152
- package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +255 -217
- package/dist/builtin/workflows/src/runs/foreground/executor-exit-manager.ts +178 -173
- package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +273 -269
- package/dist/builtin/workflows/src/runs/foreground/executor-inputs.ts +59 -56
- package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +368 -361
- package/dist/builtin/workflows/src/runs/foreground/executor-outputs.ts +123 -127
- package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +355 -339
- package/dist/builtin/workflows/src/runs/foreground/executor-queued-user-message.ts +47 -47
- package/dist/builtin/workflows/src/runs/foreground/executor-run-finalizers.ts +125 -104
- package/dist/builtin/workflows/src/runs/foreground/executor-scheduler.ts +189 -189
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +294 -250
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-context.ts +141 -127
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +218 -213
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +406 -364
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-replay.ts +143 -127
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +49 -49
- package/dist/builtin/workflows/src/runs/foreground/executor-task-context.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-task-prompts.ts +148 -153
- package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +155 -117
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +10 -10
- package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +168 -141
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +356 -379
- package/dist/builtin/workflows/src/runs/foreground/stage-delivery-activity.ts +53 -53
- package/dist/builtin/workflows/src/runs/foreground/stage-queued-user-messages.ts +95 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-candidate.ts +8 -8
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +232 -232
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +630 -493
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-message-admission.ts +182 -181
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-messages.ts +80 -80
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +78 -78
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-output.ts +102 -104
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-pause.ts +178 -173
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-replacement.ts +31 -32
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-send-user-message.ts +114 -105
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +29 -29
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session.ts +44 -52
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-structured-output.ts +63 -58
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +157 -148
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-unresolved-overflow.ts +27 -23
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +10 -10
- package/dist/builtin/workflows/src/runs/foreground/stage-tool-execution-buffer.ts +33 -31
- package/dist/builtin/workflows/src/runs/shared/concurrency.ts +53 -53
- package/dist/builtin/workflows/src/runs/shared/graph-inference.ts +1 -1
- package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +257 -245
- package/dist/builtin/workflows/src/runs/shared/model-fallback-failures.ts +378 -363
- package/dist/builtin/workflows/src/runs/shared/prompt-callsite.ts +55 -55
- package/dist/builtin/workflows/src/runs/shared/validate-inputs.ts +75 -84
- package/dist/builtin/workflows/src/runs/shared/worktree-cache-lifecycle.ts +1 -3
- package/dist/builtin/workflows/src/runs/shared/worktree-cwd.ts +96 -83
- package/dist/builtin/workflows/src/runs/shared/worktree-diff.ts +9 -2
- package/dist/builtin/workflows/src/runs/shared/worktree-git-runner.ts +21 -6
- package/dist/builtin/workflows/src/runs/shared/worktree-git.ts +60 -30
- package/dist/builtin/workflows/src/runs/shared/worktree-post-create.ts +12 -5
- package/dist/builtin/workflows/src/runs/shared/worktree-setup.ts +51 -30
- package/dist/builtin/workflows/src/runs/shared/worktree.ts +4 -4
- package/dist/builtin/workflows/src/sdk-surface.ts +38 -19
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +11 -5
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +299 -275
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +21 -7
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +290 -264
- package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +220 -211
- package/dist/builtin/workflows/src/shared/intercom-group.ts +22 -22
- package/dist/builtin/workflows/src/shared/persistence-compaction-policy.ts +30 -30
- package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +432 -406
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +187 -181
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +211 -212
- package/dist/builtin/workflows/src/shared/prompt-callsite-context.ts +3 -3
- package/dist/builtin/workflows/src/shared/render-inputs-schema.ts +84 -91
- package/dist/builtin/workflows/src/shared/resume-continuation.ts +1 -1
- package/dist/builtin/workflows/src/shared/returned-run-status.ts +91 -77
- package/dist/builtin/workflows/src/shared/run-visibility.ts +2 -2
- package/dist/builtin/workflows/src/shared/schema-introspection.ts +50 -60
- package/dist/builtin/workflows/src/shared/serializable.ts +72 -86
- package/dist/builtin/workflows/src/shared/session-transcript.ts +44 -39
- package/dist/builtin/workflows/src/shared/stage-prompt.ts +183 -202
- package/dist/builtin/workflows/src/shared/stage-ui-broker.ts +270 -274
- package/dist/builtin/workflows/src/shared/store-factory.ts +8 -8
- package/dist/builtin/workflows/src/shared/store-internal.ts +168 -172
- package/dist/builtin/workflows/src/shared/store-prompt-methods.ts +196 -200
- package/dist/builtin/workflows/src/shared/store-public-types.ts +208 -204
- package/dist/builtin/workflows/src/shared/store-run-methods.ts +238 -231
- package/dist/builtin/workflows/src/shared/store-stage-methods.ts +284 -285
- package/dist/builtin/workflows/src/shared/store-tool-node-methods.ts +43 -36
- package/dist/builtin/workflows/src/shared/store-types.ts +263 -263
- package/dist/builtin/workflows/src/shared/store.ts +7 -7
- package/dist/builtin/workflows/src/shared/timing.ts +36 -34
- package/dist/builtin/workflows/src/shared/types.ts +256 -213
- package/dist/builtin/workflows/src/shared/workflow-authoring-types.d.ts +10 -4
- package/dist/builtin/workflows/src/shared/workflow-authoring-types.ts +81 -59
- package/dist/builtin/workflows/src/shared/workflow-failures-classifier.ts +247 -227
- package/dist/builtin/workflows/src/shared/workflow-failures-contract.ts +45 -46
- package/dist/builtin/workflows/src/shared/workflow-failures-decisions.ts +330 -351
- package/dist/builtin/workflows/src/shared/workflow-failures-signals.ts +192 -195
- package/dist/builtin/workflows/src/shared/workflow-failures.ts +10 -10
- package/dist/builtin/workflows/src/shared/workflow-run-ownership.ts +32 -36
- package/dist/builtin/workflows/src/tui/chat-surface-message.ts +157 -184
- package/dist/builtin/workflows/src/tui/chat-surface.ts +332 -355
- package/dist/builtin/workflows/src/tui/color-utils.ts +21 -30
- package/dist/builtin/workflows/src/tui/connectors.ts +57 -61
- package/dist/builtin/workflows/src/tui/dispatch-confirm.ts +168 -192
- package/dist/builtin/workflows/src/tui/edge.ts +10 -9
- package/dist/builtin/workflows/src/tui/graph-canvas.ts +131 -134
- package/dist/builtin/workflows/src/tui/graph-theme.ts +139 -148
- package/dist/builtin/workflows/src/tui/graph-view-constants.ts +6 -6
- package/dist/builtin/workflows/src/tui/graph-view-graph-render.ts +146 -179
- package/dist/builtin/workflows/src/tui/graph-view-input.ts +295 -323
- package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +291 -327
- package/dist/builtin/workflows/src/tui/graph-view-render.ts +171 -191
- package/dist/builtin/workflows/src/tui/graph-view-state.ts +317 -303
- package/dist/builtin/workflows/src/tui/graph-view-types.ts +65 -59
- package/dist/builtin/workflows/src/tui/header.ts +140 -156
- package/dist/builtin/workflows/src/tui/host-input-form.ts +47 -45
- package/dist/builtin/workflows/src/tui/inline-form-card.ts +277 -266
- package/dist/builtin/workflows/src/tui/inline-form-editor-text.ts +61 -62
- package/dist/builtin/workflows/src/tui/inline-form-editor.ts +407 -412
- package/dist/builtin/workflows/src/tui/inline-form-overlay.ts +203 -214
- package/dist/builtin/workflows/src/tui/inline-form-store.ts +24 -24
- package/dist/builtin/workflows/src/tui/inputs-overlay.ts +116 -129
- package/dist/builtin/workflows/src/tui/inputs-picker-editing.ts +111 -115
- package/dist/builtin/workflows/src/tui/inputs-picker-input.ts +255 -269
- package/dist/builtin/workflows/src/tui/inputs-picker-render.ts +248 -236
- package/dist/builtin/workflows/src/tui/inputs-picker-types.ts +111 -140
- package/dist/builtin/workflows/src/tui/inputs-picker.ts +12 -12
- package/dist/builtin/workflows/src/tui/keybindings-adapter.ts +49 -57
- package/dist/builtin/workflows/src/tui/layout.ts +124 -133
- package/dist/builtin/workflows/src/tui/mouse-input.ts +45 -47
- package/dist/builtin/workflows/src/tui/node-card.ts +230 -219
- package/dist/builtin/workflows/src/tui/overlay-adapter.ts +381 -394
- package/dist/builtin/workflows/src/tui/overlay-terminal-modes.ts +20 -19
- package/dist/builtin/workflows/src/tui/prompt-card-input.ts +183 -194
- package/dist/builtin/workflows/src/tui/prompt-card-render.ts +243 -302
- package/dist/builtin/workflows/src/tui/prompt-card-select.ts +76 -98
- package/dist/builtin/workflows/src/tui/prompt-card-state.ts +40 -40
- package/dist/builtin/workflows/src/tui/prompt-card-text.ts +76 -83
- package/dist/builtin/workflows/src/tui/prompt-card.ts +3 -3
- package/dist/builtin/workflows/src/tui/renderers.ts +6 -6
- package/dist/builtin/workflows/src/tui/run-detail.ts +287 -279
- package/dist/builtin/workflows/src/tui/session-list.ts +19 -22
- package/dist/builtin/workflows/src/tui/session-overlays.ts +82 -87
- package/dist/builtin/workflows/src/tui/session-picker.ts +258 -275
- package/dist/builtin/workflows/src/tui/stage-chat-composer-drafts.ts +11 -11
- package/dist/builtin/workflows/src/tui/stage-chat-layout.ts +55 -62
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +220 -263
- package/dist/builtin/workflows/src/tui/stage-chat-view-custom-ui.ts +91 -102
- package/dist/builtin/workflows/src/tui/stage-chat-view-delivery-activity.ts +51 -59
- package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +154 -208
- package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +174 -208
- package/dist/builtin/workflows/src/tui/stage-chat-view-live-events.ts +32 -44
- package/dist/builtin/workflows/src/tui/stage-chat-view-pending-tools.ts +2 -4
- package/dist/builtin/workflows/src/tui/stage-chat-view-render-helpers.ts +82 -97
- package/dist/builtin/workflows/src/tui/stage-chat-view-render-settings.ts +33 -31
- package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +428 -400
- package/dist/builtin/workflows/src/tui/stage-chat-view-status.ts +24 -25
- package/dist/builtin/workflows/src/tui/stage-chat-view-transcript.ts +181 -197
- package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +125 -134
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +210 -211
- package/dist/builtin/workflows/src/tui/status-helpers.ts +65 -69
- package/dist/builtin/workflows/src/tui/status-list.ts +316 -294
- package/dist/builtin/workflows/src/tui/store-widget-installer.ts +213 -214
- package/dist/builtin/workflows/src/tui/submit-pane.ts +114 -130
- package/dist/builtin/workflows/src/tui/switcher.ts +116 -134
- package/dist/builtin/workflows/src/tui/text-helpers.ts +136 -145
- package/dist/builtin/workflows/src/tui/toast.ts +68 -67
- package/dist/builtin/workflows/src/tui/widget.ts +265 -285
- package/dist/builtin/workflows/src/tui/workflow-attach-pane-handle.ts +12 -17
- package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +81 -82
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +467 -445
- package/dist/builtin/workflows/src/tui/workflow-list.ts +130 -145
- package/dist/builtin/workflows/src/tui/workflow-notice-card.ts +127 -144
- package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +217 -216
- package/dist/builtin/workflows/src/workflows/identity.ts +11 -11
- package/dist/builtin/workflows/src/workflows/registry.ts +66 -68
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/internal-intercom-broker.d.ts.map +1 -1
- package/dist/bun/internal-intercom-broker.js +1 -1
- package/dist/bun/internal-intercom-broker.js.map +1 -1
- package/dist/bun/register-bedrock.js +1 -1
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts +170 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +513 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/project-trust.d.ts +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +13 -6
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config-self-update.d.ts.map +1 -1
- package/dist/config-self-update.js +5 -2
- package/dist/config-self-update.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -3
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-accessors.d.ts.map +1 -1
- package/dist/core/agent-session-accessors.js +125 -25
- package/dist/core/agent-session-accessors.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +4 -2
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +3 -1
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +45 -8
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
- package/dist/core/agent-session-custom-message-commit.js +13 -9
- package/dist/core/agent-session-custom-message-commit.js.map +1 -1
- package/dist/core/agent-session-delivery-forwarding.d.ts +1 -1
- package/dist/core/agent-session-delivery-forwarding.d.ts.map +1 -1
- package/dist/core/agent-session-delivery-forwarding.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +15 -8
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +12 -5
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +4 -4
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +21 -12
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -5
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +1 -1
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.js +6 -4
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +5 -5
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +8 -7
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +30 -7
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.d.ts.map +1 -1
- package/dist/core/agent-session-runtime-auth.js +3 -1
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +14 -3
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +17 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +4 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +2 -6
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +4 -3
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.d.ts.map +1 -1
- package/dist/core/agent-session-transfer.js +6 -10
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +5 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +1 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js +4 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +14 -10
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +8 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
- package/dist/core/anthropic-thinking-guard.js +4 -2
- package/dist/core/anthropic-thinking-guard.js.map +1 -1
- package/dist/core/async/format.d.ts +1 -1
- package/dist/core/async/format.d.ts.map +1 -1
- package/dist/core/async/format.js +3 -1
- package/dist/core/async/format.js.map +1 -1
- package/dist/core/async/job-manager.d.ts.map +1 -1
- package/dist/core/async/job-manager.js +20 -5
- package/dist/core/async/job-manager.js.map +1 -1
- package/dist/core/async/session-manager.d.ts.map +1 -1
- package/dist/core/async/session-manager.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +1 -2
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/auth-guidance.d.ts.map +1 -1
- package/dist/core/auth-guidance.js.map +1 -1
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/auth-storage.d.ts +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +4 -8
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +1 -4
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +8 -6
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/callback-activity.d.ts.map +1 -1
- package/dist/core/callback-activity.js.map +1 -1
- package/dist/core/codex-errors.d.ts.map +1 -1
- package/dist/core/codex-errors.js +1 -1
- package/dist/core/codex-errors.js.map +1 -1
- package/dist/core/codex-fast-mode.d.ts.map +1 -1
- package/dist/core/codex-fast-mode.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +10 -6
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +1 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +2 -4
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +5 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/deleted-ranges.d.ts.map +1 -1
- package/dist/core/compaction/deleted-ranges.js.map +1 -1
- package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
- package/dist/core/compaction/fallback-planner.js.map +1 -1
- package/dist/core/compaction/index.d.ts +6 -6
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +6 -6
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
- package/dist/core/compaction/planner-outcome.js.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.js +4 -2
- package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +4 -1
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
- package/dist/core/compaction/transcript-serialization.js.map +1 -1
- package/dist/core/context-tool-pairing.js +3 -3
- package/dist/core/context-tool-pairing.js.map +1 -1
- package/dist/core/copilot-env-routing.d.ts.map +1 -1
- package/dist/core/copilot-env-routing.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +5 -0
- package/dist/core/exec.js.map +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +2 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +2 -2
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +7 -1
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +7 -7
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +2 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +4 -2
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +2 -2
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-discovery.d.ts.map +1 -1
- package/dist/core/extensions/loader-discovery.js.map +1 -1
- package/dist/core/extensions/loader-resources.d.ts.map +1 -1
- package/dist/core/extensions/loader-resources.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +23 -11
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts +17 -0
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +281 -20
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -2
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
- package/dist/core/extensions/reactive-widget.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +27 -1
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +52 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +18 -6
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +3 -1
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/session-events.d.ts.map +1 -1
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/extensions/types.d.ts +15 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +16 -2
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/fallback-models.d.ts.map +1 -1
- package/dist/core/fallback-models.js +11 -2
- package/dist/core/fallback-models.js.map +1 -1
- package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
- package/dist/core/flattened-tool-arguments.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +5 -3
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-capabilities.d.ts.map +1 -1
- package/dist/core/model-capabilities.js +1 -2
- package/dist/core/model-capabilities.js.map +1 -1
- package/dist/core/model-resolver-cli.d.ts.map +1 -1
- package/dist/core/model-resolver-cli.js.map +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts +1 -1
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js +1 -1
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver-patterns.d.ts.map +1 -1
- package/dist/core/model-resolver-patterns.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +1 -1
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.js +12 -2
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-resolver-types.d.ts.map +1 -1
- package/dist/core/model-resolver-types.js.map +1 -1
- package/dist/core/model-resolver.d.ts +3 -3
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime-auth.d.ts.map +1 -1
- package/dist/core/model-runtime-auth.js +5 -2
- package/dist/core/model-runtime-auth.js.map +1 -1
- package/dist/core/model-runtime-restoration.d.ts.map +1 -1
- package/dist/core/model-runtime-restoration.js +2 -2
- package/dist/core/model-runtime-restoration.js.map +1 -1
- package/dist/core/model-runtime-snapshot.d.ts.map +1 -1
- package/dist/core/model-runtime-snapshot.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +9 -7
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/oauth-login.d.ts.map +1 -1
- package/dist/core/oauth-login.js +7 -2
- package/dist/core/oauth-login.js.map +1 -1
- package/dist/core/oauth-provider-metadata.d.ts.map +1 -1
- package/dist/core/oauth-provider-metadata.js +20 -6
- package/dist/core/oauth-provider-metadata.js.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.js.map +1 -1
- package/dist/core/output-guard.d.ts +44 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +63 -0
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
- package/dist/core/package-manager-auto-resources.js +6 -1
- package/dist/core/package-manager-auto-resources.js.map +1 -1
- package/dist/core/package-manager-git.d.ts.map +1 -1
- package/dist/core/package-manager-git.js +27 -11
- package/dist/core/package-manager-git.js.map +1 -1
- package/dist/core/package-manager-npm.d.ts.map +1 -1
- package/dist/core/package-manager-npm.js +4 -2
- package/dist/core/package-manager-npm.js.map +1 -1
- package/dist/core/package-manager-operations.d.ts.map +1 -1
- package/dist/core/package-manager-operations.js +2 -2
- package/dist/core/package-manager-operations.js.map +1 -1
- package/dist/core/package-manager-paths.d.ts.map +1 -1
- package/dist/core/package-manager-paths.js.map +1 -1
- package/dist/core/package-manager-resolver.d.ts.map +1 -1
- package/dist/core/package-manager-resolver.js +19 -16
- package/dist/core/package-manager-resolver.js.map +1 -1
- package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
- package/dist/core/package-manager-resource-collector.js +6 -6
- package/dist/core/package-manager-resource-collector.js.map +1 -1
- package/dist/core/package-manager-resource-files.d.ts.map +1 -1
- package/dist/core/package-manager-resource-files.js +4 -3
- package/dist/core/package-manager-resource-files.js.map +1 -1
- package/dist/core/package-manager-resource-patterns.d.ts.map +1 -1
- package/dist/core/package-manager-resource-patterns.js.map +1 -1
- package/dist/core/package-manager-settings.d.ts.map +1 -1
- package/dist/core/package-manager-settings.js +3 -2
- package/dist/core/package-manager-settings.js.map +1 -1
- package/dist/core/package-manager-source.d.ts.map +1 -1
- package/dist/core/package-manager-source.js +1 -1
- package/dist/core/package-manager-source.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +2 -3
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates-async.d.ts.map +1 -1
- package/dist/core/prompt-templates-async.js +15 -7
- package/dist/core/prompt-templates-async.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +1 -3
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +1 -1
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-context-usage.d.ts.map +1 -1
- package/dist/core/provider-context-usage.js +2 -1
- package/dist/core/provider-context-usage.js.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +31 -7
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-context-files.d.ts +6 -0
- package/dist/core/resource-loader-context-files.d.ts.map +1 -1
- package/dist/core/resource-loader-context-files.js +83 -4
- package/dist/core/resource-loader-context-files.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +12 -3
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +36 -19
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-discovery.d.ts.map +1 -1
- package/dist/core/resource-loader-discovery.js.map +1 -1
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.js +33 -21
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-internals.d.ts +13 -6
- package/dist/core/resource-loader-internals.d.ts.map +1 -1
- package/dist/core/resource-loader-internals.js.map +1 -1
- package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
- package/dist/core/resource-loader-package-resources.js +1 -1
- package/dist/core/resource-loader-package-resources.js.map +1 -1
- package/dist/core/resource-loader-paths.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +28 -13
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-source-info.d.ts +1 -1
- package/dist/core/resource-loader-source-info.d.ts.map +1 -1
- package/dist/core/resource-loader-source-info.js +1 -1
- package/dist/core/resource-loader-source-info.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +9 -3
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/resource-loader.d.ts +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk-exports.d.ts +1 -1
- package/dist/core/sdk-exports.d.ts.map +1 -1
- package/dist/core/sdk-exports.js +2 -2
- package/dist/core/sdk-exports.js.map +1 -1
- package/dist/core/sdk-types.d.ts +3 -3
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -20
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-archive.d.ts.map +1 -1
- package/dist/core/session-manager-archive.js +5 -2
- package/dist/core/session-manager-archive.js.map +1 -1
- package/dist/core/session-manager-classification.js +3 -3
- package/dist/core/session-manager-classification.js.map +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +3 -3
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +1 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +13 -5
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +1 -1
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-migrations.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager.d.ts +4 -4
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +2 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager-ui-accessors.js +2 -1
- package/dist/core/settings-manager-ui-accessors.js.map +1 -1
- package/dist/core/settings-storage.d.ts.map +1 -1
- package/dist/core/settings-storage.js +3 -3
- package/dist/core/settings-storage.js.map +1 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/skills-async.d.ts.map +1 -1
- package/dist/core/skills-async.js +18 -8
- package/dist/core/skills-async.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +76 -19
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -19
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/thinking-blocks.d.ts.map +1 -1
- package/dist/core/thinking-blocks.js +2 -2
- package/dist/core/thinking-blocks.js.map +1 -1
- package/dist/core/tools/artifact-protocol.d.ts.map +1 -1
- package/dist/core/tools/artifact-protocol.js.map +1 -1
- package/dist/core/tools/artifacts.d.ts.map +1 -1
- package/dist/core/tools/artifacts.js.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js +2 -4
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/body-residual-spacer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/body-residual-spacer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js +1 -3
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/tab-bar.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/tab-bar.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.js +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.js +2 -4
- package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js +2 -9
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js.map +1 -1
- package/dist/core/tools/bash-async-execution.d.ts.map +1 -1
- package/dist/core/tools/bash-async-execution.js +11 -4
- package/dist/core/tools/bash-async-execution.js.map +1 -1
- package/dist/core/tools/bash-async-jobs.d.ts.map +1 -1
- package/dist/core/tools/bash-async-jobs.js +14 -2
- package/dist/core/tools/bash-async-jobs.js.map +1 -1
- package/dist/core/tools/bash-async-output.d.ts.map +1 -1
- package/dist/core/tools/bash-async-output.js +6 -2
- package/dist/core/tools/bash-async-output.js.map +1 -1
- package/dist/core/tools/bash-interceptor.d.ts.map +1 -1
- package/dist/core/tools/bash-interceptor.js +20 -4
- package/dist/core/tools/bash-interceptor.js.map +1 -1
- package/dist/core/tools/bash-leading-cd.d.ts.map +1 -1
- package/dist/core/tools/bash-leading-cd.js +9 -3
- package/dist/core/tools/bash-leading-cd.js.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash-session-environment.d.ts.map +1 -1
- package/dist/core/tools/bash-session-environment.js +24 -12
- package/dist/core/tools/bash-session-environment.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +123 -27
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/block-resolver.d.ts.map +1 -1
- package/dist/core/tools/block-resolver.js.map +1 -1
- package/dist/core/tools/conflict-registry.d.ts.map +1 -1
- package/dist/core/tools/conflict-registry.js.map +1 -1
- package/dist/core/tools/directory-tree.d.ts.map +1 -1
- package/dist/core/tools/directory-tree.js +20 -4
- package/dist/core/tools/directory-tree.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +37 -13
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/fetch-url.d.ts.map +1 -1
- package/dist/core/tools/fetch-url.js +127 -41
- package/dist/core/tools/fetch-url.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +176 -46
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +43 -10
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/hashline-engine/apply.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/apply.js +6 -6
- package/dist/core/tools/hashline-engine/apply.js.map +1 -1
- package/dist/core/tools/hashline-engine/block.js +1 -1
- package/dist/core/tools/hashline-engine/block.js.map +1 -1
- package/dist/core/tools/hashline-engine/format.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/format.js +1 -1
- package/dist/core/tools/hashline-engine/format.js.map +1 -1
- package/dist/core/tools/hashline-engine/input.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/input.js +7 -7
- package/dist/core/tools/hashline-engine/input.js.map +1 -1
- package/dist/core/tools/hashline-engine/parser.js +1 -1
- package/dist/core/tools/hashline-engine/parser.js.map +1 -1
- package/dist/core/tools/hashline-engine/patcher.js +5 -5
- package/dist/core/tools/hashline-engine/patcher.js.map +1 -1
- package/dist/core/tools/hashline-engine/prefixes.js +4 -4
- package/dist/core/tools/hashline-engine/prefixes.js.map +1 -1
- package/dist/core/tools/hashline-engine/recovery.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/recovery.js +4 -2
- package/dist/core/tools/hashline-engine/recovery.js.map +1 -1
- package/dist/core/tools/hashline-engine/snapshots.js +5 -5
- package/dist/core/tools/hashline-engine/snapshots.js.map +1 -1
- package/dist/core/tools/hashline.d.ts.map +1 -1
- package/dist/core/tools/hashline.js +24 -13
- package/dist/core/tools/hashline.js.map +1 -1
- package/dist/core/tools/index.d.ts +6 -6
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +6 -6
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/notebook.d.ts.map +1 -1
- package/dist/core/tools/notebook.js +13 -3
- package/dist/core/tools/notebook.js.map +1 -1
- package/dist/core/tools/read-document-extract.d.ts.map +1 -1
- package/dist/core/tools/read-document-extract.js +30 -10
- package/dist/core/tools/read-document-extract.js.map +1 -1
- package/dist/core/tools/read-selectors.d.ts.map +1 -1
- package/dist/core/tools/read-selectors.js +59 -15
- package/dist/core/tools/read-selectors.js.map +1 -1
- package/dist/core/tools/read-url.d.ts.map +1 -1
- package/dist/core/tools/read-url.js +41 -7
- package/dist/core/tools/read-url.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +306 -71
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/resource-selectors.d.ts +4 -0
- package/dist/core/tools/resource-selectors.d.ts.map +1 -1
- package/dist/core/tools/resource-selectors.js +324 -84
- package/dist/core/tools/resource-selectors.js.map +1 -1
- package/dist/core/tools/search-details.d.ts.map +1 -1
- package/dist/core/tools/search-details.js +13 -1
- package/dist/core/tools/search-details.js.map +1 -1
- package/dist/core/tools/search-line-ranges.d.ts.map +1 -1
- package/dist/core/tools/search-line-ranges.js +5 -2
- package/dist/core/tools/search-line-ranges.js.map +1 -1
- package/dist/core/tools/search-native.d.ts.map +1 -1
- package/dist/core/tools/search-native.js.map +1 -1
- package/dist/core/tools/search.d.ts.map +1 -1
- package/dist/core/tools/search.js +244 -90
- package/dist/core/tools/search.js.map +1 -1
- package/dist/core/tools/structured-output.d.ts +1 -1
- package/dist/core/tools/structured-output.d.ts.map +1 -1
- package/dist/core/tools/structured-output.js.map +1 -1
- package/dist/core/tools/todos-execute.d.ts.map +1 -1
- package/dist/core/tools/todos-execute.js +4 -4
- package/dist/core/tools/todos-execute.js.map +1 -1
- package/dist/core/tools/todos-locks.d.ts.map +1 -1
- package/dist/core/tools/todos-locks.js.map +1 -1
- package/dist/core/tools/todos-mutations.js +1 -1
- package/dist/core/tools/todos-mutations.js.map +1 -1
- package/dist/core/tools/todos-paths.js +2 -2
- package/dist/core/tools/todos-paths.js.map +1 -1
- package/dist/core/tools/todos-render.d.ts.map +1 -1
- package/dist/core/tools/todos-render.js +2 -2
- package/dist/core/tools/todos-render.js.map +1 -1
- package/dist/core/tools/todos-storage.d.ts.map +1 -1
- package/dist/core/tools/todos-storage.js +1 -2
- package/dist/core/tools/todos-storage.js.map +1 -1
- package/dist/core/tools/todos-types.d.ts.map +1 -1
- package/dist/core/tools/todos-types.js +1 -11
- package/dist/core/tools/todos-types.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -6
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/url-ip-guards.d.ts.map +1 -1
- package/dist/core/tools/url-ip-guards.js +27 -17
- package/dist/core/tools/url-ip-guards.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +88 -29
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +5 -2
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/core/workflow-stage-admission.d.ts.map +1 -1
- package/dist/core/workflow-stage-admission.js +8 -2
- package/dist/core/workflow-stage-admission.js.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/index-extensions.d.ts +2 -2
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/main-deferred-startup.d.ts +1 -1
- package/dist/main-deferred-startup.d.ts.map +1 -1
- package/dist/main-deferred-startup.js +16 -15
- package/dist/main-deferred-startup.js.map +1 -1
- package/dist/main-early-input.js.map +1 -1
- package/dist/main-first-time-setup.d.ts +1 -1
- package/dist/main-first-time-setup.d.ts.map +1 -1
- package/dist/main-first-time-setup.js.map +1 -1
- package/dist/main-session-options.d.ts +1 -1
- package/dist/main-session-options.d.ts.map +1 -1
- package/dist/main-session-options.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +4 -4
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +143 -38
- package/dist/main.js.map +1 -1
- package/dist/migrations-config-values.d.ts.map +1 -1
- package/dist/migrations-config-values.js +3 -1
- package/dist/migrations-config-values.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
- package/dist/modes/interactive/chat-input-actions.js +3 -6
- package/dist/modes/interactive/chat-input-actions.js.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.js +7 -5
- package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.js +26 -13
- package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +6 -5
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts +3 -2
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +14 -18
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.d.ts +4 -4
- package/dist/modes/interactive/components/chat-session-host-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.js +9 -4
- package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +9 -8
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +22 -7
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +9 -2
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.js +15 -13
- package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +2 -2
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.d.ts +9 -2
- package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.js +3 -8
- package/dist/modes/interactive/components/chat-session-host-utils.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +4 -4
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +1 -2
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.d.ts +1 -1
- package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.js +5 -12
- package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +18 -7
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.js +4 -2
- package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-project-scope.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector-project-scope.js +2 -4
- package/dist/modes/interactive/components/config-selector-project-scope.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +15 -6
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +11 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +21 -5
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -3
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.js +2 -2
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +15 -4
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +16 -15
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.d.ts.map +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.js +4 -2
- package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form.d.ts.map +1 -1
- package/dist/modes/interactive/components/host-input-form.js +55 -21
- package/dist/modes/interactive/components/host-input-form.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.d.ts.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.js +8 -3
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +7 -7
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +4 -4
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +12 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +5 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -1
- package/dist/modes/interactive/components/startup-identity.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.js +1 -9
- package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-viewport.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-viewport.js.map +1 -1
- package/dist/modes/interactive/components/working-status.d.ts.map +1 -1
- package/dist/modes/interactive/components/working-status.js +1 -1
- package/dist/modes/interactive/components/working-status.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +20 -13
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +6 -6
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +3 -6
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +4 -10
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +18 -8
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +6 -2
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.js +6 -11
- package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-context.js +4 -4
- package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +15 -8
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +50 -24
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +9 -6
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-widgets.js +1 -1
- package/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
- package/dist/modes/interactive/interactive-global-clear.d.ts +45 -1
- package/dist/modes/interactive/interactive-global-clear.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-global-clear.js +60 -4
- package/dist/modes/interactive/interactive-global-clear.js.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.js +2 -3
- package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +55 -20
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-key-identity.d.ts +22 -0
- package/dist/modes/interactive/interactive-key-identity.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-key-identity.js +29 -0
- package/dist/modes/interactive/interactive-key-identity.js.map +1 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts +7 -6
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +12 -12
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +20 -20
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +16 -16
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +3 -9
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +8 -7
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js +1 -0
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.js +2 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +6 -6
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-onboarding.js +7 -7
- package/dist/modes/interactive/interactive-onboarding.js.map +1 -1
- package/dist/modes/interactive/interactive-pause.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +38 -8
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-restore.d.ts +58 -0
- package/dist/modes/interactive/interactive-prompt-restore.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-prompt-restore.js +87 -0
- package/dist/modes/interactive/interactive-prompt-restore.js.map +1 -0
- package/dist/modes/interactive/interactive-prompt-turn.js +18 -3
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +3 -7
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +47 -36
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.js +1 -3
- package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-paths.js +6 -19
- package/dist/modes/interactive/interactive-resource-paths.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +15 -16
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +3 -5
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +16 -4
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +11 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +11 -6
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +9 -11
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-submission.d.ts +24 -0
- package/dist/modes/interactive/interactive-submission.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-submission.js +10 -0
- package/dist/modes/interactive/interactive-submission.js.map +1 -0
- package/dist/modes/interactive/interactive-summarization-retry-events.d.ts +1 -1
- package/dist/modes/interactive/interactive-summarization-retry-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-summarization-retry-events.js +4 -2
- package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -1
- package/dist/modes/interactive/login-provider-options.d.ts.map +1 -1
- package/dist/modes/interactive/login-provider-options.js +1 -2
- package/dist/modes/interactive/login-provider-options.js.map +1 -1
- package/dist/modes/interactive/theme/global-theme.d.ts +1 -1
- package/dist/modes/interactive/theme/global-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/global-theme.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.js +1 -1
- package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +2 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +2 -2
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/whimsical-messages.d.ts.map +1 -1
- package/dist/modes/interactive/whimsical-messages.js.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.d.ts +16 -6
- package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.js +12 -6
- package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js +5 -4
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-child-liveness.js +6 -4
- package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +3 -2
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +32 -11
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts +16 -0
- package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-diagnostic-view.js +19 -0
- package/dist/modes/interactive-engine/engine-diagnostic-view.js.map +1 -0
- package/dist/modes/interactive-engine/engine-dialog-host.d.ts +33 -0
- package/dist/modes/interactive-engine/engine-dialog-host.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-dialog-host.js +129 -0
- package/dist/modes/interactive-engine/engine-dialog-host.js.map +1 -0
- package/dist/modes/interactive-engine/engine-generation.d.ts +29 -0
- package/dist/modes/interactive-engine/engine-generation.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-generation.js +11 -0
- package/dist/modes/interactive-engine/engine-generation.js.map +1 -0
- package/dist/modes/interactive-engine/engine-health.d.ts +101 -0
- package/dist/modes/interactive-engine/engine-health.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-health.js +236 -0
- package/dist/modes/interactive-engine/engine-health.js.map +1 -0
- package/dist/modes/interactive-engine/engine-input-form.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-input-form.js +12 -3
- package/dist/modes/interactive-engine/engine-input-form.js.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.js +7 -2
- package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
- package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-render-service.js +11 -5
- package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.js +4 -2
- package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +14 -3
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +32 -45
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/input-form-host.d.ts +1 -0
- package/dist/modes/interactive-engine/input-form-host.d.ts.map +1 -1
- package/dist/modes/interactive-engine/input-form-host.js +12 -2
- package/dist/modes/interactive-engine/input-form-host.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +32 -6
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +122 -59
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +20 -1
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +183 -55
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts +38 -0
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +111 -22
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/interactive-engine/remote-input-ownership.d.ts +48 -0
- package/dist/modes/interactive-engine/remote-input-ownership.d.ts.map +1 -0
- package/dist/modes/interactive-engine/remote-input-ownership.js +42 -0
- package/dist/modes/interactive-engine/remote-input-ownership.js.map +1 -0
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +10 -4
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/interactive-engine/remote-queue-pause.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-queue-pause.js.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js +38 -10
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/dist/modes/interactive-engine/session-picker-host.d.ts +1 -0
- package/dist/modes/interactive-engine/session-picker-host.d.ts.map +1 -1
- package/dist/modes/interactive-engine/session-picker-host.js +4 -0
- package/dist/modes/interactive-engine/session-picker-host.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +7 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +17 -1
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/queued-writer.d.ts +14 -0
- package/dist/modes/rpc/queued-writer.d.ts.map +1 -1
- package/dist/modes/rpc/queued-writer.js +33 -9
- package/dist/modes/rpc/queued-writer.js.map +1 -1
- package/dist/modes/rpc/rpc-bash-request-owners.js +1 -1
- package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +3 -3
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +63 -22
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +10 -0
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +72 -15
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client-waits.d.ts +17 -1
- package/dist/modes/rpc/rpc-client-waits.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-waits.js +25 -0
- package/dist/modes/rpc/rpc-client-waits.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +61 -6
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +200 -145
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts +2 -2
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +35 -13
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-command-timeouts.d.ts +30 -0
- package/dist/modes/rpc/rpc-command-timeouts.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-timeouts.js +52 -0
- package/dist/modes/rpc/rpc-command-timeouts.js.map +1 -0
- package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.js +3 -1
- package/dist/modes/rpc/rpc-event-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.js +44 -16
- package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
- package/dist/modes/rpc/rpc-generation-buffer.d.ts +21 -0
- package/dist/modes/rpc/rpc-generation-buffer.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-generation-buffer.js +35 -0
- package/dist/modes/rpc/rpc-generation-buffer.js.map +1 -0
- package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.js +13 -6
- package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
- package/dist/modes/rpc/rpc-input.d.ts +7 -1
- package/dist/modes/rpc/rpc-input.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input.js +14 -4
- package/dist/modes/rpc/rpc-input.js.map +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +17 -18
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-oauth-client.d.ts +1 -2
- package/dist/modes/rpc/rpc-oauth-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-oauth-client.js +11 -4
- package/dist/modes/rpc/rpc-oauth-client.js.map +1 -1
- package/dist/modes/rpc/rpc-oauth-interaction.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-oauth-interaction.js.map +1 -1
- package/dist/modes/rpc/rpc-output-buffer.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-output-buffer.js +3 -1
- package/dist/modes/rpc/rpc-output-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-pending-requests.d.ts +37 -0
- package/dist/modes/rpc/rpc-pending-requests.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-pending-requests.js +57 -0
- package/dist/modes/rpc/rpc-pending-requests.js.map +1 -0
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +24 -5
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-responses.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +7 -2
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/modes/rpc/rpc-terminal-drain.d.ts +52 -0
- package/dist/modes/rpc/rpc-terminal-drain.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-terminal-drain.js +85 -0
- package/dist/modes/rpc/rpc-terminal-drain.js.map +1 -0
- package/dist/modes/rpc/rpc-transport-error.d.ts +49 -0
- package/dist/modes/rpc/rpc-transport-error.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-transport-error.js +78 -0
- package/dist/modes/rpc/rpc-transport-error.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +10 -8
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli-parser.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +22 -11
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/fs-watch.d.ts.map +1 -1
- package/dist/utils/fs-watch.js +1 -3
- package/dist/utils/fs-watch.js.map +1 -1
- package/dist/utils/git.js +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +67 -0
- package/dist/utils/interactive-engine-bootstrap.d.ts.map +1 -0
- package/dist/utils/interactive-engine-bootstrap.js +117 -0
- package/dist/utils/interactive-engine-bootstrap.js.map +1 -0
- package/dist/utils/interactive-engine-env.d.ts +41 -0
- package/dist/utils/interactive-engine-env.d.ts.map +1 -0
- package/dist/utils/interactive-engine-env.js +67 -0
- package/dist/utils/interactive-engine-env.js.map +1 -0
- package/dist/utils/markit.d.ts.map +1 -1
- package/dist/utils/markit.js +15 -5
- package/dist/utils/markit.js.map +1 -1
- package/dist/utils/shell.js +2 -2
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/split-launcher.d.ts.map +1 -1
- package/dist/utils/split-launcher.js +1 -2
- package/dist/utils/split-launcher.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +8 -34
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/changelog.mdx +11 -0
- package/docs/custom-provider.md +26 -3
- package/docs/development.md +14 -15
- package/docs/extensions.md +60 -2
- package/docs/keybindings.md +13 -1
- package/docs/providers.md +15 -2
- package/docs/rpc.md +1 -1
- package/docs/security.md +15 -0
- package/docs/session-format.md +2 -0
- package/docs/usage.md +34 -0
- package/docs/workflows.md +86 -9
- package/examples/extensions/border-status-editor.ts +1 -6
- package/examples/extensions/custom-compaction.ts +7 -2
- package/examples/extensions/custom-footer.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +14 -2
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
- package/examples/extensions/gondolin/index.ts +1 -1
- package/examples/extensions/handoff.ts +2 -2
- package/examples/extensions/hello.ts +1 -1
- package/examples/extensions/minimal-mode.ts +6 -6
- package/examples/extensions/overlay-qa-focus-components.ts +0 -1
- package/examples/extensions/overlay-qa-streaming-input-components.ts +2 -2
- package/examples/extensions/overlay-qa-tests.ts +16 -14
- package/examples/extensions/overlay-qa-toggle-passive-components.ts +3 -5
- package/examples/extensions/overlay-test.ts +3 -6
- package/examples/extensions/plan-mode/index.ts +1 -1
- package/examples/extensions/preset.ts +1 -1
- package/examples/extensions/qna.ts +1 -1
- package/examples/extensions/structured-output.ts +9 -9
- package/examples/extensions/subagent/display.ts +115 -127
- package/examples/extensions/subagent/index.ts +310 -349
- package/examples/extensions/subagent/render.ts +244 -345
- package/examples/extensions/subagent/runner.ts +223 -230
- package/examples/extensions/subagent/schemas.ts +39 -46
- package/examples/extensions/subagent/types.ts +22 -22
- package/examples/extensions/summarize.ts +2 -2
- package/examples/extensions/tic-tac-toe.ts +4 -4
- package/examples/extensions/todo.ts +1 -1
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/trigger-compact.ts +4 -1
- package/examples/extensions/working-indicator.ts +2 -1
- package/examples/rpc-extension-ui-components.ts +1 -2
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -6
- package/examples/sdk/06-extensions.ts +1 -6
- package/examples/sdk/07-context-files.ts +1 -6
- package/examples/sdk/12-full-control.ts +1 -1
- package/npm-shrinkwrap.json +300 -303
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-npm.js","sourceRoot":"","sources":["../../src/core/package-manager-npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAA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,GAAG;YAChB,SAAS,EAAE,kBAAkB;SAC7B,CAAC;QACH,CAAC,CAAC,MAAM,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE;YAC5G,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,SAAS,EAAE,kBAAkB;SAC7B,CAAC,CAAC;IACL,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAsB,CAAC;IACpD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzF,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC3B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, join } from \"node:path\";\nimport { maxSatisfying, rcompare, satisfies } from \"semver\";\nimport { APP_NAME, CONFIG_DIR_NAME, getProjectConfigDirs } from \"../config.ts\";\nimport { markPathIgnoredByCloudSync } from \"../utils/paths.ts\";\nimport { NETWORK_TIMEOUT_MS } from \"./package-manager-constants.ts\";\nimport { runCommand, runCommandCapture, runCommandSync } from \"./package-manager-command.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport { getNpmInstallRoot } from \"./package-manager-paths.ts\";\nimport type { InstalledSourceScope, NpmSource, PackageManagerContext, SourceScope } from \"./package-manager-types.ts\";\n\nexport function getNpmCommand(context: PackageManagerContext): { command: string; args: string[] } {\n\tconst configuredCommand = context.settingsManager.getNpmCommand();\n\tif (!configuredCommand || configuredCommand.length === 0) {\n\t\treturn { command: \"npm\", args: [] };\n\t}\n\tconst [command, ...args] = configuredCommand;\n\tif (!command) {\n\t\tthrow new Error(\"Invalid npmCommand: first array entry must be a non-empty command\");\n\t}\n\treturn { command, args };\n}\n\nexport function getPackageManagerName(context: PackageManagerContext): string {\n\tconst npmCommand = getNpmCommand(context);\n\tconst commandParts = [npmCommand.command, ...npmCommand.args];\n\tconst separatorIndex = commandParts.lastIndexOf(\"--\");\n\tconst packageManagerCommand = separatorIndex >= 0 ? commandParts[separatorIndex + 1] : npmCommand.command;\n\treturn packageManagerCommand ? basename(packageManagerCommand).replace(/\\.(cmd|exe)$/i, \"\") : \"\";\n}\n\nexport async function runNpmCommand(\n\tcontext: PackageManagerContext,\n\targs: string[],\n\toptions?: { cwd?: string },\n): Promise<void> {\n\tconst npmCommand = getNpmCommand(context);\n\tif (context.driver) {\n\t\tawait context.driver.runCommand(npmCommand.command, [...npmCommand.args, ...args], options);\n\t\treturn;\n\t}\n\tawait runCommand(npmCommand.command, [...npmCommand.args, ...args], options);\n}\n\nexport function runNpmCommandSync(context: PackageManagerContext, args: string[]): string {\n\tconst npmCommand = getNpmCommand(context);\n\tif (context.driver) {\n\t\treturn context.driver.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);\n\t}\n\treturn runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);\n}\n\nexport function getGitDependencyInstallArgs(context: PackageManagerContext): string[] {\n\tconst configuredCommand = context.settingsManager.getNpmCommand();\n\tif (configuredCommand && configuredCommand.length > 0) {\n\t\treturn [\"install\"];\n\t}\n\treturn [\"install\", \"--omit=dev\"];\n}\n\nexport function getNpmInstallArgs(\n\tcontext: PackageManagerContext,\n\tspecs: string[],\n\tinstallRoot: string,\n): string[] {\n\tconst packageManagerName = getPackageManagerName(context);\n\tif (packageManagerName === \"bun\") {\n\t\treturn [\"install\", ...specs, \"--cwd\", installRoot, \"--omit=peer\"];\n\t}\n\tif (packageManagerName === \"pnpm\") {\n\t\treturn [\n\t\t\t\"install\",\n\t\t\t...specs,\n\t\t\t\"--prefix\",\n\t\t\tinstallRoot,\n\t\t\t\"--config.auto-install-peers=false\",\n\t\t\t\"--config.strict-peer-dependencies=false\",\n\t\t\t\"--config.strict-dep-builds=false\",\n\t\t];\n\t}\n\treturn [\"install\", ...specs, \"--prefix\", installRoot, \"--legacy-peer-deps\"];\n}\n\nexport async function installNpm(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n\ttemporary: boolean,\n): Promise<void> {\n\tconst installRoot = getNpmInstallRoot(context, scope, temporary);\n\tensureNpmProject(installRoot);\n\tawait runNpmCommand(context, getNpmInstallArgs(context, [source.spec], installRoot));\n}\n\nexport async function uninstallNpm(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n): Promise<void> {\n\tconst installRoot = getNpmInstallRoot(context, scope, false);\n\tif (!existsSync(installRoot)) {\n\t\treturn;\n\t}\n\tif (getPackageManagerName(context) === \"bun\") {\n\t\tawait runNpmCommand(context, [\"uninstall\", source.name, \"--cwd\", installRoot]);\n\t\treturn;\n\t}\n\tawait runNpmCommand(context, [\"uninstall\", source.name, \"--prefix\", installRoot]);\n}\n\nexport async function installNpmBatch(\n\tcontext: PackageManagerContext,\n\tspecs: string[],\n\tscope: InstalledSourceScope,\n): Promise<void> {\n\tconst installRoot = getNpmInstallRoot(context, scope, false);\n\tensureNpmProject(installRoot);\n\tawait runNpmCommand(context, getNpmInstallArgs(context, specs, installRoot));\n}\n\nfunction ensureNpmProject(installRoot: string): void {\n\tif (!existsSync(installRoot)) {\n\t\tmkdirSync(installRoot, { recursive: true });\n\t}\n\tmarkPathIgnoredByCloudSync(installRoot);\n\tensureGitIgnore(installRoot);\n\tconst packageJsonPath = join(installRoot, \"package.json\");\n\tif (!existsSync(packageJsonPath)) {\n\t\tconst pkgJson = { name: `${APP_NAME}-extensions`, private: true };\n\t\twriteFileSync(packageJsonPath, JSON.stringify(pkgJson, null, 2), \"utf-8\");\n\t}\n}\n\nexport function ensureGitIgnore(dir: string): void {\n\tif (!existsSync(dir)) {\n\t\tmkdirSync(dir, { recursive: true });\n\t}\n\tconst ignorePath = join(dir, \".gitignore\");\n\tif (!existsSync(ignorePath)) {\n\t\twriteFileSync(ignorePath, \"*\\n!.gitignore\\n\", \"utf-8\");\n\t}\n}\n\nexport function getManagedNpmInstallPath(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n): string {\n\tif (scope === \"temporary\") {\n\t\treturn join(getNpmInstallRoot(context, scope, true), \"node_modules\", source.name);\n\t}\n\tif (scope === \"project\") {\n\t\treturn join(context.cwd, CONFIG_DIR_NAME, \"npm\", \"node_modules\", source.name);\n\t}\n\treturn join(context.agentDir, \"npm\", \"node_modules\", source.name);\n}\n\nexport function getGlobalNpmRoot(context: PackageManagerContext): string {\n\tconst npmCommand = getNpmCommand(context);\n\tconst commandKey = [npmCommand.command, ...npmCommand.args].join(\"\\0\");\n\tif (context.globalNpmRoot && context.globalNpmRootCommandKey === commandKey) {\n\t\treturn context.globalNpmRoot;\n\t}\n\tif (getPackageManagerName(context) === \"bun\") {\n\t\tconst binDir = runNpmCommandSync(context, [\"pm\", \"bin\", \"-g\"]).trim();\n\t\tcontext.globalNpmRoot = join(dirname(binDir), \"install\", \"global\", \"node_modules\");\n\t} else {\n\t\tcontext.globalNpmRoot = runNpmCommandSync(context, [\"root\", \"-g\"]).trim();\n\t}\n\tcontext.globalNpmRootCommandKey = commandKey;\n\treturn context.globalNpmRoot;\n}\n\nfunction getPnpmGlobalPackagePath(context: PackageManagerContext, packageName: string): string | undefined {\n\tif (getPackageManagerName(context) !== \"pnpm\") {\n\t\treturn undefined;\n\t}\n\tconst output = runNpmCommandSync(context, [\"list\", \"-g\", \"--depth\", \"0\", \"--json\"]);\n\tconst entries = JSON.parse(output) as Array<{ dependencies?: Record<string, { path?: string }> }>;\n\tfor (const entry of entries) {\n\t\tconst path = entry.dependencies?.[packageName]?.path;\n\t\tif (path) return path;\n\t}\n\treturn undefined;\n}\n\nfunction getLegacyGlobalNpmInstallPath(context: PackageManagerContext, source: NpmSource): string | undefined {\n\ttry {\n\t\tconst pnpmPath = getPnpmGlobalPackagePath(context, source.name);\n\t\tif (pnpmPath) return pnpmPath;\n\t\tconst globalRoot = context.driver?.getGlobalNpmRoot ? context.driver.getGlobalNpmRoot() : getGlobalNpmRoot(context);\n\t\treturn join(globalRoot, source.name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function getNpmInstallPath(context: PackageManagerContext, source: NpmSource, scope: SourceScope): string {\n\tconst managedPath = getManagedNpmInstallPath(context, source, scope);\n\tif (scope !== \"user\" || existsSync(managedPath)) {\n\t\treturn managedPath;\n\t}\n\tconst legacyPath = getLegacyGlobalNpmInstallPath(context, source);\n\treturn legacyPath && existsSync(legacyPath) ? legacyPath : managedPath;\n}\n\nexport function getExistingNpmInstallPath(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n): string | undefined {\n\tconst candidates = [getNpmInstallPath(context, source, scope)];\n\tif (scope === \"project\") {\n\t\tfor (const configDir of getProjectConfigDirs(context.cwd)) {\n\t\t\tcandidates.push(join(configDir, \"npm\", \"node_modules\", source.name));\n\t\t}\n\t}\n\tfor (const candidate of Array.from(new Set(candidates))) {\n\t\tif (existsSync(candidate)) return candidate;\n\t}\n\treturn undefined;\n}\n\nexport async function installedNpmMatchesConfiguredVersion(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tinstalledPath: string,\n): Promise<boolean> {\n\tconst installedVersion = getInstalledNpmVersion(installedPath);\n\tif (!installedVersion) return false;\n\tif (source.range) return satisfies(installedVersion, source.range);\n\tif (source.version !== undefined) {\n\t\tif (isOfflineModeEnabled()) return true;\n\t\ttry {\n\t\t\tconst targetVersion = await getLatestNpmVersion(context, source.spec);\n\t\t\treturn installedVersion === targetVersion;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport async function npmHasAvailableUpdate(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tinstalledPath: string,\n): Promise<boolean> {\n\tif (isOfflineModeEnabled()) return false;\n\tconst installedVersion = getInstalledNpmVersion(installedPath);\n\tif (!installedVersion) return false;\n\ttry {\n\t\tconst targetVersion = await getLatestNpmVersion(context, source.version ? source.spec : source.name, source.range);\n\t\treturn targetVersion !== installedVersion;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getInstalledNpmVersion(installedPath: string): string | undefined {\n\tconst packageJsonPath = join(installedPath, \"package.json\");\n\tif (!existsSync(packageJsonPath)) return undefined;\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\");\n\t\tconst pkg = JSON.parse(content) as { version?: string };\n\t\treturn pkg.version;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport async function getLatestNpmVersion(\n\tcontext: PackageManagerContext,\n\tpackageSpec: string,\n\trange?: string,\n): Promise<string> {\n\tconst npmCommand = getNpmCommand(context);\n\tconst stdout = context.driver\n\t\t? await context.driver.runCommandCapture(npmCommand.command, [...npmCommand.args, \"view\", packageSpec, \"version\", \"--json\"], {\n\t\t\t\tcwd: context.cwd,\n\t\t\t\ttimeoutMs: NETWORK_TIMEOUT_MS,\n\t\t\t})\n\t\t: await runCommandCapture(npmCommand.command, [...npmCommand.args, \"view\", packageSpec, \"version\", \"--json\"], {\n\t\t\t\tcwd: context.cwd,\n\t\t\t\ttimeoutMs: NETWORK_TIMEOUT_MS,\n\t\t\t});\n\tconst raw = stdout.trim();\n\tif (!raw) throw new Error(\"Empty response from npm view\");\n\tconst parsed = JSON.parse(raw) as string | string[];\n\tif (typeof parsed === \"string\") return parsed;\n\tif (Array.isArray(parsed)) {\n\t\tconst versions = parsed.filter((value) => typeof value === \"string\" && value.length > 0);\n\t\tconst latest = range ? maxSatisfying(versions, range) : [...versions].sort(rcompare)[0];\n\t\tif (latest) return latest;\n\t}\n\tthrow new Error(\"Unexpected response from npm view\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"package-manager-npm.js","sourceRoot":"","sources":["../../src/core/package-manager-npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,MAAM,UAAU,aAAa,CAAC,OAA8B;IAC3D,MAAM,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IAClE,IAAI,CAAC,iBAAiB,IA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AAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzF,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC3B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, join } from \"node:path\";\nimport { maxSatisfying, rcompare, satisfies } from \"semver\";\nimport { APP_NAME, CONFIG_DIR_NAME, getProjectConfigDirs } from \"../config.ts\";\nimport { markPathIgnoredByCloudSync } from \"../utils/paths.ts\";\nimport { runCommand, runCommandCapture, runCommandSync } from \"./package-manager-command.ts\";\nimport { NETWORK_TIMEOUT_MS } from \"./package-manager-constants.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport { getNpmInstallRoot } from \"./package-manager-paths.ts\";\nimport type { InstalledSourceScope, NpmSource, PackageManagerContext, SourceScope } from \"./package-manager-types.ts\";\n\nexport function getNpmCommand(context: PackageManagerContext): { command: string; args: string[] } {\n\tconst configuredCommand = context.settingsManager.getNpmCommand();\n\tif (!configuredCommand || configuredCommand.length === 0) {\n\t\treturn { command: \"npm\", args: [] };\n\t}\n\tconst [command, ...args] = configuredCommand;\n\tif (!command) {\n\t\tthrow new Error(\"Invalid npmCommand: first array entry must be a non-empty command\");\n\t}\n\treturn { command, args };\n}\n\nexport function getPackageManagerName(context: PackageManagerContext): string {\n\tconst npmCommand = getNpmCommand(context);\n\tconst commandParts = [npmCommand.command, ...npmCommand.args];\n\tconst separatorIndex = commandParts.lastIndexOf(\"--\");\n\tconst packageManagerCommand = separatorIndex >= 0 ? commandParts[separatorIndex + 1] : npmCommand.command;\n\treturn packageManagerCommand ? basename(packageManagerCommand).replace(/\\.(cmd|exe)$/i, \"\") : \"\";\n}\n\nexport async function runNpmCommand(\n\tcontext: PackageManagerContext,\n\targs: string[],\n\toptions?: { cwd?: string },\n): Promise<void> {\n\tconst npmCommand = getNpmCommand(context);\n\tif (context.driver) {\n\t\tawait context.driver.runCommand(npmCommand.command, [...npmCommand.args, ...args], options);\n\t\treturn;\n\t}\n\tawait runCommand(npmCommand.command, [...npmCommand.args, ...args], options);\n}\n\nexport function runNpmCommandSync(context: PackageManagerContext, args: string[]): string {\n\tconst npmCommand = getNpmCommand(context);\n\tif (context.driver) {\n\t\treturn context.driver.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);\n\t}\n\treturn runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);\n}\n\nexport function getGitDependencyInstallArgs(context: PackageManagerContext): string[] {\n\tconst configuredCommand = context.settingsManager.getNpmCommand();\n\tif (configuredCommand && configuredCommand.length > 0) {\n\t\treturn [\"install\"];\n\t}\n\treturn [\"install\", \"--omit=dev\"];\n}\n\nexport function getNpmInstallArgs(context: PackageManagerContext, specs: string[], installRoot: string): string[] {\n\tconst packageManagerName = getPackageManagerName(context);\n\tif (packageManagerName === \"bun\") {\n\t\treturn [\"install\", ...specs, \"--cwd\", installRoot, \"--omit=peer\"];\n\t}\n\tif (packageManagerName === \"pnpm\") {\n\t\treturn [\n\t\t\t\"install\",\n\t\t\t...specs,\n\t\t\t\"--prefix\",\n\t\t\tinstallRoot,\n\t\t\t\"--config.auto-install-peers=false\",\n\t\t\t\"--config.strict-peer-dependencies=false\",\n\t\t\t\"--config.strict-dep-builds=false\",\n\t\t];\n\t}\n\treturn [\"install\", ...specs, \"--prefix\", installRoot, \"--legacy-peer-deps\"];\n}\n\nexport async function installNpm(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n\ttemporary: boolean,\n): Promise<void> {\n\tconst installRoot = getNpmInstallRoot(context, scope, temporary);\n\tensureNpmProject(installRoot);\n\tawait runNpmCommand(context, getNpmInstallArgs(context, [source.spec], installRoot));\n}\n\nexport async function uninstallNpm(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n): Promise<void> {\n\tconst installRoot = getNpmInstallRoot(context, scope, false);\n\tif (!existsSync(installRoot)) {\n\t\treturn;\n\t}\n\tif (getPackageManagerName(context) === \"bun\") {\n\t\tawait runNpmCommand(context, [\"uninstall\", source.name, \"--cwd\", installRoot]);\n\t\treturn;\n\t}\n\tawait runNpmCommand(context, [\"uninstall\", source.name, \"--prefix\", installRoot]);\n}\n\nexport async function installNpmBatch(\n\tcontext: PackageManagerContext,\n\tspecs: string[],\n\tscope: InstalledSourceScope,\n): Promise<void> {\n\tconst installRoot = getNpmInstallRoot(context, scope, false);\n\tensureNpmProject(installRoot);\n\tawait runNpmCommand(context, getNpmInstallArgs(context, specs, installRoot));\n}\n\nfunction ensureNpmProject(installRoot: string): void {\n\tif (!existsSync(installRoot)) {\n\t\tmkdirSync(installRoot, { recursive: true });\n\t}\n\tmarkPathIgnoredByCloudSync(installRoot);\n\tensureGitIgnore(installRoot);\n\tconst packageJsonPath = join(installRoot, \"package.json\");\n\tif (!existsSync(packageJsonPath)) {\n\t\tconst pkgJson = { name: `${APP_NAME}-extensions`, private: true };\n\t\twriteFileSync(packageJsonPath, JSON.stringify(pkgJson, null, 2), \"utf-8\");\n\t}\n}\n\nexport function ensureGitIgnore(dir: string): void {\n\tif (!existsSync(dir)) {\n\t\tmkdirSync(dir, { recursive: true });\n\t}\n\tconst ignorePath = join(dir, \".gitignore\");\n\tif (!existsSync(ignorePath)) {\n\t\twriteFileSync(ignorePath, \"*\\n!.gitignore\\n\", \"utf-8\");\n\t}\n}\n\nexport function getManagedNpmInstallPath(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n): string {\n\tif (scope === \"temporary\") {\n\t\treturn join(getNpmInstallRoot(context, scope, true), \"node_modules\", source.name);\n\t}\n\tif (scope === \"project\") {\n\t\treturn join(context.cwd, CONFIG_DIR_NAME, \"npm\", \"node_modules\", source.name);\n\t}\n\treturn join(context.agentDir, \"npm\", \"node_modules\", source.name);\n}\n\nexport function getGlobalNpmRoot(context: PackageManagerContext): string {\n\tconst npmCommand = getNpmCommand(context);\n\tconst commandKey = [npmCommand.command, ...npmCommand.args].join(\"\\0\");\n\tif (context.globalNpmRoot && context.globalNpmRootCommandKey === commandKey) {\n\t\treturn context.globalNpmRoot;\n\t}\n\tif (getPackageManagerName(context) === \"bun\") {\n\t\tconst binDir = runNpmCommandSync(context, [\"pm\", \"bin\", \"-g\"]).trim();\n\t\tcontext.globalNpmRoot = join(dirname(binDir), \"install\", \"global\", \"node_modules\");\n\t} else {\n\t\tcontext.globalNpmRoot = runNpmCommandSync(context, [\"root\", \"-g\"]).trim();\n\t}\n\tcontext.globalNpmRootCommandKey = commandKey;\n\treturn context.globalNpmRoot;\n}\n\nfunction getPnpmGlobalPackagePath(context: PackageManagerContext, packageName: string): string | undefined {\n\tif (getPackageManagerName(context) !== \"pnpm\") {\n\t\treturn undefined;\n\t}\n\tconst output = runNpmCommandSync(context, [\"list\", \"-g\", \"--depth\", \"0\", \"--json\"]);\n\tconst entries = JSON.parse(output) as Array<{ dependencies?: Record<string, { path?: string }> }>;\n\tfor (const entry of entries) {\n\t\tconst path = entry.dependencies?.[packageName]?.path;\n\t\tif (path) return path;\n\t}\n\treturn undefined;\n}\n\nfunction getLegacyGlobalNpmInstallPath(context: PackageManagerContext, source: NpmSource): string | undefined {\n\ttry {\n\t\tconst pnpmPath = getPnpmGlobalPackagePath(context, source.name);\n\t\tif (pnpmPath) return pnpmPath;\n\t\tconst globalRoot = context.driver?.getGlobalNpmRoot\n\t\t\t? context.driver.getGlobalNpmRoot()\n\t\t\t: getGlobalNpmRoot(context);\n\t\treturn join(globalRoot, source.name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function getNpmInstallPath(context: PackageManagerContext, source: NpmSource, scope: SourceScope): string {\n\tconst managedPath = getManagedNpmInstallPath(context, source, scope);\n\tif (scope !== \"user\" || existsSync(managedPath)) {\n\t\treturn managedPath;\n\t}\n\tconst legacyPath = getLegacyGlobalNpmInstallPath(context, source);\n\treturn legacyPath && existsSync(legacyPath) ? legacyPath : managedPath;\n}\n\nexport function getExistingNpmInstallPath(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: SourceScope,\n): string | undefined {\n\tconst candidates = [getNpmInstallPath(context, source, scope)];\n\tif (scope === \"project\") {\n\t\tfor (const configDir of getProjectConfigDirs(context.cwd)) {\n\t\t\tcandidates.push(join(configDir, \"npm\", \"node_modules\", source.name));\n\t\t}\n\t}\n\tfor (const candidate of Array.from(new Set(candidates))) {\n\t\tif (existsSync(candidate)) return candidate;\n\t}\n\treturn undefined;\n}\n\nexport async function installedNpmMatchesConfiguredVersion(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tinstalledPath: string,\n): Promise<boolean> {\n\tconst installedVersion = getInstalledNpmVersion(installedPath);\n\tif (!installedVersion) return false;\n\tif (source.range) return satisfies(installedVersion, source.range);\n\tif (source.version !== undefined) {\n\t\tif (isOfflineModeEnabled()) return true;\n\t\ttry {\n\t\t\tconst targetVersion = await getLatestNpmVersion(context, source.spec);\n\t\t\treturn installedVersion === targetVersion;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport async function npmHasAvailableUpdate(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tinstalledPath: string,\n): Promise<boolean> {\n\tif (isOfflineModeEnabled()) return false;\n\tconst installedVersion = getInstalledNpmVersion(installedPath);\n\tif (!installedVersion) return false;\n\ttry {\n\t\tconst targetVersion = await getLatestNpmVersion(\n\t\t\tcontext,\n\t\t\tsource.version ? source.spec : source.name,\n\t\t\tsource.range,\n\t\t);\n\t\treturn targetVersion !== installedVersion;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getInstalledNpmVersion(installedPath: string): string | undefined {\n\tconst packageJsonPath = join(installedPath, \"package.json\");\n\tif (!existsSync(packageJsonPath)) return undefined;\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\");\n\t\tconst pkg = JSON.parse(content) as { version?: string };\n\t\treturn pkg.version;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport async function getLatestNpmVersion(\n\tcontext: PackageManagerContext,\n\tpackageSpec: string,\n\trange?: string,\n): Promise<string> {\n\tconst npmCommand = getNpmCommand(context);\n\tconst stdout = context.driver\n\t\t? await context.driver.runCommandCapture(\n\t\t\t\tnpmCommand.command,\n\t\t\t\t[...npmCommand.args, \"view\", packageSpec, \"version\", \"--json\"],\n\t\t\t\t{\n\t\t\t\t\tcwd: context.cwd,\n\t\t\t\t\ttimeoutMs: NETWORK_TIMEOUT_MS,\n\t\t\t\t},\n\t\t\t)\n\t\t: await runCommandCapture(npmCommand.command, [...npmCommand.args, \"view\", packageSpec, \"version\", \"--json\"], {\n\t\t\t\tcwd: context.cwd,\n\t\t\t\ttimeoutMs: NETWORK_TIMEOUT_MS,\n\t\t\t});\n\tconst raw = stdout.trim();\n\tif (!raw) throw new Error(\"Empty response from npm view\");\n\tconst parsed = JSON.parse(raw) as string | string[];\n\tif (typeof parsed === \"string\") return parsed;\n\tif (Array.isArray(parsed)) {\n\t\tconst versions = parsed.filter((value) => typeof value === \"string\" && value.length > 0);\n\t\tconst latest = range ? maxSatisfying(versions, range) : [...versions].sort(rcompare)[0];\n\t\tif (latest) return latest;\n\t}\n\tthrow new Error(\"Unexpected response from npm view\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-operations.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-operations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-manager-operations.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-operations.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAMX,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,MAAM,4BAA4B,CAAC;AAEpC,wBAAsB,OAAO,CAC5B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED,wBAAsB,MAAM,CAC3B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B3F;AAED,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC,CAQf;AAmFD,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAoCvG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { runWithConcurrency } from "./package-manager-command.js";
|
|
3
3
|
import { GIT_UPDATE_CONCURRENCY, UPDATE_CHECK_CONCURRENCY } from "./package-manager-constants.js";
|
|
4
|
-
import { getExistingGitInstallPath, gitHasAvailableUpdate, installGit, removeGit, updateGit } from "./package-manager-git.js";
|
|
5
4
|
import { isOfflineModeEnabled } from "./package-manager-env.js";
|
|
6
|
-
import {
|
|
5
|
+
import { getExistingGitInstallPath, gitHasAvailableUpdate, installGit, removeGit, updateGit, } from "./package-manager-git.js";
|
|
6
|
+
import { getInstalledNpmVersion, getLatestNpmVersion, getManagedNpmInstallPath, getNpmInstallPath, installNpm, installNpmBatch, npmHasAvailableUpdate, uninstallNpm, } from "./package-manager-npm.js";
|
|
7
7
|
import { resolveManagerPath } from "./package-manager-paths.js";
|
|
8
8
|
import { withProgress } from "./package-manager-progress.js";
|
|
9
9
|
import { assertProjectTrustedForScope, buildNoMatchingPackageMessage, dedupePackages, getPackageIdentity, getPackageSourceString, parseSource, } from "./package-manager-source.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-operations.js","sourceRoot":"","sources":["../../src/core/package-manager-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC9H,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,YAAY,GACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EACN,4BAA4B,EAC5B,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,GACX,MAAM,6BAA6B,CAAC;AAarC,MAAM,CAAC,KAAK,UAAU,OAAO,CAC5B,OAA8B,EAC9B,MAAc,EACd,OAA6B;IAE7B,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM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existsSync } from \"node:fs\";\nimport { runWithConcurrency } from \"./package-manager-command.ts\";\nimport { GIT_UPDATE_CONCURRENCY, UPDATE_CHECK_CONCURRENCY } from \"./package-manager-constants.ts\";\nimport { getExistingGitInstallPath, gitHasAvailableUpdate, installGit, removeGit, updateGit } from \"./package-manager-git.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport {\n\tgetInstalledNpmVersion,\n\tgetManagedNpmInstallPath,\n\tgetLatestNpmVersion,\n\tgetNpmInstallPath,\n\tinstallNpm,\n\tinstallNpmBatch,\n\tnpmHasAvailableUpdate,\n\tuninstallNpm,\n} from \"./package-manager-npm.ts\";\nimport { resolveManagerPath } from \"./package-manager-paths.ts\";\nimport { withProgress } from \"./package-manager-progress.ts\";\nimport {\n\tassertProjectTrustedForScope,\n\tbuildNoMatchingPackageMessage,\n\tdedupePackages,\n\tgetPackageIdentity,\n\tgetPackageSourceString,\n\tparseSource,\n} from \"./package-manager-source.ts\";\nimport type {\n\tConfiguredUpdateSource,\n\tGitUpdateTarget,\n\tInstalledSourceScope,\n\tNpmSource,\n\tNpmUpdateTarget,\n\tPackageManagerContext,\n\tPackageUpdate,\n\tParsedSource,\n\tSourceScope,\n} from \"./package-manager-types.ts\";\n\nexport async function install(\n\tcontext: PackageManagerContext,\n\tsource: string,\n\toptions?: { local?: boolean },\n): Promise<void> {\n\tconst parsed = parseSource(source);\n\tconst scope: SourceScope = options?.local ? \"project\" : \"user\";\n\tassertProjectTrustedForScope(context, scope);\n\tawait withProgress(context, \"install\", source, `Installing ${source}...`, async () => {\n\t\tif (parsed.type === \"npm\") {\n\t\t\tawait installNpm(context, parsed, scope, false);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"git\") {\n\t\t\tawait installGit(context, parsed, scope);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"local\") {\n\t\t\tconst resolved = resolveManagerPath(context, parsed.path);\n\t\t\tif (!existsSync(resolved)) {\n\t\t\t\tthrow new Error(`Path does not exist: ${resolved}`);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthrow new Error(`Unsupported install source: ${source}`);\n\t});\n}\n\nexport async function remove(\n\tcontext: PackageManagerContext,\n\tsource: string,\n\toptions?: { local?: boolean },\n): Promise<void> {\n\tconst parsed = parseSource(source);\n\tconst scope: SourceScope = options?.local ? \"project\" : \"user\";\n\tassertProjectTrustedForScope(context, scope);\n\tawait withProgress(context, \"remove\", source, `Removing ${source}...`, async () => {\n\t\tif (parsed.type === \"npm\") {\n\t\t\tawait uninstallNpm(context, parsed, scope);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"git\") {\n\t\t\tawait removeGit(context, parsed, scope);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"local\") return;\n\t\tthrow new Error(`Unsupported remove source: ${source}`);\n\t});\n}\n\nexport async function update(context: PackageManagerContext, source?: string): Promise<void> {\n\tconst globalSettings = context.settingsManager.getGlobalSettings();\n\tconst projectSettings = context.settingsManager.getProjectSettings();\n\tconst identity = source ? getPackageIdentity(context, source) : undefined;\n\tlet matched = false;\n\tconst updateSources: ConfiguredUpdateSource[] = [];\n\n\tfor (const pkg of globalSettings.packages ?? []) {\n\t\tconst sourceStr = getPackageSourceString(pkg);\n\t\tif (identity && getPackageIdentity(context, sourceStr, \"user\") !== identity) continue;\n\t\tmatched = true;\n\t\tupdateSources.push({ source: sourceStr, scope: \"user\" });\n\t}\n\tfor (const pkg of projectSettings.packages ?? []) {\n\t\tconst sourceStr = getPackageSourceString(pkg);\n\t\tif (identity && getPackageIdentity(context, sourceStr, \"project\") !== identity) continue;\n\t\tmatched = true;\n\t\tupdateSources.push({ source: sourceStr, scope: \"project\" });\n\t}\n\n\tif (source && !matched) {\n\t\tthrow new Error(\n\t\t\tbuildNoMatchingPackageMessage(context, source, [\n\t\t\t\t...(globalSettings.packages ?? []),\n\t\t\t\t...(projectSettings.packages ?? []),\n\t\t\t]),\n\t\t);\n\t}\n\tawait updateConfiguredSources(context, updateSources);\n}\n\nexport async function installParsedSource(\n\tcontext: PackageManagerContext,\n\tparsed: ParsedSource,\n\tscope: SourceScope,\n): Promise<void> {\n\tif (parsed.type === \"npm\") {\n\t\tawait installNpm(context, parsed, scope, scope === \"temporary\");\n\t\treturn;\n\t}\n\tif (parsed.type === \"git\") {\n\t\tawait installGit(context, parsed, scope);\n\t}\n}\n\nasync function updateConfiguredSources(\n\tcontext: PackageManagerContext,\n\tsources: ConfiguredUpdateSource[],\n): Promise<void> {\n\tif (isOfflineModeEnabled() || sources.length === 0) return;\n\n\tconst npmCandidates: NpmUpdateTarget[] = [];\n\tconst gitCandidates: GitUpdateTarget[] = [];\n\tfor (const entry of sources) {\n\t\tconst parsed = parseSource(entry.source);\n\t\tif (parsed.type === \"npm\") {\n\t\t\tif (!parsed.pinned) npmCandidates.push({ ...entry, parsed });\n\t\t} else if (parsed.type === \"git\") {\n\t\t\tgitCandidates.push({ ...entry, parsed });\n\t\t}\n\t}\n\n\tconst npmCheckTasks = npmCandidates.map((entry) => async () => ({\n\t\tentry,\n\t\tshouldUpdate: await shouldUpdateNpmSource(context, entry.parsed, entry.scope),\n\t}));\n\tconst npmCheckResults = await runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);\n\tconst userNpmUpdates: NpmUpdateTarget[] = [];\n\tconst projectNpmUpdates: NpmUpdateTarget[] = [];\n\tfor (const result of npmCheckResults) {\n\t\tif (!result.shouldUpdate) continue;\n\t\tif (result.entry.scope === \"user\") userNpmUpdates.push(result.entry);\n\t\telse projectNpmUpdates.push(result.entry);\n\t}\n\n\tconst tasks: Promise<void>[] = [];\n\tif (userNpmUpdates.length > 0) tasks.push(updateNpmBatch(context, userNpmUpdates, \"user\"));\n\tif (projectNpmUpdates.length > 0) tasks.push(updateNpmBatch(context, projectNpmUpdates, \"project\"));\n\tif (gitCandidates.length > 0) {\n\t\tconst gitTasks = gitCandidates.map(\n\t\t\t(entry) => async () =>\n\t\t\t\twithProgress(context, \"update\", entry.source, `Updating ${entry.source}...`, async () => {\n\t\t\t\t\tif (context.driver) await context.driver.updateGit(entry.parsed, entry.scope);\n\t\t\t\t\telse await updateGit(context, entry.parsed, entry.scope);\n\t\t\t\t}),\n\t\t);\n\t\ttasks.push(runWithConcurrency(gitTasks, GIT_UPDATE_CONCURRENCY).then(() => {}));\n\t}\n\tawait Promise.all(tasks);\n}\n\nasync function shouldUpdateNpmSource(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: InstalledSourceScope,\n): Promise<boolean> {\n\tconst installedPath = getManagedNpmInstallPath(context, source, scope);\n\tconst installedVersion = existsSync(installedPath) ? getInstalledNpmVersion(installedPath) : undefined;\n\tif (!installedVersion) return true;\n\ttry {\n\t\tconst targetVersion = await getLatestNpmVersion(context, source.version ? source.spec : source.name, source.range);\n\t\treturn targetVersion !== installedVersion;\n\t} catch {\n\t\treturn true;\n\t}\n}\n\nasync function updateNpmBatch(\n\tcontext: PackageManagerContext,\n\tsources: NpmUpdateTarget[],\n\tscope: InstalledSourceScope,\n): Promise<void> {\n\tif (sources.length === 0) return;\n\tconst sourceLabel = sources.length === 1 ? sources[0].source : `${scope} npm packages`;\n\tconst message = sources.length === 1 ? `Updating ${sources[0].source}...` : `Updating ${scope} npm packages...`;\n\tconst specs = sources.map((entry) => (entry.parsed.version ? entry.parsed.spec : `${entry.parsed.name}@latest`));\n\n\tawait withProgress(context, \"update\", sourceLabel, message, async () => {\n\t\tawait installNpmBatch(context, specs, scope);\n\t});\n}\n\nexport async function checkForAvailableUpdates(context: PackageManagerContext): Promise<PackageUpdate[]> {\n\tif (isOfflineModeEnabled()) return [];\n\n\tconst globalSettings = context.settingsManager.getGlobalSettings();\n\tconst projectSettings = context.settingsManager.getProjectSettings();\n\tconst allPackages = [\n\t\t...(projectSettings.packages ?? []).map((pkg) => ({ pkg, scope: \"project\" as const })),\n\t\t...(globalSettings.packages ?? []).map((pkg) => ({ pkg, scope: \"user\" as const })),\n\t];\n\tconst packageSources = dedupePackages(context, allPackages);\n\tconst checks = packageSources\n\t\t.filter((entry): entry is { pkg: typeof entry.pkg; scope: InstalledSourceScope } => entry.scope !== \"temporary\")\n\t\t.map((entry) => async (): Promise<PackageUpdate | undefined> => {\n\t\t\tconst source = getPackageSourceString(entry.pkg);\n\t\t\tconst parsed = parseSource(source);\n\t\t\tif (parsed.type === \"local\" || parsed.pinned) return undefined;\n\n\t\t\tif (parsed.type === \"npm\") {\n\t\t\t\tconst installedPath = getNpmInstallPath(context, parsed, entry.scope);\n\t\t\t\tif (!existsSync(installedPath)) return undefined;\n\t\t\t\tconst hasUpdate = await npmHasAvailableUpdate(context, parsed, installedPath);\n\t\t\t\tif (!hasUpdate) return undefined;\n\t\t\t\treturn { source, displayName: parsed.name, type: \"npm\", scope: entry.scope };\n\t\t\t}\n\n\t\t\tconst installedPath = getExistingGitInstallPath(context, parsed, entry.scope);\n\t\t\tif (!installedPath) return undefined;\n\t\t\tconst hasUpdate = context.driver\n\t\t\t\t? await context.driver.gitHasAvailableUpdate(installedPath)\n\t\t\t\t: await gitHasAvailableUpdate(context, installedPath);\n\t\t\tif (!hasUpdate) return undefined;\n\t\t\treturn { source, displayName: `${parsed.host}/${parsed.path}`, type: \"git\", scope: entry.scope };\n\t\t});\n\n\tconst results = await runWithConcurrency(checks, UPDATE_CHECK_CONCURRENCY);\n\treturn results.filter((result): result is PackageUpdate => result !== undefined);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"package-manager-operations.js","sourceRoot":"","sources":["../../src/core/package-manager-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACN,yBAAyB,EACzB,qBAAqB,EAC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AM,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,aAAa,CAAC;YAC3D,CAAC,CAAC,MAAM,qBAAqB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS;YAAE,OAAO,SAAS,CAAC;QACjC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAClG,CAAC,CAAC,CAAC;IAEJ,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IAC3E,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAA2B,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAClF,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport { runWithConcurrency } from \"./package-manager-command.ts\";\nimport { GIT_UPDATE_CONCURRENCY, UPDATE_CHECK_CONCURRENCY } from \"./package-manager-constants.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport {\n\tgetExistingGitInstallPath,\n\tgitHasAvailableUpdate,\n\tinstallGit,\n\tremoveGit,\n\tupdateGit,\n} from \"./package-manager-git.ts\";\nimport {\n\tgetInstalledNpmVersion,\n\tgetLatestNpmVersion,\n\tgetManagedNpmInstallPath,\n\tgetNpmInstallPath,\n\tinstallNpm,\n\tinstallNpmBatch,\n\tnpmHasAvailableUpdate,\n\tuninstallNpm,\n} from \"./package-manager-npm.ts\";\nimport { resolveManagerPath } from \"./package-manager-paths.ts\";\nimport { withProgress } from \"./package-manager-progress.ts\";\nimport {\n\tassertProjectTrustedForScope,\n\tbuildNoMatchingPackageMessage,\n\tdedupePackages,\n\tgetPackageIdentity,\n\tgetPackageSourceString,\n\tparseSource,\n} from \"./package-manager-source.ts\";\nimport type {\n\tConfiguredUpdateSource,\n\tGitUpdateTarget,\n\tInstalledSourceScope,\n\tNpmSource,\n\tNpmUpdateTarget,\n\tPackageManagerContext,\n\tPackageUpdate,\n\tParsedSource,\n\tSourceScope,\n} from \"./package-manager-types.ts\";\n\nexport async function install(\n\tcontext: PackageManagerContext,\n\tsource: string,\n\toptions?: { local?: boolean },\n): Promise<void> {\n\tconst parsed = parseSource(source);\n\tconst scope: SourceScope = options?.local ? \"project\" : \"user\";\n\tassertProjectTrustedForScope(context, scope);\n\tawait withProgress(context, \"install\", source, `Installing ${source}...`, async () => {\n\t\tif (parsed.type === \"npm\") {\n\t\t\tawait installNpm(context, parsed, scope, false);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"git\") {\n\t\t\tawait installGit(context, parsed, scope);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"local\") {\n\t\t\tconst resolved = resolveManagerPath(context, parsed.path);\n\t\t\tif (!existsSync(resolved)) {\n\t\t\t\tthrow new Error(`Path does not exist: ${resolved}`);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthrow new Error(`Unsupported install source: ${source}`);\n\t});\n}\n\nexport async function remove(\n\tcontext: PackageManagerContext,\n\tsource: string,\n\toptions?: { local?: boolean },\n): Promise<void> {\n\tconst parsed = parseSource(source);\n\tconst scope: SourceScope = options?.local ? \"project\" : \"user\";\n\tassertProjectTrustedForScope(context, scope);\n\tawait withProgress(context, \"remove\", source, `Removing ${source}...`, async () => {\n\t\tif (parsed.type === \"npm\") {\n\t\t\tawait uninstallNpm(context, parsed, scope);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"git\") {\n\t\t\tawait removeGit(context, parsed, scope);\n\t\t\treturn;\n\t\t}\n\t\tif (parsed.type === \"local\") return;\n\t\tthrow new Error(`Unsupported remove source: ${source}`);\n\t});\n}\n\nexport async function update(context: PackageManagerContext, source?: string): Promise<void> {\n\tconst globalSettings = context.settingsManager.getGlobalSettings();\n\tconst projectSettings = context.settingsManager.getProjectSettings();\n\tconst identity = source ? getPackageIdentity(context, source) : undefined;\n\tlet matched = false;\n\tconst updateSources: ConfiguredUpdateSource[] = [];\n\n\tfor (const pkg of globalSettings.packages ?? []) {\n\t\tconst sourceStr = getPackageSourceString(pkg);\n\t\tif (identity && getPackageIdentity(context, sourceStr, \"user\") !== identity) continue;\n\t\tmatched = true;\n\t\tupdateSources.push({ source: sourceStr, scope: \"user\" });\n\t}\n\tfor (const pkg of projectSettings.packages ?? []) {\n\t\tconst sourceStr = getPackageSourceString(pkg);\n\t\tif (identity && getPackageIdentity(context, sourceStr, \"project\") !== identity) continue;\n\t\tmatched = true;\n\t\tupdateSources.push({ source: sourceStr, scope: \"project\" });\n\t}\n\n\tif (source && !matched) {\n\t\tthrow new Error(\n\t\t\tbuildNoMatchingPackageMessage(context, source, [\n\t\t\t\t...(globalSettings.packages ?? []),\n\t\t\t\t...(projectSettings.packages ?? []),\n\t\t\t]),\n\t\t);\n\t}\n\tawait updateConfiguredSources(context, updateSources);\n}\n\nexport async function installParsedSource(\n\tcontext: PackageManagerContext,\n\tparsed: ParsedSource,\n\tscope: SourceScope,\n): Promise<void> {\n\tif (parsed.type === \"npm\") {\n\t\tawait installNpm(context, parsed, scope, scope === \"temporary\");\n\t\treturn;\n\t}\n\tif (parsed.type === \"git\") {\n\t\tawait installGit(context, parsed, scope);\n\t}\n}\n\nasync function updateConfiguredSources(\n\tcontext: PackageManagerContext,\n\tsources: ConfiguredUpdateSource[],\n): Promise<void> {\n\tif (isOfflineModeEnabled() || sources.length === 0) return;\n\n\tconst npmCandidates: NpmUpdateTarget[] = [];\n\tconst gitCandidates: GitUpdateTarget[] = [];\n\tfor (const entry of sources) {\n\t\tconst parsed = parseSource(entry.source);\n\t\tif (parsed.type === \"npm\") {\n\t\t\tif (!parsed.pinned) npmCandidates.push({ ...entry, parsed });\n\t\t} else if (parsed.type === \"git\") {\n\t\t\tgitCandidates.push({ ...entry, parsed });\n\t\t}\n\t}\n\n\tconst npmCheckTasks = npmCandidates.map((entry) => async () => ({\n\t\tentry,\n\t\tshouldUpdate: await shouldUpdateNpmSource(context, entry.parsed, entry.scope),\n\t}));\n\tconst npmCheckResults = await runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);\n\tconst userNpmUpdates: NpmUpdateTarget[] = [];\n\tconst projectNpmUpdates: NpmUpdateTarget[] = [];\n\tfor (const result of npmCheckResults) {\n\t\tif (!result.shouldUpdate) continue;\n\t\tif (result.entry.scope === \"user\") userNpmUpdates.push(result.entry);\n\t\telse projectNpmUpdates.push(result.entry);\n\t}\n\n\tconst tasks: Promise<void>[] = [];\n\tif (userNpmUpdates.length > 0) tasks.push(updateNpmBatch(context, userNpmUpdates, \"user\"));\n\tif (projectNpmUpdates.length > 0) tasks.push(updateNpmBatch(context, projectNpmUpdates, \"project\"));\n\tif (gitCandidates.length > 0) {\n\t\tconst gitTasks = gitCandidates.map(\n\t\t\t(entry) => async () =>\n\t\t\t\twithProgress(context, \"update\", entry.source, `Updating ${entry.source}...`, async () => {\n\t\t\t\t\tif (context.driver) await context.driver.updateGit(entry.parsed, entry.scope);\n\t\t\t\t\telse await updateGit(context, entry.parsed, entry.scope);\n\t\t\t\t}),\n\t\t);\n\t\ttasks.push(runWithConcurrency(gitTasks, GIT_UPDATE_CONCURRENCY).then(() => {}));\n\t}\n\tawait Promise.all(tasks);\n}\n\nasync function shouldUpdateNpmSource(\n\tcontext: PackageManagerContext,\n\tsource: NpmSource,\n\tscope: InstalledSourceScope,\n): Promise<boolean> {\n\tconst installedPath = getManagedNpmInstallPath(context, source, scope);\n\tconst installedVersion = existsSync(installedPath) ? getInstalledNpmVersion(installedPath) : undefined;\n\tif (!installedVersion) return true;\n\ttry {\n\t\tconst targetVersion = await getLatestNpmVersion(\n\t\t\tcontext,\n\t\t\tsource.version ? source.spec : source.name,\n\t\t\tsource.range,\n\t\t);\n\t\treturn targetVersion !== installedVersion;\n\t} catch {\n\t\treturn true;\n\t}\n}\n\nasync function updateNpmBatch(\n\tcontext: PackageManagerContext,\n\tsources: NpmUpdateTarget[],\n\tscope: InstalledSourceScope,\n): Promise<void> {\n\tif (sources.length === 0) return;\n\tconst sourceLabel = sources.length === 1 ? sources[0].source : `${scope} npm packages`;\n\tconst message = sources.length === 1 ? `Updating ${sources[0].source}...` : `Updating ${scope} npm packages...`;\n\tconst specs = sources.map((entry) => (entry.parsed.version ? entry.parsed.spec : `${entry.parsed.name}@latest`));\n\n\tawait withProgress(context, \"update\", sourceLabel, message, async () => {\n\t\tawait installNpmBatch(context, specs, scope);\n\t});\n}\n\nexport async function checkForAvailableUpdates(context: PackageManagerContext): Promise<PackageUpdate[]> {\n\tif (isOfflineModeEnabled()) return [];\n\n\tconst globalSettings = context.settingsManager.getGlobalSettings();\n\tconst projectSettings = context.settingsManager.getProjectSettings();\n\tconst allPackages = [\n\t\t...(projectSettings.packages ?? []).map((pkg) => ({ pkg, scope: \"project\" as const })),\n\t\t...(globalSettings.packages ?? []).map((pkg) => ({ pkg, scope: \"user\" as const })),\n\t];\n\tconst packageSources = dedupePackages(context, allPackages);\n\tconst checks = packageSources\n\t\t.filter((entry): entry is { pkg: typeof entry.pkg; scope: InstalledSourceScope } => entry.scope !== \"temporary\")\n\t\t.map((entry) => async (): Promise<PackageUpdate | undefined> => {\n\t\t\tconst source = getPackageSourceString(entry.pkg);\n\t\t\tconst parsed = parseSource(source);\n\t\t\tif (parsed.type === \"local\" || parsed.pinned) return undefined;\n\n\t\t\tif (parsed.type === \"npm\") {\n\t\t\t\tconst installedPath = getNpmInstallPath(context, parsed, entry.scope);\n\t\t\t\tif (!existsSync(installedPath)) return undefined;\n\t\t\t\tconst hasUpdate = await npmHasAvailableUpdate(context, parsed, installedPath);\n\t\t\t\tif (!hasUpdate) return undefined;\n\t\t\t\treturn { source, displayName: parsed.name, type: \"npm\", scope: entry.scope };\n\t\t\t}\n\n\t\t\tconst installedPath = getExistingGitInstallPath(context, parsed, entry.scope);\n\t\t\tif (!installedPath) return undefined;\n\t\t\tconst hasUpdate = context.driver\n\t\t\t\t? await context.driver.gitHasAvailableUpdate(installedPath)\n\t\t\t\t: await gitHasAvailableUpdate(context, installedPath);\n\t\t\tif (!hasUpdate) return undefined;\n\t\t\treturn { source, displayName: `${parsed.host}/${parsed.path}`, type: \"git\", scope: entry.scope };\n\t\t});\n\n\tconst results = await runWithConcurrency(checks, UPDATE_CHECK_CONCURRENCY);\n\treturn results.filter((result): result is PackageUpdate => result !== undefined);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-paths.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-paths.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAErF,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAMvE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,CAQhG;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAE7F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAExF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"package-manager-paths.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-paths.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAErF,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,eAAe,CAAC,MAAM,EA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WAAW,EAAE,CAAC;QAC3B,OAAO,eAAe,CAAC,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAA8B,EAAE,KAAkB;IACnF,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { homedir, tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { APP_NAME, CONFIG_DIR_NAME, getAgentDir, getAgentDirs, getProjectConfigDirs } from \"../config.ts\";\nimport { resolvePath } from \"../utils/paths.ts\";\nimport type { PackageManagerContext, SourceScope } from \"./package-manager-types.ts\";\n\nexport function getHomeDir(): string {\n\treturn process.env.HOME || homedir();\n}\n\nexport function getTemporaryDir(prefix: string, suffix?: string): string {\n\tconst hash = createHash(\"sha256\")\n\t\t.update(`${prefix}-${suffix ?? \"\"}`)\n\t\t.digest(\"hex\")\n\t\t.slice(0, 8);\n\treturn join(tmpdir(), `${APP_NAME}-extensions`, prefix, hash, suffix ?? \"\");\n}\n\nexport function getBaseDirsForScope(context: PackageManagerContext, scope: SourceScope): string[] {\n\tif (scope === \"project\") {\n\t\treturn getProjectConfigDirs(context.cwd);\n\t}\n\tif (scope === \"user\") {\n\t\treturn context.agentDir === getAgentDir() ? getAgentDirs() : [context.agentDir];\n\t}\n\treturn [context.cwd];\n}\n\nexport function getBaseDirForScope(context: PackageManagerContext, scope: SourceScope): string {\n\treturn getBaseDirsForScope(context, scope)[0]!;\n}\n\nexport function resolveManagerPath(context: PackageManagerContext, input: string): string {\n\treturn resolvePath(input, context.cwd, { homeDir: getHomeDir(), trim: true });\n}\n\nexport function resolvePathFromBase(input: string, baseDir: string): string {\n\treturn resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });\n}\n\nexport function getNpmInstallRoot(context: PackageManagerContext, scope: SourceScope, temporary: boolean): string {\n\tif (temporary) {\n\t\treturn getTemporaryDir(\"npm\");\n\t}\n\tif (scope === \"project\") {\n\t\treturn join(context.cwd, CONFIG_DIR_NAME, \"npm\");\n\t}\n\treturn join(context.agentDir, \"npm\");\n}\n\nexport function getGitInstallPath(\n\tcontext: PackageManagerContext,\n\tsource: { host: string; path: string },\n\tscope: SourceScope,\n): string {\n\tif (scope === \"temporary\") {\n\t\treturn getTemporaryDir(`git-${source.host}`, source.path);\n\t}\n\tif (scope === \"project\") {\n\t\treturn join(context.cwd, CONFIG_DIR_NAME, \"git\", source.host, source.path);\n\t}\n\treturn join(context.agentDir, \"git\", source.host, source.path);\n}\n\nexport function getGitInstallRoot(context: PackageManagerContext, scope: SourceScope): string | undefined {\n\tif (scope === \"temporary\") {\n\t\treturn undefined;\n\t}\n\tif (scope === \"project\") {\n\t\treturn join(context.cwd, CONFIG_DIR_NAME, \"git\");\n\t}\n\treturn join(context.agentDir, \"git\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-resolver.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-manager-resolver.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-resolver.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACX,mBAAmB,EAEnB,qBAAqB,EAErB,aAAa,EACb,8BAA8B,EAG9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW3D,wBAAsB,eAAe,CACpC,OAAO,EAAE,qBAAqB,EAC9B,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,GAC1D,OAAO,CAAC,aAAa,CAAC,CAiDxB;AAmCD,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,CAAC,EAAE,8BAA8B,GACtC,OAAO,CAAC,aAAa,CAAC,CAQxB"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { access, stat } from "node:fs/promises";
|
|
2
2
|
import { dirname, isAbsolute, join } from "node:path";
|
|
3
3
|
import { CONFIG_DIR_NAME } from "../config.js";
|
|
4
|
-
import { getGitInstallPath } from "./package-manager-paths.js";
|
|
5
4
|
import { addAutoDiscoveredResources, collectProjectLocalResources } from "./package-manager-auto-resources.js";
|
|
6
|
-
import { getExistingGitInstallPath, refreshTemporaryGitSource } from "./package-manager-git.js";
|
|
7
5
|
import { isOfflineModeEnabled } from "./package-manager-env.js";
|
|
6
|
+
import { getExistingGitInstallPath, refreshTemporaryGitSource } from "./package-manager-git.js";
|
|
8
7
|
import { getExistingNpmInstallPath, installedNpmMatchesConfiguredVersion } from "./package-manager-npm.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { installParsedSource } from "./package-manager-operations.js";
|
|
9
|
+
import { getBaseDirsForScope, getGitInstallPath, resolvePathFromBase } from "./package-manager-paths.js";
|
|
10
|
+
import { addResource, createAccumulator, getTargetMap, toResolvedPaths, } from "./package-manager-resource-accumulator.js";
|
|
11
11
|
import { collectPackageResources, resolveLocalEntries } from "./package-manager-resource-collector.js";
|
|
12
12
|
import { resolveExtensionEntries } from "./package-manager-resource-files.js";
|
|
13
|
-
import { dedupePackages, getPackageIdentity, getPackageSourceString, parseSource } from "./package-manager-source.js";
|
|
14
13
|
import { splitPatterns } from "./package-manager-resource-patterns.js";
|
|
15
|
-
import {
|
|
14
|
+
import { dedupePackages, getPackageIdentity, getPackageSourceString, parseSource } from "./package-manager-source.js";
|
|
16
15
|
async function exists(path) {
|
|
17
16
|
try {
|
|
18
17
|
await access(path);
|
|
@@ -43,7 +42,9 @@ export async function resolvePackages(context, onMissing) {
|
|
|
43
42
|
const target = getTargetMap(accumulator, resourceType);
|
|
44
43
|
const globalEntries = (globalSettings[resourceType] ?? []);
|
|
45
44
|
const projectEntries = (projectSettings[resourceType] ?? []);
|
|
46
|
-
const projectOrigin = context.settingsManager.isFieldInherited("project", resourceType)
|
|
45
|
+
const projectOrigin = context.settingsManager.isFieldInherited("project", resourceType)
|
|
46
|
+
? "inherited-pi"
|
|
47
|
+
: "atomic";
|
|
47
48
|
const globalOrigin = context.settingsManager.isFieldInherited("global", resourceType) ? "inherited-pi" : "atomic";
|
|
48
49
|
await resolveConfiguredLocalEntries(projectEntries, resourceType, target, "project", projectBaseDirs, projectOrigin);
|
|
49
50
|
await resolveConfiguredLocalEntries(globalEntries, resourceType, target, "user", globalBaseDirs, globalOrigin);
|
|
@@ -87,20 +88,23 @@ async function resolvePackageSources(context, sources, accumulator, onMissing, o
|
|
|
87
88
|
const resolvedSource = deltaBase?.source ?? sourceStr;
|
|
88
89
|
const resolvedScope = deltaBase?.scope ?? scope;
|
|
89
90
|
const parsed = parseSource(resolvedSource);
|
|
90
|
-
const configurationOrigin = options?.settingsField &&
|
|
91
|
+
const configurationOrigin = options?.settingsField &&
|
|
92
|
+
context.settingsManager.isFieldInherited(scope === "project" ? "project" : "global", options.settingsField)
|
|
91
93
|
? "inherited-pi"
|
|
92
|
-
: options?.settingsField
|
|
94
|
+
: options?.settingsField
|
|
95
|
+
? "atomic"
|
|
96
|
+
: undefined;
|
|
93
97
|
const metadata = { source: sourceStr, scope, origin: "package", configurationOrigin };
|
|
94
98
|
if (parsed.type === "local") {
|
|
95
99
|
for (const [baseIndex, baseDir] of getBaseDirsForScope(context, resolvedScope).entries()) {
|
|
96
|
-
const resolvesFromSettingsBase = options?.settingsField !== undefined
|
|
97
|
-
&& !isAbsolute(parsed.path)
|
|
98
|
-
&& !parsed.path.startsWith("~");
|
|
100
|
+
const resolvesFromSettingsBase = options?.settingsField !== undefined && !isAbsolute(parsed.path) && !parsed.path.startsWith("~");
|
|
99
101
|
const localMetadata = {
|
|
100
102
|
...metadata,
|
|
101
103
|
baseDir,
|
|
102
104
|
configurationOrigin: resolvesFromSettingsBase
|
|
103
|
-
? baseIndex === 0 || configurationOrigin === "atomic"
|
|
105
|
+
? baseIndex === 0 || configurationOrigin === "atomic"
|
|
106
|
+
? "atomic"
|
|
107
|
+
: "inherited-pi"
|
|
104
108
|
: configurationOrigin,
|
|
105
109
|
};
|
|
106
110
|
await resolveLocalExtensionSource(parsed, accumulator, filter, localMetadata, baseDir, {
|
|
@@ -148,7 +152,7 @@ async function resolvePackageSources(context, sources, accumulator, onMissing, o
|
|
|
148
152
|
await collectPackageResources(installedPath, accumulator, filter, metadata);
|
|
149
153
|
continue;
|
|
150
154
|
}
|
|
151
|
-
|
|
155
|
+
const installedPath = getExistingGitInstallPath(context, parsed, resolvedScope) ?? getGitInstallPath(context, parsed, resolvedScope);
|
|
152
156
|
if (!(await exists(installedPath))) {
|
|
153
157
|
const installed = await installMissing();
|
|
154
158
|
if (!installed)
|
|
@@ -168,8 +172,7 @@ function findAutoloadDeltaBase(context, pkg, scope, sources) {
|
|
|
168
172
|
if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
|
|
169
173
|
return undefined;
|
|
170
174
|
const identity = getPackageIdentity(context, pkg.source, scope);
|
|
171
|
-
const userEntry = sources.find((entry) => entry.scope === "user"
|
|
172
|
-
&& getPackageIdentity(context, getPackageSourceString(entry.pkg), "user") === identity);
|
|
175
|
+
const userEntry = sources.find((entry) => entry.scope === "user" && getPackageIdentity(context, getPackageSourceString(entry.pkg), "user") === identity);
|
|
173
176
|
return userEntry ? { source: getPackageSourceString(userEntry.pkg), scope: "user" } : undefined;
|
|
174
177
|
}
|
|
175
178
|
async function resolveLocalExtensionSource(source, accumulator, filter, metadata, baseDir, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-resolver.js","sourceRoot":"","sources":["../../src/core/package-manager-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC1H,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,kBAAk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O,EAAE,4BAA4B;gBAClE,CAAC,CAAC,MAAM,4BAA4B,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC;gBACpF,CAAC,CAAC,KAAK,CAAC;YACT,MAAM,gBAAgB,GAAG,MAAM,uBAAuB,CAAC,QAAQ,CAAC,CAAC;YACjE,MAAM,0BAA0B,GAC/B,gBAAgB,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,4BAA4B,KAAK,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACzG,IAAI,CAAC,gBAAgB,IAAI,0BAA0B,EAAE,CAAC;gBACrD,WAAW,CAAC,WAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;YACtE,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC","sourcesContent":["import { access, stat } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join } from \"node:path\";\nimport { CONFIG_DIR_NAME } from \"../config.ts\";\nimport { getGitInstallPath } from \"./package-manager-paths.ts\";\nimport { addAutoDiscoveredResources, collectProjectLocalResources } from \"./package-manager-auto-resources.ts\";\nimport { getExistingGitInstallPath, refreshTemporaryGitSource } from \"./package-manager-git.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport { getExistingNpmInstallPath, installedNpmMatchesConfiguredVersion } from \"./package-manager-npm.ts\";\nimport { getBaseDirsForScope, resolvePathFromBase } from \"./package-manager-paths.ts\";\nimport { createAccumulator, addResource, getTargetMap, toResolvedPaths } from \"./package-manager-resource-accumulator.ts\";\nimport { collectPackageResources, resolveLocalEntries } from \"./package-manager-resource-collector.ts\";\nimport { resolveExtensionEntries } from \"./package-manager-resource-files.ts\";\nimport { dedupePackages, getPackageIdentity, getPackageSourceString, parseSource } from \"./package-manager-source.ts\";\nimport { splitPatterns } from \"./package-manager-resource-patterns.ts\";\nimport { installParsedSource } from \"./package-manager-operations.ts\";\nimport type {\n\tMissingSourceAction,\n\tPackageFilter,\n\tPackageManagerContext,\n\tPathMetadata,\n\tResolvedPaths,\n\tResolveExtensionSourcesOptions,\n\tResourceAccumulator,\n\tSourceScope,\n} from \"./package-manager-types.ts\";\nimport type { PackageSource } from \"./settings-manager.ts\";\n\nasync function exists(path: string): Promise<boolean> {\n\ttry { await access(path); return true; } catch { return false; }\n}\n\n\nexport async function resolvePackages(\n\tcontext: PackageManagerContext,\n\tonMissing?: (source: string) => Promise<MissingSourceAction>,\n): Promise<ResolvedPaths> {\n\tconst accumulator = createAccumulator();\n\tconst globalSettings = context.settingsManager.getGlobalSettings();\n\tconst projectSettings = context.settingsManager.getProjectSettings();\n\tconst allPackages: Array<{ pkg: PackageSource; scope: SourceScope }> = [];\n\n\tfor (const pkg of projectSettings.packages ?? []) {\n\t\tallPackages.push({ pkg, scope: \"project\" });\n\t}\n\tfor (const pkg of globalSettings.packages ?? []) {\n\t\tallPackages.push({ pkg, scope: \"user\" });\n\t}\n\n\tconst packageSources = dedupePackages(context, allPackages);\n\tawait resolvePackageSources(context, packageSources, accumulator, onMissing, { settingsField: \"packages\" });\n\n\tconst globalBaseDir = context.agentDir;\n\tconst projectBaseDir = join(context.cwd, CONFIG_DIR_NAME);\n\tconst globalBaseDirs = getBaseDirsForScope(context, \"user\");\n\tconst projectBaseDirs = getBaseDirsForScope(context, \"project\");\n\n\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\tconst target = getTargetMap(accumulator, resourceType);\n\t\tconst globalEntries = (globalSettings[resourceType] ?? []) as string[];\n\t\tconst projectEntries = (projectSettings[resourceType] ?? []) as string[];\n\t\tconst projectOrigin = context.settingsManager.isFieldInherited(\"project\", resourceType) ? \"inherited-pi\" : \"atomic\";\n\t\tconst globalOrigin = context.settingsManager.isFieldInherited(\"global\", resourceType) ? \"inherited-pi\" : \"atomic\";\n\t\tawait resolveConfiguredLocalEntries(projectEntries, resourceType, target, \"project\", projectBaseDirs, projectOrigin);\n\t\tawait resolveConfiguredLocalEntries(globalEntries, resourceType, target, \"user\", globalBaseDirs, globalOrigin);\n\t}\n\n\tawait addAutoDiscoveredResources(context, accumulator, globalSettings, projectSettings, globalBaseDir, projectBaseDir);\n\treturn toResolvedPaths(accumulator);\n}\n\nasync function resolveConfiguredLocalEntries(\n\tentries: string[],\n\tresourceType: \"extensions\" | \"skills\" | \"prompts\" | \"themes\" | \"workflows\",\n\ttarget: ReturnType<typeof getTargetMap>,\n\tscope: \"project\" | \"user\",\n\tbaseDirs: string[],\n\tfieldOrigin: \"atomic\" | \"inherited-pi\",\n): Promise<void> {\n\tconst { plain, patterns } = splitPatterns(entries);\n\tconst relativeEntries = plain.filter((entry) => !isAbsolute(entry) && !entry.startsWith(\"~\"));\n\tconst fixedEntries = plain.filter((entry) => isAbsolute(entry) || entry.startsWith(\"~\"));\n\tfor (const [baseIndex, baseDir] of baseDirs.entries()) {\n\t\tconst metadata: PathMetadata = {\n\t\t\tsource: \"local\",\n\t\t\tscope,\n\t\t\torigin: \"top-level\",\n\t\t\tbaseDir,\n\t\t\tconfigurationOrigin: baseIndex === 0 || fieldOrigin === \"atomic\" ? \"atomic\" : \"inherited-pi\",\n\t\t};\n\t\tawait resolveLocalEntries([...relativeEntries, ...patterns], resourceType, target, metadata, baseDir);\n\t\tawait resolveLocalEntries([...fixedEntries, ...patterns], resourceType, target, {\n\t\t\t...metadata,\n\t\t\tconfigurationOrigin: fieldOrigin,\n\t\t}, baseDir);\n\t}\n}\n\nexport async function resolveExtensionSources(\n\tcontext: PackageManagerContext,\n\tsources: PackageSource[],\n\toptions?: ResolveExtensionSourcesOptions,\n): Promise<ResolvedPaths> {\n\tconst accumulator = createAccumulator();\n\tconst scope: SourceScope = options?.temporary ? \"temporary\" : options?.local ? \"project\" : \"user\";\n\tconst packageSources = sources.map((source) => ({ pkg: source, scope }));\n\tawait resolvePackageSources(context, packageSources, accumulator, undefined, {\n\t\tincludeProjectLocalResources: options?.includeProjectLocalResources === true,\n\t});\n\treturn toResolvedPaths(accumulator);\n}\n\nasync function resolvePackageSources(\n\tcontext: PackageManagerContext,\n\tsources: Array<{ pkg: PackageSource; scope: SourceScope }>,\n\taccumulator: ResourceAccumulator,\n\tonMissing?: (source: string) => Promise<MissingSourceAction>,\n\toptions?: { includeProjectLocalResources?: boolean; settingsField?: \"packages\" },\n): Promise<void> {\n\tfor (const { pkg, scope } of sources) {\n\t\tconst sourceStr = getPackageSourceString(pkg);\n\t\tconst filter = typeof pkg === \"object\" ? pkg : undefined;\n\t\tconst deltaBase = findAutoloadDeltaBase(context, pkg, scope, sources);\n\t\tconst resolvedSource = deltaBase?.source ?? sourceStr;\n\t\tconst resolvedScope = deltaBase?.scope ?? scope;\n\t\tconst parsed = parseSource(resolvedSource);\n\t\tconst configurationOrigin = options?.settingsField && context.settingsManager.isFieldInherited(scope === \"project\" ? \"project\" : \"global\", options.settingsField)\n\t\t\t? \"inherited-pi\"\n\t\t\t: options?.settingsField ? \"atomic\" : undefined;\n\t\tconst metadata: PathMetadata = { source: sourceStr, scope, origin: \"package\", configurationOrigin };\n\n\t\tif (parsed.type === \"local\") {\n\t\t\tfor (const [baseIndex, baseDir] of getBaseDirsForScope(context, resolvedScope).entries()) {\n\t\t\t\tconst resolvesFromSettingsBase = options?.settingsField !== undefined\n\t\t\t\t\t&& !isAbsolute(parsed.path)\n\t\t\t\t\t&& !parsed.path.startsWith(\"~\");\n\t\t\t\tconst localMetadata: PathMetadata = {\n\t\t\t\t\t...metadata,\n\t\t\t\t\tbaseDir,\n\t\t\t\t\tconfigurationOrigin: resolvesFromSettingsBase\n\t\t\t\t\t\t? baseIndex === 0 || configurationOrigin === \"atomic\" ? \"atomic\" : \"inherited-pi\"\n\t\t\t\t\t\t: configurationOrigin,\n\t\t\t\t};\n\t\t\t\tawait resolveLocalExtensionSource(parsed, accumulator, filter, localMetadata, baseDir, {\n\t\t\t\t\tincludeProjectLocalResources: options?.includeProjectLocalResources === true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst installMissing = async (): Promise<boolean> => {\n\t\t\tif (isOfflineModeEnabled()) return false;\n\t\t\tif (!onMissing) {\n\t\t\t\tif (context.driver) await context.driver.installParsedSource(parsed, resolvedScope);\n\t\t\t\telse await installParsedSource(context, parsed, resolvedScope);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst action = await onMissing(sourceStr);\n\t\t\tif (action === \"skip\") return false;\n\t\t\tif (action === \"error\") throw new Error(`Missing source: ${sourceStr}`);\n\t\t\tif (context.driver) await context.driver.installParsedSource(parsed, resolvedScope);\n\t\t\telse await installParsedSource(context, parsed, resolvedScope);\n\t\t\treturn true;\n\t\t};\n\n\t\tif (parsed.type === \"npm\") {\n\t\t\tlet installedPath = getExistingNpmInstallPath(context, parsed, resolvedScope);\n\t\t\tconst needsInstall =\n\t\t\t\t!installedPath || !(await installedNpmMatchesConfiguredVersion(context, parsed, installedPath));\n\t\t\tif (needsInstall) {\n\t\t\t\tconst installed = await installMissing();\n\t\t\t\tif (!installed) continue;\n\t\t\t\tinstalledPath = getExistingNpmInstallPath(context, parsed, resolvedScope);\n\t\t\t\tif (!installedPath || !(await installedNpmMatchesConfiguredVersion(context, parsed, installedPath))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!installedPath) continue;\n\t\t\tmetadata.baseDir = installedPath;\n\t\t\tawait collectPackageResources(installedPath, accumulator, filter, metadata);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet installedPath = getExistingGitInstallPath(context, parsed, resolvedScope) ?? getGitInstallPath(context, parsed, resolvedScope);\n\t\tif (!(await exists(installedPath))) {\n\t\t\tconst installed = await installMissing();\n\t\t\tif (!installed) continue;\n\t\t} else if (resolvedScope === \"temporary\" && !parsed.pinned && !isOfflineModeEnabled()) {\n\t\t\tif (context.driver) await context.driver.refreshTemporaryGitSource(parsed, sourceStr);\n\t\t\telse await refreshTemporaryGitSource(context, parsed, sourceStr);\n\t\t}\n\t\tmetadata.baseDir = installedPath;\n\t\tawait collectPackageResources(installedPath, accumulator, filter, metadata);\n\t}\n}\n\nfunction findAutoloadDeltaBase(\n\tcontext: PackageManagerContext,\n\tpkg: PackageSource,\n\tscope: SourceScope,\n\tsources: Array<{ pkg: PackageSource; scope: SourceScope }>,\n): { source: string; scope: SourceScope } | undefined {\n\tif (scope !== \"project\" || typeof pkg !== \"object\" || pkg.autoload !== false) return undefined;\n\tconst identity = getPackageIdentity(context, pkg.source, scope);\n\tconst userEntry = sources.find((entry) => entry.scope === \"user\"\n\t\t&& getPackageIdentity(context, getPackageSourceString(entry.pkg), \"user\") === identity);\n\treturn userEntry ? { source: getPackageSourceString(userEntry.pkg), scope: \"user\" } : undefined;\n}\n\nasync function resolveLocalExtensionSource(\n\tsource: { type: \"local\"; path: string },\n\taccumulator: ResourceAccumulator,\n\tfilter: PackageFilter | undefined,\n\tmetadata: PathMetadata,\n\tbaseDir: string,\n\toptions?: { includeProjectLocalResources?: boolean },\n): Promise<void> {\n\tconst resolved = resolvePathFromBase(source.path, baseDir);\n\tif (!(await exists(resolved))) return;\n\n\ttry {\n\t\tconst stats = await stat(resolved);\n\t\tif (stats.isFile()) {\n\t\t\taddResource(accumulator.extensions, resolved, { ...metadata, baseDir: dirname(resolved) }, true);\n\t\t\treturn;\n\t\t}\n\t\tif (stats.isDirectory()) {\n\t\t\tconst packageMetadata: PathMetadata = { ...metadata, baseDir: resolved };\n\t\t\tconst packageResources = await collectPackageResources(resolved, accumulator, filter, packageMetadata);\n\t\t\tconst projectLocalResources = options?.includeProjectLocalResources\n\t\t\t\t? await collectProjectLocalResources(resolved, accumulator, filter, packageMetadata)\n\t\t\t\t: false;\n\t\t\tconst extensionEntries = await resolveExtensionEntries(resolved);\n\t\t\tconst shouldAddDirectoryFallback =\n\t\t\t\textensionEntries !== null || (options?.includeProjectLocalResources === true && !projectLocalResources);\n\t\t\tif (!packageResources && shouldAddDirectoryFallback) {\n\t\t\t\taddResource(accumulator.extensions, resolved, packageMetadata, true);\n\t\t\t}\n\t\t}\n\t} catch {}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"package-manager-resolver.js","sourceRoot":"","sources":["../../src/core/package-manager-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACzG,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,eAAe,GACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAatH,KAAK,UAAU,MAAM,CAAC,IAAY;IACjC,IAAI,CAAC;QACJ,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IAA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C,CAAC;YACzG,IAAI,CAAC,gBAAgB,IAAI,0BAA0B,EAAE,CAAC;gBACrD,WAAW,CAAC,WAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;YACtE,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC","sourcesContent":["import { access, stat } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join } from \"node:path\";\nimport { CONFIG_DIR_NAME } from \"../config.ts\";\nimport { addAutoDiscoveredResources, collectProjectLocalResources } from \"./package-manager-auto-resources.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport { getExistingGitInstallPath, refreshTemporaryGitSource } from \"./package-manager-git.ts\";\nimport { getExistingNpmInstallPath, installedNpmMatchesConfiguredVersion } from \"./package-manager-npm.ts\";\nimport { installParsedSource } from \"./package-manager-operations.ts\";\nimport { getBaseDirsForScope, getGitInstallPath, resolvePathFromBase } from \"./package-manager-paths.ts\";\nimport {\n\taddResource,\n\tcreateAccumulator,\n\tgetTargetMap,\n\ttoResolvedPaths,\n} from \"./package-manager-resource-accumulator.ts\";\nimport { collectPackageResources, resolveLocalEntries } from \"./package-manager-resource-collector.ts\";\nimport { resolveExtensionEntries } from \"./package-manager-resource-files.ts\";\nimport { splitPatterns } from \"./package-manager-resource-patterns.ts\";\nimport { dedupePackages, getPackageIdentity, getPackageSourceString, parseSource } from \"./package-manager-source.ts\";\nimport type {\n\tMissingSourceAction,\n\tPackageFilter,\n\tPackageManagerContext,\n\tPathMetadata,\n\tResolvedPaths,\n\tResolveExtensionSourcesOptions,\n\tResourceAccumulator,\n\tSourceScope,\n} from \"./package-manager-types.ts\";\nimport type { PackageSource } from \"./settings-manager.ts\";\n\nasync function exists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport async function resolvePackages(\n\tcontext: PackageManagerContext,\n\tonMissing?: (source: string) => Promise<MissingSourceAction>,\n): Promise<ResolvedPaths> {\n\tconst accumulator = createAccumulator();\n\tconst globalSettings = context.settingsManager.getGlobalSettings();\n\tconst projectSettings = context.settingsManager.getProjectSettings();\n\tconst allPackages: Array<{ pkg: PackageSource; scope: SourceScope }> = [];\n\n\tfor (const pkg of projectSettings.packages ?? []) {\n\t\tallPackages.push({ pkg, scope: \"project\" });\n\t}\n\tfor (const pkg of globalSettings.packages ?? []) {\n\t\tallPackages.push({ pkg, scope: \"user\" });\n\t}\n\n\tconst packageSources = dedupePackages(context, allPackages);\n\tawait resolvePackageSources(context, packageSources, accumulator, onMissing, { settingsField: \"packages\" });\n\n\tconst globalBaseDir = context.agentDir;\n\tconst projectBaseDir = join(context.cwd, CONFIG_DIR_NAME);\n\tconst globalBaseDirs = getBaseDirsForScope(context, \"user\");\n\tconst projectBaseDirs = getBaseDirsForScope(context, \"project\");\n\n\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\tconst target = getTargetMap(accumulator, resourceType);\n\t\tconst globalEntries = (globalSettings[resourceType] ?? []) as string[];\n\t\tconst projectEntries = (projectSettings[resourceType] ?? []) as string[];\n\t\tconst projectOrigin = context.settingsManager.isFieldInherited(\"project\", resourceType)\n\t\t\t? \"inherited-pi\"\n\t\t\t: \"atomic\";\n\t\tconst globalOrigin = context.settingsManager.isFieldInherited(\"global\", resourceType) ? \"inherited-pi\" : \"atomic\";\n\t\tawait resolveConfiguredLocalEntries(\n\t\t\tprojectEntries,\n\t\t\tresourceType,\n\t\t\ttarget,\n\t\t\t\"project\",\n\t\t\tprojectBaseDirs,\n\t\t\tprojectOrigin,\n\t\t);\n\t\tawait resolveConfiguredLocalEntries(globalEntries, resourceType, target, \"user\", globalBaseDirs, globalOrigin);\n\t}\n\n\tawait addAutoDiscoveredResources(\n\t\tcontext,\n\t\taccumulator,\n\t\tglobalSettings,\n\t\tprojectSettings,\n\t\tglobalBaseDir,\n\t\tprojectBaseDir,\n\t);\n\treturn toResolvedPaths(accumulator);\n}\n\nasync function resolveConfiguredLocalEntries(\n\tentries: string[],\n\tresourceType: \"extensions\" | \"skills\" | \"prompts\" | \"themes\" | \"workflows\",\n\ttarget: ReturnType<typeof getTargetMap>,\n\tscope: \"project\" | \"user\",\n\tbaseDirs: string[],\n\tfieldOrigin: \"atomic\" | \"inherited-pi\",\n): Promise<void> {\n\tconst { plain, patterns } = splitPatterns(entries);\n\tconst relativeEntries = plain.filter((entry) => !isAbsolute(entry) && !entry.startsWith(\"~\"));\n\tconst fixedEntries = plain.filter((entry) => isAbsolute(entry) || entry.startsWith(\"~\"));\n\tfor (const [baseIndex, baseDir] of baseDirs.entries()) {\n\t\tconst metadata: PathMetadata = {\n\t\t\tsource: \"local\",\n\t\t\tscope,\n\t\t\torigin: \"top-level\",\n\t\t\tbaseDir,\n\t\t\tconfigurationOrigin: baseIndex === 0 || fieldOrigin === \"atomic\" ? \"atomic\" : \"inherited-pi\",\n\t\t};\n\t\tawait resolveLocalEntries([...relativeEntries, ...patterns], resourceType, target, metadata, baseDir);\n\t\tawait resolveLocalEntries(\n\t\t\t[...fixedEntries, ...patterns],\n\t\t\tresourceType,\n\t\t\ttarget,\n\t\t\t{\n\t\t\t\t...metadata,\n\t\t\t\tconfigurationOrigin: fieldOrigin,\n\t\t\t},\n\t\t\tbaseDir,\n\t\t);\n\t}\n}\n\nexport async function resolveExtensionSources(\n\tcontext: PackageManagerContext,\n\tsources: PackageSource[],\n\toptions?: ResolveExtensionSourcesOptions,\n): Promise<ResolvedPaths> {\n\tconst accumulator = createAccumulator();\n\tconst scope: SourceScope = options?.temporary ? \"temporary\" : options?.local ? \"project\" : \"user\";\n\tconst packageSources = sources.map((source) => ({ pkg: source, scope }));\n\tawait resolvePackageSources(context, packageSources, accumulator, undefined, {\n\t\tincludeProjectLocalResources: options?.includeProjectLocalResources === true,\n\t});\n\treturn toResolvedPaths(accumulator);\n}\n\nasync function resolvePackageSources(\n\tcontext: PackageManagerContext,\n\tsources: Array<{ pkg: PackageSource; scope: SourceScope }>,\n\taccumulator: ResourceAccumulator,\n\tonMissing?: (source: string) => Promise<MissingSourceAction>,\n\toptions?: { includeProjectLocalResources?: boolean; settingsField?: \"packages\" },\n): Promise<void> {\n\tfor (const { pkg, scope } of sources) {\n\t\tconst sourceStr = getPackageSourceString(pkg);\n\t\tconst filter = typeof pkg === \"object\" ? pkg : undefined;\n\t\tconst deltaBase = findAutoloadDeltaBase(context, pkg, scope, sources);\n\t\tconst resolvedSource = deltaBase?.source ?? sourceStr;\n\t\tconst resolvedScope = deltaBase?.scope ?? scope;\n\t\tconst parsed = parseSource(resolvedSource);\n\t\tconst configurationOrigin =\n\t\t\toptions?.settingsField &&\n\t\t\tcontext.settingsManager.isFieldInherited(scope === \"project\" ? \"project\" : \"global\", options.settingsField)\n\t\t\t\t? \"inherited-pi\"\n\t\t\t\t: options?.settingsField\n\t\t\t\t\t? \"atomic\"\n\t\t\t\t\t: undefined;\n\t\tconst metadata: PathMetadata = { source: sourceStr, scope, origin: \"package\", configurationOrigin };\n\n\t\tif (parsed.type === \"local\") {\n\t\t\tfor (const [baseIndex, baseDir] of getBaseDirsForScope(context, resolvedScope).entries()) {\n\t\t\t\tconst resolvesFromSettingsBase =\n\t\t\t\t\toptions?.settingsField !== undefined && !isAbsolute(parsed.path) && !parsed.path.startsWith(\"~\");\n\t\t\t\tconst localMetadata: PathMetadata = {\n\t\t\t\t\t...metadata,\n\t\t\t\t\tbaseDir,\n\t\t\t\t\tconfigurationOrigin: resolvesFromSettingsBase\n\t\t\t\t\t\t? baseIndex === 0 || configurationOrigin === \"atomic\"\n\t\t\t\t\t\t\t? \"atomic\"\n\t\t\t\t\t\t\t: \"inherited-pi\"\n\t\t\t\t\t\t: configurationOrigin,\n\t\t\t\t};\n\t\t\t\tawait resolveLocalExtensionSource(parsed, accumulator, filter, localMetadata, baseDir, {\n\t\t\t\t\tincludeProjectLocalResources: options?.includeProjectLocalResources === true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst installMissing = async (): Promise<boolean> => {\n\t\t\tif (isOfflineModeEnabled()) return false;\n\t\t\tif (!onMissing) {\n\t\t\t\tif (context.driver) await context.driver.installParsedSource(parsed, resolvedScope);\n\t\t\t\telse await installParsedSource(context, parsed, resolvedScope);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst action = await onMissing(sourceStr);\n\t\t\tif (action === \"skip\") return false;\n\t\t\tif (action === \"error\") throw new Error(`Missing source: ${sourceStr}`);\n\t\t\tif (context.driver) await context.driver.installParsedSource(parsed, resolvedScope);\n\t\t\telse await installParsedSource(context, parsed, resolvedScope);\n\t\t\treturn true;\n\t\t};\n\n\t\tif (parsed.type === \"npm\") {\n\t\t\tlet installedPath = getExistingNpmInstallPath(context, parsed, resolvedScope);\n\t\t\tconst needsInstall =\n\t\t\t\t!installedPath || !(await installedNpmMatchesConfiguredVersion(context, parsed, installedPath));\n\t\t\tif (needsInstall) {\n\t\t\t\tconst installed = await installMissing();\n\t\t\t\tif (!installed) continue;\n\t\t\t\tinstalledPath = getExistingNpmInstallPath(context, parsed, resolvedScope);\n\t\t\t\tif (!installedPath || !(await installedNpmMatchesConfiguredVersion(context, parsed, installedPath))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!installedPath) continue;\n\t\t\tmetadata.baseDir = installedPath;\n\t\t\tawait collectPackageResources(installedPath, accumulator, filter, metadata);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst installedPath =\n\t\t\tgetExistingGitInstallPath(context, parsed, resolvedScope) ?? getGitInstallPath(context, parsed, resolvedScope);\n\t\tif (!(await exists(installedPath))) {\n\t\t\tconst installed = await installMissing();\n\t\t\tif (!installed) continue;\n\t\t} else if (resolvedScope === \"temporary\" && !parsed.pinned && !isOfflineModeEnabled()) {\n\t\t\tif (context.driver) await context.driver.refreshTemporaryGitSource(parsed, sourceStr);\n\t\t\telse await refreshTemporaryGitSource(context, parsed, sourceStr);\n\t\t}\n\t\tmetadata.baseDir = installedPath;\n\t\tawait collectPackageResources(installedPath, accumulator, filter, metadata);\n\t}\n}\n\nfunction findAutoloadDeltaBase(\n\tcontext: PackageManagerContext,\n\tpkg: PackageSource,\n\tscope: SourceScope,\n\tsources: Array<{ pkg: PackageSource; scope: SourceScope }>,\n): { source: string; scope: SourceScope } | undefined {\n\tif (scope !== \"project\" || typeof pkg !== \"object\" || pkg.autoload !== false) return undefined;\n\tconst identity = getPackageIdentity(context, pkg.source, scope);\n\tconst userEntry = sources.find(\n\t\t(entry) =>\n\t\t\tentry.scope === \"user\" && getPackageIdentity(context, getPackageSourceString(entry.pkg), \"user\") === identity,\n\t);\n\treturn userEntry ? { source: getPackageSourceString(userEntry.pkg), scope: \"user\" } : undefined;\n}\n\nasync function resolveLocalExtensionSource(\n\tsource: { type: \"local\"; path: string },\n\taccumulator: ResourceAccumulator,\n\tfilter: PackageFilter | undefined,\n\tmetadata: PathMetadata,\n\tbaseDir: string,\n\toptions?: { includeProjectLocalResources?: boolean },\n): Promise<void> {\n\tconst resolved = resolvePathFromBase(source.path, baseDir);\n\tif (!(await exists(resolved))) return;\n\n\ttry {\n\t\tconst stats = await stat(resolved);\n\t\tif (stats.isFile()) {\n\t\t\taddResource(accumulator.extensions, resolved, { ...metadata, baseDir: dirname(resolved) }, true);\n\t\t\treturn;\n\t\t}\n\t\tif (stats.isDirectory()) {\n\t\t\tconst packageMetadata: PathMetadata = { ...metadata, baseDir: resolved };\n\t\t\tconst packageResources = await collectPackageResources(resolved, accumulator, filter, packageMetadata);\n\t\t\tconst projectLocalResources = options?.includeProjectLocalResources\n\t\t\t\t? await collectProjectLocalResources(resolved, accumulator, filter, packageMetadata)\n\t\t\t\t: false;\n\t\t\tconst extensionEntries = await resolveExtensionEntries(resolved);\n\t\t\tconst shouldAddDirectoryFallback =\n\t\t\t\textensionEntries !== null || (options?.includeProjectLocalResources === true && !projectLocalResources);\n\t\t\tif (!packageResources && shouldAddDirectoryFallback) {\n\t\t\t\taddResource(accumulator.extensions, resolved, packageMetadata, true);\n\t\t\t}\n\t\t}\n\t} catch {}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-resource-collector.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-resource-collector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-manager-resource-collector.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-resource-collector.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,MAAM,4BAA4B,CAAC;AAoBpC,wBAAsB,uBAAuB,CAC5C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,mBAAmB,EAChC,MAAM,EAAE,aAAa,GAAG,SAAS,EACjC,QAAQ,EAAE,YAAY,GACpB,OAAO,CAAC,OAAO,CAAC,CA4ClB;AAwFD,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW1G"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { access, readFile, stat } from "node:fs/promises";
|
|
2
|
-
import { glob } from "glob";
|
|
3
2
|
import { resolve } from "node:path";
|
|
3
|
+
import { glob } from "glob";
|
|
4
|
+
import { conventionDirsForResource, getManifestFromPackageJson, manifestEntriesForResource, } from "./package-manager-manifest.js";
|
|
5
|
+
import { resolvePathFromBase } from "./package-manager-paths.js";
|
|
4
6
|
import { addResource, getTargetMap } from "./package-manager-resource-accumulator.js";
|
|
5
7
|
import { collectResourceFiles } from "./package-manager-resource-files.js";
|
|
6
|
-
import {
|
|
7
|
-
import { applyAutoloadDisabledPatterns, applyPatterns, hasGlobPattern, isOverridePattern, splitPatterns } from "./package-manager-resource-patterns.js";
|
|
8
|
-
import { resolvePathFromBase } from "./package-manager-paths.js";
|
|
8
|
+
import { applyAutoloadDisabledPatterns, applyPatterns, hasGlobPattern, isOverridePattern, splitPatterns, } from "./package-manager-resource-patterns.js";
|
|
9
9
|
async function exists(path) {
|
|
10
10
|
try {
|
|
11
11
|
await access(path);
|
|
@@ -104,7 +104,7 @@ async function collectManifestFiles(packageRoot, resourceType) {
|
|
|
104
104
|
const allFiles = [];
|
|
105
105
|
for (const dir of conventionDirsForResource(packageRoot, resourceType)) {
|
|
106
106
|
if (await exists(dir))
|
|
107
|
-
allFiles.push(...await collectResourceFiles(dir, resourceType));
|
|
107
|
+
allFiles.push(...(await collectResourceFiles(dir, resourceType)));
|
|
108
108
|
}
|
|
109
109
|
return { allFiles, enabledByManifest: new Set(allFiles) };
|
|
110
110
|
}
|
|
@@ -148,7 +148,7 @@ export async function collectFilesFromPaths(paths, resourceType) {
|
|
|
148
148
|
if (stats.isFile())
|
|
149
149
|
files.push(p);
|
|
150
150
|
else if (stats.isDirectory())
|
|
151
|
-
files.push(...await collectResourceFiles(p, resourceType));
|
|
151
|
+
files.push(...(await collectResourceFiles(p, resourceType)));
|
|
152
152
|
}
|
|
153
153
|
catch { }
|
|
154
154
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-resource-collector.js","sourceRoot":"","sources":["../../src/core/package-manager-resource-collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,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AC,KAAK,UAAU,qBAAqB,CAAC,KAAe,EAAE,YAA0B;IACtF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QACjC,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,KAAK,CAAC,MAAM,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAC7B,IAAI,KAAK,CAAC,WAAW,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,oBAAoB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;QAC1F,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { access, readFile, stat } from \"node:fs/promises\";\nimport { glob } from \"glob\";\nimport { resolve } from \"node:path\";\nimport { addResource, getTargetMap } from \"./package-manager-resource-accumulator.ts\";\nimport { collectResourceFiles } from \"./package-manager-resource-files.ts\";\nimport { conventionDirsForResource, getManifestFromPackageJson, manifestEntriesForResource } from \"./package-manager-manifest.ts\";\nimport { applyAutoloadDisabledPatterns, applyPatterns, hasGlobPattern, isOverridePattern, splitPatterns } from \"./package-manager-resource-patterns.ts\";\nimport { resolvePathFromBase } from \"./package-manager-paths.ts\";\nimport type { PackageFilter, PathMetadata, ResourceAccumulator, ResourceMap, ResourceType } from \"./package-manager-types.ts\";\n\nasync function exists(path: string): Promise<boolean> {\n\ttry { await access(path); return true; } catch { return false; }\n}\n\nasync function readPiManifest(packageRoot: string): Promise<ReturnType<typeof getManifestFromPackageJson> | null> {\n\ttry {\n\t\tconst content = await readFile(resolve(packageRoot, \"package.json\"), \"utf-8\");\n\t\treturn getManifestFromPackageJson(JSON.parse(content) as Record<string, unknown>);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport async function collectPackageResources(\n\tpackageRoot: string,\n\taccumulator: ResourceAccumulator,\n\tfilter: PackageFilter | undefined,\n\tmetadata: PathMetadata,\n): Promise<boolean> {\n\tif (filter) {\n\t\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\t\tconst patterns = filter[resourceType];\n\t\t\tconst target = getTargetMap(accumulator, resourceType);\n\t\t\tif (filter.autoload === false) {\n\t\t\t\tconst { allFiles } = await collectManifestFiles(packageRoot, resourceType);\n\t\t\t\tconst selected = applyAutoloadDisabledPatterns(allFiles, patterns ?? [], packageRoot);\n\t\t\t\tfor (const [filePath, enabled] of selected) addResource(target, filePath, metadata, enabled);\n\t\t\t} else if (patterns !== undefined) await applyPackageFilter(packageRoot, patterns, resourceType, target, metadata);\n\t\t\telse await collectDefaultResources(packageRoot, resourceType, target, metadata);\n\t\t}\n\t\treturn true;\n\t}\n\tconst manifest = await readPiManifest(packageRoot);\n\tif (manifest) {\n\t\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\t\tconst entries = manifestEntriesForResource(manifest, resourceType);\n\t\t\tif (entries !== undefined) {\n\t\t\t\tawait addManifestEntries(entries, packageRoot, resourceType, getTargetMap(accumulator, resourceType), metadata);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (resourceType === \"workflows\") await collectDefaultResources(packageRoot, resourceType, getTargetMap(accumulator, resourceType), metadata);\n\t\t}\n\t\treturn true;\n\t}\n\tlet hasAnyDir = false;\n\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\tfor (const dir of conventionDirsForResource(packageRoot, resourceType)) {\n\t\t\tif (!(await exists(dir))) continue;\n\t\t\tfor (const f of await collectResourceFiles(dir, resourceType)) addResource(getTargetMap(accumulator, resourceType), f, metadata, true);\n\t\t\thasAnyDir = true;\n\t\t}\n\t}\n\treturn hasAnyDir;\n}\n\nasync function collectDefaultResources(packageRoot: string, resourceType: ResourceType, target: ResourceMap, metadata: PathMetadata): Promise<void> {\n\tconst manifest = await readPiManifest(packageRoot);\n\tconst entries = manifestEntriesForResource(manifest, resourceType);\n\tif (entries !== undefined) {\n\t\tawait addManifestEntries(entries, packageRoot, resourceType, target, metadata);\n\t\treturn;\n\t}\n\tfor (const dir of conventionDirsForResource(packageRoot, resourceType)) {\n\t\tif (!(await exists(dir))) continue;\n\t\tfor (const f of await collectResourceFiles(dir, resourceType)) addResource(target, f, metadata, true);\n\t}\n}\n\nasync function applyPackageFilter(packageRoot: string, userPatterns: string[], resourceType: ResourceType, target: ResourceMap, metadata: PathMetadata): Promise<void> {\n\tconst { allFiles } = await collectManifestFiles(packageRoot, resourceType);\n\tif (userPatterns.length === 0) {\n\t\tfor (const f of allFiles) addResource(target, f, metadata, false);\n\t\treturn;\n\t}\n\tconst enabledByUser = applyPatterns(allFiles, userPatterns, packageRoot);\n\tfor (const f of allFiles) addResource(target, f, metadata, enabledByUser.has(f));\n}\n\nasync function collectManifestFiles(packageRoot: string, resourceType: ResourceType): Promise<{ allFiles: string[]; enabledByManifest: Set<string> }> {\n\tconst manifest = await readPiManifest(packageRoot);\n\tconst entries = manifestEntriesForResource(manifest, resourceType);\n\tif (entries && entries.length > 0) {\n\t\tconst allFiles = await collectFilesFromManifestEntries(entries, packageRoot, resourceType);\n\t\tconst manifestPatterns = entries.filter(isOverridePattern);\n\t\tconst enabledByManifest = manifestPatterns.length > 0 ? applyPatterns(allFiles, manifestPatterns, packageRoot) : new Set(allFiles);\n\t\treturn { allFiles: Array.from(enabledByManifest), enabledByManifest };\n\t}\n\tconst allFiles: string[] = [];\n\tfor (const dir of conventionDirsForResource(packageRoot, resourceType)) {\n\t\tif (await exists(dir)) allFiles.push(...await collectResourceFiles(dir, resourceType));\n\t}\n\treturn { allFiles, enabledByManifest: new Set(allFiles) };\n}\n\nasync function addManifestEntries(entries: string[] | undefined, root: string, resourceType: ResourceType, target: ResourceMap, metadata: PathMetadata): Promise<void> {\n\tif (!entries) return;\n\tconst allFiles = await collectFilesFromManifestEntries(entries, root, resourceType);\n\tconst patterns = entries.filter(isOverridePattern);\n\tconst enabledPaths = applyPatterns(allFiles, patterns, root);\n\tfor (const f of allFiles) if (enabledPaths.has(f)) addResource(target, f, metadata, true);\n}\n\nasync function collectFilesFromManifestEntries(entries: string[], root: string, resourceType: ResourceType): Promise<string[]> {\n\tconst resolved: string[] = [];\n\tfor (const entry of entries.filter((entry) => !isOverridePattern(entry))) {\n\t\tif (!hasGlobPattern(entry)) resolved.push(resolve(root, entry));\n\t\telse resolved.push(...(await glob(entry, { cwd: root, absolute: true, dot: false, nodir: false })).map((match) => resolve(match)));\n\t}\n\treturn collectFilesFromPaths(resolved, resourceType);\n}\n\nexport async function resolveLocalEntries(entries: string[], resourceType: ResourceType, target: ResourceMap, metadata: PathMetadata, baseDir: string): Promise<void> {\n\tif (entries.length === 0) return;\n\tconst { plain, patterns } = splitPatterns(entries);\n\tconst resolvedPlain = plain.map((p) => resolvePathFromBase(p, baseDir));\n\tconst allFiles = await collectFilesFromPaths(resolvedPlain, resourceType);\n\tconst enabledPaths = applyPatterns(allFiles, patterns, baseDir);\n\tfor (const f of allFiles) addResource(target, f, metadata, enabledPaths.has(f));\n}\n\nexport async function collectFilesFromPaths(paths: string[], resourceType: ResourceType): Promise<string[]> {\n\tconst files: string[] = [];\n\tfor (const p of paths) {\n\t\tif (!(await exists(p))) continue;\n\t\ttry {\n\t\t\tconst stats = await stat(p);\n\t\t\tif (stats.isFile()) files.push(p);\n\t\t\telse if (stats.isDirectory()) files.push(...await collectResourceFiles(p, resourceType));\n\t\t} catch {}\n\t}\n\treturn files;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"package-manager-resource-collector.js","sourceRoot":"","sources":["../../src/core/package-manager-resource-collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,I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AAK,MAAM,CAAC,IAAI,QAAQ;QAAE,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAe,EAAE,YAA0B;IACtF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QACjC,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,KAAK,CAAC,MAAM,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAC7B,IAAI,KAAK,CAAC,WAAW,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC5F,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { access, readFile, stat } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { glob } from \"glob\";\nimport {\n\tconventionDirsForResource,\n\tgetManifestFromPackageJson,\n\tmanifestEntriesForResource,\n} from \"./package-manager-manifest.ts\";\nimport { resolvePathFromBase } from \"./package-manager-paths.ts\";\nimport { addResource, getTargetMap } from \"./package-manager-resource-accumulator.ts\";\nimport { collectResourceFiles } from \"./package-manager-resource-files.ts\";\nimport {\n\tapplyAutoloadDisabledPatterns,\n\tapplyPatterns,\n\thasGlobPattern,\n\tisOverridePattern,\n\tsplitPatterns,\n} from \"./package-manager-resource-patterns.ts\";\nimport type {\n\tPackageFilter,\n\tPathMetadata,\n\tResourceAccumulator,\n\tResourceMap,\n\tResourceType,\n} from \"./package-manager-types.ts\";\n\nasync function exists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function readPiManifest(packageRoot: string): Promise<ReturnType<typeof getManifestFromPackageJson> | null> {\n\ttry {\n\t\tconst content = await readFile(resolve(packageRoot, \"package.json\"), \"utf-8\");\n\t\treturn getManifestFromPackageJson(JSON.parse(content) as Record<string, unknown>);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport async function collectPackageResources(\n\tpackageRoot: string,\n\taccumulator: ResourceAccumulator,\n\tfilter: PackageFilter | undefined,\n\tmetadata: PathMetadata,\n): Promise<boolean> {\n\tif (filter) {\n\t\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\t\tconst patterns = filter[resourceType];\n\t\t\tconst target = getTargetMap(accumulator, resourceType);\n\t\t\tif (filter.autoload === false) {\n\t\t\t\tconst { allFiles } = await collectManifestFiles(packageRoot, resourceType);\n\t\t\t\tconst selected = applyAutoloadDisabledPatterns(allFiles, patterns ?? [], packageRoot);\n\t\t\t\tfor (const [filePath, enabled] of selected) addResource(target, filePath, metadata, enabled);\n\t\t\t} else if (patterns !== undefined)\n\t\t\t\tawait applyPackageFilter(packageRoot, patterns, resourceType, target, metadata);\n\t\t\telse await collectDefaultResources(packageRoot, resourceType, target, metadata);\n\t\t}\n\t\treturn true;\n\t}\n\tconst manifest = await readPiManifest(packageRoot);\n\tif (manifest) {\n\t\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\t\tconst entries = manifestEntriesForResource(manifest, resourceType);\n\t\t\tif (entries !== undefined) {\n\t\t\t\tawait addManifestEntries(\n\t\t\t\t\tentries,\n\t\t\t\t\tpackageRoot,\n\t\t\t\t\tresourceType,\n\t\t\t\t\tgetTargetMap(accumulator, resourceType),\n\t\t\t\t\tmetadata,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (resourceType === \"workflows\")\n\t\t\t\tawait collectDefaultResources(packageRoot, resourceType, getTargetMap(accumulator, resourceType), metadata);\n\t\t}\n\t\treturn true;\n\t}\n\tlet hasAnyDir = false;\n\tfor (const resourceType of [\"extensions\", \"skills\", \"prompts\", \"themes\", \"workflows\"] as const) {\n\t\tfor (const dir of conventionDirsForResource(packageRoot, resourceType)) {\n\t\t\tif (!(await exists(dir))) continue;\n\t\t\tfor (const f of await collectResourceFiles(dir, resourceType))\n\t\t\t\taddResource(getTargetMap(accumulator, resourceType), f, metadata, true);\n\t\t\thasAnyDir = true;\n\t\t}\n\t}\n\treturn hasAnyDir;\n}\n\nasync function collectDefaultResources(\n\tpackageRoot: string,\n\tresourceType: ResourceType,\n\ttarget: ResourceMap,\n\tmetadata: PathMetadata,\n): Promise<void> {\n\tconst manifest = await readPiManifest(packageRoot);\n\tconst entries = manifestEntriesForResource(manifest, resourceType);\n\tif (entries !== undefined) {\n\t\tawait addManifestEntries(entries, packageRoot, resourceType, target, metadata);\n\t\treturn;\n\t}\n\tfor (const dir of conventionDirsForResource(packageRoot, resourceType)) {\n\t\tif (!(await exists(dir))) continue;\n\t\tfor (const f of await collectResourceFiles(dir, resourceType)) addResource(target, f, metadata, true);\n\t}\n}\n\nasync function applyPackageFilter(\n\tpackageRoot: string,\n\tuserPatterns: string[],\n\tresourceType: ResourceType,\n\ttarget: ResourceMap,\n\tmetadata: PathMetadata,\n): Promise<void> {\n\tconst { allFiles } = await collectManifestFiles(packageRoot, resourceType);\n\tif (userPatterns.length === 0) {\n\t\tfor (const f of allFiles) addResource(target, f, metadata, false);\n\t\treturn;\n\t}\n\tconst enabledByUser = applyPatterns(allFiles, userPatterns, packageRoot);\n\tfor (const f of allFiles) addResource(target, f, metadata, enabledByUser.has(f));\n}\n\nasync function collectManifestFiles(\n\tpackageRoot: string,\n\tresourceType: ResourceType,\n): Promise<{ allFiles: string[]; enabledByManifest: Set<string> }> {\n\tconst manifest = await readPiManifest(packageRoot);\n\tconst entries = manifestEntriesForResource(manifest, resourceType);\n\tif (entries && entries.length > 0) {\n\t\tconst allFiles = await collectFilesFromManifestEntries(entries, packageRoot, resourceType);\n\t\tconst manifestPatterns = entries.filter(isOverridePattern);\n\t\tconst enabledByManifest =\n\t\t\tmanifestPatterns.length > 0 ? applyPatterns(allFiles, manifestPatterns, packageRoot) : new Set(allFiles);\n\t\treturn { allFiles: Array.from(enabledByManifest), enabledByManifest };\n\t}\n\tconst allFiles: string[] = [];\n\tfor (const dir of conventionDirsForResource(packageRoot, resourceType)) {\n\t\tif (await exists(dir)) allFiles.push(...(await collectResourceFiles(dir, resourceType)));\n\t}\n\treturn { allFiles, enabledByManifest: new Set(allFiles) };\n}\n\nasync function addManifestEntries(\n\tentries: string[] | undefined,\n\troot: string,\n\tresourceType: ResourceType,\n\ttarget: ResourceMap,\n\tmetadata: PathMetadata,\n): Promise<void> {\n\tif (!entries) return;\n\tconst allFiles = await collectFilesFromManifestEntries(entries, root, resourceType);\n\tconst patterns = entries.filter(isOverridePattern);\n\tconst enabledPaths = applyPatterns(allFiles, patterns, root);\n\tfor (const f of allFiles) if (enabledPaths.has(f)) addResource(target, f, metadata, true);\n}\n\nasync function collectFilesFromManifestEntries(\n\tentries: string[],\n\troot: string,\n\tresourceType: ResourceType,\n): Promise<string[]> {\n\tconst resolved: string[] = [];\n\tfor (const entry of entries.filter((entry) => !isOverridePattern(entry))) {\n\t\tif (!hasGlobPattern(entry)) resolved.push(resolve(root, entry));\n\t\telse\n\t\t\tresolved.push(\n\t\t\t\t...(await glob(entry, { cwd: root, absolute: true, dot: false, nodir: false })).map((match) =>\n\t\t\t\t\tresolve(match),\n\t\t\t\t),\n\t\t\t);\n\t}\n\treturn collectFilesFromPaths(resolved, resourceType);\n}\n\nexport async function resolveLocalEntries(\n\tentries: string[],\n\tresourceType: ResourceType,\n\ttarget: ResourceMap,\n\tmetadata: PathMetadata,\n\tbaseDir: string,\n): Promise<void> {\n\tif (entries.length === 0) return;\n\tconst { plain, patterns } = splitPatterns(entries);\n\tconst resolvedPlain = plain.map((p) => resolvePathFromBase(p, baseDir));\n\tconst allFiles = await collectFilesFromPaths(resolvedPlain, resourceType);\n\tconst enabledPaths = applyPatterns(allFiles, patterns, baseDir);\n\tfor (const f of allFiles) addResource(target, f, metadata, enabledPaths.has(f));\n}\n\nexport async function collectFilesFromPaths(paths: string[], resourceType: ResourceType): Promise<string[]> {\n\tconst files: string[] = [];\n\tfor (const p of paths) {\n\t\tif (!(await exists(p))) continue;\n\t\ttry {\n\t\t\tconst stats = await stat(p);\n\t\t\tif (stats.isFile()) files.push(p);\n\t\t\telse if (stats.isDirectory()) files.push(...(await collectResourceFiles(p, resourceType)));\n\t\t} catch {}\n\t}\n\treturn files;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-resource-files.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-resource-files.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI9E,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAC/C,KAAK,kBAAkB,GAAG,IAAI,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"package-manager-resource-files.d.ts","sourceRoot":"","sources":["../../src/core/package-manager-resource-files.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI9E,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAC/C,KAAK,kBAAkB,GAAG,IAAI,GAAG,QAAQ,CAAC;AAoE1C,wBAAsB,YAAY,CACjC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,eAAe,UAAO,EACtB,aA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