@cydm/pie 1.0.5 → 1.0.7

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 (59) hide show
  1. package/README.md +162 -9
  2. package/dist/builtin/extensions/ask-user/index.js +10 -2911
  3. package/dist/builtin/extensions/changelog/index.js +3 -8
  4. package/dist/builtin/extensions/deploy/index.js +1 -1
  5. package/dist/builtin/extensions/document-attachments/index.js +1 -0
  6. package/dist/builtin/extensions/files/index.js +1 -1
  7. package/dist/builtin/extensions/init/index.js +1 -3
  8. package/dist/builtin/extensions/kimi-attachments/index.js +4 -3
  9. package/dist/builtin/extensions/plan-mode/index.js +96 -165
  10. package/dist/builtin/extensions/subagent/index.js +88 -10991
  11. package/dist/builtin/extensions/todo/index.js +55 -2734
  12. package/dist/builtin/skills/browser-tools/CHANGELOG.md +2 -44
  13. package/dist/builtin/skills/browser-tools/README.md +10 -99
  14. package/dist/builtin/skills/browser-tools/SKILL.md +21 -174
  15. package/dist/builtin/skills/browser-tools/package.json +6 -13
  16. package/dist/builtin/skills/browser-tools/playwright-cli.js +24 -0
  17. package/dist/builtin/skills/pie-unity-rpc/SKILL.md +121 -0
  18. package/dist/builtin/skills/pie-unity-rpc/pie-unity-rpc.js +417 -0
  19. package/dist/builtin/skills/skill-creator/SKILL.md +17 -17
  20. package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.mjs +285 -0
  21. package/dist/builtin/skills/skill-creator/eval-viewer/viewer.html +1 -1
  22. package/dist/builtin/skills/skill-creator/scripts/aggregate_benchmark.mjs +271 -0
  23. package/dist/builtin/skills/skill-creator/scripts/claude_cli.mjs +115 -0
  24. package/dist/builtin/skills/skill-creator/scripts/generate_report.mjs +224 -0
  25. package/dist/builtin/skills/skill-creator/scripts/improve_description.mjs +198 -0
  26. package/dist/builtin/skills/skill-creator/scripts/package_skill.mjs +132 -0
  27. package/dist/builtin/skills/skill-creator/scripts/pie_runner.mjs +115 -0
  28. package/dist/builtin/skills/skill-creator/scripts/quick_validate.mjs +44 -0
  29. package/dist/builtin/skills/skill-creator/scripts/run_eval.mjs +169 -0
  30. package/dist/builtin/skills/skill-creator/scripts/run_loop.mjs +297 -0
  31. package/dist/builtin/skills/skill-creator/scripts/skill_metadata.mjs +134 -0
  32. package/dist/chunks/chunk-A5JSJAPK.js +9994 -0
  33. package/dist/chunks/chunk-BHNULR7U.js +7991 -0
  34. package/dist/chunks/chunk-GDTN4UPJ.js +701 -0
  35. package/dist/chunks/chunk-TG2EQLX2.js +43 -0
  36. package/dist/chunks/src-3X3HBT2G.js +12 -0
  37. package/dist/chunks/typescript-GSKWJIO4.js +210747 -0
  38. package/dist/cli.js +21519 -33379
  39. package/models.schema.json +238 -0
  40. package/package.json +36 -11
  41. package/dist/builtin/extensions/questionnaire/index.js +0 -2753
  42. package/dist/builtin/skills/browser-tools/browser-content.js +0 -103
  43. package/dist/builtin/skills/browser-tools/browser-cookies.js +0 -35
  44. package/dist/builtin/skills/browser-tools/browser-eval.js +0 -49
  45. package/dist/builtin/skills/browser-tools/browser-hn-scraper.js +0 -108
  46. package/dist/builtin/skills/browser-tools/browser-nav.js +0 -44
  47. package/dist/builtin/skills/browser-tools/browser-pick.js +0 -162
  48. package/dist/builtin/skills/browser-tools/browser-screenshot.js +0 -34
  49. package/dist/builtin/skills/browser-tools/browser-start.js +0 -86
  50. package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  51. package/dist/builtin/skills/skill-creator/scripts/__init__.py +0 -0
  52. package/dist/builtin/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  53. package/dist/builtin/skills/skill-creator/scripts/generate_report.py +0 -326
  54. package/dist/builtin/skills/skill-creator/scripts/improve_description.py +0 -247
  55. package/dist/builtin/skills/skill-creator/scripts/package_skill.py +0 -136
  56. package/dist/builtin/skills/skill-creator/scripts/quick_validate.py +0 -103
  57. package/dist/builtin/skills/skill-creator/scripts/run_eval.py +0 -310
  58. package/dist/builtin/skills/skill-creator/scripts/run_loop.py +0 -328
  59. package/dist/builtin/skills/skill-creator/scripts/utils.py +0 -47
package/README.md CHANGED
@@ -4,8 +4,6 @@
4
4
 
5
5
  It gives you a terminal-first agent experience out of the box, while staying modular enough to embed into other runtimes and products. Pie is designed for teams that want a small surface area, strong defaults, persistent sessions, tool use, and a clean path from CLI usage to deeper integration.
6
6
 
7
- Pie is heavily inspired by `pi`, while evolving in its own direction around modularity, embeddability, and a compact developer-facing workflow.
8
-
9
7
  Pie is developed by [cydream](https://cydream.tech).
10
8
 
11
9
  ## Why Pie
@@ -22,6 +20,8 @@ Pie is developed by [cydream](https://cydream.tech).
22
20
  npm install -g @cydm/pie
23
21
  ```
24
22
 
23
+ Pie supports Node.js 20 and newer. Release builds are validated with npm's lockfile workflow (`npm ci`) so dependency resolution is reproducible.
24
+
25
25
  ## Quick Start
26
26
 
27
27
  Set an API key for the provider you want to use:
@@ -38,6 +38,71 @@ You can also configure defaults in:
38
38
  - `~/.pie/models.json`
39
39
  - `~/.pie/config.json` for legacy-compatible defaults
40
40
 
41
+ Minimal `~/.pie/models.json`:
42
+
43
+ ```json
44
+ {
45
+ "profiles": {
46
+ "cy-gpt": {
47
+ "api": "openai-completions",
48
+ "baseUrl": "https://token.magicshell.ai/v1",
49
+ "apiKey": "YOUR_API_KEY",
50
+ "models": [
51
+ {
52
+ "id": "gpt-5.4",
53
+ "name": "GPT 5.4",
54
+ "reasoning": true,
55
+ "input": ["text", "image"],
56
+ "contextWindow": 128000,
57
+ "maxTokens": 16384,
58
+ "cost": {
59
+ "input": 0,
60
+ "output": 0,
61
+ "cacheRead": 0,
62
+ "cacheWrite": 0
63
+ }
64
+ }
65
+ ]
66
+ }
67
+ },
68
+ "defaults": {
69
+ "provider": "cy-gpt",
70
+ "modelId": "gpt-5.4"
71
+ }
72
+ }
73
+ ```
74
+
75
+ Required profile fields:
76
+
77
+ - `api`
78
+ - `baseUrl`
79
+ - `apiKey` or `apiKeyEnv`
80
+ - `models`
81
+
82
+ Required model fields:
83
+
84
+ - `id`
85
+ - `input`
86
+ - `cost`
87
+ - `contextWindow`
88
+ - `maxTokens`
89
+
90
+ Validate the file explicitly:
91
+
92
+ ```bash
93
+ pie models validate
94
+ pie models validate --path /abs/path/to/models.json
95
+ ```
96
+
97
+ Generate a starter template:
98
+
99
+ ```bash
100
+ pie models init
101
+ pie models init --stdout
102
+ ```
103
+
104
+ For editor auto-complete and validation, you can also point the optional `"$schema"` field in your local `models.json` at your installed `@cydm/pie/models.schema.json` file.
105
+
41
106
  Start Pie in interactive mode:
42
107
 
43
108
  ```bash
@@ -67,6 +132,17 @@ Pie is not just a chat CLI. It is a compact agent suite with a terminal UI on to
67
132
 
68
133
  If you want an agent that feels lightweight but still has serious capability, that is the design target for Pie.
69
134
 
135
+ ## Architecture Position
136
+
137
+ `@cydm/pie` is the CLI product layer in the repo architecture.
138
+
139
+ - `@pie/agent-core` provides runtime semantics and the agent loop
140
+ - `@pie/agent-framework` provides shared application infrastructure such as sessions, skills, and extension protocols
141
+ - `@pie/shared-headless-capabilities` provides shared headless capabilities used across hosts
142
+ - `products/cli` adds terminal bindings, CLI workflows, and host-specific capabilities such as shell execution
143
+
144
+ The CLI should consume shared capability and framework contracts; it should not redefine shared runtime or extension semantics locally.
145
+
70
146
  ## Interactive Experience
71
147
 
72
148
  Run:
@@ -102,6 +178,10 @@ Pie uses a hierarchical slash-command menu. The current built-in commands includ
102
178
 
103
179
  | Command | Description |
104
180
  | --- | --- |
181
+ | `pie doctor [--json]` | Diagnose local config, model setup, writable paths, browser automation, and Unity bridge hints |
182
+ | `pie models init` | Create a starter `~/.pie/models.json` |
183
+ | `pie models validate` | Validate `~/.pie/models.json` |
184
+ | `pie permissions` | Explain tool and shell safety defaults |
105
185
  | `/sessions/compact` | Summarize history and create a compact checkpoint |
106
186
  | `/sessions/new` | Start a new session |
107
187
  | `/sessions/resume` | Resume a different session |
@@ -119,9 +199,9 @@ Pie uses a hierarchical slash-command menu. The current built-in commands includ
119
199
  | `/skills/use` | Use a skill |
120
200
  | `/skills/reload` | Reload skills from disk |
121
201
  | `/tools/subagent` | Spawn a subagent for a task |
122
- | `/debugs/cache-test` | Test context caching |
123
- | `/debugs/context` | Dump raw context for debugging |
124
- | `/debugs/package` | Dump raw request and response payloads |
202
+ | `/debugs/cache-test` | Run provider cache diagnostics with a dedicated 2-request probe |
203
+ | `/debugs/context` | Append a context summary to `~/.pie/logs/pie-cli.log` |
204
+ | `/debugs/package` | Append a package summary to `~/.pie/logs/pie-cli.log` |
125
205
 
126
206
  Pie can also load extension-provided commands at runtime.
127
207
 
@@ -147,6 +227,55 @@ Pie supports Markdown-based skills and built-in extensions.
147
227
 
148
228
  That is part of what makes Pie embeddable: the CLI is only one interface on top of a broader agent toolkit.
149
229
 
230
+ ## Browser Tools
231
+
232
+ The built-in `browser-tools` skill uses Microsoft's Playwright CLI for visible browser automation. Its runtime dependencies ship with the CLI; do not run `npm install` inside the skill directory.
233
+
234
+ Resolve the skill resource and run Playwright commands:
235
+
236
+ ```bash
237
+ node <resolvedPath for browser-tools/playwright-cli.js> open https://example.com
238
+ node <resolvedPath for browser-tools/playwright-cli.js> snapshot
239
+ node <resolvedPath for browser-tools/playwright-cli.js> screenshot
240
+ node <resolvedPath for browser-tools/playwright-cli.js> console
241
+ node <resolvedPath for browser-tools/playwright-cli.js> network
242
+ ```
243
+
244
+ If Playwright's Chromium browser is not installed, run:
245
+
246
+ ```bash
247
+ node <resolvedPath for browser-tools/playwright-cli.js> install-browser chromium
248
+ ```
249
+
250
+ Run `pie doctor` to check whether Playwright CLI and its browser runtime are discoverable.
251
+
252
+ ## Web Search
253
+
254
+ Pie exposes a canonical `web_search` tool for public web research, current information, online documentation, and internet inspiration. Workspace search remains separate: use `grep_text`, `find_files`, and `list_dir` for local repository content.
255
+
256
+ `web_search` uses provider-native web search where supported. It does not scrape DuckDuckGo or fall back to `bash` with `curl` or Python HTTP scripts. If the current provider/model cannot perform native web search, the tool returns a clear unavailable result with provider/configuration details.
257
+
258
+ Use `web_fetch` after search when the agent needs to read a specific URL, documentation page, changelog, issue, or PDF. `web_fetch` follows redirects, extracts readable text/markdown, returns citation anchors and extraction diagnostics, and reports `requires_browser` for JavaScript-heavy pages instead of pretending the content was read.
259
+
260
+ ## Permissions
261
+
262
+ Pie's default tools operate from the current workspace. File tools are workspace-scoped, `~/.pie` is allowlisted for Pie configuration/session support, and shell commands return structured timeout/truncation/error details. The canonical shell tool is still named `bash` for compatibility; on Windows `shell:auto` uses PowerShell, and callers can explicitly request `bash`, `powershell`, or `cmd`. High-risk shell commands require confirmation outside YOLO mode. `/settings/yolo` relaxes filesystem sandbox directory restrictions and should only be used in trusted workspaces. `pie permissions` prints the current policy-derived safety summary.
263
+
264
+ ## Code Intelligence
265
+
266
+ `code_intel` provides read-only JS/TS diagnostics, definition, references, symbols, and hover. CLI uses the TypeScript language service by default and falls back to lightweight text analysis only when the TypeScript service cannot start. Unity uses a Node sidecar contract for TypeScript intelligence so the PuerTS bundle does not import Node-only parser dependencies.
267
+
268
+ ## Diagnostics
269
+
270
+ Use:
271
+
272
+ ```bash
273
+ pie doctor
274
+ pie doctor --json
275
+ ```
276
+
277
+ Doctor checks Node/npm, model configuration, API key availability, writable Pie data paths, Playwright browser readiness, Unity bridge hints, and runtime log location. User-facing errors stay concise; detailed debugging goes to `~/.pie/logs/pie-cli.log` and session trace artifacts.
278
+
150
279
  ## Output Modes
151
280
 
152
281
  For non-interactive usage, Pie supports structured output options:
@@ -168,12 +297,36 @@ For the best multiline editing experience, use a terminal with good modified-key
168
297
  ## Development
169
298
 
170
299
  ```bash
171
- cd products/cli
172
- npm install
173
- npm run build
174
- npm run test:offline
300
+ npm ci
301
+ npm run verify:quality
302
+ npm run verify:release
303
+ npm run verify:browser
304
+ npm run verify:terminal:matrix
305
+ ```
306
+
307
+ Use `npm run verify:agent` when model credentials are available and you want the real daily agent gate.
308
+ Use `npm run verify:agent:nightly` and `npm run verify:unity:reliability` before release candidates that claim real-provider or Unity reliability.
309
+ Set `PIE_REAL_BROWSER=1` when you want `verify:browser` to open a real browser session instead of only checking the Playwright CLI contract.
310
+
311
+ ## Publishing
312
+
313
+ Publish `@cydm/pie` from the monorepo root.
314
+
315
+ Set the npm token first:
316
+
317
+ ```bash
318
+ npm config set //registry.npmjs.org/:_authToken <YOUR_TOKEN>
175
319
  ```
176
320
 
321
+ Then publish:
322
+
323
+ ```bash
324
+ npm run verify:release
325
+ npm publish --workspace products/cli --access public
326
+ ```
327
+
328
+ If the package version already exists on npm, bump `products/cli/package.json` first.
329
+
177
330
  ## License
178
331
 
179
332
  MIT