pi-plus-sdk 0.1.12 → 0.1.14

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 (3) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/api.js +35 -33
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  ### Added
6
6
 
7
+ - The task store API is re-exported from the SDK surface (`packages/plus/src/extensions/tasks/store.ts`): `TaskStore` (file-backed `TaskCreate`/`TaskUpdate`/`TaskList`/`TaskGet` storage under `<agentDir>/tasks/<sessionId>/`, now a per-process singleton per list id), `subscribeToTasks(listId, listener)` — fires immediately with the current list, then with the full post-mutation list after every task-tool change in this process, returning an unsubscribe function — plus the `Task`/`TaskStatus`/`TaskListListener` types. A host (e.g. the pi-plus desktop) can render a native task panel that stays in sync without polling the files. In-process only: writers in another process are not observed.
7
8
  - Runtime settings layering for hub profiles applies to SDK hosts with no environment plumbing (shared `loader/redirects.mjs` entry for `coding-agent/src/core/settings-manager.ts`): whenever the agent dir passed to `SettingsManager.create` is a hub-materialized profile dir (a direct child of `~/.pi/pi-hub/profiles`, honoring `PI_HUB_PI_DIR`/`PI_HUB_DIR`; the pipi-set `PI_PLUS_BASE_AGENT_DIR` marker also still activates it), the global scope reads the base agent `settings.json` deep-merged under the profile `settings.json` with the profile winning, and writes route per top-level key — the profile-scoped `defaultProvider`/`defaultModel`/`defaultThinkingLevel` to the profile file, everything else to the agent file with any profile shadow cleared. Any other agent dir keeps `SettingsManager.create` behaving exactly as upstream.
8
9
  - The pi-plus context settings are re-exported from the SDK surface (`packages/plus/src/context/threshold-setting.ts`): `readPlusSettings/writePlusSettings/getPlusSettingsPath` for the pi-plus settings store next to `settings.json`, plus the typed getters/setters and UI formatters behind the pipi `/settings` rows — `get/setAutoCompactThresholdPercent` (default 80%), `get/setContextFloorTokens` (default/built-in minimum 13000), and `get/setContextWindowCapTokens` (undefined = no cap). Embedding hosts get the same knobs the TUI edits, against the same file detection actually reads. `SessionManager.deleteSession` and `SessionManager.search` (new in the re-exported upstream surface) cover transcript deletion and title/content search for history-management UIs.
9
10
  - Initial **`pi-plus-sdk`** npm artifact (published from this package): the programmatic pi-plus entry, split out of the `pi-plus` package so library hosts embed pi in-process with zero CLI logic. `import { createPlusAgentSession, createPlusUIContext, plusSdkExtensionFactories } from "pi-plus-sdk"` gives a host application (e.g. a desktop app) the compaction/context/reasoning overrides (baked in at bundle time by the shared redirect plugin) plus the nine non-TUI pi-plus extensions (subagent, tasks, memory, plan, ask-user, hooks, context-guard, /cd, /init). `createPlusAgentSession()` composes the upstream `createAgentSession` with a `DefaultResourceLoader` carrying those factories, reloads it, and binds extensions once (emitting `session_start`); hosts pass dialog handlers via the `ui` option to get working `ask_user` questions (select/confirm/input bridged to native UI), or omit it for a headless session. The staged package has an `exports` map (deep imports closed off), ships a hand-authored `api.d.ts` re-exporting `@earendil-works/pi-coding-agent` types (added as an exact-pinned dependency for type resolution only; the runtime stays self-contained), and has no bin. Hosts without a pi CLI on PATH should pass `excludeTools: ["subagent"]`: the subagent tool launches a pi subprocess and could otherwise relaunch the host app itself.