@myagentroam/node 0.11.19 → 0.11.21
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
|
@@ -120,6 +120,7 @@ const CONVERSATION_TEMPLATE_OPERATIONS = [
|
|
|
120
120
|
];
|
|
121
121
|
const HOSTED_CONVERSATION_OPERATIONS = [
|
|
122
122
|
'conversation.hosted.list',
|
|
123
|
+
'conversation.hosted.model-options',
|
|
123
124
|
'conversation.hosted.create',
|
|
124
125
|
'conversation.hosted.get',
|
|
125
126
|
'conversation.hosted.history',
|
|
@@ -4,7 +4,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
4
4
|
import { constants } from 'node:fs';
|
|
5
5
|
import { lstat, mkdir, open, readFile, rename, rm, utimes } from 'node:fs/promises';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
|
-
import { toolResultResourceInputSchema, toolResultResourcePageSchema, conversationTurnSchema, conversationTemplateSummarySchema, hostedConversationConfigUpdateInputSchema, hostedConversationCreateInputSchema, hostedConversationDeleteResultSchema, hostedConversationFileDeleteInputSchema, hostedConversationFileDeleteResultSchema, hostedConversationFileReadInputSchema, hostedConversationFileReadResultSchema, hostedConversationFilesSchema, hostedConversationHistoryInputSchema, hostedConversationHistoryPageSchema, hostedConversationIdInputSchema, hostedConversationImageReadInputSchema, hostedConversationListInputSchema, hostedConversationListPageSchema, hostedConversationMessageInputSchema, hostedConversationMetadataUpdateInputSchema, hostedConversationRollbackInputSchema, hostedConversationSnapshotSchema, hostedConversationSummarySchema, hostedConversationUnwatchInputSchema, hostedConversationUploadChunkInputSchema, hostedConversationUploadControlInputSchema, hostedConversationUploadCreateInputSchema, hostedConversationUploadPreflightInputSchema, hostedConversationUploadPreflightResultSchema, hostedConversationUploadSchema, hostedConversationWatchInputSchema, marAgentRuntimeModelConfigurationSchema, resolveMarAgentDefaultReasoningEffort } from '@myagentroam/protocol';
|
|
7
|
+
import { toolResultResourceInputSchema, toolResultResourcePageSchema, conversationTurnSchema, conversationTemplateSummarySchema, hostedConversationConfigUpdateInputSchema, hostedConversationCreateInputSchema, hostedConversationDeleteResultSchema, hostedConversationFileDeleteInputSchema, hostedConversationFileDeleteResultSchema, hostedConversationFileReadInputSchema, hostedConversationFileReadResultSchema, hostedConversationFilesSchema, hostedConversationHistoryInputSchema, hostedConversationHistoryPageSchema, hostedConversationIdInputSchema, hostedConversationImageReadInputSchema, hostedConversationListInputSchema, hostedConversationListPageSchema, hostedConversationMessageInputSchema, hostedConversationMetadataUpdateInputSchema, hostedConversationModelOptionsInputSchema, hostedConversationModelOptionsSchema, hostedConversationRollbackInputSchema, hostedConversationSnapshotSchema, hostedConversationSummarySchema, hostedConversationUnwatchInputSchema, hostedConversationUploadChunkInputSchema, hostedConversationUploadControlInputSchema, hostedConversationUploadCreateInputSchema, hostedConversationUploadPreflightInputSchema, hostedConversationUploadPreflightResultSchema, hostedConversationUploadSchema, hostedConversationWatchInputSchema, marAgentRuntimeModelConfigurationSchema, resolveMarAgentDefaultReasoningEffort } from '@myagentroam/protocol';
|
|
8
8
|
import { hostedConversationGeneratedImagesDisplayDirectory, hostedConversationImageRunId, marAgentGeneratedImagesDirectory } from '../runner/mar-agent/generated-images.js';
|
|
9
9
|
import { sessionTitleFromFirstMessage } from '../util/node-operation-parsers.js';
|
|
10
10
|
import { safeErrorCode } from '../util/safe-error.js';
|
|
@@ -50,6 +50,7 @@ export class HostedConversationNodeService {
|
|
|
50
50
|
operations() {
|
|
51
51
|
return {
|
|
52
52
|
'conversation.hosted.list': (raw) => this.list(raw),
|
|
53
|
+
'conversation.hosted.model-options': (raw) => this.modelOptions(raw),
|
|
53
54
|
'conversation.hosted.create': (raw) => this.create(raw),
|
|
54
55
|
'conversation.hosted.get': (raw) => this.get(raw),
|
|
55
56
|
'conversation.hosted.history': (raw) => this.history(raw),
|
|
@@ -106,6 +107,26 @@ export class HostedConversationNodeService {
|
|
|
106
107
|
}))
|
|
107
108
|
});
|
|
108
109
|
}
|
|
110
|
+
async modelOptions(raw) {
|
|
111
|
+
if (this.disablePrepared)
|
|
112
|
+
throw new Error('CONVERSATION_HOSTING_UNAVAILABLE');
|
|
113
|
+
const payload = hostedRequest(raw);
|
|
114
|
+
const input = hostedConversationModelOptionsInputSchema.parse(payload.data);
|
|
115
|
+
const template = conversationTemplateSummarySchema.parse(payload.template);
|
|
116
|
+
if (template.id !== input.templateId ||
|
|
117
|
+
template.nodeId !== this.options.nodeId() ||
|
|
118
|
+
!template.available ||
|
|
119
|
+
template.status !== 'ACTIVE' ||
|
|
120
|
+
template.currentVersionId === null)
|
|
121
|
+
throw new Error('HOSTED_CONVERSATION_TEMPLATE_UNAVAILABLE');
|
|
122
|
+
const version = await this.loadTemplateVersion(template.currentVersionId, template.id);
|
|
123
|
+
const models = allowedModels(version, runtimeModels(payload.models)).filter((model) => model.conversationModel !== false);
|
|
124
|
+
const selected = models.length === 0 ? undefined : selectModel(version, models, version.modelPolicy.defaultId);
|
|
125
|
+
return hostedConversationModelOptionsSchema.parse({
|
|
126
|
+
models: networkModels(models, version.draft.networkMode).map(modelSummary),
|
|
127
|
+
defaultModelId: selected?.id ?? null
|
|
128
|
+
});
|
|
129
|
+
}
|
|
109
130
|
create(raw) {
|
|
110
131
|
if (this.disablePrepared)
|
|
111
132
|
return Promise.reject(new Error('CONVERSATION_HOSTING_UNAVAILABLE'));
|
|
@@ -126,15 +147,18 @@ export class HostedConversationNodeService {
|
|
|
126
147
|
const existing = this.options.store.findConversationByClientRequest(payload.userId, input.clientRequestId);
|
|
127
148
|
if (existing !== undefined)
|
|
128
149
|
return this.snapshot(payload.userId, existing.id, models);
|
|
129
|
-
const operation = this.createConversation(payload.userId, input.clientRequestId, template, models, payload.runtimeScopeId);
|
|
150
|
+
const operation = this.createConversation(payload.userId, input.clientRequestId, template, models, input.modelId, payload.runtimeScopeId);
|
|
130
151
|
this.pendingCreates.set(key, operation);
|
|
131
152
|
void operation.finally(() => this.pendingCreates.delete(key)).catch(() => undefined);
|
|
132
153
|
return operation;
|
|
133
154
|
}
|
|
134
|
-
async createConversation(userId, clientRequestId, template, models, runtimeScopeId) {
|
|
155
|
+
async createConversation(userId, clientRequestId, template, models, requestedModelId, runtimeScopeId) {
|
|
135
156
|
await this.options.assertCanCreate?.();
|
|
136
157
|
const version = await this.loadTemplateVersion(template.currentVersionId, template.id);
|
|
137
|
-
|
|
158
|
+
if (requestedModelId !== undefined &&
|
|
159
|
+
!allowedModels(version, models).some((model) => model.id === requestedModelId && model.conversationModel !== false))
|
|
160
|
+
throw new Error('HOSTED_CONVERSATION_MODEL_NOT_AVAILABLE');
|
|
161
|
+
const selected = selectModel(version, models, requestedModelId ?? version.modelPolicy.defaultId);
|
|
138
162
|
const conversationId = this.id();
|
|
139
163
|
const prepared = await this.options.store.prepareConversationEnvironment(userId, conversationId);
|
|
140
164
|
const pathMounts = this.pathMounts(prepared.paths, version);
|
|
@@ -178,7 +178,8 @@ export class SessionLifecycleService {
|
|
|
178
178
|
});
|
|
179
179
|
if (input.bootstrapOnly === true)
|
|
180
180
|
this.options.identity.markBootstrap(session.id);
|
|
181
|
-
|
|
181
|
+
if (input.__marctlOrigin === undefined)
|
|
182
|
+
database.saveRunnerDefaults(configuration);
|
|
182
183
|
if (input.bootstrapOnly !== true)
|
|
183
184
|
this.options.emitSession(session);
|
|
184
185
|
return { session: this.options.present(session) };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.21",
|
|
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.
|
|
40
|
+
"@myagentroam/agent": "0.11.21",
|
|
41
41
|
"@myagentroam/marctl": "0.11.0",
|
|
42
|
-
"@myagentroam/
|
|
43
|
-
"@myagentroam/
|
|
42
|
+
"@myagentroam/protocol": "0.11.21",
|
|
43
|
+
"@myagentroam/code-navigation": "0.11.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/ws": "^8.18.1"
|