pi-plus-sdk 0.2.24 → 0.2.26
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 +2 -0
- package/README.md +2 -2
- package/api.js +193 -158
- package/bedrock-converse-stream.js +1 -1
- package/core/export-html/template.html +1 -0
- package/core/export-html/template.js +2 -1
- package/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/core/export-html/vendor/marked.min.js +30 -29
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
+
- The diagram extension (`pi-plus-diagram`, shared core `packages/plus/src/extensions/diagram/`) joins `plusSdkExtensionFactories`: SDK sessions get the `draw_diagram` tool (structured JSON spec → layered layout → box-drawing ASCII in `details`, optional `file` write of a standalone HTML/SVG document), and the SDK surface re-exports the rendering pieces directly — `renderDiagramHtml(spec, options?)` for hosts that want self-contained HTML/SVG from a spec without a tool call, plus `layoutDiagram`, the `DiagramSpec`/`DiagramNode`/`DiagramEdge`/`DiagramShape`/`DiagramDetails` types, and `DiagramError`/`DIAGRAM_TOOL_NAME`.
|
|
8
|
+
|
|
7
9
|
- `createPlusSdkExtensionFactories(agentDir?: string)` builds the hidden non-TUI pi-plus extension factories with the session's agent dir bound into the sub-agent-spawning extensions (`pi-plus-subagent`, `pi-plus-memory`); `plusSdkExtensionFactories` stays the env-fallback binding (`createPlusSdkExtensionFactories()`), so hosts importing the array directly keep the pipi-CLI behavior. Declared in `api.d.ts`.
|
|
8
10
|
- The SDK entry now owns the session/host-facing surface that previously required direct upstream edits: `api.js` re-exports `getDefaultSessionDir` through the pi-plus session overlay and the `ConfiguredPackage`, `PackageUpdate`, and `DefaultResourceLoaderOptions` types via type-only imports from their source modules (the coding-agent barrel stays pristine), and `api.d.ts` declares the pi-plus runtime additions — `AgentSession.getSlashCommands()`, `SessionManager.deleteSession()`, `SessionManager.search()` (instance side via module augmentation, statics via a shadow class export) — plus inline mirrors of the four re-exported names. Embedding hosts keep the same runtime and typed surface as before the upstream edits were moved into the plus packages.
|
|
9
11
|
- The web search extension (`pi-plus-web-search`, shared core `packages/plus/src/extensions/web-search/`) joins `plusSdkExtensionFactories`: SDK sessions get the `WebSearch` (provider chain over `WEB_SEARCH_PROVIDER`/`*_API_KEY` env vars, keyless DuckDuckGo fallback last) and `WebFetch` (URL → text) tools, registered exactly as the CLI wrapper registers them.
|
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ await session.prompt("Review this repository");
|
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
- The full pi-plus layer is included: the compaction/context/reasoning overrides are
|
|
28
|
-
baked into `api.js` by the shared bundle-time redirect plugin, and the
|
|
28
|
+
baked into `api.js` by the shared bundle-time redirect plugin, and the twelve
|
|
29
29
|
non-TUI pi-plus extensions (subagent, tasks, memory, plan, ask-user, hooks,
|
|
30
|
-
context-guard, recap, `/cd`, `/init`, web-search) are registered exactly as the CLI wrapper registers them. No CLI
|
|
30
|
+
context-guard, recap, diagram, `/cd`, `/init`, web-search) are registered exactly as the CLI wrapper registers them. The diagram capability is also exposed directly: `renderDiagramHtml(spec)` turns a node-edge `DiagramSpec` into a self-contained HTML/SVG document without a tool round-trip (`layoutDiagram`, the `Diagram*` types, and `DiagramError` are re-exported too). No CLI
|
|
31
31
|
logic ships in this artifact: no hub command dispatch (`pipi profile ...`), no
|
|
32
32
|
completion, no pipi help text, no banner/vim/tab-title/plain-tools.
|
|
33
33
|
- Profile management ships as a library: the curated `@earendil-works/pi-hub`
|