@kingingwang/pi-darwin-arm64 0.85.1 → 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.
Files changed (55) hide show
  1. package/bin/CHANGELOG.md +110 -0
  2. package/bin/README.md +3 -1
  3. package/bin/docs/compaction.md +39 -13
  4. package/bin/docs/custom-provider.md +22 -13
  5. package/bin/docs/development.md +4 -4
  6. package/bin/docs/docs.json +4 -0
  7. package/bin/docs/environment-variables.md +1 -0
  8. package/bin/docs/extensions.md +57 -43
  9. package/bin/docs/json.md +4 -4
  10. package/bin/docs/models.md +33 -2
  11. package/bin/docs/providers.md +10 -2
  12. package/bin/docs/sdk.md +4 -2
  13. package/bin/docs/security.md +1 -1
  14. package/bin/docs/session-format.md +82 -40
  15. package/bin/docs/sessions.md +27 -0
  16. package/bin/docs/settings.md +56 -1
  17. package/bin/docs/termux.md +0 -1
  18. package/bin/docs/tui.md +2 -2
  19. package/bin/docs/usage.md +1 -0
  20. package/bin/examples/extensions/README.md +0 -1
  21. package/bin/examples/extensions/custom-provider-anthropic/index.ts +18 -12
  22. package/bin/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  23. package/bin/examples/extensions/custom-provider-anthropic/package.json +1 -1
  24. package/bin/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  25. package/bin/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  26. package/bin/examples/extensions/gondolin/package-lock.json +2 -2
  27. package/bin/examples/extensions/gondolin/package.json +1 -1
  28. package/bin/examples/extensions/prompt-customizer.ts +19 -67
  29. package/bin/examples/extensions/sandbox/package-lock.json +2 -2
  30. package/bin/examples/extensions/sandbox/package.json +1 -1
  31. package/bin/examples/extensions/with-deps/package-lock.json +2 -2
  32. package/bin/examples/extensions/with-deps/package.json +1 -1
  33. package/bin/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  34. package/bin/package.json +17 -23
  35. package/bin/pi +2 -2
  36. package/package.json +1 -1
  37. package/bin/examples/extensions/kimi-deferred-tools.ts +0 -61
  38. package/bin/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  39. package/bin/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
  40. package/bin/node_modules/@mariozechner/clipboard/README.md +0 -60
  41. package/bin/node_modules/@mariozechner/clipboard/build.rs +0 -5
  42. package/bin/node_modules/@mariozechner/clipboard/clipboard.darwin-arm64.node +0 -0
  43. package/bin/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  44. package/bin/node_modules/@mariozechner/clipboard/index.d.ts +0 -37
  45. package/bin/node_modules/@mariozechner/clipboard/index.js +0 -606
  46. package/bin/node_modules/@mariozechner/clipboard/package.json +0 -56
  47. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
  48. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
  49. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
  50. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
  51. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
  52. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
  53. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
  54. package/bin/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
  55. package/bin/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
package/bin/docs/tui.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
6
6
 
7
- **Source:** [`@earendil-works/pi-tui`](https://github.com/earendil-works/pi-mono/tree/main/packages/tui)
7
+ **Source:** [`@earendil-works/pi-tui`](https://github.com/earendil-works/pi/tree/main/packages/tui)
8
8
 
9
9
  ## Component Interface
10
10
 
@@ -930,7 +930,7 @@ export default function (pi: ExtensionAPI) {
930
930
 
931
931
  - **Extend `CustomEditor`** (not base `Editor`) to get app keybindings (escape to abort, ctrl+d to exit, model switching, etc.)
932
932
  - **Call `super.handleInput(data)`** for keys you don't handle
933
- - **Working status**: custom editors keep the standalone working row by default. Pass `{ embedWorkingStatus: true }` as the fourth `CustomEditor` constructor argument to use the built-in editor-border spinner instead.
933
+ - **Status spinners**: custom editors keep standalone status rows by default. Pass `{ embedWorkingStatus: true }` as the fourth `CustomEditor` constructor argument to embed working, compaction, branch summarization, and retry spinners in the editor border instead.
934
934
  - **Factory pattern**: `setEditorComponent` receives a factory function that gets `tui`, `theme`, and `keybindings`
935
935
  - **Pass `undefined`** to restore the default editor: `ctx.ui.setEditorComponent(undefined)`
936
936
 
package/bin/docs/usage.md CHANGED
@@ -55,6 +55,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
55
55
  | `/export [file]` | Export session to HTML or JSONL |
56
56
  | `/import <file>` | Import and resume a session from a JSONL file |
57
57
  | `/share` | Upload as private GitHub gist with shareable HTML link |
58
+ | `/bug [description]` | Report a bug to the Pi developers; see [Sessions](sessions.md#reporting-bugs) |
58
59
  | `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
59
60
  | `/hotkeys` | Show all keyboard shortcuts |
60
61
  | `/changelog` | Display version history |
@@ -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: 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(context.messages, isOAuth, context.tools),
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 (context.systemPrompt) {
418
+ if (systemPrompt) {
411
419
  params.system.push({
412
420
  type: "text",
413
- text: sanitizeSurrogates(context.systemPrompt),
421
+ text: sanitizeSurrogates(systemPrompt),
414
422
  cache_control: { type: "ephemeral" },
415
423
  });
416
424
  }
417
- } else if (context.systemPrompt) {
425
+ } else if (systemPrompt) {
418
426
  params.system = [
419
427
  {
420
428
  type: "text",
421
- text: sanitizeSurrogates(context.systemPrompt),
429
+ text: sanitizeSurrogates(systemPrompt),
422
430
  cache_control: { type: "ephemeral" },
423
431
  },
424
432
  ];
425
433
  }
426
434
 
427
- if (context.tools) {
428
- params.tools = convertTools(context.tools, isOAuth);
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.85.1",
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.85.1",
9
+ "version": "0.86.1",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.85.1",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -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: Context,
309
+ context: TranscriptContext,
310
310
  options?: SimpleStreamOptions,
311
311
  ): AssistantMessageEventStream {
312
312
  const stream = createAssistantMessageEventStream();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.85.1",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.85.1",
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.85.1",
9
+ "version": "0.86.1",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.85.1",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,11 +1,8 @@
1
1
  /**
2
2
  * Prompt Customizer Extension
3
3
  *
4
- * Demonstrates using systemPromptOptions to make informed, context-aware
5
- * modifications to the system prompt without re-discovering resources.
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
- parts.push(
29
- "• Use the `read` tool for file contents (supports text and images).",
30
- " - For large files, use `offset` and `limit` to read in chunks.",
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
- parts.push("• Execute commands with the `bash` tool. Use it for file operations like `ls`, `find`, `grep`.");
25
+ rules.push("- Use `bash` for file operations such as `ls`, `find`, and `grep`.");
36
26
  }
37
-
38
27
  if (hasTool("edit")) {
39
- parts.push(
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
- parts.push("• Use the `write` tool to create new files or overwrite existing ones completely.");
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
- const skillNames = options.skills.map((s) => s.name).join(", ");
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
- if (parts.length === 0) {
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", async (event) => {
88
- const { systemPrompt, systemPromptOptions } = event;
89
-
90
- const customPrompt = addToolGuidance(systemPromptOptions, systemPrompt);
91
- const appendSection = mergeWithUserAppend(systemPromptOptions);
92
-
93
- return {
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.15.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.15.1",
9
+ "version": "1.16.1",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "1.15.1",
4
+ "version": "1.16.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.85.1",
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.85.1",
9
+ "version": "0.86.1",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.85.1",
4
+ "version": "0.86.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
package/bin/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-coding-agent",
3
- "version": "0.85.1",
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": {
@@ -49,45 +49,39 @@
49
49
  "prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
50
50
  },
51
51
  "dependencies": {
52
- "@earendil-works/chord": "^0.85.1",
53
- "@earendil-works/pi-agent-core": "^0.85.1",
54
- "@earendil-works/pi-ai": "^0.85.1",
55
- "@earendil-works/pi-tui": "^0.85.1",
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",
56
56
  "@silvia-odwyer/photon-node": "0.3.4",
57
- "chalk": "5.6.2",
57
+ "chalk": "6.0.0",
58
58
  "cross-spawn": "7.0.6",
59
59
  "diff": "8.0.4",
60
- "grok-mermaid": "0.2.2",
60
+ "grok-mermaid": "0.2.3",
61
61
  "highlight.js": "10.7.3",
62
62
  "hosted-git-info": "9.0.3",
63
- "ignore": "7.0.5",
63
+ "ignore": "7.0.8",
64
64
  "jiti": "2.7.0",
65
- "minimatch": "10.2.5",
65
+ "minimatch": "10.2.6",
66
66
  "proper-lockfile": "4.1.2",
67
- "semver": "7.8.0",
68
- "typebox": "1.3.7",
69
- "undici": "8.9.0",
67
+ "semver": "7.8.5",
68
+ "typebox": "1.3.27",
69
+ "undici": "8.10.2",
70
70
  "yaml": "2.9.0"
71
71
  },
72
72
  "overrides": {
73
- "protobufjs": "7.6.5",
74
- "rimraf": "6.1.2",
75
- "gaxios": {
76
- "rimraf": "6.1.2"
77
- }
78
- },
79
- "optionalDependencies": {
80
- "@mariozechner/clipboard": "0.3.9"
73
+ "protobufjs": "7.6.6"
81
74
  },
82
75
  "devDependencies": {
83
- "@earendil-works/pi-client": "^0.85.1",
84
- "@earendil-works/pi-protocol": "^0.85.1",
85
- "@earendil-works/pi-server": "^0.85.1",
76
+ "@earendil-works/pi-client": "^0.86.1",
77
+ "@earendil-works/pi-protocol": "^0.86.1",
78
+ "@earendil-works/pi-server": "^0.86.1",
86
79
  "@types/cross-spawn": "6.0.6",
87
80
  "@types/hosted-git-info": "3.0.5",
88
81
  "@types/node": "22.19.19",
89
82
  "@types/proper-lockfile": "4.1.4",
90
83
  "@types/semver": "7.7.1",
84
+ "marked": "18.0.11",
91
85
  "shx": "0.4.0",
92
86
  "typescript": "5.9.3",
93
87
  "vitest": "4.1.9"
package/bin/pi CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/pi
3
- size: 74888930 bytes
4
- sha256: 6e554b4f43ec90ebea41ee7709a853d1983385aedb45965bc7572ed35f388ac9
3
+ size: 75466850 bytes
4
+ sha256: c7a62eb311c42f12782407049d3f9fda901f71c288baa1488971789d40e1ca81
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kingingwang/pi-darwin-arm64",
3
- "version": "0.85.1",
3
+ "version": "0.86.1",
4
4
  "description": "Pi standalone binary for darwin-arm64 (fork distribution)",
5
5
  "license": "MIT",
6
6
  "os": [
@@ -1,61 +0,0 @@
1
- /**
2
- * Minimal Kimi deferred-tool loading demo.
3
- *
4
- * pi -e ./kimi-deferred-tools.ts
5
- * example prompt: Use the available tools to calculate 100 + 500. Do not calculate it yourself.
6
- */
7
-
8
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
9
- import { Type } from "typebox";
10
-
11
- function calculate(_expr: string): string {
12
- return "42";
13
- }
14
-
15
- export default function (pi: ExtensionAPI): void {
16
- pi.registerTool({
17
- name: "Calculator",
18
- label: "Calculator",
19
- description: "Evaluate a simple arithmetic expression.",
20
- parameters: Type.Object({
21
- expr: Type.String({ description: "An expression such as 100 + 500" }),
22
- }),
23
- async execute(_toolCallId, params) {
24
- return {
25
- content: [{ type: "text", text: calculate(params.expr) }],
26
- details: {},
27
- };
28
- },
29
- });
30
-
31
- pi.registerTool({
32
- name: "tool_search",
33
- label: "Tool Search",
34
- description: "Find and activate tools for a capability.",
35
- promptSnippet: "Search for additional tools when the active tools cannot perform the task",
36
- parameters: Type.Object({
37
- query: Type.String({ description: "Capability to search for" }),
38
- }),
39
- async execute(_toolCallId, params) {
40
- if (!params.query.toLowerCase().includes("calc")) {
41
- return {
42
- content: [{ type: "text", text: "The relevant tools do not exist." }],
43
- details: { matches: [], added: [] },
44
- };
45
- }
46
-
47
- const active = pi.getActiveTools();
48
- const added = active.includes("Calculator") ? [] : ["Calculator"];
49
- if (added.length > 0) pi.setActiveTools([...active, ...added]);
50
-
51
- return {
52
- content: [{ type: "text", text: "Success. Found 1 matching tool(s)" }],
53
- details: { matches: ["Calculator"], added },
54
- };
55
- },
56
- });
57
-
58
- pi.on("session_start", () => {
59
- pi.setActiveTools(["tool_search"]);
60
- });
61
- }
@@ -1 +0,0 @@
1
- nodeLinker: node-modules
@@ -1,45 +0,0 @@
1
- [package]
2
- edition = "2021"
3
- name = "crosscopy_clipboard"
4
- version = "0.0.0"
5
-
6
- [lib]
7
- crate-type = ["cdylib"]
8
-
9
- [features]
10
- default = ["image"]
11
- image = ["dep:image"]
12
- wayland = ["dep:wl-clipboard-rs"]
13
-
14
- [dependencies]
15
- base64 = "0.22.0"
16
- futures = "0.3.30"
17
- # Pin image to version compatible with older Rust in CI Docker images
18
- image = { version = "=0.25.5", features = ["png", "jpeg"], optional = true, default-features = false }
19
- # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
20
- napi = { version = "3.9.0", default-features = false, features = ["napi4", "tokio_rt", "dyn-symbols"] }
21
- napi-derive = "3.5.6"
22
- tokio = "1.36.0"
23
-
24
- [target.'cfg(all(unix, not(any(target_os="macos", target_os="android", target_os="ios", target_os="emscripten"))))'.dependencies]
25
- wl-clipboard-rs = { version = "0.9", optional = true }
26
- x11rb = { version = "0.13.2", features = ["xfixes"] }
27
-
28
- [target.'cfg(target_os = "macos")'.dependencies]
29
- image = { version = "=0.25.5", features = ["tiff", "png", "jpeg"], optional = true, default-features = false }
30
- objc2 = "0.6.3"
31
- objc2-app-kit = { version = "0.3.2", features = ["NSPasteboard", "NSPasteboardItem", "NSImage"] }
32
- objc2-foundation = { version = "0.3.2", features = ["NSArray", "NSString", "NSEnumerator"] }
33
-
34
- [target.'cfg(target_os = "windows")'.dependencies]
35
- clipboard-win = { version = "5.4.1", features = ["monitor"] }
36
- image = { version = "=0.25.5", features = ["bmp", "png", "jpeg"], optional = true, default-features = false }
37
- windows = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Graphics_Gdi", "Win32_System_DataExchange"] }
38
-
39
- [build-dependencies]
40
- # Pin to version that works with older Rust in Docker images
41
- napi-build = "2.3.2"
42
-
43
- [profile.release]
44
- lto = true
45
- strip = "symbols"
@@ -1,60 +0,0 @@
1
- # @mariozechner/clipboard
2
-
3
- > **Fork of [@crosscopy/clipboard](https://github.com/CrossCopy/clipboard)**
4
- >
5
- > This fork updates to the latest `clipboard-rs` (0.3.1) and adds musl (Alpine Linux) support.
6
- > All credit goes to the original authors.
7
-
8
- ![NPM Version](https://img.shields.io/npm/v/@mariozechner/clipboard)
9
- [![CI](https://github.com/badlogic/clipboard/actions/workflows/CI.yml/badge.svg)](https://github.com/badlogic/clipboard/actions/workflows/CI.yml)
10
-
11
- **NPM Package**: https://www.npmjs.com/package/@mariozechner/clipboard
12
-
13
- **GitHub**: https://github.com/badlogic/clipboard
14
-
15
- > This is a clipboard API npm package that allows you to copy and paste data to and from the clipboard.
16
- > There doesn't seem to be a good clipboard package for node.js (that supports data format beyond text), so I decided to make one.
17
- > Data Format Supported
18
- >
19
- > - Text
20
- > - Image
21
- > - Rich Text Format
22
- > - Files
23
- > - HTML
24
-
25
- ## Acknowledgements
26
-
27
- - [ChurchTao/clipboard-rs](https://github.com/ChurchTao/clipboard-rs) is written in rust, which is used to provide the native clipboard support for this package across Linux, Windows and MacOS. This package is basically a wrapper around this rust package.
28
- - https://crates.io/crates/clipboard-rs
29
- - [napi.rs](https://napi.rs/) was used to create the node.js addon for this package, so that API calls written in rust can be called from node.js.
30
-
31
- ## API
32
-
33
- Detailed API function declarations can be found in the [index.d.ts](./index.d.ts).
34
-
35
- Or you can refer to the source code in [src/lib.rs](./src/lib.rs).
36
-
37
- ## Sample
38
-
39
- ```javascript
40
- import Clipboard from "@mariozechner/clipboard";
41
-
42
- console.log(await Clipboard.getText());
43
-
44
- console.log(await Clipboard.getHtml());
45
-
46
- if (await Clipboard.hasImage()) {
47
- console.log(await Clipboard.getImageBase64());
48
- } else {
49
- console.log("No Image");
50
- }
51
- ```
52
-
53
- ## Publish
54
-
55
- Everything is done with GitHub Action.
56
-
57
- Run `npm version patch` to bump the version.
58
- Then `git push --follow-tags` to push the changes and tags to GitHub. GitHub Action will automatically build and publish.
59
-
60
- The GitHub Actions `NPM_TOKEN` repository secret is a granular npm token with publish access to `@mariozechner/clipboard` and all `@mariozechner/clipboard-*` platform packages. npm granular access tokens expire after 90 days, so this secret must be rotated before expiry.
@@ -1,5 +0,0 @@
1
- extern crate napi_build;
2
-
3
- fn main() {
4
- napi_build::setup();
5
- }