@kingingwang/pi-windows-x64 0.84.4 → 0.86.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/bin/CHANGELOG.md +185 -5
- package/bin/README.md +4 -2
- package/bin/docs/compaction.md +39 -13
- package/bin/docs/containerization.md +45 -0
- package/bin/docs/custom-provider.md +22 -13
- package/bin/docs/development.md +23 -4
- package/bin/docs/docs.json +4 -0
- package/bin/docs/environment-variables.md +3 -0
- package/bin/docs/extensions.md +62 -45
- package/bin/docs/json.md +4 -4
- package/bin/docs/keybindings.md +5 -2
- package/bin/docs/models.md +37 -3
- package/bin/docs/providers.md +10 -2
- package/bin/docs/rpc.md +1 -1
- package/bin/docs/sdk.md +9 -2
- package/bin/docs/security.md +1 -1
- package/bin/docs/session-format.md +82 -40
- package/bin/docs/sessions.md +27 -0
- package/bin/docs/settings.md +60 -5
- package/bin/docs/skills.md +1 -1
- package/bin/docs/terminal-setup.md +15 -0
- package/bin/docs/termux.md +0 -1
- package/bin/docs/themes.md +8 -6
- package/bin/docs/tui.md +21 -2
- package/bin/docs/usage.md +1 -0
- package/bin/examples/README.md +3 -0
- package/bin/examples/extensions/README.md +0 -1
- package/bin/examples/extensions/custom-provider-anthropic/index.ts +18 -12
- package/bin/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/bin/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/bin/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/bin/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/bin/examples/extensions/dynamic-resources/dynamic.json +2 -0
- package/bin/examples/extensions/gondolin/package-lock.json +2 -2
- package/bin/examples/extensions/gondolin/package.json +1 -1
- package/bin/examples/extensions/prompt-customizer.ts +19 -67
- package/bin/examples/extensions/sandbox/package-lock.json +2 -2
- package/bin/examples/extensions/sandbox/package.json +1 -1
- package/bin/examples/extensions/with-deps/package-lock.json +2 -2
- package/bin/examples/extensions/with-deps/package.json +1 -1
- package/bin/examples/plugins/pi-example-plugin/README.md +38 -0
- package/bin/examples/plugins/pi-example-plugin/package.json +10 -0
- package/bin/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
- package/bin/examples/plugins/pi-example-plugin/src/session.ts +23 -0
- package/bin/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
- package/bin/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/bin/package.json +24 -23
- package/bin/pi.exe +2 -2
- package/bin/theme/dark.json +2 -1
- package/bin/theme/light.json +2 -1
- package/bin/theme/theme-schema.json +6 -2
- package/package.json +1 -1
- package/bin/examples/extensions/kimi-deferred-tools.ts +0 -61
- package/bin/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/bin/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
- package/bin/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
- package/bin/node_modules/@mariozechner/clipboard/README.md +0 -60
- package/bin/node_modules/@mariozechner/clipboard/build.rs +0 -5
- package/bin/node_modules/@mariozechner/clipboard/clipboard.win32-x64-msvc.node +0 -0
- package/bin/node_modules/@mariozechner/clipboard/exp.ts +0 -12
- package/bin/node_modules/@mariozechner/clipboard/index.d.ts +0 -37
- package/bin/node_modules/@mariozechner/clipboard/index.js +0 -606
- package/bin/node_modules/@mariozechner/clipboard/package.json +0 -56
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
- package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
- package/bin/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
package/bin/examples/README.md
CHANGED
|
@@ -18,6 +18,9 @@ Example extensions demonstrating:
|
|
|
18
18
|
- External integrations (SSH, file watchers, system theme sync)
|
|
19
19
|
- Custom providers (Anthropic with custom streaming, GitLab Duo)
|
|
20
20
|
|
|
21
|
+
### [plugins/pi-example-plugin/](plugins/pi-example-plugin/)
|
|
22
|
+
An experimental plugin package that Pi automatically builds into separate Session-worker and TUI Chord facets.
|
|
23
|
+
|
|
21
24
|
## Documentation
|
|
22
25
|
|
|
23
26
|
- [SDK Reference](sdk/README.md)
|
|
@@ -36,7 +36,6 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
36
36
|
| `questionnaire.ts` | Multi-question input with tab bar navigation between questions |
|
|
37
37
|
| `tool-override.ts` | Override built-in tools (e.g., add logging/access control to `read`) |
|
|
38
38
|
| `dynamic-tools.ts` | Register tools after startup (`session_start`) and at runtime via command, with prompt snippets and tool-specific prompt guidelines |
|
|
39
|
-
| `kimi-deferred-tools.ts` | Search for and progressively activate tools for Kimi's deferred-tool loading protocol |
|
|
40
39
|
| `structured-output.ts` | Final structured-output tool that returns `terminate: true` so the agent can end on the tool call |
|
|
41
40
|
| `built-in-tool-renderer.ts` | Custom compact rendering for built-in tools (read, bash, edit, write) while keeping original behavior |
|
|
42
41
|
| `minimal-mode.ts` | Override built-in tool rendering for minimal display (only tool calls, no output in collapsed mode) |
|
|
@@ -27,9 +27,11 @@ import {
|
|
|
27
27
|
type Api,
|
|
28
28
|
type AssistantMessage,
|
|
29
29
|
type AssistantMessageEventStream,
|
|
30
|
-
type Context,
|
|
31
30
|
calculateCost,
|
|
31
|
+
collapseSystemMessages,
|
|
32
32
|
createAssistantMessageEventStream,
|
|
33
|
+
getCurrentSystemPrompt,
|
|
34
|
+
getCurrentTools,
|
|
33
35
|
type ImageContent,
|
|
34
36
|
type Message,
|
|
35
37
|
type Model,
|
|
@@ -42,6 +44,7 @@ import {
|
|
|
42
44
|
type Tool,
|
|
43
45
|
type ToolCall,
|
|
44
46
|
type ToolResultMessage,
|
|
47
|
+
type TranscriptContext,
|
|
45
48
|
} from "@earendil-works/pi-ai";
|
|
46
49
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
47
50
|
|
|
@@ -334,10 +337,15 @@ function mapStopReason(reason: string): StopReason {
|
|
|
334
337
|
|
|
335
338
|
function streamCustomAnthropic(
|
|
336
339
|
model: Model<Api>,
|
|
337
|
-
context:
|
|
340
|
+
context: TranscriptContext,
|
|
338
341
|
options?: SimpleStreamOptions,
|
|
339
342
|
): AssistantMessageEventStream {
|
|
340
343
|
const stream = createAssistantMessageEventStream();
|
|
344
|
+
// The transcript carries the prompt and tools in its system messages. This provider sends
|
|
345
|
+
// one top-level system prompt, so fold later system messages into the leading one first.
|
|
346
|
+
const transcript = collapseSystemMessages(context);
|
|
347
|
+
const systemPrompt = getCurrentSystemPrompt(transcript.messages);
|
|
348
|
+
const tools = getCurrentTools(transcript.messages);
|
|
341
349
|
|
|
342
350
|
(async () => {
|
|
343
351
|
const output: AssistantMessage = {
|
|
@@ -393,7 +401,7 @@ function streamCustomAnthropic(
|
|
|
393
401
|
// Build request params
|
|
394
402
|
const params: MessageCreateParamsStreaming = {
|
|
395
403
|
model: model.id,
|
|
396
|
-
messages: convertMessages(
|
|
404
|
+
messages: convertMessages(transcript.messages, isOAuth, tools),
|
|
397
405
|
max_tokens: options?.maxTokens || Math.floor(model.maxTokens / 3),
|
|
398
406
|
stream: true,
|
|
399
407
|
};
|
|
@@ -407,25 +415,25 @@ function streamCustomAnthropic(
|
|
|
407
415
|
cache_control: { type: "ephemeral" },
|
|
408
416
|
},
|
|
409
417
|
];
|
|
410
|
-
if (
|
|
418
|
+
if (systemPrompt) {
|
|
411
419
|
params.system.push({
|
|
412
420
|
type: "text",
|
|
413
|
-
text: sanitizeSurrogates(
|
|
421
|
+
text: sanitizeSurrogates(systemPrompt),
|
|
414
422
|
cache_control: { type: "ephemeral" },
|
|
415
423
|
});
|
|
416
424
|
}
|
|
417
|
-
} else if (
|
|
425
|
+
} else if (systemPrompt) {
|
|
418
426
|
params.system = [
|
|
419
427
|
{
|
|
420
428
|
type: "text",
|
|
421
|
-
text: sanitizeSurrogates(
|
|
429
|
+
text: sanitizeSurrogates(systemPrompt),
|
|
422
430
|
cache_control: { type: "ephemeral" },
|
|
423
431
|
},
|
|
424
432
|
];
|
|
425
433
|
}
|
|
426
434
|
|
|
427
|
-
if (
|
|
428
|
-
params.tools = convertTools(
|
|
435
|
+
if (tools.length > 0) {
|
|
436
|
+
params.tools = convertTools(tools, isOAuth);
|
|
429
437
|
}
|
|
430
438
|
|
|
431
439
|
// Handle thinking/reasoning
|
|
@@ -474,9 +482,7 @@ function streamCustomAnthropic(
|
|
|
474
482
|
output.content.push({
|
|
475
483
|
type: "toolCall",
|
|
476
484
|
id: event.content_block.id,
|
|
477
|
-
name: isOAuth
|
|
478
|
-
? fromClaudeCodeName(event.content_block.name, context.tools)
|
|
479
|
-
: event.content_block.name,
|
|
485
|
+
name: isOAuth ? fromClaudeCodeName(event.content_block.name, tools) : event.content_block.name,
|
|
480
486
|
arguments: {},
|
|
481
487
|
partialJson: "",
|
|
482
488
|
index: event.index,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.1",
|
|
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.86.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
type Api,
|
|
14
14
|
type AssistantMessageEventStream,
|
|
15
15
|
anthropicMessagesApi,
|
|
16
|
-
type Context,
|
|
17
16
|
createAssistantMessageEventStream,
|
|
18
17
|
type Model,
|
|
19
18
|
type OAuthCredentials,
|
|
@@ -21,6 +20,7 @@ import {
|
|
|
21
20
|
openAIResponsesApi,
|
|
22
21
|
type SimpleStreamOptions,
|
|
23
22
|
type ThinkingLevelMap,
|
|
23
|
+
type TranscriptContext,
|
|
24
24
|
} from "@earendil-works/pi-ai/compat";
|
|
25
25
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
26
26
|
|
|
@@ -306,7 +306,7 @@ async function refreshGitLabToken(credentials: OAuthCredentials, signal: AbortSi
|
|
|
306
306
|
|
|
307
307
|
export function streamGitLabDuo(
|
|
308
308
|
model: Model<Api>,
|
|
309
|
-
context:
|
|
309
|
+
context: TranscriptContext,
|
|
310
310
|
options?: SimpleStreamOptions,
|
|
311
311
|
): AssistantMessageEventStream {
|
|
312
312
|
const stream = createAssistantMessageEventStream();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.1",
|
|
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.86.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prompt Customizer Extension
|
|
3
3
|
*
|
|
4
|
-
* Demonstrates using systemPromptOptions to
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This extension adds tool-specific guidance based on what tools and skills
|
|
8
|
-
* are currently active, respecting whatever the user has configured.
|
|
4
|
+
* Demonstrates using systemPromptOptions to add context-aware prompt sections
|
|
5
|
+
* without replacing or reparsing the complete rendered prompt.
|
|
9
6
|
*
|
|
10
7
|
* Usage:
|
|
11
8
|
* 1. Copy this file to ~/.pi/agent/extensions/ or your project's .pi/extensions/
|
|
@@ -14,84 +11,39 @@
|
|
|
14
11
|
|
|
15
12
|
import type { BuildSystemPromptOptions, ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
* Adds tool-specific guidance that adapts to the active tool set.
|
|
19
|
-
* Instead of appending one-size-fits-all instructions, this reads what's
|
|
20
|
-
* actually loaded and tailors the guidance accordingly.
|
|
21
|
-
*/
|
|
22
|
-
function addToolGuidance(options: BuildSystemPromptOptions, basePrompt: string): string {
|
|
14
|
+
function buildToolGuidance(options: BuildSystemPromptOptions): string {
|
|
23
15
|
const hasTool = (name: string) => options.selectedTools?.includes(name) ?? false;
|
|
24
|
-
|
|
25
|
-
const parts: string[] = [];
|
|
16
|
+
const rules: string[] = [];
|
|
26
17
|
|
|
27
18
|
if (hasTool("read")) {
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
19
|
+
rules.push(
|
|
20
|
+
"- Use `read` for file contents; it supports text and images.",
|
|
21
|
+
"- For large files, use `offset` and `limit` to read in chunks.",
|
|
31
22
|
);
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
if (hasTool("bash")) {
|
|
35
|
-
|
|
25
|
+
rules.push("- Use `bash` for file operations such as `ls`, `find`, and `grep`.");
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
if (hasTool("edit")) {
|
|
39
|
-
|
|
40
|
-
"• Use the `edit` tool for precise text replacements in files. Match exact content including whitespace.",
|
|
41
|
-
);
|
|
28
|
+
rules.push("- Use `edit` for precise text replacements that match existing content exactly.");
|
|
42
29
|
}
|
|
43
|
-
|
|
44
30
|
if (hasTool("write")) {
|
|
45
|
-
|
|
31
|
+
rules.push("- Use `write` to create new files or replace existing files completely.");
|
|
46
32
|
}
|
|
47
|
-
|
|
48
33
|
if (options.skills && options.skills.length > 0) {
|
|
49
|
-
|
|
50
|
-
parts.push(`\nAvailable skills: ${skillNames}`, "Use skill documentation for best practices on specific tools.");
|
|
34
|
+
rules.push(`- Available skills: ${options.skills.map((skill) => skill.name).join(", ")}.`);
|
|
51
35
|
}
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
return basePrompt;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return `${basePrompt}
|
|
58
|
-
|
|
59
|
-
## Tool Guidance
|
|
60
|
-
|
|
61
|
-
${parts.join("\n")}
|
|
62
|
-
`;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Merges extension instructions with user-provided append prompts.
|
|
67
|
-
* This respects whatever the user configured via --append-system-prompt
|
|
68
|
-
* flags or files, rather than duplicating that work.
|
|
69
|
-
*/
|
|
70
|
-
function mergeWithUserAppend(options: BuildSystemPromptOptions): string {
|
|
71
|
-
const userAppend = options.appendSystemPrompt;
|
|
72
|
-
const extensionSpecific = `
|
|
73
|
-
## Extension-Added Context
|
|
74
|
-
|
|
75
|
-
This prompt includes tool guidance and skill information loaded dynamically.
|
|
76
|
-
If you have additional requirements, configure them via --append-system-prompt or project context files.
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
if (userAppend) {
|
|
80
|
-
return `${userAppend}\n\n${extensionSpecific}`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return extensionSpecific;
|
|
37
|
+
return rules.join("\n");
|
|
84
38
|
}
|
|
85
39
|
|
|
86
40
|
export default function promptCustomizer(pi: ExtensionAPI) {
|
|
87
|
-
pi.on("before_agent_start",
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
systemPrompt: `${customPrompt}${appendSection}`,
|
|
95
|
-
};
|
|
41
|
+
pi.on("before_agent_start", (event) => {
|
|
42
|
+
const guidance = buildToolGuidance(event.systemPromptOptions);
|
|
43
|
+
if (guidance) {
|
|
44
|
+
event.systemPromptOptions.sections.tool_guidance = guidance;
|
|
45
|
+
} else {
|
|
46
|
+
delete event.systemPromptOptions.sections.tool_guidance;
|
|
47
|
+
}
|
|
96
48
|
});
|
|
97
49
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
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.16.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.1",
|
|
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.86.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `@earendil-works/pi-example-plugin`
|
|
2
|
+
|
|
3
|
+
This package provides conventional `session` and `tui` Chord facets. The Session-worker facet provides a remote greeting service. The TUI facet contributes `/hello` and calls that service.
|
|
4
|
+
|
|
5
|
+
The package needs no build script. Pi asks Chord to discover `src/session.ts` and `src/tui.ts`, builds both entries into its server-owned plugin cache, and sends the TUI artifact to clients.
|
|
6
|
+
|
|
7
|
+
From the repository root:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
PI_EXPERIMENTAL=1 ./pi-test.sh server \
|
|
11
|
+
-e "$PWD/packages/coding-agent/examples/plugins/pi-example-plugin"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Alternatively, a client can select the plugin for the Session it creates or resumes on one local server:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
PI_EXPERIMENTAL=1 ./pi-test.sh client \
|
|
18
|
+
-e "$PWD/packages/coding-agent/examples/plugins/pi-example-plugin"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Repeat `-e` to select multiple plugin packages. Client paths are resolved locally and sent only to a Unix server; Radius clients cannot select server filesystem paths. The Session and matching TUI facets are stored with that Session, so later server generations and clients can resume it without plugin arguments. Other Sessions and their workers are unaffected. An active Session rejects a different package selection instead of being restarted.
|
|
22
|
+
|
|
23
|
+
`server -e` establishes the server profile's default Session and TUI facets. Starting an explicit foreground server without `-e` clears that default. Client selection never changes the server's root facet generation.
|
|
24
|
+
|
|
25
|
+
Run `/hello Armin` in the TUI. After editing a facet, run `/reload`. The server atomically rebuilds the package, reloads the attached Session-worker generation, updates the current TUI generation, and serves the new artifact to future clients.
|
|
26
|
+
|
|
27
|
+
Package metadata can override or disable conventional entries:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"chord": {
|
|
32
|
+
"facets": {
|
|
33
|
+
"session": "./src/worker.ts",
|
|
34
|
+
"tui": false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Context, defineService, type ReplicatedState } from "@earendil-works/chord";
|
|
2
|
+
|
|
3
|
+
export interface ExampleFacetReply {
|
|
4
|
+
readonly message: string;
|
|
5
|
+
readonly workerActivations: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ExampleFacetService {
|
|
9
|
+
readonly workerActivations: ReplicatedState<{ count: number }>;
|
|
10
|
+
greet(input: { readonly name: string }, context: Context): Promise<ExampleFacetReply>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ExampleFacetService = defineService<ExampleFacetService>("pi.example-plugin.greeting");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineFacet } from "@earendil-works/chord";
|
|
2
|
+
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
|
|
3
|
+
import { ExampleFacetService } from "./contract.ts";
|
|
4
|
+
|
|
5
|
+
export default defineFacet({
|
|
6
|
+
id: "@earendil-works/pi-example-plugin/session",
|
|
7
|
+
setup(env) {
|
|
8
|
+
const workerActivations = env.replicatedState({ count: 0 });
|
|
9
|
+
env.provide(ExampleFacetService, {
|
|
10
|
+
workerActivations,
|
|
11
|
+
async greet({ name }) {
|
|
12
|
+
return {
|
|
13
|
+
message: `Hello ${name} from the bundled Session worker facet!!!`,
|
|
14
|
+
workerActivations: workerActivations.value.count,
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
env.onActivate(() => {
|
|
19
|
+
workerActivations.state.count += 1;
|
|
20
|
+
workerActivations.publish(BACKGROUND_CONTEXT);
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineFacet } from "@earendil-works/chord";
|
|
2
|
+
import { AgentController, PresentationUI, SlashCommands } from "@earendil-works/pi-coding-agent/experimental/plugin";
|
|
3
|
+
import { ExampleFacetService } from "./contract.ts";
|
|
4
|
+
|
|
5
|
+
export default defineFacet({
|
|
6
|
+
id: "@earendil-works/pi-example-plugin/tui",
|
|
7
|
+
setup(env) {
|
|
8
|
+
const example = env.use(ExampleFacetService);
|
|
9
|
+
const commands = env.use(SlashCommands);
|
|
10
|
+
const controller = env.use(AgentController);
|
|
11
|
+
const ui = env.use(PresentationUI);
|
|
12
|
+
env.onActivate(() => {
|
|
13
|
+
env.own(
|
|
14
|
+
commands.replace({
|
|
15
|
+
name: "hello",
|
|
16
|
+
description: "Call the bundled Session worker facet",
|
|
17
|
+
argumentHint: "<name>",
|
|
18
|
+
async run(args, context) {
|
|
19
|
+
const message = args.length === 0 ? "from the TUI" : args;
|
|
20
|
+
const reply = await example.greet({ name: message }, context);
|
|
21
|
+
ui.showStatus(
|
|
22
|
+
`We got this: ${reply.message} Worker activations: ${reply.workerActivations}.`,
|
|
23
|
+
context,
|
|
24
|
+
);
|
|
25
|
+
return controller.prompt({ message: `pong: ${message}`, images: null }, context);
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
Binary file
|
package/bin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-coding-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.1",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -20,12 +20,17 @@
|
|
|
20
20
|
"import": "./dist/bundle/rpc-entry.js"
|
|
21
21
|
},
|
|
22
22
|
"./client": {
|
|
23
|
-
"
|
|
24
|
-
|
|
23
|
+
"source": "./src/client/index.ts"
|
|
24
|
+
},
|
|
25
|
+
"./experimental/plugin": {
|
|
26
|
+
"source": "./src/experimental/plugin.ts"
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
"files": [
|
|
28
30
|
"dist",
|
|
31
|
+
"!dist/client",
|
|
32
|
+
"!dist/experimental",
|
|
33
|
+
"!dist/cli/experimental",
|
|
29
34
|
"docs",
|
|
30
35
|
"examples",
|
|
31
36
|
"containerization.md",
|
|
@@ -44,43 +49,39 @@
|
|
|
44
49
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
45
50
|
},
|
|
46
51
|
"dependencies": {
|
|
47
|
-
"@earendil-works/
|
|
48
|
-
"@earendil-works/pi-
|
|
49
|
-
"@earendil-works/pi-
|
|
50
|
-
"@earendil-works/pi-
|
|
51
|
-
"@earendil-works/pi-tui": "^0.84.4",
|
|
52
|
+
"@earendil-works/chord": "^0.86.1",
|
|
53
|
+
"@earendil-works/pi-agent-core": "^0.86.1",
|
|
54
|
+
"@earendil-works/pi-ai": "^0.86.1",
|
|
55
|
+
"@earendil-works/pi-tui": "^0.86.1",
|
|
52
56
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
53
|
-
"chalk": "
|
|
57
|
+
"chalk": "6.0.0",
|
|
54
58
|
"cross-spawn": "7.0.6",
|
|
55
59
|
"diff": "8.0.4",
|
|
56
|
-
"grok-mermaid": "0.2.
|
|
60
|
+
"grok-mermaid": "0.2.3",
|
|
57
61
|
"highlight.js": "10.7.3",
|
|
58
62
|
"hosted-git-info": "9.0.3",
|
|
59
|
-
"ignore": "7.0.
|
|
63
|
+
"ignore": "7.0.8",
|
|
60
64
|
"jiti": "2.7.0",
|
|
61
|
-
"minimatch": "10.2.
|
|
65
|
+
"minimatch": "10.2.6",
|
|
62
66
|
"proper-lockfile": "4.1.2",
|
|
63
|
-
"semver": "7.8.
|
|
64
|
-
"typebox": "1.3.
|
|
65
|
-
"undici": "8.
|
|
67
|
+
"semver": "7.8.5",
|
|
68
|
+
"typebox": "1.3.27",
|
|
69
|
+
"undici": "8.10.2",
|
|
66
70
|
"yaml": "2.9.0"
|
|
67
71
|
},
|
|
68
72
|
"overrides": {
|
|
69
|
-
"protobufjs": "7.6.
|
|
70
|
-
"rimraf": "6.1.2",
|
|
71
|
-
"gaxios": {
|
|
72
|
-
"rimraf": "6.1.2"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"optionalDependencies": {
|
|
76
|
-
"@mariozechner/clipboard": "0.3.9"
|
|
73
|
+
"protobufjs": "7.6.6"
|
|
77
74
|
},
|
|
78
75
|
"devDependencies": {
|
|
76
|
+
"@earendil-works/pi-client": "^0.86.1",
|
|
77
|
+
"@earendil-works/pi-protocol": "^0.86.1",
|
|
78
|
+
"@earendil-works/pi-server": "^0.86.1",
|
|
79
79
|
"@types/cross-spawn": "6.0.6",
|
|
80
80
|
"@types/hosted-git-info": "3.0.5",
|
|
81
81
|
"@types/node": "22.19.19",
|
|
82
82
|
"@types/proper-lockfile": "4.1.4",
|
|
83
83
|
"@types/semver": "7.7.1",
|
|
84
|
+
"marked": "18.0.11",
|
|
84
85
|
"shx": "0.4.0",
|
|
85
86
|
"typescript": "5.9.3",
|
|
86
87
|
"vitest": "4.1.9"
|
package/bin/pi.exe
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/pi.exe
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 109688320 bytes
|
|
4
|
+
sha256: 5c97d227c7fd086ffb5ad6608e22d95abfbe60f9668c5534e69ab5efd941c09b
|
package/bin/theme/dark.json
CHANGED
package/bin/theme/light.json
CHANGED
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"thinkingText": "mediumGray",
|
|
33
33
|
|
|
34
34
|
"selectedBg": "selectedBg",
|
|
35
|
-
"
|
|
35
|
+
"scrollbarTrack": "lightGray",
|
|
36
|
+
"scrollbarThumb": "text",
|
|
36
37
|
"searchMatchBg": "selectedBg",
|
|
37
38
|
"searchMatchText": "text",
|
|
38
39
|
"userMessageBg": "userMsgBg",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"colors": {
|
|
36
36
|
"type": "object",
|
|
37
|
-
"description": "Theme color definitions (
|
|
37
|
+
"description": "Theme color definitions (scrollbar, thinkingMax, and search highlight colors are optional and use compatible fallbacks)",
|
|
38
38
|
"required": [
|
|
39
39
|
"accent",
|
|
40
40
|
"border",
|
|
@@ -137,9 +137,13 @@
|
|
|
137
137
|
"$ref": "#/$defs/colorValue",
|
|
138
138
|
"description": "Selected item background"
|
|
139
139
|
},
|
|
140
|
+
"scrollbarTrack": {
|
|
141
|
+
"$ref": "#/$defs/colorValue",
|
|
142
|
+
"description": "Fullscreen scrollbar track foreground (falls back to muted when omitted)"
|
|
143
|
+
},
|
|
140
144
|
"scrollbarThumb": {
|
|
141
145
|
"$ref": "#/$defs/colorValue",
|
|
142
|
-
"description": "Fullscreen scrollbar thumb
|
|
146
|
+
"description": "Fullscreen scrollbar thumb foreground (falls back to text when omitted)"
|
|
143
147
|
},
|
|
144
148
|
"searchMatchBg": {
|
|
145
149
|
"$ref": "#/$defs/colorValue",
|