infinicode 2.2.3 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -16,7 +16,7 @@ import { serve } from './commands/serve.js';
16
16
  import { mcpCommand } from './commands/mcp.js';
17
17
  import { installTui } from './commands/install-tui.js';
18
18
  import { DEFAULT_CONFIG } from './kernel/config-schema.js';
19
- const VERSION = '2.2.3';
19
+ const VERSION = '2.3.1';
20
20
  const config = new Conf({
21
21
  projectName: 'infinicode',
22
22
  defaults: DEFAULT_CONFIG,
@@ -19,6 +19,7 @@ import ora from 'ora';
19
19
  import { existsSync } from 'node:fs';
20
20
  import { dirname, join, resolve } from 'node:path';
21
21
  import { fileURLToPath } from 'node:url';
22
+ import { createRequire } from 'node:module';
22
23
  import { ASCII_VIDEO_FPS, ASCII_VIDEO_FRAMES } from '../ascii-video-animation.js';
23
24
  import { getProviderPreset } from '../kernel/free-providers.js';
24
25
  import { buildKernelFromConfig } from '../kernel/setup.js';
@@ -27,19 +28,32 @@ import { openAICompatBaseURL } from '../kernel/provider-url.js';
27
28
  const __dirname = dirname(fileURLToPath(import.meta.url));
28
29
  const PROMPT_ANIMATION_MAX_FRAMES = Math.min(ASCII_VIDEO_FRAMES.length, ASCII_VIDEO_FPS * 3);
29
30
  /**
30
- * Locate the bundled TUI binary, or null if it isn't shipped in this install.
31
+ * Locate the TUI binary. Resolution order (opencode/esbuild pattern):
32
+ * 1. the platform package installed via optionalDependencies
33
+ * (infinicode-tui-<platform>-<arch>) — auto-installed by npm, universal.
34
+ * 2. this install's own bin/ (dev repo, or `infinicode install-tui`).
35
+ * Returns null if none is present.
36
+ *
31
37
  * IMPORTANT: never fall back to spawning `infinicode` itself — that re-enters
32
- * this default command and creates an infinite launch loop (the npm package
33
- * ships the CLI/kernel only, without the large platform-specific TUI binary).
38
+ * this default command and creates an infinite launch loop.
34
39
  */
35
40
  function resolveTuiBinary() {
36
- const rootDir = resolve(__dirname, '..', '..');
37
- const names = process.platform === 'win32' ? ['infinicode-tui.exe'] : ['infinicode-tui'];
38
- for (const name of names) {
39
- const p = join(rootDir, 'bin', name);
41
+ const exe = process.platform === 'win32' ? 'infinicode-tui.exe' : 'infinicode-tui';
42
+ // 1. Platform binary package (npm installs only the one matching this OS/arch).
43
+ const pkg = `infinicode-tui-${process.platform}-${process.arch}`;
44
+ try {
45
+ const require = createRequire(import.meta.url);
46
+ const p = require.resolve(`${pkg}/${exe}`);
40
47
  if (existsSync(p))
41
48
  return p;
42
49
  }
50
+ catch {
51
+ /* platform package not installed — fall through */
52
+ }
53
+ // 2. Local bin/ (dev checkout or a manual `install-tui`).
54
+ const local = join(resolve(__dirname, '..', '..'), 'bin', exe);
55
+ if (existsSync(local))
56
+ return local;
43
57
  return null;
44
58
  }
45
59
  function fitPromptFrameToTerminal(frame) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infinicode",
3
- "version": "2.2.3",
3
+ "version": "2.3.1",
4
4
  "description": "OpenKernel — provider-agnostic AI execution kernel. Native coding agent + mission-driven execution runtime.",
5
5
  "type": "module",
6
6
  "main": "./dist/kernel/index.js",
@@ -84,6 +84,12 @@
84
84
  "typescript": "^5.4.5"
85
85
  },
86
86
  "optionalDependencies": {
87
- "playwright": "^1.47.0"
87
+ "playwright": "^1.47.0",
88
+ "infinicode-tui-win32-x64": "2.3.1",
89
+ "infinicode-tui-win32-arm64": "2.3.1",
90
+ "infinicode-tui-linux-x64": "2.3.1",
91
+ "infinicode-tui-linux-arm64": "2.3.1",
92
+ "infinicode-tui-darwin-x64": "2.3.1",
93
+ "infinicode-tui-darwin-arm64": "2.3.1"
88
94
  }
89
95
  }