dev-sessions 0.1.0
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/README.md +156 -0
- package/dist/backends/claude-tmux.d.ts +19 -0
- package/dist/backends/claude-tmux.js +162 -0
- package/dist/backends/claude-tmux.js.map +1 -0
- package/dist/backends/codex-appserver.d.ts +71 -0
- package/dist/backends/codex-appserver.js +839 -0
- package/dist/backends/codex-appserver.js.map +1 -0
- package/dist/champion-ids.d.ts +11 -0
- package/dist/champion-ids.js +51 -0
- package/dist/champion-ids.js.map +1 -0
- package/dist/cli.d.ts +33 -0
- package/dist/cli.js +307 -0
- package/dist/cli.js.map +1 -0
- package/dist/gateway/client.d.ts +31 -0
- package/dist/gateway/client.js +146 -0
- package/dist/gateway/client.js.map +1 -0
- package/dist/gateway/server.d.ts +27 -0
- package/dist/gateway/server.js +409 -0
- package/dist/gateway/server.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/session-manager.d.ts +36 -0
- package/dist/session-manager.js +407 -0
- package/dist/session-manager.js.map +1 -0
- package/dist/session-store.d.ts +15 -0
- package/dist/session-store.js +143 -0
- package/dist/session-store.js.map +1 -0
- package/dist/transcript/claude-parser.d.ts +17 -0
- package/dist/transcript/claude-parser.js +203 -0
- package/dist/transcript/claude-parser.js.map +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +37 -0
- package/skill/SKILL.md +141 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GatewaySessionManager = void 0;
|
|
7
|
+
exports.resolveGatewayBaseUrl = resolveGatewayBaseUrl;
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const DEFAULT_GATEWAY_BASE_URL = 'http://host.docker.internal:6767';
|
|
10
|
+
function isAgentTurnStatus(value) {
|
|
11
|
+
return value === 'idle' || value === 'working' || value === 'waiting_for_input';
|
|
12
|
+
}
|
|
13
|
+
function resolveGatewayBaseUrl(env = process.env) {
|
|
14
|
+
const rawUrl = env.DEV_SESSIONS_GATEWAY_URL;
|
|
15
|
+
if (typeof rawUrl === 'string' && rawUrl.trim().length > 0) {
|
|
16
|
+
return rawUrl.trim();
|
|
17
|
+
}
|
|
18
|
+
return DEFAULT_GATEWAY_BASE_URL;
|
|
19
|
+
}
|
|
20
|
+
class GatewaySessionManager {
|
|
21
|
+
baseUrl;
|
|
22
|
+
fetchFn;
|
|
23
|
+
constructor(options = {}) {
|
|
24
|
+
this.baseUrl = (options.baseUrl ?? resolveGatewayBaseUrl()).replace(/\/+$/, '');
|
|
25
|
+
this.fetchFn = options.fetchFn ?? fetch;
|
|
26
|
+
}
|
|
27
|
+
async createSession(options) {
|
|
28
|
+
const payload = {
|
|
29
|
+
path: node_path_1.default.resolve(options.path ?? process.cwd()),
|
|
30
|
+
cli: options.cli ?? 'claude',
|
|
31
|
+
mode: options.mode ?? 'yolo'
|
|
32
|
+
};
|
|
33
|
+
if (typeof options.description === 'string' && options.description.trim().length > 0) {
|
|
34
|
+
payload.description = options.description;
|
|
35
|
+
}
|
|
36
|
+
const response = await this.request('/create', {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
body: JSON.stringify(payload)
|
|
39
|
+
});
|
|
40
|
+
if (response.session) {
|
|
41
|
+
return response.session;
|
|
42
|
+
}
|
|
43
|
+
const listResponse = await this.request('/list');
|
|
44
|
+
const resolved = listResponse.sessions.find((candidate) => candidate.championId === response.sessionId);
|
|
45
|
+
if (resolved) {
|
|
46
|
+
return resolved;
|
|
47
|
+
}
|
|
48
|
+
const timestamp = new Date().toISOString();
|
|
49
|
+
return {
|
|
50
|
+
championId: response.sessionId,
|
|
51
|
+
internalId: response.sessionId,
|
|
52
|
+
cli: payload.cli ?? 'claude',
|
|
53
|
+
mode: payload.mode ?? 'yolo',
|
|
54
|
+
path: String(payload.path),
|
|
55
|
+
description: options.description,
|
|
56
|
+
status: 'active',
|
|
57
|
+
createdAt: timestamp,
|
|
58
|
+
lastUsed: timestamp
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async sendMessage(championId, message) {
|
|
62
|
+
await this.request('/send', {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
body: JSON.stringify({
|
|
65
|
+
sessionId: championId,
|
|
66
|
+
message
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async killSession(championId) {
|
|
71
|
+
await this.request('/kill', {
|
|
72
|
+
method: 'POST',
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
sessionId: championId
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async listSessions() {
|
|
79
|
+
const response = await this.request('/list');
|
|
80
|
+
return response.sessions;
|
|
81
|
+
}
|
|
82
|
+
async getLastAssistantTextBlocks(championId, count) {
|
|
83
|
+
const safeCount = Math.max(1, count);
|
|
84
|
+
const query = new URLSearchParams({
|
|
85
|
+
id: championId,
|
|
86
|
+
n: String(safeCount)
|
|
87
|
+
});
|
|
88
|
+
const response = await this.request(`/last-message?${query.toString()}`);
|
|
89
|
+
return response.blocks;
|
|
90
|
+
}
|
|
91
|
+
async getSessionStatus(championId) {
|
|
92
|
+
const query = new URLSearchParams({
|
|
93
|
+
id: championId
|
|
94
|
+
});
|
|
95
|
+
const response = await this.request(`/status?${query.toString()}`);
|
|
96
|
+
if (!isAgentTurnStatus(response.status)) {
|
|
97
|
+
throw new Error(`Gateway returned invalid status: ${String(response.status)}`);
|
|
98
|
+
}
|
|
99
|
+
return response.status;
|
|
100
|
+
}
|
|
101
|
+
async waitForSession(championId, options = {}) {
|
|
102
|
+
const timeoutSeconds = Math.max(1, options.timeoutSeconds ?? 300);
|
|
103
|
+
const query = new URLSearchParams({
|
|
104
|
+
id: championId,
|
|
105
|
+
timeout: String(timeoutSeconds)
|
|
106
|
+
});
|
|
107
|
+
if (typeof options.intervalSeconds === 'number' && Number.isFinite(options.intervalSeconds)) {
|
|
108
|
+
query.set('interval', String(Math.max(1, options.intervalSeconds)));
|
|
109
|
+
}
|
|
110
|
+
const response = await this.request(`/wait?${query.toString()}`);
|
|
111
|
+
return response.waitResult;
|
|
112
|
+
}
|
|
113
|
+
async request(requestPath, init = {}) {
|
|
114
|
+
const requestUrl = `${this.baseUrl}${requestPath}`;
|
|
115
|
+
let response;
|
|
116
|
+
try {
|
|
117
|
+
response = await this.fetchFn(requestUrl, {
|
|
118
|
+
...init,
|
|
119
|
+
headers: {
|
|
120
|
+
'content-type': 'application/json',
|
|
121
|
+
...init.headers
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
// Sandbox/Docker sessions use the local gateway HTTP bridge; unreachable gateway fetches fail as TypeError.
|
|
127
|
+
if (error instanceof TypeError) {
|
|
128
|
+
const hint = 'Is the gateway running? Start it with: dev-sessions gateway --port <port>';
|
|
129
|
+
const detail = typeof error.message === 'string' && error.message.length > 0 ? ` (${error.message})` : '';
|
|
130
|
+
throw new Error(`Gateway request failed for ${requestUrl}${detail}. ${hint}`);
|
|
131
|
+
}
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
const rawBody = await response.text();
|
|
135
|
+
const payload = rawBody.length > 0 ? JSON.parse(rawBody) : {};
|
|
136
|
+
if (!response.ok) {
|
|
137
|
+
const errorMessage = typeof payload.error === 'string' && payload.error.length > 0
|
|
138
|
+
? payload.error
|
|
139
|
+
: `Gateway request failed with status ${response.status}`;
|
|
140
|
+
throw new Error(errorMessage);
|
|
141
|
+
}
|
|
142
|
+
return payload;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.GatewaySessionManager = GatewaySessionManager;
|
|
146
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/gateway/client.ts"],"names":[],"mappings":";;;;;;AAgDA,sDAOC;AAvDD,0DAA6B;AAG7B,MAAM,wBAAwB,GAAG,kCAAkC,CAAC;AAyCpE,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,mBAAmB,CAAC;AAClF,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACxE,MAAM,MAAM,GAAG,GAAG,CAAC,wBAAwB,CAAC;IAC5C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,MAAa,qBAAqB;IACf,OAAO,CAAS;IAEhB,OAAO,CAAe;IAEvC,YAAY,UAAgC,EAAE;QAC5C,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,MAAM,OAAO,GAA4B;YACvC,IAAI,EAAE,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YACjD,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,QAAQ;YAC5B,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,MAAM;SAC7B,CAAC;QAEF,IA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QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,4GAA4G;YAC5G,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;gBAC/B,MAAM,IAAI,GAAG,2EAA2E,CAAC;gBACzF,MAAM,MAAM,GAAG,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1G,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,GAAG,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC;YAChF,CAAC;YAED,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAA4B,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,YAAY,GAChB,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;gBAC3D,CAAC,CAAC,OAAO,CAAC,KAAK;gBACf,CAAC,CAAC,sCAAsC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,OAAY,CAAC;IACtB,CAAC;CACF;AArJD,sDAqJC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import express from 'express';
|
|
3
|
+
export interface GatewayCommandResult {
|
|
4
|
+
command: string[];
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
exitCode: number;
|
|
8
|
+
}
|
|
9
|
+
export type GatewayCommandExecutor = (args: string[]) => Promise<GatewayCommandResult>;
|
|
10
|
+
export interface StartGatewayServerOptions {
|
|
11
|
+
port?: number;
|
|
12
|
+
cliBinary?: string;
|
|
13
|
+
executeCommand?: GatewayCommandExecutor;
|
|
14
|
+
}
|
|
15
|
+
export declare class GatewayCommandError extends Error {
|
|
16
|
+
readonly result: GatewayCommandResult;
|
|
17
|
+
constructor(message: string, result: GatewayCommandResult);
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveGatewayPort(env?: NodeJS.ProcessEnv): number;
|
|
20
|
+
export declare function resolveGatewayCliBinary(argv?: readonly string[], moduleDir?: string): string;
|
|
21
|
+
export declare function createGatewayCommandExecutor(cliBinary?: string): GatewayCommandExecutor;
|
|
22
|
+
export declare function createGatewayApp(executeCommand?: GatewayCommandExecutor): express.Express;
|
|
23
|
+
export declare function startGatewayServer(options?: StartGatewayServerOptions): Promise<{
|
|
24
|
+
app: express.Express;
|
|
25
|
+
server: Server;
|
|
26
|
+
port: number;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GatewayCommandError = void 0;
|
|
7
|
+
exports.resolveGatewayPort = resolveGatewayPort;
|
|
8
|
+
exports.resolveGatewayCliBinary = resolveGatewayCliBinary;
|
|
9
|
+
exports.createGatewayCommandExecutor = createGatewayCommandExecutor;
|
|
10
|
+
exports.createGatewayApp = createGatewayApp;
|
|
11
|
+
exports.startGatewayServer = startGatewayServer;
|
|
12
|
+
const node_child_process_1 = require("node:child_process");
|
|
13
|
+
const node_fs_1 = require("node:fs");
|
|
14
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
15
|
+
const node_util_1 = require("node:util");
|
|
16
|
+
const express_1 = __importDefault(require("express"));
|
|
17
|
+
const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
18
|
+
const DEFAULT_GATEWAY_PORT = 6767;
|
|
19
|
+
const DEFAULT_GATEWAY_CLI_BINARY = 'dev-sessions';
|
|
20
|
+
const ALLOWED_CLIS = ['claude', 'codex'];
|
|
21
|
+
const ALLOWED_MODES = ['yolo', 'native', 'docker'];
|
|
22
|
+
class GatewayCommandError extends Error {
|
|
23
|
+
result;
|
|
24
|
+
constructor(message, result) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.result = result;
|
|
27
|
+
this.name = 'GatewayCommandError';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.GatewayCommandError = GatewayCommandError;
|
|
31
|
+
function ensureNonEmptyString(value, fieldName) {
|
|
32
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
33
|
+
throw new Error(`${fieldName} is required and must be a non-empty string`);
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
function parsePositiveInteger(value, fieldName) {
|
|
38
|
+
if (!/^\d+$/.test(value)) {
|
|
39
|
+
throw new Error(`${fieldName} must be a positive integer`);
|
|
40
|
+
}
|
|
41
|
+
const parsed = Number.parseInt(value, 10);
|
|
42
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
43
|
+
throw new Error(`${fieldName} must be a positive integer`);
|
|
44
|
+
}
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
function parsePositiveIntegerQuery(value, defaultValue, fieldName) {
|
|
48
|
+
if (value === undefined) {
|
|
49
|
+
return defaultValue;
|
|
50
|
+
}
|
|
51
|
+
if (typeof value !== 'string') {
|
|
52
|
+
throw new Error(`${fieldName} must be a positive integer`);
|
|
53
|
+
}
|
|
54
|
+
return parsePositiveInteger(value, fieldName);
|
|
55
|
+
}
|
|
56
|
+
function isGatewayCommandError(error) {
|
|
57
|
+
return error instanceof GatewayCommandError;
|
|
58
|
+
}
|
|
59
|
+
function parseSessionsPayload(stdout) {
|
|
60
|
+
const parsed = JSON.parse(stdout);
|
|
61
|
+
if (!Array.isArray(parsed)) {
|
|
62
|
+
throw new Error('Expected list command to return a JSON array');
|
|
63
|
+
}
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
function serializeCommandResult(result) {
|
|
67
|
+
return {
|
|
68
|
+
command: [...result.command],
|
|
69
|
+
stdout: result.stdout,
|
|
70
|
+
stderr: result.stderr,
|
|
71
|
+
exitCode: result.exitCode
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function jsonError(res, statusCode, message) {
|
|
75
|
+
res.status(statusCode).json({
|
|
76
|
+
ok: false,
|
|
77
|
+
error: message
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function handleRouteError(res, error) {
|
|
81
|
+
if (isGatewayCommandError(error)) {
|
|
82
|
+
res.status(500).json({
|
|
83
|
+
ok: false,
|
|
84
|
+
error: error.message,
|
|
85
|
+
output: serializeCommandResult(error.result)
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
90
|
+
jsonError(res, 500, message);
|
|
91
|
+
}
|
|
92
|
+
function resolveGatewayPort(env = process.env) {
|
|
93
|
+
const rawPort = env.DEV_SESSIONS_GATEWAY_PORT;
|
|
94
|
+
if (!rawPort) {
|
|
95
|
+
return DEFAULT_GATEWAY_PORT;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
return parsePositiveInteger(rawPort, 'DEV_SESSIONS_GATEWAY_PORT');
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return DEFAULT_GATEWAY_PORT;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function resolveGatewayCliBinary(argv = process.argv, moduleDir = __dirname) {
|
|
105
|
+
const argvBinary = typeof argv[1] === 'string' && argv[1].trim().length > 0 ? node_path_1.default.resolve(argv[1]) : undefined;
|
|
106
|
+
const candidates = [
|
|
107
|
+
argvBinary,
|
|
108
|
+
node_path_1.default.resolve(moduleDir, '..', 'cli.js'),
|
|
109
|
+
node_path_1.default.resolve(moduleDir, '..', 'index.js'),
|
|
110
|
+
node_path_1.default.resolve(moduleDir, '..', '..', 'dist', 'cli.js'),
|
|
111
|
+
node_path_1.default.resolve(moduleDir, '..', '..', 'dist', 'index.js')
|
|
112
|
+
];
|
|
113
|
+
for (const candidate of candidates) {
|
|
114
|
+
if (candidate && (0, node_fs_1.existsSync)(candidate)) {
|
|
115
|
+
return candidate;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return DEFAULT_GATEWAY_CLI_BINARY;
|
|
119
|
+
}
|
|
120
|
+
function createGatewayCommandExecutor(cliBinary = resolveGatewayCliBinary()) {
|
|
121
|
+
return async (args) => {
|
|
122
|
+
try {
|
|
123
|
+
const { stdout, stderr } = await execFileAsync(cliBinary, args, {
|
|
124
|
+
encoding: 'utf8',
|
|
125
|
+
maxBuffer: 1024 * 1024 * 4,
|
|
126
|
+
env: {
|
|
127
|
+
...process.env,
|
|
128
|
+
IS_SANDBOX: '0',
|
|
129
|
+
DEV_SESSIONS_GATEWAY_URL: ''
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
command: [cliBinary, ...args],
|
|
134
|
+
stdout,
|
|
135
|
+
stderr,
|
|
136
|
+
exitCode: 0
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
const candidate = error;
|
|
141
|
+
const exitCode = typeof candidate.code === 'number'
|
|
142
|
+
? candidate.code
|
|
143
|
+
: candidate.code === 'ENOENT'
|
|
144
|
+
? 127
|
|
145
|
+
: 1;
|
|
146
|
+
const stderr = typeof candidate.stderr === 'string' && candidate.stderr.length > 0
|
|
147
|
+
? candidate.stderr
|
|
148
|
+
: candidate.message;
|
|
149
|
+
throw new GatewayCommandError(`Command failed: ${cliBinary} ${args.join(' ')}`.trim(), {
|
|
150
|
+
command: [cliBinary, ...args],
|
|
151
|
+
stdout: typeof candidate.stdout === 'string' ? candidate.stdout : '',
|
|
152
|
+
stderr,
|
|
153
|
+
exitCode
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function createGatewayApp(executeCommand = createGatewayCommandExecutor()) {
|
|
159
|
+
const app = (0, express_1.default)();
|
|
160
|
+
app.use((req, res, next) => {
|
|
161
|
+
const startedAt = Date.now();
|
|
162
|
+
res.once('finish', () => {
|
|
163
|
+
const durationMs = Date.now() - startedAt;
|
|
164
|
+
console.log(`[gateway] ${new Date().toISOString()} ${req.method} ${req.path} ${res.statusCode} ${durationMs}ms`);
|
|
165
|
+
});
|
|
166
|
+
next();
|
|
167
|
+
});
|
|
168
|
+
app.use(express_1.default.json());
|
|
169
|
+
app.post('/create', async (req, res) => {
|
|
170
|
+
try {
|
|
171
|
+
const workspacePath = ensureNonEmptyString(req.body.path, 'path');
|
|
172
|
+
const args = ['create', '--quiet', '--path', workspacePath];
|
|
173
|
+
if (req.body.cli !== undefined) {
|
|
174
|
+
if (typeof req.body.cli !== 'string' || !ALLOWED_CLIS.includes(req.body.cli)) {
|
|
175
|
+
jsonError(res, 400, 'cli must be one of: claude, codex');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
args.push('--cli', req.body.cli);
|
|
179
|
+
}
|
|
180
|
+
if (req.body.mode !== undefined) {
|
|
181
|
+
if (typeof req.body.mode !== 'string' || !ALLOWED_MODES.includes(req.body.mode)) {
|
|
182
|
+
jsonError(res, 400, 'mode must be one of: yolo, native, docker');
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
args.push('--mode', req.body.mode);
|
|
186
|
+
}
|
|
187
|
+
if (req.body.description !== undefined) {
|
|
188
|
+
if (typeof req.body.description !== 'string') {
|
|
189
|
+
jsonError(res, 400, 'description must be a string');
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (req.body.description.trim().length > 0) {
|
|
193
|
+
args.push('--description', req.body.description);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const createResult = await executeCommand(args);
|
|
197
|
+
const sessionId = createResult.stdout.trim();
|
|
198
|
+
if (sessionId.length === 0) {
|
|
199
|
+
throw new Error('create command did not return a session ID');
|
|
200
|
+
}
|
|
201
|
+
let session;
|
|
202
|
+
try {
|
|
203
|
+
const listResult = await executeCommand(['list', '--json']);
|
|
204
|
+
const sessions = parseSessionsPayload(listResult.stdout);
|
|
205
|
+
session = sessions.find((candidate) => candidate.championId === sessionId);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// create already succeeded; session lookup is best-effort
|
|
209
|
+
}
|
|
210
|
+
res.json({
|
|
211
|
+
ok: true,
|
|
212
|
+
sessionId,
|
|
213
|
+
session,
|
|
214
|
+
output: serializeCommandResult(createResult)
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
if (error instanceof Error && /required and must be a non-empty string/.test(error.message)) {
|
|
219
|
+
jsonError(res, 400, error.message);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
handleRouteError(res, error);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
app.post('/send', async (req, res) => {
|
|
226
|
+
try {
|
|
227
|
+
const sessionId = ensureNonEmptyString(req.body.sessionId, 'sessionId');
|
|
228
|
+
const message = typeof req.body.message === 'string' && req.body.message.trim().length > 0 ? req.body.message : undefined;
|
|
229
|
+
const file = typeof req.body.file === 'string' && req.body.file.trim().length > 0 ? req.body.file : undefined;
|
|
230
|
+
if ((message && file) || (!message && !file)) {
|
|
231
|
+
jsonError(res, 400, 'Provide exactly one of message or file');
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const args = ['send', sessionId];
|
|
235
|
+
if (file) {
|
|
236
|
+
args.push('--file', file);
|
|
237
|
+
}
|
|
238
|
+
else if (message) {
|
|
239
|
+
args.push(message);
|
|
240
|
+
}
|
|
241
|
+
const result = await executeCommand(args);
|
|
242
|
+
res.json({
|
|
243
|
+
ok: true,
|
|
244
|
+
output: serializeCommandResult(result)
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
if (error instanceof Error && /required and must be a non-empty string/.test(error.message)) {
|
|
249
|
+
jsonError(res, 400, error.message);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
handleRouteError(res, error);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
app.post('/kill', async (req, res) => {
|
|
256
|
+
try {
|
|
257
|
+
const sessionId = ensureNonEmptyString(req.body.sessionId, 'sessionId');
|
|
258
|
+
const result = await executeCommand(['kill', sessionId]);
|
|
259
|
+
res.json({
|
|
260
|
+
ok: true,
|
|
261
|
+
output: serializeCommandResult(result)
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
if (error instanceof Error && /required and must be a non-empty string/.test(error.message)) {
|
|
266
|
+
jsonError(res, 400, error.message);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
handleRouteError(res, error);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
app.get('/list', async (_req, res) => {
|
|
273
|
+
try {
|
|
274
|
+
const result = await executeCommand(['list', '--json']);
|
|
275
|
+
const sessions = parseSessionsPayload(result.stdout);
|
|
276
|
+
res.json({
|
|
277
|
+
ok: true,
|
|
278
|
+
sessions,
|
|
279
|
+
output: serializeCommandResult(result)
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
handleRouteError(res, error);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
app.get('/status', async (req, res) => {
|
|
287
|
+
try {
|
|
288
|
+
const sessionId = ensureNonEmptyString(req.query.id, 'id');
|
|
289
|
+
const result = await executeCommand(['status', sessionId]);
|
|
290
|
+
const status = result.stdout.trim();
|
|
291
|
+
res.json({
|
|
292
|
+
ok: true,
|
|
293
|
+
status,
|
|
294
|
+
output: serializeCommandResult(result)
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
if (error instanceof Error && /required and must be a non-empty string/.test(error.message)) {
|
|
299
|
+
jsonError(res, 400, error.message);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
handleRouteError(res, error);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
app.get('/wait', async (req, res) => {
|
|
306
|
+
let timeoutSeconds = 300;
|
|
307
|
+
let intervalSeconds;
|
|
308
|
+
try {
|
|
309
|
+
const sessionId = ensureNonEmptyString(req.query.id, 'id');
|
|
310
|
+
timeoutSeconds = parsePositiveIntegerQuery(req.query.timeout, 300, 'timeout');
|
|
311
|
+
if (req.query.interval !== undefined) {
|
|
312
|
+
intervalSeconds = parsePositiveIntegerQuery(req.query.interval, 2, 'interval');
|
|
313
|
+
}
|
|
314
|
+
const args = ['wait', sessionId, '--timeout', String(timeoutSeconds)];
|
|
315
|
+
if (intervalSeconds !== undefined) {
|
|
316
|
+
args.push('--interval', String(intervalSeconds));
|
|
317
|
+
}
|
|
318
|
+
const startTime = Date.now();
|
|
319
|
+
try {
|
|
320
|
+
const result = await executeCommand(args);
|
|
321
|
+
res.json({
|
|
322
|
+
ok: true,
|
|
323
|
+
waitResult: {
|
|
324
|
+
completed: true,
|
|
325
|
+
timedOut: false,
|
|
326
|
+
elapsedMs: Date.now() - startTime
|
|
327
|
+
},
|
|
328
|
+
output: serializeCommandResult(result)
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
if (isGatewayCommandError(error) && error.result.exitCode === 124) {
|
|
333
|
+
res.json({
|
|
334
|
+
ok: true,
|
|
335
|
+
waitResult: {
|
|
336
|
+
completed: false,
|
|
337
|
+
timedOut: true,
|
|
338
|
+
elapsedMs: Date.now() - startTime
|
|
339
|
+
},
|
|
340
|
+
output: serializeCommandResult(error.result)
|
|
341
|
+
});
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
throw error;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
if (error instanceof Error &&
|
|
349
|
+
(/required and must be a non-empty string/.test(error.message) || /must be a positive integer/.test(error.message))) {
|
|
350
|
+
jsonError(res, 400, error.message);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
handleRouteError(res, error);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
app.get('/last-message', async (req, res) => {
|
|
357
|
+
try {
|
|
358
|
+
const sessionId = ensureNonEmptyString(req.query.id, 'id');
|
|
359
|
+
const count = parsePositiveIntegerQuery(req.query.n, 1, 'n');
|
|
360
|
+
const result = await executeCommand(['last-message', sessionId, '-n', String(count)]);
|
|
361
|
+
const trimmed = result.stdout.trim();
|
|
362
|
+
const blocks = trimmed.length > 0
|
|
363
|
+
? trimmed.split(/\n{2,}/).map((block) => block.trim()).filter((block) => block.length > 0)
|
|
364
|
+
: [];
|
|
365
|
+
res.json({
|
|
366
|
+
ok: true,
|
|
367
|
+
blocks,
|
|
368
|
+
output: serializeCommandResult(result)
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
if (error instanceof Error &&
|
|
373
|
+
(/required and must be a non-empty string/.test(error.message) || /must be a positive integer/.test(error.message))) {
|
|
374
|
+
jsonError(res, 400, error.message);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
handleRouteError(res, error);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
app.get('/health', (_req, res) => {
|
|
381
|
+
res.json({
|
|
382
|
+
status: 'healthy'
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
return app;
|
|
386
|
+
}
|
|
387
|
+
async function startGatewayServer(options = {}) {
|
|
388
|
+
const port = options.port ?? resolveGatewayPort();
|
|
389
|
+
const cliBinary = options.cliBinary ?? resolveGatewayCliBinary();
|
|
390
|
+
const executeCommand = options.executeCommand ?? createGatewayCommandExecutor(cliBinary);
|
|
391
|
+
const app = createGatewayApp(executeCommand);
|
|
392
|
+
const server = await new Promise((resolve, reject) => {
|
|
393
|
+
const startedServer = app.listen(port, () => {
|
|
394
|
+
resolve(startedServer);
|
|
395
|
+
});
|
|
396
|
+
startedServer.on('error', (error) => {
|
|
397
|
+
reject(error);
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
const address = server.address();
|
|
401
|
+
const listeningPort = typeof address === 'object' && address !== null ? address.port : port;
|
|
402
|
+
console.log(`[gateway] ${new Date().toISOString()} server started port=${listeningPort} cli=${cliBinary}`);
|
|
403
|
+
return {
|
|
404
|
+
app,
|
|
405
|
+
server,
|
|
406
|
+
port
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/gateway/server.ts"],"names":[],"mappings":";;;;;;AAqIA,gDAWC;AAED,0DAqBC;AAED,oEA6CC;AAED,4CAkQC;AAED,gDA6BC;AAzfD,2DAA8C;AAC9C,qCAAqC;AAErC,0DAA6B;AAC7B,yCAAsC;AACtC,sDAAqD;AAGrD,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,6BAAQ,CAAC,CAAC;AAC1C,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAElD,MAAM,YAAY,GAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,aAAa,GAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAiBlE,MAAa,mBAAoB,SAAQ,KAAK;IAG1B;IAFlB,YACE,OAAe,EACC,MAA4B;QAE5C,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,WAAM,GAAN,MAAM,CAAsB;QAG5C,IA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