pm-orchestrator-runner 1.0.7 → 1.0.9
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 +59 -6
- package/dist/cli/index.d.ts +7 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +191 -49
- 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 +2 -0
- package/dist/core/runner-core.d.ts.map +1 -1
- package/dist/core/runner-core.js +27 -1
- 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/executor/stepwise-mock-executor.d.ts +76 -0
- package/dist/executor/stepwise-mock-executor.d.ts.map +1 -0
- package/dist/executor/stepwise-mock-executor.js +369 -0
- package/dist/executor/stepwise-mock-executor.js.map +1 -0
- 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/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/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 +40 -5
- package/dist/repl/repl-interface.d.ts.map +1 -1
- package/dist/repl/repl-interface.js +95 -17
- package/dist/repl/repl-interface.js.map +1 -1
- package/dist/repl/two-pane-renderer.d.ts +160 -0
- package/dist/repl/two-pane-renderer.d.ts.map +1 -0
- package/dist/repl/two-pane-renderer.js +276 -0
- package/dist/repl/two-pane-renderer.js.map +1 -0
- package/dist/trace/trace-pack.d.ts +182 -0
- package/dist/trace/trace-pack.d.ts.map +1 -0
- package/dist/trace/trace-pack.js +407 -0
- package/dist/trace/trace-pack.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 +10 -2
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue Store - DynamoDB Local implementation
|
|
3
|
+
* Per spec/20_QUEUE_STORE.md
|
|
4
|
+
*
|
|
5
|
+
* Provides queue operations with:
|
|
6
|
+
* - Atomic QUEUED -> RUNNING transitions (conditional update)
|
|
7
|
+
* - Double execution prevention
|
|
8
|
+
* - Fail-closed error handling
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Queue Item status
|
|
12
|
+
* Per spec/20: QUEUED / RUNNING / COMPLETE / ERROR
|
|
13
|
+
*/
|
|
14
|
+
export type QueueItemStatus = 'QUEUED' | 'RUNNING' | 'COMPLETE' | 'ERROR';
|
|
15
|
+
/**
|
|
16
|
+
* Queue Item schema
|
|
17
|
+
* Per spec/20_QUEUE_STORE.md
|
|
18
|
+
*/
|
|
19
|
+
export interface QueueItem {
|
|
20
|
+
task_id: string;
|
|
21
|
+
task_group_id: string;
|
|
22
|
+
session_id: string;
|
|
23
|
+
status: QueueItemStatus;
|
|
24
|
+
prompt: string;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
error_message?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Queue Store configuration
|
|
31
|
+
*/
|
|
32
|
+
export interface QueueStoreConfig {
|
|
33
|
+
/** DynamoDB endpoint (default: http://localhost:8000) */
|
|
34
|
+
endpoint?: string;
|
|
35
|
+
/** Table name (default: pm-runner-queue) */
|
|
36
|
+
tableName?: string;
|
|
37
|
+
/** AWS region (default: local) */
|
|
38
|
+
region?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Claim result
|
|
42
|
+
*/
|
|
43
|
+
export interface ClaimResult {
|
|
44
|
+
success: boolean;
|
|
45
|
+
item?: QueueItem;
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Task Group summary for listing
|
|
50
|
+
* Per spec/19_WEB_UI.md: task group list view
|
|
51
|
+
*/
|
|
52
|
+
export interface TaskGroupSummary {
|
|
53
|
+
task_group_id: string;
|
|
54
|
+
task_count: number;
|
|
55
|
+
created_at: string;
|
|
56
|
+
latest_updated_at: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Queue Store
|
|
60
|
+
* Manages task queue with DynamoDB Local
|
|
61
|
+
*/
|
|
62
|
+
export declare class QueueStore {
|
|
63
|
+
private readonly client;
|
|
64
|
+
private readonly docClient;
|
|
65
|
+
private readonly tableName;
|
|
66
|
+
private readonly endpoint;
|
|
67
|
+
constructor(config?: QueueStoreConfig);
|
|
68
|
+
/**
|
|
69
|
+
* Get table name
|
|
70
|
+
*/
|
|
71
|
+
getTableName(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Get endpoint
|
|
74
|
+
*/
|
|
75
|
+
getEndpoint(): string;
|
|
76
|
+
/**
|
|
77
|
+
* Check if table exists
|
|
78
|
+
*/
|
|
79
|
+
tableExists(): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Create table with required GSIs
|
|
82
|
+
* Per spec/20_QUEUE_STORE.md table definition
|
|
83
|
+
*/
|
|
84
|
+
createTable(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Ensure table exists, create if not
|
|
87
|
+
*/
|
|
88
|
+
ensureTable(): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Wait for table to become active
|
|
91
|
+
*/
|
|
92
|
+
private waitForTableActive;
|
|
93
|
+
/**
|
|
94
|
+
* Enqueue a new task
|
|
95
|
+
* Creates item with status=QUEUED
|
|
96
|
+
*
|
|
97
|
+
* @param sessionId - Session ID
|
|
98
|
+
* @param taskGroupId - Task Group ID
|
|
99
|
+
* @param prompt - User prompt
|
|
100
|
+
* @param taskId - Optional task ID (generates if not provided)
|
|
101
|
+
* @returns Created queue item
|
|
102
|
+
*/
|
|
103
|
+
enqueue(sessionId: string, taskGroupId: string, prompt: string, taskId?: string): Promise<QueueItem>;
|
|
104
|
+
/**
|
|
105
|
+
* Get item by task_id
|
|
106
|
+
*/
|
|
107
|
+
getItem(taskId: string): Promise<QueueItem | null>;
|
|
108
|
+
/**
|
|
109
|
+
* Claim the oldest QUEUED task (atomic QUEUED -> RUNNING)
|
|
110
|
+
* Per spec: Uses conditional update for double execution prevention
|
|
111
|
+
*
|
|
112
|
+
* @returns ClaimResult with success flag and item if claimed
|
|
113
|
+
*/
|
|
114
|
+
claim(): Promise<ClaimResult>;
|
|
115
|
+
/**
|
|
116
|
+
* Update task status
|
|
117
|
+
* Per spec: RUNNING -> COMPLETE or RUNNING -> ERROR
|
|
118
|
+
*
|
|
119
|
+
* @param taskId - Task ID
|
|
120
|
+
* @param status - New status
|
|
121
|
+
* @param errorMessage - Optional error message (for ERROR status)
|
|
122
|
+
*/
|
|
123
|
+
updateStatus(taskId: string, status: QueueItemStatus, errorMessage?: string): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Get items by session ID
|
|
126
|
+
* Uses session-index GSI
|
|
127
|
+
*/
|
|
128
|
+
getBySession(sessionId: string): Promise<QueueItem[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Get items by status
|
|
131
|
+
* Uses status-index GSI
|
|
132
|
+
*/
|
|
133
|
+
getByStatus(status: QueueItemStatus): Promise<QueueItem[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Get items by task group ID
|
|
136
|
+
* Uses task-group-index GSI
|
|
137
|
+
* Per spec/19_WEB_UI.md: for listing tasks in a task group
|
|
138
|
+
*/
|
|
139
|
+
getByTaskGroup(taskGroupId: string): Promise<QueueItem[]>;
|
|
140
|
+
/**
|
|
141
|
+
* Get all distinct task groups with summary
|
|
142
|
+
* Per spec/19_WEB_UI.md: for task group list view
|
|
143
|
+
* Note: Uses Scan - consider pagination for large datasets
|
|
144
|
+
*/
|
|
145
|
+
getAllTaskGroups(): Promise<TaskGroupSummary[]>;
|
|
146
|
+
/**
|
|
147
|
+
* Delete item (for testing)
|
|
148
|
+
*/
|
|
149
|
+
deleteItem(taskId: string): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Mark stale RUNNING tasks as ERROR
|
|
152
|
+
* Per spec: fail-closed - don't leave tasks in "limbo"
|
|
153
|
+
*
|
|
154
|
+
* @param maxAgeMs - Max age in milliseconds for RUNNING tasks
|
|
155
|
+
* @returns Number of tasks marked as ERROR
|
|
156
|
+
*/
|
|
157
|
+
recoverStaleTasks(maxAgeMs?: number): Promise<number>;
|
|
158
|
+
/**
|
|
159
|
+
* Close the client connection
|
|
160
|
+
*/
|
|
161
|
+
destroy(): void;
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=queue-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-store.d.ts","sourceRoot":"","sources":["../../src/queue/queue-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,M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AS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAAC;IAsBrB;;OAEG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAWxD;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAgEnC;;;;;;;OAOG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,eAAe,EACvB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IA6BhB;;;OAGG;IACG,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAgB3D;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAmBhE;;;;OAIG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAgB/D;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAiDrD;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/C;;;;;;OAMG;IACG,iBAAiB,CAAC,QAAQ,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAoB1E;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Queue Store - DynamoDB Local implementation
|
|
4
|
+
* Per spec/20_QUEUE_STORE.md
|
|
5
|
+
*
|
|
6
|
+
* Provides queue operations with:
|
|
7
|
+
* - Atomic QUEUED -> RUNNING transitions (conditional update)
|
|
8
|
+
* - Double execution prevention
|
|
9
|
+
* - Fail-closed error handling
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.QueueStore = void 0;
|
|
13
|
+
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
14
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
16
|
+
/**
|
|
17
|
+
* Queue Store
|
|
18
|
+
* Manages task queue with DynamoDB Local
|
|
19
|
+
*/
|
|
20
|
+
class QueueStore {
|
|
21
|
+
client;
|
|
22
|
+
docClient;
|
|
23
|
+
tableName;
|
|
24
|
+
endpoint;
|
|
25
|
+
constructor(config = {}) {
|
|
26
|
+
this.endpoint = config.endpoint || 'http://localhost:8000';
|
|
27
|
+
this.tableName = config.tableName || 'pm-runner-queue';
|
|
28
|
+
const region = config.region || 'local';
|
|
29
|
+
this.client = new client_dynamodb_1.DynamoDBClient({
|
|
30
|
+
endpoint: this.endpoint,
|
|
31
|
+
region: region,
|
|
32
|
+
credentials: {
|
|
33
|
+
accessKeyId: 'local',
|
|
34
|
+
secretAccessKey: 'local',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
this.docClient = lib_dynamodb_1.DynamoDBDocumentClient.from(this.client, {
|
|
38
|
+
marshallOptions: {
|
|
39
|
+
removeUndefinedValues: true,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get table name
|
|
45
|
+
*/
|
|
46
|
+
getTableName() {
|
|
47
|
+
return this.tableName;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get endpoint
|
|
51
|
+
*/
|
|
52
|
+
getEndpoint() {
|
|
53
|
+
return this.endpoint;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if table exists
|
|
57
|
+
*/
|
|
58
|
+
async tableExists() {
|
|
59
|
+
try {
|
|
60
|
+
await this.client.send(new client_dynamodb_1.DescribeTableCommand({ TableName: this.tableName }));
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (error instanceof client_dynamodb_1.ResourceNotFoundException) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Create table with required GSIs
|
|
72
|
+
* Per spec/20_QUEUE_STORE.md table definition
|
|
73
|
+
*/
|
|
74
|
+
async createTable() {
|
|
75
|
+
const command = new client_dynamodb_1.CreateTableCommand({
|
|
76
|
+
TableName: this.tableName,
|
|
77
|
+
KeySchema: [{ AttributeName: 'task_id', KeyType: 'HASH' }],
|
|
78
|
+
AttributeDefinitions: [
|
|
79
|
+
{ AttributeName: 'task_id', AttributeType: 'S' },
|
|
80
|
+
{ AttributeName: 'session_id', AttributeType: 'S' },
|
|
81
|
+
{ AttributeName: 'status', AttributeType: 'S' },
|
|
82
|
+
{ AttributeName: 'created_at', AttributeType: 'S' },
|
|
83
|
+
{ AttributeName: 'task_group_id', AttributeType: 'S' },
|
|
84
|
+
],
|
|
85
|
+
GlobalSecondaryIndexes: [
|
|
86
|
+
{
|
|
87
|
+
IndexName: 'session-index',
|
|
88
|
+
KeySchema: [
|
|
89
|
+
{ AttributeName: 'session_id', KeyType: 'HASH' },
|
|
90
|
+
{ AttributeName: 'created_at', KeyType: 'RANGE' },
|
|
91
|
+
],
|
|
92
|
+
Projection: { ProjectionType: 'ALL' },
|
|
93
|
+
ProvisionedThroughput: {
|
|
94
|
+
ReadCapacityUnits: 5,
|
|
95
|
+
WriteCapacityUnits: 5,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
IndexName: 'status-index',
|
|
100
|
+
KeySchema: [
|
|
101
|
+
{ AttributeName: 'status', KeyType: 'HASH' },
|
|
102
|
+
{ AttributeName: 'created_at', KeyType: 'RANGE' },
|
|
103
|
+
],
|
|
104
|
+
Projection: { ProjectionType: 'ALL' },
|
|
105
|
+
ProvisionedThroughput: {
|
|
106
|
+
ReadCapacityUnits: 5,
|
|
107
|
+
WriteCapacityUnits: 5,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
IndexName: 'task-group-index',
|
|
112
|
+
KeySchema: [
|
|
113
|
+
{ AttributeName: 'task_group_id', KeyType: 'HASH' },
|
|
114
|
+
{ AttributeName: 'created_at', KeyType: 'RANGE' },
|
|
115
|
+
],
|
|
116
|
+
Projection: { ProjectionType: 'ALL' },
|
|
117
|
+
ProvisionedThroughput: {
|
|
118
|
+
ReadCapacityUnits: 5,
|
|
119
|
+
WriteCapacityUnits: 5,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
ProvisionedThroughput: {
|
|
124
|
+
ReadCapacityUnits: 5,
|
|
125
|
+
WriteCapacityUnits: 5,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
await this.client.send(command);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Ensure table exists, create if not
|
|
132
|
+
*/
|
|
133
|
+
async ensureTable() {
|
|
134
|
+
const exists = await this.tableExists();
|
|
135
|
+
if (!exists) {
|
|
136
|
+
await this.createTable();
|
|
137
|
+
// Wait for table to be active
|
|
138
|
+
await this.waitForTableActive();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Wait for table to become active
|
|
143
|
+
*/
|
|
144
|
+
async waitForTableActive(maxWaitMs = 30000) {
|
|
145
|
+
const startTime = Date.now();
|
|
146
|
+
while (Date.now() - startTime < maxWaitMs) {
|
|
147
|
+
try {
|
|
148
|
+
const result = await this.client.send(new client_dynamodb_1.DescribeTableCommand({ TableName: this.tableName }));
|
|
149
|
+
if (result.Table?.TableStatus === 'ACTIVE') {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// Table not ready yet
|
|
155
|
+
}
|
|
156
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
157
|
+
}
|
|
158
|
+
throw new Error(`Table ${this.tableName} did not become active within ${maxWaitMs}ms`);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Enqueue a new task
|
|
162
|
+
* Creates item with status=QUEUED
|
|
163
|
+
*
|
|
164
|
+
* @param sessionId - Session ID
|
|
165
|
+
* @param taskGroupId - Task Group ID
|
|
166
|
+
* @param prompt - User prompt
|
|
167
|
+
* @param taskId - Optional task ID (generates if not provided)
|
|
168
|
+
* @returns Created queue item
|
|
169
|
+
*/
|
|
170
|
+
async enqueue(sessionId, taskGroupId, prompt, taskId) {
|
|
171
|
+
const now = new Date().toISOString();
|
|
172
|
+
const item = {
|
|
173
|
+
task_id: taskId || (0, uuid_1.v4)(),
|
|
174
|
+
task_group_id: taskGroupId,
|
|
175
|
+
session_id: sessionId,
|
|
176
|
+
status: 'QUEUED',
|
|
177
|
+
prompt,
|
|
178
|
+
created_at: now,
|
|
179
|
+
updated_at: now,
|
|
180
|
+
};
|
|
181
|
+
await this.docClient.send(new lib_dynamodb_1.PutCommand({
|
|
182
|
+
TableName: this.tableName,
|
|
183
|
+
Item: item,
|
|
184
|
+
}));
|
|
185
|
+
return item;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get item by task_id
|
|
189
|
+
*/
|
|
190
|
+
async getItem(taskId) {
|
|
191
|
+
const result = await this.docClient.send(new lib_dynamodb_1.GetCommand({
|
|
192
|
+
TableName: this.tableName,
|
|
193
|
+
Key: { task_id: taskId },
|
|
194
|
+
}));
|
|
195
|
+
return result.Item || null;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Claim the oldest QUEUED task (atomic QUEUED -> RUNNING)
|
|
199
|
+
* Per spec: Uses conditional update for double execution prevention
|
|
200
|
+
*
|
|
201
|
+
* @returns ClaimResult with success flag and item if claimed
|
|
202
|
+
*/
|
|
203
|
+
async claim() {
|
|
204
|
+
// Query for oldest QUEUED item using status-index
|
|
205
|
+
const queryResult = await this.docClient.send(new lib_dynamodb_1.QueryCommand({
|
|
206
|
+
TableName: this.tableName,
|
|
207
|
+
IndexName: 'status-index',
|
|
208
|
+
KeyConditionExpression: '#status = :queued',
|
|
209
|
+
ExpressionAttributeNames: {
|
|
210
|
+
'#status': 'status',
|
|
211
|
+
},
|
|
212
|
+
ExpressionAttributeValues: {
|
|
213
|
+
':queued': 'QUEUED',
|
|
214
|
+
},
|
|
215
|
+
Limit: 1,
|
|
216
|
+
ScanIndexForward: true, // Ascending by created_at (oldest first)
|
|
217
|
+
}));
|
|
218
|
+
if (!queryResult.Items || queryResult.Items.length === 0) {
|
|
219
|
+
return { success: false };
|
|
220
|
+
}
|
|
221
|
+
const item = queryResult.Items[0];
|
|
222
|
+
// Atomic update: QUEUED -> RUNNING with conditional check
|
|
223
|
+
try {
|
|
224
|
+
const now = new Date().toISOString();
|
|
225
|
+
await this.docClient.send(new lib_dynamodb_1.UpdateCommand({
|
|
226
|
+
TableName: this.tableName,
|
|
227
|
+
Key: { task_id: item.task_id },
|
|
228
|
+
UpdateExpression: 'SET #status = :running, updated_at = :now',
|
|
229
|
+
ConditionExpression: '#status = :queued',
|
|
230
|
+
ExpressionAttributeNames: {
|
|
231
|
+
'#status': 'status',
|
|
232
|
+
},
|
|
233
|
+
ExpressionAttributeValues: {
|
|
234
|
+
':running': 'RUNNING',
|
|
235
|
+
':queued': 'QUEUED',
|
|
236
|
+
':now': now,
|
|
237
|
+
},
|
|
238
|
+
}));
|
|
239
|
+
// Update local item with new status
|
|
240
|
+
item.status = 'RUNNING';
|
|
241
|
+
item.updated_at = now;
|
|
242
|
+
return { success: true, item };
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
// ConditionalCheckFailed means another process claimed it
|
|
246
|
+
if (error &&
|
|
247
|
+
typeof error === 'object' &&
|
|
248
|
+
'name' in error &&
|
|
249
|
+
error.name === 'ConditionalCheckFailedException') {
|
|
250
|
+
return { success: false, error: 'Task already claimed by another process' };
|
|
251
|
+
}
|
|
252
|
+
// Fail-closed: re-throw unexpected errors
|
|
253
|
+
throw error;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Update task status
|
|
258
|
+
* Per spec: RUNNING -> COMPLETE or RUNNING -> ERROR
|
|
259
|
+
*
|
|
260
|
+
* @param taskId - Task ID
|
|
261
|
+
* @param status - New status
|
|
262
|
+
* @param errorMessage - Optional error message (for ERROR status)
|
|
263
|
+
*/
|
|
264
|
+
async updateStatus(taskId, status, errorMessage) {
|
|
265
|
+
const now = new Date().toISOString();
|
|
266
|
+
const updateExpression = errorMessage
|
|
267
|
+
? 'SET #status = :status, updated_at = :now, error_message = :error'
|
|
268
|
+
: 'SET #status = :status, updated_at = :now';
|
|
269
|
+
const expressionAttributeValues = {
|
|
270
|
+
':status': status,
|
|
271
|
+
':now': now,
|
|
272
|
+
};
|
|
273
|
+
if (errorMessage) {
|
|
274
|
+
expressionAttributeValues[':error'] = errorMessage;
|
|
275
|
+
}
|
|
276
|
+
await this.docClient.send(new lib_dynamodb_1.UpdateCommand({
|
|
277
|
+
TableName: this.tableName,
|
|
278
|
+
Key: { task_id: taskId },
|
|
279
|
+
UpdateExpression: updateExpression,
|
|
280
|
+
ExpressionAttributeNames: {
|
|
281
|
+
'#status': 'status',
|
|
282
|
+
},
|
|
283
|
+
ExpressionAttributeValues: expressionAttributeValues,
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Get items by session ID
|
|
288
|
+
* Uses session-index GSI
|
|
289
|
+
*/
|
|
290
|
+
async getBySession(sessionId) {
|
|
291
|
+
const result = await this.docClient.send(new lib_dynamodb_1.QueryCommand({
|
|
292
|
+
TableName: this.tableName,
|
|
293
|
+
IndexName: 'session-index',
|
|
294
|
+
KeyConditionExpression: 'session_id = :sid',
|
|
295
|
+
ExpressionAttributeValues: {
|
|
296
|
+
':sid': sessionId,
|
|
297
|
+
},
|
|
298
|
+
ScanIndexForward: true, // Ascending by created_at
|
|
299
|
+
}));
|
|
300
|
+
return result.Items || [];
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Get items by status
|
|
304
|
+
* Uses status-index GSI
|
|
305
|
+
*/
|
|
306
|
+
async getByStatus(status) {
|
|
307
|
+
const result = await this.docClient.send(new lib_dynamodb_1.QueryCommand({
|
|
308
|
+
TableName: this.tableName,
|
|
309
|
+
IndexName: 'status-index',
|
|
310
|
+
KeyConditionExpression: '#status = :status',
|
|
311
|
+
ExpressionAttributeNames: {
|
|
312
|
+
'#status': 'status',
|
|
313
|
+
},
|
|
314
|
+
ExpressionAttributeValues: {
|
|
315
|
+
':status': status,
|
|
316
|
+
},
|
|
317
|
+
ScanIndexForward: true, // Ascending by created_at
|
|
318
|
+
}));
|
|
319
|
+
return result.Items || [];
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get items by task group ID
|
|
323
|
+
* Uses task-group-index GSI
|
|
324
|
+
* Per spec/19_WEB_UI.md: for listing tasks in a task group
|
|
325
|
+
*/
|
|
326
|
+
async getByTaskGroup(taskGroupId) {
|
|
327
|
+
const result = await this.docClient.send(new lib_dynamodb_1.QueryCommand({
|
|
328
|
+
TableName: this.tableName,
|
|
329
|
+
IndexName: 'task-group-index',
|
|
330
|
+
KeyConditionExpression: 'task_group_id = :tgid',
|
|
331
|
+
ExpressionAttributeValues: {
|
|
332
|
+
':tgid': taskGroupId,
|
|
333
|
+
},
|
|
334
|
+
ScanIndexForward: true, // Ascending by created_at
|
|
335
|
+
}));
|
|
336
|
+
return result.Items || [];
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Get all distinct task groups with summary
|
|
340
|
+
* Per spec/19_WEB_UI.md: for task group list view
|
|
341
|
+
* Note: Uses Scan - consider pagination for large datasets
|
|
342
|
+
*/
|
|
343
|
+
async getAllTaskGroups() {
|
|
344
|
+
// Scan all items and aggregate by task_group_id
|
|
345
|
+
const result = await this.docClient.send(new lib_dynamodb_1.ScanCommand({
|
|
346
|
+
TableName: this.tableName,
|
|
347
|
+
ProjectionExpression: 'task_group_id, created_at, updated_at',
|
|
348
|
+
}));
|
|
349
|
+
const items = result.Items || [];
|
|
350
|
+
// Aggregate by task_group_id
|
|
351
|
+
const groupMap = new Map();
|
|
352
|
+
for (const item of items) {
|
|
353
|
+
const existing = groupMap.get(item.task_group_id);
|
|
354
|
+
if (existing) {
|
|
355
|
+
existing.count++;
|
|
356
|
+
if (item.created_at < existing.createdAt) {
|
|
357
|
+
existing.createdAt = item.created_at;
|
|
358
|
+
}
|
|
359
|
+
if (item.updated_at > existing.latestUpdatedAt) {
|
|
360
|
+
existing.latestUpdatedAt = item.updated_at;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
groupMap.set(item.task_group_id, {
|
|
365
|
+
count: 1,
|
|
366
|
+
createdAt: item.created_at,
|
|
367
|
+
latestUpdatedAt: item.updated_at,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
// Convert to array and sort by created_at (oldest first)
|
|
372
|
+
const groups = [];
|
|
373
|
+
for (const [taskGroupId, data] of groupMap) {
|
|
374
|
+
groups.push({
|
|
375
|
+
task_group_id: taskGroupId,
|
|
376
|
+
task_count: data.count,
|
|
377
|
+
created_at: data.createdAt,
|
|
378
|
+
latest_updated_at: data.latestUpdatedAt,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
groups.sort((a, b) => a.created_at.localeCompare(b.created_at));
|
|
382
|
+
return groups;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Delete item (for testing)
|
|
386
|
+
*/
|
|
387
|
+
async deleteItem(taskId) {
|
|
388
|
+
await this.docClient.send(new lib_dynamodb_1.DeleteCommand({
|
|
389
|
+
TableName: this.tableName,
|
|
390
|
+
Key: { task_id: taskId },
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Mark stale RUNNING tasks as ERROR
|
|
395
|
+
* Per spec: fail-closed - don't leave tasks in "limbo"
|
|
396
|
+
*
|
|
397
|
+
* @param maxAgeMs - Max age in milliseconds for RUNNING tasks
|
|
398
|
+
* @returns Number of tasks marked as ERROR
|
|
399
|
+
*/
|
|
400
|
+
async recoverStaleTasks(maxAgeMs = 5 * 60 * 1000) {
|
|
401
|
+
const runningTasks = await this.getByStatus('RUNNING');
|
|
402
|
+
const now = Date.now();
|
|
403
|
+
let recovered = 0;
|
|
404
|
+
for (const task of runningTasks) {
|
|
405
|
+
const taskAge = now - new Date(task.updated_at).getTime();
|
|
406
|
+
if (taskAge > maxAgeMs) {
|
|
407
|
+
await this.updateStatus(task.task_id, 'ERROR', `Task stale: running for ${Math.round(taskAge / 1000)}s without completion`);
|
|
408
|
+
recovered++;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return recovered;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Close the client connection
|
|
415
|
+
*/
|
|
416
|
+
destroy() {
|
|
417
|
+
this.client.destroy();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
exports.QueueStore = QueueStore;
|
|
421
|
+
//# sourceMappingURL=queue-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-store.js","sourceRoot":"","sources":["../../src/queue/queue-store.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,8DAKkC;AAClC,wDAQ+B;AAC/B,+BAAoC;AAuDpC;;;GAGG;AACH,MAAa,UAAU;IACJ,MAAM,CAAiB;IACvB,SAAS,CAAyB;IAClC,SAAS,CAAS;IAClB,QAAQ,CAAS;IAElC,YAAY,SAA2B,EAAE;QACvC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,uBAAuB,CAAC;QAC3D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,iBAAiB,CAAC;QAC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CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,iBAAiB,CAAC,WAAmB,CAAC,GAAG,EAAE,GAAG,IAAI;QACtD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;YAChC,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;YAC1D,IAAI,OAAO,GAAG,QAAQ,EAAE,CAAC;gBACvB,MAAM,IAAI,CAAC,YAAY,CACrB,IAAI,CAAC,OAAO,EACZ,OAAO,EACP,2BAA2B,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,sBAAsB,CAC5E,CAAC;gBACF,SAAS,EAAE,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACF;AA9dD,gCA8dC"}
|
package/dist/repl/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { REPLInterface, REPLConfig, ReplExecutionMode, EXIT_CODES, ProjectMode, VerifiedFile, TaskLog, } from './repl-interface';
|
|
5
5
|
export * from './commands';
|
|
6
|
+
export { TwoPaneRenderer, TwoPaneRendererConfig, RunningInfo, CompleteInfo, } from './two-pane-renderer';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/repl/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EAEV,WAAW,EACX,YAAY,EACZ,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EAEV,WAAW,EACX,YAAY,EACZ,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
package/dist/repl/index.js
CHANGED
|
@@ -17,9 +17,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.EXIT_CODES = exports.REPLInterface = void 0;
|
|
20
|
+
exports.TwoPaneRenderer = exports.EXIT_CODES = exports.REPLInterface = void 0;
|
|
21
21
|
var repl_interface_1 = require("./repl-interface");
|
|
22
22
|
Object.defineProperty(exports, "REPLInterface", { enumerable: true, get: function () { return repl_interface_1.REPLInterface; } });
|
|
23
23
|
Object.defineProperty(exports, "EXIT_CODES", { enumerable: true, get: function () { return repl_interface_1.EXIT_CODES; } });
|
|
24
24
|
__exportStar(require("./commands"), exports);
|
|
25
|
+
var two_pane_renderer_1 = require("./two-pane-renderer");
|
|
26
|
+
Object.defineProperty(exports, "TwoPaneRenderer", { enumerable: true, get: function () { return two_pane_renderer_1.TwoPaneRenderer; } });
|
|
25
27
|
//# sourceMappingURL=index.js.map
|
package/dist/repl/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,mDAS0B;AARxB,+GAAA,aAAa,OAAA;AAGb,4GAAA,UAAU,OAAA;AAMZ,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,mDAS0B;AARxB,+GAAA,aAAa,OAAA;AAGb,4GAAA,UAAU,OAAA;AAMZ,6CAA2B;AAC3B,yDAK6B;AAJ3B,oHAAA,eAAe,OAAA"}
|