@zihanw/pi-forge 0.4.0-beta.1 → 0.4.1

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.
Files changed (227) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/PUBLIC_API.md +3 -26
  3. package/README.md +90 -601
  4. package/README.zh-CN.md +86 -585
  5. package/SUBAGENT_ADAPTER_CONTRACT.md +3 -197
  6. package/dist/agent-profile.d.ts +24 -1
  7. package/dist/agent-profile.d.ts.map +1 -1
  8. package/dist/agent-profile.js +146 -36
  9. package/dist/agent-profile.js.map +1 -1
  10. package/dist/catalog.d.ts +27 -0
  11. package/dist/catalog.d.ts.map +1 -0
  12. package/dist/catalog.js +59 -0
  13. package/dist/catalog.js.map +1 -0
  14. package/dist/forge-config.d.ts +106 -0
  15. package/dist/forge-config.d.ts.map +1 -1
  16. package/dist/forge-config.js +305 -18
  17. package/dist/forge-config.js.map +1 -1
  18. package/dist/index.d.ts +5 -5
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +55 -8
  21. package/dist/index.js.map +1 -1
  22. package/dist/lifecycle.d.ts +2 -1
  23. package/dist/lifecycle.d.ts.map +1 -1
  24. package/dist/lifecycle.js +7 -4
  25. package/dist/lifecycle.js.map +1 -1
  26. package/dist/loader.d.ts +17 -1
  27. package/dist/loader.d.ts.map +1 -1
  28. package/dist/loader.js +84 -25
  29. package/dist/loader.js.map +1 -1
  30. package/dist/preset-command.d.ts +1 -1
  31. package/dist/preset-command.d.ts.map +1 -1
  32. package/dist/preset-command.js +38 -10
  33. package/dist/preset-command.js.map +1 -1
  34. package/dist/profile-command.d.ts.map +1 -1
  35. package/dist/profile-command.js +46 -21
  36. package/dist/profile-command.js.map +1 -1
  37. package/dist/profile-service.d.ts +6 -3
  38. package/dist/profile-service.d.ts.map +1 -1
  39. package/dist/profile-service.js +55 -13
  40. package/dist/profile-service.js.map +1 -1
  41. package/dist/resource-identity.d.ts +33 -0
  42. package/dist/resource-identity.d.ts.map +1 -0
  43. package/dist/resource-identity.js +56 -0
  44. package/dist/resource-identity.js.map +1 -0
  45. package/dist/runtime/profile-runtime.d.ts.map +1 -1
  46. package/dist/runtime/profile-runtime.js +7 -2
  47. package/dist/runtime/profile-runtime.js.map +1 -1
  48. package/dist/runtime/prompt-stack-runtime.d.ts +1 -1
  49. package/dist/runtime/prompt-stack-runtime.d.ts.map +1 -1
  50. package/dist/runtime/prompt-stack-runtime.js +22 -12
  51. package/dist/runtime/prompt-stack-runtime.js.map +1 -1
  52. package/dist/runtime/subagent-runtime.d.ts +23 -8
  53. package/dist/runtime/subagent-runtime.d.ts.map +1 -1
  54. package/dist/runtime/subagent-runtime.js +296 -67
  55. package/dist/runtime/subagent-runtime.js.map +1 -1
  56. package/dist/storage.d.ts +11 -0
  57. package/dist/storage.d.ts.map +1 -1
  58. package/dist/storage.js +51 -2
  59. package/dist/storage.js.map +1 -1
  60. package/dist/subagent/canonical.d.ts +19 -7
  61. package/dist/subagent/canonical.d.ts.map +1 -1
  62. package/dist/subagent/canonical.js +19 -47
  63. package/dist/subagent/canonical.js.map +1 -1
  64. package/dist/subagent/contract.d.ts +1 -2
  65. package/dist/subagent/contract.d.ts.map +1 -1
  66. package/dist/subagent/contract.js +1 -2
  67. package/dist/subagent/contract.js.map +1 -1
  68. package/dist/subagent/index.d.ts +4 -3
  69. package/dist/subagent/index.d.ts.map +1 -1
  70. package/dist/subagent/index.js +4 -3
  71. package/dist/subagent/index.js.map +1 -1
  72. package/dist/subagent/plan.d.ts +5 -1
  73. package/dist/subagent/plan.d.ts.map +1 -1
  74. package/dist/subagent/plan.js +29 -32
  75. package/dist/subagent/plan.js.map +1 -1
  76. package/dist/subagent/request.d.ts.map +1 -1
  77. package/dist/subagent/request.js +36 -4
  78. package/dist/subagent/request.js.map +1 -1
  79. package/dist/subagent/types.d.ts +66 -178
  80. package/dist/subagent/types.d.ts.map +1 -1
  81. package/dist/subagent/types.js +1 -1
  82. package/dist/subagent/types.js.map +1 -1
  83. package/dist/subagent/validation.d.ts +14 -14
  84. package/dist/subagent/validation.d.ts.map +1 -1
  85. package/dist/subagent/validation.js +52 -238
  86. package/dist/subagent/validation.js.map +1 -1
  87. package/dist/subagent-command.d.ts +2 -1
  88. package/dist/subagent-command.d.ts.map +1 -1
  89. package/dist/subagent-command.js +115 -19
  90. package/dist/subagent-command.js.map +1 -1
  91. package/dist/subagent-host.d.ts.map +1 -1
  92. package/dist/subagent-host.js +43 -16
  93. package/dist/subagent-host.js.map +1 -1
  94. package/dist/subagent-profile-tool.d.ts +25 -2
  95. package/dist/subagent-profile-tool.d.ts.map +1 -1
  96. package/dist/subagent-profile-tool.js +41 -9
  97. package/dist/subagent-profile-tool.js.map +1 -1
  98. package/dist/subagent-tool.d.ts +31 -4
  99. package/dist/subagent-tool.d.ts.map +1 -1
  100. package/dist/subagent-tool.js +311 -137
  101. package/dist/subagent-tool.js.map +1 -1
  102. package/dist/types.d.ts +3 -0
  103. package/dist/types.d.ts.map +1 -1
  104. package/dist/types.js.map +1 -1
  105. package/dist/web-editor/client-script.generated.d.ts +1 -1
  106. package/dist/web-editor/client-script.generated.d.ts.map +1 -1
  107. package/dist/web-editor/client-script.generated.js +1 -1
  108. package/dist/web-editor/client-script.generated.js.map +1 -1
  109. package/dist/web-editor/client-styles.d.ts +2 -0
  110. package/dist/web-editor/client-styles.d.ts.map +1 -0
  111. package/dist/web-editor/client-styles.generated.d.ts +2 -0
  112. package/dist/web-editor/client-styles.generated.d.ts.map +1 -0
  113. package/dist/web-editor/client-styles.generated.js +3 -0
  114. package/dist/web-editor/client-styles.generated.js.map +1 -0
  115. package/dist/web-editor/client-styles.js +2 -0
  116. package/dist/web-editor/client-styles.js.map +1 -0
  117. package/dist/web-editor/page.d.ts +2 -0
  118. package/dist/web-editor/page.d.ts.map +1 -1
  119. package/dist/web-editor/page.js +11 -73
  120. package/dist/web-editor/page.js.map +1 -1
  121. package/dist/web-editor/server.d.ts.map +1 -1
  122. package/dist/web-editor/server.js +176 -1
  123. package/dist/web-editor/server.js.map +1 -1
  124. package/dist/web-editor/styles.d.ts.map +1 -1
  125. package/dist/web-editor/styles.js +60 -3
  126. package/dist/web-editor/styles.js.map +1 -1
  127. package/dist/web-editor/types.d.ts +87 -0
  128. package/dist/web-editor/types.d.ts.map +1 -1
  129. package/dist/web-host.d.ts +13 -2
  130. package/dist/web-host.d.ts.map +1 -1
  131. package/dist/web-host.js +371 -27
  132. package/dist/web-host.js.map +1 -1
  133. package/docs/README.md +41 -0
  134. package/docs/concepts/agent-profiles.md +60 -0
  135. package/docs/concepts/prompt-stacks.md +95 -0
  136. package/docs/design/README.md +17 -0
  137. package/docs/design/roadmap-0.4-archive.md +216 -0
  138. package/docs/design/subagents/design-review.md +220 -0
  139. package/docs/design/subagents/interface-design.md +274 -0
  140. package/docs/design/subagents/sdk-spike-findings.md +117 -0
  141. package/docs/development/complexity-review.md +86 -0
  142. package/docs/development/release.md +31 -0
  143. package/docs/development/roadmap.md +36 -0
  144. package/docs/development/scoped-global-profiles-stacks.md +325 -0
  145. package/docs/development/setup.md +75 -0
  146. package/docs/getting-started.md +95 -0
  147. package/docs/guides/custom-macros-and-slots.md +68 -0
  148. package/docs/guides/debugging.md +39 -0
  149. package/docs/guides/delegation.md +107 -0
  150. package/docs/guides/sillytavern-import.md +47 -0
  151. package/docs/guides/use-cases.md +65 -0
  152. package/docs/guides/web-editor.md +75 -0
  153. package/docs/reference/commands.md +60 -0
  154. package/docs/reference/configuration.md +66 -0
  155. package/docs/reference/features.md +280 -0
  156. package/docs/reference/macros-and-slots.md +82 -0
  157. package/docs/reference/public-api.md +28 -0
  158. package/docs/reference/stack-schema.md +167 -0
  159. package/docs/reference/subagent-adapter.md +204 -0
  160. package/docs/zh-CN/README.md +37 -0
  161. package/docs/zh-CN/concepts/agent-profiles.md +46 -0
  162. package/docs/zh-CN/concepts/prompt-stacks.md +42 -0
  163. package/docs/zh-CN/getting-started.md +81 -0
  164. package/docs/zh-CN/guides/delegation.md +66 -0
  165. package/docs/zh-CN/guides/web-editor.md +45 -0
  166. package/docs/zh-CN/reference/commands.md +60 -0
  167. package/package.json +29 -15
  168. package/dist/subagent/backend-registry.d.ts +0 -75
  169. package/dist/subagent/backend-registry.d.ts.map +0 -1
  170. package/dist/subagent/backend-registry.js +0 -463
  171. package/dist/subagent/backend-registry.js.map +0 -1
  172. package/dist/subagent/diagnostics.d.ts +0 -3
  173. package/dist/subagent/diagnostics.d.ts.map +0 -1
  174. package/dist/subagent/diagnostics.js +0 -5
  175. package/dist/subagent/diagnostics.js.map +0 -1
  176. package/dist/subagent/pi-model-runtime.d.ts +0 -8
  177. package/dist/subagent/pi-model-runtime.d.ts.map +0 -1
  178. package/dist/subagent/pi-model-runtime.js +0 -22
  179. package/dist/subagent/pi-model-runtime.js.map +0 -1
  180. package/dist/subagent/pi-sdk-backend.d.ts +0 -23
  181. package/dist/subagent/pi-sdk-backend.d.ts.map +0 -1
  182. package/dist/subagent/pi-sdk-backend.js +0 -383
  183. package/dist/subagent/pi-sdk-backend.js.map +0 -1
  184. package/dist/subagent/pi-subprocess-backend.d.ts +0 -72
  185. package/dist/subagent/pi-subprocess-backend.d.ts.map +0 -1
  186. package/dist/subagent/pi-subprocess-backend.js +0 -756
  187. package/dist/subagent/pi-subprocess-backend.js.map +0 -1
  188. package/dist/subagent/subprocess-bridge.d.ts +0 -21
  189. package/dist/subagent/subprocess-bridge.d.ts.map +0 -1
  190. package/dist/subagent/subprocess-bridge.js +0 -87
  191. package/dist/subagent/subprocess-bridge.js.map +0 -1
  192. package/dist/subagent/subprocess-report.d.ts +0 -4
  193. package/dist/subagent/subprocess-report.d.ts.map +0 -1
  194. package/dist/subagent/subprocess-report.js +0 -55
  195. package/dist/subagent/subprocess-report.js.map +0 -1
  196. package/dist/subagent-contract.d.ts +0 -8
  197. package/dist/subagent-contract.d.ts.map +0 -1
  198. package/dist/subagent-contract.js +0 -8
  199. package/dist/subagent-contract.js.map +0 -1
  200. package/dist/web-editor/client/api.d.ts +0 -9
  201. package/dist/web-editor/client/api.d.ts.map +0 -1
  202. package/dist/web-editor/client/api.js +0 -26
  203. package/dist/web-editor/client/api.js.map +0 -1
  204. package/dist/web-editor/client/dom.d.ts +0 -13
  205. package/dist/web-editor/client/dom.d.ts.map +0 -1
  206. package/dist/web-editor/client/dom.js +0 -30
  207. package/dist/web-editor/client/dom.js.map +0 -1
  208. package/dist/web-editor/client/inspector.d.ts +0 -22
  209. package/dist/web-editor/client/inspector.d.ts.map +0 -1
  210. package/dist/web-editor/client/inspector.js +0 -226
  211. package/dist/web-editor/client/inspector.js.map +0 -1
  212. package/dist/web-editor/client/main.d.ts +0 -2
  213. package/dist/web-editor/client/main.d.ts.map +0 -1
  214. package/dist/web-editor/client/main.js +0 -1468
  215. package/dist/web-editor/client/main.js.map +0 -1
  216. package/dist/web-editor/client/policy-editor.d.ts +0 -16
  217. package/dist/web-editor/client/policy-editor.d.ts.map +0 -1
  218. package/dist/web-editor/client/policy-editor.js +0 -330
  219. package/dist/web-editor/client/policy-editor.js.map +0 -1
  220. package/dist/web-editor/client/regex-editor.d.ts +0 -19
  221. package/dist/web-editor/client/regex-editor.d.ts.map +0 -1
  222. package/dist/web-editor/client/regex-editor.js +0 -281
  223. package/dist/web-editor/client/regex-editor.js.map +0 -1
  224. package/dist/web-editor/client/types.d.ts +0 -60
  225. package/dist/web-editor/client/types.d.ts.map +0 -1
  226. package/dist/web-editor/client/types.js +0 -2
  227. package/dist/web-editor/client/types.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,49 @@ In 0.x development, breaking changes may occur in minor releases and will be exp
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.4.1] - 2026-08-17
12
+
13
+ ### Added
14
+
15
+ - **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.
16
+ - **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.
17
+ - **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.
18
+
19
+ ## [0.4.0] - 2026-08-02
20
+
21
+ ### Added
22
+
23
+ - **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.
24
+ - **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.
25
+ - **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.
26
+ - **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.
27
+ - **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).
28
+
29
+ ### Changed
30
+
31
+ - **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.
32
+ - **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.
33
+ - **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.
34
+ - **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.
35
+ - **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.
36
+ - **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.
37
+ - **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.
38
+ - **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.
39
+ - **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.
40
+ - **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.
41
+
42
+ ### Removed
43
+
44
+ - **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.
45
+
46
+ ### Fixed
47
+
48
+ - **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.
49
+ - **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.
50
+ - **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.
51
+ - **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.
52
+ - **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.
53
+
11
54
  ## [0.4.0-beta.1] - 2026-07-18
12
55
 
13
56
  ### Added
@@ -50,7 +93,8 @@ In 0.x development, breaking changes may occur in minor releases and will be exp
50
93
 
51
94
  - 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.
52
95
  - 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.
53
- - The web editor client is authored as strict TypeScript modules for API transport, DOM access, policy editing, regex editing, preview/payload inspection, and orchestration. A build-only esbuild step produces the self-contained script used by the localhost editor, and verification rejects stale generated output.
96
+ - 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.
97
+ - **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.
54
98
  - 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.
55
99
  - 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.
56
100
  - 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.
package/PUBLIC_API.md CHANGED
@@ -1,28 +1,5 @@
1
- # Public API Policy
1
+ # Public API policy
2
2
 
3
- pi-forge is pre-1.0. This document separates supported integration surfaces from experimental 0.4 work and compatibility paths that should not become permanent dependencies.
3
+ The authoritative policy moved to [`docs/reference/public-api.md`](docs/reference/public-api.md).
4
4
 
5
- ## Stable
6
-
7
- - The package default export is the Pi extension entry point declared by `pi.extensions`.
8
- - Package-root macro and slot registration APIs (`registerMacro`, `registerSlot`, their registry readers, render contexts, and declarative definition types) are supported for trusted reusable extensions.
9
- - `ForgeExtensionApi` and related registration types are supported for trusted project-local forge extensions.
10
-
11
- Stable means changes should preserve source compatibility within the documented supported release range unless a changelog entry explicitly announces a breaking release.
12
-
13
- ## Experimental
14
-
15
- - Agent-profile repository, resolution, application, preview, provenance, and drift APIs are 0.4 experimental surfaces.
16
- - The runner-neutral subagent contract, host-resolution helpers, optional empty-by-default backend registry, retained `PiSdkIsolatedBackend`, and default `PiSubprocessBackend` adapter are 0.4 experimental surfaces.
17
- - New subagent integrations should import from `@zihanw/pi-forge/subagent`. The package root continues to re-export the current subagent names through the 0.4 prereleases for compatibility.
18
-
19
- Experimental APIs are typed, tested, and documented, but may be revised before the 0.4 release as real adapter and parent-integration work exposes missing semantics. Changes should still be deliberate and recorded.
20
-
21
- ## Internal compatibility paths
22
-
23
- - `@zihanw/pi-forge/src/*` subpath exports exist for compatibility with earlier source-shaped imports. They resolve to compiled `dist` modules and are not a promise that every implementation module is a permanent public API.
24
- - `src/subagent-contract.ts` is a compatibility barrel over the focused contract modules; it does not contain a second implementation.
25
- - Physical `src/` files are not included in the npm tarball. Runtime installation and legacy `@zihanw/pi-forge/src/*` aliases use compiled `dist` modules; source inspection or modification requires a repository clone.
26
- - `scripts/subagent-sdk-spike*.ts` are diagnostic development interfaces, not a supported runner API.
27
-
28
- Before removing the compatibility subpaths, check known consumers, announce the change, and provide supported package entry points for legitimate integrations.
5
+ This compatibility pointer remains at the published root path so existing links continue to work.