@mariozechner/pi-coding-agent 0.34.1 → 0.35.0

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 (251) hide show
  1. package/CHANGELOG.md +224 -18
  2. package/README.md +233 -105
  3. package/dist/cli/args.d.ts +3 -4
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +13 -18
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/config.d.ts +2 -2
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/config.js +3 -3
  10. package/dist/config.js.map +1 -1
  11. package/dist/core/agent-session.d.ts +39 -50
  12. package/dist/core/agent-session.d.ts.map +1 -1
  13. package/dist/core/agent-session.js +166 -197
  14. package/dist/core/agent-session.js.map +1 -1
  15. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  16. package/dist/core/compaction/branch-summarization.js +3 -3
  17. package/dist/core/compaction/branch-summarization.js.map +1 -1
  18. package/dist/core/compaction/compaction.d.ts +1 -1
  19. package/dist/core/compaction/compaction.d.ts.map +1 -1
  20. package/dist/core/compaction/compaction.js +6 -5
  21. package/dist/core/compaction/compaction.js.map +1 -1
  22. package/dist/core/event-bus.d.ts +9 -0
  23. package/dist/core/event-bus.d.ts.map +1 -0
  24. package/dist/core/event-bus.js +25 -0
  25. package/dist/core/event-bus.js.map +1 -0
  26. package/dist/core/exec.d.ts +1 -1
  27. package/dist/core/exec.d.ts.map +1 -1
  28. package/dist/core/exec.js +1 -1
  29. package/dist/core/exec.js.map +1 -1
  30. package/dist/core/extensions/index.d.ts +10 -0
  31. package/dist/core/extensions/index.d.ts.map +1 -0
  32. package/dist/core/extensions/index.js +9 -0
  33. package/dist/core/extensions/index.js.map +1 -0
  34. package/dist/core/extensions/loader.d.ts +21 -0
  35. package/dist/core/extensions/loader.d.ts.map +1 -0
  36. package/dist/core/extensions/loader.js +400 -0
  37. package/dist/core/extensions/loader.js.map +1 -0
  38. package/dist/core/extensions/runner.d.ts +88 -0
  39. package/dist/core/extensions/runner.d.ts.map +1 -0
  40. package/dist/core/{hooks → extensions}/runner.js +52 -141
  41. package/dist/core/extensions/runner.js.map +1 -0
  42. package/dist/core/extensions/types.d.ts +461 -0
  43. package/dist/core/extensions/types.d.ts.map +1 -0
  44. package/dist/core/{hooks → extensions}/types.js +7 -4
  45. package/dist/core/extensions/types.js.map +1 -0
  46. package/dist/core/extensions/wrapper.d.ts +25 -0
  47. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  48. package/dist/core/{hooks/tool-wrapper.js → extensions/wrapper.js} +39 -24
  49. package/dist/core/extensions/wrapper.js.map +1 -0
  50. package/dist/core/index.d.ts +2 -2
  51. package/dist/core/index.d.ts.map +1 -1
  52. package/dist/core/index.js +3 -2
  53. package/dist/core/index.js.map +1 -1
  54. package/dist/core/messages.d.ts +7 -7
  55. package/dist/core/messages.d.ts.map +1 -1
  56. package/dist/core/messages.js +4 -4
  57. package/dist/core/messages.js.map +1 -1
  58. package/dist/core/prompt-templates.d.ts +40 -0
  59. package/dist/core/prompt-templates.d.ts.map +1 -0
  60. package/dist/core/{slash-commands.js → prompt-templates.js} +31 -31
  61. package/dist/core/prompt-templates.js.map +1 -0
  62. package/dist/core/sdk.d.ts +29 -52
  63. package/dist/core/sdk.d.ts.map +1 -1
  64. package/dist/core/sdk.js +111 -211
  65. package/dist/core/sdk.js.map +1 -1
  66. package/dist/core/session-manager.d.ts +17 -17
  67. package/dist/core/session-manager.d.ts.map +1 -1
  68. package/dist/core/session-manager.js +25 -10
  69. package/dist/core/session-manager.js.map +1 -1
  70. package/dist/core/settings-manager.d.ts +3 -6
  71. package/dist/core/settings-manager.d.ts.map +1 -1
  72. package/dist/core/settings-manager.js +4 -11
  73. package/dist/core/settings-manager.js.map +1 -1
  74. package/dist/core/system-prompt.d.ts.map +1 -1
  75. package/dist/core/system-prompt.js +4 -2
  76. package/dist/core/system-prompt.js.map +1 -1
  77. package/dist/index.d.ts +4 -5
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +5 -6
  80. package/dist/index.js.map +1 -1
  81. package/dist/main.d.ts.map +1 -1
  82. package/dist/main.js +36 -33
  83. package/dist/main.js.map +1 -1
  84. package/dist/migrations.d.ts +7 -2
  85. package/dist/migrations.d.ts.map +1 -1
  86. package/dist/migrations.js +93 -4
  87. package/dist/migrations.js.map +1 -1
  88. package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
  89. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  90. package/dist/modes/interactive/components/bordered-loader.js +1 -1
  91. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  92. package/dist/modes/interactive/components/branch-summary-message.d.ts +1 -1
  93. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  94. package/dist/modes/interactive/components/branch-summary-message.js +1 -1
  95. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  96. package/dist/modes/interactive/components/compaction-summary-message.d.ts +1 -1
  97. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  98. package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
  99. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  100. package/dist/modes/interactive/components/custom-editor.d.ts +2 -2
  101. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  102. package/dist/modes/interactive/components/custom-editor.js +4 -4
  103. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  104. package/dist/modes/interactive/components/custom-message.d.ts +18 -0
  105. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  106. package/dist/modes/interactive/components/{hook-message.js → custom-message.js} +3 -3
  107. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  108. package/dist/modes/interactive/components/dynamic-border.d.ts +2 -2
  109. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  110. package/dist/modes/interactive/components/dynamic-border.js +2 -2
  111. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  112. package/dist/modes/interactive/components/{hook-editor.d.ts → extension-editor.d.ts} +3 -3
  113. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  114. package/dist/modes/interactive/components/{hook-editor.js → extension-editor.js} +4 -4
  115. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  116. package/dist/modes/interactive/components/{hook-input.d.ts → extension-input.d.ts} +3 -3
  117. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  118. package/dist/modes/interactive/components/{hook-input.js → extension-input.js} +3 -3
  119. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  120. package/dist/modes/interactive/components/{hook-selector.d.ts → extension-selector.d.ts} +3 -3
  121. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  122. package/dist/modes/interactive/components/{hook-selector.js → extension-selector.js} +3 -3
  123. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  124. package/dist/modes/interactive/components/footer.d.ts +3 -3
  125. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  126. package/dist/modes/interactive/components/footer.js +8 -8
  127. package/dist/modes/interactive/components/footer.js.map +1 -1
  128. package/dist/modes/interactive/components/tool-execution.d.ts +3 -3
  129. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  130. package/dist/modes/interactive/components/tool-execution.js +9 -9
  131. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  132. package/dist/modes/interactive/interactive-mode.d.ts +37 -44
  133. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  134. package/dist/modes/interactive/interactive-mode.js +143 -189
  135. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  136. package/dist/modes/print-mode.d.ts.map +1 -1
  137. package/dist/modes/print-mode.js +10 -33
  138. package/dist/modes/print-mode.js.map +1 -1
  139. package/dist/modes/rpc/rpc-client.d.ts +3 -3
  140. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  141. package/dist/modes/rpc/rpc-client.js +3 -3
  142. package/dist/modes/rpc/rpc-client.js.map +1 -1
  143. package/dist/modes/rpc/rpc-mode.d.ts +2 -2
  144. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  145. package/dist/modes/rpc/rpc-mode.js +33 -57
  146. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  147. package/dist/modes/rpc/rpc-types.d.ts +16 -16
  148. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  149. package/dist/modes/rpc/rpc-types.js.map +1 -1
  150. package/docs/extensions.md +1053 -0
  151. package/docs/rpc.md +4 -4
  152. package/docs/sdk.md +62 -93
  153. package/docs/session.md +22 -19
  154. package/docs/skills.md +1 -1
  155. package/docs/tui.md +1 -1
  156. package/examples/README.md +9 -15
  157. package/examples/extensions/README.md +141 -0
  158. package/examples/{hooks → extensions}/auto-commit-on-exit.ts +3 -3
  159. package/examples/extensions/chalk-logger.ts +26 -0
  160. package/examples/{hooks → extensions}/confirm-destructive.ts +3 -3
  161. package/examples/{hooks → extensions}/custom-compaction.ts +6 -6
  162. package/examples/{hooks → extensions}/dirty-repo-guard.ts +8 -4
  163. package/examples/{hooks → extensions}/file-trigger.ts +3 -3
  164. package/examples/{hooks → extensions}/git-checkpoint.ts +3 -3
  165. package/examples/{hooks → extensions}/handoff.ts +3 -3
  166. package/examples/extensions/hello.ts +25 -0
  167. package/examples/{hooks → extensions}/permission-gate.ts +3 -3
  168. package/examples/{hooks → extensions}/pirate.ts +5 -5
  169. package/examples/{hooks → extensions}/plan-mode.ts +6 -6
  170. package/examples/{hooks → extensions}/protected-paths.ts +3 -3
  171. package/examples/{hooks → extensions}/qna.ts +3 -3
  172. package/examples/{custom-tools/question/index.ts → extensions/question.ts} +13 -17
  173. package/examples/{hooks → extensions}/snake.ts +3 -3
  174. package/examples/{hooks → extensions}/status-line.ts +3 -3
  175. package/examples/{custom-tools → extensions}/subagent/README.md +15 -15
  176. package/examples/{custom-tools → extensions}/subagent/index.ts +22 -43
  177. package/examples/{custom-tools/todo/index.ts → extensions/todo.ts} +122 -39
  178. package/examples/{hooks → extensions}/tools.ts +5 -5
  179. package/examples/extensions/with-deps/index.ts +40 -0
  180. package/examples/extensions/with-deps/package-lock.json +31 -0
  181. package/examples/extensions/with-deps/package.json +16 -0
  182. package/examples/sdk/01-minimal.ts +1 -1
  183. package/examples/sdk/05-tools.ts +7 -41
  184. package/examples/sdk/06-extensions.ts +81 -0
  185. package/examples/sdk/08-prompt-templates.ts +42 -0
  186. package/examples/sdk/12-full-control.ts +10 -29
  187. package/examples/sdk/README.md +5 -5
  188. package/package.json +4 -4
  189. package/dist/core/custom-tools/index.d.ts +0 -7
  190. package/dist/core/custom-tools/index.d.ts.map +0 -1
  191. package/dist/core/custom-tools/index.js +0 -6
  192. package/dist/core/custom-tools/index.js.map +0 -1
  193. package/dist/core/custom-tools/loader.d.ts +0 -30
  194. package/dist/core/custom-tools/loader.d.ts.map +0 -1
  195. package/dist/core/custom-tools/loader.js +0 -276
  196. package/dist/core/custom-tools/loader.js.map +0 -1
  197. package/dist/core/custom-tools/types.d.ts +0 -144
  198. package/dist/core/custom-tools/types.d.ts.map +0 -1
  199. package/dist/core/custom-tools/types.js +0 -8
  200. package/dist/core/custom-tools/types.js.map +0 -1
  201. package/dist/core/custom-tools/wrapper.d.ts +0 -15
  202. package/dist/core/custom-tools/wrapper.d.ts.map +0 -1
  203. package/dist/core/custom-tools/wrapper.js +0 -23
  204. package/dist/core/custom-tools/wrapper.js.map +0 -1
  205. package/dist/core/hooks/index.d.ts +0 -6
  206. package/dist/core/hooks/index.d.ts.map +0 -1
  207. package/dist/core/hooks/index.js +0 -6
  208. package/dist/core/hooks/index.js.map +0 -1
  209. package/dist/core/hooks/loader.d.ts +0 -146
  210. package/dist/core/hooks/loader.d.ts.map +0 -1
  211. package/dist/core/hooks/loader.js +0 -275
  212. package/dist/core/hooks/loader.js.map +0 -1
  213. package/dist/core/hooks/runner.d.ts +0 -173
  214. package/dist/core/hooks/runner.d.ts.map +0 -1
  215. package/dist/core/hooks/runner.js.map +0 -1
  216. package/dist/core/hooks/tool-wrapper.d.ts +0 -17
  217. package/dist/core/hooks/tool-wrapper.d.ts.map +0 -1
  218. package/dist/core/hooks/tool-wrapper.js.map +0 -1
  219. package/dist/core/hooks/types.d.ts +0 -767
  220. package/dist/core/hooks/types.d.ts.map +0 -1
  221. package/dist/core/hooks/types.js.map +0 -1
  222. package/dist/core/slash-commands.d.ts +0 -40
  223. package/dist/core/slash-commands.d.ts.map +0 -1
  224. package/dist/core/slash-commands.js.map +0 -1
  225. package/dist/modes/interactive/components/hook-editor.d.ts.map +0 -1
  226. package/dist/modes/interactive/components/hook-editor.js.map +0 -1
  227. package/dist/modes/interactive/components/hook-input.d.ts.map +0 -1
  228. package/dist/modes/interactive/components/hook-input.js.map +0 -1
  229. package/dist/modes/interactive/components/hook-message.d.ts +0 -18
  230. package/dist/modes/interactive/components/hook-message.d.ts.map +0 -1
  231. package/dist/modes/interactive/components/hook-message.js.map +0 -1
  232. package/dist/modes/interactive/components/hook-selector.d.ts.map +0 -1
  233. package/dist/modes/interactive/components/hook-selector.js.map +0 -1
  234. package/docs/custom-tools.md +0 -514
  235. package/docs/extension-loading.md +0 -1004
  236. package/docs/hooks.md +0 -979
  237. package/docs/session-tree-plan.md +0 -441
  238. package/examples/custom-tools/README.md +0 -114
  239. package/examples/custom-tools/hello/index.ts +0 -21
  240. package/examples/hooks/README.md +0 -60
  241. package/examples/hooks/todo/index.ts +0 -134
  242. package/examples/sdk/06-hooks.ts +0 -61
  243. package/examples/sdk/08-slash-commands.ts +0 -42
  244. /package/examples/{custom-tools → extensions}/subagent/agents/planner.md +0 -0
  245. /package/examples/{custom-tools → extensions}/subagent/agents/reviewer.md +0 -0
  246. /package/examples/{custom-tools → extensions}/subagent/agents/scout.md +0 -0
  247. /package/examples/{custom-tools → extensions}/subagent/agents/worker.md +0 -0
  248. /package/examples/{custom-tools → extensions}/subagent/agents.ts +0 -0
  249. /package/examples/{custom-tools/subagent/commands → extensions/subagent/prompts}/implement-and-review.md +0 -0
  250. /package/examples/{custom-tools/subagent/commands → extensions/subagent/prompts}/implement.md +0 -0
  251. /package/examples/{custom-tools/subagent/commands → extensions/subagent/prompts}/scout-and-plan.md +0 -0
@@ -1,134 +0,0 @@
1
- /**
2
- * Todo Hook - Companion to the todo custom tool
3
- *
4
- * Registers a /todos command that displays all todos on the current branch
5
- * with a nice custom UI.
6
- */
7
-
8
- import type { HookAPI, Theme } from "@mariozechner/pi-coding-agent";
9
- import { matchesKey, truncateToWidth } from "@mariozechner/pi-tui";
10
-
11
- interface Todo {
12
- id: number;
13
- text: string;
14
- done: boolean;
15
- }
16
-
17
- interface TodoDetails {
18
- action: "list" | "add" | "toggle" | "clear";
19
- todos: Todo[];
20
- nextId: number;
21
- error?: string;
22
- }
23
-
24
- class TodoListComponent {
25
- private todos: Todo[];
26
- private theme: Theme;
27
- private onClose: () => void;
28
- private cachedWidth?: number;
29
- private cachedLines?: string[];
30
-
31
- constructor(todos: Todo[], theme: Theme, onClose: () => void) {
32
- this.todos = todos;
33
- this.theme = theme;
34
- this.onClose = onClose;
35
- }
36
-
37
- handleInput(data: string): void {
38
- if (matchesKey(data, "escape") || matchesKey(data, "ctrl+c")) {
39
- this.onClose();
40
- }
41
- }
42
-
43
- render(width: number): string[] {
44
- if (this.cachedLines && this.cachedWidth === width) {
45
- return this.cachedLines;
46
- }
47
-
48
- const lines: string[] = [];
49
- const th = this.theme;
50
-
51
- // Header
52
- lines.push("");
53
- const title = th.fg("accent", " Todos ");
54
- const headerLine =
55
- th.fg("borderMuted", "─".repeat(3)) + title + th.fg("borderMuted", "─".repeat(Math.max(0, width - 10)));
56
- lines.push(truncateToWidth(headerLine, width));
57
- lines.push("");
58
-
59
- if (this.todos.length === 0) {
60
- lines.push(truncateToWidth(` ${th.fg("dim", "No todos yet. Ask the agent to add some!")}`, width));
61
- } else {
62
- // Stats
63
- const done = this.todos.filter((t) => t.done).length;
64
- const total = this.todos.length;
65
- const statsText = ` ${th.fg("muted", `${done}/${total} completed`)}`;
66
- lines.push(truncateToWidth(statsText, width));
67
- lines.push("");
68
-
69
- // Todo items
70
- for (const todo of this.todos) {
71
- const check = todo.done ? th.fg("success", "✓") : th.fg("dim", "○");
72
- const id = th.fg("accent", `#${todo.id}`);
73
- const text = todo.done ? th.fg("dim", todo.text) : th.fg("text", todo.text);
74
- const line = ` ${check} ${id} ${text}`;
75
- lines.push(truncateToWidth(line, width));
76
- }
77
- }
78
-
79
- lines.push("");
80
- lines.push(truncateToWidth(` ${th.fg("dim", "Press Escape to close")}`, width));
81
- lines.push("");
82
-
83
- this.cachedWidth = width;
84
- this.cachedLines = lines;
85
- return lines;
86
- }
87
-
88
- invalidate(): void {
89
- this.cachedWidth = undefined;
90
- this.cachedLines = undefined;
91
- }
92
- }
93
-
94
- export default function (pi: HookAPI) {
95
- /**
96
- * Reconstruct todos from session entries on the current branch.
97
- */
98
- function getTodos(ctx: {
99
- sessionManager: {
100
- getBranch: () => Array<{ type: string; message?: { role?: string; toolName?: string; details?: unknown } }>;
101
- };
102
- }): Todo[] {
103
- let todos: Todo[] = [];
104
-
105
- for (const entry of ctx.sessionManager.getBranch()) {
106
- if (entry.type !== "message") continue;
107
- const msg = entry.message;
108
- if (!msg || msg.role !== "toolResult" || msg.toolName !== "todo") continue;
109
-
110
- const details = msg.details as TodoDetails | undefined;
111
- if (details) {
112
- todos = details.todos;
113
- }
114
- }
115
-
116
- return todos;
117
- }
118
-
119
- pi.registerCommand("todos", {
120
- description: "Show all todos on the current branch",
121
- handler: async (_args, ctx) => {
122
- if (!ctx.hasUI) {
123
- ctx.ui.notify("/todos requires interactive mode", "error");
124
- return;
125
- }
126
-
127
- const todos = getTodos(ctx);
128
-
129
- await ctx.ui.custom<void>((_tui, theme, done) => {
130
- return new TodoListComponent(todos, theme, () => done());
131
- });
132
- },
133
- });
134
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * Hooks Configuration
3
- *
4
- * Hooks intercept agent events for logging, blocking, or modification.
5
- */
6
-
7
- import { createAgentSession, type HookFactory, SessionManager } from "@mariozechner/pi-coding-agent";
8
-
9
- // Logging hook
10
- const loggingHook: HookFactory = (api) => {
11
- api.on("agent_start", async () => {
12
- console.log("[Hook] Agent starting");
13
- });
14
-
15
- api.on("tool_call", async (event) => {
16
- console.log(`[Hook] Tool: ${event.toolName}`);
17
- return undefined; // Don't block
18
- });
19
-
20
- api.on("agent_end", async (event) => {
21
- console.log(`[Hook] Done, ${event.messages.length} messages`);
22
- });
23
- };
24
-
25
- // Blocking hook (returns { block: true, reason: "..." })
26
- const safetyHook: HookFactory = (api) => {
27
- api.on("tool_call", async (event) => {
28
- if (event.toolName === "bash") {
29
- const cmd = (event.input as { command?: string }).command ?? "";
30
- if (cmd.includes("rm -rf")) {
31
- return { block: true, reason: "Dangerous command blocked" };
32
- }
33
- }
34
- return undefined;
35
- });
36
- };
37
-
38
- // Use inline hooks
39
- const { session } = await createAgentSession({
40
- hooks: [{ factory: loggingHook }, { factory: safetyHook }],
41
- sessionManager: SessionManager.inMemory(),
42
- });
43
-
44
- session.subscribe((event) => {
45
- if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
46
- process.stdout.write(event.assistantMessageEvent.delta);
47
- }
48
- });
49
-
50
- await session.prompt("List files in the current directory.");
51
- console.log();
52
-
53
- // Disable all hooks:
54
- // hooks: []
55
-
56
- // Merge with discovered hooks:
57
- // const discovered = await discoverHooks();
58
- // hooks: [...discovered, { factory: myHook }]
59
-
60
- // Add paths without replacing discovery:
61
- // additionalHookPaths: ["/extra/hooks"]
@@ -1,42 +0,0 @@
1
- /**
2
- * Slash Commands
3
- *
4
- * File-based commands that inject content when invoked with /commandname.
5
- */
6
-
7
- import {
8
- createAgentSession,
9
- discoverSlashCommands,
10
- type FileSlashCommand,
11
- SessionManager,
12
- } from "@mariozechner/pi-coding-agent";
13
-
14
- // Discover commands from cwd/.pi/commands/ and ~/.pi/agent/commands/
15
- const discovered = discoverSlashCommands();
16
- console.log("Discovered slash commands:");
17
- for (const cmd of discovered) {
18
- console.log(` /${cmd.name}: ${cmd.description}`);
19
- }
20
-
21
- // Define custom commands
22
- const deployCommand: FileSlashCommand = {
23
- name: "deploy",
24
- description: "Deploy the application",
25
- source: "(custom)",
26
- content: `# Deploy Instructions
27
-
28
- 1. Build: npm run build
29
- 2. Test: npm test
30
- 3. Deploy: npm run deploy`,
31
- };
32
-
33
- // Use discovered + custom commands
34
- await createAgentSession({
35
- slashCommands: [...discovered, deployCommand],
36
- sessionManager: SessionManager.inMemory(),
37
- });
38
-
39
- console.log(`Session created with ${discovered.length + 1} slash commands`);
40
-
41
- // Disable slash commands:
42
- // slashCommands: []