@entelligentsia/forgecli 0.7.10 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/dist/CHANGELOG-forge-plugin.md +70 -0
- package/dist/CHANGELOG-pi.md +63 -0
- package/dist/bin/argv.d.ts +2 -2
- package/dist/bin/argv.js +27 -0
- package/dist/bin/argv.js.map +1 -1
- package/dist/bin/config.d.ts +69 -0
- package/dist/bin/config.js +315 -0
- package/dist/bin/config.js.map +1 -0
- package/dist/bin/doctor.d.ts +1 -0
- package/dist/bin/doctor.js +12 -0
- package/dist/bin/doctor.js.map +1 -1
- package/dist/bin/env-defaults.d.ts +1 -0
- package/dist/bin/env-defaults.js +13 -0
- package/dist/bin/env-defaults.js.map +1 -0
- package/dist/bin/forge.js +16 -0
- package/dist/bin/forge.js.map +1 -1
- package/dist/bin/update-cli.d.ts +9 -0
- package/dist/bin/update-cli.js +120 -0
- package/dist/bin/update-cli.js.map +1 -0
- package/dist/extensions/forgecli/config-command.d.ts +8 -0
- package/dist/extensions/forgecli/config-command.js +66 -0
- package/dist/extensions/forgecli/config-command.js.map +1 -0
- package/dist/extensions/forgecli/config-layer.d.ts +38 -0
- package/dist/extensions/forgecli/config-layer.js +68 -0
- package/dist/extensions/forgecli/config-layer.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/component.d.ts +35 -0
- package/dist/extensions/forgecli/config-tui/component.js +236 -0
- package/dist/extensions/forgecli/config-tui/component.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/handler.d.ts +40 -0
- package/dist/extensions/forgecli/config-tui/handler.js +240 -0
- package/dist/extensions/forgecli/config-tui/handler.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/index.d.ts +5 -0
- package/dist/extensions/forgecli/config-tui/index.js +5 -0
- package/dist/extensions/forgecli/config-tui/index.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/keys.d.ts +26 -0
- package/dist/extensions/forgecli/config-tui/keys.js +33 -0
- package/dist/extensions/forgecli/config-tui/keys.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/plugin-config-reader.d.ts +23 -0
- package/dist/extensions/forgecli/config-tui/plugin-config-reader.js +58 -0
- package/dist/extensions/forgecli/config-tui/plugin-config-reader.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/advanced-menu.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/advanced-menu.js +83 -0
- package/dist/extensions/forgecli/config-tui/screens/advanced-menu.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/confirm-quit.d.ts +11 -0
- package/dist/extensions/forgecli/config-tui/screens/confirm-quit.js +54 -0
- package/dist/extensions/forgecli/config-tui/screens/confirm-quit.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/override-editor.d.ts +11 -0
- package/dist/extensions/forgecli/config-tui/screens/override-editor.js +233 -0
- package/dist/extensions/forgecli/config-tui/screens/override-editor.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.js +91 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list.js +71 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-editor.d.ts +10 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-editor.js +182 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-editor.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-picker.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-picker.js +76 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-picker.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/personas-list.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/personas-list.js +98 -0
- package/dist/extensions/forgecli/config-tui/screens/personas-list.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/shared.d.ts +29 -0
- package/dist/extensions/forgecli/config-tui/screens/shared.js +100 -0
- package/dist/extensions/forgecli/config-tui/screens/shared.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/show-resolved.d.ts +23 -0
- package/dist/extensions/forgecli/config-tui/screens/show-resolved.js +128 -0
- package/dist/extensions/forgecli/config-tui/screens/show-resolved.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-menu.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-menu.js +135 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-menu.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-picker.d.ts +9 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-picker.js +122 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-picker.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/types.d.ts +24 -0
- package/dist/extensions/forgecli/config-tui/screens/types.js +5 -0
- package/dist/extensions/forgecli/config-tui/screens/types.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens.d.ts +24 -0
- package/dist/extensions/forgecli/config-tui/screens.js +78 -0
- package/dist/extensions/forgecli/config-tui/screens.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/buffer.d.ts +11 -0
- package/dist/extensions/forgecli/config-tui/state/buffer.js +91 -0
- package/dist/extensions/forgecli/config-tui/state/buffer.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/constants.d.ts +4 -0
- package/dist/extensions/forgecli/config-tui/state/constants.js +14 -0
- package/dist/extensions/forgecli/config-tui/state/constants.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/index.d.ts +6 -0
- package/dist/extensions/forgecli/config-tui/state/index.js +9 -0
- package/dist/extensions/forgecli/config-tui/state/index.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/init.d.ts +2 -0
- package/dist/extensions/forgecli/config-tui/state/init.js +30 -0
- package/dist/extensions/forgecli/config-tui/state/init.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/model.d.ts +192 -0
- package/dist/extensions/forgecli/config-tui/state/model.js +4 -0
- package/dist/extensions/forgecli/config-tui/state/model.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/reducer.d.ts +2 -0
- package/dist/extensions/forgecli/config-tui/state/reducer.js +212 -0
- package/dist/extensions/forgecli/config-tui/state/reducer.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/selectors.d.ts +91 -0
- package/dist/extensions/forgecli/config-tui/state/selectors.js +231 -0
- package/dist/extensions/forgecli/config-tui/state/selectors.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state.d.ts +6 -0
- package/dist/extensions/forgecli/config-tui/state.js +11 -0
- package/dist/extensions/forgecli/config-tui/state.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/theme.d.ts +37 -0
- package/dist/extensions/forgecli/config-tui/theme.js +88 -0
- package/dist/extensions/forgecli/config-tui/theme.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/tier-meta.d.ts +28 -0
- package/dist/extensions/forgecli/config-tui/tier-meta.js +69 -0
- package/dist/extensions/forgecli/config-tui/tier-meta.js.map +1 -0
- package/dist/extensions/forgecli/config-writer.d.ts +16 -0
- package/dist/extensions/forgecli/config-writer.js +63 -0
- package/dist/extensions/forgecli/config-writer.js.map +1 -0
- package/dist/extensions/forgecli/fix-bug.js +85 -1
- package/dist/extensions/forgecli/fix-bug.js.map +1 -1
- package/dist/extensions/forgecli/forge-cli-schema.json +54 -0
- package/dist/extensions/forgecli/forge-commands.js +3 -8
- package/dist/extensions/forgecli/forge-commands.js.map +1 -1
- package/dist/extensions/forgecli/forge-subagent.d.ts +13 -0
- package/dist/extensions/forgecli/forge-subagent.js +19 -0
- package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
- package/dist/extensions/forgecli/index.js +19 -3
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/input-router.d.ts +33 -0
- package/dist/extensions/forgecli/input-router.js +133 -0
- package/dist/extensions/forgecli/input-router.js.map +1 -0
- package/dist/extensions/forgecli/model-resolver.d.ts +32 -0
- package/dist/extensions/forgecli/model-resolver.js +65 -0
- package/dist/extensions/forgecli/model-resolver.js.map +1 -0
- package/dist/extensions/forgecli/model-validator.d.ts +29 -0
- package/dist/extensions/forgecli/model-validator.js +107 -0
- package/dist/extensions/forgecli/model-validator.js.map +1 -0
- package/dist/extensions/forgecli/run-sprint.js +59 -0
- package/dist/extensions/forgecli/run-sprint.js.map +1 -1
- package/dist/extensions/forgecli/run-task.js +93 -1
- package/dist/extensions/forgecli/run-task.js.map +1 -1
- package/dist/extensions/forgecli/thread-switcher.js +5 -2
- package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
- package/dist/extensions/forgecli/update-check.js +1 -1
- package/dist/extensions/forgecli/update-check.js.map +1 -1
- package/dist/extensions/forgecli/whats-new-widget.d.ts +5 -5
- package/dist/extensions/forgecli/whats-new-widget.js +16 -13
- package/dist/extensions/forgecli/whats-new-widget.js.map +1 -1
- package/dist/extensions/forgecli/whats-new.js +6 -5
- package/dist/extensions/forgecli/whats-new.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +27 -98
- 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 +62 -132
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +25 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +8 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +63 -0
- package/node_modules/@earendil-works/pi-coding-agent/README.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js +6 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +12 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +30 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +23 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +4 -0
- 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 +58 -38
- 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/slash-commands.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +3 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +60 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -3
- 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/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +187 -153
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +207 -173
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +6 -3
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/node_modules/undici/README.md +14 -5
- package/node_modules/undici/docs/docs/api/Client.md +4 -2
- package/node_modules/undici/docs/docs/api/Dispatcher.md +62 -27
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +7 -5
- package/node_modules/undici/docs/docs/api/H2CClient.md +1 -1
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +14 -9
- package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -1
- package/node_modules/undici/docs/docs/api/RetryHandler.md +12 -14
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +23 -0
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +231 -0
- package/node_modules/undici/index.js +4 -2
- package/node_modules/undici/lib/api/api-connect.js +13 -11
- package/node_modules/undici/lib/api/api-pipeline.js +26 -13
- package/node_modules/undici/lib/api/api-request.js +45 -21
- package/node_modules/undici/lib/api/api-stream.js +81 -20
- package/node_modules/undici/lib/api/api-upgrade.js +21 -11
- package/node_modules/undici/lib/api/readable.js +3 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +6 -4
- package/node_modules/undici/lib/core/connect.js +17 -1
- package/node_modules/undici/lib/core/constants.js +1 -24
- package/node_modules/undici/lib/core/errors.js +2 -2
- package/node_modules/undici/lib/core/request.js +115 -18
- package/node_modules/undici/lib/core/socks5-client.js +24 -9
- package/node_modules/undici/lib/core/socks5-utils.js +32 -23
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/core/util.js +70 -43
- package/node_modules/undici/lib/dispatcher/agent.js +47 -33
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +21 -26
- package/node_modules/undici/lib/dispatcher/client-h1.js +98 -39
- package/node_modules/undici/lib/dispatcher/client-h2.js +603 -272
- package/node_modules/undici/lib/dispatcher/client.js +12 -5
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +24 -5
- package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -4
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +107 -0
- package/node_modules/undici/lib/dispatcher/h2c-client.js +5 -5
- package/node_modules/undici/lib/dispatcher/pool-base.js +28 -10
- package/node_modules/undici/lib/dispatcher/pool.js +31 -6
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +38 -13
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +31 -9
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +95 -80
- package/node_modules/undici/lib/global.js +13 -1
- package/node_modules/undici/lib/handler/cache-handler.js +16 -8
- package/node_modules/undici/lib/handler/decorator-handler.js +1 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -51
- package/node_modules/undici/lib/handler/retry-handler.js +15 -2
- package/node_modules/undici/lib/interceptor/cache.js +30 -17
- package/node_modules/undici/lib/interceptor/decompress.js +28 -2
- package/node_modules/undici/lib/interceptor/dns.js +1 -1
- package/node_modules/undici/lib/interceptor/redirect.js +3 -3
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -1
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -1
- package/node_modules/undici/lib/mock/mock-agent.js +8 -8
- package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
- package/node_modules/undici/lib/mock/mock-utils.js +37 -22
- package/node_modules/undici/lib/mock/snapshot-agent.js +16 -6
- package/node_modules/undici/lib/mock/snapshot-recorder.js +38 -3
- package/node_modules/undici/lib/util/cache.js +8 -7
- package/node_modules/undici/lib/util/runtime-features.js +3 -34
- package/node_modules/undici/lib/web/cache/cache.js +6 -8
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/fetch/body.js +3 -9
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +21 -2
- package/node_modules/undici/lib/web/fetch/index.js +214 -221
- package/node_modules/undici/lib/web/webidl/index.js +7 -9
- package/node_modules/undici/lib/web/websocket/frame.js +1 -7
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
- package/node_modules/undici/lib/web/websocket/receiver.js +62 -22
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +11 -17
- package/node_modules/undici/lib/web/websocket/websocket.js +6 -1
- package/node_modules/undici/package.json +9 -9
- package/node_modules/undici/types/agent.d.ts +0 -2
- package/node_modules/undici/types/client.d.ts +25 -19
- package/node_modules/undici/types/dispatcher.d.ts +7 -27
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici/types/formdata.d.ts +0 -6
- package/node_modules/undici/types/h2c-client.d.ts +6 -6
- package/node_modules/undici/types/header.d.ts +5 -0
- package/node_modules/undici/types/index.d.ts +3 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/pool.d.ts +0 -2
- package/node_modules/undici/types/proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici/types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/webidl.d.ts +0 -1
- package/package.json +16 -9
- package/dist/extensions/forgecli/review-command.d.ts +0 -2
- package/dist/extensions/forgecli/review-command.js +0 -184
- package/dist/extensions/forgecli/review-command.js.map +0 -1
- package/dist/forge-payload/.tools/banners.cjs +0 -435
- package/dist/forge-payload/.tools/build-context-pack.cjs +0 -290
- package/dist/forge-payload/.tools/build-init-context.cjs +0 -322
- package/dist/forge-payload/.tools/build-overlay.cjs +0 -326
- package/dist/forge-payload/.tools/build-persona-pack.cjs +0 -226
- package/dist/forge-payload/.tools/collate.cjs +0 -1041
- package/dist/forge-payload/.tools/generation-manifest.cjs +0 -311
- package/dist/forge-payload/.tools/lib/forge-root.cjs +0 -59
- package/dist/forge-payload/.tools/lib/paths.cjs +0 -29
- package/dist/forge-payload/.tools/lib/pricing.cjs +0 -165
- package/dist/forge-payload/.tools/lib/project-root.cjs +0 -32
- package/dist/forge-payload/.tools/lib/result.js +0 -40
- package/dist/forge-payload/.tools/lib/store-facade.cjs +0 -162
- package/dist/forge-payload/.tools/lib/store-nlp.cjs +0 -250
- package/dist/forge-payload/.tools/lib/store-query-exec.cjs +0 -272
- package/dist/forge-payload/.tools/lib/validate.js +0 -141
- package/dist/forge-payload/.tools/manage-config.cjs +0 -340
- package/dist/forge-payload/.tools/manage-versions.cjs +0 -365
- package/dist/forge-payload/.tools/package.json +0 -3
- package/dist/forge-payload/.tools/parse-gates.cjs +0 -151
- package/dist/forge-payload/.tools/parse-verdict.cjs +0 -67
- package/dist/forge-payload/.tools/preflight-gate.cjs +0 -350
- package/dist/forge-payload/.tools/prompts/sprint-plan-prompt.md +0 -70
- package/dist/forge-payload/.tools/schemas/task-list.schema.json +0 -53
- package/dist/forge-payload/.tools/seed-store.cjs +0 -237
- package/dist/forge-payload/.tools/store-cli.cjs +0 -1226
- package/dist/forge-payload/.tools/store-query.cjs +0 -319
- package/dist/forge-payload/.tools/store.cjs +0 -315
- package/dist/forge-payload/.tools/substitute-placeholders.cjs +0 -625
- package/dist/forge-payload/.tools/validate-store.cjs +0 -593
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +0 -92
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +0 -31
- package/node_modules/undici/lib/handler/unwrap-handler.js +0 -100
- package/node_modules/undici/lib/handler/wrap-handler.js +0 -105
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/util/promise.js +0 -28
- package/skills/refresh-kb-links/SKILL.md +0 -217
- package/skills/store-custodian/SKILL.md +0 -163
- package/skills/store-query-grammar/SKILL.md +0 -145
- package/skills/store-query-nlp/SKILL.md +0 -110
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Native /forge:config handler — replaces the LLM-backed delegateMarkdownCommand
|
|
2
|
+
// stub that previously lived in forge-commands.ts.
|
|
3
|
+
//
|
|
4
|
+
// Plan 16 Slice 4a + 4b. The handler delegates to runConfigTui which is the
|
|
5
|
+
// same entry point used by the `forge config` bin subcommand — single source
|
|
6
|
+
// of truth for the routing config TUI / show flow. The wrapper supplies a
|
|
7
|
+
// `mountConfigTui` callback that uses ctx.ui.custom() to overlay the TUI.
|
|
8
|
+
import { createConfigTuiComponent } from "./config-tui/component.js";
|
|
9
|
+
import { runConfigTui } from "./config-tui/handler.js";
|
|
10
|
+
import { getInputRouter } from "./input-router.js";
|
|
11
|
+
export function registerConfigCommand(pi, _opts) {
|
|
12
|
+
pi.registerCommand("forge:config", {
|
|
13
|
+
description: "Inspect or change forge-cli routing config (persona-models, pipeline overrides) and view Forge project config",
|
|
14
|
+
async handler(args, ctx) {
|
|
15
|
+
const argv = args.trim().length === 0 ? [] : args.trim().split(/\s+/);
|
|
16
|
+
const mountConfigTui = async (init) => {
|
|
17
|
+
// Mark overlay active so forge-input-router suppresses arrow-activator
|
|
18
|
+
// listeners (thread-switcher's ↓, whats-new's ↓) while the TUI owns
|
|
19
|
+
// input focus.
|
|
20
|
+
const router = getInputRouter();
|
|
21
|
+
router.pushOverlay();
|
|
22
|
+
try {
|
|
23
|
+
const exitCode = await ctx.ui.custom((tui, theme, _kb, done) => {
|
|
24
|
+
// Component drives done() on q or successful confirm-quit.
|
|
25
|
+
// Pi TUI key rule 3: call tui.requestRender() after state changes.
|
|
26
|
+
const component = createConfigTuiComponent({
|
|
27
|
+
...init,
|
|
28
|
+
onExit: (code) => done(code),
|
|
29
|
+
onSaved: (target) => ctx.ui.notify(`forge config: saved → ${target}`, "info"),
|
|
30
|
+
onError: (msg) => ctx.ui.notify(`forge config: ${msg}`, "error"),
|
|
31
|
+
requestRender: () => tui.requestRender(),
|
|
32
|
+
theme,
|
|
33
|
+
});
|
|
34
|
+
return component;
|
|
35
|
+
}, {
|
|
36
|
+
overlay: true,
|
|
37
|
+
overlayOptions: {
|
|
38
|
+
width: "100%",
|
|
39
|
+
anchor: "center",
|
|
40
|
+
margin: 0,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return exitCode;
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
router.popOverlay();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const exitCode = await runConfigTui(argv, process.cwd(), {
|
|
50
|
+
write: () => { },
|
|
51
|
+
writeErr: (s) => ctx.ui.notify(s, "error"),
|
|
52
|
+
ctx: {
|
|
53
|
+
notify: (msg, level) => {
|
|
54
|
+
const lvl = (level === "warning" || level === "error" ? level : "info");
|
|
55
|
+
ctx.ui.notify(msg, lvl);
|
|
56
|
+
},
|
|
57
|
+
mountConfigTui,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
if (exitCode !== 0) {
|
|
61
|
+
ctx.ui.notify(`forge:config exited with code ${exitCode}`, "warning");
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=config-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-command.js","sourceRoot":"","sources":["../../../src/extensions/forgecli/config-command.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AACnD,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAG1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASnD,MAAM,UAAU,qBAAqB,CAAC,EAAgB,EAAE,KAAmC;IACzF,EAAE,CAAC,eAAe,CAAC,cAAc,EAAE;QACjC,WAAW,EACT,+GAA+G;QACjH,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG;YACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAEtE,MAAM,cAAc,GAAG,KAAK,EAAE,IAAiB,EAAmB,EAAE;gBAClE,uEAAuE;gBACvE,oEAAoE;gBACpE,eAAe;gBACf,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;gBAChC,MAAM,CAAC,WAAW,EAAE,CAAC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,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;wBACrB,MAAM,GAAG,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAG3D,CAAC;wBACZ,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;oBAC1B,CAAC;oBACD,cAAc;iBACf;aACF,CAAC,CAAC;YAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;gBACnB,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,iCAAiC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface PersonaModel {
|
|
2
|
+
provider: string;
|
|
3
|
+
model: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export type PersonaModelsMap = Record<string, PersonaModel>;
|
|
7
|
+
export interface PhaseConfig {
|
|
8
|
+
"model-override"?: string | PersonaModel;
|
|
9
|
+
}
|
|
10
|
+
export interface PipelineConfig {
|
|
11
|
+
"persona-models"?: PersonaModelsMap;
|
|
12
|
+
/** Phase overrides keyed by role string. */
|
|
13
|
+
phases?: Record<string, PhaseConfig>;
|
|
14
|
+
}
|
|
15
|
+
export interface GlobalConfig {
|
|
16
|
+
"persona-models"?: PersonaModelsMap;
|
|
17
|
+
}
|
|
18
|
+
export interface ProjectConfig {
|
|
19
|
+
"persona-models"?: PersonaModelsMap;
|
|
20
|
+
pipelines?: Record<string, PipelineConfig>;
|
|
21
|
+
}
|
|
22
|
+
export interface MergedConfig {
|
|
23
|
+
/** Shallow-merged persona-models (project wins on key collision). */
|
|
24
|
+
"persona-models"?: PersonaModelsMap;
|
|
25
|
+
/** Project-only pipelines (L3/L4 config lives here). */
|
|
26
|
+
pipelines?: Record<string, PipelineConfig>;
|
|
27
|
+
/** The raw global config for L1 lookups — null if absent or invalid. */
|
|
28
|
+
_global: GlobalConfig | null;
|
|
29
|
+
/** The raw project config for L2 lookups — null if absent or invalid. */
|
|
30
|
+
_project: ProjectConfig | null;
|
|
31
|
+
}
|
|
32
|
+
export interface LayeredConfig {
|
|
33
|
+
global: GlobalConfig | null;
|
|
34
|
+
project: ProjectConfig | null;
|
|
35
|
+
merged: MergedConfig;
|
|
36
|
+
errors: string[];
|
|
37
|
+
}
|
|
38
|
+
export declare function loadLayeredConfig(cwd: string): LayeredConfig;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import { Ajv } from "ajv";
|
|
5
|
+
import schema from "./forge-cli-schema.json" with { type: "json" };
|
|
6
|
+
const ajv = new Ajv({ allErrors: true });
|
|
7
|
+
const validate = ajv.compile(schema);
|
|
8
|
+
function validateConfig(raw, label) {
|
|
9
|
+
const ok = validate(raw);
|
|
10
|
+
if (!ok) {
|
|
11
|
+
const messages = validate.errors?.map((e) => `${e.instancePath || "/"} ${e.message}`).join("; ") ?? "unknown";
|
|
12
|
+
return { valid: false, error: `forge-cli ${label} config schema error: ${messages}` };
|
|
13
|
+
}
|
|
14
|
+
return { valid: true, data: raw };
|
|
15
|
+
}
|
|
16
|
+
function readJsonFile(filePath) {
|
|
17
|
+
try {
|
|
18
|
+
return JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
19
|
+
}
|
|
20
|
+
catch (_err) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function loadLayeredConfig(cwd) {
|
|
25
|
+
const errors = [];
|
|
26
|
+
const globalPath = path.join(getAgentDir(), "forge-cli", "config.json");
|
|
27
|
+
const projectPath = path.join(cwd, ".pi", "forge-cli", "config.json");
|
|
28
|
+
let globalConfig = null;
|
|
29
|
+
let projectConfig = null;
|
|
30
|
+
const rawGlobal = readJsonFile(globalPath);
|
|
31
|
+
if (rawGlobal !== null) {
|
|
32
|
+
const result = validateConfig(rawGlobal, "global");
|
|
33
|
+
if (result.valid) {
|
|
34
|
+
globalConfig = result.data;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
errors.push(result.error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const rawProject = readJsonFile(projectPath);
|
|
41
|
+
if (rawProject !== null) {
|
|
42
|
+
const result = validateConfig(rawProject, "project");
|
|
43
|
+
if (result.valid) {
|
|
44
|
+
projectConfig = result.data;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
errors.push(result.error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Shallow-merge persona-models: global first, project overwrites per key
|
|
51
|
+
const mergedPersonaModels = {
|
|
52
|
+
...(globalConfig?.["persona-models"] ?? {}),
|
|
53
|
+
...(projectConfig?.["persona-models"] ?? {}),
|
|
54
|
+
};
|
|
55
|
+
const merged = {
|
|
56
|
+
_global: globalConfig,
|
|
57
|
+
_project: projectConfig,
|
|
58
|
+
};
|
|
59
|
+
if (Object.keys(mergedPersonaModels).length > 0) {
|
|
60
|
+
merged["persona-models"] = mergedPersonaModels;
|
|
61
|
+
}
|
|
62
|
+
// Pipelines are project-only (global config is project-agnostic)
|
|
63
|
+
if (projectConfig?.pipelines) {
|
|
64
|
+
merged.pipelines = projectConfig.pipelines;
|
|
65
|
+
}
|
|
66
|
+
return { global: globalConfig, project: projectConfig, merged, errors };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=config-layer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-layer.js","sourceRoot":"","sources":["../../../src/extensions/forgecli/config-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,E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AI,CAAC,mBAAmB,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,CAAC,gBAAgB,CAAC,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAED,iEAAiE;IACjE,IAAI,aAAa,EAAE,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;IAC7C,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Component, Focusable } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { type InitOptions } from "./state.js";
|
|
4
|
+
export interface ConfigTuiComponentOptions extends InitOptions {
|
|
5
|
+
/** Called by the component when the user has quit (with discard or via clean exit). */
|
|
6
|
+
onExit: (exitCode: number) => void;
|
|
7
|
+
/** Called when a write to disk completes successfully — surfaces "saved to X". */
|
|
8
|
+
onSaved?: (target: string) => void;
|
|
9
|
+
/** Called on write failure — surfaces the error to the parent ctx. */
|
|
10
|
+
onError?: (message: string) => void;
|
|
11
|
+
/** Optional invalidate hook supplied by the TUI driver (forces re-render). */
|
|
12
|
+
requestRender?: () => void;
|
|
13
|
+
/** pi TUI theme — drives all colour choices inside the overlay. */
|
|
14
|
+
theme: Theme;
|
|
15
|
+
}
|
|
16
|
+
export declare class ConfigTuiComponent implements Component, Focusable {
|
|
17
|
+
private state;
|
|
18
|
+
private readonly opts;
|
|
19
|
+
/** Focusable — pi sets this to true when the overlay has keyboard focus.
|
|
20
|
+
* Without this, arrow keys don't route to handleInput (see commit 07e886f). */
|
|
21
|
+
focused: boolean;
|
|
22
|
+
/** Timer handle for the auto-clearing save banner (guards against unmount). */
|
|
23
|
+
private clearStatusTimer?;
|
|
24
|
+
constructor(opts: ConfigTuiComponentOptions);
|
|
25
|
+
invalidate(): void;
|
|
26
|
+
render(width: number): string[];
|
|
27
|
+
handleInput(data: string): void;
|
|
28
|
+
private handleResult;
|
|
29
|
+
private dispatch;
|
|
30
|
+
private maybeExit;
|
|
31
|
+
private maybePersist;
|
|
32
|
+
/** Schedule save-banner auto-clear. Guards against unmount (Hard Rule 5). */
|
|
33
|
+
private scheduleClearStatus;
|
|
34
|
+
}
|
|
35
|
+
export declare function createConfigTuiComponent(opts: ConfigTuiComponentOptions): ConfigTuiComponent;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// Composite Component that drives the config TUI.
|
|
2
|
+
//
|
|
3
|
+
// Phase 2: thin orchestrator that delegates render and handleInput to the
|
|
4
|
+
// active Screen implementation. The Component & Focusable impl stays here;
|
|
5
|
+
// per-view logic moved into screens/*.ts modules.
|
|
6
|
+
//
|
|
7
|
+
// The component composes:
|
|
8
|
+
// - state/ reducer (single source of truth)
|
|
9
|
+
// - screens/* renderers + input handlers (delegated via Screen interface)
|
|
10
|
+
// - config-writer.ts for atomic persistence on commit-persona-edit
|
|
11
|
+
import * as fs from "node:fs";
|
|
12
|
+
import { Key, matchesKey, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
13
|
+
import { DynamicBorder } from "@earendil-works/pi-coding-agent";
|
|
14
|
+
import { writeRoutingConfig } from "../config-writer.js";
|
|
15
|
+
import { getActiveView, initialState, reducer, } from "./state.js";
|
|
16
|
+
import { AdvancedMenuScreen } from "./screens/advanced-menu.js";
|
|
17
|
+
import { TierMenuScreen } from "./screens/tier-menu.js";
|
|
18
|
+
import { TierPickerScreen } from "./screens/tier-picker.js";
|
|
19
|
+
import { ConfirmQuitScreen, renderSaveBanner } from "./screens/confirm-quit.js";
|
|
20
|
+
import { PersonasListScreen } from "./screens/personas-list.js";
|
|
21
|
+
import { PersonaPickerScreen } from "./screens/persona-picker.js";
|
|
22
|
+
import { PersonaEditorScreen } from "./screens/persona-editor.js";
|
|
23
|
+
import { ShowResolvedScreen } from "./screens/show-resolved.js";
|
|
24
|
+
import { OverridesListPipelinesScreen } from "./screens/overrides-list.js";
|
|
25
|
+
import { OverridesListPhasesScreen } from "./screens/overrides-list-phases.js";
|
|
26
|
+
import { OverrideEditorScreen } from "./screens/override-editor.js";
|
|
27
|
+
function debugLog(line) {
|
|
28
|
+
if (process.env.FORGE_DEBUG_INPUT !== "1")
|
|
29
|
+
return;
|
|
30
|
+
try {
|
|
31
|
+
const ts = new Date().toISOString();
|
|
32
|
+
const path = process.env.FORGE_DEBUG_INPUT_LOG ?? "/tmp/forge-input-router.log";
|
|
33
|
+
fs.appendFileSync(path, `${ts} [config-tui] ${line}\n`);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
/* swallow */
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function hexEscape(s) {
|
|
40
|
+
return [...s]
|
|
41
|
+
.map((c) => {
|
|
42
|
+
const cp = c.codePointAt(0);
|
|
43
|
+
if (cp >= 0x20 && cp <= 0x7e)
|
|
44
|
+
return c;
|
|
45
|
+
return `\\x${cp.toString(16).padStart(2, "0")}`;
|
|
46
|
+
})
|
|
47
|
+
.join("");
|
|
48
|
+
}
|
|
49
|
+
// ── Screen factory ──────────────────────────────────────────────────────────
|
|
50
|
+
const SCREEN_INSTANCES = {
|
|
51
|
+
"confirm-quit": new ConfirmQuitScreen(),
|
|
52
|
+
"tier-menu": new TierMenuScreen(),
|
|
53
|
+
"tier-picker": new TierPickerScreen(),
|
|
54
|
+
"advanced-menu": new AdvancedMenuScreen(),
|
|
55
|
+
"personas-list": new PersonasListScreen(),
|
|
56
|
+
"persona-picker": new PersonaPickerScreen(),
|
|
57
|
+
"persona-editor": new PersonaEditorScreen(),
|
|
58
|
+
"show-resolved": new ShowResolvedScreen(),
|
|
59
|
+
"overrides-list-pipelines": new OverridesListPipelinesScreen(),
|
|
60
|
+
"overrides-list-phases": new OverridesListPhasesScreen(),
|
|
61
|
+
"override-editor": new OverrideEditorScreen(),
|
|
62
|
+
};
|
|
63
|
+
function createScreen(view) {
|
|
64
|
+
return SCREEN_INSTANCES[view.kind] ?? SCREEN_INSTANCES["tier-menu"];
|
|
65
|
+
}
|
|
66
|
+
// ── Hard Rule 4: Explicit layer-to-action mapping ──────────────────────────
|
|
67
|
+
function persistLayerForAction(action) {
|
|
68
|
+
switch (action.kind) {
|
|
69
|
+
case "commit-tier-model": return action.layer;
|
|
70
|
+
case "commit-persona-edit": return action.layer;
|
|
71
|
+
case "delete-persona-entry": return action.layer;
|
|
72
|
+
case "commit-override-name": return "project"; // L4 lives on project only
|
|
73
|
+
case "commit-override-inline": return "project"; // L4 lives on project only
|
|
74
|
+
case "clear-phase-override": return "project"; // L4 lives on project only
|
|
75
|
+
default: return undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export class ConfigTuiComponent {
|
|
79
|
+
state;
|
|
80
|
+
opts;
|
|
81
|
+
/** Focusable — pi sets this to true when the overlay has keyboard focus.
|
|
82
|
+
* Without this, arrow keys don't route to handleInput (see commit 07e886f). */
|
|
83
|
+
focused = false;
|
|
84
|
+
/** Timer handle for the auto-clearing save banner (guards against unmount). */
|
|
85
|
+
clearStatusTimer;
|
|
86
|
+
constructor(opts) {
|
|
87
|
+
this.opts = opts;
|
|
88
|
+
this.state = initialState(opts);
|
|
89
|
+
}
|
|
90
|
+
invalidate() {
|
|
91
|
+
// Stateless renderer; no cache to drop. (Hard Rule 3: no render caching.)
|
|
92
|
+
}
|
|
93
|
+
render(width) {
|
|
94
|
+
const theme = this.opts.theme;
|
|
95
|
+
const view = getActiveView(this.state);
|
|
96
|
+
// Delegate rendering to the active screen (or confirm-quit overlay).
|
|
97
|
+
let contentLines;
|
|
98
|
+
if (this.state.confirmQuit) {
|
|
99
|
+
// show the underlying screen plus the confirm-quit overlay
|
|
100
|
+
const screen = createScreen(view);
|
|
101
|
+
const baseLines = screen.render(this.state, width, theme);
|
|
102
|
+
const quitLines = SCREEN_INSTANCES["confirm-quit"].render(this.state, width, theme);
|
|
103
|
+
contentLines = [...baseLines, ...renderSaveBanner(this.state, width, theme), ...quitLines];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const screen = createScreen(view);
|
|
107
|
+
contentLines = [
|
|
108
|
+
...screen.render(this.state, width, theme),
|
|
109
|
+
...renderSaveBanner(this.state, width, theme),
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
// ── Modal frame ────────────────────────────────────────────────────
|
|
113
|
+
const bgFn = (s) => theme.bg("selectedBg", s);
|
|
114
|
+
const lines = [];
|
|
115
|
+
// Top border
|
|
116
|
+
lines.push(...new DynamicBorder((s) => theme.fg("borderAccent", s)).render(width));
|
|
117
|
+
// Content: each line padded to full width so the background colour fills
|
|
118
|
+
// the entire row. visibleWidth correctly ignores ANSI codes added by theme.
|
|
119
|
+
// truncateToWidth ensures no line exceeds the terminal width.
|
|
120
|
+
for (const line of contentLines) {
|
|
121
|
+
const truncated = truncateToWidth(line, width, "");
|
|
122
|
+
const vis = visibleWidth(truncated);
|
|
123
|
+
const padded = vis < width ? truncated + " ".repeat(width - vis) : truncated;
|
|
124
|
+
lines.push(bgFn(padded));
|
|
125
|
+
}
|
|
126
|
+
// Bottom border
|
|
127
|
+
lines.push(...new DynamicBorder((s) => theme.fg("borderAccent", s)).render(width));
|
|
128
|
+
return lines;
|
|
129
|
+
}
|
|
130
|
+
handleInput(data) {
|
|
131
|
+
debugLog(`handleInput IN data="${hexEscape(data)}" focused=${this.focused} view=${getActiveView(this.state).kind}`);
|
|
132
|
+
if (this.state.shouldExit) {
|
|
133
|
+
debugLog(`handleInput RETURN (shouldExit)`);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
// Universal: q always requests quit
|
|
137
|
+
if (matchesKey(data, "q")) {
|
|
138
|
+
this.dispatch({ kind: "request-quit" });
|
|
139
|
+
this.maybeExit();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
// confirmQuit modal hijacks subsequent input
|
|
143
|
+
if (this.state.confirmQuit) {
|
|
144
|
+
const result = SCREEN_INSTANCES["confirm-quit"].handleInput(data, this.state);
|
|
145
|
+
this.handleResult(result);
|
|
146
|
+
// After confirm-quit, check if we should exit
|
|
147
|
+
this.maybeExit();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (matchesKey(data, Key.escape)) {
|
|
151
|
+
this.dispatch({ kind: "pop-view" });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
// Delegate to the active screen's handleInput
|
|
155
|
+
const view = getActiveView(this.state);
|
|
156
|
+
const screen = createScreen(view);
|
|
157
|
+
const result = screen.handleInput(data, this.state);
|
|
158
|
+
this.handleResult(result);
|
|
159
|
+
}
|
|
160
|
+
// ── Result dispatcher ─────────────────────────────────────────────────────
|
|
161
|
+
handleResult(result) {
|
|
162
|
+
switch (result.kind) {
|
|
163
|
+
case "dispatch":
|
|
164
|
+
this.dispatch(result.action);
|
|
165
|
+
this.maybePersist(result.action);
|
|
166
|
+
break;
|
|
167
|
+
case "dispatch-seq":
|
|
168
|
+
for (const action of result.actions) {
|
|
169
|
+
this.dispatch(action);
|
|
170
|
+
}
|
|
171
|
+
// Persist the last action (the one that triggers the write)
|
|
172
|
+
if (result.actions.length > 0) {
|
|
173
|
+
this.maybePersist(result.actions[result.actions.length - 1]);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case "pop":
|
|
177
|
+
this.dispatch({ kind: "pop-view" });
|
|
178
|
+
break;
|
|
179
|
+
case "quit":
|
|
180
|
+
this.dispatch({ kind: "request-quit" });
|
|
181
|
+
this.maybeExit();
|
|
182
|
+
break;
|
|
183
|
+
case "error":
|
|
184
|
+
this.opts.onError?.(result.message);
|
|
185
|
+
this.opts.requestRender?.();
|
|
186
|
+
break;
|
|
187
|
+
case "consumed":
|
|
188
|
+
this.opts.requestRender?.();
|
|
189
|
+
break;
|
|
190
|
+
case "no-op":
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// ── Dispatcher helpers ────────────────────────────────────────────────────
|
|
195
|
+
dispatch(action) {
|
|
196
|
+
this.state = reducer(this.state, action);
|
|
197
|
+
this.opts.requestRender?.();
|
|
198
|
+
}
|
|
199
|
+
maybeExit() {
|
|
200
|
+
if (this.state.shouldExit) {
|
|
201
|
+
if (this.clearStatusTimer)
|
|
202
|
+
clearTimeout(this.clearStatusTimer); // Hard Rule 5
|
|
203
|
+
this.opts.onExit(0);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
maybePersist(action) {
|
|
207
|
+
const layer = persistLayerForAction(action);
|
|
208
|
+
if (!layer)
|
|
209
|
+
return;
|
|
210
|
+
try {
|
|
211
|
+
const buffer = layer === "global" ? this.state.buffer.global : this.state.buffer.project;
|
|
212
|
+
const target = writeRoutingConfig({ layer, cwd: this.state.cwd, buffer });
|
|
213
|
+
this.dispatch({ kind: "mark-clean", lastSaved: { target, layer } });
|
|
214
|
+
this.scheduleClearStatus(); // Hard Rule 5
|
|
215
|
+
this.opts.onSaved?.(target);
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
219
|
+
this.opts.onError?.(msg);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/** Schedule save-banner auto-clear. Guards against unmount (Hard Rule 5). */
|
|
223
|
+
scheduleClearStatus() {
|
|
224
|
+
if (this.clearStatusTimer)
|
|
225
|
+
clearTimeout(this.clearStatusTimer);
|
|
226
|
+
this.clearStatusTimer = setTimeout(() => {
|
|
227
|
+
if (!this.state.shouldExit) {
|
|
228
|
+
this.dispatch({ kind: "clear-status" });
|
|
229
|
+
}
|
|
230
|
+
}, 3000);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export function createConfigTuiComponent(opts) {
|
|
234
|
+
return new ConfigTuiComponent(opts);
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
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|
5
|
+
kind: "show";
|
|
6
|
+
resolved: boolean;
|
|
7
|
+
json: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "dispatch";
|
|
10
|
+
pipeline: string | undefined;
|
|
11
|
+
json: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "edit-persona";
|
|
14
|
+
persona: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "edit-override";
|
|
17
|
+
pipeline: string;
|
|
18
|
+
phaseRole: string;
|
|
19
|
+
};
|
|
20
|
+
export interface ConfigTuiArgsError {
|
|
21
|
+
error: string;
|
|
22
|
+
}
|
|
23
|
+
export type ParseConfigTuiResult = ConfigTuiRoute | ConfigTuiArgsError;
|
|
24
|
+
export declare function parseConfigTuiArgs(args: string[]): ParseConfigTuiResult;
|
|
25
|
+
/**
|
|
26
|
+
* Caller-provided interaction surface. The pi-extension wrapper supplies
|
|
27
|
+
* `ctx.mountConfigTui` to give us TUI access; the bin surface omits it (and
|
|
28
|
+
* gets a non-interactive fallback message).
|
|
29
|
+
*/
|
|
30
|
+
export interface ConfigTuiCallbacks {
|
|
31
|
+
write: (line: string) => void;
|
|
32
|
+
writeErr?: (line: string) => void;
|
|
33
|
+
/** Present only when invoked inside a pi session (TUI mount available). */
|
|
34
|
+
ctx?: {
|
|
35
|
+
notify: (msg: string, level?: string) => void;
|
|
36
|
+
mountConfigTui?: (init: InitOptions) => Promise<number>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export declare function readPipelineCatalogue(cwd: string): string[] | null;
|
|
40
|
+
export declare function runConfigTui(args: string[], cwd: string, cb: ConfigTuiCallbacks): Promise<number>;
|