@thegitai/cli 1.2.0 → 1.2.2

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.
@@ -20,10 +20,27 @@ let extensionProfileId = '';
20
20
  let extensionProfileLabel = '';
21
21
  let extensionPlatform = '';
22
22
  let extensionLastFocusedAt = 0;
23
+ let stopping = false;
23
24
  function log(message) {
24
25
  process.stderr.write(`[thegitai-browser-host] ${message}\n`);
25
26
  }
27
+ function stop(code) {
28
+ if (stopping)
29
+ return;
30
+ stopping = true;
31
+ for (const link of sessions.values())
32
+ link.socket.destroy();
33
+ process.exit(code);
34
+ }
35
+ process.on('uncaughtException', (error) => {
36
+ if (!stopping)
37
+ log(`stopping after an unexpected error: ${error?.stack ?? error}`);
38
+ stop(1);
39
+ });
40
+ process.stdout.on('error', () => stop(0));
26
41
  function writeToExtension(frame) {
42
+ if (stopping)
43
+ return;
27
44
  const payload = Buffer.from(JSON.stringify(frame), 'utf8');
28
45
  if (payload.length > MAX_FRAME_BYTES) {
29
46
  for (const fragment of fragmentPayload(payload, crypto.randomUUID())) {
@@ -44,11 +61,7 @@ process.stdin.on('data', (chunk) => {
44
61
  for (const frame of frames)
45
62
  handleExtensionFrame(frame);
46
63
  });
47
- process.stdin.on('end', () => {
48
- for (const link of sessions.values())
49
- link.socket.destroy();
50
- process.exit(0);
51
- });
64
+ process.stdin.on('end', () => stop(0));
52
65
  function describeParentBrowser() {
53
66
  const cmdline = process.platform === 'win32' ? windowsParentCommandLine() : unixParentCommandLine();
54
67
  const userDataArg = cmdline.find((part) => part.startsWith('--user-data-dir='));
@@ -5,7 +5,6 @@ const PLAN_MODE_TOOL_NAMES = new Set([
5
5
  'read_file',
6
6
  'grep_code',
7
7
  'read_document',
8
- 'analyze_image',
9
8
  'run_command',
10
9
  'shell_job_output',
11
10
  'update_todos',
@@ -53,9 +53,8 @@ function writeLauncher(env, hostScript, platform = process.platform) {
53
53
  const launcherPath = path.join(dir, 'browser-bridge-host.bat');
54
54
  const contents = [
55
55
  '@echo off',
56
- process.versions.electron
57
- ? `"${process.execPath}" --thegitai-browser-host %*`
58
- : `"${process.execPath}" "${hostScript}" %*`,
56
+ ...(process.versions.electron ? ['set ELECTRON_RUN_AS_NODE=1'] : []),
57
+ `"${process.execPath}" "${hostScript}" %*`,
59
58
  '',
60
59
  ].join('\r\n');
61
60
  const existingBat = fs.existsSync(launcherPath)
@@ -20,7 +20,6 @@ import { strReplace } from './str-replace.js';
20
20
  import { undoEdit } from './undo-edit.js';
21
21
  import { updateTodos } from './update-todos.js';
22
22
  import { useSkill } from './use-skill.js';
23
- import { readImageFile } from './read-image-file.js';
24
23
  import { saveGeneratedImage } from './save-generated-image.js';
25
24
  import { writeFile } from './write-file.js';
26
25
  export const TOOL_MAP = {
@@ -46,7 +45,6 @@ export const TOOL_MAP = {
46
45
  shell_job_kill: shellJobKill,
47
46
  update_todos: updateTodos,
48
47
  use_skill: (context, args) => useSkill(context, args),
49
- analyze_image: (context, args) => readImageFile(context, args),
50
48
  browser: (context, args) => browserGateway(context, args),
51
49
  browser_tabs: browserTabs,
52
50
  browser_tab_new: (context, args) => browserTabNew(context, args),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thegitai/cli",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "TheGitAI is an agentic AI coding tool for your terminal. It reads and searches your repository, writes and edits files, runs your tests, and verifies the change before handing it back.",
5
5
  "keywords": [
6
6
  "agentic-ai",
@@ -45,11 +45,11 @@
45
45
  "@lydell/node-pty-linux-x64": "1.1.0",
46
46
  "@lydell/node-pty-win32-arm64": "1.1.0",
47
47
  "@lydell/node-pty-win32-x64": "1.1.0",
48
- "@thegitai/tui-darwin-arm64": "1.2.0",
49
- "@thegitai/tui-darwin-x64": "1.2.0",
50
- "@thegitai/tui-linux-arm64": "1.2.0",
51
- "@thegitai/tui-linux-x64": "1.2.0",
52
- "@thegitai/tui-win32-x64": "1.2.0",
48
+ "@thegitai/tui-darwin-arm64": "1.2.2",
49
+ "@thegitai/tui-darwin-x64": "1.2.2",
50
+ "@thegitai/tui-linux-arm64": "1.2.2",
51
+ "@thegitai/tui-linux-x64": "1.2.2",
52
+ "@thegitai/tui-win32-x64": "1.2.2",
53
53
  "@vscode/ripgrep": "1.18.0"
54
54
  },
55
55
  "repository": {