@entelligentsia/forgecli 0.21.0 → 1.0.2
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 +21 -0
- package/README.md +31 -33
- package/dist/CHANGELOG-forge-plugin.md +118 -0
- package/dist/CHANGELOG-pi.md +24 -1
- package/dist/bin/forgecli.d.ts +2 -0
- package/dist/bin/forgecli.js +6 -0
- package/dist/bin/forgecli.js.map +1 -0
- package/dist/extensions/forgecli/add-pipeline.js +1 -1
- package/dist/extensions/forgecli/add-pipeline.js.map +1 -1
- package/dist/extensions/forgecli/add-task.js +1 -1
- package/dist/extensions/forgecli/add-task.js.map +1 -1
- package/dist/extensions/forgecli/approve.js +17 -2
- package/dist/extensions/forgecli/approve.js.map +1 -1
- package/dist/extensions/forgecli/calibrate.js +11 -8
- package/dist/extensions/forgecli/calibrate.js.map +1 -1
- package/dist/extensions/forgecli/collate.js +1 -1
- package/dist/extensions/forgecli/collate.js.map +1 -1
- package/dist/extensions/forgecli/commit.js +17 -2
- package/dist/extensions/forgecli/commit.js.map +1 -1
- package/dist/extensions/forgecli/enhance.js +1 -1
- package/dist/extensions/forgecli/enhance.js.map +1 -1
- package/dist/extensions/forgecli/forge-artifact-tool.d.ts +6 -8
- package/dist/extensions/forgecli/forge-artifact-tool.js +80 -195
- package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
- package/dist/extensions/forgecli/forge-commands.js +57 -18
- package/dist/extensions/forgecli/forge-commands.js.map +1 -1
- package/dist/extensions/forgecli/forge-init/phase4-register.js +6 -7
- package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
- package/dist/extensions/forgecli/forge-init/run-phases.d.ts +4 -0
- package/dist/extensions/forgecli/forge-init/run-phases.js +304 -0
- package/dist/extensions/forgecli/forge-init/run-phases.js.map +1 -0
- package/dist/extensions/forgecli/forge-init/verifiers.d.ts +14 -5
- package/dist/extensions/forgecli/forge-init/verifiers.js +79 -62
- package/dist/extensions/forgecli/forge-init/verifiers.js.map +1 -1
- package/dist/extensions/forgecli/forge-init.js +131 -76
- package/dist/extensions/forgecli/forge-init.js.map +1 -1
- package/dist/extensions/forgecli/forge-subagent.d.ts +9 -0
- package/dist/extensions/forgecli/forge-subagent.js +11 -6
- package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
- package/dist/extensions/forgecli/forge-tools.d.ts +28 -4
- package/dist/extensions/forgecli/forge-tools.js +122 -73
- package/dist/extensions/forgecli/forge-tools.js.map +1 -1
- package/dist/extensions/forgecli/health-check.js +3 -3
- package/dist/extensions/forgecli/health-check.js.map +1 -1
- package/dist/extensions/forgecli/hook-dispatcher.d.ts +1 -1
- package/dist/extensions/forgecli/hooks/check-update.d.ts +8 -0
- package/dist/extensions/forgecli/hooks/check-update.js +29 -1
- package/dist/extensions/forgecli/hooks/check-update.js.map +1 -1
- package/dist/extensions/forgecli/hooks/post-init-hook.js +6 -6
- package/dist/extensions/forgecli/hooks/post-init-hook.js.map +1 -1
- package/dist/extensions/forgecli/hooks/post-sprint-hook.js +6 -6
- package/dist/extensions/forgecli/hooks/post-sprint-hook.js.map +1 -1
- package/dist/extensions/forgecli/hooks/triage-error.js +1 -0
- package/dist/extensions/forgecli/hooks/triage-error.js.map +1 -1
- package/dist/extensions/forgecli/implement.js +20 -2
- package/dist/extensions/forgecli/implement.js.map +1 -1
- package/dist/extensions/forgecli/index.js +39 -32
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/lib/pipeline-guard.d.ts +41 -0
- package/dist/extensions/forgecli/lib/pipeline-guard.js +100 -0
- package/dist/extensions/forgecli/lib/pipeline-guard.js.map +1 -0
- package/dist/extensions/forgecli/loaders/persona-skill-loader.js +2 -2
- package/dist/extensions/forgecli/loaders/persona-skill-loader.js.map +1 -1
- package/dist/extensions/forgecli/migrate.d.ts +3 -0
- package/dist/extensions/forgecli/migrate.js +4 -2
- package/dist/extensions/forgecli/migrate.js.map +1 -1
- package/dist/extensions/forgecli/plan.js +21 -2
- package/dist/extensions/forgecli/plan.js.map +1 -1
- package/dist/extensions/forgecli/quiz-agent.js +7 -7
- package/dist/extensions/forgecli/quiz-agent.js.map +1 -1
- package/dist/extensions/forgecli/regenerate.js +49 -18
- package/dist/extensions/forgecli/regenerate.js.map +1 -1
- package/dist/extensions/forgecli/remove-command.js +1 -1
- package/dist/extensions/forgecli/remove-command.js.map +1 -1
- package/dist/extensions/forgecli/report-bug.js +1 -1
- package/dist/extensions/forgecli/report-bug.js.map +1 -1
- package/dist/extensions/forgecli/retrospective.js +9 -9
- package/dist/extensions/forgecli/retrospective.js.map +1 -1
- package/dist/extensions/forgecli/review-code.d.ts +13 -0
- package/dist/extensions/forgecli/review-code.js +62 -3
- package/dist/extensions/forgecli/review-code.js.map +1 -1
- package/dist/extensions/forgecli/review-plan.d.ts +13 -0
- package/dist/extensions/forgecli/review-plan.js +65 -3
- package/dist/extensions/forgecli/review-plan.js.map +1 -1
- package/dist/extensions/forgecli/skill-curator-subagent.d.ts +2 -1
- package/dist/extensions/forgecli/skill-curator-subagent.js +2 -1
- package/dist/extensions/forgecli/skill-curator-subagent.js.map +1 -1
- package/dist/extensions/forgecli/sprint-intake.js +6 -6
- package/dist/extensions/forgecli/sprint-intake.js.map +1 -1
- package/dist/extensions/forgecli/sprint-plan.js +9 -9
- package/dist/extensions/forgecli/sprint-plan.js.map +1 -1
- package/dist/extensions/forgecli/status-command.js +1 -1
- package/dist/extensions/forgecli/status-command.js.map +1 -1
- package/dist/extensions/forgecli/store-query.js +11 -11
- package/dist/extensions/forgecli/store-query.js.map +1 -1
- package/dist/extensions/forgecli/store-repair.js +7 -7
- package/dist/extensions/forgecli/store-repair.js.map +1 -1
- package/dist/extensions/forgecli/validate.js +17 -2
- package/dist/extensions/forgecli/validate.js.map +1 -1
- package/dist/forge-payload/.base-pack/commands/check-agent.md +22 -0
- package/dist/forge-payload/.base-pack/commands/new-sprint.md +22 -0
- package/dist/forge-payload/.base-pack/commands/plan-sprint.md +22 -0
- package/dist/forge-payload/.base-pack/commands/quiz-agent.md +2 -18
- package/dist/forge-payload/.base-pack/commands/retro.md +22 -0
- package/dist/forge-payload/.base-pack/commands/retrospective.md +2 -18
- package/dist/forge-payload/.base-pack/commands/sprint-intake.md +2 -18
- package/dist/forge-payload/.base-pack/commands/sprint-plan.md +2 -18
- package/dist/forge-payload/.base-pack/workflows/_fragments/friction-emit.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/_fragments/generation-instructions.md +4 -4
- package/dist/forge-payload/.base-pack/workflows/_fragments/iron-laws.md +1 -1
- package/dist/forge-payload/.base-pack/workflows/architect_approve.md +13 -1
- package/dist/forge-payload/.base-pack/workflows/commit_task.md +12 -1
- package/dist/forge-payload/.base-pack/workflows/enhance.md +6 -6
- package/dist/forge-payload/.base-pack/workflows/fix_bug.md +1 -1
- package/dist/forge-payload/.base-pack/workflows/implement_plan.md +14 -2
- package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +20 -4
- package/dist/forge-payload/.base-pack/workflows/plan_task.md +14 -2
- package/dist/forge-payload/.base-pack/workflows/review_code.md +37 -7
- package/dist/forge-payload/.base-pack/workflows/review_plan.md +36 -6
- package/dist/forge-payload/.base-pack/workflows/run_sprint.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/validate_task.md +37 -7
- package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
- package/dist/forge-payload/.schemas/config.schema.json +0 -5
- package/dist/forge-payload/.schemas/enum-catalog.json +9 -13
- package/dist/forge-payload/.schemas/migrations.json +54 -0
- package/dist/forge-payload/agents/tomoshibi.md +150 -6
- package/dist/forge-payload/commands/add-pipeline.md +1 -1
- package/dist/forge-payload/commands/add-task.md +1 -1
- package/dist/forge-payload/commands/calibrate.md +4 -350
- package/dist/forge-payload/commands/check-agent.md +38 -0
- package/dist/forge-payload/commands/config.md +3 -113
- package/dist/forge-payload/commands/enhance.md +5 -32
- package/dist/forge-payload/commands/health.md +155 -13
- package/dist/forge-payload/commands/init.md +25 -31
- package/dist/forge-payload/commands/migrate.md +6 -154
- package/dist/forge-payload/commands/quiz-agent.md +2 -34
- package/dist/forge-payload/commands/rebuild.md +664 -0
- package/dist/forge-payload/commands/regenerate.md +2 -774
- package/dist/forge-payload/commands/remove.md +10 -13
- package/dist/forge-payload/commands/repair.md +187 -0
- package/dist/forge-payload/commands/search.md +73 -0
- package/dist/forge-payload/commands/status.md +105 -0
- package/dist/forge-payload/commands/store-query.md +2 -69
- package/dist/forge-payload/commands/store-repair.md +2 -183
- package/dist/forge-payload/commands/update-tools.md +4 -50
- package/dist/forge-payload/commands/update.md +64 -58
- package/dist/forge-payload/hooks/check-update.cjs +1 -1
- package/dist/forge-payload/hooks/post-init.cjs +2 -2
- package/dist/forge-payload/hooks/post-sprint.cjs +2 -2
- package/dist/forge-payload/hooks/triage-error.cjs +11 -10
- package/dist/forge-payload/init/phases/phase-1-collect.md +138 -0
- package/dist/forge-payload/init/phases/phase-2-discover.md +127 -0
- package/dist/forge-payload/init/phases/phase-3-materialize.md +113 -0
- package/dist/forge-payload/init/phases/phase-4-register.md +159 -0
- package/dist/forge-payload/integrity.json +21 -24
- package/dist/forge-payload/meta/fragments/tool-discipline.md +22 -0
- package/dist/forge-payload/meta/templates/meta-retro.md +28 -0
- package/dist/forge-payload/meta/workflows/_fragments/friction-emit.md +2 -2
- package/dist/forge-payload/meta/workflows/_fragments/generation-instructions.md +4 -4
- package/dist/forge-payload/meta/workflows/_fragments/iron-laws.md +1 -1
- package/dist/forge-payload/meta/workflows/meta-approve.md +13 -1
- package/dist/forge-payload/meta/workflows/meta-check-agent.md +138 -0
- package/dist/forge-payload/meta/workflows/meta-commit.md +12 -1
- package/dist/forge-payload/meta/workflows/meta-enhance.md +5 -5
- package/dist/forge-payload/meta/workflows/meta-fix-bug.md +1 -1
- package/dist/forge-payload/meta/workflows/meta-implement.md +13 -1
- package/dist/forge-payload/meta/workflows/meta-migrate.md +3 -3
- package/dist/forge-payload/meta/workflows/meta-new-sprint.md +84 -0
- package/dist/forge-payload/meta/workflows/meta-orchestrate.md +20 -4
- package/dist/forge-payload/meta/workflows/meta-plan-sprint.md +152 -0
- package/dist/forge-payload/meta/workflows/meta-plan-task.md +13 -1
- package/dist/forge-payload/meta/workflows/meta-retro.md +73 -0
- package/dist/forge-payload/meta/workflows/meta-review-implementation.md +37 -7
- package/dist/forge-payload/meta/workflows/meta-review-plan.md +36 -6
- package/dist/forge-payload/meta/workflows/meta-validate.md +37 -7
- package/dist/forge-payload/schemas/config.schema.json +0 -5
- package/dist/forge-payload/schemas/enum-catalog.json +9 -13
- package/dist/forge-payload/schemas/structure-manifest.json +6 -8
- package/dist/forge-payload/tools/artifact.cjs +295 -0
- package/dist/forge-payload/tools/banners.cjs +3 -4
- package/dist/forge-payload/tools/build-context-pack.cjs +1 -1
- package/dist/forge-payload/tools/check-structure.cjs +8 -3
- package/dist/forge-payload/tools/store-cli.cjs +67 -7
- package/dist/forge-payload/tools/substitute-placeholders.cjs +1 -1
- package/dist/forge-payload/tools/verify-apply.cjs +75 -0
- package/dist/forge-payload/tools/verify-phase.cjs +259 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +0 -17
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +21 -38
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +5 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +24 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +16 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +45 -50
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +43 -81
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +37 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +30 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts +7 -27
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -14
- package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -5
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +3 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +13 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/package.json +6 -6
- package/dist/extensions/forgecli/forge-init/phase-descriptors.d.ts +0 -72
- package/dist/extensions/forgecli/forge-init/phase-descriptors.js +0 -359
- package/dist/extensions/forgecli/forge-init/phase-descriptors.js.map +0 -1
- package/dist/extensions/forgecli/forge-init/prompts.d.ts +0 -10
- package/dist/extensions/forgecli/forge-init/prompts.js +0 -91
- package/dist/extensions/forgecli/forge-init/prompts.js.map +0 -1
- package/dist/extensions/forgecli/lib/store-error-remediation.d.ts +0 -65
- package/dist/extensions/forgecli/lib/store-error-remediation.js +0 -298
- package/dist/extensions/forgecli/lib/store-error-remediation.js.map +0 -1
- package/dist/forge-payload/hooks/check-update.js +0 -378
- package/dist/forge-payload/hooks/forge-permissions.js +0 -164
- package/dist/forge-payload/hooks/triage-error.js +0 -77
- package/dist/forge-payload/hooks/validate-write.js +0 -250
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Fixed `RpcClient` to reject pending requests and consume stdin pipe errors when the child process exits unexpectedly ([#4764](https://github.com/earendil-works/pi/issues/4764)).
|
|
8
|
+
- Fixed managed npm extension updates to avoid package managers installing or resolving pi host packages as peer dependencies ([#4907](https://github.com/earendil-works/pi/issues/4907)).
|
|
9
|
+
- Fixed RPC mode raw stdout writes to retry transient backpressure errors and flush queued protocol output during shutdown ([#4897](https://github.com/earendil-works/pi/issues/4897)).
|
|
10
|
+
|
|
11
|
+
## [0.75.5] - 2026-05-23
|
|
12
|
+
|
|
13
|
+
### New Features
|
|
14
|
+
|
|
15
|
+
- **Cleaner read tool output** - Collapsed `read` tool cards now show only the read line by default, while `Ctrl+O` still expands the full file content.
|
|
16
|
+
- **Faster file tools on Windows** - Built-in file tools now use async filesystem operations during streaming, and image resizes run off the main TUI thread in a worker.
|
|
17
|
+
- **More reliable package updates** - `pi update` and git package installs now reconcile pinned git refs and keep package settings intact. See [Packages](docs/packages.md).
|
|
18
|
+
- **Custom Anthropic-compatible adaptive thinking** - Custom provider model configs can opt into adaptive-thinking Claude behavior with `compat.forceAdaptiveThinking`. See [Custom providers](docs/custom-provider.md) and [Models](docs/models.md).
|
|
19
|
+
|
|
5
20
|
### Added
|
|
6
21
|
|
|
7
22
|
- Added `compat.forceAdaptiveThinking` support to custom Anthropic-compatible model configuration docs and validation ([#4797](https://github.com/earendil-works/pi-mono/pull/4797) by [@mbazso](https://github.com/mbazso)).
|
|
@@ -9,20 +24,28 @@
|
|
|
9
24
|
|
|
10
25
|
### Changed
|
|
11
26
|
|
|
27
|
+
- Changed collapsed read tool cards to show only the read line until expanded ([#4916](https://github.com/earendil-works/pi/issues/4916)).
|
|
28
|
+
- Replaced the inherited optional `koffi` dependency for Windows VT input with a tiny vendored native helper, reducing install size while preserving Shift+Tab handling ([#4480](https://github.com/earendil-works/pi/issues/4480)).
|
|
12
29
|
- Changed the root development install documentation to use `npm install --ignore-scripts` ([#4868](https://github.com/earendil-works/pi/issues/4868)).
|
|
13
30
|
|
|
14
31
|
### Fixed
|
|
15
32
|
|
|
16
33
|
- Fixed `pi update` to reconcile git-pinned packages to their configured ref ([#4869](https://github.com/earendil-works/pi/issues/4869)).
|
|
34
|
+
- Fixed package/resource path handling for Windows and glob/pattern resolution ([#4873](https://github.com/earendil-works/pi-mono/pull/4873) by [@mitsuhiko](https://github.com/mitsuhiko)).
|
|
35
|
+
- Fixed config pattern matching to resolve patterns from the correct base directory ([#4898](https://github.com/earendil-works/pi-mono/pull/4898) by [@haoqixu](https://github.com/haoqixu)).
|
|
36
|
+
- Fixed theme pickers to list themes by their content name instead of file stem ([#4830](https://github.com/earendil-works/pi-mono/pull/4830) by [@Perlence](https://github.com/Perlence)).
|
|
17
37
|
- Fixed OpenCode Zen/Go requests to send per-session OpenCode routing headers ([#4847](https://github.com/earendil-works/pi/issues/4847)).
|
|
18
38
|
- Fixed Amazon Bedrock provider loading under strict package managers by inheriting the declared `@smithy/node-http-handler` dependency from `@earendil-works/pi-ai` ([#4842](https://github.com/earendil-works/pi/issues/4842)).
|
|
39
|
+
- Fixed inherited Amazon Bedrock Claude requests to send the model output token cap by default, avoiding Bedrock's 4096-token default truncation ([#4848](https://github.com/earendil-works/pi/issues/4848)).
|
|
19
40
|
- Fixed exported session HTML to escape quote characters in attribute values ([#4832](https://github.com/earendil-works/pi/issues/4832)).
|
|
20
|
-
- Fixed GitHub Copilot device-code login to keep opening the verification URL in browser-capable environments while ignoring browser launch failures for headless use.
|
|
41
|
+
- Fixed GitHub Copilot device-code login to keep opening the verification URL in browser-capable environments while ignoring browser launch failures for headless use ([#4788](https://github.com/earendil-works/pi-mono/pull/4788) by [@vegarsti](https://github.com/vegarsti)).
|
|
21
42
|
- Fixed git package installs to reconcile existing checkouts to the requested ref and update package settings without losing filters ([#4870](https://github.com/earendil-works/pi/issues/4870)).
|
|
22
43
|
- Published a 0.74.2 rescue release that tells Node 20 users to upgrade Node before updating to newer Pi versions ([#4876](https://github.com/earendil-works/pi/issues/4876)).
|
|
23
44
|
- Fixed final bash tool cards to avoid rendering duplicate full-output truncation paths ([#4819](https://github.com/earendil-works/pi/issues/4819)).
|
|
24
45
|
- Fixed bash tool truncation line counts to ignore the trailing newline as an extra output line ([#4818](https://github.com/earendil-works/pi/issues/4818)).
|
|
25
46
|
- Fixed footer home-directory abbreviation to avoid shortening sibling paths that only share the same prefix ([#4878](https://github.com/earendil-works/pi/issues/4878)).
|
|
47
|
+
- Fixed macOS Bun release binaries to resolve the native clipboard sidecar so Ctrl+V image paste can load `@mariozechner/clipboard` ([#4307](https://github.com/earendil-works/pi/issues/4307)).
|
|
48
|
+
- Fixed coding-agent tools to avoid synchronous filesystem operations during streaming and moved image resizing off the main TUI thread ([#4756](https://github.com/earendil-works/pi-mono/pull/4756) by [@mitsuhiko](https://github.com/mitsuhiko)).
|
|
26
49
|
|
|
27
50
|
## [0.75.4] - 2026-05-20
|
|
28
51
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-processor.d.ts","sourceRoot":"","sources":["../../src/cli/file-processor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAO1D,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAClC,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,sEAAsE;AACtE,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"file-processor.d.ts","sourceRoot":"","sources":["../../src/cli/file-processor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAO1D,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAClC,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,sEAAsE;AACtE,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CA2EpH","sourcesContent":["/**\n * Process @file CLI arguments into text content and image attachments\n */\n\nimport { access, readFile, stat } from \"node:fs/promises\";\nimport type { ImageContent } from \"@earendil-works/pi-ai\";\nimport chalk from \"chalk\";\nimport { resolve } from \"path\";\nimport { resolveReadPath } from \"../core/tools/path-utils.ts\";\nimport { formatDimensionNote, resizeImage } from \"../utils/image-resize.ts\";\nimport { detectSupportedImageMimeTypeFromFile } from \"../utils/mime.ts\";\n\nexport interface ProcessedFiles {\n\ttext: string;\n\timages: ImageContent[];\n}\n\nexport interface ProcessFileOptions {\n\t/** Whether to auto-resize images to 2000x2000 max. Default: true */\n\tautoResizeImages?: boolean;\n}\n\n/** Process @file arguments into text content and image attachments */\nexport async function processFileArguments(fileArgs: string[], options?: ProcessFileOptions): Promise<ProcessedFiles> {\n\tconst autoResizeImages = options?.autoResizeImages ?? true;\n\tlet text = \"\";\n\tconst images: ImageContent[] = [];\n\n\tfor (const fileArg of fileArgs) {\n\t\t// Expand and resolve path (handles ~ expansion and macOS screenshot Unicode spaces)\n\t\tconst absolutePath = resolve(resolveReadPath(fileArg, process.cwd()));\n\n\t\t// Check if file exists\n\t\ttry {\n\t\t\tawait access(absolutePath);\n\t\t} catch {\n\t\t\tconsole.error(chalk.red(`Error: File not found: ${absolutePath}`));\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\t// Check if file is empty\n\t\tconst stats = await stat(absolutePath);\n\t\tif (stats.size === 0) {\n\t\t\t// Skip empty files\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst mimeType = await detectSupportedImageMimeTypeFromFile(absolutePath);\n\n\t\tif (mimeType) {\n\t\t\t// Handle image file\n\t\t\tconst content = await readFile(absolutePath);\n\n\t\t\tlet attachment: ImageContent;\n\t\t\tlet dimensionNote: string | undefined;\n\n\t\t\tif (autoResizeImages) {\n\t\t\t\tconst resized = await resizeImage(content, mimeType);\n\t\t\t\tif (!resized) {\n\t\t\t\t\ttext += `<file name=\"${absolutePath}\">[Image omitted: could not be resized below the inline image size limit.]</file>\\n`;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdimensionNote = formatDimensionNote(resized);\n\t\t\t\tattachment = {\n\t\t\t\t\ttype: \"image\",\n\t\t\t\t\tmimeType: resized.mimeType,\n\t\t\t\t\tdata: resized.data,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tattachment = {\n\t\t\t\t\ttype: \"image\",\n\t\t\t\t\tmimeType,\n\t\t\t\t\tdata: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\timages.push(attachment);\n\n\t\t\t// Add text reference to image with optional dimension note\n\t\t\tif (dimensionNote) {\n\t\t\t\ttext += `<file name=\"${absolutePath}\">${dimensionNote}</file>\\n`;\n\t\t\t} else {\n\t\t\t\ttext += `<file name=\"${absolutePath}\"></file>\\n`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Handle text file\n\t\t\ttry {\n\t\t\t\tconst content = await readFile(absolutePath, \"utf-8\");\n\t\t\t\ttext += `<file name=\"${absolutePath}\">\\n${content}\\n</file>\\n`;\n\t\t\t} catch (error: unknown) {\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tconsole.error(chalk.red(`Error: Could not read file ${absolutePath}: ${message}`));\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { text, images };\n}\n"]}
|
|
@@ -33,11 +33,10 @@ export async function processFileArguments(fileArgs, options) {
|
|
|
33
33
|
if (mimeType) {
|
|
34
34
|
// Handle image file
|
|
35
35
|
const content = await readFile(absolutePath);
|
|
36
|
-
const base64Content = content.toString("base64");
|
|
37
36
|
let attachment;
|
|
38
37
|
let dimensionNote;
|
|
39
38
|
if (autoResizeImages) {
|
|
40
|
-
const resized = await resizeImage(
|
|
39
|
+
const resized = await resizeImage(content, mimeType);
|
|
41
40
|
if (!resized) {
|
|
42
41
|
text += `<file name="${absolutePath}">[Image omitted: could not be resized below the inline image size limit.]</file>\n`;
|
|
43
42
|
continue;
|
|
@@ -53,7 +52,7 @@ export async function processFileArguments(fileArgs, options) {
|
|
|
53
52
|
attachment = {
|
|
54
53
|
type: "image",
|
|
55
54
|
mimeType,
|
|
56
|
-
data:
|
|
55
|
+
data: content.toString("base64"),
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
58
|
images.push(attachment);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-processor.js","sourceRoot":"","sources":["../../src/cli/file-processor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,oCAAoC,EAAE,MAAM,kBA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CAAC,CAAC,CAAC;gBACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAAA,CACxB","sourcesContent":["/**\n * Process @file CLI arguments into text content and image attachments\n */\n\nimport { access, readFile, stat } from \"node:fs/promises\";\nimport type { ImageContent } from \"@earendil-works/pi-ai\";\nimport chalk from \"chalk\";\nimport { resolve } from \"path\";\nimport { resolveReadPath } from \"../core/tools/path-utils.ts\";\nimport { formatDimensionNote, resizeImage } from \"../utils/image-resize.ts\";\nimport { detectSupportedImageMimeTypeFromFile } from \"../utils/mime.ts\";\n\nexport interface ProcessedFiles {\n\ttext: string;\n\timages: ImageContent[];\n}\n\nexport interface ProcessFileOptions {\n\t/** Whether to auto-resize images to 2000x2000 max. Default: true */\n\tautoResizeImages?: boolean;\n}\n\n/** Process @file arguments into text content and image attachments */\nexport async function processFileArguments(fileArgs: string[], options?: ProcessFileOptions): Promise<ProcessedFiles> {\n\tconst autoResizeImages = options?.autoResizeImages ?? true;\n\tlet text = \"\";\n\tconst images: ImageContent[] = [];\n\n\tfor (const fileArg of fileArgs) {\n\t\t// Expand and resolve path (handles ~ expansion and macOS screenshot Unicode spaces)\n\t\tconst absolutePath = resolve(resolveReadPath(fileArg, process.cwd()));\n\n\t\t// Check if file exists\n\t\ttry {\n\t\t\tawait access(absolutePath);\n\t\t} catch {\n\t\t\tconsole.error(chalk.red(`Error: File not found: ${absolutePath}`));\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\t// Check if file is empty\n\t\tconst stats = await stat(absolutePath);\n\t\tif (stats.size === 0) {\n\t\t\t// Skip empty files\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst mimeType = await detectSupportedImageMimeTypeFromFile(absolutePath);\n\n\t\tif (mimeType) {\n\t\t\t// Handle image file\n\t\t\tconst content = await readFile(absolutePath);\n\n\t\t\tlet attachment: ImageContent;\n\t\t\tlet dimensionNote: string | undefined;\n\n\t\t\tif (autoResizeImages) {\n\t\t\t\tconst resized = await resizeImage(content, mimeType);\n\t\t\t\tif (!resized) {\n\t\t\t\t\ttext += `<file name=\"${absolutePath}\">[Image omitted: could not be resized below the inline image size limit.]</file>\\n`;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdimensionNote = formatDimensionNote(resized);\n\t\t\t\tattachment = {\n\t\t\t\t\ttype: \"image\",\n\t\t\t\t\tmimeType: resized.mimeType,\n\t\t\t\t\tdata: resized.data,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tattachment = {\n\t\t\t\t\ttype: \"image\",\n\t\t\t\t\tmimeType,\n\t\t\t\t\tdata: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\timages.push(attachment);\n\n\t\t\t// Add text reference to image with optional dimension note\n\t\t\tif (dimensionNote) {\n\t\t\t\ttext += `<file name=\"${absolutePath}\">${dimensionNote}</file>\\n`;\n\t\t\t} else {\n\t\t\t\ttext += `<file name=\"${absolutePath}\"></file>\\n`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Handle text file\n\t\t\ttry {\n\t\t\t\tconst content = await readFile(absolutePath, \"utf-8\");\n\t\t\t\ttext += `<file name=\"${absolutePath}\">\\n${content}\\n</file>\\n`;\n\t\t\t} catch (error: unknown) {\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tconsole.error(chalk.red(`Error: Could not read file ${absolutePath}: ${message}`));\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { text, images };\n}\n"]}
|
|
@@ -2,5 +2,6 @@ export declare function takeOverStdout(): void;
|
|
|
2
2
|
export declare function restoreStdout(): void;
|
|
3
3
|
export declare function isStdoutTakenOver(): boolean;
|
|
4
4
|
export declare function writeRawStdout(text: string): void;
|
|
5
|
+
export declare function waitForRawStdoutBackpressure(): Promise<void>;
|
|
5
6
|
export declare function flushRawStdout(): Promise<void>;
|
|
6
7
|
//# sourceMappingURL=output-guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-guard.d.ts","sourceRoot":"","sources":["../../src/core/output-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output-guard.d.ts","sourceRoot":"","sources":["../../src/core/output-guard.ts"],"names":[],"mappings":"AA4CA,wBAAgB,cAAc,IAAI,IAAI,CAyBrC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAOpC;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAQjD;AAED,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC,CAQlE;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpD","sourcesContent":["interface StdoutTakeoverState {\n\trawStdoutWrite: (chunk: string, callback?: (error?: Error | null) => void) => boolean;\n\trawStderrWrite: (chunk: string, callback?: (error?: Error | null) => void) => boolean;\n\toriginalStdoutWrite: typeof process.stdout.write;\n}\n\nlet stdoutTakeoverState: StdoutTakeoverState | undefined;\n\nconst RAW_STDOUT_RETRY_DELAY_MS = 10;\n\nlet rawStdoutWriteTail: Promise<void> = Promise.resolve();\n\nfunction getRawStdoutWrite(): StdoutTakeoverState[\"rawStdoutWrite\"] {\n\tif (stdoutTakeoverState) {\n\t\treturn stdoutTakeoverState.rawStdoutWrite;\n\t}\n\treturn process.stdout.write.bind(process.stdout) as StdoutTakeoverState[\"rawStdoutWrite\"];\n}\n\nasync function writeRawStdoutChunk(text: string): Promise<void> {\n\twhile (true) {\n\t\ttry {\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\ttry {\n\t\t\t\t\tgetRawStdoutWrite()(text, (error) => {\n\t\t\t\t\t\tif (error) reject(error);\n\t\t\t\t\t\telse resolve();\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tconst writeError = error instanceof Error ? error : new Error(String(error));\n\t\t\tconst code = (writeError as Error & { code?: unknown }).code;\n\t\t\tif (code !== \"ENOBUFS\" && code !== \"EAGAIN\" && code !== \"EWOULDBLOCK\") {\n\t\t\t\tthrow writeError;\n\t\t\t}\n\t\t\tawait new Promise<void>((resolve) => setTimeout(resolve, RAW_STDOUT_RETRY_DELAY_MS));\n\t\t}\n\t}\n}\n\nexport function takeOverStdout(): void {\n\tif (stdoutTakeoverState) {\n\t\treturn;\n\t}\n\n\tconst rawStdoutWrite = process.stdout.write.bind(process.stdout) as StdoutTakeoverState[\"rawStdoutWrite\"];\n\tconst rawStderrWrite = process.stderr.write.bind(process.stderr) as StdoutTakeoverState[\"rawStderrWrite\"];\n\tconst originalStdoutWrite = process.stdout.write;\n\n\tprocess.stdout.write = ((\n\t\tchunk: string | Uint8Array,\n\t\tencodingOrCallback?: BufferEncoding | ((error?: Error | null) => void),\n\t\tcallback?: (error?: Error | null) => void,\n\t): boolean => {\n\t\tif (typeof encodingOrCallback === \"function\") {\n\t\t\treturn rawStderrWrite(String(chunk), encodingOrCallback);\n\t\t}\n\t\treturn rawStderrWrite(String(chunk), callback);\n\t}) as typeof process.stdout.write;\n\n\tstdoutTakeoverState = {\n\t\trawStdoutWrite,\n\t\trawStderrWrite,\n\t\toriginalStdoutWrite,\n\t};\n}\n\nexport function restoreStdout(): void {\n\tif (!stdoutTakeoverState) {\n\t\treturn;\n\t}\n\n\tprocess.stdout.write = stdoutTakeoverState.originalStdoutWrite;\n\tstdoutTakeoverState = undefined;\n}\n\nexport function isStdoutTakenOver(): boolean {\n\treturn stdoutTakeoverState !== undefined;\n}\n\nexport function writeRawStdout(text: string): void {\n\tif (text.length === 0) {\n\t\treturn;\n\t}\n\trawStdoutWriteTail = rawStdoutWriteTail.then(() => writeRawStdoutChunk(text));\n\tvoid rawStdoutWriteTail.catch(() => {\n\t\tprocess.exit(1);\n\t});\n}\n\nexport async function waitForRawStdoutBackpressure(): Promise<void> {\n\twhile (true) {\n\t\tconst tail = rawStdoutWriteTail;\n\t\tawait tail;\n\t\tif (tail === rawStdoutWriteTail) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\nexport async function flushRawStdout(): Promise<void> {\n\tawait waitForRawStdoutBackpressure();\n\tawait writeRawStdoutChunk(\"\");\n}\n"]}
|
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
let stdoutTakeoverState;
|
|
2
|
+
const RAW_STDOUT_RETRY_DELAY_MS = 10;
|
|
3
|
+
let rawStdoutWriteTail = Promise.resolve();
|
|
4
|
+
function getRawStdoutWrite() {
|
|
5
|
+
if (stdoutTakeoverState) {
|
|
6
|
+
return stdoutTakeoverState.rawStdoutWrite;
|
|
7
|
+
}
|
|
8
|
+
return process.stdout.write.bind(process.stdout);
|
|
9
|
+
}
|
|
10
|
+
async function writeRawStdoutChunk(text) {
|
|
11
|
+
while (true) {
|
|
12
|
+
try {
|
|
13
|
+
await new Promise((resolve, reject) => {
|
|
14
|
+
try {
|
|
15
|
+
getRawStdoutWrite()(text, (error) => {
|
|
16
|
+
if (error)
|
|
17
|
+
reject(error);
|
|
18
|
+
else
|
|
19
|
+
resolve();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
const writeError = error instanceof Error ? error : new Error(String(error));
|
|
30
|
+
const code = writeError.code;
|
|
31
|
+
if (code !== "ENOBUFS" && code !== "EAGAIN" && code !== "EWOULDBLOCK") {
|
|
32
|
+
throw writeError;
|
|
33
|
+
}
|
|
34
|
+
await new Promise((resolve) => setTimeout(resolve, RAW_STDOUT_RETRY_DELAY_MS));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
2
38
|
export function takeOverStdout() {
|
|
3
39
|
if (stdoutTakeoverState) {
|
|
4
40
|
return;
|
|
@@ -29,31 +65,25 @@ export function isStdoutTakenOver() {
|
|
|
29
65
|
return stdoutTakeoverState !== undefined;
|
|
30
66
|
}
|
|
31
67
|
export function writeRawStdout(text) {
|
|
32
|
-
if (
|
|
33
|
-
stdoutTakeoverState.rawStdoutWrite(text);
|
|
68
|
+
if (text.length === 0) {
|
|
34
69
|
return;
|
|
35
70
|
}
|
|
36
|
-
|
|
71
|
+
rawStdoutWriteTail = rawStdoutWriteTail.then(() => writeRawStdoutChunk(text));
|
|
72
|
+
void rawStdoutWriteTail.catch(() => {
|
|
73
|
+
process.exit(1);
|
|
74
|
+
});
|
|
37
75
|
}
|
|
38
|
-
export async function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
resolve();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
return;
|
|
76
|
+
export async function waitForRawStdoutBackpressure() {
|
|
77
|
+
while (true) {
|
|
78
|
+
const tail = rawStdoutWriteTail;
|
|
79
|
+
await tail;
|
|
80
|
+
if (tail === rawStdoutWriteTail) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
49
83
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
else
|
|
55
|
-
resolve();
|
|
56
|
-
});
|
|
57
|
-
});
|
|
84
|
+
}
|
|
85
|
+
export async function flushRawStdout() {
|
|
86
|
+
await waitForRawStdoutBackpressure();
|
|
87
|
+
await writeRawStdoutChunk("");
|
|
58
88
|
}
|
|
59
89
|
//# sourceMappingURL=output-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-guard.js","sourceRoot":"","sources":["../../src/core/output-guard.ts"],"names":[],"mappings":"AAMA,IAAI,mBAAoD,CAAC;AAEz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AAC;AAAA,CACzC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY,EAAQ;IAClD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO;IACR,CAAC;IACD,kBAAkB,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9E,KAAK,kBAAkB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAAA,CAChB,CAAC,CAAC;AAAA,CACH;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,GAAkB;IACnE,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,IAAI,GAAG,kBAAkB,CAAC;QAChC,MAAM,IAAI,CAAC;QACX,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACjC,OAAO;QACR,CAAC;IACF,CAAC;AAAA,CACD;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,GAAkB;IACrD,MAAM,4BAA4B,EAAE,CAAC;IACrC,MAAM,mBAAmB,CAAC,EAAE,CAAC,CAAC;AAAA,CAC9B","sourcesContent":["interface StdoutTakeoverState {\n\trawStdoutWrite: (chunk: string, callback?: (error?: Error | null) => void) => boolean;\n\trawStderrWrite: (chunk: string, callback?: (error?: Error | null) => void) => boolean;\n\toriginalStdoutWrite: typeof process.stdout.write;\n}\n\nlet stdoutTakeoverState: StdoutTakeoverState | undefined;\n\nconst RAW_STDOUT_RETRY_DELAY_MS = 10;\n\nlet rawStdoutWriteTail: Promise<void> = Promise.resolve();\n\nfunction getRawStdoutWrite(): StdoutTakeoverState[\"rawStdoutWrite\"] {\n\tif (stdoutTakeoverState) {\n\t\treturn stdoutTakeoverState.rawStdoutWrite;\n\t}\n\treturn process.stdout.write.bind(process.stdout) as StdoutTakeoverState[\"rawStdoutWrite\"];\n}\n\nasync function writeRawStdoutChunk(text: string): Promise<void> {\n\twhile (true) {\n\t\ttry {\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\ttry {\n\t\t\t\t\tgetRawStdoutWrite()(text, (error) => {\n\t\t\t\t\t\tif (error) reject(error);\n\t\t\t\t\t\telse resolve();\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tconst writeError = error instanceof Error ? error : new Error(String(error));\n\t\t\tconst code = (writeError as Error & { code?: unknown }).code;\n\t\t\tif (code !== \"ENOBUFS\" && code !== \"EAGAIN\" && code !== \"EWOULDBLOCK\") {\n\t\t\t\tthrow writeError;\n\t\t\t}\n\t\t\tawait new Promise<void>((resolve) => setTimeout(resolve, RAW_STDOUT_RETRY_DELAY_MS));\n\t\t}\n\t}\n}\n\nexport function takeOverStdout(): void {\n\tif (stdoutTakeoverState) {\n\t\treturn;\n\t}\n\n\tconst rawStdoutWrite = process.stdout.write.bind(process.stdout) as StdoutTakeoverState[\"rawStdoutWrite\"];\n\tconst rawStderrWrite = process.stderr.write.bind(process.stderr) as StdoutTakeoverState[\"rawStderrWrite\"];\n\tconst originalStdoutWrite = process.stdout.write;\n\n\tprocess.stdout.write = ((\n\t\tchunk: string | Uint8Array,\n\t\tencodingOrCallback?: BufferEncoding | ((error?: Error | null) => void),\n\t\tcallback?: (error?: Error | null) => void,\n\t): boolean => {\n\t\tif (typeof encodingOrCallback === \"function\") {\n\t\t\treturn rawStderrWrite(String(chunk), encodingOrCallback);\n\t\t}\n\t\treturn rawStderrWrite(String(chunk), callback);\n\t}) as typeof process.stdout.write;\n\n\tstdoutTakeoverState = {\n\t\trawStdoutWrite,\n\t\trawStderrWrite,\n\t\toriginalStdoutWrite,\n\t};\n}\n\nexport function restoreStdout(): void {\n\tif (!stdoutTakeoverState) {\n\t\treturn;\n\t}\n\n\tprocess.stdout.write = stdoutTakeoverState.originalStdoutWrite;\n\tstdoutTakeoverState = undefined;\n}\n\nexport function isStdoutTakenOver(): boolean {\n\treturn stdoutTakeoverState !== undefined;\n}\n\nexport function writeRawStdout(text: string): void {\n\tif (text.length === 0) {\n\t\treturn;\n\t}\n\trawStdoutWriteTail = rawStdoutWriteTail.then(() => writeRawStdoutChunk(text));\n\tvoid rawStdoutWriteTail.catch(() => {\n\t\tprocess.exit(1);\n\t});\n}\n\nexport async function waitForRawStdoutBackpressure(): Promise<void> {\n\twhile (true) {\n\t\tconst tail = rawStdoutWriteTail;\n\t\tawait tail;\n\t\tif (tail === rawStdoutWriteTail) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\nexport async function flushRawStdout(): Promise<void> {\n\tawait waitForRawStdoutBackpressure();\n\tawait writeRawStdoutChunk(\"\");\n}\n"]}
|