@cjhyy/code-shell-server 0.8.10 → 0.8.12
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/index.serve.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Ready-made headless HTTP/WebSocket host and CLI composition helpers. */
|
|
2
2
|
export * from "./serve/headless-server.js";
|
|
3
|
-
export { parseServeArgs, resolveWebAppRoot, resolveWorkerEntry, runServeCli } from "./serve/cli.js";
|
|
3
|
+
export { parseServeArgs, resolveWebAppRoot, resolveWorkerCapabilityModules, resolveWorkerEntry, runServeCli, } from "./serve/cli.js";
|
package/dist/index.serve.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Ready-made headless HTTP/WebSocket host and CLI composition helpers. */
|
|
2
2
|
export * from "./serve/headless-server.js";
|
|
3
|
-
export { parseServeArgs, resolveWebAppRoot, resolveWorkerEntry, runServeCli } from "./serve/cli.js";
|
|
3
|
+
export { parseServeArgs, resolveWebAppRoot, resolveWorkerCapabilityModules, resolveWorkerEntry, runServeCli, } from "./serve/cli.js";
|
package/dist/serve/cli.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ interface CliArgs {
|
|
|
9
9
|
export declare function parseServeArgs(argv: string[], env?: NodeJS.ProcessEnv): CliArgs;
|
|
10
10
|
/** Locate the stdio worker entry the same way desktop's AgentBridge does. */
|
|
11
11
|
export declare function resolveWorkerEntry(): string;
|
|
12
|
+
/**
|
|
13
|
+
* AgentModule spec string for the worker env — headless serve ships the
|
|
14
|
+
* coding module (matches the pre-cutover behavior where the coding bin
|
|
15
|
+
* wrapper registered it; arena/pet stay desktop-only).
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveWorkerCapabilityModules(): string;
|
|
12
18
|
/** Locate the built browser app (packages/web `app` build), when present. */
|
|
13
19
|
export declare function resolveWebAppRoot(): string | undefined;
|
|
14
20
|
export declare function runServeCli(argv?: string[]): Promise<void>;
|
package/dist/serve/cli.js
CHANGED
|
@@ -64,7 +64,15 @@ export function parseServeArgs(argv, env = process.env) {
|
|
|
64
64
|
/** Locate the stdio worker entry the same way desktop's AgentBridge does. */
|
|
65
65
|
export function resolveWorkerEntry() {
|
|
66
66
|
const require = createRequire(import.meta.url);
|
|
67
|
-
return require.resolve("@cjhyy/code-shell-
|
|
67
|
+
return require.resolve("@cjhyy/code-shell-core/bin/agent-server-stdio");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* AgentModule spec string for the worker env — headless serve ships the
|
|
71
|
+
* coding module (matches the pre-cutover behavior where the coding bin
|
|
72
|
+
* wrapper registered it; arena/pet stay desktop-only).
|
|
73
|
+
*/
|
|
74
|
+
export function resolveWorkerCapabilityModules() {
|
|
75
|
+
return `${import.meta.resolve("@cjhyy/code-shell-capability-coding")}#createCodingModule`;
|
|
68
76
|
}
|
|
69
77
|
/** Locate the built browser app (packages/web `app` build), when present. */
|
|
70
78
|
export function resolveWebAppRoot() {
|
|
@@ -94,6 +102,7 @@ export async function runServeCli(argv = process.argv.slice(2)) {
|
|
|
94
102
|
cwd: parsed.cwd,
|
|
95
103
|
dataDir: parsed.dataDir,
|
|
96
104
|
workerEntryPath: resolveWorkerEntry(),
|
|
105
|
+
workerCapabilityModules: resolveWorkerCapabilityModules(),
|
|
97
106
|
...(staticRootDir ? { staticRootDir } : {}),
|
|
98
107
|
...(parsed.passcode ? { passcode: parsed.passcode } : {}),
|
|
99
108
|
log: (event, data) => console.error(`[serve] ${event}${data ? ` ${JSON.stringify(data)}` : ""}`),
|
|
@@ -11,6 +11,8 @@ export interface HeadlessServeOptions {
|
|
|
11
11
|
dataDir: string;
|
|
12
12
|
/** Absolute path of the agent-server-stdio worker entry. */
|
|
13
13
|
workerEntryPath: string;
|
|
14
|
+
/** CODE_SHELL_CAPABILITY_MODULES spec injected into the worker env. */
|
|
15
|
+
workerCapabilityModules?: string;
|
|
14
16
|
/** Session root override for tests/relocated workers. Defaults to core's canonical root. */
|
|
15
17
|
sessionRootDir?: string;
|
|
16
18
|
/**
|
|
@@ -98,7 +98,13 @@ export async function startHeadlessServer(opts) {
|
|
|
98
98
|
entryPath: opts.workerEntryPath,
|
|
99
99
|
execPath: opts.execPath,
|
|
100
100
|
fallbackCwd: () => opts.cwd,
|
|
101
|
-
buildEnv: () => ({
|
|
101
|
+
buildEnv: () => ({
|
|
102
|
+
...process.env,
|
|
103
|
+
CODE_SHELL_DATA_ROOT: workerDataRoot,
|
|
104
|
+
...(opts.workerCapabilityModules
|
|
105
|
+
? { CODE_SHELL_CAPABILITY_MODULES: opts.workerCapabilityModules }
|
|
106
|
+
: {}),
|
|
107
|
+
}),
|
|
102
108
|
log,
|
|
103
109
|
onStderr: (text) => log("worker.stderr", { text: previewLine(text) }),
|
|
104
110
|
onExit: (info) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cjhyy/code-shell-server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.12",
|
|
4
4
|
"description": "CodeShell server transport layer — mobile remote HTTP/WS host, pairing, passcode gate, tunnel, rooms, uploads, and session/attachment services. Electron-free; precursor of the auth gateway.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@cjhyy/code-shell-capability-coding": "0.8.
|
|
43
|
-
"@cjhyy/code-shell-core": "0.8.
|
|
44
|
-
"@cjhyy/code-shell-web": "0.8.
|
|
42
|
+
"@cjhyy/code-shell-capability-coding": "0.8.12",
|
|
43
|
+
"@cjhyy/code-shell-core": "0.8.12",
|
|
44
|
+
"@cjhyy/code-shell-web": "0.8.12",
|
|
45
45
|
"@types/ws": "^8.18.1",
|
|
46
46
|
"ws": "^8.21.0"
|
|
47
47
|
},
|