@myagentroam/node 0.9.82 → 0.9.84
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
CHANGED
|
@@ -854,7 +854,7 @@ export class NodeConnector {
|
|
|
854
854
|
missionAccessChanged: prepared.changed
|
|
855
855
|
};
|
|
856
856
|
},
|
|
857
|
-
mission: async ({ session, objective, secretEnvironment, personalInstructions, marAgentModel, marAgentModels, marAgentRuntimeScopeId }) => {
|
|
857
|
+
mission: async ({ session, objective, initiatedByUserId, secretEnvironment, personalInstructions, marAgentModel, marAgentModels, marAgentRuntimeScopeId }) => {
|
|
858
858
|
this.clearMissionRetry(session.id);
|
|
859
859
|
const prepared = this.prepareMissionSession(session);
|
|
860
860
|
const missionSession = prepared.session;
|
|
@@ -869,6 +869,7 @@ export class NodeConnector {
|
|
|
869
869
|
content: this.missionRuntime.prompt(session.id, 'start'),
|
|
870
870
|
deliveryIntent: replacing ? 'REPLACE_CURRENT' : 'SEND',
|
|
871
871
|
mission: { id: mission.id, revision: mission.revision },
|
|
872
|
+
...(initiatedByUserId === undefined ? {} : { initiatedByUserId }),
|
|
872
873
|
secretEnvironment,
|
|
873
874
|
...(personalInstructions === undefined ? {} : { personalInstructions }),
|
|
874
875
|
...(marAgentModel === undefined ? {} : { marAgentModel }),
|
|
@@ -170,6 +170,9 @@ export class MarAgentConversationNormalizer {
|
|
|
170
170
|
: undefined;
|
|
171
171
|
const subagentTitle = agentId === undefined ? undefined : this.#subagentTitles.get(agentId);
|
|
172
172
|
const subagentDetails = agentId === undefined ? undefined : this.#subagentDetails.get(agentId);
|
|
173
|
+
const toolSubagentDetails = event.toolName === 'agent_message'
|
|
174
|
+
? withoutSubagentLatestMessage(subagentDetails)
|
|
175
|
+
: subagentDetails;
|
|
173
176
|
this.#tools.set(event.callId, {
|
|
174
177
|
toolName: event.toolName,
|
|
175
178
|
input: event.input,
|
|
@@ -181,7 +184,7 @@ export class MarAgentConversationNormalizer {
|
|
|
181
184
|
if (event.toolName === 'apply_patch' && 'input' in event)
|
|
182
185
|
return [fileChangeItem(ownItemId, 'IN_PROGRESS', [])];
|
|
183
186
|
return [
|
|
184
|
-
genericToolItem(ownItemId, event.toolName, 'IN_PROGRESS', event.input, null, null, false, undefined, subagentTitle,
|
|
187
|
+
genericToolItem(ownItemId, event.toolName, 'IN_PROGRESS', event.input, null, null, false, undefined, subagentTitle, toolSubagentDetails)
|
|
185
188
|
];
|
|
186
189
|
}
|
|
187
190
|
#toolCompleted(event) {
|
|
@@ -214,8 +217,13 @@ export class MarAgentConversationNormalizer {
|
|
|
214
217
|
const agentId = controlTool
|
|
215
218
|
? (marAgentAgentId(state?.input) ?? marAgentAgentId(controlOutput))
|
|
216
219
|
: undefined;
|
|
220
|
+
const cachedDetails = agentId === undefined
|
|
221
|
+
? undefined
|
|
222
|
+
: mergeSubagentDetails(this.#subagentDetails.get(agentId), state?.subagentDetails ?? {});
|
|
217
223
|
const details = controlTool
|
|
218
|
-
? mergeSubagentDetails(
|
|
224
|
+
? mergeSubagentDetails(event.toolName === 'agent_message'
|
|
225
|
+
? withoutSubagentLatestMessage(cachedDetails)
|
|
226
|
+
: cachedDetails, subagentDetails(controlOutput))
|
|
219
227
|
: {};
|
|
220
228
|
if (agentId !== undefined) {
|
|
221
229
|
const output = structuredRecord(controlOutput);
|
|
@@ -294,9 +302,7 @@ export class MarAgentConversationNormalizer {
|
|
|
294
302
|
const start = this.#subagentStarts.get(event.agentId);
|
|
295
303
|
if (start === undefined)
|
|
296
304
|
return [];
|
|
297
|
-
return [
|
|
298
|
-
subagentStartItem(start, event.agentId, title, details, lifecycle)
|
|
299
|
-
];
|
|
305
|
+
return [subagentStartItem(start, event.agentId, title, details, lifecycle)];
|
|
300
306
|
}
|
|
301
307
|
}
|
|
302
308
|
function itemId(kind, value) {
|
|
@@ -540,6 +546,12 @@ function mergeSubagentDetails(current, update) {
|
|
|
540
546
|
...update
|
|
541
547
|
};
|
|
542
548
|
}
|
|
549
|
+
function withoutSubagentLatestMessage(details) {
|
|
550
|
+
if (details?.latestMessage === undefined)
|
|
551
|
+
return details;
|
|
552
|
+
const { latestMessage: _latestMessage, ...withoutLatestMessage } = details;
|
|
553
|
+
return withoutLatestMessage;
|
|
554
|
+
}
|
|
543
555
|
function subagentPayload(details) {
|
|
544
556
|
return {
|
|
545
557
|
...(details.modelId === undefined ? {} : { subagentModelId: details.modelId }),
|
|
@@ -62,6 +62,9 @@ export class SessionCommandService {
|
|
|
62
62
|
return this.options.mission({
|
|
63
63
|
session,
|
|
64
64
|
objective: invocation.argument,
|
|
65
|
+
...(Number.isSafeInteger(input.__requestUserId)
|
|
66
|
+
? { initiatedByUserId: input.__requestUserId }
|
|
67
|
+
: {}),
|
|
65
68
|
secretEnvironment,
|
|
66
69
|
...(typeof input.personalInstructions === 'string'
|
|
67
70
|
? { personalInstructions: input.personalInstructions }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.84",
|
|
4
4
|
"description": "MyAgentRoam Node runtime CLI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"node-pty": "1.1.0",
|
|
29
29
|
"ws": "^8.21.3",
|
|
30
30
|
"zod": "4.4.3",
|
|
31
|
-
"@myagentroam/agent": "0.9.
|
|
32
|
-
"@myagentroam/protocol": "0.9.
|
|
31
|
+
"@myagentroam/agent": "0.9.84",
|
|
32
|
+
"@myagentroam/protocol": "0.9.84"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/ws": "^8.18.1"
|