@jadelclemens/pi-forge 0.0.0-stage → 0.6.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 +486 -0
- package/LICENSE +21 -0
- package/PUBLIC_API.md +5 -0
- package/README.md +204 -2
- package/README.zh-CN.md +128 -0
- package/SUBAGENT_ADAPTER_CONTRACT.md +7 -0
- package/dist/active-state.d.ts +148 -0
- package/dist/active-state.d.ts.map +1 -0
- package/dist/active-state.js +374 -0
- package/dist/active-state.js.map +1 -0
- package/dist/agent-profile.d.ts +51 -0
- package/dist/agent-profile.d.ts.map +1 -0
- package/dist/agent-profile.js +197 -0
- package/dist/agent-profile.js.map +1 -0
- package/dist/capabilities.d.ts +39 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +160 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/capability-anchors.d.ts +45 -0
- package/dist/capability-anchors.d.ts.map +1 -0
- package/dist/capability-anchors.js +263 -0
- package/dist/capability-anchors.js.map +1 -0
- package/dist/capability-command.d.ts +4 -0
- package/dist/capability-command.d.ts.map +1 -0
- package/dist/capability-command.js +164 -0
- package/dist/capability-command.js.map +1 -0
- package/dist/capability-events.d.ts +79 -0
- package/dist/capability-events.d.ts.map +1 -0
- package/dist/capability-events.js +478 -0
- package/dist/capability-events.js.map +1 -0
- package/dist/capability-projection.d.ts +22 -0
- package/dist/capability-projection.d.ts.map +1 -0
- package/dist/capability-projection.js +273 -0
- package/dist/capability-projection.js.map +1 -0
- package/dist/capability-protocol.d.ts +21 -0
- package/dist/capability-protocol.d.ts.map +1 -0
- package/dist/capability-protocol.js +15 -0
- package/dist/capability-protocol.js.map +1 -0
- package/dist/capability-state.d.ts +74 -0
- package/dist/capability-state.d.ts.map +1 -0
- package/dist/capability-state.js +43 -0
- package/dist/capability-state.js.map +1 -0
- package/dist/capability-tool.d.ts +11 -0
- package/dist/capability-tool.d.ts.map +1 -0
- package/dist/capability-tool.js +25 -0
- package/dist/capability-tool.js.map +1 -0
- package/dist/capability-web-host.d.ts +11 -0
- package/dist/capability-web-host.d.ts.map +1 -0
- package/dist/capability-web-host.js +105 -0
- package/dist/capability-web-host.js.map +1 -0
- package/dist/catalog.d.ts +27 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +59 -0
- package/dist/catalog.js.map +1 -0
- package/dist/codecs/agent-profile.d.ts +53 -0
- package/dist/codecs/agent-profile.d.ts.map +1 -0
- package/dist/codecs/agent-profile.js +176 -0
- package/dist/codecs/agent-profile.js.map +1 -0
- package/dist/codecs/capability.d.ts +71 -0
- package/dist/codecs/capability.d.ts.map +1 -0
- package/dist/codecs/capability.js +363 -0
- package/dist/codecs/capability.js.map +1 -0
- package/dist/codecs/index.d.ts +5 -0
- package/dist/codecs/index.d.ts.map +1 -0
- package/dist/codecs/index.js +3 -0
- package/dist/codecs/index.js.map +1 -0
- package/dist/codecs/prompt-stack.d.ts +18 -0
- package/dist/codecs/prompt-stack.d.ts.map +1 -0
- package/dist/codecs/prompt-stack.js +623 -0
- package/dist/codecs/prompt-stack.js.map +1 -0
- package/dist/command-contribution/index.d.ts +21 -0
- package/dist/command-contribution/index.d.ts.map +1 -0
- package/dist/command-contribution/index.js +14 -0
- package/dist/command-contribution/index.js.map +1 -0
- package/dist/compile-cycle.d.ts +26 -0
- package/dist/compile-cycle.d.ts.map +1 -0
- package/dist/compile-cycle.js +16 -0
- package/dist/compile-cycle.js.map +1 -0
- package/dist/compiler.d.ts +22 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +737 -0
- package/dist/compiler.js.map +1 -0
- package/dist/context-diff-history.d.ts +69 -0
- package/dist/context-diff-history.d.ts.map +1 -0
- package/dist/context-diff-history.js +107 -0
- package/dist/context-diff-history.js.map +1 -0
- package/dist/context-diff-snapshot.d.ts +19 -0
- package/dist/context-diff-snapshot.d.ts.map +1 -0
- package/dist/context-diff-snapshot.js +146 -0
- package/dist/context-diff-snapshot.js.map +1 -0
- package/dist/context-diff.d.ts +70 -0
- package/dist/context-diff.d.ts.map +1 -0
- package/dist/context-diff.js +259 -0
- package/dist/context-diff.js.map +1 -0
- package/dist/extension-registry.d.ts +25 -0
- package/dist/extension-registry.d.ts.map +1 -0
- package/dist/extension-registry.js +9 -0
- package/dist/extension-registry.js.map +1 -0
- package/dist/forge-command.d.ts +10 -0
- package/dist/forge-command.d.ts.map +1 -0
- package/dist/forge-command.js +106 -0
- package/dist/forge-command.js.map +1 -0
- package/dist/forge-config.d.ts +9 -0
- package/dist/forge-config.d.ts.map +1 -0
- package/dist/forge-config.js +15 -0
- package/dist/forge-config.js.map +1 -0
- package/dist/forge-extensions.d.ts +28 -0
- package/dist/forge-extensions.d.ts.map +1 -0
- package/dist/forge-extensions.js +198 -0
- package/dist/forge-extensions.js.map +1 -0
- package/dist/forge-v1/analyzer.d.ts +3 -0
- package/dist/forge-v1/analyzer.d.ts.map +1 -0
- package/dist/forge-v1/analyzer.js +50 -0
- package/dist/forge-v1/analyzer.js.map +1 -0
- package/dist/forge-v1/index.d.ts +6 -0
- package/dist/forge-v1/index.d.ts.map +1 -0
- package/dist/forge-v1/index.js +13 -0
- package/dist/forge-v1/index.js.map +1 -0
- package/dist/forge-v1/parser.d.ts +3 -0
- package/dist/forge-v1/parser.d.ts.map +1 -0
- package/dist/forge-v1/parser.js +186 -0
- package/dist/forge-v1/parser.js.map +1 -0
- package/dist/forge-v1/renderer.d.ts +9 -0
- package/dist/forge-v1/renderer.d.ts.map +1 -0
- package/dist/forge-v1/renderer.js +181 -0
- package/dist/forge-v1/renderer.js.map +1 -0
- package/dist/forge-v1/types.d.ts +87 -0
- package/dist/forge-v1/types.d.ts.map +1 -0
- package/dist/forge-v1/types.js +4 -0
- package/dist/forge-v1/types.js.map +1 -0
- package/dist/host-compatibility.d.ts +13 -0
- package/dist/host-compatibility.d.ts.map +1 -0
- package/dist/host-compatibility.js +41 -0
- package/dist/host-compatibility.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +183 -0
- package/dist/index.js.map +1 -0
- package/dist/json-fingerprint.d.ts +11 -0
- package/dist/json-fingerprint.d.ts.map +1 -0
- package/dist/json-fingerprint.js +66 -0
- package/dist/json-fingerprint.js.map +1 -0
- package/dist/lifecycle.d.ts +46 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +330 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/loader.d.ts +21 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +58 -0
- package/dist/loader.js.map +1 -0
- package/dist/macro-engine.d.ts +18 -0
- package/dist/macro-engine.d.ts.map +1 -0
- package/dist/macro-engine.js +29 -0
- package/dist/macro-engine.js.map +1 -0
- package/dist/payload-capture.d.ts +31 -0
- package/dist/payload-capture.d.ts.map +1 -0
- package/dist/payload-capture.js +253 -0
- package/dist/payload-capture.js.map +1 -0
- package/dist/payload-command.d.ts +12 -0
- package/dist/payload-command.d.ts.map +1 -0
- package/dist/payload-command.js +197 -0
- package/dist/payload-command.js.map +1 -0
- package/dist/payload-state.d.ts +20 -0
- package/dist/payload-state.d.ts.map +1 -0
- package/dist/payload-state.js +20 -0
- package/dist/payload-state.js.map +1 -0
- package/dist/policy.d.ts +7 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +41 -0
- package/dist/policy.js.map +1 -0
- package/dist/preset-command.d.ts +19 -0
- package/dist/preset-command.d.ts.map +1 -0
- package/dist/preset-command.js +261 -0
- package/dist/preset-command.js.map +1 -0
- package/dist/preview-inspection.d.ts +68 -0
- package/dist/preview-inspection.d.ts.map +1 -0
- package/dist/preview-inspection.js +293 -0
- package/dist/preview-inspection.js.map +1 -0
- package/dist/preview-text.d.ts +5 -0
- package/dist/preview-text.d.ts.map +1 -0
- package/dist/preview-text.js +27 -0
- package/dist/preview-text.js.map +1 -0
- package/dist/preview.d.ts +32 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +272 -0
- package/dist/preview.js.map +1 -0
- package/dist/profile-command.d.ts +17 -0
- package/dist/profile-command.d.ts.map +1 -0
- package/dist/profile-command.js +385 -0
- package/dist/profile-command.js.map +1 -0
- package/dist/profile-service.d.ts +107 -0
- package/dist/profile-service.d.ts.map +1 -0
- package/dist/profile-service.js +248 -0
- package/dist/profile-service.js.map +1 -0
- package/dist/prompt-analysis.d.ts +24 -0
- package/dist/prompt-analysis.d.ts.map +1 -0
- package/dist/prompt-analysis.js +84 -0
- package/dist/prompt-analysis.js.map +1 -0
- package/dist/prompt-cache-warning.d.ts +23 -0
- package/dist/prompt-cache-warning.d.ts.map +1 -0
- package/dist/prompt-cache-warning.js +74 -0
- package/dist/prompt-cache-warning.js.map +1 -0
- package/dist/prompt-runtime.d.ts +19 -0
- package/dist/prompt-runtime.d.ts.map +1 -0
- package/dist/prompt-runtime.js +34 -0
- package/dist/prompt-runtime.js.map +1 -0
- package/dist/regex.d.ts +19 -0
- package/dist/regex.d.ts.map +1 -0
- package/dist/regex.js +507 -0
- package/dist/regex.js.map +1 -0
- package/dist/render-helpers.d.ts +38 -0
- package/dist/render-helpers.d.ts.map +1 -0
- package/dist/render-helpers.js +85 -0
- package/dist/render-helpers.js.map +1 -0
- package/dist/repositories/agent-profile.d.ts +36 -0
- package/dist/repositories/agent-profile.d.ts.map +1 -0
- package/dist/repositories/agent-profile.js +153 -0
- package/dist/repositories/agent-profile.js.map +1 -0
- package/dist/repositories/capability.d.ts +53 -0
- package/dist/repositories/capability.d.ts.map +1 -0
- package/dist/repositories/capability.js +294 -0
- package/dist/repositories/capability.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +3 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/prompt-stack.d.ts +57 -0
- package/dist/repositories/prompt-stack.d.ts.map +1 -0
- package/dist/repositories/prompt-stack.js +175 -0
- package/dist/repositories/prompt-stack.js.map +1 -0
- package/dist/resource-identity.d.ts +33 -0
- package/dist/resource-identity.d.ts.map +1 -0
- package/dist/resource-identity.js +56 -0
- package/dist/resource-identity.js.map +1 -0
- package/dist/runtime/capability-runtime.d.ts +95 -0
- package/dist/runtime/capability-runtime.d.ts.map +1 -0
- package/dist/runtime/capability-runtime.js +991 -0
- package/dist/runtime/capability-runtime.js.map +1 -0
- package/dist/runtime/profile-runtime.d.ts +14 -0
- package/dist/runtime/profile-runtime.d.ts.map +1 -0
- package/dist/runtime/profile-runtime.js +56 -0
- package/dist/runtime/profile-runtime.js.map +1 -0
- package/dist/runtime/prompt-stack-runtime.d.ts +27 -0
- package/dist/runtime/prompt-stack-runtime.d.ts.map +1 -0
- package/dist/runtime/prompt-stack-runtime.js +149 -0
- package/dist/runtime/prompt-stack-runtime.js.map +1 -0
- package/dist/runtime/tool-policy-runtime.d.ts +25 -0
- package/dist/runtime/tool-policy-runtime.d.ts.map +1 -0
- package/dist/runtime/tool-policy-runtime.js +386 -0
- package/dist/runtime/tool-policy-runtime.js.map +1 -0
- package/dist/runtime/web-editor-runtime.d.ts +11 -0
- package/dist/runtime/web-editor-runtime.d.ts.map +1 -0
- package/dist/runtime/web-editor-runtime.js +141 -0
- package/dist/runtime/web-editor-runtime.js.map +1 -0
- package/dist/session-adapter.d.ts +30 -0
- package/dist/session-adapter.d.ts.map +1 -0
- package/dist/session-adapter.js +167 -0
- package/dist/session-adapter.js.map +1 -0
- package/dist/session-state.d.ts +23 -0
- package/dist/session-state.d.ts.map +1 -0
- package/dist/session-state.js +44 -0
- package/dist/session-state.js.map +1 -0
- package/dist/session-usage.d.ts +65 -0
- package/dist/session-usage.d.ts.map +1 -0
- package/dist/session-usage.js +134 -0
- package/dist/session-usage.js.map +1 -0
- package/dist/slot-renderers.d.ts +38 -0
- package/dist/slot-renderers.d.ts.map +1 -0
- package/dist/slot-renderers.js +285 -0
- package/dist/slot-renderers.js.map +1 -0
- package/dist/stack-migration.d.ts +35 -0
- package/dist/stack-migration.d.ts.map +1 -0
- package/dist/stack-migration.js +123 -0
- package/dist/stack-migration.js.map +1 -0
- package/dist/status-text.d.ts +6 -0
- package/dist/status-text.d.ts.map +1 -0
- package/dist/status-text.js +11 -0
- package/dist/status-text.js.map +1 -0
- package/dist/storage.d.ts +24 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +94 -0
- package/dist/storage.js.map +1 -0
- package/dist/subagent/fingerprints.d.ts +12 -0
- package/dist/subagent/fingerprints.d.ts.map +1 -0
- package/dist/subagent/fingerprints.js +17 -0
- package/dist/subagent/fingerprints.js.map +1 -0
- package/dist/subagent/host-port.d.ts +296 -0
- package/dist/subagent/host-port.d.ts.map +1 -0
- package/dist/subagent/host-port.js +560 -0
- package/dist/subagent/host-port.js.map +1 -0
- package/dist/subagent/index.d.ts +16 -0
- package/dist/subagent/index.d.ts.map +1 -0
- package/dist/subagent/index.js +15 -0
- package/dist/subagent/index.js.map +1 -0
- package/dist/subagent-host.d.ts +125 -0
- package/dist/subagent-host.d.ts.map +1 -0
- package/dist/subagent-host.js +327 -0
- package/dist/subagent-host.js.map +1 -0
- package/dist/template-render.d.ts +18 -0
- package/dist/template-render.d.ts.map +1 -0
- package/dist/template-render.js +232 -0
- package/dist/template-render.js.map +1 -0
- package/dist/types.d.ts +213 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui-contribution/contrib-port.d.ts +170 -0
- package/dist/ui-contribution/contrib-port.d.ts.map +1 -0
- package/dist/ui-contribution/contrib-port.js +640 -0
- package/dist/ui-contribution/contrib-port.js.map +1 -0
- package/dist/ui-contribution/index.d.ts +3 -0
- package/dist/ui-contribution/index.d.ts.map +1 -0
- package/dist/ui-contribution/index.js +2 -0
- package/dist/ui-contribution/index.js.map +1 -0
- package/dist/web-editor/client-script.d.ts +2 -0
- package/dist/web-editor/client-script.d.ts.map +1 -0
- package/dist/web-editor/client-script.generated.d.ts +2 -0
- package/dist/web-editor/client-script.generated.d.ts.map +1 -0
- package/dist/web-editor/client-script.generated.js +3 -0
- package/dist/web-editor/client-script.generated.js.map +1 -0
- package/dist/web-editor/client-script.js +2 -0
- package/dist/web-editor/client-script.js.map +1 -0
- package/dist/web-editor/client-styles.d.ts +2 -0
- package/dist/web-editor/client-styles.d.ts.map +1 -0
- package/dist/web-editor/client-styles.generated.d.ts +2 -0
- package/dist/web-editor/client-styles.generated.d.ts.map +1 -0
- package/dist/web-editor/client-styles.generated.js +3 -0
- package/dist/web-editor/client-styles.generated.js.map +1 -0
- package/dist/web-editor/client-styles.js +2 -0
- package/dist/web-editor/client-styles.js.map +1 -0
- package/dist/web-editor/contrib-service.d.ts +41 -0
- package/dist/web-editor/contrib-service.d.ts.map +1 -0
- package/dist/web-editor/contrib-service.js +174 -0
- package/dist/web-editor/contrib-service.js.map +1 -0
- package/dist/web-editor/index.d.ts +3 -0
- package/dist/web-editor/index.d.ts.map +1 -0
- package/dist/web-editor/index.js +2 -0
- package/dist/web-editor/index.js.map +1 -0
- package/dist/web-editor/line-diff.d.ts +28 -0
- package/dist/web-editor/line-diff.d.ts.map +1 -0
- package/dist/web-editor/line-diff.js +216 -0
- package/dist/web-editor/line-diff.js.map +1 -0
- package/dist/web-editor/page.d.ts +4 -0
- package/dist/web-editor/page.d.ts.map +1 -0
- package/dist/web-editor/page.js +26 -0
- package/dist/web-editor/page.js.map +1 -0
- package/dist/web-editor/schema-form.d.ts +63 -0
- package/dist/web-editor/schema-form.d.ts.map +1 -0
- package/dist/web-editor/schema-form.js +213 -0
- package/dist/web-editor/schema-form.js.map +1 -0
- package/dist/web-editor/server.d.ts +4 -0
- package/dist/web-editor/server.d.ts.map +1 -0
- package/dist/web-editor/server.js +637 -0
- package/dist/web-editor/server.js.map +1 -0
- package/dist/web-editor/styles.d.ts +2 -0
- package/dist/web-editor/styles.d.ts.map +1 -0
- package/dist/web-editor/styles.js +1744 -0
- package/dist/web-editor/styles.js.map +1 -0
- package/dist/web-editor/types.d.ts +304 -0
- package/dist/web-editor/types.d.ts.map +1 -0
- package/dist/web-editor/types.js +2 -0
- package/dist/web-editor/types.js.map +1 -0
- package/dist/web-host.d.ts +56 -0
- package/dist/web-host.d.ts.map +1 -0
- package/dist/web-host.js +750 -0
- package/dist/web-host.js.map +1 -0
- package/dist/workspace.d.ts +85 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +409 -0
- package/dist/workspace.js.map +1 -0
- package/docs/README.md +49 -0
- package/docs/concepts/agent-profiles.md +62 -0
- package/docs/concepts/prompt-stacks.md +99 -0
- package/docs/design/0.5.1-plan.md +237 -0
- package/docs/design/README.md +37 -0
- package/docs/design/architecture-0.5.md +254 -0
- package/docs/design/archive/0.5-full-proposal/0.5-consumer-audit.md +62 -0
- package/docs/design/archive/0.5-full-proposal/0.5-inventory.md +208 -0
- package/docs/design/archive/0.5-full-proposal/0.5-phase0-decision-drafts.md +237 -0
- package/docs/design/archive/0.5-full-proposal/README.md +12 -0
- package/docs/design/archive/0.5-full-proposal/architecture-0.5.md +423 -0
- package/docs/design/archive/0.5-full-proposal/host-discovery-spike.md +103 -0
- package/docs/design/archive/0.5-full-proposal/template-language-spike.md +156 -0
- package/docs/design/archive/2026-09-12-system-update-design.md +229 -0
- package/docs/design/context-diff-plan.md +78 -0
- package/docs/design/decision-template.md +33 -0
- package/docs/design/pi-forge-system-update-design-notes.md +157 -0
- package/docs/design/roadmap-0.4-archive.md +216 -0
- package/docs/design/subagents/design-review.md +220 -0
- package/docs/design/subagents/interface-design.md +274 -0
- package/docs/design/subagents/sdk-spike-findings.md +117 -0
- package/docs/development/architecture-rules.md +148 -0
- package/docs/development/complexity-review.md +86 -0
- package/docs/development/release.md +59 -0
- package/docs/development/roadmap.md +117 -0
- package/docs/development/scoped-global-profiles-stacks.md +325 -0
- package/docs/development/setup.md +99 -0
- package/docs/getting-started.md +96 -0
- package/docs/guides/custom-macros-and-slots.md +69 -0
- package/docs/guides/debugging.md +39 -0
- package/docs/guides/delegation.md +105 -0
- package/docs/guides/migrating-to-0.5.md +136 -0
- package/docs/guides/pi-1-compatibility.md +160 -0
- package/docs/guides/use-cases.md +67 -0
- package/docs/guides/web-editor.md +161 -0
- package/docs/reference/active-state.md +77 -0
- package/docs/reference/capabilities.md +288 -0
- package/docs/reference/commands.md +89 -0
- package/docs/reference/configuration.md +70 -0
- package/docs/reference/features.md +305 -0
- package/docs/reference/macros-and-slots.md +103 -0
- package/docs/reference/provider-support.md +67 -0
- package/docs/reference/public-api.md +133 -0
- package/docs/reference/session-cache.md +112 -0
- package/docs/reference/stack-schema.md +243 -0
- package/docs/reference/subagent-host-port.md +57 -0
- package/docs/reference/ui-contribution-port.md +51 -0
- package/docs/zh-CN/README.md +41 -0
- package/docs/zh-CN/concepts/agent-profiles.md +48 -0
- package/docs/zh-CN/concepts/prompt-stacks.md +48 -0
- package/docs/zh-CN/getting-started.md +82 -0
- package/docs/zh-CN/guides/delegation.md +76 -0
- package/docs/zh-CN/guides/migrating-to-0.5.md +121 -0
- package/docs/zh-CN/guides/pi-1-compatibility.md +158 -0
- package/docs/zh-CN/guides/web-editor.md +134 -0
- package/docs/zh-CN/reference/capabilities.md +288 -0
- package/docs/zh-CN/reference/commands.md +89 -0
- package/docs/zh-CN/reference/provider-support.md +67 -0
- package/docs/zh-CN/reference/session-cache.md +112 -0
- package/examples/capabilities/review.json +12 -0
- package/examples/capabilities/write-tools.json +15 -0
- package/examples/custom-system-status-extension/index.ts +144 -0
- package/examples/custom-system-status-extension/prompt-stack.json +40 -0
- package/examples/default-prompt-stack.json +125 -0
- package/examples/fake-assistant-direct-output-prompt-stack.json +48 -0
- package/examples/hack-prompt-stack.json +118 -0
- package/examples/minimal-prompt-stack.json +40 -0
- package/examples/read-first-worker-prompt-stack.json +49 -0
- package/examples/validation-issues-prompt-stack.json +38 -0
- package/package.json +114 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
In 0.x development, breaking changes may occur in minor releases and will be explicitly noted.
|
|
8
|
+
|
|
9
|
+
## [0.5.13] - 2026-11-21
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Support Pi 1.6. Optional SDK peers expand to `>=0.87.0 <0.88.0 || 0.99.0 || 0.99.1 || 0.99.2 || >=1.0.0 <1.7.0`, development SDKs are pinned to 1.6.0, and Pi 1.5.0 joins the compatibility lanes. Minimum Pi 0.87.0 and TypeBox 1.3.27 remain unchanged. No Forge runtime code changes were needed: Pi 1.6's default prompt and documentation list are unchanged, and Forge does not render pi-tui components, so the read-only `render()` change does not affect it.
|
|
14
|
+
- When Forge aborts a request before dispatch from its `context_with_system` hook (for example on a corrupt Capability event), Pi 1.5.1 and later record the turn as `aborted`; 1.5.0 and earlier recorded `error`. The aborted request is still never dispatched. Tests now expect the host's value.
|
|
15
|
+
|
|
16
|
+
## [0.5.12] - 2026-11-13
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Long sessions with many images could run Pi out of memory. Forge captures every provider request for the context-diff view and kept image data verbatim; with Responses-style providers (such as OpenAI Codex) each of the 20 retained snapshots held every image in the conversation. A session with 53 screenshots (about 92 MB of base64) retained about 3.6 GB and crashed with "JavaScript heap out of memory".
|
|
21
|
+
- Snapshots now replace media in standard provider fields with a placeholder carrying its type, length and a SHA-1 of the full content, so the diff still detects content changes: base64 data URLs (OpenAI, Codex Responses images and files), base64 `data` of Anthropic image/document, Gemini inline-data and OpenAI audio blocks, Pi's native image content (pi-messages providers), and binary bytes (Bedrock). Hashing costs roughly 0.5 ms per MB of media per request.
|
|
22
|
+
- Tool definitions and tool-call arguments are never inspected for media and are kept verbatim. Elsewhere, a string that starts with a base64 data URL prefix (`data:<type>;base64,`) is treated as media in full, for example a tool result that begins with a data URL; a data URL that appears after other text stays as text. Formats not listed here are kept as before and are bounded only by the history budget below.
|
|
23
|
+
- Snapshot history also has a 16-million-character budget. Older turns are dropped first; the latest two turns are always kept, so a single very large turn can exceed the budget.
|
|
24
|
+
- In a real Pi session reading 100 screenshots (200 requests), memory stayed at the level of Pi without Forge; 0.5.11 had about 3.3 GB live by the 46th screenshot.
|
|
25
|
+
- Image data no longer inflates the context-diff token estimates: an inline image used to count as hundreds of thousands of approximate tokens.
|
|
26
|
+
|
|
27
|
+
## [0.5.11] - 2026-11-08
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Support Pi 1.5. Optional SDK peers expand to `>=0.87.0 <0.88.0 || 0.99.0 || 0.99.1 || 0.99.2 || >=1.0.0 <1.6.0`, development SDKs are pinned to 1.5.0, and Pi 1.4.0 joins the compatibility lanes. Minimum Pi 0.87.0 and TypeBox 1.3.27 remain unchanged.
|
|
32
|
+
- The **Pi Default** web-editor template, the example stacks and the `pi-docs` slot use Pi 1.5's default prompt wording. Saved Presets are unchanged.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Forge works with SDK consumers on Pi 1.5, where `@earendil-works/pi-ai` no longer exports TypeBox's `Type`.
|
|
37
|
+
- The `tools` and `tool-guidelines` slots no longer list tools whose declarations a `prepareLoadout` hook hides (for example tools reached only through codemode), matching Pi's default prompt. This needs Pi 1.0.4 or later; older hosts do not report hidden declarations to extensions, and their own default prompt lists those tools too.
|
|
38
|
+
- Development dependencies updated (vite 8.3.6, vue 3.5.45); `npm audit` reports no findings.
|
|
39
|
+
|
|
40
|
+
## [0.5.10] - 2026-10-31
|
|
41
|
+
|
|
42
|
+
- Support Pi 1.4: expand optional SDK peers through `<1.5.0`, pin development SDKs to 1.4.0, and retain Pi 1.3.0 as an explicit historical CI lane. Minimum Pi 0.87.0 and TypeBox 1.3.27 remain unchanged; Pi 1.5+ is not implied.
|
|
43
|
+
|
|
44
|
+
### Behavior change
|
|
45
|
+
|
|
46
|
+
- Tool-policy sync retains already-active tools authorized by the effective set or same-source namespace rule, and registered `deferred`/`codemode` tools unless explicitly denied or removed. Retention does not grant execution access; other external direct tools still leave the active list (missing exposure is treated as direct). This avoids unnecessary tool removals after discovery.
|
|
47
|
+
|
|
48
|
+
- With an active Preset's tool policy, every tool call, including nested codemode calls, must be authorized by Forge's current effective set: `tools.initial` or the policy-derived baseline, plus enabled Capability additions, minus removals, subject to allow/deny. Disabling a Capability revokes execution access for tools no longer authorized; Pi's active tool list is not authorization. No Preset or no restrictive tool policy preserves previous behavior (`initial` alone or `allow: ["*"]` alone does not enable this gate).
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- Block all tool calls while Forge restores tool policy across session startup, tree navigation and compaction, with a retry message; release the restoration fence on both completion and failure.
|
|
53
|
+
- An effective tool `P` now authorizes registered `P__*` descendants from the same registration source, without requiring child names in `allow`. This covers pi-mcp-adapter 6+/7 calls such as `mcp__hitch__<tool>` when `mcp` or `mcp__hitch` is enabled. Different or missing sources do not grant namespace access; Preset deny and Capability remove still block child tools, including exact child exclusions.
|
|
54
|
+
- Blocked calls to tools not currently enabled now point to `forge_capability` when a Capability can provide access.
|
|
55
|
+
|
|
56
|
+
### Known limitations
|
|
57
|
+
|
|
58
|
+
- Codemode `ALL_TOOLS` / `searchTools()` and `tool_search` still reveal unauthorized tool names. Forge blocks execution, not discovery.
|
|
59
|
+
- Codemode `models.generateImages()` / `models.classify()` bypass `tool_call`, so Forge cannot block them; disabling an image Capability does not disable these APIs. Only programmatic SDK assembly with `createCodemodeExtension({ models: false })` disables this codemode model access; Pi settings have no equivalent toggle.
|
|
60
|
+
- On OpenAI Responses/Completions transports, any tool removal, including Capability deactivation that removes tools, makes subsequent requests in that session send the full current tool list because removal detection scans the transcript. This disrupts prefix caching even after re-enabling tools. Anthropic's native `tool_removal` path is unaffected by this fallback. Forge aims to preserve cacheable prefixes where possible, not guarantee cache hits.
|
|
61
|
+
|
|
62
|
+
## [0.5.9] - 2026-10-20
|
|
63
|
+
|
|
64
|
+
- Support Pi 1.1, 1.2 and 1.3: peers become `>=0.87.0 <0.88.0 || 0.99.0 || 0.99.1 || 0.99.2 || >=1.0.0 <1.4.0` and development SDKs pin 1.3.0 (`typebox@1.3.27`). Historical host lanes remain, with 1.0.4, 1.1.0 and 1.2.0 added; Pi 1.4+ and other 0.x versions are not implied.
|
|
65
|
+
- Handle Pi 1.2 custom `before_agent_start` wakes (no `prompt`): `runtime.lastUserMessage` comes once from the current branch's latest non-empty user history, frozen through tool followups until settlement. Ordinary and legacy user events keep their authoritative prompt.
|
|
66
|
+
- Document a known limitation on Pi 1.1 and earlier: idle custom wakes start without `before_agent_start`, so those requests carry no Preset System blocks (unchanged from 0.5.8; use Pi 1.2+ for background completion wakes).
|
|
67
|
+
- Add Pi 1.3 regressions for transcript tool restoration with Preset and Capability policy; packed consumers report the resolved SDK and upstream packages and keep normal npm peer resolution.
|
|
68
|
+
- Fall back to plain status text when Theme formatting is unavailable, including the pi-web-ui 0.103+ prototype-getter regression; preset/tool selection still applies (#3).
|
|
69
|
+
- Handle missing required prompt inputs without an unhandled failure (#2): warn once per session, clear stale compile inputs, decline new preset/profile application, and skip preset compilation/preview. CLI activation preflights command prompt APIs before changing selection/model; already-open Web previews return an unsupported-host error.
|
|
70
|
+
- Early auto-profile settings and preset/tool selection may apply before first-turn prompt compatibility is observed. Detection neither rolls back them nor aborts provider dispatch; Forge keeps applying its tool policy and explicit preset disable remains available. A new session resets detection; tree navigation/compaction do not.
|
|
71
|
+
- Upstream Pi is required: oh-my-pi remains unsupported, and valid options or hook registration cannot prove `context_with_system` availability.
|
|
72
|
+
|
|
73
|
+
## [0.5.8] - 2026-10-03
|
|
74
|
+
|
|
75
|
+
- Keep README images and demonstration media in the repository, not the npm package. Link the accepted EN/ZH demos to immutable GitHub URLs; retain text documentation, examples, compiled code, types and source maps. Restrict package file patterns, reject media/asset entries and tarballs above 2 MiB during package checks, and run those checks automatically in prepack.
|
|
76
|
+
|
|
77
|
+
- Extend optional host peers to Pi 0.99.0, 0.99.1, 0.99.2 and the Pi 1.0 patch series (`>=1.0.0 <1.1.0`; 1.0.0, 1.0.1 and 1.0.2 tested) while retaining the Pi 0.87.x baseline. Pin development SDKs to 1.0.2 and TypeBox to 1.3.27; ordinary platform CI uses current pins and explicit Linux lanes retain older supported hosts.
|
|
78
|
+
- Parameterize packed consumers with `PI_TEST_VERSION` / `TYPEBOX_TEST_VERSION`, default to the coherent installed host, verify installed family versions and use normal npm peer resolution. Pass the selected host through compatibility/latest CI instead of silently packing against 0.87.0. Optional import smoke uses the companion's declared runtime dependency.
|
|
79
|
+
- Document Pi 1.0.1+ Anthropic native tool changes (fixed request-level list, later tools defined inline in `tool_addition`, at least one initial tool required) in the compatibility guide and provider support reference.
|
|
80
|
+
- Refresh the pi-docs slot and add bilingual native MCP/codemode migration notes and focused catalog/System-section regressions. Native MCP names remain exact: stale deny/remove names require review, not automatic aliases. This patch does not change initial/loadout authorization, Capability ownership, models.* access or usage accounting; published 0.5.7 metadata and personal configurations are unchanged.
|
|
81
|
+
|
|
82
|
+
## [0.5.7] - 2026-09-28
|
|
83
|
+
|
|
84
|
+
- Preserve inspection choices through same-Preset draft edits with a clearly marked, paused previous preview. Restore native disclosure state after search/full-text, retain filtered history JSON reading positions, and search historical declaration JSON and named System keys without changing prompt text. Keep the Preset dock physically reachable on short narrow screens.
|
|
85
|
+
|
|
86
|
+
- Collapse individual historical tool declarations to one-line names, description excerpts and explicit top-level argument counts. Expand a declaration to inspect/copy its Preview JSON; unknown schemas do not imply zero arguments. This changes only inspection, not active tools or model context.
|
|
87
|
+
|
|
88
|
+
- Make Preview content-first: readable role-colored excerpts, one-line tool calls/results, and collapsible amber Tools groups with visible call/result/failure counts. Search full displayed text and tool identities, reveal matches, and copy individual tool text. Original projection order remains the default; optional call pairing changes only presentation within safe continuous tool intervals.
|
|
89
|
+
- Add ordered read-only inspection metadata from real compiled content parts, preserving System section operations, historical tool declarations, legacy text/token estimates and Draft/Run diff semantics. Correct duplicated history-slot Preview provenance instead of cross-associating identical call IDs from different slots. Same-data refresh retains reading state; the open Preset dock remains scroll-reachable on narrow screens.
|
|
90
|
+
|
|
91
|
+
- Restore scrolling in Current session: apply the expanded workspace's flex sizing to the correct element and constrain this surface to the viewport at narrow widths. Capability controls and context inspection remain independently scrollable on desktop; the stacked workspace and inspector remain reachable on small screens. Other surfaces retain their existing sizing.
|
|
92
|
+
|
|
93
|
+
## [0.5.6] - 2026-09-27
|
|
94
|
+
|
|
95
|
+
- Make disabled Block/Slot rows visibly neutral as a whole: muted titles, gray side markers and a distinct background remain disabled-looking even when selected. Keep On/Off controls readable and preserve toggle focus for repeated Space/Enter operation.
|
|
96
|
+
- Allow dragging the right edges of the Presets and Stack items panes to adjust their widths, with browser-local preferences, keyboard adjustment and double-click reset. Constrain widths to leave editing space and retain narrow-screen stacking; resizing does not change or save Preset drafts.
|
|
97
|
+
|
|
98
|
+
- Keep Pi's incoming initial System message and its tool declarations at index zero when a Preset places authored messages before explicit or implicit history. Later System updates and Preview provenance remain ordered.
|
|
99
|
+
- Confirm before discarding an unsaved Preset draft on import; preserve newer edits during file reading, resource creation, and reload. Reload reuses a discard confirmation only for the exact confirmed draft revision.
|
|
100
|
+
- Disable Agent Profile draft controls while Save or Validate is pending, preventing edits from being lost when a successful save closes the editor.
|
|
101
|
+
- Preflight surviving Capability tool patches against a prospective Preset before changing selection or retiring bound activations. Conflicting switches leave the current session unchanged and explain how to resolve the conflict; Web activation returns a conflict response. Create-and-activate discovers the new file without selecting it before this check.
|
|
102
|
+
- Apply the same Capability conflict preflight before saving or overwriting the active Preset's live policy. A rejected write returns a conflict without modifying the file or session; inactive resource editing and frozen activation snapshots are unchanged.
|
|
103
|
+
- Report the actual preflight diagnostics for a single invalid auto-activate Profile instead of incorrectly reporting multiple candidates; scope precedence and fail-closed activation are unchanged.
|
|
104
|
+
|
|
105
|
+
## [0.5.5] - 2026-09-26
|
|
106
|
+
|
|
107
|
+
- **New Preset templates:** choose the existing Default Pi prompt, an Empty preset, or Minimal Worker. Empty keeps compiler base-prompt/history fallbacks; Minimal Worker matches the bundled bash/edit example. Template choice does not affect Import/Fork or persist as a schema field.
|
|
108
|
+
- **Capability completion consistency:** unique IDs complete without a scope prefix, while collisions and explicit scope prefixes stay qualified; labels retain resource provenance.
|
|
109
|
+
|
|
110
|
+
- **Breaking Capabilities rename:** Instruction modes are now Capabilities. Use `/capability` with `add`, `list`, `bindings`, `enable`, `enable-bound`, `disable`, `status`, `reset`, and `help`; the Agent tool is `forge_capability` with `list`, `status`, `enable`, and `disable`. Existing development configs must convert to `capabilities` resources and new sessions; old directories, schemas, aliases, and continuing capability state are not supported. This is a breaking compatibility boundary, not a compatibility claim for older published configurations.
|
|
111
|
+
|
|
112
|
+
- **Session prompt-cache usage:** document read-only branch prompt-cache hit rates (turn and session) derived from persisted message usage, separate main vs nested reporting, and the experimental v1 `toolResult.details.forgeNestedUsage` contract.
|
|
113
|
+
- **Current session workspace:** capability/tool controls beside the runtime projection; preserve the separate Preset editor and Preview/Draft diff/Run diff reading state. Quiet background state polling no longer repeatedly reloads the catalog or disables controls. Late reads cannot overwrite a newer visit; navigation retains in-flight mutation receipts.
|
|
114
|
+
- **Reviewed documentation and examples:** adopt bilingual README B and continuous Context/Capability/Draft diff media. Add the small Read-first Worker + Write tools pair: default reading, explicitly authorized model-selected `bash`/`edit`, and documented non-sandbox/ownership limits.
|
|
115
|
+
- **CLI naming:** document `/forge ui`, `/forge payload`, and optional `/forge subagent plan` as the recommended Forge commands; `/capability` is the capability command. `/preset` and `/profile` roots are unchanged. The legacy `/subagent` smoke helper remains distinct from the `/forge subagent` execution-plan command.
|
|
116
|
+
- **Payload capture boundaries:** document `next save="path with spaces.json" [--overwrite]`, `status`, and `cancel`; capture is taken at `before_provider_request`, does not itself call a model, and does not overwrite without the explicit flag. Cancellation only clears pending capture state, not retained history.
|
|
117
|
+
- **Command-contribution source surface:** Forge 0.5.5 provides the intentional `@zihanw/pi-forge/command-contribution` entry from `src/command-contribution/index.ts`: synchronous local discovery, callback metadata, explicit unsubscribe, main-owned `/forge` root, and fail-closed duplicate children. It has no singleton registry, persistent format, or authorization boundary. The optional package remains an independent upcoming release and must raise its Forge dependency floor to `^0.5.5`; no optional publication is implied here.
|
|
118
|
+
- **Provider support snapshot:** add bilingual docs recording, for Pi 0.87.1, how each API sends mid-conversation system updates and tool changes, which catalog models were flagged, and observed cache behavior. README and the capability reference explain that the current model's catalog flags choose native or fallback delivery.
|
|
119
|
+
- **Delegation distinction:** document that `/forge-agent run` always requests approval and may write through its backend, while model-callable `forge_subagent` unattended authorization is separate.
|
|
120
|
+
|
|
121
|
+
- Tool-only Capabilities (empty or whitespace-only text) no longer project an empty instruction update, removal notice, or compaction checkpoint section in native or fallback delivery; their tool changes are unchanged. Current session hides Locate for them, and the Agent `enable` reply says no instruction text is sent.
|
|
122
|
+
- Preserve Capability edits made during a pending create/save or subsequent catalog refresh; follow-up saves use the exact write's revision receipt. Cancelling a pending refresh releases its busy state.
|
|
123
|
+
- Persist the original tool baseline for `tools.initial`-only Presets, so rebuilding from a filtered tool set can still restore that baseline when the Preset is disabled.
|
|
124
|
+
- Retain a continuous suffix of ordinary history under `maxChars`, while continuing to preserve necessary instruction control messages beyond the trimming boundary.
|
|
125
|
+
- Keep Preview panel width/focus unchanged when switching Preview, Draft diff and Run diff. Focused reading is entered explicitly.
|
|
126
|
+
- Specify that `tools.initial` delegation requires the matching optional subagents fix; the explicitly published optional 0.5.3 build cannot validate this selection. This is an optional-package compatibility gate, not a gate on the main Forge 0.5.5 release. See the host-port compatibility note.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
- **On-demand tool loadouts:** Presets can opt into `tools.initial` (concrete tool names; `[]` means zero defaults). Omission preserves legacy behavior; existing allow/deny remains the hard ceiling. Authorized capabilities add permitted registered tools, and disable/reset recomputes from defaults plus remaining capabilities. Live execution, Preview and subagent preparation agree; source edits never replace frozen capability snapshots. Older Forge readers do not understand this new selection field.
|
|
130
|
+
- **Source-grouped tool selection and binding UX:** One searchable, collapsible picker batches the current extension/source tools into ordinary literal tool-name arrays; no permanent package bindings or automatic future-tool grants. Preset bindings move out of metadata to a peer **Capability bindings** tab, with overrides/source-effective details collapsed. Default-tool selection is opt-in. Cross-preset draft ownership, authoritative scoped identity, resource response ordering and baseline-vs-capability default seeding are guarded. Saving a capability never activates it; saving an active Preset refreshes that Preset's policy. Catalog refresh preserves literal selections without auto-selecting new package members; payload polling ignores obsolete responses after a newer capture or mutation.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Added
|
|
134
|
+
|
|
135
|
+
- **Capabilities and session update CLI.** Session-scoped dynamic capabilities and manual directives via `/capability` (`add`, `list`, `bindings`, `enable`, `enable-bound`, `disable`, `status`, `reset`). Capabilities are stored as JSON definitions (`schemaVersion: 1`, `type: "pi-forge.capability"`) under `.pi/forge/capabilities/` or `~/.pi/forge/capabilities/`. Direct `enable` enables an unbound capability; `enable-bound` enables an authorized Preset binding.
|
|
136
|
+
- **Preset capability bindings.** Declarative `capabilities` configuration in Presets supporting qualified capability references (`project:<id>`, `global:<id>`), unique binding IDs (control calls accept IDs ≤128 chars), opt-in Agent authorization (`modelCallable: boolean`), and finite overrides (content replacement or paragraph append with two newlines; tool additions/removals array replacement or explicit empty clear).
|
|
137
|
+
- **Restricted model-callable Agent control.** The `forge_capability` tool accepts only `{ action: "list" | "status" | "enable" | "disable", id?: string }` (ID ≤ 128 chars). It rechecks project trust, active Preset, binding identity, `modelCallable: true`, and current tool policy on every call. The Agent cannot stop human-owned rules, reset, add arbitrary rules, or disable `forge_capability`. Repeated use is idempotent and never performs automatic owner takeover.
|
|
138
|
+
- **Web editor Capabilities surface (CRUD).** Dedicated bilingual Capabilities surface for creating, editing, and deleting scoped capability files in project and global libraries. Operations require `sourceRevision` checking against raw file bytes; 409 Conflict on stale views preserves local drafts. Capability saves never activate definitions in the session.
|
|
139
|
+
- **Preset Capability bindings editor.** Dedicated peer tab in the Preset editor for configuring qualified references, binding IDs, `modelCallable` toggles, and finite overrides, with live side-by-side source vs effective preview resolved through the shared server resolver.
|
|
140
|
+
- **Web session capabilities activity panel and human activation picker.** Non-modal Current session workspace reached from navigation or the global summary, pairing capability/tool controls with the active saved Preset/session projection for inspecting active session capabilities, actor attribution (`user`/`agent`), collapsible frozen snapshots, tool deltas, effective tools, delivery status (`none`, `pending`, `prepared`), and presentation mode. Includes a guarded human activation picker with available capability choices (`GET /api/capability-state/available`) and guarded activation (`POST /api/capability-state/enable`) requiring session/leaf/revision and content fingerprint validation, rejecting stale state (409 Conflict) without automatic retry or inference.
|
|
141
|
+
- **State concurrency guarding and conservative polling.** The Web panel polls `GET /api/capability-state` every 3 seconds only while visible, upon window focus, or via manual refresh without LLM inference. Web mutations require project trust (`isProjectTrusted()`), returning 403 on untrusted sessions with CLI recovery retained. Mutation requests enforce derived guards (`sessionId`, `leafId`, `revision`, runtime generation) to reject stale browser views (409 Conflict); errors and conflicts halt mutations for manual review rather than blindly retrying.
|
|
142
|
+
- **Local execution without inference.** Capability operations (`/capability` and Web activity panel actions) execute locally without invoking LLM inference or consuming paid API tokens. Active instruction text continues to consume input tokens on subsequent model requests when inference occurs. Read-only resource discovery and Preview never mutate tool policy, commit session events, or mark pending capabilities prepared.
|
|
143
|
+
- **Request-boundary tool and prompt synchronization.** Immediate executable tool synchronization (`setActiveTools`) pairs with next-request prompt text and SystemMessage section or user update delivery. Running tool batches are not interrupted mid-flight. Capability definitions are captured as immutable snapshots, preventing disk drift.
|
|
144
|
+
- **Pure metadata capability delivery anchors.** Delivery markers are stored as plain `custom` session entries using the same delivery type (`pi-forge-capability-delivery`) carrying strictly cursor-only metadata (`schemaVersion: 1`, `throughEventId`). They replace previous `sendMessage` steering and dialogue-polluting `custom_message` carriers. Anchors are committed immediately when idle, deferred safely until running tool batches complete, or committed at `agent_end` after the assistant's final response when no Forge context failure or incomplete batch remains, without enqueueing an extra model turn. UI status notifications (`ctx.ui.setStatus`) are decoupled and never enqueue turns to the model.
|
|
145
|
+
- **Pre-compilation ordinal materialization and rule projection.** Context assembly (`prepareCapabilityMessages`) materializes before Preset compilation plain metadata anchors into ephemeral in-memory markers at their exact ordinal session positions before rules are projected (`projectCapabilityMessages`) into request-only native `SystemMessage.sections` or fallback attributed user updates.
|
|
146
|
+
- **Parent safeguards.** Enforce raw source/revision coherence (GET returns editable data and revisions from same raw bytes), external new bindings stale-save detection on binding-bearing Preset saves, and lifecycle/re-entry fences (`disposed`, `lifecycleRevision`, `sameContext`) blocking cross-session pollution or operations after session disposal.
|
|
147
|
+
- **Fail-closed extension rewrite protection.** Preceding extension message rewrites are a legitimate Pi SDK capability, but because Forge requires unique ordered correspondence between session context entries and incoming context messages, incompatible or ambiguous preceding rewrites cause Forge to fail closed safely rather than misattributing anchors. Users may adjust extension order or behavior as an operational workaround; Forge does not guarantee post-extension rewrite safety, generic plugin compatibility, prompt cache retention, warming, or automatic overflow handling.
|
|
148
|
+
- **Breaking pre-release session boundary.** Former instruction-mode delivery carriers and continuing capability state have no compatibility reader. Forge does not rewrite old JSONL or historical summaries; convert configuration and start a new session.
|
|
149
|
+
- **Session event recovery and branch coherence.** Semantic events and derived delivery cursors enable state reconstruction across session reloads, manual compaction checkpoints, and tree branch navigation, verified offline via local SDK test harnesses.
|
|
150
|
+
- **Fail-closed shadowing and literal rule isolation.** Bare capability selectors resolve project-over-global; invalid local capability definitions fail closed rather than falling back to global. Content is evaluated strictly as literal text without macro or script execution.
|
|
151
|
+
|
|
152
|
+
### Fixed
|
|
153
|
+
|
|
154
|
+
- **Node 22 nested-test lifecycle and portable permission fixtures.** Parent tests now await nested `t.test` calls so Node 22 does not cancel unfinished children. Targeted EACCES/EPERM fixtures replace non-portable `chmod` assumptions without dropping permission-error assertions.
|
|
155
|
+
- **Windows browser fixture serialization.** Browser fixture imports are serialized and Windows path handling is normalized so cross-platform fixture tests do not depend on platform-specific module paths.
|
|
156
|
+
|
|
157
|
+
- **Empty capability binding catalog.** Adding a Preset binding no longer invents an `unavailable-UUID` reference when no eligible capabilities exist. Global Presets remain limited to global capabilities. Loading, catalog errors and known-invalid definitions disable Add without dirtying the draft; bilingual empty-state guidance, retry and refresh support creating a capability in the library and updating source/effective previews. Existing missing references remain visible for explicit repair.
|
|
158
|
+
|
|
159
|
+
- **Keep Agent inspection replies out of rule-body history.** `forge_capability` list/status return identities, authored descriptions, ownership and tool/status metadata, not copies of full instruction bodies. Rules remain request-only projections; human CLI/Web inspection still shows full snapshots. Real SDK control-call and summarizer tests cover the distinction. Genuine dialogue or descriptions quoting rules are not stripped.
|
|
160
|
+
|
|
161
|
+
### Changed
|
|
162
|
+
|
|
163
|
+
- **Preview text/metadata separation.** Keep actual System prose and named-section values separate from historical tool declarations; show draft-relative selected tools independently, hide only genuinely empty projected System cards, and retain structural-only changes in Draft diff. After the final overlay is stopped, tool previews use the restored live selection rather than captured filtered options. Text estimates exclude tool schemas. Group only consecutive history runs so intervening instruction updates retain their chronological position.
|
|
164
|
+
- **Capability-aware Preview.** Compile the selected Preset draft with current session capability snapshots using the existing pure projection. Render native sections, stop notices and tool declaration changes; do not leak cursor-only metadata anchors or mark previewed instructions prepared. Preserve message provenance/order and remove the 8,000-character copy-text cutoff. Existing summaries and compaction behavior are unchanged.
|
|
165
|
+
- **Tool policy coordination and boundaries.** Active capabilities participate in Forge's single tool-policy runtime: additions are subject to top-level Preset deny policies, removals take global priority across active capabilities, and session baseline tools are restored conservatively upon disable. Capabilities support `add` and `remove` ONLY; candidate `only`/allowlist is not implemented.
|
|
166
|
+
- **Provider-managed cache warning.** Prompt caching and tool transport are downstream provider-managed; conservative warnings apply without promises of zero KV cache invalidation or exact cache hits.
|
|
167
|
+
- **Upstream Pi 0.87 migration.** Forge now runs its full compiler/base/capability pipeline in `context_with_system`, because ordinary `context` hooks no longer receive System messages. Live anchor placement and read-only Preview use canonical `buildSessionProjection`, including context-edit omissions/replacements and branch provenance; raw history remains unchanged. Idle prefix anchors stay after the incoming leading System. Compile inputs survive low-level `agent_end` and clear only at `agent_settled`, preserving Presets during `agent_before_settle` continuations. Real SDK regressions also cover automatic retry omissions with pending rules and original history retained.
|
|
168
|
+
- **Supported Pi line: 0.87.x.** All four host-provided optional Pi peers now require `>=0.87.0 <0.88.0`; development and packed-install checks use 0.87.0. Pi 0.86 is no longer supported by this development slice, and future minor versions are not implicitly accepted. Forge 0.5.5 requires this range; OMP compatibility is not promised.
|
|
169
|
+
|
|
170
|
+
### Note
|
|
171
|
+
|
|
172
|
+
- **0.5.5 functional source delivery.** Functional source is delivered across all planned main-package lanes: foundation codecs, human CLI core, plain metadata anchors, Web Session capabilities panel and human activation picker, live Preset bindings, restricted Agent control (`forge_capability`), Web Capabilities CRUD, Preset binding editor with finite overrides, and parent safeguards (raw source/revision coherence, external new bindings stale-save detection, lifecycle/re-entry fences). Compaction checkpoints remain placed after the leading system prompt and before summary (placement unchanged; the upstream Pi metadata chunking bug remains independent and unfixed). SDK summarization input characterization confirms summarizers observe user, assistant, and peer dialogue without metadata anchors or request-only Forge rule text, characterized offline with fake test responses that do not constitute remote LLM semantic validation. Local build and full verification passed at the accepted 2026-09-24 UI closeout (`89c6ba2`), without claiming a remote-provider matrix; release verification is tracked separately. These results do not imply remote-provider acceptance or optional-package/runtime publication.
|
|
173
|
+
|
|
174
|
+
## [0.5.4] - 2026-09-12
|
|
175
|
+
|
|
176
|
+
### Added
|
|
177
|
+
|
|
178
|
+
- **Prompt-cache impact warning on preset/profile switch.** `/preset use` and `/profile use` now estimate the cache cost before switching: when the next preset's compiled system prompt differs from the current one, a non-blocking notice reports the shared prefix (`~X tokens (N%)`), the history that will be re-processed, and the previous request's `cacheRead` when known. Identical prompts, model-only switches, and sessions without a compiled request yet stay quiet.
|
|
179
|
+
- **Cache-sensitive compile diagnostics.** Compilation now warns when an enabled item uses `{{time}}`/`{{runtime.time}}` (changes every turn, invalidating the prompt-prefix cache from that item onward) or when a `date`/`date-cwd` slot enables `options.includeTime`; `{{date}}`/`{{runtime.date}}` produces an informational note (daily rebuild, stable within the day). Disabled items stay silent; duplicate emissions across compile paths are deduplicated.
|
|
180
|
+
- **Preview readability.** Preview groups chat-history messages by source with collapsible sections, and colors messages by role (system/user/assistant/toolResult).
|
|
181
|
+
- **Item list kind colors.** Blocks and slots get distinct badge colors, with per-semantics colors for built-in slots (chat-history, tools, tool-guidelines, skills, project-context, date, date-cwd) in both light and dark themes.
|
|
182
|
+
|
|
183
|
+
### Fixed
|
|
184
|
+
|
|
185
|
+
- **Item options JSON save desync.** A JSON parse error while editing item options left a sticky error state that kept blocking saves after the text was reset to valid JSON (the "type a space to save" workaround). Mode switches now clear the error state in both directions; non-object JSON (arrays, scalars, `null`) is rejected explicitly; the `roles`/`maxMessages`/`maxChars` inputs sync on input instead of on blur, so Ctrl+S right after typing no longer loses the value; and saving no longer resets the selected item and editor mode.
|
|
186
|
+
|
|
187
|
+
## [0.5.3] - 2026-09-01
|
|
188
|
+
|
|
189
|
+
### Changed
|
|
190
|
+
|
|
191
|
+
- **Preset and Stack terminology.** The complete user-facing resource is now a **Preset**, while **Stack** means its ordered Block/Slot composition. The former whole-resource Stack settings tab is now **Advanced**. English and Chinese editor labels, commands, diagnostics, profiles, documentation, and examples use the same hierarchy.
|
|
192
|
+
- This patch intentionally keeps compatibility identifiers unchanged: `.pi/forge/prompt-stacks/`, `"pi-forge.prompt-stack"`, profile field `promptStack`, `/api/stacks`, wire contracts, and internal `PromptStack` type names do not migrate.
|
|
193
|
+
|
|
194
|
+
### Fixed
|
|
195
|
+
|
|
196
|
+
- Preview now recovers the pre-policy session tool baseline when captured prompt options were already filtered by the active Preset. Previewing another draft therefore restores its selected tool names, fills missing tool text from registered descriptions, and rebuilds the matching tool guidelines instead of showing empty or stale tool context.
|
|
197
|
+
|
|
198
|
+
## [0.5.2] - 2026-08-28
|
|
199
|
+
|
|
200
|
+
### Added
|
|
201
|
+
|
|
202
|
+
- **Optional consecutive-role message merge.** Stacks can set `context.mergeConsecutiveRoles: true` (plus an optional `context.mergeSeparator`, default a blank line) to compile runs of consecutive stack items that share the same declared role into a single provider message. Only stack-authored `user`/`assistant` items merge: chat-history output (including the implicit history tail and a trailing user history message) and custom-role items are hard boundaries, and merging runs after compiled-stage regex so existing rule semantics are unchanged. Preview reflects the merged layout and attributes merged messages to their source items ("A + B"). The web editor's Stack tab exposes both options.
|
|
203
|
+
- **System-position validation warning.** Stack validation now warns when an enabled `system` item appears after enabled non-system items, since item position across the system/message channels has no effect on compilation. Roles are never silently converted; the warning suggests a user-role item for in-conversation injection.
|
|
204
|
+
- **Per-rule regex frequency.** Regex rules accept `frequency: "turn" | "request"` (default `"turn"`, preserving prior behavior). Outgoing message rules with `"request"` also run on tool-result follow-up requests over Pi's full natural context — closing the gap where tool output (for example an API key returned by a tool) reached the provider unfiltered until the next user turn. Wire-consistent by construction: each request is rebuilt from the transcript, so re-application never doubles. `finalize` rules and system-only targets ignore `frequency` with a validation warning. The regex editor exposes the field, and preview notes that follow-up applications are not represented.
|
|
205
|
+
- **Finalize rules can scrub stored tool results.** A `finalize` rule whose `roles` explicitly includes `"toolResult"` now rewrites stored tool-result messages at `message_end` — before the follow-up request, so the wire inherits the scrubbed transcript. Rules without `roles` keep assistant-only behavior; user messages are never finalized. The `hack-prompt-stack.json` example demonstrates the wire-plus-transcript pair (`redact-api-keys-outgoing` with `frequency: "request"` + `redact-api-keys-finalize`) for two illustrative token shapes; regex redaction is not an exhaustive secret scanner.
|
|
206
|
+
|
|
207
|
+
- **Web editor localization.** The editor interface is available in English and Chinese: a language selector in the top bar (Auto / English / 中文) writes `webEditor.locale` in the project config, `"auto"` (default) follows the browser language, and the initial page render honors `Accept-Language`. Navigation, the stack workspace chrome, all built-in stack/profile tabs, the preview/diff dock, and the generic settings form renderer are localized with instant switching; contributed settings tabs remain provider-owned and are not translated, and compiler/server-generated diagnostics stay in English.
|
|
208
|
+
|
|
209
|
+
### Fixed
|
|
210
|
+
|
|
211
|
+
- The settings status no longer compares localized placeholder text to decide when to show "Settings ready", so the contribution surface behaves identically in both interface languages.
|
|
212
|
+
|
|
213
|
+
## [0.5.1] - 2026-08-23
|
|
214
|
+
|
|
215
|
+
### Added
|
|
216
|
+
|
|
217
|
+
- **Cross-platform release CI.** The complete verification surface, including
|
|
218
|
+
the real-browser editor suite and packed-install smoke, now runs on GitHub's
|
|
219
|
+
macOS and Windows hosted runners in addition to Linux. Generated TypeScript
|
|
220
|
+
output and repository text files are pinned to LF so tracked `dist/` checks
|
|
221
|
+
remain deterministic across operating systems.
|
|
222
|
+
- **UI contribution framework (Lane 1).** Optional packages can now contribute schema-driven configuration pages to the web editor without shipping any UI code into the main package:
|
|
223
|
+
- New versioned `@zihanw/pi-forge/ui-contribution` entry point: a generic RPC contract over the Pi event bus (`UI_CONTRIBUTION_PORT_VERSION = 1`, with its own version counter separate from the `/subagent` host port) exposing exactly two operations — `listContributions` and `writeValues` — over discover/available/request/reply/unavailable channels. Wire messages carry `hostId` + `generation` binding, version negotiation (`minVersion`/`maxVersion`), bounded discovery timeouts, explicit duplicate-provider failure, and recursive JSON-compatibility validators. All payloads are plain data: no functions, components, or live contexts cross the bus. See the [UI contribution port contract](docs/reference/ui-contribution-port.md).
|
|
224
|
+
- Web server routes: `GET /api/contrib` returns discovered tab descriptors at page load, and `PUT /api/contrib/<tabId>` proxies submitted values to the contributing package over the bus. The forge side is fully generic and knows nothing about subagents; it never owns the schema, validation, or persistence of contributed tabs (the provider writes its own config files), and with no provider discovered there is no contributed tab and zero cost.
|
|
225
|
+
- Contribution discovery tolerates provider churn across sessions: providers that appear after startup surface their tabs, departed providers are cleared, and service stop cancels pending discovery.
|
|
226
|
+
- Data-driven stack-tab registry replaces the stack editor's hardcoded `"policy" | "regex" | "stack"` tab union. Built-in tabs keep their existing hosts (including the legacy imperative items workspace as an ordinary tab), while contributed configuration renders through a self-contained host on a separate top-level **Settings** surface.
|
|
227
|
+
- Generic schema-form renderer: a self-contained Vue component bridged via the vue-host mechanism, covering deliberately restricted v1 field types — boolean, number, enum, string, plus a record/table shape for keyed per-entry lists. Record identities may use live catalog-backed `keyOptions`, while validation and persistence remain provider-owned. No imperative code was added to `legacy-editor.ts`.
|
|
228
|
+
- **Context diff — per-turn prompt observability (Lane 2).** Consecutive real provider requests are diffed automatically so KV-cache reuse is observable:
|
|
229
|
+
- Host-neutral pure engine (`src/context-diff.ts`): `TurnSnapshot`/`TurnDiff` shapes, block classification (`same`/`added`/`removed`/`modified`) aligned by stable content-derived keys with positional fallback, and a prefix-walk cache-boundary algorithm that walks matching block hashes and trims the char-level common prefix inside the first mismatched block — no Myers diff. Token figures are chars/4 approximations: relative deltas are accurate, and absolute boundary claims are labeled approx in the UI.
|
|
230
|
+
- Automatic per-turn capture: every provider request enters a rolling history of the last 20 turns (not just manually armed captures), and each new snapshot is auto-diffed against the previous turn. Block hashes cover role and serialized wire-relevant fields, and request-level sections (tool definitions and similar) participate as blocks so wire changes break the cache boundary faithfully.
|
|
231
|
+
- `GET /api/context-diff` serves the latest snapshot, the previous-turn diff, and summary rollups (added/removed/net tokens, prefix tokens and ratio).
|
|
232
|
+
- Preview/diff dock: the preview modal is promoted into a wider right-side panel with three focused views — **Preview** (the live compiled draft), **Draft diff** (the unsaved draft against the saved stack), and **Run diff** (the latest captured provider turn against its predecessor). Diff views hide unchanged blocks by default, show modified blocks in Before/After columns, keep run/cache metadata collapsed until requested, and offer **Focus/Split** controls to use the full editor width without permanently crowding stack editing. The panel is a self-contained Vue component riding Lane 1's data-driven registry; no imperative code was added to `legacy-editor.ts`.
|
|
233
|
+
|
|
234
|
+
### Fixed
|
|
235
|
+
|
|
236
|
+
- Preview/Draft/Run diffs now render git-style unified or split line views with old/new line numbers, inline changed spans, and changes-only/three-line/all-line context controls. Chars/4 figures are labeled strictly as estimates. Each captured provider request is correlated with its completed assistant message, so Run metadata shows Pi's actual input/output/cache-read/cache-write usage and a provider-reported cache-hit rate when cache reporting has been observed; otherwise it says the rate is not reported instead of presenting a synthetic zero.
|
|
237
|
+
|
|
238
|
+
- Schema-driven record settings can now provide catalog-backed `keyOptions`, rendered as a duplicate-safe selector instead of a free-text identity field. UI-contribution handlers may resolve asynchronously, allowing optional packages to refresh host-owned catalogs before returning a schema or validating a write; stale replies are suppressed if that provider generation stops while the handler is pending.
|
|
239
|
+
|
|
240
|
+
- Selective stack tool allow lists now select from Pi's complete registered tool catalog, so built-in inactive tools such as `grep`, `find`, and `ls` can be activated by a stack and are restored to their prior inactive state when the policy is removed. Allow lists containing `*` remain on the active baseline and do not expand to every inactive tool. The web editor now states the active-vs-registered distinction explicitly.
|
|
241
|
+
- The docked Compiled preview now consumes the editor's current in-memory stack draft, refreshes from actual draft-change notifications, aborts superseded requests, and no longer silently previews the saved disk version while unsaved edits are visible.
|
|
242
|
+
- Plugin configuration no longer mounts inside the stack Preview dock. Contributed pages now live on an independent top-level **Settings** surface, so switching between Stack Preview and Subagent Settings cannot unmount or constrain the settings form.
|
|
243
|
+
- Preview now owns a dedicated DOM mount instead of sharing the legacy stack-tab panel, so saving or selecting another stack cannot leave an active-but-empty dock. Draft changes immediately invalidate visible compiled output, Preview and Run requests both reject superseded responses, and browser tests cover save/selection plus controlled delayed-response races.
|
|
244
|
+
- Settings autosaves are serialized per contribution host and replay the newest full form snapshot after an in-flight write, preventing a slow older PUT from overwriting a newer edit while the UI reports `Saved`. Drafts and save status are retained independently per Settings page during rapid tab switches, while a forge-owned monotonic provider-session key forces clean forms to remount with fresh schema and values after fast provider churn. PUT results are bound to the provider session that received them, so a delayed old-session success retries the preserved draft instead of overwriting the new session. Duplicate contribution IDs are ignored after the first descriptor and Settings button IDs cannot collide with built-in stack tabs.
|
|
245
|
+
- Compiled draft diffs align messages with stable source keys rather than positional `message-<index>` IDs, avoiding cascades of false modifications after insertions. Split Preview and top-level Settings collapse to usable single-column layouts on narrow screens without document-level horizontal overflow.
|
|
246
|
+
- The stack editor now keeps the Project/Global selector attached to **New stack** instead of stretching it across a full row, leaves only primary actions in the toolbar, moves infrequent capture/import/export/delete actions into **More**, and compacts the status, metadata, tab, sidebar, and item-list chrome so editing and Preview/Diff receive substantially more viewport space.
|
|
247
|
+
- The profile editor now keeps the canonical `global:<id>` selector visible in list, summary, edit heading, and save status. Profile JSON continues to store a bare schema ID and same-scope prompt-stack references relatively; their global identity is carried by storage scope and is no longer visually lost in the editor.
|
|
248
|
+
- Context-diff fidelity (architecture review F1–F3/F6 and re-review R1–R4): block hashes are computed from the faithful redacted serialization rather than the lossy capture projection, preserving provider field order for request-level blocks; blocks align by stable unique keys so insertions before existing messages classify correctly; token rounding is conservative and consistent so per-block chips cannot contradict summary totals; and the empty Diff view reflects automatic per-turn capture instead of instructing manual arming.
|
|
249
|
+
- UI-contribution hardening (F4/F5/F7): a partial-patch `writeValues` success no longer clobbers cached descriptor values with stale data; contribution lifecycle handles late-surfacing and departed providers and cancels pending discovery on stop; malformed or oversized `/api/contrib` request bodies return 400/413 instead of surfacing raw validator failures.
|
|
250
|
+
|
|
251
|
+
## [0.5.0] - 2026-08-21
|
|
252
|
+
|
|
253
|
+
### Planning
|
|
254
|
+
|
|
255
|
+
- Replaced the proposed six-phase 0.5.0 plan with the accepted [lean 0.5.0 architecture plan](docs/design/architecture-0.5.md). The original full proposal and Phase-0 evidence are archived under [docs/design/archive/0.5-full-proposal/](docs/design/archive/0.5-full-proposal/README.md) and remain the long-term target.
|
|
256
|
+
- Accepted lean 0.5.0 decisions: complete SillyTavern removal; mutable-variable removal; `forge-v1` with a redesigned pure trusted-extension port; regex `display`/`both` removal while `finalize` is retained under lifecycle-adapter ownership; minimal repositories/codecs with fingerprint and atomic writes deferred; minimal `ForgeWorkspace`; versioned `/subagent` host port with mandatory lifecycle semantics; optional `pi-forge-subagents` package without main-package delegation UI and with dedicated `subagents.json` files; explicit root default, root named extension API, and `/subagent` surfaces.
|
|
257
|
+
|
|
258
|
+
### Removed
|
|
259
|
+
|
|
260
|
+
- SillyTavern importer, `/preset import-silly`, its reports, guide, example, and tests are removed. 0.4 is the last supported conversion path.
|
|
261
|
+
- Mutable turn/session variable stores, `pi-forge-variable-state` session entries, set/get/clear variable macros, and the `variables` slot are removed. Static reusable values now live on stack `parameters` in schema v2 or legacy `variables` in v1.
|
|
262
|
+
- Regex `display` and `both` effects are removed and rejected as validation errors; only `outgoing` and `finalize` remain.
|
|
263
|
+
- **Breaking (Lane 4b): legacy package surfaces.** All `@zihanw/pi-forge/src/*` compatibility aliases and the `./examples/*` subpath export are removed. The package root now exports exactly the default Pi extension factory plus `registerMacro`/`registerSlot` and their contract types (`PromptEnvironment`, `PromptRenderHelpers`, macro/slot definition and renderer types, option-schema types, and the trusted project extension API types). `@zihanw/pi-forge/subagent` is the only other entry point. `check-package` enforces the allowlist and forbids legacy aliases.
|
|
264
|
+
|
|
265
|
+
### Changed
|
|
266
|
+
|
|
267
|
+
- Prompt compilation uses the `forge-v1` parse/analyze/render engine with a frozen `PromptEnvironment` (`runtime.*`, `parameters.*`, `extensions.*`). Preview, runtime, and subagent preparation share the same compiler entry.
|
|
268
|
+
- `registerMacro` and `registerSlot` move to a pure-contract extension port with immutable `env`, declared dependencies, bounded output, and strict undefined-path errors.
|
|
269
|
+
- Prompt-stack schema v2 introduces immutable `parameters`; unversioned/v1 stacks continue to read through the legacy `variables` field.
|
|
270
|
+
- `finalize` regex remains lifecycle-owned and is excluded from preview, which now reports an informational diagnostic.
|
|
271
|
+
- Legacy 0.4 nested macro syntax (for example `{{upper::x}}`, `{{json::...}}`, `{{iftools::...}}`) is no longer executed by the compiler and must migrate to forge-v1 syntax.
|
|
272
|
+
- Compiler/extension conformance (Lane 1d): custom slots share the pure `{ item, options, env, helpers }` contract with declared `dependencies` and the 16,384-character output limit; `env.extensions` is resolved for slots; a shared dependency analysis and one compilation context keep preview/runtime/subagent consistent; extension values resolve lazily per active branch; nested `{% if %}` and empty-string comparisons are supported.
|
|
273
|
+
- Subagent extraction (Lane 3): the `forge_subagent`/`/forge-agent` execution surface, the web-editor delegation UI, and all subagent configuration reads/writes are removed from the main package and move to the optional `@zihanw/pi-forge-subagents` package, which discovers the active host through the versioned `/subagent` port and owns its own `subagents.json`. Packed-install smoke tests cover main-only and main-plus-optional installs (`check:packed`).
|
|
274
|
+
- Host-neutralization (Lane 3.5): the prompt compiler's rendering and preflight contract is fully host-neutral (capability-driven, no subagent-specific branches), `ForgeWorkspace` is the single owner of resource state and compilation contexts (no second loader/registry path), and subagent documentation/configuration alignment was completed for the optional package split. The packed-install smoke was made portable across checkouts.
|
|
275
|
+
- Forge-native host contract (Lane 4a): the main package no longer depends on `@zihanw/pi-subagent-runtime` at all. `@zihanw/pi-forge/subagent` is now exactly the minimal Forge DTO host contract — host-port wire messages, recursive validators, transport, client/host lifecycle, and Forge-owned canonical fingerprint helpers (byte-compatible with the runtime's `sha256:v1` canonical JSON, pinned by golden vectors). The 0.4 execution contract (request, preflight, plan, response, context budgeting, tool negotiation, and validators) moves to `@zihanw/pi-forge-subagents` with names unchanged, importing portable leaves from the runtime directly. Host-owned preparation no longer synthesizes runtime request/preflight/prompt-runtime artifacts: the workspace resolves the profile and stack from its snapshot, filters the client tool catalog through stack policy, and compiles through the shared compilation context directly. **Breaking:** the package root no longer re-exports subagent contract or host-resolution names (the `/subagent` entry point is the only subagent surface); client-side snapshot validation keeps structural and fingerprint checks while deep profile schema validation remains host-owned.
|
|
276
|
+
- Minimum repositories and codecs (Lane 2a): prompt-stack and agent-profile parse/normalize/validate/serialize are centralized in `src/codecs/`, and reads, writes, and deletes all go through scoped repositories (`src/repositories/`) with containment and symlink checks; the loaders and profile service delegate to the repositories, so domain resources are never read or written directly at the adapter layer. Replacement semantics are unchanged and characterized by tests (no fingerprint conflict or atomic replace yet). Legacy stack migration is a documented byte-preserving exception whose raw IO lives inside the repository.
|
|
277
|
+
- ForgeWorkspace and host port v1 (Lane 2b): a minimal `ForgeWorkspace` snapshot owner (genuinely immutable, deep-frozen snapshots) over the repositories/codecs, plus a versioned `@zihanw/pi-forge/subagent` host-port protocol over the Pi event bus with the three minimal operations (discovery, profile listing, prepare). Mandatory lifecycle semantics are enforced and covered by tests: bounded timeouts, explicit duplicate-host failure, `hostId`+`generation`-bound request/reply so stale/foreign requests are rejected, disposal/`unavailable`, listener cleanup, host-owned prompt preparation (client sends only profile selector + task + backend facts), and recursive JSON-compatible operation validators. The host is wired into the real extension lifecycle via `pi.events` (host can only start after the first snapshot exists, so availability implies a loaded workspace; `reload` honors project trust; disposal runs before subagent teardown; the base system prompt is host-owned and empty for delegated subagents), with integration tests that discover, list, prepare, and observe disposal through the published `/subagent` surface — including that the host is not advertised before any session start. Operation validators are strict and recursive: exact nested field sets, typed enums, plain-object-only JSON compatibility, and unknown-field rejection — so `allowProcess` is the only process fact and no runtime access/limit/execution material crosses.
|
|
278
|
+
|
|
279
|
+
- Documentation and migration notes (Lane 4d): the [public API policy](docs/reference/public-api.md) was rewritten for the three intentional entry points; the 0.4 subagent adapter contract reference was replaced by the [subagent host port contract](docs/reference/subagent-host-port.md); the [0.5 migration guide](docs/guides/migrating-to-0.5.md) now covers Lanes 1–4 with a [zh-CN translation](docs/zh-CN/guides/migrating-to-0.5.md); README, setup, getting-started, web-editor, features, and configuration docs were aligned with the optional-package split (EN + zh-CN).
|
|
280
|
+
|
|
281
|
+
- Strengthened the `/subagent` host-port DTO types (code-review follow-up, no wire-behavior change): `ForgeResolveProfileResponse.snapshot`, `ForgePrepareResponse.messages`/`diagnostics`/`profileSnapshot` are no longer `unknown`. New exported types: `ForgeProfileSnapshot`, `ForgeWireAgentProfile`, `ForgeWirePromptStack`, `ForgeDelegationMessage`, `ForgeDelegationDiagnostic`, `ForgePromptDependency`/`ForgePromptDependencyKind`, `ForgeListProfilesResponse`, `ForgeHostWireMessage`, and a generic `ValidationResult<T>`; the recursive validators now return typed data. Runtime validation is byte-compatible with 0.5.0.
|
|
282
|
+
|
|
283
|
+
### Fixed
|
|
284
|
+
|
|
285
|
+
- Profile auto-activation now honors project-over-global shadowing: a global `autoActivate` profile whose ID exists in project scope no longer activates, matching `chooseAutoActivateStack` semantics (0.5.x review A1). Regression test covers explicit opt-out and implicit shadowing.
|
|
286
|
+
- The fresh-session startup branch now evaluates auto-activation requests with the same shadow-aware candidacy (A1 follow-up, found by dogfooding): a global `autoActivate` profile shadowed by a same-ID project profile no longer triggers the spurious "multiple agent profiles request auto-activation" error, and the auto-activate stack fallback is no longer skipped in that state.
|
|
287
|
+
- Extension macro/slot names may no longer contain `.` — forge-v1 uses dots as path separators, so dotted names were registerable but unreachable (0.5.x review A2). Regression test pins the rejection.
|
|
288
|
+
- Static prompt analysis now reports macro dependency cycles as `recursion` diagnostics instead of silently stopping traversal (0.5.x review A5). Regression test pins a single deduplicated diagnostic per cycle.
|
|
289
|
+
- Dev/test Pi SDK pins aligned across both repositories at `0.84.2` (0.5.x review A4); the optional package no longer mixes `0.83.0`/`0.84.2` instances in its tree.
|
|
290
|
+
|
|
291
|
+
- Web editor polish (code-review follow-up): the theme toggle moved from the legacy stacks topbar into the shared surface navigation, so it stays visible and functional on the Agent profiles surface; theme state now lives in a shared `theme.ts` module consumed by both the Vue shell and the legacy bridge. Policy editor rows no longer repeat the column labels on wide layouts (labels return when the grid stacks on narrow screens). Item/main action buttons no longer wrap their own text mid-label, and the item toolbar wraps whole buttons instead of clipping.
|
|
292
|
+
|
|
293
|
+
## [0.4.1] - 2026-08-17
|
|
294
|
+
|
|
295
|
+
### Added
|
|
296
|
+
|
|
297
|
+
- **Scoped global agent profiles and prompt stacks.** Profiles and stacks can now live in the user-owned global forge directory or the trusted project, with project resources shadowing same-ID global resources for bare selectors. Qualified `global:<id>` and `project:<id>` selectors provide exact addressing across commands, saved session state, profile stack references, delegation policy, subagent plans, and the browser editor. Global profiles resolve only global stacks, while project profiles may explicitly reuse global stacks; untrusted projects remain browse-only and cannot auto-activate or delegate resources. The browser editor shows scope and shadow badges, edits/deletes global resources only through explicit `global:<id>` routes, and provides project-default scope selectors for creating profiles and creating, forking, or importing prompt stacks. The zh-CN documentation now covers the scoped model.
|
|
298
|
+
- **Parallel foreground subagent invocation.** `forge_subagent` now registers as a parallel-execution tool, so the parent model can issue several calls in one turn and they prepare, approve, and execute concurrently. Pi's single-slot select/editor UI cannot host two dialogs at once, so interactive approval dialogs (including View full prompt) are serialized through a shared gate inside `requestForgeSubagentApproval` — the same gate covers `/forge-agent run` — while approved runs still overlap; unattended trusted-project invocation never enters the gate and is fully concurrent. Each run remains an independent subprocess and provider request, so a burst of parallel calls multiplies provider cost and process load.
|
|
299
|
+
- **Embedded subagent profile summary in the tool description.** `subagents.summaryInToolDescription` (default `false`, settable in global or trusted-project config) embeds a compact summary of enabled subagent profiles directly in the `forge_subagent` tool description—id, name, model/thinking level, stack, backend, and timeout—so the parent model can pick a frequently used profile without a `forge_subagent_profiles` discovery call. Unavailable enabled profiles stay visible with their first error so the model does not attempt them, ready profiles sort first, and the block is capped at 8 profiles and 1,000 characters. The description re-registers only when the rendered summary changes (profiles, stacks, or configuration), so per-turn lifecycle refreshes are no-ops, and disabling the option reverts the description to the base form. `forge_subagent_profiles` remains the authoritative full-detail surface.
|
|
300
|
+
|
|
301
|
+
## [0.4.0] - 2026-08-02
|
|
302
|
+
|
|
303
|
+
### Added
|
|
304
|
+
|
|
305
|
+
- **Per-profile subagent delegation in the browser editor.** Each profile now has a delegation card that reports its effective delegation state, backend, timeout, and sources, and trusted projects can toggle the `subagents.profiles.<id>` opt-in with backend and timeout overrides without hand-editing `.pi/forge/config.json`. The editor writes the project config while preserving unrelated keys and removing emptied entries, warns when the effective backend is not registered, marks delegation-enabled profiles with a `subagent` badge, and keeps project defaults and `allowAgentInvocationWithoutApproval` read-only. Backend listing degrades to registered IDs when backend construction is unavailable, so profile browsing never depends on backend runtime resources.
|
|
306
|
+
- **Agent-profile editor foundation.** The localhost editor now has top-level navigation between prompt stacks and project agent profiles. The profile surface lists exact model/thinking/stack targets, auto-activation and last-applied markers, current-to-target transitions, effective tools, shared resolution diagnostics, applicability, provenance, and runtime drift. Trusted projects can create, validate, edit, apply once, and delete project-local profiles through a token-protected API backed by the existing resolver, transactional application service, and guarded repository.
|
|
307
|
+
- **Configurable subagent backend selection.** The execution backend is now layered configuration rather than a fixed default: `subagents.backend` in the user-owned `~/.pi/forge/config.json` sets the global default, a trusted project's `.pi/forge/config.json` overrides it, trusted-project per-profile policy can refine it, and `/forge-agent plan|run <profile> --backend <id>` or the interactive `forge_subagent` `backend` parameter overrides a single run. The experimental `pi-rpc-readonly` backend registered in the previous prerelease is now reachable from the product. There is deliberately no fallback to another backend when the selected one is unavailable; unattended `forge_subagent` invocation is pinned to the effective configured profile backend and rejects per-call backend overrides. `forge_subagent_profiles` and `/forge-agent backends` report resolved values and sources.
|
|
308
|
+
- **Explicit per-profile delegation policy.** Agent profiles are no longer automatically exposed as subagents. Trusted-project `subagents.profiles.<id>` entries explicitly enable delegation and can override backend and timeout per profile while keeping runner policy out of portable agent-profile JSON. Disabled and unlisted profiles remain available to ordinary `/profile` workflows but are hidden from model discovery and rejected before preparation by command, tool, and runtime paths. Global profile entries warn and are ignored because profiles and prompt stacks are project-local; interactive backend overrides remain highest priority.
|
|
309
|
+
- **Conversation fingerprint visibility.** `AgentExecutionPlan` now carries the runtime-issued `conversationFingerprint` alongside the execution fingerprint. `/forge-agent plan`, the approval summary, the full-prompt viewer, and the `forge_subagent` plan details display it, so cross-backend prompt fidelity is observable (equal conversation fingerprints with backend-distinct execution fingerprints).
|
|
310
|
+
|
|
311
|
+
### Changed
|
|
312
|
+
|
|
313
|
+
- **Declarative stack item editor.** Prompt blocks, runtime slots, and structured slot options now render through a lifecycle-managed Vue component. Form and raw-JSON modes share one reactive draft, preserve unknown option keys, and keep malformed JSON visible while preventing validation, preview, or save.
|
|
314
|
+
- **First declarative web-editor tabs.** The policy and regex editors now run as lifecycle-managed Vue components while the remaining stack editor stays on the compatibility bridge. Their drafts remain plain JSON at the bridge boundary, validation errors survive tab changes, repeated mounts clean up safely, and advanced rule/policy fields are preserved while editing.
|
|
315
|
+
- **Declarative stack settings editor.** Context options, stack variables, and the raw JSON recovery view now share the same lifecycle-managed Vue tab host. Duplicate-variable errors remain authoritative across tab changes, raw JSON stays unapplied until explicitly accepted, and applying a replacement stack resets the other tab drafts through one plain-JSON boundary.
|
|
316
|
+
- **Declarative stack metadata.** Stack identity, name, mode, auto-activation, description, file provenance, collapse state, and dirty-state signaling now render through a lifecycle-managed Vue component while preserving the established browser controls and immutable-ID behavior.
|
|
317
|
+
- **Viewport-safe subagent approval.** The interactive approval selector now shows a bounded one-line task preview and compact execution metadata instead of embedding the full multi-line review in an unbounded selector title. `View full prompt` opens the complete approval details, full fingerprints, and exact provider-bound prompt in Pi's internally scrollable editor, avoiding terminal-scrollback jumps in small terminals such as VS Code's integrated terminal.
|
|
318
|
+
- **Configurable foreground subagent timeout.** `subagents.timeoutMs` configures the best-effort default from 1,000 through 3,600,000 milliseconds with a 60,000-millisecond built-in value, while `subagents.profiles.<id>.timeoutMs` can override it per enabled profile. Malformed values preserve the preceding valid/default value with a warning, and discovery, backend, plan, and approval surfaces show the effective timeout.
|
|
319
|
+
- **Published subagent runtime integration.** Pinned `@zihanw/pi-subagent-runtime@0.1.0-beta.2` instead of a sibling `file:` dependency. Host compilation now consumes the runtime's validated accepted preflight directly, and preparation forwards its `AbortSignal` through the public runtime API, removing the temporary `hostCompilePreflight()` and `prepareWithAbort()` shims. Runtime beta.2 consumes Pi SDK packages as host-provided peers and resolves model registries structurally, avoiding a private-class identity dependency on one Pi release.
|
|
320
|
+
- **Runtime-issued plan fingerprints.** `createAgentExecutionPlan()` now requires the runtime-issued conversation and execution fingerprints as inputs instead of computing a host-side execution fingerprint. `validateAgentExecutionPlan()` validates fingerprint shape and internal consistency; substituted-plan detection is the runtime's sealed-plan binding, not host recomputation.
|
|
321
|
+
- **Portable validators unified with the runtime core.** The subagent contract's access, limit, prompt-runtime, backend-descriptor, and access-enforcement validators are re-exported from `@zihanw/pi-subagent-runtime` (adapted to the host collecting style), removing the duplicated portable implementations. Host-specific artifacts (selected context, context budget, media, usage, artifacts, traces, and the richer host access-receipt cross-checks) keep their local validators.
|
|
322
|
+
- **Host-provided Pi compatibility.** Pi SDK packages and `typebox` are wildcard optional peers instead of private runtime dependencies, while exact versions remain development-only for reproducible builds. The full verification surface passes against Pi 0.82.1 and 0.83.0, and scheduled CI checks the latest published Pi family so incompatibilities are found without constraining every host update.
|
|
323
|
+
|
|
324
|
+
### Removed
|
|
325
|
+
|
|
326
|
+
- **Breaking: legacy subagent compatibility surfaces.** Removed the `src/subagent-contract.ts` compatibility barrel (import the identical surface from `@zihanw/pi-forge/subagent` or the package root), the `subagentExecutionFingerprint` host fingerprint helper (execution fingerprints are runtime-issued), and the `scripts/subagent-sdk-spike*` diagnostic harness with its `spike:subagent` npm script and test. The spike's media-transport and trusted-extension preparation diagnostics are recorded as coverage debt in `docs/development/roadmap.md` and return with productized delegated media tasks.
|
|
327
|
+
|
|
328
|
+
### Fixed
|
|
329
|
+
|
|
330
|
+
- **Profile editor state synchronization.** Returning to agent profiles now refreshes resolution after prompt-stack changes, so deleted or changed stack references immediately fail preflight instead of showing stale applicability. Unsaved delegation drafts survive same-profile refreshes and require confirmation before profile/editor navigation, manual reload, or deletion; browser unloads also use the standard unsaved-change guard. Deleting a profile now removes its effective `subagents.profiles.<id>` delegation policy, preventing a later profile with the same ID from silently inheriting delegation authority.
|
|
331
|
+
- **Restored viewport-constrained editor layout.** The Vue app shell's mount element had no height, so every `height: 100%`/`calc()` below it collapsed to content height while `body` clipped the overflow without a scroll path: the delegation card, profile sidebar rows, and the stacks workspace were silently cut off at desktop window sizes. Both surfaces now size through flex `min-height: 0` chains with internal scroll regions, the sidebar list no longer assumes a fixed header height, and the narrow-width profiles layout stacks without phantom gaps. A browser regression test asserts both surfaces stay within the viewport and that bottom-of-page controls are reachable by scrolling.
|
|
332
|
+
- **Narrow-window stack editing.** The stacked single-column workspace no longer stretches the items pane into dead space, the prompt-content editor keeps a usable 220px minimum height with vertical resize instead of collapsing to two lines, item fields lay out in two columns, and the diagnostics panel is now collapsible: a slim summary header (auto-expanded when errors or warnings exist, collapsed when clean, with an explicit user toggle and `aria-expanded` state) replaces the fixed 128px region.
|
|
333
|
+
- **Editor UX polish.** Profiles default-select the last-applied or first healthy profile instead of the alphabetically-first broken one; the delegation card distinguishes its saved policy from an unsaved draft and uses a bounded number input for timeout overrides; the profile editor warns inline when the typed model lacks configured authentication; surface navigation exposes `aria-current`; harness-driven tests no longer read the developer's real global pi-forge config.
|
|
334
|
+
- **Single auto-activation enforced on profile save.** The browser editor's create and save APIs now reject a profile that requests auto-activation while another project profile already does (409), matching the existing validation diagnostic instead of writing an ambiguous configuration that the loader would then flag on both profiles. Browser coverage now also exercises the single auto-activation rule, registry-populated model options, and runtime drift reporting after external model, thinking-level, and stack changes.
|
|
335
|
+
|
|
336
|
+
## [0.4.0-beta.1] - 2026-07-18
|
|
337
|
+
|
|
338
|
+
### Added
|
|
339
|
+
|
|
340
|
+
- **Main-agent profile discovery.** Added the no-egress `forge_subagent_profiles` tool. It returns loaded profile IDs, names, descriptions, declared model/thinking/stack metadata, ready/unavailable resolution diagnostics, and whether parent policy currently exposes `forge_subagent`, without preparing a child prompt or contacting a provider.
|
|
341
|
+
- **Approval-gated foreground subagents.** Added the model-callable `forge_subagent` tool and moved `/forge-agent run` onto the same prepare-review-execute path. Every run prepares an immutable exact plan before provider transport. `/forge-agent run` and the default tool path show a compact task/profile/provider/model/thinking/tool/boundary/fingerprint summary, permit on-demand inspection of the full provider-bound prompt, and require explicit interactive human approval.
|
|
342
|
+
- **Explicit unattended tool authorization.** Trusted projects may set `subagents.allowAgentInvocationWithoutApproval: true` in `.pi/forge/config.json` to let the parent agent invoke only the model-callable `forge_subagent` tool without per-run UI. Profile discovery exposes the active mode, result receipts record `trusted-project-config`, and missing, malformed, or untrusted-project settings fail closed.
|
|
343
|
+
- **Read-only Pi subprocess backend.** Added the experimental `pi-subprocess-readonly` backend as the extension default. It runs one sequential foreground Pi subprocess with a clean conversation and only stack-filtered `read`, `grep`, `find`, and `ls` tools; write, edit, shell, skills, templates, context files, and third-party extensions are disabled.
|
|
344
|
+
- **Inspectable subagent reports.** Foreground progress and bounded output now return through a normal Pi tool call result. Expandable result details retain the approval receipt, plan summary, normalized response, diagnostics, usage, bounded transcript tail, and tool calls/results while the full compiled prompt remains transient unless the user explicitly opens it before approval.
|
|
345
|
+
- **Explicit shared-user execution boundary.** Access receipts can now distinguish isolated execution from a shared-user subprocess. The latter cannot claim mount, symlink, process, or network isolation and documents that read-only model tools do not reduce the child process's operating-system permissions.
|
|
346
|
+
- **Public API classification.** Added a dedicated experimental `@zihanw/pi-forge/subagent` entry point and documented stable, experimental, and internal compatibility surfaces while preserving existing package-root exports.
|
|
347
|
+
- **Optional subagent backend registry.** Added empty-by-default validated backend registration, accepted-preflight binding, exact/backend-assisted preparation dispatch, execution and cancellation arbitration, host-abort timeout handling, failure normalization, and authorization-scoped trace routing. Deterministic fake-backend conformance tests cover the full adapter status and enforcement matrix.
|
|
348
|
+
- **Experimental isolated Pi SDK backend.** Added a pi-forge-owned, text-only `pi-sdk-isolated` adapter backed by an in-memory Pi `AgentSession`. It accepts only access `none`, advertises no agent tools or stored artifacts/traces, blocks provider transport until exact host preparation and immutable-plan validation complete, and cleans up temporary runtime state after execution or discard.
|
|
349
|
+
- **Human subagent test commands.** Added `/forge-agent backends`, `/forge-agent plan <profile> <task>`, and `/forge-agent run <profile> <task>`. Dry planning exercises the complete request pipeline without provider transport; TUI execution requires explicit provider-egress confirmation and returns a compact normalized response.
|
|
350
|
+
|
|
351
|
+
- **Native one-shot agent profiles.** Project profiles under `.pi/forge/agent-profiles` store an exact model, thinking level, and prompt-stack reference. `/profile use` preflights and applies once, `/profile save` captures the current runtime, and list/status/preview/validate/reload/forget commands cover diagnostics, drift, direct file editing, and branch-scoped provenance without automatic reapplication.
|
|
352
|
+
- **Profile resolution API.** Exported strict profile types, loading, validation, exact model/auth/thinking/stack resolution, fingerprints, provenance guards, and diagnostics for future subagent adapters without adding a runner dependency. Prompt stacks remain the single source of truth for tool policy and model-visible skill filtering.
|
|
353
|
+
- **Fresh-session profile auto-activation.** One profile may opt into `autoActivate: true` to apply its model, thinking level, and prompt stack once for each fresh session. Profile selection takes precedence over standalone stack autoload, restored branch state remains authoritative, and invalid or ambiguous startup profiles fail closed without producing a hybrid configuration.
|
|
354
|
+
- **Browser-level editor smoke coverage.** CI now launches the real localhost editor in headless Chrome and verifies load, metadata editing, validation, policy guidance, save, and browser-console behavior.
|
|
355
|
+
- **Runner-neutral subagent adapter contract.** Exported pure request, host-resolution, backend-preflight, backend-assisted preparation, execution-plan, enforcement-receipt, and discriminated response APIs. The contract includes custom macro/slot dependency receipts, effect-aware tool negotiation, protected task/media assembly, deterministic UTF-8 context budgeting, canonical `sha256:v1` fingerprints, and access/limit/status/artifact/trace validators without registering a backend or adding parent run tools.
|
|
356
|
+
- **Internal Pi SDK adapter spike.** Added an opt-in dry-run/execute harness that validates real profiles, exact lifecycle prompt preparation, in-memory sessions, no-access execution, timeout abort, media transport, and trusted custom registrations against Pi 0.80.6.
|
|
357
|
+
|
|
358
|
+
### Fixed
|
|
359
|
+
|
|
360
|
+
- **Terminal subprocess cancellation.** Cancelled and timed-out registry responses now wait for backend execution to drain. The subprocess backend awaits child closure with bounded TERM-to-KILL escalation during cancellation and disposal, terminalizes pre-spawn failures, and removes temporary run data before the foreground result settles.
|
|
361
|
+
- **Bounded retained subagent transcripts.** Retained transcript strings are capped, base64-like text is redacted in addition to canonical image blocks, stderr is bounded, and report messages keep a 512 KiB rolling tail with explicit omission metadata. This prevents pathological textual output from recreating the TUI/session lag caused by the original inline-image transport.
|
|
362
|
+
- **Binary-safe subagent image reports.** The child no longer sends Pi's complete JSON lifecycle stream to the parent, where repeated inline image blocks could exceed the 8 MiB transport limit and make the TUI retain megabytes of base64. A dedicated sanitized report channel preserves images inside the child for vision-provider requests, emits only image metadata to the parent, and defensively sanitizes the retained tool details again.
|
|
363
|
+
- **Pi 0.80.10 subagent authentication.** Subagent preparation now reuses the parent `ModelRuntime` when creating its temporary `AgentSession`, preserving the parent's OAuth/API-key state instead of passing session options that Pi 0.80.10 ignores. An offline regression test covers the extension's real model-registry-only path.
|
|
364
|
+
- **Fail-closed subagent egress consent.** `/forge-agent run` and the default `forge_subagent` path refuse non-UI execution instead of treating the absence of an interactive confirmation surface as approval. Only the explicit trusted-project unattended setting bypasses the tool's per-run UI. Exact preparation remains behind a closed provider gate, and dry planning remains available without provider transport.
|
|
365
|
+
- **Cancellation before backend dispatch.** An external abort that wins before backend execution now discards the prepared backend state without calling `execute()`. Concrete Pi SDK cancellation and host-timeout tests verify `AgentSession` abort and temporary-runtime cleanup.
|
|
366
|
+
- **Web editor lifecycle refresh.** Reused editor servers now bind ordinary lifecycle contexts separately from snapshotted system-prompt options, so resource inventory and preview remain available after startup reload, tree navigation, compaction, and extension reinitialization.
|
|
367
|
+
- **Trusted extension disposal and reload.** Runtime shutdown unregisters owned custom macros and slots before replacement. Every ESM load receives a process-unique cache token, while CommonJS entry caches are cleared, so `.ts`, `.mjs`, CommonJS `.js`, and `.cjs` extension edits reload without duplicate registrations or stale entry code.
|
|
368
|
+
- **Strict prompt-stack input validation.** Behavior-changing booleans, enums, defaults, context fields, variables, and item shapes are diagnosed before recovery normalization. Malformed values can still be displayed for repair but can no longer become an automatically usable stack.
|
|
369
|
+
- **Immutable stack identity on save.** Existing stack IDs are read-only in the web editor, and the save API rejects body/URL ID mismatches without writing files or changing active selection. Fork remains the supported way to create a new ID.
|
|
370
|
+
- **Token-accounting payload visibility.** Provider payload redaction preserves known token limits, usage counters, budgets, and tokenizer metadata while continuing to hide generic and credential-shaped token fields.
|
|
371
|
+
- **Tool policy restoration and enforcement across Pi reload.** pi-forge now restores the pre-policy active tool set during extension shutdown, waits for other extensions to finish their startup tool configuration before recapturing it, and reapplies restrictive policy before input and turns. A tool-call guard blocks disallowed execution even if another extension later calls `setActiveTools()`. This prevents both missing built-ins after `/preset use none` and late-added extension tools bypassing an active stack policy.
|
|
372
|
+
- **Skill-policy semantics.** Validation, documentation, and editor guidance now state that skill policy filters model-visible pi-forge skill listings; it does not disable explicit skill invocation and is not a security boundary.
|
|
373
|
+
|
|
374
|
+
### Changed
|
|
375
|
+
|
|
376
|
+
- The npm tarball no longer includes physical `src/` files and uses compiled runtime entries. Legacy `@zihanw/pi-forge/src/*` imports continue to resolve to compiled modules, while development documentation directs source modifications through a repository clone and explicit local TypeScript extension entry.
|
|
377
|
+
- The extension entry point is now a small composition root; prompt-stack state, one-shot profile activation, tool-policy/preview behavior, and shared web-editor lifecycle live in focused runtime modules.
|
|
378
|
+
- The web editor client is authored as strict TypeScript/Vue source with a dedicated browser typecheck. A build-only Vite pipeline emits self-contained JavaScript and CSS strings for the localhost editor, and verification rejects stale generated output without publishing browser-only source modules.
|
|
379
|
+
- **Breaking: browser-client compatibility paths.** `@zihanw/pi-forge/src/web-editor/client/*` imports are now explicitly blocked instead of matching the broad legacy `src/*` export wildcard. Browser implementation modules are build inputs rather than runtime integration surfaces; the supported editor delivery remains the generated embedded bundle.
|
|
380
|
+
- The subagent contract implementation is split into focused type, canonicalization, request, preflight, tool, context, plan, response, and diagnostic modules. Existing package-root and `src/subagent-contract.ts` exports remain compatibility barrels with an exact import-surface test.
|
|
381
|
+
- Backend-assisted preparation now makes the adapter, rather than the caller, provide the complete runtime compiler inputs. The registry fingerprints and validates that runtime, invokes the host compiler exactly once, binds the resulting prompt/messages/tools to execution, routes discard through the owning backend, and rejects adapters or callers that bypass, alter, or refingerprint a substitute host result.
|
|
382
|
+
- Profile commands now consume shared typed repository, application, preview, provenance, and drift-status services, establishing one behavioral core for profile UI and future subagent preparation.
|
|
383
|
+
- Package metadata now declares Node.js 22.19+ and pins the Pi peer/runtime/development packages to exactly 0.80.10. Pi changed session runtime wiring within 0.80.x, so this beta no longer claims compatibility with 0.80.6–0.80.9 or unverified later 0.80.x releases.
|
|
384
|
+
- The roadmap now records the approval-gated foreground subprocess path and moves forward to sandboxing, staged writes, profile UI, and release hardening without adding background orchestration.
|
|
385
|
+
|
|
386
|
+
## [0.3.2] - 2026-07-07
|
|
387
|
+
|
|
388
|
+
### Added
|
|
389
|
+
|
|
390
|
+
- **Global forge extensions.** pi-forge now loads trusted macro/slot registration modules from `~/.pi/forge/extensions` before project-local `.pi/forge/extensions`, so users can keep personal custom macros and slots available across projects without importing `@zihanw/pi-forge`.
|
|
391
|
+
|
|
392
|
+
### Changed
|
|
393
|
+
|
|
394
|
+
- `/preset list` now shows both global and project forge extension directories.
|
|
395
|
+
- Documentation and examples now describe global and project-local forge extension placement.
|
|
396
|
+
- No breaking changes.
|
|
397
|
+
|
|
398
|
+
## [0.3.1] - 2026-07-07
|
|
399
|
+
|
|
400
|
+
### Added
|
|
401
|
+
|
|
402
|
+
- **Parser-backed macro expansion.** Macros now support nested `{{...}}` expressions and split `::` arguments only at the current macro depth.
|
|
403
|
+
- **Macro filters and lazy conditionals.** Added `{{trim}}`, `{{upper}}`, `{{lower}}`, `{{json}}`, `{{xml}}`, plus lazy `{{ifvar}}`, `{{ifeq}}`, `{{iftools}}`, and `{{ifslot}}` conditionals. Skipped conditional branches are not expanded, so they cannot mutate variables.
|
|
404
|
+
- **Trusted custom macro and slot APIs.** Added `registerMacro`, `registerSlot`, `getRegisteredMacros`, `getRegisteredSlots`, shared render helpers, and process-global registries so trusted Pi extensions can add custom macros and slots without embedding executable code in stack JSON.
|
|
405
|
+
- **Project-local forge extensions.** Added trusted `.pi/forge/extensions` modules for project-local macro/slot registration. pi-forge loads them before stack validation, reloads them on `/preset reload`, and lists loaded files or load warnings in `/preset diagnostics`.
|
|
406
|
+
- **Example custom extension.** Added `examples/custom-system-status-extension`, which registers a `{{cpuLoad}}` macro and `machine-status` slot from a project-local forge extension module.
|
|
407
|
+
- **Slot registry and date-time option.** Built-in slots now use the public slot registry, and `date` / `date-cwd` slots support `includeTime: true`.
|
|
408
|
+
- **Web editor: new stack workflow.** The browser can create a stack even when no stack files exist yet. New stacks start from the default Pi prompt mirror layout so users can edit a complete working stack instead of a blank skeleton.
|
|
409
|
+
- **Web editor: policy resource picker.** The Policy tab now lists registered tools and loaded skills, marks active tools and hidden skills, hides exact selected names from the available list, supports removable selected-pattern chips, and includes a filter/autocomplete input for adding exact names while keeping wildcard/manual textarea editing.
|
|
410
|
+
- **Web editor shortcuts.** Added browser shortcuts for new stack, save, validate, preview, and closing dialogs/inspectors.
|
|
411
|
+
- **Web editor item actions.** Added direct Add block and Add slot actions.
|
|
412
|
+
- **Read-only web resource inventory API.** Added editor host support for listing known tools and skills for UI policy editing.
|
|
413
|
+
|
|
414
|
+
### Fixed
|
|
415
|
+
|
|
416
|
+
- **Package install exports.** Installs now load compiled `dist` JavaScript instead of raw `.ts` files under `node_modules`, so `import { registerMacro, registerSlot } from "@zihanw/pi-forge"` works for reusable trusted extension packages without relying on Node TypeScript stripping. Git installs include the compiled output and do not require TypeScript during Pi's `npm install --omit=dev` step.
|
|
417
|
+
- **Preview policy simulation.** Web preview now compiles with the edited stack's tool policy applied to selected tools, snippets, and tool guidelines. This prevents preview from showing unrelated tool guidelines from the current Pi tool state.
|
|
418
|
+
- **Empty-project web editor UX.** Empty stack directories now show a create/import path instead of leaving the editor in a dead-end state.
|
|
419
|
+
|
|
420
|
+
### Changed
|
|
421
|
+
|
|
422
|
+
- Documentation and feature inventory now describe the 0.3.1 web editor workflow.
|
|
423
|
+
- No breaking changes.
|
|
424
|
+
|
|
425
|
+
## [0.3.0] - 2026-06-30
|
|
426
|
+
|
|
427
|
+
### Breaking Changes
|
|
428
|
+
|
|
429
|
+
- **Tool/skill policy no longer allows mixed `allow` and `deny` lists.** Each resource policy (`tools`, `skills`) must use either `allow` **or** `deny`, not both. Stacks with non-empty mixed lists now produce validation errors. Previously, concrete `allow` patterns silently took priority over `deny`. Update your stack JSON to use one list per resource.
|
|
430
|
+
- Before: `{ "tools": { "allow": ["read", "bash"], "deny": ["*"] } }`
|
|
431
|
+
- After: `{ "tools": { "allow": ["read", "bash"] } }` or `{ "tools": { "deny": ["write"] } }`
|
|
432
|
+
- `PromptResourcePolicy` type changed from `{ allow?: string[]; deny?: string[] }` to a discriminated union: `{ allow?: string[]; deny?: never } | { allow?: never; deny?: string[] }`.
|
|
433
|
+
|
|
434
|
+
### Added
|
|
435
|
+
|
|
436
|
+
- **Regex transforms.** Deterministic JavaScript `RegExp` find/replace on prompt text, ordered as stack-level `regex.rules`.
|
|
437
|
+
- `stage: "history"` — transforms messages inserted by the `chat-history` slot, with role filters, depth filters, `maxMessages`, and `maxChars`.
|
|
438
|
+
- `stage: "compiled"` — transforms final system prompt and/or message text before provider serialization, with `targets`, role filters, depth filters, `maxMessages`, and `maxChars`.
|
|
439
|
+
- `trimStrings` supports deterministic SillyTavern-style Trim Out behavior for expanded replacement matches/captures.
|
|
440
|
+
- `effect: "finalize"` — destructively rewrites completed assistant messages at `message_end`. Original model output is not preserved.
|
|
441
|
+
- Supported flags: `g`, `i`, `m`, `s`, `u`. Invalid patterns, duplicate IDs, and unsupported flags are rejected during validation.
|
|
442
|
+
- Runtime diagnostics report match counts and changed text segments.
|
|
443
|
+
- **Tool and skill policy.** Stack-level `tools.allow`/`tools.deny` and `skills.allow`/`skills.deny` with exact names and `*` wildcards. Tool policy is enforced through `pi.setActiveTools()` and restored when the stack is disabled or switched. Skill policy filters rendered `skills` slots and respects `disableModelInvocation`.
|
|
444
|
+
- **Web editor: Policy tab.** Structured editor for tool and skill policies with mode selector (Unrestricted / Allow / Deny), pattern textarea, duplicate detection, and live policy summaries.
|
|
445
|
+
- **Web editor: Payload inspector.** Arm the next provider request from the UI, display captures with collapsible JSON sections, redaction preserved, char/token estimates, and copy controls. Captures triggered by `/payload next` are also visible in the browser.
|
|
446
|
+
- **Web editor: Full-screen structured preview inspector.** Collapsible system/message sections, char/token estimates, and copy controls for full preview and individual sections.
|
|
447
|
+
- **Web editor: Structured editors** for stack `context` options, `variables`, tool/skill policy, and `regex.rules` with drag-and-drop reordering.
|
|
448
|
+
- **Web editor: Raw JSON recovery path.** View, copy, and apply raw stack JSON for advanced stack-level fields.
|
|
449
|
+
- **Compact prompt slot formats.** Opt-in `format: "plain"` for `tools`, `tool-guidelines`, `skills`, `project-context`, and `variables` slots. XML remains the default.
|
|
450
|
+
- **Chat-history controls.** `chat-history` slots can opt into `stripAssistantThinking: true`, summary omission, role filters, `toolMode: "drop"`, `maxMessages`, and `maxChars`. Filtering/trimming repairs dangling tool calls/results before model-bound history is sent.
|
|
451
|
+
- **Prompt-stack storage migration.** New stacks write to `.pi/forge/prompt-stacks/`; legacy `.pi/prompt-stacks/` remains readable and is shadowed by same-named forge files. `/preset migrate-stacks [--dry-run] [--overwrite] [--delete-legacy]` copies legacy stacks into forge storage.
|
|
452
|
+
- **SillyTavern regex import.** Safe `promptOnly` regex scripts are converted into pi-forge outgoing `history` regex rules during import, including `{{match}}` / `$0` full-match conversion, trim strings, depth fields, clear user/assistant placement mapping, and preserved `source.sillytavern` metadata. Display-only, mixed, JavaScript, DOM/browser, CSS/HTML decoration, and unsupported-placement scripts remain report-only with migration notes.
|
|
453
|
+
- **`/preset ui` server reuse.** Existing same-project editor servers are reclaimed after extension reinitialization from session navigation or new-session flows, preventing orphaned servers.
|
|
454
|
+
- **`/payload next [save=<path>]` command.** Displays and optionally saves the next redacted/truncated provider payload with char/token estimates.
|
|
455
|
+
- **`/preset migrate-stacks` command** with `--dry-run`, `--overwrite`, and `--delete-legacy` options.
|
|
456
|
+
|
|
457
|
+
### Changed
|
|
458
|
+
|
|
459
|
+
- **Web editor architecture split.** `src/web-editor.ts` split into `src/web-editor/` module folder (`index.ts`, `types.ts`, `server.ts`, `page.ts`). `src/index.ts` split into `src/web-host.ts` (stack CRUD/web-editor host) and `src/payload-capture.ts` (provider payload redaction/capture).
|
|
460
|
+
- **Prompt state removed before 0.3.0 release.** pi-forge now keeps template variables and SillyTavern-style variable macros, but no longer exposes stack `state.definitions`, `/state`, `/preset vars`, `forge_state_set`, `forge_set_var`, state metadata rendering, or web runtime state editing.
|
|
461
|
+
- **Context rewrite** limited to the first provider request of each user-submitted turn, avoiding repeated injection after tool calls.
|
|
462
|
+
- **`/preset import-silly`** now detects `{{lastUserMessage}}` and configures chat history accordingly. SillyTavern `{{setvar}}`/`{{getvar}}` macros reported as handled instead of migration-needed.
|
|
463
|
+
- **`/preset reload`** preserves explicit disabled selection instead of reactivating `default.json`.
|
|
464
|
+
- SillyTavern import reports now include `extensions.regex_scripts` counts, prompt/display classification, script names, per-script conversion warnings, and migration notes.
|
|
465
|
+
|
|
466
|
+
### Removed
|
|
467
|
+
|
|
468
|
+
- Implicit `allow`-takes-priority-over-`deny` behavior in resource policy evaluation.
|
|
469
|
+
- Prompt-state memory layer: `state.definitions`, `/state`, `/preset vars`, `forge_state_set`, `forge_set_var`, metadata/namespace/JSON prompt-state rendering, and web runtime state editing.
|
|
470
|
+
|
|
471
|
+
## [0.2.0] - 2025-06-13
|
|
472
|
+
|
|
473
|
+
### Added
|
|
474
|
+
|
|
475
|
+
- File-backed prompt stacks with `replace`, `append`, and `prepend` system prompt modes.
|
|
476
|
+
- Movable `chat-history` slot with optional omission of latest user message.
|
|
477
|
+
- Runtime slots: `tools`, `tool-guidelines`, `skills`, `project-context`, `append-system-prompt`, `date`, `cwd`, `date-cwd`, `active-model`, `pi-docs`, `variables`.
|
|
478
|
+
- Built-in macros: `{{cwd}}`, `{{date}}`, `{{time}}`, `{{lastUserMessage}}`, `{{selectedTools}}`, `{{tools}}`, `{{activeModel}}`.
|
|
479
|
+
- Turn/session/static variable lookup and mutation macros.
|
|
480
|
+
- Branch-aware macro session variable restoration during session tree navigation.
|
|
481
|
+
- `/preset` commands: `list`, `status`, `use`, `preview`, `validate`, `diagnostics`, `reload`, `vars`, `ui`.
|
|
482
|
+
- `/intercept` command for next provider payload inspection.
|
|
483
|
+
- `/preset import-silly` command for SillyTavern preset import with import reports.
|
|
484
|
+
- `/preset ui` local web editor for prompt-stack management.
|
|
485
|
+
- Node built-in test suite covering compiler, loader, importer, and command/event harness.
|
|
486
|
+
- Chinese README (`README.zh-CN.md`).
|