@surething/cockpit 1.0.236 → 1.0.238
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +3 -3
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +3 -3
- package/.next-prod/server/chunks/9658.js +3 -3
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/3283-06498d72f2d02c34.js +25 -0
- package/.next-prod/static/chunks/app/{layout-3781fa5b8e04f272.js → layout-09e14606d83f2723.js} +1 -1
- package/.next-prod/static/chunks/app/{page-e63d872a9af204ae.js → page-9ad16c0c615eedae.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-e63d872a9af204ae.js → page-9ad16c0c615eedae.js} +1 -1
- package/.next-prod/static/css/{7ed891f30e531791.css → 76211649f6d7a87c.css} +1 -1
- package/.next-prod/trace +13 -13
- package/.next-prod/trace-build +1 -1
- package/bin/cock.mjs +26 -1
- package/bin/postinstall.mjs +15 -0
- package/package.json +2 -1
- package/scripts/claudeBinary.mjs +38 -0
- package/.next-prod/static/chunks/3283-80d4d836a00d7bb4.js +0 -25
- /package/.next-prod/static/{VRVzMV9rhbwaTwXonUCzN → UnrfRwZSyDx6zJRTpvkls}/_buildManifest.js +0 -0
- /package/.next-prod/static/{VRVzMV9rhbwaTwXonUCzN → UnrfRwZSyDx6zJRTpvkls}/_ssgManifest.js +0 -0
package/.next-prod/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":21294844,"timestamp":156554912,"id":14,"parentId":1,"tags":{},"startTime":1783433059900,"traceId":"a7f1671e07b37386"},{"name":"run-typescript","duration":20172493,"timestamp":177853825,"id":1606,"parentId":1,"tags":{},"startTime":1783433081199,"traceId":"a7f1671e07b37386"},{"name":"static-check","duration":1244947,"timestamp":198072105,"id":1609,"parentId":1,"tags":{},"startTime":1783433101417,"traceId":"a7f1671e07b37386"},{"name":"static-generation","duration":6902053,"timestamp":199474577,"id":1881,"parentId":1,"tags":{},"startTime":1783433102820,"traceId":"a7f1671e07b37386"},{"name":"collect-build-traces","duration":21598548,"timestamp":199317686,"id":1878,"parentId":1,"tags":{},"startTime":1783433102663,"traceId":"a7f1671e07b37386"},{"name":"telemetry-flush","duration":66,"timestamp":220921536,"id":1890,"parentId":1,"tags":{},"startTime":1783433124266,"traceId":"a7f1671e07b37386"},{"name":"next-build","duration":64554328,"timestamp":156367290,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1783433059712,"traceId":"a7f1671e07b37386"}]
|
package/bin/cock.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { dirname, resolve } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { spawnSync } from 'child_process';
|
|
6
|
+
import { hasClaudeBinary } from '../scripts/claudeBinary.mjs';
|
|
6
7
|
|
|
7
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
const PROJECT_ROOT = resolve(__dirname, '..');
|
|
@@ -124,11 +125,27 @@ if (process.argv[2] === 'connection') {
|
|
|
124
125
|
|
|
125
126
|
if (process.argv[2] === 'update') {
|
|
126
127
|
console.log('Updating @surething/cockpit...');
|
|
127
|
-
const
|
|
128
|
+
const installArgs = ['install', '-g', '@surething/cockpit@latest', '--include=optional'];
|
|
129
|
+
let result = spawnSync('npm', installArgs, { stdio: 'inherit' });
|
|
130
|
+
|
|
131
|
+
// An in-place `npm i -g` can drop the SDK's platform-specific native binary
|
|
132
|
+
// (an optional dependency) when the SDK version bumps — see
|
|
133
|
+
// scripts/claudeBinary.mjs. A clean uninstall + reinstall reliably refetches
|
|
134
|
+
// it. Guard here so `cockpit update` never leaves chat silently broken.
|
|
135
|
+
if (result.status === 0 && !hasClaudeBinary()) {
|
|
136
|
+
console.log('Native Claude binary missing after update — reinstalling to repair...');
|
|
137
|
+
spawnSync('npm', ['uninstall', '-g', '@surething/cockpit'], { stdio: 'inherit' });
|
|
138
|
+
result = spawnSync('npm', installArgs, { stdio: 'inherit' });
|
|
139
|
+
}
|
|
140
|
+
|
|
128
141
|
if (result.status === 0) {
|
|
129
142
|
const { readFileSync } = await import('fs');
|
|
130
143
|
const pkg = JSON.parse(readFileSync(resolve(PROJECT_ROOT, 'package.json'), 'utf8'));
|
|
131
144
|
console.log(`\nUpdated to v${pkg.version}`);
|
|
145
|
+
if (!hasClaudeBinary()) {
|
|
146
|
+
console.error('\nWarning: the native Claude CLI binary is still missing; chat will not work.');
|
|
147
|
+
console.error('Fix manually: npm uninstall -g @surething/cockpit && npm install -g @surething/cockpit');
|
|
148
|
+
}
|
|
132
149
|
}
|
|
133
150
|
process.exit(result.status ?? 1);
|
|
134
151
|
}
|
|
@@ -194,6 +211,14 @@ if (!isDev && !existsSync(resolve(PROJECT_ROOT, '.next-prod', 'BUILD_ID'))) {
|
|
|
194
211
|
process.exit(1);
|
|
195
212
|
}
|
|
196
213
|
|
|
214
|
+
// Warn (don't block) if the SDK's native binary is missing — every panel but
|
|
215
|
+
// the Claude chat still works, but chat would otherwise fail with a cryptic
|
|
216
|
+
// runtime error only once the user sends a message. See scripts/claudeBinary.mjs.
|
|
217
|
+
if (!hasClaudeBinary()) {
|
|
218
|
+
console.error('Warning: the native Claude CLI binary is missing; chat may not work.');
|
|
219
|
+
console.error('Fix: npm uninstall -g @surething/cockpit && npm install -g @surething/cockpit\n');
|
|
220
|
+
}
|
|
221
|
+
|
|
197
222
|
// Hand the project directory to server.mjs so it opens the right URL
|
|
198
223
|
if (projectDir) {
|
|
199
224
|
process.env.COCKPIT_OPEN_PROJECT = projectDir;
|
package/bin/postinstall.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { execSync } from 'child_process';
|
|
|
7
7
|
import { homedir } from 'os';
|
|
8
8
|
import { copyTreeSitterWasms } from '../scripts/copy-tree-sitter-wasms.mjs';
|
|
9
9
|
import { copyPdfjsWorker } from '../scripts/copy-pdfjs-worker.mjs';
|
|
10
|
+
import { hasClaudeBinary } from '../scripts/claudeBinary.mjs';
|
|
10
11
|
|
|
11
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
13
|
const projectRoot = join(__dirname, '..');
|
|
@@ -28,6 +29,20 @@ try {
|
|
|
28
29
|
console.warn('[postinstall] pdf.js worker copy failed:', err?.message ?? err);
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
// Warn (don't fail) if the Claude Agent SDK's native binary didn't land — the
|
|
33
|
+
// chat engine needs it. npm can skip this optional platform sub-package during
|
|
34
|
+
// an in-place `npm i -g` upgrade; catching it here turns a mid-chat runtime
|
|
35
|
+
// error into an install-time hint. See scripts/claudeBinary.mjs.
|
|
36
|
+
try {
|
|
37
|
+
if (!hasClaudeBinary()) {
|
|
38
|
+
const plat = `${process.platform}-${process.arch}`;
|
|
39
|
+
console.warn(`[postinstall] Warning: Claude native binary (${plat}) is missing — chat will not work.`);
|
|
40
|
+
console.warn('[postinstall] Fix: npm uninstall -g @surething/cockpit && npm install -g @surething/cockpit');
|
|
41
|
+
}
|
|
42
|
+
} catch (err) {
|
|
43
|
+
console.warn('[postinstall] Claude binary check failed:', err?.message ?? err);
|
|
44
|
+
}
|
|
45
|
+
|
|
31
46
|
if (process.platform !== 'win32') {
|
|
32
47
|
// node-pty: spawn-helper needs the executable bit
|
|
33
48
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surething/cockpit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.238",
|
|
4
4
|
"description": "The open-source Claude Code GUI — an IDE-like workbench for parallel AI coding. Drive Claude (default), Codex, DeepSeek, Kimi, or local Ollama in tabs. Terminal, browser & DB bubbles, code review. Self-host on a shared dev box — a seat for every teammate. Local-first, MIT.",
|
|
5
5
|
"author": "Robert",
|
|
6
6
|
"license": "MIT",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"next.config.mjs",
|
|
76
76
|
"scripts/copy-tree-sitter-wasms.mjs",
|
|
77
77
|
"scripts/copy-pdfjs-worker.mjs",
|
|
78
|
+
"scripts/claudeBinary.mjs",
|
|
78
79
|
"LICENSE",
|
|
79
80
|
"README.md"
|
|
80
81
|
],
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect whether the Claude Agent SDK's platform-specific native `claude`
|
|
3
|
+
* binary is actually installed for the current platform.
|
|
4
|
+
*
|
|
5
|
+
* The binary ships as an OPTIONAL dependency of `@anthropic-ai/claude-agent-sdk`
|
|
6
|
+
* (one sub-package per platform, e.g. `-darwin-arm64`). npm can silently skip it
|
|
7
|
+
* during an in-place `npm i -g` upgrade when the SDK version bumps via its caret
|
|
8
|
+
* range, leaving the SDK unable to spawn `claude` at runtime with:
|
|
9
|
+
* "Native CLI binary for <platform>-<arch> not found. Reinstall
|
|
10
|
+
* @anthropic-ai/claude-agent-sdk without --omit=optional, ..."
|
|
11
|
+
*
|
|
12
|
+
* `cockpit update`, postinstall, and CLI startup all call this so the problem is
|
|
13
|
+
* surfaced (and repaired) BEFORE the user hits the runtime error mid-chat.
|
|
14
|
+
*/
|
|
15
|
+
import { createRequire } from 'module';
|
|
16
|
+
import { existsSync } from 'fs';
|
|
17
|
+
import { join, dirname } from 'path';
|
|
18
|
+
|
|
19
|
+
const require = createRequire(import.meta.url);
|
|
20
|
+
|
|
21
|
+
/** @returns {boolean} true if the current platform's `claude` binary resolves. */
|
|
22
|
+
export function hasClaudeBinary() {
|
|
23
|
+
const base = `${process.platform}-${process.arch}`;
|
|
24
|
+
// linux ships glibc and musl variants under distinct package names.
|
|
25
|
+
const variants = process.platform === 'linux' ? [base, `${base}-musl`] : [base];
|
|
26
|
+
for (const variant of variants) {
|
|
27
|
+
try {
|
|
28
|
+
const pkgJson = require.resolve(
|
|
29
|
+
`@anthropic-ai/claude-agent-sdk-${variant}/package.json`,
|
|
30
|
+
);
|
|
31
|
+
const bin = join(dirname(pkgJson), 'claude');
|
|
32
|
+
if (existsSync(bin) || existsSync(`${bin}.exe`)) return true;
|
|
33
|
+
} catch {
|
|
34
|
+
// Not resolvable → this variant's sub-package isn't installed.
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|