@spenceriam/impulse 0.15.0 → 0.15.3

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 (242) hide show
  1. package/bin/impulse +95 -0
  2. package/package.json +17 -51
  3. package/postinstall.mjs +115 -0
  4. package/README.md +0 -194
  5. package/dist/api/client.d.ts +0 -53
  6. package/dist/api/client.d.ts.map +0 -1
  7. package/dist/api/client.js +0 -271
  8. package/dist/api/client.js.map +0 -1
  9. package/dist/api/index.d.ts +0 -6
  10. package/dist/api/index.d.ts.map +0 -1
  11. package/dist/api/index.js +0 -7
  12. package/dist/api/index.js.map +0 -1
  13. package/dist/api/stream.d.ts +0 -98
  14. package/dist/api/stream.d.ts.map +0 -1
  15. package/dist/api/stream.js +0 -202
  16. package/dist/api/stream.js.map +0 -1
  17. package/dist/api/types.d.ts +0 -1353
  18. package/dist/api/types.d.ts.map +0 -1
  19. package/dist/api/types.js +0 -143
  20. package/dist/api/types.js.map +0 -1
  21. package/dist/bash.txt +0 -28
  22. package/dist/bus/bus.d.ts +0 -21
  23. package/dist/bus/bus.d.ts.map +0 -1
  24. package/dist/bus/bus.js +0 -22
  25. package/dist/bus/bus.js.map +0 -1
  26. package/dist/bus/events.d.ts +0 -100
  27. package/dist/bus/events.d.ts.map +0 -1
  28. package/dist/bus/events.js +0 -45
  29. package/dist/bus/events.js.map +0 -1
  30. package/dist/bus/index.d.ts +0 -3
  31. package/dist/bus/index.d.ts.map +0 -1
  32. package/dist/bus/index.js +0 -3
  33. package/dist/bus/index.js.map +0 -1
  34. package/dist/file-edit.txt +0 -21
  35. package/dist/file-read.txt +0 -18
  36. package/dist/file-write.txt +0 -16
  37. package/dist/glob.txt +0 -19
  38. package/dist/global.d.ts +0 -8
  39. package/dist/global.d.ts.map +0 -1
  40. package/dist/global.js +0 -14
  41. package/dist/global.js.map +0 -1
  42. package/dist/grep.txt +0 -20
  43. package/dist/highlights-eq9cgrbb.scm +0 -604
  44. package/dist/highlights-ghv9g403.scm +0 -205
  45. package/dist/highlights-hk7bwhj4.scm +0 -284
  46. package/dist/highlights-r812a2qc.scm +0 -150
  47. package/dist/highlights-x6tmsnaa.scm +0 -115
  48. package/dist/index.d.ts +0 -2
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -62122
  51. package/dist/index.js.map +0 -1
  52. package/dist/index.jsx +0 -5
  53. package/dist/index.jsx.map +0 -1
  54. package/dist/injections-73j83es3.scm +0 -27
  55. package/dist/input/at-refs.d.ts +0 -42
  56. package/dist/input/at-refs.d.ts.map +0 -1
  57. package/dist/input/at-refs.js +0 -154
  58. package/dist/input/at-refs.js.map +0 -1
  59. package/dist/input/history.d.ts +0 -26
  60. package/dist/input/history.d.ts.map +0 -1
  61. package/dist/input/history.js +0 -109
  62. package/dist/input/history.js.map +0 -1
  63. package/dist/input/index.d.ts +0 -5
  64. package/dist/input/index.d.ts.map +0 -1
  65. package/dist/input/index.js +0 -5
  66. package/dist/input/index.js.map +0 -1
  67. package/dist/input/paste.d.ts +0 -19
  68. package/dist/input/paste.d.ts.map +0 -1
  69. package/dist/input/paste.js +0 -75
  70. package/dist/input/paste.js.map +0 -1
  71. package/dist/input/shortcuts.d.ts +0 -6
  72. package/dist/input/shortcuts.d.ts.map +0 -1
  73. package/dist/input/shortcuts.js +0 -84
  74. package/dist/input/shortcuts.js.map +0 -1
  75. package/dist/mcp/index.d.ts +0 -3
  76. package/dist/mcp/index.d.ts.map +0 -1
  77. package/dist/mcp/index.js +0 -3
  78. package/dist/mcp/index.js.map +0 -1
  79. package/dist/mcp/manager.d.ts +0 -51
  80. package/dist/mcp/manager.d.ts.map +0 -1
  81. package/dist/mcp/manager.js +0 -158
  82. package/dist/mcp/manager.js.map +0 -1
  83. package/dist/mcp/types.d.ts +0 -18
  84. package/dist/mcp/types.d.ts.map +0 -1
  85. package/dist/mcp/types.js +0 -5
  86. package/dist/mcp/types.js.map +0 -1
  87. package/dist/session/todo.d.ts +0 -24
  88. package/dist/session/todo.d.ts.map +0 -1
  89. package/dist/session/todo.js +0 -39
  90. package/dist/session/todo.js.map +0 -1
  91. package/dist/storage/index.d.ts +0 -2
  92. package/dist/storage/index.d.ts.map +0 -1
  93. package/dist/storage/index.js +0 -2
  94. package/dist/storage/index.js.map +0 -1
  95. package/dist/storage/storage.d.ts +0 -13
  96. package/dist/storage/storage.d.ts.map +0 -1
  97. package/dist/storage/storage.js +0 -84
  98. package/dist/storage/storage.js.map +0 -1
  99. package/dist/task.txt +0 -26
  100. package/dist/todo-read.txt +0 -14
  101. package/dist/todo-write.txt +0 -166
  102. package/dist/tools/bash.d.ts +0 -22
  103. package/dist/tools/bash.d.ts.map +0 -1
  104. package/dist/tools/bash.js +0 -70
  105. package/dist/tools/bash.js.map +0 -1
  106. package/dist/tools/file-edit.d.ts +0 -22
  107. package/dist/tools/file-edit.d.ts.map +0 -1
  108. package/dist/tools/file-edit.js +0 -67
  109. package/dist/tools/file-edit.js.map +0 -1
  110. package/dist/tools/file-read.d.ts +0 -19
  111. package/dist/tools/file-read.d.ts.map +0 -1
  112. package/dist/tools/file-read.js +0 -70
  113. package/dist/tools/file-read.js.map +0 -1
  114. package/dist/tools/file-write.d.ts +0 -16
  115. package/dist/tools/file-write.d.ts.map +0 -1
  116. package/dist/tools/file-write.js +0 -45
  117. package/dist/tools/file-write.js.map +0 -1
  118. package/dist/tools/glob.d.ts +0 -16
  119. package/dist/tools/glob.d.ts.map +0 -1
  120. package/dist/tools/glob.js +0 -45
  121. package/dist/tools/glob.js.map +0 -1
  122. package/dist/tools/grep.d.ts +0 -19
  123. package/dist/tools/grep.d.ts.map +0 -1
  124. package/dist/tools/grep.js +0 -65
  125. package/dist/tools/grep.js.map +0 -1
  126. package/dist/tools/index.d.ts +0 -11
  127. package/dist/tools/index.d.ts.map +0 -1
  128. package/dist/tools/index.js +0 -11
  129. package/dist/tools/index.js.map +0 -1
  130. package/dist/tools/registry.d.ts +0 -22
  131. package/dist/tools/registry.d.ts.map +0 -1
  132. package/dist/tools/registry.js +0 -75
  133. package/dist/tools/registry.js.map +0 -1
  134. package/dist/tools/task.d.ts +0 -19
  135. package/dist/tools/task.d.ts.map +0 -1
  136. package/dist/tools/task.js +0 -51
  137. package/dist/tools/task.js.map +0 -1
  138. package/dist/tools/todo-read.d.ts +0 -7
  139. package/dist/tools/todo-read.d.ts.map +0 -1
  140. package/dist/tools/todo-read.js +0 -56
  141. package/dist/tools/todo-read.js.map +0 -1
  142. package/dist/tools/todo-write.d.ts +0 -38
  143. package/dist/tools/todo-write.d.ts.map +0 -1
  144. package/dist/tools/todo-write.js +0 -40
  145. package/dist/tools/todo-write.js.map +0 -1
  146. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  147. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  148. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  149. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  150. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  151. package/dist/ui/App.d.ts +0 -6
  152. package/dist/ui/App.d.ts.map +0 -1
  153. package/dist/ui/App.jsx +0 -37
  154. package/dist/ui/App.jsx.map +0 -1
  155. package/dist/ui/components/Autocomplete.d.ts +0 -24
  156. package/dist/ui/components/Autocomplete.d.ts.map +0 -1
  157. package/dist/ui/components/Autocomplete.jsx +0 -67
  158. package/dist/ui/components/Autocomplete.jsx.map +0 -1
  159. package/dist/ui/components/ChatView.d.ts +0 -14
  160. package/dist/ui/components/ChatView.d.ts.map +0 -1
  161. package/dist/ui/components/ChatView.jsx +0 -11
  162. package/dist/ui/components/ChatView.jsx.map +0 -1
  163. package/dist/ui/components/InputArea.d.ts +0 -18
  164. package/dist/ui/components/InputArea.d.ts.map +0 -1
  165. package/dist/ui/components/InputArea.jsx +0 -35
  166. package/dist/ui/components/InputArea.jsx.map +0 -1
  167. package/dist/ui/components/MessageBlock.d.ts +0 -21
  168. package/dist/ui/components/MessageBlock.d.ts.map +0 -1
  169. package/dist/ui/components/MessageBlock.jsx +0 -94
  170. package/dist/ui/components/MessageBlock.jsx.map +0 -1
  171. package/dist/ui/components/Overlay.d.ts +0 -28
  172. package/dist/ui/components/Overlay.d.ts.map +0 -1
  173. package/dist/ui/components/Overlay.jsx +0 -102
  174. package/dist/ui/components/Overlay.jsx.map +0 -1
  175. package/dist/ui/components/ProgressBar.d.ts +0 -9
  176. package/dist/ui/components/ProgressBar.d.ts.map +0 -1
  177. package/dist/ui/components/ProgressBar.jsx +0 -17
  178. package/dist/ui/components/ProgressBar.jsx.map +0 -1
  179. package/dist/ui/components/Sidebar.d.ts +0 -22
  180. package/dist/ui/components/Sidebar.d.ts.map +0 -1
  181. package/dist/ui/components/Sidebar.jsx +0 -96
  182. package/dist/ui/components/Sidebar.jsx.map +0 -1
  183. package/dist/ui/components/StatusLine.d.ts +0 -6
  184. package/dist/ui/components/StatusLine.d.ts.map +0 -1
  185. package/dist/ui/components/StatusLine.jsx +0 -32
  186. package/dist/ui/components/StatusLine.jsx.map +0 -1
  187. package/dist/ui/components/ThinkingBlock.d.ts +0 -15
  188. package/dist/ui/components/ThinkingBlock.d.ts.map +0 -1
  189. package/dist/ui/components/ThinkingBlock.jsx +0 -33
  190. package/dist/ui/components/ThinkingBlock.jsx.map +0 -1
  191. package/dist/ui/components/TodoItem.d.ts +0 -22
  192. package/dist/ui/components/TodoItem.d.ts.map +0 -1
  193. package/dist/ui/components/TodoItem.jsx +0 -11
  194. package/dist/ui/components/TodoItem.jsx.map +0 -1
  195. package/dist/ui/components/ToolBlock.d.ts +0 -27
  196. package/dist/ui/components/ToolBlock.d.ts.map +0 -1
  197. package/dist/ui/components/ToolBlock.jsx +0 -76
  198. package/dist/ui/components/ToolBlock.jsx.map +0 -1
  199. package/dist/ui/components/index.d.ts +0 -12
  200. package/dist/ui/components/index.d.ts.map +0 -1
  201. package/dist/ui/components/index.js +0 -12
  202. package/dist/ui/components/index.js.map +0 -1
  203. package/dist/ui/context/index.d.ts +0 -4
  204. package/dist/ui/context/index.d.ts.map +0 -1
  205. package/dist/ui/context/index.js +0 -4
  206. package/dist/ui/context/index.js.map +0 -1
  207. package/dist/ui/context/mode.d.ts +0 -24
  208. package/dist/ui/context/mode.d.ts.map +0 -1
  209. package/dist/ui/context/mode.jsx +0 -53
  210. package/dist/ui/context/mode.jsx.map +0 -1
  211. package/dist/ui/context/session.d.ts +0 -43
  212. package/dist/ui/context/session.d.ts.map +0 -1
  213. package/dist/ui/context/session.jsx +0 -63
  214. package/dist/ui/context/session.jsx.map +0 -1
  215. package/dist/ui/context/todo.d.ts +0 -32
  216. package/dist/ui/context/todo.d.ts.map +0 -1
  217. package/dist/ui/context/todo.jsx +0 -75
  218. package/dist/ui/context/todo.jsx.map +0 -1
  219. package/dist/ui/design.d.ts +0 -182
  220. package/dist/ui/design.d.ts.map +0 -1
  221. package/dist/ui/design.js +0 -189
  222. package/dist/ui/design.js.map +0 -1
  223. package/dist/ui/index.d.ts +0 -4
  224. package/dist/ui/index.d.ts.map +0 -1
  225. package/dist/ui/index.js +0 -3
  226. package/dist/ui/index.js.map +0 -1
  227. package/dist/util/config.d.ts +0 -22
  228. package/dist/util/config.d.ts.map +0 -1
  229. package/dist/util/config.js +0 -55
  230. package/dist/util/config.js.map +0 -1
  231. package/dist/util/instructions.d.ts +0 -39
  232. package/dist/util/instructions.d.ts.map +0 -1
  233. package/dist/util/instructions.js +0 -96
  234. package/dist/util/instructions.js.map +0 -1
  235. package/dist/util/lock.d.ts +0 -18
  236. package/dist/util/lock.d.ts.map +0 -1
  237. package/dist/util/lock.js +0 -65
  238. package/dist/util/lock.js.map +0 -1
  239. package/dist/util/logger.d.ts +0 -8
  240. package/dist/util/logger.d.ts.map +0 -1
  241. package/dist/util/logger.js +0 -81
  242. package/dist/util/logger.js.map +0 -1
package/bin/impulse ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from "child_process";
4
+ import { existsSync } from "fs";
5
+ import { join, dirname } from "path";
6
+ import { fileURLToPath } from "url";
7
+ import { createRequire } from "module";
8
+ import os from "os";
9
+
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
11
+ const require = createRequire(import.meta.url);
12
+
13
+ function detectPlatformAndArch() {
14
+ let platform;
15
+ switch (os.platform()) {
16
+ case "darwin":
17
+ platform = "darwin";
18
+ break;
19
+ case "linux":
20
+ platform = "linux";
21
+ break;
22
+ case "win32":
23
+ platform = "windows";
24
+ break;
25
+ default:
26
+ platform = os.platform();
27
+ break;
28
+ }
29
+
30
+ let arch;
31
+ switch (os.arch()) {
32
+ case "x64":
33
+ arch = "x64";
34
+ break;
35
+ case "arm64":
36
+ arch = "arm64";
37
+ break;
38
+ default:
39
+ arch = os.arch();
40
+ break;
41
+ }
42
+
43
+ return { platform, arch };
44
+ }
45
+
46
+ function findBinary() {
47
+ const { platform, arch } = detectPlatformAndArch();
48
+ const packageName = `@spenceriam/impulse-${platform}-${arch}`;
49
+ const binaryName = platform === "windows" ? "impulse.exe" : "impulse";
50
+
51
+ try {
52
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
53
+ const packageDir = dirname(packageJsonPath);
54
+ const binaryPath = join(packageDir, "bin", binaryName);
55
+
56
+ if (!existsSync(binaryPath)) {
57
+ throw new Error(`Binary not found at ${binaryPath}`);
58
+ }
59
+
60
+ return binaryPath;
61
+ } catch (error) {
62
+ // Check if symlinked binary exists in same directory
63
+ const localBinary = join(__dirname, binaryName);
64
+ if (existsSync(localBinary)) {
65
+ return localBinary;
66
+ }
67
+
68
+ throw new Error(
69
+ `Could not find IMPULSE binary for ${platform}-${arch}.\n` +
70
+ `Package ${packageName} may not be installed.\n` +
71
+ `Try reinstalling: npm install -g @spenceriam/impulse`
72
+ );
73
+ }
74
+ }
75
+
76
+ try {
77
+ const binaryPath = findBinary();
78
+
79
+ const child = spawn(binaryPath, process.argv.slice(2), {
80
+ stdio: "inherit",
81
+ env: process.env,
82
+ });
83
+
84
+ child.on("error", (err) => {
85
+ console.error("Failed to start IMPULSE:", err.message);
86
+ process.exit(1);
87
+ });
88
+
89
+ child.on("exit", (code) => {
90
+ process.exit(code ?? 0);
91
+ });
92
+ } catch (error) {
93
+ console.error(error.message);
94
+ process.exit(1);
95
+ }
package/package.json CHANGED
@@ -1,64 +1,30 @@
1
1
  {
2
2
  "name": "@spenceriam/impulse",
3
- "version": "0.15.0",
4
- "private": false,
5
- "description": "Terminal-based AI coding agent powered by Z.ai's Coding Plan - the best cost/engineering ratio for builders",
6
- "type": "module",
7
- "scripts": {
8
- "dev": "bun run --watch src/index.tsx",
9
- "build": "bun run scripts/build.ts",
10
- "start": "bun run dist/index.js",
11
- "lint": "eslint src/",
12
- "typecheck": "tsc --noEmit"
13
- },
14
- "dependencies": {
15
- "@opentui/core": "^0.1.74",
16
- "@opentui/solid": "^0.1.74",
17
- "diff": "^8.0.3",
18
- "openai": "^4.73.0",
19
- "semver": "^7.7.3",
20
- "solid-js": "^1.9.0",
21
- "zod": "^3.24.0",
22
- "zod-to-json-schema": "^3.25.1"
23
- },
24
- "devDependencies": {
25
- "@types/bun": "^1.3.6",
26
- "@types/diff": "^8.0.0",
27
- "@types/node": "^22.10.0",
28
- "@types/semver": "^7.7.1",
29
- "typescript": "^5.7.0"
30
- },
3
+ "version": "0.15.3",
4
+ "description": "Terminal-based AI coding agent powered by Z.ai's Coding Plan",
5
+ "license": "MIT",
31
6
  "bin": {
32
- "impulse": "dist/index.js"
7
+ "impulse": "./bin/impulse"
33
8
  },
34
- "files": [
35
- "dist/**/*"
36
- ],
37
- "publishConfig": {
38
- "access": "public"
9
+ "scripts": {
10
+ "postinstall": "node ./postinstall.mjs"
39
11
  },
40
- "keywords": [
41
- "ai",
42
- "cli",
43
- "impulse",
44
- "terminal",
45
- "coding",
46
- "agent",
47
- "glm",
48
- "z-ai",
49
- "coding-plan"
50
- ],
51
- "author": "Spencer Francisco",
52
- "license": "MIT",
53
12
  "repository": {
54
13
  "type": "git",
55
14
  "url": "git+https://github.com/spenceriam/impulse.git"
56
15
  },
57
16
  "homepage": "https://github.com/spenceriam/impulse#readme",
58
- "bugs": {
59
- "url": "https://github.com/spenceriam/impulse/issues"
17
+ "keywords": ["ai", "cli", "impulse", "terminal", "coding", "agent"],
18
+ "author": "Spencer Francisco",
19
+ "files": ["bin/*", "postinstall.mjs"],
20
+ "publishConfig": {
21
+ "access": "public"
60
22
  },
61
- "engines": {
62
- "node": ">=18.0.0"
23
+ "optionalDependencies": {
24
+ "@spenceriam/impulse-linux-x64": "0.15.3",
25
+ "@spenceriam/impulse-linux-arm64": "0.15.3",
26
+ "@spenceriam/impulse-darwin-x64": "0.15.3",
27
+ "@spenceriam/impulse-darwin-arm64": "0.15.3",
28
+ "@spenceriam/impulse-windows-x64": "0.15.3"
63
29
  }
64
30
  }
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import os from "os";
6
+ import { fileURLToPath } from "url";
7
+ import { createRequire } from "module";
8
+
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
+ const require = createRequire(import.meta.url);
11
+
12
+ function detectPlatformAndArch() {
13
+ let platform;
14
+ switch (os.platform()) {
15
+ case "darwin":
16
+ platform = "darwin";
17
+ break;
18
+ case "linux":
19
+ platform = "linux";
20
+ break;
21
+ case "win32":
22
+ platform = "windows";
23
+ break;
24
+ default:
25
+ platform = os.platform();
26
+ break;
27
+ }
28
+
29
+ let arch;
30
+ switch (os.arch()) {
31
+ case "x64":
32
+ arch = "x64";
33
+ break;
34
+ case "arm64":
35
+ arch = "arm64";
36
+ break;
37
+ default:
38
+ arch = os.arch();
39
+ break;
40
+ }
41
+
42
+ return { platform, arch };
43
+ }
44
+
45
+ function findBinary() {
46
+ const { platform, arch } = detectPlatformAndArch();
47
+ const packageName = `@spenceriam/impulse-${platform}-${arch}`;
48
+ const binaryName = platform === "windows" ? "impulse.exe" : "impulse";
49
+
50
+ try {
51
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
52
+ const packageDir = path.dirname(packageJsonPath);
53
+ const binaryPath = path.join(packageDir, "bin", binaryName);
54
+
55
+ if (!fs.existsSync(binaryPath)) {
56
+ throw new Error(`Binary not found at ${binaryPath}`);
57
+ }
58
+
59
+ return { binaryPath, binaryName };
60
+ } catch (error) {
61
+ throw new Error(`Could not find package ${packageName}: ${error.message}`);
62
+ }
63
+ }
64
+
65
+ function prepareBinDirectory(binaryName) {
66
+ const binDir = path.join(__dirname, "bin");
67
+ const targetPath = path.join(binDir, binaryName);
68
+
69
+ if (!fs.existsSync(binDir)) {
70
+ fs.mkdirSync(binDir, { recursive: true });
71
+ }
72
+
73
+ if (fs.existsSync(targetPath)) {
74
+ fs.unlinkSync(targetPath);
75
+ }
76
+
77
+ return { binDir, targetPath };
78
+ }
79
+
80
+ function symlinkBinary(sourcePath, targetPath) {
81
+ fs.symlinkSync(sourcePath, targetPath);
82
+ console.log(`IMPULSE binary symlinked: ${targetPath} -> ${sourcePath}`);
83
+
84
+ if (!fs.existsSync(targetPath)) {
85
+ throw new Error(`Failed to symlink binary to ${targetPath}`);
86
+ }
87
+ }
88
+
89
+ async function main() {
90
+ try {
91
+ if (os.platform() === "win32") {
92
+ console.log("Windows detected: using packaged executable");
93
+ return;
94
+ }
95
+
96
+ const { binaryPath, binaryName } = findBinary();
97
+ const { targetPath } = prepareBinDirectory(binaryName);
98
+
99
+ // Create symlink to the platform-specific binary
100
+ symlinkBinary(binaryPath, targetPath);
101
+
102
+ console.log(`IMPULSE installed successfully!`);
103
+ } catch (error) {
104
+ console.error("Failed to setup IMPULSE binary:", error.message);
105
+ console.error("You may need to install Bun and run IMPULSE directly:");
106
+ console.error(" curl -fsSL https://bun.sh/install | bash");
107
+ console.error(" bun x @spenceriam/impulse");
108
+ process.exit(1);
109
+ }
110
+ }
111
+
112
+ main().catch((error) => {
113
+ console.error("Postinstall script error:", error.message);
114
+ process.exit(0);
115
+ });
package/README.md DELETED
@@ -1,194 +0,0 @@
1
- # IMPULSE
2
-
3
- > Terminal-based AI coding agent powered by Z.ai's Coding Plan
4
-
5
- A brutally minimal terminal interface for AI-assisted software development. Built with OpenTUI + SolidJS for flicker-free 60fps rendering. Powered by Z.ai's Coding Plan and their GLM-4.x models - the best cost/engineering ratio for builders.
6
-
7
- ## Features
8
-
9
- - **GLM-4.x Models** - Z.ai's flagship models with thinking mode
10
- - **5 Modes** - AUTO, AGENT, PLANNER, PLAN-PRD, DEBUG
11
- - **MCP Integration** - Vision, Web Search, Web Reader, Zread, Context7
12
- - **Git Checkpoints** - Per-message undo/redo
13
- - **Auto-Compact** - AI summarization at 85% context
14
- - **Auto-Save** - Sessions persist automatically
15
- - **Express Mode** - Skip permission prompts in trusted environments
16
- - **Interactive Overlays** - Model picker, session loader, question prompts
17
-
18
- ## Visual Preview
19
-
20
- **Welcome Screen:**
21
- ```
22
- ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
23
- ┃ ┃
24
- ┃ ██╗███╗ ███╗██████╗ ██╗ ██╗██╗ ███████╗███████╗ ┃
25
- ┃ ██║████╗ ████║██╔══██╗██║ ██║██║ ██╔════╝██╔════╝ ┃
26
- ┃ ██║██╔████╔██║██████╔╝██║ ██║██║ ███████╗█████╗ ┃
27
- ┃ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║ ╚════██║██╔══╝ ┃
28
- ┃ ██║██║ ╚═╝ ██║██║ ╚██████╔╝███████╗███████║███████╗ ┃
29
- ┃ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝ ┃
30
- ┃ ┃
31
- ┃ v0.14.0 GLM-4.7 ┃
32
- ┃ built 01-23-2026 ~/project ┃
33
- ┃ ┃
34
- ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
35
-
36
- ┌─ AUTO ─────────────────────────────────────────────────────────────────────┐
37
- │ > _ │
38
- └────────────────────────────────────────────────────────────────────────────┘
39
- GLM-4.7 | ~/project | main | MCP: ● | 01-23-2026
40
- ```
41
-
42
- **Session View:**
43
- ```
44
- [IMPULSE] | Implementing API client
45
- ────────────────────────────────────────────────────────────────────────────────
46
-
47
- You 12:34 PM
48
- Can you help me implement the API client?
49
-
50
- GLM-4.7 [AGENT] 12:34 PM
51
- I'll help you implement the API client.
52
-
53
- ▶ file_write src/api/types.ts [OK]
54
- ▶ file_write src/api/client.ts [OK]
55
-
56
- ┌─ AGENT ────────────────────────────────────────────────────────────────────┐
57
- │ > _ │
58
- └────────────────────────────────────────────────────────────────────────────┘
59
- GLM-4.7 | AGENT | [██████░░░░] 62% | ~/project | main | MCP: ● | 01-23-2026
60
- ```
61
-
62
- ## Quick Start
63
-
64
- ```bash
65
- # Install
66
- bun install -g impulse
67
-
68
- # Set API key
69
- export GLM_API_KEY=your_key_here
70
-
71
- # Run
72
- impulse
73
-
74
- # Run with Express mode (skip permission prompts)
75
- impulse --express
76
- # or
77
- impulse -e
78
- ```
79
-
80
- ## Modes
81
-
82
- | Mode | Key | Purpose |
83
- |------|-----|---------|
84
- | AUTO | - | AI decides based on prompt |
85
- | AGENT | Tab | Full execution with all tools |
86
- | PLANNER | Tab | Generate project documentation |
87
- | PLAN-PRD | Tab | Quick PRD via Q&A |
88
- | DEBUG | Tab | 7-step systematic debugging |
89
-
90
- ## Commands
91
-
92
- | Command | Description |
93
- |---------|-------------|
94
- | `/new` | New session (clears current) |
95
- | `/clear` | Clear session (alias for /new) |
96
- | `/save` | Save session |
97
- | `/load` | Interactive session picker |
98
- | `/undo` | Revert last change |
99
- | `/redo` | Restore undone |
100
- | `/compact` | Manually compact context |
101
- | `/model` | Interactive model picker |
102
- | `/mode` | Switch mode |
103
- | `/think` | Toggle thinking mode |
104
- | `/express` | Toggle Express mode (skip permissions) |
105
- | `/init` | Analyze project, create AGENTS.md |
106
- | `/stats` | Session statistics |
107
- | `/help` | Show help |
108
- | `/quit` | Exit with summary |
109
-
110
- ## Keyboard
111
-
112
- | Key | Action |
113
- |-----|--------|
114
- | `Tab` | Cycle modes |
115
- | `Shift+Tab` | Cycle reverse |
116
- | `Enter` | Submit |
117
- | `Shift+Enter` | New line |
118
- | `Up/Down` | Message history |
119
- | `@` | File autocomplete |
120
- | `Esc` (2x) | Cancel operation |
121
- | `Ctrl+C` (2x) | Exit with summary |
122
- | `Ctrl+P` | Command palette |
123
- | `Ctrl+M` | MCP status |
124
-
125
- ## Models
126
-
127
- | Model | Type | Best For |
128
- |-------|------|----------|
129
- | `glm-4.7` | Text | Complex coding (default) |
130
- | `glm-4.7-flash` | Text | Fast coding |
131
- | `glm-4.6` | Text | Previous flagship |
132
- | `glm-4.6v` | Vision | Image understanding |
133
- | `glm-4.5` | Text | General tasks |
134
- | `glm-4.5-air` | Text | Lightweight |
135
- | `glm-4.5-flash` | Text | Ultra-fast |
136
- | `glm-4.5v` | Vision | Quick image tasks |
137
-
138
- ## MCP Servers
139
-
140
- IMPULSE integrates with 5 MCP servers out of the box:
141
-
142
- | Server | Type | Tools |
143
- |--------|------|-------|
144
- | **Vision** | Local (stdio) | Image analysis, UI screenshots, diagrams |
145
- | **Web Search** | Remote (HTTP) | Web search |
146
- | **Web Reader** | Remote (HTTP) | Fetch and parse web pages |
147
- | **Zread** | Remote (HTTP) | Search docs, read GitHub repos |
148
- | **Context7** | Remote (HTTP) | Library/framework documentation |
149
-
150
- The agent discovers MCP tools on-demand to keep context lean.
151
-
152
- ## Configuration
153
-
154
- Config file: `~/.config/impulse/config.json`
155
-
156
- ```json
157
- {
158
- "apiKey": "your_key_here",
159
- "defaultModel": "glm-4.7",
160
- "defaultMode": "AUTO",
161
- "thinking": true,
162
- "express": false
163
- }
164
- ```
165
-
166
- Or use environment variable:
167
-
168
- ```bash
169
- export GLM_API_KEY=your_key_here
170
- ```
171
-
172
- ## Project Instructions
173
-
174
- IMPULSE loads project-specific instructions from these files (first found wins):
175
-
176
- 1. `.impulse/instructions.md`
177
- 2. `AGENTS.md`
178
- 3. `CLAUDE.md`
179
- 4. `GEMINI.md`
180
- 5. `QWEN.md`
181
- 6. `KIMI.md`
182
- 7. `COPILOT.md`
183
- 8. `.cursorrules`
184
- 9. `.windsurfrules`
185
-
186
- ## Requirements
187
-
188
- - Bun 1.0+ or Node.js 20+
189
- - Git (for undo/redo)
190
- - Terminal with 256 colors
191
-
192
- ## License
193
-
194
- MIT
@@ -1,53 +0,0 @@
1
- import type { ChatCompletionRequest, ChatCompletionResponse, ChatCompletionChunk, GLMModel, ChatMessage, ToolDefinition } from "./types";
2
- export declare class GLMClientError extends Error {
3
- readonly code?: string | undefined;
4
- readonly statusCode?: number | undefined;
5
- constructor(message: string, code?: string | undefined, statusCode?: number | undefined);
6
- }
7
- export declare class GLMAuthError extends GLMClientError {
8
- constructor(message: string);
9
- }
10
- export declare class GLMRateLimitError extends GLMClientError {
11
- readonly retryAfter?: number | undefined;
12
- constructor(message: string, retryAfter?: number | undefined);
13
- }
14
- interface CompletionOptions {
15
- model?: GLMModel;
16
- messages: ChatMessage[];
17
- temperature?: number;
18
- top_p?: number;
19
- max_tokens?: number;
20
- stop?: string | string[];
21
- tools?: ToolDefinition[];
22
- tool_choice?: ChatCompletionRequest["tool_choice"];
23
- stream?: false;
24
- signal?: AbortSignal;
25
- }
26
- interface StreamCompletionOptions extends Omit<CompletionOptions, "stream"> {
27
- stream: true;
28
- }
29
- declare class GLMClientImpl {
30
- private client;
31
- private apiKey;
32
- private getClient;
33
- private sleep;
34
- private calculateBackoff;
35
- private isRetryableError;
36
- private executeWithRetry;
37
- /**
38
- * Create a chat completion (non-streaming)
39
- */
40
- complete(options: CompletionOptions): Promise<ChatCompletionResponse>;
41
- /**
42
- * Create a streaming chat completion
43
- * Returns an async iterable of chunks
44
- */
45
- stream(options: Omit<StreamCompletionOptions, "stream">): AsyncGenerator<ChatCompletionChunk, void, unknown>;
46
- /**
47
- * Reset the client (useful when API key changes)
48
- */
49
- reset(): void;
50
- }
51
- export declare const GLMClient: GLMClientImpl;
52
- export {};
53
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AAkBjB,qBAAa,cAAe,SAAQ,KAAK;aAGrB,IAAI,CAAC,EAAE,MAAM;aACb,UAAU,CAAC,EAAE,MAAM;gBAFnC,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,UAAU,CAAC,EAAE,MAAM,YAAA;CAKtC;AAED,qBAAa,YAAa,SAAQ,cAAc;gBAClC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAkB,SAAQ,cAAc;aACN,UAAU,CAAC,EAAE,MAAM;gBAApD,OAAO,EAAE,MAAM,EAAkB,UAAU,CAAC,EAAE,MAAM,YAAA;CAIjE;AAED,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACnD,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,uBAAwB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IACzE,MAAM,EAAE,IAAI,CAAC;CACd;AAED,cAAM,aAAa;IACjB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAuB;YAEvB,SAAS;YAqBT,KAAK;IAInB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,gBAAgB;YAWV,gBAAgB;IA0D9B;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAqE3E;;;OAGG;IACI,MAAM,CACX,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GAC/C,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC;IA6ErD;;OAEG;IACH,KAAK,IAAI,IAAI;CAId;AAGD,eAAO,MAAM,SAAS,eAAsB,CAAC"}