@moxt-ai/mobius 0.0.52 → 0.0.53
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/cli.js +34 -28
- package/dist/cli.js.map +3 -3
- package/dist/index.js +33 -27
- package/dist/index.js.map +3 -3
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +34 -32
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +33 -27
- package/dist/runtime.js.map +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import { mkdir as mkdir5 } from "node:fs/promises";
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "@moxt-ai/mobius",
|
|
14
|
-
version: "0.0.
|
|
14
|
+
version: "0.0.53",
|
|
15
15
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
16
16
|
type: "module",
|
|
17
17
|
bin: {
|
|
@@ -40221,32 +40221,41 @@ async function resolveSessionDirectories(directories, bindingId, directoryId2, a
|
|
|
40221
40221
|
async function discoverAgentSettings(command, config2, directories, sessions, signal) {
|
|
40222
40222
|
const agent = config2.catalog.find(command.agentId);
|
|
40223
40223
|
const cwd = await directories.resolve(config2.bindingId, "default", signal);
|
|
40224
|
-
const
|
|
40224
|
+
const baseSnapshot = await sessions.inspectAgentSettings({
|
|
40225
40225
|
additionalDirectories: [],
|
|
40226
40226
|
agent,
|
|
40227
40227
|
cwd,
|
|
40228
40228
|
signal
|
|
40229
40229
|
});
|
|
40230
|
+
const selectedSnapshot = command.model === void 0 ? baseSnapshot : await sessions.inspectAgentSettings({
|
|
40231
|
+
additionalDirectories: [],
|
|
40232
|
+
agent,
|
|
40233
|
+
cwd,
|
|
40234
|
+
model: command.model,
|
|
40235
|
+
signal
|
|
40236
|
+
});
|
|
40230
40237
|
const adapter = agentSettingsAdapterForAgent(agent.id);
|
|
40231
|
-
const
|
|
40238
|
+
const baseSettings = settingsFromSnapshot(agent, baseSnapshot.configOptions);
|
|
40239
|
+
const settings = settingsFromSnapshot(agent, selectedSnapshot.configOptions);
|
|
40232
40240
|
const modelEffort = await discoverModelEffort(
|
|
40233
40241
|
command,
|
|
40234
40242
|
agent,
|
|
40235
40243
|
adapter.modelEffortResolution,
|
|
40236
|
-
|
|
40244
|
+
baseSnapshot.configOptions,
|
|
40245
|
+
selectedSnapshot.configOptions,
|
|
40237
40246
|
cwd,
|
|
40238
40247
|
sessions,
|
|
40239
40248
|
signal
|
|
40240
40249
|
);
|
|
40241
40250
|
return {
|
|
40242
40251
|
agentId: command.agentId,
|
|
40243
|
-
agentName:
|
|
40244
|
-
agentVersion:
|
|
40252
|
+
agentName: selectedSnapshot.agentName,
|
|
40253
|
+
agentVersion: selectedSnapshot.agentVersion,
|
|
40245
40254
|
kind: AGENT_SETTINGS_DISCOVERED_KIND,
|
|
40246
40255
|
modelEffort,
|
|
40247
40256
|
requestId: command.requestId,
|
|
40248
40257
|
settings,
|
|
40249
|
-
settingsRevision: settingsRevision(agent,
|
|
40258
|
+
settingsRevision: settingsRevision(agent, baseSnapshot.agentVersion, baseSettings, modelEffort)
|
|
40250
40259
|
};
|
|
40251
40260
|
}
|
|
40252
40261
|
function settingFromOption(option) {
|
|
@@ -40296,13 +40305,12 @@ function unavailableModelEffort() {
|
|
|
40296
40305
|
valuesByModel: {}
|
|
40297
40306
|
};
|
|
40298
40307
|
}
|
|
40299
|
-
async function discoverModelEffort(command, agent, resolution, initialOptions, cwd, sessions, signal) {
|
|
40308
|
+
async function discoverModelEffort(command, agent, resolution, initialOptions, selectedOptions, cwd, sessions, signal) {
|
|
40300
40309
|
const model = modelOption(initialOptions);
|
|
40301
|
-
const effort = effortOption(initialOptions);
|
|
40302
40310
|
if (resolution !== AGENT_MODEL_EFFORT_RESOLUTION_COMPLETE && resolution !== AGENT_MODEL_EFFORT_RESOLUTION_ON_MODEL_SELECTION) {
|
|
40303
40311
|
return unavailableModelEffort();
|
|
40304
40312
|
}
|
|
40305
|
-
if (model === void 0 || model.type !== "select" || model.values.length === 0
|
|
40313
|
+
if (model === void 0 || model.type !== "select" || model.values.length === 0) {
|
|
40306
40314
|
return unavailableModelEffort();
|
|
40307
40315
|
}
|
|
40308
40316
|
const inspectModel = async (modelValue) => (await sessions.inspectAgentSettings({
|
|
@@ -40314,9 +40322,13 @@ async function discoverModelEffort(command, agent, resolution, initialOptions, c
|
|
|
40314
40322
|
})).configOptions;
|
|
40315
40323
|
const valuesByModel = {};
|
|
40316
40324
|
if (resolution === "complete") {
|
|
40325
|
+
const effort = effortOption(initialOptions);
|
|
40326
|
+
if (effort === void 0 || effort.type !== "select" || effort.values.length < 2) {
|
|
40327
|
+
return unavailableModelEffort();
|
|
40328
|
+
}
|
|
40317
40329
|
for (const value of model.values) {
|
|
40318
|
-
const
|
|
40319
|
-
valuesByModel[value.value] =
|
|
40330
|
+
const selectedEffort2 = effortOption(await inspectModel(value.value));
|
|
40331
|
+
valuesByModel[value.value] = selectedEffort2?.type === "select" ? selectedEffort2.values : [];
|
|
40320
40332
|
}
|
|
40321
40333
|
return {
|
|
40322
40334
|
effortSettingId: effort.id,
|
|
@@ -40329,18 +40341,24 @@ async function discoverModelEffort(command, agent, resolution, initialOptions, c
|
|
|
40329
40341
|
if (!model.values.some((value) => value.value === command.model)) {
|
|
40330
40342
|
throw new AcpExecutionError("The selected Agent model is unavailable", {}, "invalid_session_configuration");
|
|
40331
40343
|
}
|
|
40332
|
-
const
|
|
40333
|
-
valuesByModel[command.model] =
|
|
40344
|
+
const selectedEffort2 = effortOption(selectedOptions);
|
|
40345
|
+
valuesByModel[command.model] = selectedEffort2?.type === "select" ? selectedEffort2.values : [];
|
|
40334
40346
|
}
|
|
40347
|
+
const selectedEffort = effortOption(selectedOptions);
|
|
40335
40348
|
return {
|
|
40336
|
-
effortSettingId:
|
|
40349
|
+
effortSettingId: selectedEffort?.id ?? "",
|
|
40337
40350
|
modelSettingId: model.id,
|
|
40338
40351
|
resolution: "on_model_selection",
|
|
40339
40352
|
valuesByModel
|
|
40340
40353
|
};
|
|
40341
40354
|
}
|
|
40342
40355
|
function settingsRevision(agent, reportedAgentVersion, settings, modelEffort) {
|
|
40343
|
-
const revisionModelEffort = modelEffort.resolution === AGENT_MODEL_EFFORT_RESOLUTION_COMPLETE ? modelEffort : {
|
|
40356
|
+
const revisionModelEffort = modelEffort.resolution === AGENT_MODEL_EFFORT_RESOLUTION_COMPLETE ? modelEffort : {
|
|
40357
|
+
effortSettingId: "",
|
|
40358
|
+
modelSettingId: modelEffort.modelSettingId,
|
|
40359
|
+
resolution: modelEffort.resolution,
|
|
40360
|
+
valuesByModel: {}
|
|
40361
|
+
};
|
|
40344
40362
|
return createHash5("sha256").update(
|
|
40345
40363
|
JSON.stringify({
|
|
40346
40364
|
adapterVersion: agent.adapterVersion,
|
|
@@ -40712,17 +40730,6 @@ function assertSessionConfigurationSchema(options, selections) {
|
|
|
40712
40730
|
}
|
|
40713
40731
|
}
|
|
40714
40732
|
}
|
|
40715
|
-
function assertSessionConfigurationCoverage(options, selections) {
|
|
40716
|
-
const selectionsById = new Map(selections.map((selection) => [selection.configId, selection]));
|
|
40717
|
-
if (selectionsById.size !== selections.length) {
|
|
40718
|
-
throw invalidSessionConfiguration("The Turn configuration contains duplicate Agent settings");
|
|
40719
|
-
}
|
|
40720
|
-
for (const option of options) {
|
|
40721
|
-
if (!selectionsById.has(option.id)) {
|
|
40722
|
-
throw invalidSessionConfiguration(`The Turn configuration does not match Agent setting ${option.id}`);
|
|
40723
|
-
}
|
|
40724
|
-
}
|
|
40725
|
-
}
|
|
40726
40733
|
function sessionConfigurationSelectionIsAvailable(option, selection) {
|
|
40727
40734
|
if (option.type !== selection.valueType) {
|
|
40728
40735
|
return false;
|
|
@@ -40851,7 +40858,6 @@ async function applySessionConfigurationSelection(sessions, audit, options, sele
|
|
|
40851
40858
|
});
|
|
40852
40859
|
}
|
|
40853
40860
|
async function applyCompleteSessionConfiguration(sessions, audit, initialOptions, selections, agent, cwd, additionalDirectories, commandId, sessionId, signal) {
|
|
40854
|
-
assertSessionConfigurationCoverage(initialOptions, selections);
|
|
40855
40861
|
let options = initialOptions;
|
|
40856
40862
|
const orderedSelections = selections.toSorted((left, right) => {
|
|
40857
40863
|
const priority = sessionConfigurationPriority(left, initialOptions) - sessionConfigurationPriority(right, initialOptions);
|