@valni/cli-darwin-x64 0.1.2 → 0.1.4

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 (149) hide show
  1. package/LICENSE +1 -2
  2. package/package.json +1 -1
  3. package/runtime/LICENSE +1 -2
  4. package/runtime/examples/extensions/auto-commit-on-exit.ts +6 -6
  5. package/runtime/examples/extensions/bash-spawn-hook.ts +3 -3
  6. package/runtime/examples/extensions/bookmark.ts +5 -5
  7. package/runtime/examples/extensions/border-status-editor.ts +7 -7
  8. package/runtime/examples/extensions/built-in-tool-renderer.ts +6 -6
  9. package/runtime/examples/extensions/claude-rules.ts +4 -4
  10. package/runtime/examples/extensions/commands.ts +5 -5
  11. package/runtime/examples/extensions/confirm-destructive.ts +3 -3
  12. package/runtime/examples/extensions/custom-footer.ts +2 -2
  13. package/runtime/examples/extensions/custom-header.ts +5 -5
  14. package/runtime/examples/extensions/custom-provider-anthropic/index.ts +4 -4
  15. package/runtime/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  16. package/runtime/examples/extensions/custom-provider-anthropic/package.json +3 -3
  17. package/runtime/examples/extensions/dirty-repo-guard.ts +7 -7
  18. package/runtime/examples/extensions/doom-overlay/doom/build.sh +4 -4
  19. package/runtime/examples/extensions/doom-overlay/doom/{doomgeneric_pi.c → doomgeneric_valni.c} +1 -1
  20. package/runtime/examples/extensions/doom-overlay/index.ts +3 -3
  21. package/runtime/examples/extensions/dynamic-resources/dynamic.json +0 -1
  22. package/runtime/examples/extensions/dynamic-resources/index.ts +2 -4
  23. package/runtime/examples/extensions/dynamic-tools.ts +4 -4
  24. package/runtime/examples/extensions/entry-renderer.ts +6 -6
  25. package/runtime/examples/extensions/event-bus.ts +8 -8
  26. package/runtime/examples/extensions/file-trigger.ts +3 -3
  27. package/runtime/examples/extensions/git-checkpoint.ts +7 -7
  28. package/runtime/examples/extensions/git-merge-and-resolve.ts +14 -14
  29. package/runtime/examples/extensions/github-issue-autocomplete.ts +6 -6
  30. package/runtime/examples/extensions/hello.ts +2 -2
  31. package/runtime/examples/extensions/hidden-thinking-label.ts +4 -4
  32. package/runtime/examples/extensions/inline-bash.ts +5 -5
  33. package/runtime/examples/extensions/input-transform-streaming.ts +5 -5
  34. package/runtime/examples/extensions/input-transform.ts +5 -5
  35. package/runtime/examples/extensions/interactive-shell.ts +3 -3
  36. package/runtime/examples/extensions/mac-system-theme.ts +5 -5
  37. package/runtime/examples/extensions/message-renderer.ts +4 -4
  38. package/runtime/examples/extensions/minimal-mode.ts +9 -9
  39. package/runtime/examples/extensions/modal-editor.ts +3 -3
  40. package/runtime/examples/extensions/model-status.ts +3 -3
  41. package/runtime/examples/extensions/notify.ts +5 -5
  42. package/runtime/examples/extensions/overlay-qa-tests.ts +20 -20
  43. package/runtime/examples/extensions/overlay-test.ts +3 -3
  44. package/runtime/examples/extensions/permission-gate.ts +2 -2
  45. package/runtime/examples/extensions/pirate.ts +4 -4
  46. package/runtime/examples/extensions/plan-mode/index.ts +21 -21
  47. package/runtime/examples/extensions/preset.ts +26 -26
  48. package/runtime/examples/extensions/project-trust.ts +7 -7
  49. package/runtime/examples/extensions/prompt-customizer.ts +3 -3
  50. package/runtime/examples/extensions/protected-paths.ts +2 -2
  51. package/runtime/examples/extensions/provider-payload.ts +3 -3
  52. package/runtime/examples/extensions/question.ts +2 -2
  53. package/runtime/examples/extensions/questionnaire.ts +2 -2
  54. package/runtime/examples/extensions/rainbow-editor.ts +3 -3
  55. package/runtime/examples/extensions/reload-runtime.ts +4 -4
  56. package/runtime/examples/extensions/rpc-demo.ts +10 -10
  57. package/runtime/examples/extensions/sandbox/index.ts +15 -15
  58. package/runtime/examples/extensions/sandbox/package-lock.json +4 -4
  59. package/runtime/examples/extensions/sandbox/package.json +3 -3
  60. package/runtime/examples/extensions/send-user-message.ts +13 -13
  61. package/runtime/examples/extensions/session-name.ts +4 -4
  62. package/runtime/examples/extensions/shutdown-command.ts +10 -10
  63. package/runtime/examples/extensions/snake.ts +3 -3
  64. package/runtime/examples/extensions/space-invaders.ts +3 -3
  65. package/runtime/examples/extensions/ssh.ts +12 -12
  66. package/runtime/examples/extensions/status-line.ts +4 -4
  67. package/runtime/examples/extensions/structured-output.ts +2 -2
  68. package/runtime/examples/extensions/subagent/index.ts +5 -5
  69. package/runtime/examples/extensions/system-prompt-header.ts +3 -3
  70. package/runtime/examples/extensions/tic-tac-toe.ts +15 -15
  71. package/runtime/examples/extensions/timed-confirm.ts +4 -4
  72. package/runtime/examples/extensions/titlebar-spinner.ts +11 -11
  73. package/runtime/examples/extensions/todo.ts +5 -5
  74. package/runtime/examples/extensions/tool-override.ts +5 -5
  75. package/runtime/examples/extensions/tools.ts +10 -10
  76. package/runtime/examples/extensions/trigger-compact.ts +3 -3
  77. package/runtime/examples/extensions/truncated-tool.ts +3 -3
  78. package/runtime/examples/extensions/widget-placement.ts +2 -2
  79. package/runtime/examples/extensions/with-deps/index.ts +2 -2
  80. package/runtime/examples/extensions/with-deps/package-lock.json +4 -4
  81. package/runtime/examples/extensions/with-deps/package.json +3 -3
  82. package/runtime/examples/extensions/working-indicator.ts +7 -7
  83. package/runtime/examples/extensions/working-message-test.ts +3 -3
  84. package/runtime/examples/sdk/01-minimal.ts +1 -1
  85. package/runtime/examples/sdk/03-custom-prompt.ts +1 -1
  86. package/runtime/examples/sdk/04-skills.ts +1 -1
  87. package/runtime/examples/sdk/05-tools.ts +1 -1
  88. package/runtime/examples/sdk/06-extensions.ts +11 -11
  89. package/runtime/examples/sdk/08-prompt-templates.ts +1 -1
  90. package/runtime/export-html/template.js +3 -3
  91. package/runtime/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  92. package/runtime/package.json +8 -14
  93. package/runtime/theme/dark.json +0 -1
  94. package/runtime/theme/light.json +0 -1
  95. package/runtime/theme/theme-schema.json +2 -2
  96. package/runtime/valni +2 -2
  97. package/runtime/README.md +0 -674
  98. package/runtime/docs/extensions.md +0 -2910
  99. package/runtime/docs/json.md +0 -82
  100. package/runtime/docs/models.md +0 -540
  101. package/runtime/docs/packages.md +0 -228
  102. package/runtime/docs/rpc.md +0 -1480
  103. package/runtime/docs/sdk.md +0 -1183
  104. package/runtime/docs/session-format.md +0 -422
  105. package/runtime/docs/settings.md +0 -315
  106. package/runtime/docs/shell-aliases.md +0 -13
  107. package/runtime/docs/terminal-setup.md +0 -142
  108. package/runtime/docs/termux.md +0 -127
  109. package/runtime/docs/tmux.md +0 -63
  110. package/runtime/docs/tui.md +0 -927
  111. package/runtime/docs/windows.md +0 -17
  112. package/runtime/examples/README.md +0 -25
  113. package/runtime/examples/extensions/README.md +0 -212
  114. package/runtime/examples/extensions/doom-overlay/README.md +0 -46
  115. package/runtime/examples/extensions/dynamic-resources/SKILL.md +0 -8
  116. package/runtime/examples/extensions/dynamic-resources/dynamic.md +0 -5
  117. package/runtime/examples/extensions/gondolin/index.ts +0 -531
  118. package/runtime/examples/extensions/gondolin/package-lock.json +0 -185
  119. package/runtime/examples/extensions/gondolin/package.json +0 -19
  120. package/runtime/examples/extensions/plan-mode/README.md +0 -66
  121. package/runtime/examples/extensions/subagent/README.md +0 -175
  122. package/runtime/examples/extensions/subagent/agents/planner.md +0 -37
  123. package/runtime/examples/extensions/subagent/agents/reviewer.md +0 -35
  124. package/runtime/examples/extensions/subagent/agents/scout.md +0 -50
  125. package/runtime/examples/extensions/subagent/agents/worker.md +0 -24
  126. package/runtime/examples/extensions/subagent/prompts/implement-and-review.md +0 -10
  127. package/runtime/examples/extensions/subagent/prompts/implement.md +0 -10
  128. package/runtime/examples/extensions/subagent/prompts/scout-and-plan.md +0 -9
  129. package/runtime/examples/sdk/README.md +0 -140
  130. package/runtime/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  131. package/runtime/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
  132. package/runtime/node_modules/@mariozechner/clipboard/README.md +0 -60
  133. package/runtime/node_modules/@mariozechner/clipboard/build.rs +0 -5
  134. package/runtime/node_modules/@mariozechner/clipboard/clipboard.darwin-x64.node +0 -0
  135. package/runtime/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  136. package/runtime/node_modules/@mariozechner/clipboard/index.js +0 -606
  137. package/runtime/node_modules/@mariozechner/clipboard/package.json +0 -56
  138. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
  139. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
  140. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
  141. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
  142. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
  143. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
  144. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
  145. package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
  146. package/runtime/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
  147. package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/README.md +0 -3
  148. package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/clipboard.darwin-x64.node +0 -0
  149. package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/package.json +0 -22
@@ -655,9 +655,9 @@ function getBoardDetails(): BoardDetails {
655
655
  };
656
656
  }
657
657
 
658
- export default function (pi: ExtensionAPI) {
659
- pi.on("session_start", async (_event, ctx) => reconstructState(ctx));
660
- pi.on("session_tree", async (_event, ctx) => reconstructState(ctx));
658
+ export default function (valni: ExtensionAPI) {
659
+ valni.on("session_start", async (_event, ctx) => reconstructState(ctx));
660
+ valni.on("session_tree", async (_event, ctx) => reconstructState(ctx));
661
661
 
662
662
  // Sent once per game at end-of-game. The custom renderer paints the banner;
663
663
  // `content` is a plain-text fallback for any non-TUI consumer and for the
@@ -671,7 +671,7 @@ export default function (pi: ExtensionAPI) {
671
671
  : gameState.status === "draw"
672
672
  ? "Draw"
673
673
  : "Game over";
674
- pi.sendMessage({
674
+ valni.sendMessage({
675
675
  customType: GAME_OVER_MESSAGE_TYPE,
676
676
  content: `Game over: ${label}.`,
677
677
  display: true,
@@ -682,7 +682,7 @@ export default function (pi: ExtensionAPI) {
682
682
  // -----------------------------------------------------------------------
683
683
  // Custom message renderer for user move messages
684
684
  // -----------------------------------------------------------------------
685
- pi.registerMessageRenderer(MOVE_MESSAGE_TYPE, (message, { expanded }, theme) => {
685
+ valni.registerMessageRenderer(MOVE_MESSAGE_TYPE, (message, { expanded }, theme) => {
686
686
  const details = message.details as BoardDetails | undefined;
687
687
  const turnLabel =
688
688
  details?.currentTurn === "O"
@@ -695,7 +695,7 @@ export default function (pi: ExtensionAPI) {
695
695
  // -----------------------------------------------------------------------
696
696
  // Custom message renderer for game-over messages
697
697
  // -----------------------------------------------------------------------
698
- pi.registerMessageRenderer(GAME_OVER_MESSAGE_TYPE, (message, _options, theme) => {
698
+ valni.registerMessageRenderer(GAME_OVER_MESSAGE_TYPE, (message, _options, theme) => {
699
699
  const details = message.details as BoardDetails | undefined;
700
700
  const status = (details?.status ?? "draw") as GameStatus;
701
701
  return new GameOverMessageComponent(status, details, theme);
@@ -704,7 +704,7 @@ export default function (pi: ExtensionAPI) {
704
704
  // -----------------------------------------------------------------------
705
705
  // before_agent_start - inject game instructions each turn
706
706
  // -----------------------------------------------------------------------
707
- pi.on("before_agent_start", async (event) => {
707
+ valni.on("before_agent_start", async (event) => {
708
708
  if (!gameActive) return undefined;
709
709
 
710
710
  const instructions = `
@@ -775,7 +775,7 @@ Decide the target cell first, then dump every action for the turn in one go.
775
775
  // -----------------------------------------------------------------------
776
776
  // /tic-tac-toe command
777
777
  // -----------------------------------------------------------------------
778
- pi.registerCommand("tic-tac-toe", {
778
+ valni.registerCommand("tic-tac-toe", {
779
779
  description: "Play tic-tac-toe against the agent",
780
780
 
781
781
  handler: async (_args, ctx) => {
@@ -789,7 +789,7 @@ Decide the target cell first, then dump every action for the turn in one go.
789
789
  gameState = createInitialState();
790
790
  }
791
791
  gameActive = true;
792
- pi.setSessionName("Tic-Tac-Toe");
792
+ valni.setSessionName("Tic-Tac-Toe");
793
793
 
794
794
  await ctx.ui.custom<void>((tui, _theme, _kb, done) => {
795
795
  component = new TicTacToeComponent(
@@ -806,7 +806,7 @@ Decide the target cell first, then dump every action for the turn in one go.
806
806
  gameState.currentTurn = gameState.agentMark;
807
807
  }
808
808
  component?.updateState(gameState);
809
- pi.appendEntry(SAVE_TYPE, getBoardDetails());
809
+ valni.appendEntry(SAVE_TYPE, getBoardDetails());
810
810
 
811
811
  if (gameState.status === "playing") {
812
812
  // IMPORTANT: user play does NOT touch the agent cursor.
@@ -816,7 +816,7 @@ Decide the target cell first, then dump every action for the turn in one go.
816
816
  gameState.agentCursorRow,
817
817
  gameState.agentCursorCol,
818
818
  );
819
- pi.sendMessage(
819
+ valni.sendMessage(
820
820
  {
821
821
  customType: MOVE_MESSAGE_TYPE,
822
822
  content:
@@ -856,7 +856,7 @@ Decide the target cell first, then dump every action for the turn in one go.
856
856
  play: 0,
857
857
  };
858
858
 
859
- pi.registerTool({
859
+ valni.registerTool({
860
860
  name: "tic_tac_toe",
861
861
  label: "Tic-Tac-Toe",
862
862
  description:
@@ -910,7 +910,7 @@ Decide the target cell first, then dump every action for the turn in one go.
910
910
  // Do NOT reset the cursor on failure. The agent can retry
911
911
  // from the cursor's current position.
912
912
  component?.updateState(gameState);
913
- pi.appendEntry(SAVE_TYPE, getBoardDetails());
913
+ valni.appendEntry(SAVE_TYPE, getBoardDetails());
914
914
  throw new TicTacToeError(
915
915
  `Cell (${r},${c}) is already ${gameState.board[r][c]}. Your cursor is still at (${r},${c}). Move to an empty cell and retry play.`,
916
916
  );
@@ -939,7 +939,7 @@ Decide the target cell first, then dump every action for the turn in one go.
939
939
  }
940
940
 
941
941
  component?.updateState(gameState);
942
- pi.appendEntry(SAVE_TYPE, getBoardDetails());
942
+ valni.appendEntry(SAVE_TYPE, getBoardDetails());
943
943
 
944
944
  return {
945
945
  content: [{ type: "text", text: result }],
@@ -969,7 +969,7 @@ Decide the target cell first, then dump every action for the turn in one go.
969
969
  // -----------------------------------------------------------------------
970
970
  // tic_tac_toe_see_board tool - inspect board + agent cursor.
971
971
  // -----------------------------------------------------------------------
972
- pi.registerTool({
972
+ valni.registerTool({
973
973
  name: "tic_tac_toe_see_board",
974
974
  label: "See Board",
975
975
  description:
@@ -9,9 +9,9 @@
9
9
 
10
10
  import type { ExtensionAPI } from "@valni/cli";
11
11
 
12
- export default function (pi: ExtensionAPI) {
12
+ export default function (valni: ExtensionAPI) {
13
13
  // Simple approach: use timeout option (recommended)
14
- pi.registerCommand("timed", {
14
+ valni.registerCommand("timed", {
15
15
  description: "Show a timed confirmation dialog (auto-cancels in 5s with countdown)",
16
16
  handler: async (_args, ctx) => {
17
17
  const confirmed = await ctx.ui.confirm(
@@ -28,7 +28,7 @@ export default function (pi: ExtensionAPI) {
28
28
  },
29
29
  });
30
30
 
31
- pi.registerCommand("timed-select", {
31
+ valni.registerCommand("timed-select", {
32
32
  description: "Show a timed select dialog (auto-cancels in 10s with countdown)",
33
33
  handler: async (_args, ctx) => {
34
34
  const choice = await ctx.ui.select("Pick an option", ["Option A", "Option B", "Option C"], { timeout: 10000 });
@@ -42,7 +42,7 @@ export default function (pi: ExtensionAPI) {
42
42
  });
43
43
 
44
44
  // Manual approach: use AbortSignal for more control
45
- pi.registerCommand("timed-signal", {
45
+ valni.registerCommand("timed-signal", {
46
46
  description: "Show a timed confirm using AbortSignal (manual approach)",
47
47
  handler: async (_args, ctx) => {
48
48
  const controller = new AbortController();
@@ -5,7 +5,7 @@
5
5
  * Uses `ctx.ui.setTitle()` to update the terminal title via the extension API.
6
6
  *
7
7
  * Usage:
8
- * pi --extension examples/extensions/titlebar-spinner.ts
8
+ * valni --extension examples/extensions/titlebar-spinner.ts
9
9
  */
10
10
 
11
11
  import path from "node:path";
@@ -13,13 +13,13 @@ import type { ExtensionAPI, ExtensionContext } from "@valni/cli";
13
13
 
14
14
  const BRAILLE_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
15
15
 
16
- function getBaseTitle(pi: ExtensionAPI): string {
16
+ function getBaseTitle(valni: ExtensionAPI): string {
17
17
  const cwd = path.basename(process.cwd());
18
- const session = pi.getSessionName();
19
- return session ? `π - ${session} - ${cwd}` : `π - ${cwd}`;
18
+ const session = valni.getSessionName();
19
+ return session ? `valni - ${session} - ${cwd}` : `valni - ${cwd}`;
20
20
  }
21
21
 
22
- export default function (pi: ExtensionAPI) {
22
+ export default function (valni: ExtensionAPI) {
23
23
  let timer: ReturnType<typeof setInterval> | null = null;
24
24
  let frameIndex = 0;
25
25
 
@@ -29,7 +29,7 @@ export default function (pi: ExtensionAPI) {
29
29
  timer = null;
30
30
  }
31
31
  frameIndex = 0;
32
- ctx.ui.setTitle(getBaseTitle(pi));
32
+ ctx.ui.setTitle(getBaseTitle(valni));
33
33
  }
34
34
 
35
35
  function startAnimation(ctx: ExtensionContext) {
@@ -37,22 +37,22 @@ export default function (pi: ExtensionAPI) {
37
37
  timer = setInterval(() => {
38
38
  const frame = BRAILLE_FRAMES[frameIndex % BRAILLE_FRAMES.length];
39
39
  const cwd = path.basename(process.cwd());
40
- const session = pi.getSessionName();
41
- const title = session ? `${frame} π - ${session} - ${cwd}` : `${frame} π - ${cwd}`;
40
+ const session = valni.getSessionName();
41
+ const title = session ? `${frame} valni - ${session} - ${cwd}` : `${frame} valni - ${cwd}`;
42
42
  ctx.ui.setTitle(title);
43
43
  frameIndex++;
44
44
  }, 80);
45
45
  }
46
46
 
47
- pi.on("agent_start", async (_event, ctx) => {
47
+ valni.on("agent_start", async (_event, ctx) => {
48
48
  startAnimation(ctx);
49
49
  });
50
50
 
51
- pi.on("agent_end", async (_event, ctx) => {
51
+ valni.on("agent_end", async (_event, ctx) => {
52
52
  stopAnimation(ctx);
53
53
  });
54
54
 
55
- pi.on("session_shutdown", async (_event, ctx) => {
55
+ valni.on("session_shutdown", async (_event, ctx) => {
56
56
  stopAnimation(ctx);
57
57
  });
58
58
  }
@@ -102,7 +102,7 @@ class TodoListComponent {
102
102
  }
103
103
  }
104
104
 
105
- export default function (pi: ExtensionAPI) {
105
+ export default function (valni: ExtensionAPI) {
106
106
  // In-memory state (reconstructed from session on load)
107
107
  let todos: Todo[] = [];
108
108
  let nextId = 1;
@@ -129,11 +129,11 @@ export default function (pi: ExtensionAPI) {
129
129
  };
130
130
 
131
131
  // Reconstruct state on session events
132
- pi.on("session_start", async (_event, ctx) => reconstructState(ctx));
133
- pi.on("session_tree", async (_event, ctx) => reconstructState(ctx));
132
+ valni.on("session_start", async (_event, ctx) => reconstructState(ctx));
133
+ valni.on("session_tree", async (_event, ctx) => reconstructState(ctx));
134
134
 
135
135
  // Register the todo tool for the LLM
136
- pi.registerTool({
136
+ valni.registerTool({
137
137
  name: "todo",
138
138
  label: "Todo",
139
139
  description: "Manage a todo list. Actions: list, add (text), toggle (id), clear",
@@ -281,7 +281,7 @@ export default function (pi: ExtensionAPI) {
281
281
  });
282
282
 
283
283
  // Register the /todos command for users
284
- pi.registerCommand("todos", {
284
+ valni.registerCommand("todos", {
285
285
  description: "Show all todos on the current branch",
286
286
  handler: async (_args, ctx) => {
287
287
  if (ctx.mode !== "tui") {
@@ -5,7 +5,7 @@
5
5
  * This is useful for:
6
6
  * - Adding logging or auditing to tool calls
7
7
  * - Implementing access control or sandboxing
8
- * - Routing tool calls to remote systems (e.g., pi-ssh-remote)
8
+ * - Routing tool calls to remote systems (e.g., valni-ssh-remote)
9
9
  * - Modifying tool behavior for specific workflows
10
10
  *
11
11
  * This example overrides the `read` tool to:
@@ -17,7 +17,7 @@
17
17
  * is used automatically (syntax highlighting, line numbers, truncation warnings).
18
18
  *
19
19
  * Usage:
20
- * pi -e ./tool-override.ts
20
+ * valni -e ./tool-override.ts
21
21
  */
22
22
 
23
23
  import type { TextContent } from "@valni/ai";
@@ -65,8 +65,8 @@ const readSchema = Type.Object({
65
65
  limit: Type.Optional(Type.Number({ description: "Maximum number of lines to read" })),
66
66
  });
67
67
 
68
- export default function (pi: ExtensionAPI) {
69
- pi.registerTool({
68
+ export default function (valni: ExtensionAPI) {
69
+ valni.registerTool({
70
70
  name: "read", // Same name as built-in - this will override it
71
71
  label: "read (audited)",
72
72
  description:
@@ -129,7 +129,7 @@ export default function (pi: ExtensionAPI) {
129
129
  });
130
130
 
131
131
  // Also register a command to view the access log
132
- pi.registerCommand("read-log", {
132
+ valni.registerCommand("read-log", {
133
133
  description: "View the file access log",
134
134
  handler: async (_args, ctx) => {
135
135
  try {
@@ -5,7 +5,7 @@
5
5
  * Tool selection persists across session reloads and respects branch navigation.
6
6
  *
7
7
  * Usage:
8
- * 1. Copy this file to ~/.pi/agent/extensions/ or your project's .pi/extensions/
8
+ * 1. Copy this file to ~/.valni/agent/extensions/ or your project's .valni/extensions/
9
9
  * 2. Use /tools to open the tool selector
10
10
  */
11
11
 
@@ -18,26 +18,26 @@ interface ToolsState {
18
18
  enabledTools: string[];
19
19
  }
20
20
 
21
- export default function toolsExtension(pi: ExtensionAPI) {
21
+ export default function toolsExtension(valni: ExtensionAPI) {
22
22
  // Track enabled tools
23
23
  let enabledTools: Set<string> = new Set();
24
24
  let allTools: ToolInfo[] = [];
25
25
 
26
26
  // Persist current state
27
27
  function persistState() {
28
- pi.appendEntry<ToolsState>("tools-config", {
28
+ valni.appendEntry<ToolsState>("tools-config", {
29
29
  enabledTools: Array.from(enabledTools),
30
30
  });
31
31
  }
32
32
 
33
33
  // Apply current tool selection
34
34
  function applyTools() {
35
- pi.setActiveTools(Array.from(enabledTools));
35
+ valni.setActiveTools(Array.from(enabledTools));
36
36
  }
37
37
 
38
38
  // Find the last tools-config entry in the current branch
39
39
  function restoreFromBranch(ctx: ExtensionContext) {
40
- allTools = pi.getAllTools();
40
+ allTools = valni.getAllTools();
41
41
 
42
42
  // Get entries in current branch only
43
43
  const branchEntries = ctx.sessionManager.getBranch();
@@ -59,12 +59,12 @@ export default function toolsExtension(pi: ExtensionAPI) {
59
59
  applyTools();
60
60
  } else {
61
61
  // No saved state - sync with currently active tools
62
- enabledTools = new Set(pi.getActiveTools());
62
+ enabledTools = new Set(valni.getActiveTools());
63
63
  }
64
64
  }
65
65
 
66
66
  // Register /tools command
67
- pi.registerCommand("tools", {
67
+ valni.registerCommand("tools", {
68
68
  description: "Enable/disable tools",
69
69
  handler: async (_args, ctx) => {
70
70
  if (ctx.mode !== "tui") {
@@ -73,7 +73,7 @@ export default function toolsExtension(pi: ExtensionAPI) {
73
73
  }
74
74
 
75
75
  // Refresh tool list
76
- allTools = pi.getAllTools();
76
+ allTools = valni.getAllTools();
77
77
 
78
78
  await ctx.ui.custom((tui, theme, _kb, done) => {
79
79
  // Build settings items for each tool
@@ -135,12 +135,12 @@ export default function toolsExtension(pi: ExtensionAPI) {
135
135
  });
136
136
 
137
137
  // Restore state on session start
138
- pi.on("session_start", async (_event, ctx) => {
138
+ valni.on("session_start", async (_event, ctx) => {
139
139
  restoreFromBranch(ctx);
140
140
  });
141
141
 
142
142
  // Restore state when navigating the session tree
143
- pi.on("session_tree", async (_event, ctx) => {
143
+ valni.on("session_tree", async (_event, ctx) => {
144
144
  restoreFromBranch(ctx);
145
145
  });
146
146
  }
@@ -2,7 +2,7 @@ import type { ExtensionAPI, ExtensionContext } from "@valni/cli";
2
2
 
3
3
  const COMPACT_THRESHOLD_TOKENS = 100_000;
4
4
 
5
- export default function (pi: ExtensionAPI) {
5
+ export default function (valni: ExtensionAPI) {
6
6
  let previousTokens: number | null | undefined;
7
7
 
8
8
  const triggerCompaction = (ctx: ExtensionContext, customInstructions?: string) => {
@@ -24,7 +24,7 @@ export default function (pi: ExtensionAPI) {
24
24
  });
25
25
  };
26
26
 
27
- pi.on("turn_end", (_event, ctx) => {
27
+ valni.on("turn_end", (_event, ctx) => {
28
28
  const usage = ctx.getContextUsage();
29
29
  const currentTokens = usage?.tokens ?? null;
30
30
  if (currentTokens === null) {
@@ -40,7 +40,7 @@ export default function (pi: ExtensionAPI) {
40
40
  triggerCompaction(ctx);
41
41
  });
42
42
 
43
- pi.registerCommand("trigger-compact", {
43
+ valni.registerCommand("trigger-compact", {
44
44
  description: "Trigger compaction immediately",
45
45
  handler: async (args, ctx) => {
46
46
  const instructions = args.trim() || undefined;
@@ -45,8 +45,8 @@ interface RgDetails {
45
45
  fullOutputPath?: string;
46
46
  }
47
47
 
48
- export default function (pi: ExtensionAPI) {
49
- pi.registerTool({
48
+ export default function (valni: ExtensionAPI) {
49
+ valni.registerTool({
50
50
  name: "rg",
51
51
  label: "ripgrep",
52
52
  // Document the truncation limits in the tool description so the LLM knows
@@ -109,7 +109,7 @@ export default function (pi: ExtensionAPI) {
109
109
 
110
110
  if (truncation.truncated) {
111
111
  // Save full output to a temp file so LLM can access it if needed
112
- const tempDir = await mkdtemp(join(tmpdir(), "pi-rg-"));
112
+ const tempDir = await mkdtemp(join(tmpdir(), "valni-rg-"));
113
113
  const tempFile = join(tempDir, "output.txt");
114
114
  await withFileMutationQueue(tempFile, async () => {
115
115
  await writeFile(tempFile, output, "utf8");
@@ -1,7 +1,7 @@
1
1
  import type { ExtensionAPI } from "@valni/cli";
2
2
 
3
- export default function widgetPlacementExtension(pi: ExtensionAPI) {
4
- pi.on("session_start", (_event, ctx) => {
3
+ export default function widgetPlacementExtension(valni: ExtensionAPI) {
4
+ valni.on("session_start", (_event, ctx) => {
5
5
  if (!ctx.hasUI) return;
6
6
  ctx.ui.setWidget("widget-above", ["Above editor widget"]);
7
7
  ctx.ui.setWidget("widget-below", ["Below editor widget"], { placement: "belowEditor" });
@@ -9,9 +9,9 @@ import type { ExtensionAPI } from "@valni/cli";
9
9
  import ms from "ms";
10
10
  import { Type } from "typebox";
11
11
 
12
- export default function (pi: ExtensionAPI) {
12
+ export default function (valni: ExtensionAPI) {
13
13
  // Register a tool that uses ms
14
- pi.registerTool({
14
+ valni.registerTool({
15
15
  name: "parse_duration",
16
16
  label: "Parse Duration",
17
17
  description: "Parse a human-readable duration string (e.g., '2 days', '1h', '5m') to milliseconds",
@@ -1,12 +1,12 @@
1
1
  {
2
- "name": "pi-extension-with-deps",
3
- "version": "0.80.10",
2
+ "name": "valni-extension-with-deps",
3
+ "version": "0.80.11",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "name": "pi-extension-with-deps",
9
- "version": "0.80.10",
8
+ "name": "valni-extension-with-deps",
9
+ "version": "0.80.11",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,14 +1,14 @@
1
1
  {
2
- "name": "pi-extension-with-deps",
2
+ "name": "valni-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.80.10",
4
+ "version": "0.80.11",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
8
8
  "build": "echo 'nothing to build'",
9
9
  "check": "echo 'nothing to check'"
10
10
  },
11
- "pi": {
11
+ "valni": {
12
12
  "extensions": [
13
13
  "./index.ts"
14
14
  ]
@@ -2,10 +2,10 @@
2
2
  * Working Indicator Extension
3
3
  *
4
4
  * Demonstrates `ctx.ui.setWorkingIndicator()` for customizing the inline
5
- * working indicator shown while pi is streaming a response.
5
+ * working indicator shown while valni is streaming a response.
6
6
  *
7
7
  * Usage:
8
- * pi --extension examples/extensions/working-indicator.ts
8
+ * valni --extension examples/extensions/working-indicator.ts
9
9
  *
10
10
  * Commands:
11
11
  * /working-indicator Show current mode
@@ -13,7 +13,7 @@
13
13
  * /working-indicator pulse Use a custom animated indicator
14
14
  * /working-indicator none Hide the indicator entirely
15
15
  * /working-indicator spinner Restore an animated spinner
16
- * /working-indicator reset Restore pi's default spinner
16
+ * /working-indicator reset Restore valni's default spinner
17
17
  */
18
18
 
19
19
  import type { ExtensionAPI, ExtensionContext, WorkingIndicatorOptions } from "@valni/cli";
@@ -79,11 +79,11 @@ function describeMode(mode: WorkingIndicatorMode): string {
79
79
  case "spinner":
80
80
  return "custom spinner";
81
81
  case "default":
82
- return "pi default spinner";
82
+ return "valni default spinner";
83
83
  }
84
84
  }
85
85
 
86
- export default function (pi: ExtensionAPI) {
86
+ export default function (valni: ExtensionAPI) {
87
87
  let mode: WorkingIndicatorMode = "spinner";
88
88
 
89
89
  const applyIndicator = (ctx: ExtensionContext) => {
@@ -91,11 +91,11 @@ export default function (pi: ExtensionAPI) {
91
91
  ctx.ui.setStatus("working-indicator", ctx.ui.theme.fg("dim", `Indicator: ${describeMode(mode)}`));
92
92
  };
93
93
 
94
- pi.on("session_start", async (_event, ctx) => {
94
+ valni.on("session_start", async (_event, ctx) => {
95
95
  applyIndicator(ctx);
96
96
  });
97
97
 
98
- pi.registerCommand("working-indicator", {
98
+ valni.registerCommand("working-indicator", {
99
99
  description: "Set the streaming working indicator: dot, pulse, none, spinner, or reset.",
100
100
  handler: async (args, ctx) => {
101
101
  const nextMode = args.trim().toLowerCase();
@@ -5,7 +5,7 @@
5
5
  * verify they survive across loader recreations (e.g. between agent turns).
6
6
  *
7
7
  * Usage:
8
- * pi --extension examples/extensions/working-message-test.ts
8
+ * valni --extension examples/extensions/working-message-test.ts
9
9
  *
10
10
  * Then send a few messages in interactive mode. The working message should
11
11
  * stay "Working... (custom)" with a brown dot indicator every time the
@@ -17,8 +17,8 @@ import type { ExtensionAPI } from "@valni/cli";
17
17
  const CUSTOM_MESSAGE = "\x1b[38;2;155;86;63mWorking... (custom)\x1b[39m";
18
18
  const CUSTOM_INDICATOR = { frames: ["\x1b[38;2;155;86;63m●\x1b[39m"] };
19
19
 
20
- export default function (pi: ExtensionAPI) {
21
- pi.on("session_start", async (_event, ctx) => {
20
+ export default function (valni: ExtensionAPI) {
21
+ valni.on("session_start", async (_event, ctx) => {
22
22
  ctx.ui.setWorkingMessage(CUSTOM_MESSAGE);
23
23
  ctx.ui.setWorkingIndicator(CUSTOM_INDICATOR);
24
24
  });
@@ -2,7 +2,7 @@
2
2
  * Minimal SDK Usage
3
3
  *
4
4
  * Uses all defaults: discovers skills, extensions, tools, context files
5
- * from cwd and ~/.pi/agent. Model chosen from settings or first available.
5
+ * from cwd and ~/.valni/agent. Model chosen from settings or first available.
6
6
  */
7
7
 
8
8
  import { createAgentSession } from "@valni/cli";
@@ -15,7 +15,7 @@ const loader1 = new DefaultResourceLoader({
15
15
  agentDir,
16
16
  systemPromptOverride: () => `You are a helpful assistant that speaks like a pirate.
17
17
  Always end responses with "Arrr!"`,
18
- // Needed to avoid DefaultResourceLoader appending APPEND_SYSTEM.md from ~/.pi/agent or <cwd>/.pi.
18
+ // Needed to avoid DefaultResourceLoader appending APPEND_SYSTEM.md from ~/.valni/agent or <cwd>/.valni.
19
19
  appendSystemPromptOverride: () => [],
20
20
  });
21
21
  await loader1.reload();
@@ -37,7 +37,7 @@ const loader = new DefaultResourceLoader({
37
37
  });
38
38
  await loader.reload();
39
39
 
40
- // Discover all skills from cwd/.pi/skills, ~/.pi/agent/skills, etc.
40
+ // Discover all skills from cwd/.valni/skills, ~/.valni/agent/skills, etc.
41
41
  const { skills: allSkills, diagnostics } = loader.getSkills();
42
42
  console.log(
43
43
  "Discovered skills:",
@@ -7,7 +7,7 @@
7
7
  * createAgentSession() applies that cwd when it builds the actual built-in tools.
8
8
  *
9
9
  * For custom tools, see 06-extensions.ts - custom tools are registered via the
10
- * extensions system using pi.registerTool().
10
+ * extensions system using valni.registerTool().
11
11
  */
12
12
 
13
13
  import { createAgentSession, SessionManager } from "@valni/cli";
@@ -5,12 +5,12 @@
5
5
  * They provide a unified system for extensions, custom tools, commands, and more.
6
6
  *
7
7
  * By default, extension files are discovered from:
8
- * - ~/.pi/agent/extensions/
9
- * - <cwd>/.pi/extensions/
8
+ * - ~/.valni/agent/extensions/
9
+ * - <cwd>/.valni/extensions/
10
10
  * - Paths specified in settings.json "extensions" array
11
11
  *
12
12
  * An extension is a TypeScript file that exports a default function:
13
- * export default function (pi: ExtensionAPI) { ... }
13
+ * export default function (valni: ExtensionAPI) { ... }
14
14
  */
15
15
 
16
16
  import { createAgentSession, DefaultResourceLoader, getAgentDir, SessionManager } from "@valni/cli";
@@ -23,8 +23,8 @@ const resourceLoader = new DefaultResourceLoader({
23
23
  agentDir: getAgentDir(),
24
24
  additionalExtensionPaths: ["./my-logging-extension.ts", "./my-safety-extension.ts"],
25
25
  extensionFactories: [
26
- (pi) => {
27
- pi.on("agent_start", () => {
26
+ (valni) => {
27
+ valni.on("agent_start", () => {
28
28
  console.log("[Inline Extension] Agent starting");
29
29
  });
30
30
  },
@@ -54,23 +54,23 @@ try {
54
54
  /*
55
55
  import type { ExtensionAPI } from "@valni/cli";
56
56
 
57
- export default function (pi: ExtensionAPI) {
58
- pi.on("agent_start", async () => {
57
+ export default function (valni: ExtensionAPI) {
58
+ valni.on("agent_start", async () => {
59
59
  console.log("[Extension] Agent starting");
60
60
  });
61
61
 
62
- pi.on("tool_call", async (event) => {
62
+ valni.on("tool_call", async (event) => {
63
63
  console.log(\`[Extension] Tool: \${event.toolName}\`);
64
64
  // Return { block: true, reason: "..." } to block execution
65
65
  return undefined;
66
66
  });
67
67
 
68
- pi.on("agent_end", async (event) => {
68
+ valni.on("agent_end", async (event) => {
69
69
  console.log(\`[Extension] Done, \${event.messages.length} messages\`);
70
70
  });
71
71
 
72
72
  // Register a custom tool
73
- pi.registerTool({
73
+ valni.registerTool({
74
74
  name: "my_tool",
75
75
  label: "My Tool",
76
76
  description: "Does something useful",
@@ -84,7 +84,7 @@ export default function (pi: ExtensionAPI) {
84
84
  });
85
85
 
86
86
  // Register a command
87
- pi.registerCommand("mycommand", {
87
+ valni.registerCommand("mycommand", {
88
88
  description: "Do something",
89
89
  handler: async (args, ctx) => {
90
90
  ctx.ui.notify(\`Command executed with: \${args}\`);
@@ -36,7 +36,7 @@ const loader = new DefaultResourceLoader({
36
36
  });
37
37
  await loader.reload();
38
38
 
39
- // Discover templates from cwd/.pi/prompts/ and ~/.pi/agent/prompts/
39
+ // Discover templates from cwd/.valni/prompts/ and ~/.valni/agent/prompts/
40
40
  const discovered = loader.getPrompts().prompts;
41
41
  console.log("Discovered prompt templates:");
42
42
  for (const template of discovered) {