@astralyn/pi 0.81.1-2 → 0.82.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.
- package/CHANGELOG.md +53 -0
- package/README.md +14 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session.d.ts +11 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -8
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +22 -4
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +11 -3
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +9 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-config.d.ts +30 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +6 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +7 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +3 -5
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +5 -10
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +49 -48
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +13 -3
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +36 -6
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -3
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +5 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +1 -2
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/subagent/activity.d.ts +16 -0
- package/dist/extensions/subagent/activity.d.ts.map +1 -0
- package/dist/extensions/subagent/activity.js +150 -0
- package/dist/extensions/subagent/activity.js.map +1 -0
- package/dist/extensions/subagent/agents.d.ts +7 -0
- package/dist/extensions/subagent/agents.d.ts.map +1 -0
- package/dist/extensions/subagent/agents.js +218 -0
- package/dist/extensions/subagent/agents.js.map +1 -0
- package/dist/extensions/subagent/constants.d.ts +22 -0
- package/dist/extensions/subagent/constants.d.ts.map +1 -0
- package/dist/extensions/subagent/constants.js +32 -0
- package/dist/extensions/subagent/constants.js.map +1 -0
- package/dist/extensions/subagent/index.d.ts +3 -0
- package/dist/extensions/subagent/index.d.ts.map +1 -0
- package/dist/extensions/subagent/index.js +249 -0
- package/dist/extensions/subagent/index.js.map +1 -0
- package/dist/extensions/subagent/picker.d.ts +31 -0
- package/dist/extensions/subagent/picker.d.ts.map +1 -0
- package/dist/extensions/subagent/picker.js +116 -0
- package/dist/extensions/subagent/picker.js.map +1 -0
- package/dist/extensions/subagent/render.d.ts +8 -0
- package/dist/extensions/subagent/render.d.ts.map +1 -0
- package/dist/extensions/subagent/render.js +322 -0
- package/dist/extensions/subagent/render.js.map +1 -0
- package/dist/extensions/subagent/resolve.d.ts +16 -0
- package/dist/extensions/subagent/resolve.d.ts.map +1 -0
- package/dist/extensions/subagent/resolve.js +103 -0
- package/dist/extensions/subagent/resolve.js.map +1 -0
- package/dist/extensions/subagent/runner.d.ts +30 -0
- package/dist/extensions/subagent/runner.d.ts.map +1 -0
- package/dist/extensions/subagent/runner.js +355 -0
- package/dist/extensions/subagent/runner.js.map +1 -0
- package/dist/extensions/subagent/schema.d.ts +28 -0
- package/dist/extensions/subagent/schema.d.ts.map +1 -0
- package/dist/extensions/subagent/schema.js +33 -0
- package/dist/extensions/subagent/schema.js.map +1 -0
- package/dist/extensions/subagent/sdk-runner.d.ts +14 -0
- package/dist/extensions/subagent/sdk-runner.d.ts.map +1 -0
- package/dist/extensions/subagent/sdk-runner.js +210 -0
- package/dist/extensions/subagent/sdk-runner.js.map +1 -0
- package/dist/extensions/subagent/settings.d.ts +9 -0
- package/dist/extensions/subagent/settings.d.ts.map +1 -0
- package/dist/extensions/subagent/settings.js +131 -0
- package/dist/extensions/subagent/settings.js.map +1 -0
- package/dist/extensions/subagent/types.d.ts +99 -0
- package/dist/extensions/subagent/types.d.ts.map +1 -0
- package/dist/extensions/subagent/types.js +2 -0
- package/dist/extensions/subagent/types.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +16 -46
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +25 -4
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-group.d.ts +16 -0
- package/dist/modes/interactive/components/tool-group.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-group.js +64 -0
- package/dist/modes/interactive/components/tool-group.js.map +1 -0
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +37 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +3 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +61 -62
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +19 -8
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/output-decoder.d.ts +52 -0
- package/dist/utils/output-decoder.d.ts.map +1 -0
- package/dist/utils/output-decoder.js +134 -0
- package/dist/utils/output-decoder.js.map +1 -0
- package/dist/utils/shell.d.ts +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +21 -0
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +1 -1
- package/docs/custom-provider.md +5 -2
- package/docs/environment-variables.md +88 -0
- package/docs/extensions.md +11 -3
- package/docs/index.md +4 -1
- package/docs/models.md +6 -2
- package/docs/providers.md +8 -1
- package/docs/rpc.md +23 -6
- package/docs/settings.md +1 -1
- package/docs/usage.md +0 -13
- package/examples/extensions/custom-compaction.ts +3 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/handoff.ts +9 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/summarize.ts +3 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +16 -15
- package/package.json +5 -4
- package/dist/core/tools/bash-command-summary.d.ts +0 -7
- package/dist/core/tools/bash-command-summary.d.ts.map +0 -1
- package/dist/core/tools/bash-command-summary.js +0 -261
- package/dist/core/tools/bash-command-summary.js.map +0 -1
package/docs/rpc.md
CHANGED
|
@@ -23,7 +23,7 @@ Common options:
|
|
|
23
23
|
- **Responses**: JSON objects with `type: "response"` indicating command success/failure
|
|
24
24
|
- **Events**: Agent events streamed to stdout as JSON lines
|
|
25
25
|
|
|
26
|
-
All commands support an optional `id` field for request/response correlation. If provided, the corresponding response will include the same `id`.
|
|
26
|
+
All commands support an optional `id` field for request/response correlation. If provided, the corresponding response will include the same `id`. `bash_execution_update` events also include the `id` of their originating `bash` command.
|
|
27
27
|
|
|
28
28
|
### Framing
|
|
29
29
|
|
|
@@ -455,15 +455,18 @@ Response:
|
|
|
455
455
|
|
|
456
456
|
#### bash
|
|
457
457
|
|
|
458
|
-
Execute a shell command and add output to conversation context.
|
|
458
|
+
Execute a shell command and add output to conversation context. Output streams as `bash_execution_update` events while the command runs; the response contains the final result.
|
|
459
459
|
|
|
460
460
|
```json
|
|
461
|
-
{"type": "bash", "command": "ls -la"}
|
|
461
|
+
{"id": "req-1", "type": "bash", "command": "ls -la"}
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
+
Include an `id` to associate streamed `bash_execution_update` events with this command.
|
|
465
|
+
|
|
464
466
|
Response:
|
|
465
467
|
```json
|
|
466
468
|
{
|
|
469
|
+
"id": "req-1",
|
|
467
470
|
"type": "response",
|
|
468
471
|
"command": "bash",
|
|
469
472
|
"success": true,
|
|
@@ -494,7 +497,7 @@ If output was truncated, includes `fullOutputPath`:
|
|
|
494
497
|
|
|
495
498
|
**How bash results reach the LLM:**
|
|
496
499
|
|
|
497
|
-
The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state.
|
|
500
|
+
The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state.
|
|
498
501
|
|
|
499
502
|
When the next `prompt` command is sent, all messages (including `BashExecutionMessage`) are transformed before being sent to the LLM. The `BashExecutionMessage` is converted to a `UserMessage` with this format:
|
|
500
503
|
|
|
@@ -509,7 +512,6 @@ drwxr-xr-x ...
|
|
|
509
512
|
This means:
|
|
510
513
|
1. Bash output is included in the LLM context on the **next prompt**, not immediately
|
|
511
514
|
2. Multiple bash commands can be executed before a prompt; all outputs will be included
|
|
512
|
-
3. No event is emitted for the `BashExecutionMessage` itself
|
|
513
515
|
|
|
514
516
|
#### abort_bash
|
|
515
517
|
|
|
@@ -829,7 +831,7 @@ Each command has:
|
|
|
829
831
|
|
|
830
832
|
## Events
|
|
831
833
|
|
|
832
|
-
Events are streamed to stdout as JSON lines during agent operation. Events do
|
|
834
|
+
Events are streamed to stdout as JSON lines during agent operation. Events do not generally include an `id` field; `bash_execution_update` includes the `id` of its originating `bash` command when one was provided.
|
|
833
835
|
|
|
834
836
|
### Event Types
|
|
835
837
|
|
|
@@ -843,6 +845,7 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
|
|
|
843
845
|
| `message_start` | Message begins |
|
|
844
846
|
| `message_update` | Streaming update (text/thinking/toolcall deltas) |
|
|
845
847
|
| `message_end` | Message completes |
|
|
848
|
+
| `bash_execution_update` | Direct RPC bash command output chunk |
|
|
846
849
|
| `tool_execution_start` | Tool begins execution |
|
|
847
850
|
| `tool_execution_update` | Tool execution progress (streaming output) |
|
|
848
851
|
| `tool_execution_end` | Tool completes |
|
|
@@ -951,6 +954,20 @@ Example streaming a text response:
|
|
|
951
954
|
{"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world","partial":{...}}}
|
|
952
955
|
```
|
|
953
956
|
|
|
957
|
+
### bash_execution_update
|
|
958
|
+
|
|
959
|
+
Emitted once for each output chunk from a direct `bash` command. `id` matches the command's `id`, allowing clients to associate output with the correct command.
|
|
960
|
+
|
|
961
|
+
Events stream all output while the command runs, even if the final `bash` response's `output` is truncated.
|
|
962
|
+
|
|
963
|
+
```json
|
|
964
|
+
{
|
|
965
|
+
"type": "bash_execution_update",
|
|
966
|
+
"id": "req-1",
|
|
967
|
+
"delta": "total 48\n"
|
|
968
|
+
}
|
|
969
|
+
```
|
|
970
|
+
|
|
954
971
|
### tool_execution_start / tool_execution_update / tool_execution_end
|
|
955
972
|
|
|
956
973
|
Emitted when a tool begins, streams progress, and completes execution.
|
package/docs/settings.md
CHANGED
|
@@ -142,7 +142,7 @@ Version checks read the latest `@astralyn/pi` version from npm. Set `PI_SKIP_VER
|
|
|
142
142
|
| `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
|
|
143
143
|
| `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
|
|
144
144
|
|
|
145
|
-
When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs
|
|
145
|
+
When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs`, the request fails immediately with an informative error instead of waiting silently. Set it to `0` to disable the limit.
|
|
146
146
|
|
|
147
147
|
Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explicitly needed. Setting it above `0` can make SDK/provider retries handle out-of-usage-limit errors before Pi sees them, which may block the agent until the provider quota resets in some circumstances.
|
|
148
148
|
|
package/docs/usage.md
CHANGED
|
@@ -289,19 +289,6 @@ pi --tools read,grep,find,ls -p "Review the code"
|
|
|
289
289
|
pi --exclude-tools ask_question
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
### Environment Variables
|
|
293
|
-
|
|
294
|
-
| Variable | Description |
|
|
295
|
-
|----------|-------------|
|
|
296
|
-
| `PI_CODING_AGENT_DIR` | Override config directory; default is `~/.pi/agent` |
|
|
297
|
-
| `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory; overridden by `--session-dir` |
|
|
298
|
-
| `PI_PACKAGE_DIR` | Override package directory, useful for Nix/Guix store paths |
|
|
299
|
-
| `PI_OFFLINE` | Disable startup network operations, including npm version checks, package update checks, and model refresh |
|
|
300
|
-
| `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the npm registry latest-version request |
|
|
301
|
-
| `PI_TELEMETRY` | Override optional provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no`. This does not disable version checks |
|
|
302
|
-
| `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache where supported |
|
|
303
|
-
| `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
|
|
304
|
-
|
|
305
292
|
## Design Principles
|
|
306
293
|
|
|
307
294
|
Pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import type { ExtensionAPI } from "@astralyn/pi";
|
|
17
17
|
import { convertToLlm, serializeConversation } from "@astralyn/pi";
|
|
18
|
+
import { uuidv7 } from "@earendil-works/pi-ai";
|
|
18
19
|
import { complete } from "@earendil-works/pi-ai/compat";
|
|
19
20
|
|
|
20
21
|
export default function (pi: ExtensionAPI) {
|
|
@@ -96,6 +97,8 @@ ${conversationText}
|
|
|
96
97
|
env: auth.env,
|
|
97
98
|
maxTokens: 8192,
|
|
98
99
|
signal,
|
|
100
|
+
cacheRetention: "none",
|
|
101
|
+
sessionId: uuidv7(),
|
|
99
102
|
},
|
|
100
103
|
);
|
|
101
104
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.82.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.82.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import type { ExtensionAPI, SessionEntry } from "@astralyn/pi";
|
|
16
16
|
import { BorderedLoader, convertToLlm, serializeConversation } from "@astralyn/pi";
|
|
17
17
|
import type { AgentMessage } from "@earendil-works/pi-agent-core";
|
|
18
|
+
import { uuidv7 } from "@earendil-works/pi-ai";
|
|
18
19
|
import { complete, type Message } from "@earendil-works/pi-ai/compat";
|
|
19
20
|
|
|
20
21
|
const SYSTEM_PROMPT = `You are a context transfer assistant. Given a conversation history and the user's goal for a new thread, generate a focused prompt that:
|
|
@@ -136,7 +137,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
136
137
|
const response = await complete(
|
|
137
138
|
ctx.model!,
|
|
138
139
|
{ systemPrompt: SYSTEM_PROMPT, messages: [userMessage] },
|
|
139
|
-
{
|
|
140
|
+
{
|
|
141
|
+
apiKey: auth.apiKey,
|
|
142
|
+
headers: auth.headers,
|
|
143
|
+
env: auth.env,
|
|
144
|
+
signal: loader.signal,
|
|
145
|
+
cacheRetention: "none",
|
|
146
|
+
sessionId: uuidv7(),
|
|
147
|
+
},
|
|
140
148
|
);
|
|
141
149
|
|
|
142
150
|
if (response.stopReason === "aborted") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.12.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionCommandContext } from "@astralyn/pi";
|
|
2
2
|
import { DynamicBorder, getMarkdownTheme } from "@astralyn/pi";
|
|
3
|
+
import { uuidv7 } from "@earendil-works/pi-ai";
|
|
3
4
|
import { complete, getModel } from "@earendil-works/pi-ai/compat";
|
|
4
5
|
import { Container, Markdown, matchesKey, Text } from "@earendil-works/pi-tui";
|
|
5
6
|
|
|
@@ -193,6 +194,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
193
194
|
headers: auth.headers,
|
|
194
195
|
env: auth.env,
|
|
195
196
|
reasoningEffort: "high",
|
|
197
|
+
cacheRetention: "none",
|
|
198
|
+
sessionId: uuidv7(),
|
|
196
199
|
},
|
|
197
200
|
);
|
|
198
201
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.82.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astralyn/pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@astralyn/pi",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.82.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
13
|
-
"@earendil-works/pi-ai": "^0.
|
|
14
|
-
"@earendil-works/pi-tui": "^0.
|
|
12
|
+
"@earendil-works/pi-agent-core": "^0.82.0",
|
|
13
|
+
"@earendil-works/pi-ai": "^0.82.0",
|
|
14
|
+
"@earendil-works/pi-tui": "^0.82.0",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"chalk": "5.6.2",
|
|
17
17
|
"cross-spawn": "7.0.6",
|
|
@@ -474,11 +474,12 @@
|
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
"node_modules/@earendil-works/pi-agent-core": {
|
|
477
|
-
"version": "0.
|
|
478
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.
|
|
477
|
+
"version": "0.82.0",
|
|
478
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.82.0.tgz",
|
|
479
479
|
"license": "MIT",
|
|
480
480
|
"dependencies": {
|
|
481
|
-
"@earendil-works/pi-ai": "^0.
|
|
481
|
+
"@earendil-works/pi-ai": "^0.82.0",
|
|
482
|
+
"diff": "8.0.4",
|
|
482
483
|
"ignore": "7.0.5",
|
|
483
484
|
"typebox": "1.1.38",
|
|
484
485
|
"yaml": "2.9.0"
|
|
@@ -488,8 +489,8 @@
|
|
|
488
489
|
}
|
|
489
490
|
},
|
|
490
491
|
"node_modules/@earendil-works/pi-ai": {
|
|
491
|
-
"version": "0.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.
|
|
492
|
+
"version": "0.82.0",
|
|
493
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.82.0.tgz",
|
|
493
494
|
"license": "MIT",
|
|
494
495
|
"dependencies": {
|
|
495
496
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -512,8 +513,8 @@
|
|
|
512
513
|
}
|
|
513
514
|
},
|
|
514
515
|
"node_modules/@earendil-works/pi-tui": {
|
|
515
|
-
"version": "0.
|
|
516
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.
|
|
516
|
+
"version": "0.82.0",
|
|
517
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.82.0.tgz",
|
|
517
518
|
"license": "MIT",
|
|
518
519
|
"dependencies": {
|
|
519
520
|
"get-east-asian-width": "1.6.0",
|
|
@@ -1592,9 +1593,9 @@
|
|
|
1592
1593
|
}
|
|
1593
1594
|
},
|
|
1594
1595
|
"node_modules/protobufjs": {
|
|
1595
|
-
"version": "7.6.
|
|
1596
|
-
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.
|
|
1597
|
-
"integrity": "sha512
|
|
1596
|
+
"version": "7.6.5",
|
|
1597
|
+
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz",
|
|
1598
|
+
"integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==",
|
|
1598
1599
|
"license": "BSD-3-Clause",
|
|
1599
1600
|
"dependencies": {
|
|
1600
1601
|
"@protobufjs/aspromise": "^1.1.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astralyn/pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.1",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
43
|
-
"@earendil-works/pi-ai": "^0.
|
|
44
|
-
"@earendil-works/pi-tui": "^0.
|
|
42
|
+
"@earendil-works/pi-agent-core": "^0.82.0",
|
|
43
|
+
"@earendil-works/pi-ai": "^0.82.0",
|
|
44
|
+
"@earendil-works/pi-tui": "^0.82.0",
|
|
45
45
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
46
46
|
"chalk": "5.6.2",
|
|
47
47
|
"cross-spawn": "7.0.6",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"yaml": "2.9.0"
|
|
60
60
|
},
|
|
61
61
|
"overrides": {
|
|
62
|
+
"protobufjs": "7.6.5",
|
|
62
63
|
"rimraf": "6.1.2",
|
|
63
64
|
"gaxios": {
|
|
64
65
|
"rimraf": "6.1.2"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return unique, ordered command names when a command is a safe multi-command
|
|
3
|
-
* chain suitable for a compact display summary. Returns undefined when the
|
|
4
|
-
* command contains unsupported shell syntax or an unrecognized command.
|
|
5
|
-
*/
|
|
6
|
-
export declare function summarizeBashCommand(command: string): string[] | undefined;
|
|
7
|
-
//# sourceMappingURL=bash-command-summary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bash-command-summary.d.ts","sourceRoot":"","sources":["../../../src/core/tools/bash-command-summary.ts"],"names":[],"mappings":"AA6PA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAY1E","sourcesContent":["const SUMMARIZABLE_COMMANDS = new Set([\n\t\"cd\",\n\t\"ls\",\n\t\"find\",\n\t\"fd\",\n\t\"rg\",\n\t\"grep\",\n\t\"git\",\n\t\"gh\",\n\t\"npm\",\n\t\"pnpm\",\n\t\"yarn\",\n\t\"bun\",\n\t\"cat\",\n\t\"head\",\n\t\"tail\",\n\t\"sed\",\n\t\"awk\",\n\t\"jq\",\n\t\"sort\",\n\t\"uniq\",\n\t\"wc\",\n\t\"mkdir\",\n\t\"cp\",\n\t\"mv\",\n\t\"rm\",\n\t\"touch\",\n\t\"curl\",\n\t\"wget\",\n\t\"make\",\n\t\"cmake\",\n\t\"cargo\",\n\t\"go\",\n\t\"docker\",\n\t\"kubectl\",\n]);\n\nconst SHELL_KEYWORDS = new Set([\n\t\"case\",\n\t\"do\",\n\t\"done\",\n\t\"elif\",\n\t\"else\",\n\t\"esac\",\n\t\"fi\",\n\t\"for\",\n\t\"function\",\n\t\"if\",\n\t\"in\",\n\t\"select\",\n\t\"then\",\n\t\"until\",\n\t\"while\",\n]);\n\ntype CommandSeparator = \"&&\" | \"||\" | \"|\" | \"|&\" | \";\" | \"\\n\";\n\nfunction splitTopLevelCommands(command: string): string[] | undefined {\n\tconst segments: string[] = [];\n\tlet current = \"\";\n\tlet quote: \"'\" | '\"' | undefined;\n\tlet escaped = false;\n\tlet sawSeparator = false;\n\tlet trailingSeparator: CommandSeparator | undefined;\n\n\tconst pushSegment = (separator: CommandSeparator): boolean => {\n\t\tconst segment = current.trim();\n\t\tif (!segment) return false;\n\t\tsegments.push(segment);\n\t\tcurrent = \"\";\n\t\tsawSeparator = true;\n\t\ttrailingSeparator = separator;\n\t\treturn true;\n\t};\n\n\tfor (let i = 0; i < command.length; i++) {\n\t\tconst char = command[i];\n\t\tconst next = command[i + 1];\n\n\t\tif (escaped) {\n\t\t\tif (char !== \"\\n\") current += char;\n\t\t\tescaped = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\\\\") {\n\t\t\tif (next === \"\\n\") {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tescaped = true;\n\t\t\tcurrent += char;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (quote) {\n\t\t\tcurrent += char;\n\t\t\tif (char === quote) quote = undefined;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"'\" || char === '\"') {\n\t\t\tquote = char;\n\t\t\tcurrent += char;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"`\" || (char === \"$\" && (next === \"(\" || next === \"{\"))) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Redirections, grouping, comments, and background execution need more\n\t\t// shell grammar than a display-only summary should attempt to model.\n\t\tif (char === \"<\" || char === \">\" || char === \"(\" || char === \")\" || char === \"#\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (char === \"&\") {\n\t\t\tif (next !== \"&\") return undefined;\n\t\t\tif (!pushSegment(\"&&\")) return undefined;\n\t\t\tcurrent = \"\";\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"|\") {\n\t\t\tif (next === \"|\") {\n\t\t\t\tif (!pushSegment(\"||\")) return undefined;\n\t\t\t\ti++;\n\t\t\t} else if (next === \"&\") {\n\t\t\t\tif (!pushSegment(\"|&\")) return undefined;\n\t\t\t\ti++;\n\t\t\t} else if (!pushSegment(\"|\")) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \";\") {\n\t\t\tif (next === \";\" || next === \"&\") return undefined;\n\t\t\tif (!pushSegment(\";\")) return undefined;\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\n\") {\n\t\t\tif (!current.trim() && trailingSeparator && trailingSeparator !== \";\" && trailingSeparator !== \"\\n\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!pushSegment(\"\\n\")) return undefined;\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent += char;\n\t}\n\n\tif (escaped || quote) return undefined;\n\tif (current.trim()) {\n\t\tsegments.push(current.trim());\n\t} else if (trailingSeparator && trailingSeparator !== \";\" && trailingSeparator !== \"\\n\") {\n\t\treturn undefined;\n\t}\n\n\treturn sawSeparator && segments.length > 1 ? segments : undefined;\n}\n\nfunction tokenizeSimpleCommand(segment: string): string[] | undefined {\n\tconst tokens: string[] = [];\n\tlet current = \"\";\n\tlet quote: \"'\" | '\"' | undefined;\n\tlet escaped = false;\n\tlet tokenStarted = false;\n\n\tconst pushToken = () => {\n\t\tif (!tokenStarted) return;\n\t\ttokens.push(current);\n\t\tcurrent = \"\";\n\t\ttokenStarted = false;\n\t};\n\n\tfor (let i = 0; i < segment.length; i++) {\n\t\tconst char = segment[i];\n\n\t\tif (escaped) {\n\t\t\tif (char !== \"\\n\") current += char;\n\t\t\tescaped = false;\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\\\\") {\n\t\t\tescaped = true;\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (quote) {\n\t\t\tif (char === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t} else {\n\t\t\t\tcurrent += char;\n\t\t\t}\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"'\" || char === '\"') {\n\t\t\tquote = char;\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (/\\s/.test(char)) {\n\t\t\tpushToken();\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent += char;\n\t\ttokenStarted = true;\n\t}\n\n\tif (escaped || quote) return undefined;\n\tpushToken();\n\treturn tokens.length > 0 ? tokens : undefined;\n}\n\nfunction normalizeCommandName(token: string): string | undefined {\n\tif (!token || token.startsWith(\"$\")) return undefined;\n\tconst lastSlash = token.lastIndexOf(\"/\");\n\tif (lastSlash !== -1) {\n\t\tif (token.startsWith(\"./\") || token.startsWith(\"../\")) return undefined;\n\t\ttoken = token.slice(lastSlash + 1);\n\t}\n\n\tconst normalized = token.toLowerCase().replace(/\\.exe$/, \"\");\n\treturn SUMMARIZABLE_COMMANDS.has(normalized) ? normalized : undefined;\n}\n\nfunction extractSimpleCommandName(segment: string): string | undefined {\n\tconst tokens = tokenizeSimpleCommand(segment);\n\tif (!tokens) return undefined;\n\n\tlet index = 0;\n\twhile (index < tokens.length && /^[A-Za-z_][A-Za-z0-9_]*=/.test(tokens[index])) {\n\t\tindex++;\n\t}\n\tconst command = tokens[index];\n\tif (!command || SHELL_KEYWORDS.has(command)) return undefined;\n\treturn normalizeCommandName(command);\n}\n\n/**\n * Return unique, ordered command names when a command is a safe multi-command\n * chain suitable for a compact display summary. Returns undefined when the\n * command contains unsupported shell syntax or an unrecognized command.\n */\nexport function summarizeBashCommand(command: string): string[] | undefined {\n\tconst segments = splitTopLevelCommands(command);\n\tif (!segments) return undefined;\n\n\tconst names: string[] = [];\n\tfor (const segment of segments) {\n\t\tconst name = extractSimpleCommandName(segment);\n\t\tif (!name) return undefined;\n\t\tif (!names.includes(name)) names.push(name);\n\t}\n\n\treturn names.length > 0 ? names : undefined;\n}\n"]}
|