@myagentroam/node 0.9.6 → 0.9.7
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/connector.js +3 -1
- package/dist/runner/codex/managed-run-controller.d.ts +1 -0
- package/dist/runner/codex/managed-run-controller.js +2 -0
- package/dist/service/session-command-service.d.ts +1 -0
- package/dist/service/session-command-service.js +7 -0
- package/dist/service/workspace-queue-workbench-service.d.ts +1 -0
- package/dist/service/workspace-queue-workbench-service.js +10 -0
- package/package.json +2 -2
package/dist/connector.js
CHANGED
|
@@ -276,6 +276,7 @@ export class NodeConnector {
|
|
|
276
276
|
setCommandState: (sessionId, state) => this.commandStates.set(sessionId, state),
|
|
277
277
|
clearCommandState: (sessionId, commandId) => this.commandStates.clear(sessionId, commandId),
|
|
278
278
|
commandStates: (sessionId) => this.commandStates.list(sessionId),
|
|
279
|
+
hasActiveSessionLease: (sessionId) => this.runtime.hasActiveSessionLease(sessionId),
|
|
279
280
|
fast: (input) => this.executeNodeOperation('runner.command.execute', {
|
|
280
281
|
runner: 'codex',
|
|
281
282
|
commandId: 'fast',
|
|
@@ -489,7 +490,8 @@ export class NodeConnector {
|
|
|
489
490
|
projection: this.nativeSessionProjectionService,
|
|
490
491
|
resume: this.externalSessionResumeService,
|
|
491
492
|
profiles: () => this.runnerService.profiles(),
|
|
492
|
-
present: (session) => this.sessionPresentationService.present(session)
|
|
493
|
+
present: (session) => this.sessionPresentationService.present(session),
|
|
494
|
+
resumeQueueAfterCommandRun: (sessionId) => this.workspaceQueueWorkbenchService.resumeAfterCommandRun(sessionId)
|
|
493
495
|
});
|
|
494
496
|
this.sessionMessageService = new SessionMessageService({
|
|
495
497
|
runtime: this.runtime,
|
|
@@ -65,6 +65,7 @@ export interface CodexManagedRunHost<TAttachment> {
|
|
|
65
65
|
setCommandState(sessionId: string, state: RunnerCommandState): void;
|
|
66
66
|
clearCommandState(sessionId: string, commandId: string): void;
|
|
67
67
|
commandStates(sessionId: string): readonly RunnerCommandState[];
|
|
68
|
+
hasActiveSessionLease(sessionId: string): boolean;
|
|
68
69
|
fast(input: string): Promise<unknown>;
|
|
69
70
|
}
|
|
70
71
|
export declare class CodexManagedRunController<TAttachment> {
|
|
@@ -80,6 +80,8 @@ export class CodexManagedRunController {
|
|
|
80
80
|
throw new Error('RUNNER_COMMAND_UNAVAILABLE');
|
|
81
81
|
}
|
|
82
82
|
async compact(session, threadId, runId) {
|
|
83
|
+
if (this.host.hasActiveSessionLease(session.id))
|
|
84
|
+
throw new Error('RUNNER_COMMAND_UNAVAILABLE');
|
|
83
85
|
this.host.adopt({
|
|
84
86
|
runId,
|
|
85
87
|
sessionId: session.id,
|
|
@@ -12,6 +12,7 @@ interface SessionCommandServiceOptions {
|
|
|
12
12
|
readonly resume: ExternalSessionResumeService;
|
|
13
13
|
readonly profiles: () => readonly RunnerProfile[];
|
|
14
14
|
readonly present: (session: NodeAgentSession) => unknown;
|
|
15
|
+
readonly resumeQueueAfterCommandRun: (sessionId: string) => void;
|
|
15
16
|
}
|
|
16
17
|
export declare class SessionCommandService {
|
|
17
18
|
private readonly options;
|
|
@@ -48,6 +48,9 @@ export class SessionCommandService {
|
|
|
48
48
|
?.commands.find((candidate) => isPlainRecord(candidate) && candidate.id === input.commandId);
|
|
49
49
|
if (command?.available !== true)
|
|
50
50
|
throw new Error('RUNNER_COMMAND_UNAVAILABLE');
|
|
51
|
+
if (command.interaction === 'IMMEDIATE_ACTION' &&
|
|
52
|
+
this.options.runtime.hasActiveSessionLease(session.id))
|
|
53
|
+
throw new Error('RUNNER_COMMAND_UNAVAILABLE');
|
|
51
54
|
const invocation = parseCommandInvocation({ descriptor: command }, input.input);
|
|
52
55
|
const secretEnvironment = parseSecretEnvironment(input.secretEnvironment);
|
|
53
56
|
const runner = this.options.runners.product(session.runner);
|
|
@@ -56,6 +59,10 @@ export class SessionCommandService {
|
|
|
56
59
|
const result = await runner.executeCommand(session, command, invocation.input, {
|
|
57
60
|
secretEnvironment
|
|
58
61
|
});
|
|
62
|
+
if (command.interaction === 'IMMEDIATE_ACTION' &&
|
|
63
|
+
isPlainRecord(result) &&
|
|
64
|
+
isPlainRecord(result.run))
|
|
65
|
+
this.options.resumeQueueAfterCommandRun(session.id);
|
|
59
66
|
return {
|
|
60
67
|
...(isPlainRecord(result) ? result : { result }),
|
|
61
68
|
session: this.options.present(session)
|
|
@@ -66,6 +66,7 @@ export declare class WorkspaceQueueWorkbenchService<TAttachment> {
|
|
|
66
66
|
migrateSession(previousId: string, nextId: string): void;
|
|
67
67
|
cancelQueued(runId: string): void;
|
|
68
68
|
pauseForInterrupt(sessionId: string): void;
|
|
69
|
+
resumeAfterCommandRun(sessionId: string): void;
|
|
69
70
|
operations(): Readonly<Record<string, NodeOperationHandler>>;
|
|
70
71
|
private get;
|
|
71
72
|
private pauseOrResume;
|
|
@@ -64,6 +64,16 @@ export class WorkspaceQueueWorkbenchService {
|
|
|
64
64
|
this.options.runtime.pauseSessionQueue(session.id);
|
|
65
65
|
this.publish(session.id);
|
|
66
66
|
}
|
|
67
|
+
resumeAfterCommandRun(sessionId) {
|
|
68
|
+
const session = this.options.runtime.getAgentSession(sessionId);
|
|
69
|
+
if (session === undefined)
|
|
70
|
+
throw new Error('SESSION_NOT_FOUND');
|
|
71
|
+
if (!this.options.runtime.sessionQueue(session.id).paused)
|
|
72
|
+
return;
|
|
73
|
+
this.options.runtime.resumeSessionQueue(session.id);
|
|
74
|
+
this.publish(session.id);
|
|
75
|
+
this.schedule(session.id);
|
|
76
|
+
}
|
|
67
77
|
operations() {
|
|
68
78
|
return {
|
|
69
79
|
'workspace.queue.get': (data) => this.get(record(data)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "MyAgentRoam Node runtime CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"node-pty": "1.1.0",
|
|
25
25
|
"ws": "^8.21.3",
|
|
26
26
|
"zod": "4.4.3",
|
|
27
|
-
"@myagentroam/protocol": "^0.9.
|
|
27
|
+
"@myagentroam/protocol": "^0.9.7"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/ws": "^8.18.1"
|