pm-orchestrator-runner 1.0.6 → 1.0.8
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 +20 -10
- package/dist/cli/index.js +36 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +19 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/namespace.d.ts +86 -0
- package/dist/config/namespace.d.ts.map +1 -0
- package/dist/config/namespace.js +150 -0
- package/dist/config/namespace.js.map +1 -0
- package/dist/core/runner-core.d.ts +19 -0
- package/dist/core/runner-core.d.ts.map +1 -1
- package/dist/core/runner-core.js +67 -4
- package/dist/core/runner-core.js.map +1 -1
- package/dist/executor/claude-code-executor.d.ts +28 -0
- package/dist/executor/claude-code-executor.d.ts.map +1 -1
- package/dist/executor/claude-code-executor.js +184 -1
- package/dist/executor/claude-code-executor.js.map +1 -1
- package/dist/executor/deterministic-executor.d.ts +2 -1
- package/dist/executor/deterministic-executor.d.ts.map +1 -1
- package/dist/executor/deterministic-executor.js +7 -0
- package/dist/executor/deterministic-executor.js.map +1 -1
- package/dist/executor/recovery-executor.d.ts +2 -1
- package/dist/executor/recovery-executor.d.ts.map +1 -1
- package/dist/executor/recovery-executor.js +7 -0
- package/dist/executor/recovery-executor.js.map +1 -1
- package/dist/logging/task-log-manager.d.ts +17 -2
- package/dist/logging/task-log-manager.d.ts.map +1 -1
- package/dist/logging/task-log-manager.js +153 -63
- package/dist/logging/task-log-manager.js.map +1 -1
- package/dist/models/enums.d.ts +54 -0
- package/dist/models/enums.d.ts.map +1 -1
- package/dist/models/enums.js +59 -1
- package/dist/models/enums.js.map +1 -1
- package/dist/models/index.d.ts +4 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +50 -2
- package/dist/models/index.js.map +1 -1
- package/dist/models/repl/task-log.d.ts +9 -0
- package/dist/models/repl/task-log.d.ts.map +1 -1
- package/dist/models/repl/task-log.js.map +1 -1
- package/dist/models/run.d.ts +82 -0
- package/dist/models/run.d.ts.map +1 -0
- package/dist/models/run.js +161 -0
- package/dist/models/run.js.map +1 -0
- package/dist/models/task-group.d.ts +164 -0
- package/dist/models/task-group.d.ts.map +1 -0
- package/dist/models/task-group.js +246 -0
- package/dist/models/task-group.js.map +1 -0
- package/dist/models/task.d.ts +7 -0
- package/dist/models/task.d.ts.map +1 -1
- package/dist/models/task.js.map +1 -1
- package/dist/models/thread.d.ts +53 -0
- package/dist/models/thread.d.ts.map +1 -0
- package/dist/models/thread.js +92 -0
- package/dist/models/thread.js.map +1 -0
- package/dist/pool/agent-pool.d.ts.map +1 -1
- package/dist/pool/agent-pool.js +2 -3
- package/dist/pool/agent-pool.js.map +1 -1
- package/dist/prompt/index.d.ts +8 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +13 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/prompt-assembler.d.ts +145 -0
- package/dist/prompt/prompt-assembler.d.ts.map +1 -0
- package/dist/prompt/prompt-assembler.js +242 -0
- package/dist/prompt/prompt-assembler.js.map +1 -0
- package/dist/queue/index.d.ts +41 -0
- package/dist/queue/index.d.ts.map +1 -0
- package/dist/queue/index.js +42 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/queue-poller.d.ts +107 -0
- package/dist/queue/queue-poller.d.ts.map +1 -0
- package/dist/queue/queue-poller.js +181 -0
- package/dist/queue/queue-poller.js.map +1 -0
- package/dist/queue/queue-store.d.ts +163 -0
- package/dist/queue/queue-store.d.ts.map +1 -0
- package/dist/queue/queue-store.js +421 -0
- package/dist/queue/queue-store.js.map +1 -0
- package/dist/repl/commands/logs.d.ts +3 -1
- package/dist/repl/commands/logs.d.ts.map +1 -1
- package/dist/repl/commands/logs.js +23 -3
- package/dist/repl/commands/logs.js.map +1 -1
- package/dist/repl/index.d.ts +1 -0
- package/dist/repl/index.d.ts.map +1 -1
- package/dist/repl/index.js +3 -1
- package/dist/repl/index.js.map +1 -1
- package/dist/repl/repl-interface.d.ts +94 -6
- package/dist/repl/repl-interface.d.ts.map +1 -1
- package/dist/repl/repl-interface.js +350 -54
- package/dist/repl/repl-interface.js.map +1 -1
- package/dist/repl/two-pane-renderer.d.ts +148 -0
- package/dist/repl/two-pane-renderer.d.ts.map +1 -0
- package/dist/repl/two-pane-renderer.js +239 -0
- package/dist/repl/two-pane-renderer.js.map +1 -0
- package/dist/web/index.d.ts +45 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +47 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/server.d.ts +71 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +329 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +12 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Module
|
|
3
|
+
* Per spec/19_WEB_UI.md
|
|
4
|
+
*
|
|
5
|
+
* Exports:
|
|
6
|
+
* - WebServer: Express HTTP server
|
|
7
|
+
* - createApp: Express app factory
|
|
8
|
+
* - createNamespacedWebServer: Factory for namespace-separated WebServer
|
|
9
|
+
*/
|
|
10
|
+
export { WebServer, WebServerConfig, WebServerState, createApp, } from './server';
|
|
11
|
+
import { WebServer } from './server';
|
|
12
|
+
import { QueueStore } from '../queue';
|
|
13
|
+
/**
|
|
14
|
+
* Namespace configuration for WebServer
|
|
15
|
+
* Per spec/21_STABLE_DEV.md
|
|
16
|
+
*/
|
|
17
|
+
export interface NamespaceWebConfig {
|
|
18
|
+
/** Namespace name (e.g., 'stable', 'dev') */
|
|
19
|
+
namespace: string;
|
|
20
|
+
/** Port number derived from namespace */
|
|
21
|
+
port: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a WebServer instance with namespace separation
|
|
25
|
+
* Per spec/21_STABLE_DEV.md
|
|
26
|
+
*
|
|
27
|
+
* @param namespaceConfig - Namespace configuration with port
|
|
28
|
+
* @param queueStore - QueueStore instance to use
|
|
29
|
+
* @param sessionId - Session ID for new tasks
|
|
30
|
+
* @param host - Optional host (default: localhost)
|
|
31
|
+
* @returns Configured WebServer instance
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const namespaceConfig = buildNamespaceConfig({ namespace: 'dev', projectRoot: '/path' });
|
|
36
|
+
* const store = createNamespacedQueueStore({ ... });
|
|
37
|
+
* const server = createNamespacedWebServer(
|
|
38
|
+
* { namespace: namespaceConfig.namespace, port: namespaceConfig.port },
|
|
39
|
+
* store,
|
|
40
|
+
* 'session-123'
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function createNamespacedWebServer(namespaceConfig: NamespaceWebConfig, queueStore: QueueStore, sessionId: string, host?: string): WebServer;
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,SAAS,EACT,eAAe,EACf,cAAc,EACd,SAAS,GACV,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SAAS,EAAmB,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,kBAAkB,EACnC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,SAAS,CAOX"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Web Module
|
|
4
|
+
* Per spec/19_WEB_UI.md
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - WebServer: Express HTTP server
|
|
8
|
+
* - createApp: Express app factory
|
|
9
|
+
* - createNamespacedWebServer: Factory for namespace-separated WebServer
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createApp = exports.WebServer = void 0;
|
|
13
|
+
exports.createNamespacedWebServer = createNamespacedWebServer;
|
|
14
|
+
var server_1 = require("./server");
|
|
15
|
+
Object.defineProperty(exports, "WebServer", { enumerable: true, get: function () { return server_1.WebServer; } });
|
|
16
|
+
Object.defineProperty(exports, "createApp", { enumerable: true, get: function () { return server_1.createApp; } });
|
|
17
|
+
const server_2 = require("./server");
|
|
18
|
+
/**
|
|
19
|
+
* Create a WebServer instance with namespace separation
|
|
20
|
+
* Per spec/21_STABLE_DEV.md
|
|
21
|
+
*
|
|
22
|
+
* @param namespaceConfig - Namespace configuration with port
|
|
23
|
+
* @param queueStore - QueueStore instance to use
|
|
24
|
+
* @param sessionId - Session ID for new tasks
|
|
25
|
+
* @param host - Optional host (default: localhost)
|
|
26
|
+
* @returns Configured WebServer instance
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const namespaceConfig = buildNamespaceConfig({ namespace: 'dev', projectRoot: '/path' });
|
|
31
|
+
* const store = createNamespacedQueueStore({ ... });
|
|
32
|
+
* const server = createNamespacedWebServer(
|
|
33
|
+
* { namespace: namespaceConfig.namespace, port: namespaceConfig.port },
|
|
34
|
+
* store,
|
|
35
|
+
* 'session-123'
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function createNamespacedWebServer(namespaceConfig, queueStore, sessionId, host) {
|
|
40
|
+
return new server_2.WebServer({
|
|
41
|
+
port: namespaceConfig.port,
|
|
42
|
+
host,
|
|
43
|
+
queueStore,
|
|
44
|
+
sessionId,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA4CH,8DAYC;AAtDD,mCAKkB;AAJhB,mGAAA,SAAS,OAAA;AAGT,mGAAA,SAAS,OAAA;AAGX,qCAAsD;AActD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,yBAAyB,CACvC,eAAmC,EACnC,UAAsB,EACtB,SAAiB,EACjB,IAAa;IAEb,OAAO,IAAI,kBAAS,CAAC;QACnB,IAAI,EAAE,eAAe,CAAC,IAAI;QAC1B,IAAI;QACJ,UAAU;QACV,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Server - Express HTTP server
|
|
3
|
+
* Per spec/19_WEB_UI.md
|
|
4
|
+
*
|
|
5
|
+
* Provides:
|
|
6
|
+
* - REST API for queue operations (read/write to QueueStore)
|
|
7
|
+
* - Static file serving for frontend
|
|
8
|
+
* - Same process as Runner (integrated)
|
|
9
|
+
*
|
|
10
|
+
* IMPORTANT: Web UI does NOT directly command Runner.
|
|
11
|
+
* Submit = queue insert only.
|
|
12
|
+
*/
|
|
13
|
+
import { Express } from 'express';
|
|
14
|
+
import { QueueStore } from '../queue';
|
|
15
|
+
/**
|
|
16
|
+
* Web Server configuration
|
|
17
|
+
*/
|
|
18
|
+
export interface WebServerConfig {
|
|
19
|
+
/** Port number (default: 3000) */
|
|
20
|
+
port?: number;
|
|
21
|
+
/** Host (default: localhost) */
|
|
22
|
+
host?: string;
|
|
23
|
+
/** QueueStore instance */
|
|
24
|
+
queueStore: QueueStore;
|
|
25
|
+
/** Session ID for new tasks */
|
|
26
|
+
sessionId: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Web Server state
|
|
30
|
+
*/
|
|
31
|
+
export interface WebServerState {
|
|
32
|
+
isRunning: boolean;
|
|
33
|
+
port: number;
|
|
34
|
+
host: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create configured Express app
|
|
38
|
+
*/
|
|
39
|
+
export declare function createApp(config: WebServerConfig): Express;
|
|
40
|
+
/**
|
|
41
|
+
* Web Server
|
|
42
|
+
* Manages Express server lifecycle
|
|
43
|
+
*/
|
|
44
|
+
export declare class WebServer {
|
|
45
|
+
private readonly app;
|
|
46
|
+
private readonly port;
|
|
47
|
+
private readonly host;
|
|
48
|
+
private server;
|
|
49
|
+
constructor(config: WebServerConfig);
|
|
50
|
+
/**
|
|
51
|
+
* Start the server
|
|
52
|
+
*/
|
|
53
|
+
start(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Stop the server
|
|
56
|
+
*/
|
|
57
|
+
stop(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Get server state
|
|
60
|
+
*/
|
|
61
|
+
getState(): WebServerState;
|
|
62
|
+
/**
|
|
63
|
+
* Get Express app (for testing)
|
|
64
|
+
*/
|
|
65
|
+
getApp(): Express;
|
|
66
|
+
/**
|
|
67
|
+
* Get server URL
|
|
68
|
+
*/
|
|
69
|
+
getUrl(): string;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAgB,EAAE,OAAO,EAAmC,MAAM,SAAS,CAAC;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAUD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA8P1D;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,MAAM,CAA8C;gBAEhD,MAAM,EAAE,eAAe;IAMnC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB3B;;OAEG;IACH,QAAQ,IAAI,cAAc;IAQ1B;;OAEG;IACH,MAAM,IAAI,OAAO;IAIjB;;OAEG;IACH,MAAM,IAAI,MAAM;CAGjB"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Web Server - Express HTTP server
|
|
4
|
+
* Per spec/19_WEB_UI.md
|
|
5
|
+
*
|
|
6
|
+
* Provides:
|
|
7
|
+
* - REST API for queue operations (read/write to QueueStore)
|
|
8
|
+
* - Static file serving for frontend
|
|
9
|
+
* - Same process as Runner (integrated)
|
|
10
|
+
*
|
|
11
|
+
* IMPORTANT: Web UI does NOT directly command Runner.
|
|
12
|
+
* Submit = queue insert only.
|
|
13
|
+
*/
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.WebServer = void 0;
|
|
19
|
+
exports.createApp = createApp;
|
|
20
|
+
const express_1 = __importDefault(require("express"));
|
|
21
|
+
const path_1 = __importDefault(require("path"));
|
|
22
|
+
/**
|
|
23
|
+
* Create configured Express app
|
|
24
|
+
*/
|
|
25
|
+
function createApp(config) {
|
|
26
|
+
const app = (0, express_1.default)();
|
|
27
|
+
const { queueStore, sessionId } = config;
|
|
28
|
+
// Middleware
|
|
29
|
+
app.use(express_1.default.json());
|
|
30
|
+
app.use(express_1.default.urlencoded({ extended: true }));
|
|
31
|
+
// Static files
|
|
32
|
+
app.use(express_1.default.static(path_1.default.join(__dirname, 'public')));
|
|
33
|
+
// CORS headers for local development
|
|
34
|
+
app.use((_req, res, next) => {
|
|
35
|
+
res.header('Access-Control-Allow-Origin', '*');
|
|
36
|
+
res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
|
|
37
|
+
res.header('Access-Control-Allow-Headers', 'Content-Type');
|
|
38
|
+
next();
|
|
39
|
+
});
|
|
40
|
+
// ===================
|
|
41
|
+
// REST API Routes
|
|
42
|
+
// Per spec/19_WEB_UI.md
|
|
43
|
+
// ===================
|
|
44
|
+
/**
|
|
45
|
+
* GET /api/task-groups
|
|
46
|
+
* List all task groups with summary
|
|
47
|
+
*/
|
|
48
|
+
app.get('/api/task-groups', async (_req, res) => {
|
|
49
|
+
try {
|
|
50
|
+
const groups = await queueStore.getAllTaskGroups();
|
|
51
|
+
res.json({ task_groups: groups });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
55
|
+
res.status(500).json({ error: 'INTERNAL_ERROR', message });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* POST /api/task-groups
|
|
60
|
+
* Create a new task group (enqueue first task)
|
|
61
|
+
* Body: { task_group_id: string, prompt: string }
|
|
62
|
+
*/
|
|
63
|
+
app.post('/api/task-groups', async (req, res) => {
|
|
64
|
+
try {
|
|
65
|
+
const { task_group_id, prompt } = req.body;
|
|
66
|
+
// Fail-closed: validate input
|
|
67
|
+
if (!task_group_id || typeof task_group_id !== 'string' || task_group_id.trim() === '') {
|
|
68
|
+
res.status(400).json({
|
|
69
|
+
error: 'INVALID_INPUT',
|
|
70
|
+
message: 'task_group_id is required and must be a non-empty string',
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!prompt || typeof prompt !== 'string' || prompt.trim() === '') {
|
|
75
|
+
res.status(400).json({
|
|
76
|
+
error: 'INVALID_INPUT',
|
|
77
|
+
message: 'prompt is required and must be a non-empty string',
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// Enqueue the first task in this group
|
|
82
|
+
const item = await queueStore.enqueue(sessionId, task_group_id.trim(), prompt.trim());
|
|
83
|
+
res.status(201).json({
|
|
84
|
+
task_id: item.task_id,
|
|
85
|
+
task_group_id: item.task_group_id,
|
|
86
|
+
status: item.status,
|
|
87
|
+
created_at: item.created_at,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
92
|
+
res.status(500).json({ error: 'INTERNAL_ERROR', message });
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* GET /api/task-groups/:task_group_id/tasks
|
|
97
|
+
* List tasks in a task group
|
|
98
|
+
*/
|
|
99
|
+
app.get('/api/task-groups/:task_group_id/tasks', async (req, res) => {
|
|
100
|
+
try {
|
|
101
|
+
const task_group_id = req.params.task_group_id;
|
|
102
|
+
const tasks = await queueStore.getByTaskGroup(task_group_id);
|
|
103
|
+
res.json({
|
|
104
|
+
task_group_id,
|
|
105
|
+
tasks: tasks.map(t => ({
|
|
106
|
+
task_id: t.task_id,
|
|
107
|
+
status: t.status,
|
|
108
|
+
prompt: t.prompt,
|
|
109
|
+
created_at: t.created_at,
|
|
110
|
+
updated_at: t.updated_at,
|
|
111
|
+
error_message: t.error_message,
|
|
112
|
+
})),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
117
|
+
res.status(500).json({ error: 'INTERNAL_ERROR', message });
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* GET /api/tasks/:task_id
|
|
122
|
+
* Get task detail
|
|
123
|
+
*/
|
|
124
|
+
app.get('/api/tasks/:task_id', async (req, res) => {
|
|
125
|
+
try {
|
|
126
|
+
const task_id = req.params.task_id;
|
|
127
|
+
const task = await queueStore.getItem(task_id);
|
|
128
|
+
if (!task) {
|
|
129
|
+
res.status(404).json({
|
|
130
|
+
error: 'NOT_FOUND',
|
|
131
|
+
message: `Task not found: ${task_id}`,
|
|
132
|
+
});
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
res.json({
|
|
136
|
+
task_id: task.task_id,
|
|
137
|
+
task_group_id: task.task_group_id,
|
|
138
|
+
session_id: task.session_id,
|
|
139
|
+
status: task.status,
|
|
140
|
+
prompt: task.prompt,
|
|
141
|
+
created_at: task.created_at,
|
|
142
|
+
updated_at: task.updated_at,
|
|
143
|
+
error_message: task.error_message,
|
|
144
|
+
// TODO: Add logs and changed_files when available
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
149
|
+
res.status(500).json({ error: 'INTERNAL_ERROR', message });
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
/**
|
|
153
|
+
* POST /api/tasks
|
|
154
|
+
* Enqueue a new task (does NOT run it directly)
|
|
155
|
+
* Body: { task_group_id: string, prompt: string }
|
|
156
|
+
*
|
|
157
|
+
* IMPORTANT: This only inserts into queue. Runner polls separately.
|
|
158
|
+
*/
|
|
159
|
+
app.post('/api/tasks', async (req, res) => {
|
|
160
|
+
try {
|
|
161
|
+
const { task_group_id, prompt } = req.body;
|
|
162
|
+
// Fail-closed: validate input
|
|
163
|
+
if (!task_group_id || typeof task_group_id !== 'string' || task_group_id.trim() === '') {
|
|
164
|
+
res.status(400).json({
|
|
165
|
+
error: 'INVALID_INPUT',
|
|
166
|
+
message: 'task_group_id is required and must be a non-empty string',
|
|
167
|
+
});
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (!prompt || typeof prompt !== 'string' || prompt.trim() === '') {
|
|
171
|
+
res.status(400).json({
|
|
172
|
+
error: 'INVALID_INPUT',
|
|
173
|
+
message: 'prompt is required and must be a non-empty string',
|
|
174
|
+
});
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
// Enqueue only - does NOT run directly
|
|
178
|
+
const item = await queueStore.enqueue(sessionId, task_group_id.trim(), prompt.trim());
|
|
179
|
+
res.status(201).json({
|
|
180
|
+
task_id: item.task_id,
|
|
181
|
+
task_group_id: item.task_group_id,
|
|
182
|
+
status: item.status, // Always QUEUED
|
|
183
|
+
created_at: item.created_at,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
188
|
+
res.status(500).json({ error: 'INTERNAL_ERROR', message });
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
// ===================
|
|
192
|
+
// Frontend Routes
|
|
193
|
+
// ===================
|
|
194
|
+
/**
|
|
195
|
+
* GET /
|
|
196
|
+
* Serve main page (task group list)
|
|
197
|
+
*/
|
|
198
|
+
app.get('/', (_req, res) => {
|
|
199
|
+
res.sendFile(path_1.default.join(__dirname, 'public', 'index.html'));
|
|
200
|
+
});
|
|
201
|
+
/**
|
|
202
|
+
* GET /task-groups/:id
|
|
203
|
+
* Serve task list page
|
|
204
|
+
*/
|
|
205
|
+
app.get('/task-groups/:id', (_req, res) => {
|
|
206
|
+
res.sendFile(path_1.default.join(__dirname, 'public', 'index.html'));
|
|
207
|
+
});
|
|
208
|
+
/**
|
|
209
|
+
* GET /tasks/:id
|
|
210
|
+
* Serve task detail page
|
|
211
|
+
*/
|
|
212
|
+
app.get('/tasks/:id', (_req, res) => {
|
|
213
|
+
res.sendFile(path_1.default.join(__dirname, 'public', 'index.html'));
|
|
214
|
+
});
|
|
215
|
+
/**
|
|
216
|
+
* GET /new
|
|
217
|
+
* Serve new command form
|
|
218
|
+
*/
|
|
219
|
+
app.get('/new', (_req, res) => {
|
|
220
|
+
res.sendFile(path_1.default.join(__dirname, 'public', 'index.html'));
|
|
221
|
+
});
|
|
222
|
+
// ===================
|
|
223
|
+
// Health Check
|
|
224
|
+
// ===================
|
|
225
|
+
/**
|
|
226
|
+
* GET /api/health
|
|
227
|
+
* Health check endpoint
|
|
228
|
+
*/
|
|
229
|
+
app.get('/api/health', (_req, res) => {
|
|
230
|
+
res.json({ status: 'ok', timestamp: new Date().toISOString() });
|
|
231
|
+
});
|
|
232
|
+
// ===================
|
|
233
|
+
// Route List (for testing - verify no direct Runner command API)
|
|
234
|
+
// ===================
|
|
235
|
+
/**
|
|
236
|
+
* GET /api/routes
|
|
237
|
+
* List all registered routes (for testing)
|
|
238
|
+
*/
|
|
239
|
+
app.get('/api/routes', (_req, res) => {
|
|
240
|
+
// Return a predefined list of routes for safety and testability
|
|
241
|
+
// This also serves as documentation of available endpoints
|
|
242
|
+
const routes = [
|
|
243
|
+
'GET /api/task-groups',
|
|
244
|
+
'POST /api/task-groups',
|
|
245
|
+
'GET /api/task-groups/:task_group_id/tasks',
|
|
246
|
+
'GET /api/tasks/:task_id',
|
|
247
|
+
'POST /api/tasks',
|
|
248
|
+
'GET /api/health',
|
|
249
|
+
'GET /api/routes',
|
|
250
|
+
];
|
|
251
|
+
res.json({ routes });
|
|
252
|
+
});
|
|
253
|
+
return app;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Web Server
|
|
257
|
+
* Manages Express server lifecycle
|
|
258
|
+
*/
|
|
259
|
+
class WebServer {
|
|
260
|
+
app;
|
|
261
|
+
port;
|
|
262
|
+
host;
|
|
263
|
+
server = null;
|
|
264
|
+
constructor(config) {
|
|
265
|
+
this.port = config.port || 3000;
|
|
266
|
+
this.host = config.host || 'localhost';
|
|
267
|
+
this.app = createApp(config);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Start the server
|
|
271
|
+
*/
|
|
272
|
+
async start() {
|
|
273
|
+
return new Promise((resolve, reject) => {
|
|
274
|
+
try {
|
|
275
|
+
this.server = this.app.listen(this.port, this.host, () => {
|
|
276
|
+
resolve();
|
|
277
|
+
});
|
|
278
|
+
this.server.on('error', reject);
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
reject(error);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Stop the server
|
|
287
|
+
*/
|
|
288
|
+
async stop() {
|
|
289
|
+
return new Promise((resolve, reject) => {
|
|
290
|
+
if (!this.server) {
|
|
291
|
+
resolve();
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this.server.close((err) => {
|
|
295
|
+
if (err) {
|
|
296
|
+
reject(err);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
this.server = null;
|
|
300
|
+
resolve();
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Get server state
|
|
307
|
+
*/
|
|
308
|
+
getState() {
|
|
309
|
+
return {
|
|
310
|
+
isRunning: this.server !== null,
|
|
311
|
+
port: this.port,
|
|
312
|
+
host: this.host,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Get Express app (for testing)
|
|
317
|
+
*/
|
|
318
|
+
getApp() {
|
|
319
|
+
return this.app;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get server URL
|
|
323
|
+
*/
|
|
324
|
+
getUrl() {
|
|
325
|
+
return `http://${this.host}:${this.port}`;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
exports.WebServer = WebServer;
|
|
329
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;AAwCH,8BA8PC;AApSD,sDAA4E;AAC5E,gDAAwB;AAkCxB;;GAEG;AACH,SAAgB,SAAS,CAAC,MAAuB;IAC/C,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IACtB,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAEzC,aAAa;IACb,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACxB,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEhD,eAAe;IACf,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,MAAM,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAExD,qCAAqC;IACrC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;QAC3D,GAAG,CAAC,MAAM,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAC/C,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;QACjE,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,cAAc,CAAC,CAAC;QAC3D,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,sBAAsB;IACtB,kBAAkB;IAClB,wBAAwB;IACxB,sBAAsB;IAEtB;;;OAGG;IACH,GAAG,CAAC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AC;IAClB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,UAAU,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5C,CAAC;CACF;AAxED,8BAwEC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pm-orchestrator-runner",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "CLI tool that enforces controlled execution of Claude Code through mandatory orchestration",
|
|
5
5
|
"main": "dist/cli/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"pm": "dist/cli/index.js"
|
|
7
|
+
"pm-orchestrator": "dist/cli/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"test:unit": "mocha --require ts-node/register 'test/unit/**/*.test.ts'",
|
|
18
18
|
"test:property": "mocha --require ts-node/register 'test/property/**/*.test.ts'",
|
|
19
19
|
"test:integration": "mocha --require ts-node/register 'test/integration/**/*.test.ts'",
|
|
20
|
+
"test:acceptance": "mocha --require ts-node/register 'test/acceptance/**/*.test.ts'",
|
|
20
21
|
"coverage": "nyc npm test",
|
|
21
22
|
"lint": "eslint src/**/*.ts test/**/*.ts",
|
|
22
23
|
"typecheck": "tsc --noEmit",
|
|
@@ -24,7 +25,9 @@
|
|
|
24
25
|
"llm:test:real": "LLM_TEST_MODE=1 mocha --require ts-node/register 'test/integration/real-llm-mediation.test.ts' 'test/integration/verdict-gate-open.test.ts'",
|
|
25
26
|
"llm:test:verdict": "mocha --require ts-node/register 'test/unit/mediation/verdict-reporter.test.ts'",
|
|
26
27
|
"e2e:smoke": "ts-node scripts/e2e-smoke.ts",
|
|
27
|
-
"e2e:recovery": "ts-node scripts/e2e-recovery.ts"
|
|
28
|
+
"e2e:recovery": "ts-node scripts/e2e-recovery.ts",
|
|
29
|
+
"proof:real": "ts-node scripts/e2e-real-world-proof.ts",
|
|
30
|
+
"dynamodb:local:init": "ts-node scripts/dynamodb-local-init.ts"
|
|
28
31
|
},
|
|
29
32
|
"keywords": [
|
|
30
33
|
"pm-orchestrator",
|
|
@@ -35,9 +38,11 @@
|
|
|
35
38
|
"license": "MIT",
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@types/chai": "^5.2.3",
|
|
41
|
+
"@types/express": "^5.0.6",
|
|
38
42
|
"@types/minimatch": "^5.1.2",
|
|
39
43
|
"@types/mocha": "^10.0.6",
|
|
40
44
|
"@types/node": "^20.10.0",
|
|
45
|
+
"@types/supertest": "^6.0.3",
|
|
41
46
|
"@types/uuid": "^10.0.0",
|
|
42
47
|
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
43
48
|
"@typescript-eslint/parser": "^8.52.0",
|
|
@@ -46,11 +51,15 @@
|
|
|
46
51
|
"fast-check": "^3.15.0",
|
|
47
52
|
"mocha": "^10.2.0",
|
|
48
53
|
"nyc": "^15.1.0",
|
|
54
|
+
"supertest": "^7.2.2",
|
|
49
55
|
"ts-node": "^10.9.2",
|
|
50
56
|
"typescript": "^5.3.2"
|
|
51
57
|
},
|
|
52
58
|
"dependencies": {
|
|
59
|
+
"@aws-sdk/client-dynamodb": "^3.971.0",
|
|
60
|
+
"@aws-sdk/lib-dynamodb": "^3.971.0",
|
|
53
61
|
"commander": "^12.0.0",
|
|
62
|
+
"express": "^5.2.1",
|
|
54
63
|
"minimatch": "^9.0.0",
|
|
55
64
|
"uuid": "^10.0.0",
|
|
56
65
|
"yaml": "^2.8.2"
|