@myagentroam/node 0.11.6 → 0.11.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/dist/connector.js +18 -7
- package/dist/marctl-guidance.js +36 -0
- package/dist/mcp/marctl-guide-stdio.js +18 -0
- package/dist/mcp/marctl-guide.js +30 -0
- package/dist/mcp/naming.js +1 -0
- package/dist/opencode-server.js +50 -8
- package/dist/runner/abstract-runner.js +8 -0
- package/dist/runner/claude-code-runner.js +2 -1
- package/dist/runner/codex-runner.js +27 -1
- package/dist/runner/execution-context.js +1 -0
- package/dist/runner/mar-agent/execution-input.js +46 -0
- package/dist/runner/mar-agent/managed-run-controller.js +10 -36
- package/dist/runner/mar-agent/marctl-skill.js +3 -34
- package/dist/runner/mar-agent-runner.js +4 -0
- package/dist/runner/opencode/managed-run-controller.js +117 -11
- package/dist/runner/opencode-runner.js +2 -1
- package/dist/runtime-state.js +32 -6
- package/dist/service/continuous-run-coordinator.js +2 -10
- package/dist/service/conversation-history-service.js +23 -40
- package/dist/service/conversation-segment-service.js +3 -1
- package/dist/service/goal-continuation-coordinator.js +5 -27
- package/dist/service/restart-session-restorer.js +3 -8
- package/dist/service/scheduled-session-coordinator.js +5 -3
- package/dist/service/scheduled-session-recurrence.js +41 -19
- package/dist/service/scheduled-session-store.js +6 -4
- package/dist/service/session-command-service.js +4 -12
- package/dist/service/session-lifecycle-service.js +4 -6
- package/dist/service/session-message-service.js +7 -18
- package/dist/service/workspace-queue-workbench-service.js +1 -1
- package/dist/util/conversation-identity.js +11 -0
- package/package.json +4 -4
|
@@ -146,7 +146,7 @@ export class ScheduledSessionStore {
|
|
|
146
146
|
const enabled = patch.enabled ?? current.enabled;
|
|
147
147
|
const ownerUserId = patch.ownerUserId ?? current.ownerUserId;
|
|
148
148
|
const nextRunAt = enabled
|
|
149
|
-
?
|
|
149
|
+
? !current.enabled || cron !== current.cron || timezone !== current.timezone
|
|
150
150
|
? nextScheduledAt(cron, timezone, this.now())
|
|
151
151
|
: current.nextRunAt
|
|
152
152
|
: null;
|
|
@@ -258,9 +258,11 @@ export class ScheduledSessionStore {
|
|
|
258
258
|
.prepare(`UPDATE scheduled_session_occurrences SET status=?,code=?,run_id=?,updated_at=?
|
|
259
259
|
WHERE id=? AND status IN ('CLAIMED','SUBMITTED')`)
|
|
260
260
|
.run(status, code ?? null, runId ?? null, this.now(), occurrenceId);
|
|
261
|
-
if (result.changes
|
|
262
|
-
return;
|
|
263
|
-
|
|
261
|
+
if (result.changes !== 1)
|
|
262
|
+
return false;
|
|
263
|
+
if (status !== 'SUBMITTED')
|
|
264
|
+
this.pruneTerminal(occurrenceId);
|
|
265
|
+
return true;
|
|
264
266
|
}
|
|
265
267
|
pruneTerminal(occurrenceId) {
|
|
266
268
|
this.database
|
|
@@ -81,12 +81,9 @@ export class SessionCommandService {
|
|
|
81
81
|
: {}),
|
|
82
82
|
secretEnvironment,
|
|
83
83
|
...(instructions === undefined ? {} : { personalInstructions: instructions }),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
...(input.marAgentRuntimeScopeId === undefined
|
|
88
|
-
? {}
|
|
89
|
-
: { marAgentRuntimeScopeId: input.marAgentRuntimeScopeId })
|
|
84
|
+
executionContext: this.options.runners
|
|
85
|
+
.require(session.runner)
|
|
86
|
+
.prepareExecutionContext(input)
|
|
90
87
|
});
|
|
91
88
|
}
|
|
92
89
|
const runner = this.options.runners.product(session.runner);
|
|
@@ -116,12 +113,7 @@ export class SessionCommandService {
|
|
|
116
113
|
const result = await runner.executeCommand(session, command, invocation.input, {
|
|
117
114
|
secretEnvironment,
|
|
118
115
|
mcpInstallations: this.options.mcps(session.workspaceId),
|
|
119
|
-
|
|
120
|
-
...(input.marAgentModels === undefined ? {} : { marAgentModels: input.marAgentModels }),
|
|
121
|
-
...(input.marAgentCompact === undefined ? {} : { marAgentCompact: input.marAgentCompact }),
|
|
122
|
-
...(input.marAgentRuntimeScopeId === undefined
|
|
123
|
-
? {}
|
|
124
|
-
: { marAgentRuntimeScopeId: input.marAgentRuntimeScopeId }),
|
|
116
|
+
executionContext: runner.prepareExecutionContext(input),
|
|
125
117
|
...(Number.isSafeInteger(input.__requestUserId)
|
|
126
118
|
? { initiatedByUserId: input.__requestUserId }
|
|
127
119
|
: {})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RUNNER_EXECUTION_CONTEXT } from '../runner/execution-context.js';
|
|
1
2
|
import { parseMessageAttachments, validSessionEffort, validSessionOption, validSessionTitle } from '../util/node-operation-parsers.js';
|
|
2
3
|
import { isPlainRecord } from '../util/node-operation-parsers.js';
|
|
3
4
|
import { parseSecretEnvironment } from '../util/secret-environment.js';
|
|
@@ -265,12 +266,9 @@ export class SessionLifecycleService {
|
|
|
265
266
|
...(input.personalInstructions === undefined
|
|
266
267
|
? {}
|
|
267
268
|
: { personalInstructions: input.personalInstructions }),
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
...(input.marAgentRuntimeScopeId === undefined
|
|
272
|
-
? {}
|
|
273
|
-
: { marAgentRuntimeScopeId: input.marAgentRuntimeScopeId }),
|
|
269
|
+
[RUNNER_EXECUTION_CONTEXT]: this.options.runners
|
|
270
|
+
.require(created.session.runner)
|
|
271
|
+
.prepareExecutionContext(input),
|
|
274
272
|
...(input.computerUse === undefined ? {} : { computerUse: input.computerUse }),
|
|
275
273
|
...(input.attachmentIds === undefined ? {} : { attachmentIds: input.attachmentIds }),
|
|
276
274
|
...(input.attachments === undefined ? {} : { attachments: input.attachments })
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RUNNER_EXECUTION_CONTEXT } from '../runner/execution-context.js';
|
|
1
2
|
import { modelUsageGrantSchema } from '@myagentroam/protocol';
|
|
2
3
|
import { randomUUID } from 'node:crypto';
|
|
3
4
|
import { isImageAttachment, isRunnerImageAttachment, parseComposerAttachmentIds, parseMessageAttachments, sessionTitleFromFirstMessage, withNonImageAttachmentPrompt } from '../util/node-operation-parsers.js';
|
|
@@ -55,11 +56,8 @@ export class SessionMessageService {
|
|
|
55
56
|
deliveryIntent: input.deliveryIntent,
|
|
56
57
|
secretEnvironment: input.secretEnvironment,
|
|
57
58
|
personalInstructions: input.personalInstructions,
|
|
58
|
-
marAgentModel: input.marAgentModel,
|
|
59
|
-
marAgentModels: input.marAgentModels,
|
|
60
|
-
marAgentCompact: input.marAgentCompact,
|
|
61
59
|
__usageGrant: input.usageGrant,
|
|
62
|
-
|
|
60
|
+
[RUNNER_EXECUTION_CONTEXT]: input.executionContext
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
63
|
submitScheduled(input) {
|
|
@@ -73,11 +71,8 @@ export class SessionMessageService {
|
|
|
73
71
|
deliveryIntent: 'SEND',
|
|
74
72
|
secretEnvironment: input.secretEnvironment,
|
|
75
73
|
personalInstructions: input.personalInstructions,
|
|
76
|
-
marAgentModel: input.marAgentModel,
|
|
77
|
-
marAgentModels: input.marAgentModels,
|
|
78
|
-
marAgentCompact: input.marAgentCompact,
|
|
79
74
|
__usageGrant: input.usageGrant,
|
|
80
|
-
|
|
75
|
+
[RUNNER_EXECUTION_CONTEXT]: input.executionContext
|
|
81
76
|
});
|
|
82
77
|
}
|
|
83
78
|
message(input) {
|
|
@@ -139,6 +134,8 @@ export class SessionMessageService {
|
|
|
139
134
|
idempotent: true,
|
|
140
135
|
auditReceipt: auditReceipt(session, existing.kind === 'queue' ? 'QUEUE' : 'SEND', existing.kind === 'queue' ? existing.item.id : existing.run.id, existing.kind === 'queue' ? existing.item.id : undefined)
|
|
141
136
|
};
|
|
137
|
+
const executionContext = input[RUNNER_EXECUTION_CONTEXT] ??
|
|
138
|
+
this.options.runners.require(session.runner).prepareExecutionContext(input);
|
|
142
139
|
const sourceContent = withSessionMessageOrigin(content, input.__marctlOrigin);
|
|
143
140
|
const goalMessage = internalGoal || internalSchedule || internalRestore
|
|
144
141
|
? undefined
|
|
@@ -270,7 +267,7 @@ export class SessionMessageService {
|
|
|
270
267
|
runId,
|
|
271
268
|
sessionId: currentSession.id,
|
|
272
269
|
workspaceId: currentSession.workspaceId,
|
|
273
|
-
|
|
270
|
+
executionContext,
|
|
274
271
|
input: runner.prepareMessageInput(runnerInput, planActive ? 'plan' : 'default'),
|
|
275
272
|
...(userMessage
|
|
276
273
|
? {
|
|
@@ -290,14 +287,6 @@ export class SessionMessageService {
|
|
|
290
287
|
collaborationMode: planActive ? 'plan' : 'default',
|
|
291
288
|
secretEnvironment,
|
|
292
289
|
...(personalInstructions === undefined ? {} : { personalInstructions }),
|
|
293
|
-
...(input.marAgentModel === undefined ? {} : { marAgentModel: input.marAgentModel }),
|
|
294
|
-
...(input.marAgentModels === undefined ? {} : { marAgentModels: input.marAgentModels }),
|
|
295
|
-
...(input.marAgentCompact === undefined
|
|
296
|
-
? {}
|
|
297
|
-
: { marAgentCompact: input.marAgentCompact }),
|
|
298
|
-
...(input.marAgentRuntimeScopeId === undefined
|
|
299
|
-
? {}
|
|
300
|
-
: { marAgentRuntimeScopeId: input.marAgentRuntimeScopeId }),
|
|
301
290
|
...(input.computerUse === undefined ? {} : { computerUse: input.computerUse }),
|
|
302
291
|
...(goalMessage !== undefined
|
|
303
292
|
? { goal: goalMessage.goal }
|
|
@@ -342,7 +331,7 @@ export class SessionMessageService {
|
|
|
342
331
|
};
|
|
343
332
|
const delivery = await prepare();
|
|
344
333
|
return {
|
|
345
|
-
session: this.options.present(sessionForPresentation),
|
|
334
|
+
session: this.options.present(this.options.runtime.getAgentSession(session.id) ?? sessionForPresentation),
|
|
346
335
|
run: created.run,
|
|
347
336
|
...(created.queueItem === undefined ? {} : { queueItemId: created.queueItem.id }),
|
|
348
337
|
delivery,
|
|
@@ -129,7 +129,7 @@ export class WorkspaceQueueWorkbenchService {
|
|
|
129
129
|
const prepared = this.options.coordinator.pending(item.id);
|
|
130
130
|
const prepareRunnerInput = (steering) => prepared === undefined
|
|
131
131
|
? undefined
|
|
132
|
-
: this.options.prepareInput(prepared.runner, withNonImageAttachmentPrompt(steering ? steerComposerMessage(content) : content, prepared.attachmentPaths, prepared.attachmentFiles), prepared.collaborationMode);
|
|
132
|
+
: this.options.prepareInput(prepared.executionContext.runner, withNonImageAttachmentPrompt(steering ? steerComposerMessage(content) : content, prepared.attachmentPaths, prepared.attachmentFiles), prepared.collaborationMode);
|
|
133
133
|
const runnerInput = prepareRunnerInput(prepared?.steering === true);
|
|
134
134
|
this.options.runtime.updateQueueItem(item.id, content);
|
|
135
135
|
if (runnerInput !== undefined)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isPlainRecord } from './node-operation-parsers.js';
|
|
2
|
+
export function conversationClientMessageId(turn) {
|
|
3
|
+
for (const item of turn.items) {
|
|
4
|
+
if (item.kind !== 'user_message' || !isPlainRecord(item.payload))
|
|
5
|
+
continue;
|
|
6
|
+
const value = item.payload.clientMessageId;
|
|
7
|
+
if (typeof value === 'string' && value.length > 0)
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
4
4
|
"description": "MyAgentRoam Node runtime CLI.",
|
|
5
5
|
"license": "Apache-2.0 AND GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"playwright": "1.62.1",
|
|
38
38
|
"ws": "^8.21.3",
|
|
39
39
|
"zod": "4.4.3",
|
|
40
|
-
"@myagentroam/agent": "0.11.
|
|
41
|
-
"@myagentroam/code-navigation": "0.11.0",
|
|
40
|
+
"@myagentroam/agent": "0.11.8",
|
|
42
41
|
"@myagentroam/marctl": "0.11.0",
|
|
43
|
-
"@myagentroam/protocol": "0.11.
|
|
42
|
+
"@myagentroam/protocol": "0.11.8",
|
|
43
|
+
"@myagentroam/code-navigation": "0.11.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/ws": "^8.18.1"
|