@moxt-ai/mobius 0.0.37 → 0.0.39

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.
@@ -1 +1 @@
1
- {"version":3,"file":"fixed-installation-executor.d.ts","sourceRoot":"","sources":["../../src/agent-installation/fixed-installation-executor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAGH,KAAK,uBAAuB,EAC/B,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAEH,KAAK,iBAAiB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE/F,OAAO,EACH,KAAK,uBAAuB,EAG/B,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,gCAAgC;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACnC;AAsED,qBAAa,yBAA0B,YAAW,oBAAoB;;IASlE,YACI,OAAO,EAAE,gCAAgC,EACzC,cAAc,GAAE,SAAS,uBAAuB,EAAwC,EACxF,gBAAgB,CAAC,EAAE,uBAAuB,EAgB7C;IAED,QAAQ,CAAC,OAAO,YACH,MAAM,aACJ,MAAM,UACT,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,UAChD,WAAW,KACpB,OAAO,CAAC,IAAI,CAAC,CAmId;CACL"}
1
+ {"version":3,"file":"fixed-installation-executor.d.ts","sourceRoot":"","sources":["../../src/agent-installation/fixed-installation-executor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAGH,KAAK,uBAAuB,EAC/B,MAAM,yCAAyC,CAAC;AAIjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE/F,OAAO,EACH,KAAK,uBAAuB,EAG/B,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,gCAAgC;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACnC;AAsED,qBAAa,yBAA0B,YAAW,oBAAoB;;IASlE,YACI,OAAO,EAAE,gCAAgC,EACzC,cAAc,GAAE,SAAS,uBAAuB,EAAwC,EACxF,gBAAgB,CAAC,EAAE,uBAAuB,EAgB7C;IAED,QAAQ,CAAC,OAAO,YACH,MAAM,aACJ,MAAM,UACT,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,UAChD,WAAW,KACpB,OAAO,CAAC,IAAI,CAAC,CA8Hd;CACL"}
@@ -1,11 +1,10 @@
1
1
  import { realpathSync, statSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
- import { AvailableAgent } from "../agent-catalog/agent-discovery.js";
3
+ import { AvailableAgent, MissingAgent } from "../agent-catalog/agent-discovery.js";
4
4
  import { BridgedAcpAgentDefinition, DirectAcpAgentDefinition, } from "../agent-catalog/agent-specification.js";
5
5
  import { supportedLocalAgentSpecifications } from "../agent-catalog/agents/supported-agent-specifications.js";
6
6
  import { discoverLocalAgentInventory } from "../agent-catalog/discover-local-agents.js";
7
7
  import { findVerifiedAgentExecutable, resolveAdapterExecutable } from "../agent-catalog/executable-discovery.js";
8
- import { AgentIntegrationDefinition, MissingAgentDefinition, } from "../agent-catalog/local-agent.js";
9
8
  import { InstallationManagerError } from "./agent-installation-manager.js";
10
9
  import { ManagedAdapterInstallError, ManagedAdapterInstaller, } from "./managed-adapter-installer.js";
11
10
  function findSpecification(specifications, agentId) {
@@ -109,13 +108,10 @@ export class FixedInstallationExecutor {
109
108
  if (alreadyReady instanceof AvailableAgent) {
110
109
  return;
111
110
  }
112
- const candidate = initialInventory.installable.find((agent) => agent.id === agentId);
113
- if (candidate instanceof MissingAgentDefinition) {
111
+ const initialDiscovery = initialInventory.unavailable.find((candidate) => candidate.specification.id === agentId);
112
+ if (initialDiscovery instanceof MissingAgent) {
114
113
  throw new InstallationManagerError("agent_not_installed", `Install ${specification.label} on this machine, then try installing the integration again.`);
115
114
  }
116
- if (!(candidate instanceof AgentIntegrationDefinition)) {
117
- throw new InstallationManagerError("agent_verification_failed", "The local Agent discovery result is unavailable");
118
- }
119
115
  const verifiedAgent = await findVerifiedAgentExecutable(specification, discoveryOptions);
120
116
  if (verifiedAgent === null) {
121
117
  throw new InstallationManagerError("agent_not_installed", `Install ${specification.label} on this machine, then try installing the integration again.`);
@@ -1 +1 @@
1
- {"version":3,"file":"fixed-installation-executor.js","sourceRoot":"","sources":["../../src/agent-installation/fixed-installation-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,cAAc,EAA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,EAAE,KAAK,OAAO,CAAC,CAAC;gBACtG,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;oBAC5B,MAAM,IAAI,wBAAwB,CAC9B,2BAA2B,EAC3B,uDAAuD,CAC1D,CAAC;gBACN,CAAC;gBACD,IACI,CAAC,gBAAgB;oBACjB,aAAa,YAAY,yBAAyB;oBAClD,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,uBAAuB,CAAC,KAAK,SAAS;oBACtE,0BAA0B,CAAC,WAAW,CAAC,IAAI,CAAC,EAC9C,CAAC;oBACC,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;oBACnC,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;oBACtE,gBAAgB,GAAG,IAAI,CAAC;oBACxB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,SAAS,EAAE,OAAO,EAAE;wBAC7D,OAAO,EAAE,aAAa,CAAC,cAAc;qBACxC,CAAC,CAAC;oBACH,SAAS;gBACb,CAAC;gBACD,MAAM,IAAI,wBAAwB,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;YAC9E,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,CAAC,cAAc,EAAE,CAAC;YAC5B,CAAC;YACD,MAAM,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACL,CAAC,CAAC;CACL"}
1
+ {"version":3,"file":"fixed-installation-executor.js","sourceRoot":"","sources":["../../src/agent-installation/fixed-installation-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,M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AY,yBAAyB;oBAClD,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,uBAAuB,CAAC,KAAK,SAAS;oBACtE,0BAA0B,CAAC,WAAW,CAAC,IAAI,CAAC,EAC9C,CAAC;oBACC,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;oBACnC,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;oBACtE,gBAAgB,GAAG,IAAI,CAAC;oBACxB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,SAAS,EAAE,OAAO,EAAE;wBAC7D,OAAO,EAAE,aAAa,CAAC,cAAc;qBACxC,CAAC,CAAC;oBACH,SAAS;gBACb,CAAC;gBACD,MAAM,IAAI,wBAAwB,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;YAC9E,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,CAAC,cAAc,EAAE,CAAC;YAC5B,CAAC;YACD,MAAM,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACL,CAAC,CAAC;CACL"}
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.37",
14
+ version: "0.0.39",
15
15
  description: "Mobius CLI for pairing and running local AI agent services.",
16
16
  type: "module",
17
17
  bin: {
@@ -1365,6 +1365,7 @@ var ClaudeCodeAgentSpecification = class extends BridgedAcpAgentDefinition {
1365
1365
 
1366
1366
  // src/agent-catalog/agents/codex-agent.ts
1367
1367
  var CodexAgentSpecification = class extends BridgedAcpAgentDefinition {
1368
+ versionProbeTimeoutMilliseconds = 1e4;
1368
1369
  adapterEnvironmentVariable = "CODEX_PATH";
1369
1370
  adapterOverrideVariable = "MOBIUS_CODEX_ACP_PATH";
1370
1371
  adapterPackageDefinition = new ManagedNpmPackageDefinition(
@@ -22798,6 +22799,9 @@ var AGENT_INSTALL_PROGRESS_KIND = "agent.integration.install.progress";
22798
22799
  var AGENT_INSTALL_COMPLETED_KIND = "agent.integration.install.completed";
22799
22800
  var AGENT_INSTALL_FAILED_KIND = "agent.integration.install.failed";
22800
22801
  var AGENT_INSTALL_CANCELLED_KIND = "agent.integration.install.cancelled";
22802
+ var AGENT_SETTINGS_DISCOVER_KIND = "agent.settings.discover";
22803
+ var AGENT_SETTINGS_DISCOVERED_KIND = "agent.settings.discovered";
22804
+ var AGENT_SETTINGS_DISCOVERY_FAILED_KIND = "agent.settings.discovery.failed";
22801
22805
  var IDENTIFIER_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
22802
22806
  var DIRECTORY_IDENTIFIER_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/;
22803
22807
  var IDENTIFIER = external_exports.string().min(1).max(128).regex(IDENTIFIER_PATTERN);
@@ -22826,6 +22830,28 @@ var sessionConfigOptionSchema = external_exports.strictObject({
22826
22830
  values: external_exports.array(configValueSchema).max(500).readonly()
22827
22831
  }).readonly();
22828
22832
  var sessionConfigOptionsSchema = external_exports.array(sessionConfigOptionSchema).max(100).readonly();
22833
+ var agentSettingsDiscoverCommandSchema = external_exports.strictObject({
22834
+ additionalDirectoryIds: external_exports.array(DIRECTORY_IDENTIFIER).max(16).readonly(),
22835
+ agentId: IDENTIFIER,
22836
+ directoryId: DIRECTORY_IDENTIFIER,
22837
+ kind: external_exports.literal(AGENT_SETTINGS_DISCOVER_KIND),
22838
+ requestId: IDENTIFIER
22839
+ }).readonly();
22840
+ var agentSettingsDiscoveredEventSchema = external_exports.strictObject({
22841
+ agentId: IDENTIFIER,
22842
+ agentName: external_exports.string().max(255),
22843
+ agentVersion: external_exports.string().max(128),
22844
+ configOptions: sessionConfigOptionsSchema,
22845
+ directoryId: DIRECTORY_IDENTIFIER,
22846
+ kind: external_exports.literal(AGENT_SETTINGS_DISCOVERED_KIND),
22847
+ requestId: IDENTIFIER
22848
+ }).readonly();
22849
+ var agentSettingsDiscoveryFailedEventSchema = external_exports.strictObject({
22850
+ code: IDENTIFIER,
22851
+ kind: external_exports.literal(AGENT_SETTINGS_DISCOVERY_FAILED_KIND),
22852
+ message: external_exports.string().min(1).max(500),
22853
+ requestId: IDENTIFIER
22854
+ }).readonly();
22829
22855
  var sessionConfigurationSelectionSchema = external_exports.strictObject({
22830
22856
  booleanValue: external_exports.boolean(),
22831
22857
  configId: IDENTIFIER,
@@ -22962,6 +22988,7 @@ var sessionPrepareCommandSchema = external_exports.strictObject({
22962
22988
  }).readonly().optional(),
22963
22989
  kind: external_exports.literal(SESSION_PREPARE_KIND),
22964
22990
  requestId: IDENTIFIER,
22991
+ /** @deprecated Reserved for the legacy Bot Agent-configuration endpoint. */
22965
22992
  transient: external_exports.boolean().optional()
22966
22993
  }).readonly();
22967
22994
  var runtimeTimingsSchema = external_exports.array(
@@ -23175,6 +23202,9 @@ var decodePromptImagesValue = (value) => decodeValue(value, external_exports.arr
23175
23202
  var decodePromptResourcesValue = (value) => decodeValue(value, external_exports.array(promptResourceSchema).max(16).readonly());
23176
23203
  var decodeSessionConfigurationSelections = (value) => decodeValue(value, sessionConfigurationSelectionsSchema);
23177
23204
  var encode3 = (message, schema) => JSON.stringify(decodeValue(message, schema));
23205
+ var decodeAgentSettingsDiscoverCommand = (encoded) => decode3(encoded, agentSettingsDiscoverCommandSchema);
23206
+ var encodeAgentSettingsDiscoveredEvent = (message) => encode3(message, agentSettingsDiscoveredEventSchema);
23207
+ var encodeAgentSettingsDiscoveryFailedEvent = (message) => encode3(message, agentSettingsDiscoveryFailedEventSchema);
23178
23208
  var decodeWorkspaceListCommand = (encoded) => decode3(encoded, workspaceListCommandSchema);
23179
23209
  var encodeWorkspaceEntriesEvent = (message) => encode3(message, workspaceEntriesEventSchema);
23180
23210
  var decodeSessionPrepareCommand = (encoded) => decode3(encoded, sessionPrepareCommandSchema);
@@ -24653,6 +24683,7 @@ async function claimPairing(options, defaultWorkspace, localAgents, installableA
24653
24683
  const agents = localAgents.map((agent) => ({
24654
24684
  agentPath: agent.agentIdentity.requestedPath,
24655
24685
  agentVersion: agent.agentVersion,
24686
+ agentSettingsDiscovery: true,
24656
24687
  botSessionConfiguration: true,
24657
24688
  capabilities: agent.capabilities,
24658
24689
  id: agent.id,
@@ -34298,6 +34329,16 @@ var AcpPreparedSession = class {
34298
34329
  this.restored = restored;
34299
34330
  }
34300
34331
  };
34332
+ var AcpAgentSettingsSnapshot = class {
34333
+ agentName;
34334
+ agentVersion;
34335
+ configOptions;
34336
+ constructor(agentName, agentVersion, configOptions) {
34337
+ this.agentName = agentName;
34338
+ this.agentVersion = agentVersion;
34339
+ this.configOptions = configOptions;
34340
+ }
34341
+ };
34301
34342
  var AcpExecutionError = class extends Error {
34302
34343
  code;
34303
34344
  constructor(message, options = {}, code = "acp_execution_failed") {
@@ -35921,6 +35962,7 @@ var AcpProcessSession = class _AcpProcessSession {
35921
35962
  };
35922
35963
  var AcpSessionManager = class {
35923
35964
  #activeCommandIds = /* @__PURE__ */ new Map();
35965
+ #agentSettingsObserver = new NullAcpSessionObserver();
35924
35966
  #nativeOperations = /* @__PURE__ */ new Set();
35925
35967
  #nativeBrowserObserver = new NullAcpSessionObserver();
35926
35968
  #nativeBrowserPreparing = /* @__PURE__ */ new Map();
@@ -36115,9 +36157,29 @@ var AcpSessionManager = class {
36115
36157
  return runtime.prepared();
36116
36158
  };
36117
36159
  /**
36118
- * Opens a short-lived ACP session only to read the Agent's authoritative
36119
- * configuration options. The runtime and any persisted native-session
36120
- * record are released before this method resolves.
36160
+ * Opens a short-lived native ACP session only to read the local Agent's
36161
+ * authoritative settings. Its identity and store are private to this
36162
+ * operation and never become a Mobius Session.
36163
+ */
36164
+ inspectAgentSettings = async (options) => {
36165
+ const runtime = await AcpProcessSession.start(
36166
+ {
36167
+ ...options,
36168
+ sessionId: `agent-settings-${crypto.randomUUID()}`
36169
+ },
36170
+ () => this.#agentSettingsObserver,
36171
+ new MemoryAcpSessionStore()
36172
+ );
36173
+ try {
36174
+ const prepared = runtime.prepared();
36175
+ return new AcpAgentSettingsSnapshot(prepared.agentName, prepared.agentVersion, prepared.configOptions);
36176
+ } finally {
36177
+ await runtime.close();
36178
+ }
36179
+ };
36180
+ /**
36181
+ * @deprecated Retained for the Bot-scoped legacy Agent-configuration API.
36182
+ * Use inspectAgentSettings for Agent-scoped settings discovery.
36121
36183
  */
36122
36184
  inspectSession = async (options, metrics = unmeasuredOperationMetrics) => {
36123
36185
  if (this.#preparing.has(options.sessionId) || this.#sessions.has(options.sessionId)) {
@@ -36650,6 +36712,7 @@ async function publishAgentCatalog(config2, signal) {
36650
36712
  agents: catalog.agents.map((agent) => ({
36651
36713
  agentPath: agent.agentIdentity.requestedPath,
36652
36714
  agentVersion: agent.agentVersion,
36715
+ agentSettingsDiscovery: true,
36653
36716
  botSessionConfiguration: true,
36654
36717
  capabilities: agent.capabilities,
36655
36718
  id: agent.id,
@@ -37039,23 +37102,19 @@ var FixedInstallationExecutor = class {
37039
37102
  this.#catalog.transition(previous2.agents, previous2.installableAgents);
37040
37103
  throw error62;
37041
37104
  }
37042
- const alreadyReady = initialInventory.available.find((candidate2) => candidate2.specification.id === agentId);
37105
+ const alreadyReady = initialInventory.available.find((candidate) => candidate.specification.id === agentId);
37043
37106
  if (alreadyReady instanceof AvailableAgent) {
37044
37107
  return;
37045
37108
  }
37046
- const candidate = initialInventory.installable.find((agent2) => agent2.id === agentId);
37047
- if (candidate instanceof MissingAgentDefinition) {
37109
+ const initialDiscovery = initialInventory.unavailable.find(
37110
+ (candidate) => candidate.specification.id === agentId
37111
+ );
37112
+ if (initialDiscovery instanceof MissingAgent) {
37048
37113
  throw new InstallationManagerError(
37049
37114
  "agent_not_installed",
37050
37115
  `Install ${specification.label} on this machine, then try installing the integration again.`
37051
37116
  );
37052
37117
  }
37053
- if (!(candidate instanceof AgentIntegrationDefinition)) {
37054
- throw new InstallationManagerError(
37055
- "agent_verification_failed",
37056
- "The local Agent discovery result is unavailable"
37057
- );
37058
- }
37059
37118
  const verifiedAgent = await findVerifiedAgentExecutable(specification, discoveryOptions);
37060
37119
  if (verifiedAgent === null) {
37061
37120
  throw new InstallationManagerError(
@@ -37097,7 +37156,7 @@ var FixedInstallationExecutor = class {
37097
37156
  signal,
37098
37157
  specifications: this.#specifications
37099
37158
  });
37100
- const verified = inventory.available.find((candidate2) => candidate2.specification.id === agentId);
37159
+ const verified = inventory.available.find((candidate) => candidate.specification.id === agentId);
37101
37160
  if (verified instanceof AvailableAgent) {
37102
37161
  this.#audit.record("agent_installation_acp_verified", requestId, agentId, {
37103
37162
  adapterVersion: verified.agent.adapterVersion,
@@ -37113,7 +37172,7 @@ var FixedInstallationExecutor = class {
37113
37172
  }
37114
37173
  return;
37115
37174
  }
37116
- const unavailable = inventory.unavailable.find((candidate2) => candidate2.specification.id === agentId);
37175
+ const unavailable = inventory.unavailable.find((candidate) => candidate.specification.id === agentId);
37117
37176
  if (unavailable === void 0) {
37118
37177
  throw new InstallationManagerError(
37119
37178
  "agent_verification_failed",
@@ -40318,6 +40377,31 @@ async function resolveSessionDirectories(directories, bindingId, directoryId2, a
40318
40377
  }
40319
40378
  return new ResolvedSessionDirectories(cwd, additionalDirectories, additionalDirectoryEntries);
40320
40379
  }
40380
+ async function discoverAgentSettings(command, config2, directories, sessions, signal) {
40381
+ const resolved = await resolveSessionDirectories(
40382
+ directories,
40383
+ config2.bindingId,
40384
+ command.directoryId,
40385
+ command.additionalDirectoryIds,
40386
+ signal
40387
+ );
40388
+ const agent = config2.catalog.find(command.agentId);
40389
+ const snapshot = await sessions.inspectAgentSettings({
40390
+ additionalDirectories: resolved.additionalDirectories,
40391
+ agent,
40392
+ cwd: resolved.cwd,
40393
+ signal
40394
+ });
40395
+ return {
40396
+ agentId: command.agentId,
40397
+ agentName: snapshot.agentName,
40398
+ agentVersion: snapshot.agentVersion,
40399
+ configOptions: snapshot.configOptions,
40400
+ directoryId: command.directoryId,
40401
+ kind: AGENT_SETTINGS_DISCOVERED_KIND,
40402
+ requestId: command.requestId
40403
+ };
40404
+ }
40321
40405
  async function executeWorkspaceList(socket, command, directories, audit, signal) {
40322
40406
  try {
40323
40407
  const listing = await directories.list(command.bindingId, command.directoryId, signal);
@@ -40835,6 +40919,22 @@ async function publishAgentCatalogUntilAvailable(config2, diagnostics, signal, t
40835
40919
  }
40836
40920
  }
40837
40921
  }
40922
+ async function installDetectedAgentIntegrations(config2, installations, signal) {
40923
+ for (const agent of config2.catalog.read().installableAgents) {
40924
+ if (!(agent instanceof AgentIntegrationDefinition)) {
40925
+ continue;
40926
+ }
40927
+ signal.throwIfAborted();
40928
+ await installations.request(
40929
+ {
40930
+ agentId: agent.id,
40931
+ kind: AGENT_INSTALL_REQUEST_KIND,
40932
+ requestId: `automatic-integration-${randomUUID6()}`
40933
+ },
40934
+ signal
40935
+ );
40936
+ }
40937
+ }
40838
40938
  async function runRelayConnection(config2, directories, audit, sessions, installations, installationObserver, nativeSessions, outbox, publisher, grants, contexts, applicator, ipc, activeTurns, activeAttemptIds, connectionEpoch, diagnostics, onConnected, signal, timer) {
40839
40939
  const relayUrl = new URL(config2.relayUrl);
40840
40940
  relayUrl.searchParams.set("deliveryReceipts", "1");
@@ -40842,10 +40942,11 @@ async function runRelayConnection(config2, directories, audit, sessions, install
40842
40942
  const socket = await connectRelay(relayUrl, signal);
40843
40943
  const reconnectingTurns = [...activeTurns.values()];
40844
40944
  diagnostics.connectionOpened(connectionEpoch);
40845
- onConnected();
40846
40945
  const connectionController = new AbortController();
40847
40946
  const nativeRequests = /* @__PURE__ */ new Map();
40947
+ const agentSettingsDiscoveries = /* @__PURE__ */ new Map();
40848
40948
  installationObserver.connect(socket);
40949
+ onConnected();
40849
40950
  try {
40850
40951
  await new Promise((resolve5, reject) => {
40851
40952
  let finished = false;
@@ -41272,6 +41373,104 @@ async function runRelayConnection(config2, directories, audit, sessions, install
41272
41373
  }
41273
41374
  return;
41274
41375
  }
41376
+ if (kind === AGENT_SETTINGS_DISCOVER_KIND) {
41377
+ const command2 = decodeAgentSettingsDiscoverCommand(encoded);
41378
+ const existing = [...agentSettingsDiscoveries.values()].find(
41379
+ (request) => request.agentId === command2.agentId && !request.controller.signal.aborted
41380
+ );
41381
+ if (agentSettingsDiscoveries.has(command2.requestId) || existing !== void 0) {
41382
+ if (socket.readyState === WebSocket2.OPEN) {
41383
+ send(
41384
+ socket,
41385
+ encodeAgentSettingsDiscoveryFailedEvent({
41386
+ code: "agent_settings_discovery_busy",
41387
+ kind: AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
41388
+ message: "Another settings discovery is already running for this Agent",
41389
+ requestId: command2.requestId
41390
+ })
41391
+ );
41392
+ }
41393
+ return;
41394
+ }
41395
+ if (agentSettingsDiscoveries.size >= 4) {
41396
+ if (socket.readyState === WebSocket2.OPEN) {
41397
+ send(
41398
+ socket,
41399
+ encodeAgentSettingsDiscoveryFailedEvent({
41400
+ code: "agent_settings_discovery_busy",
41401
+ kind: AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
41402
+ message: "Too many Agent settings discoveries are running",
41403
+ requestId: command2.requestId
41404
+ })
41405
+ );
41406
+ }
41407
+ return;
41408
+ }
41409
+ const controller = new AbortController();
41410
+ const operationSignal = AbortSignal.any([connectionController.signal, controller.signal]);
41411
+ const timeout = timer.schedule(
41412
+ () => controller.abort(
41413
+ new AcpExecutionError(
41414
+ "Agent settings discovery timed out",
41415
+ {},
41416
+ "agent_settings_discovery_timeout"
41417
+ )
41418
+ ),
41419
+ 9e4
41420
+ );
41421
+ const completion = (async () => {
41422
+ try {
41423
+ const result = await discoverAgentSettings(
41424
+ command2,
41425
+ config2,
41426
+ directories,
41427
+ sessions,
41428
+ operationSignal
41429
+ );
41430
+ audit.record({
41431
+ commandId: command2.requestId,
41432
+ details: { agentId: command2.agentId, directoryId: command2.directoryId },
41433
+ event: "agent_settings_discovered",
41434
+ sessionId: `agent-settings:${command2.agentId}`
41435
+ });
41436
+ if (socket.readyState === WebSocket2.OPEN) {
41437
+ send(socket, encodeAgentSettingsDiscoveredEvent(result));
41438
+ }
41439
+ } catch (error62) {
41440
+ const failure2 = operationSignal.aborted ? controller.signal.reason ?? new AcpExecutionError(
41441
+ "Agent settings discovery cancelled",
41442
+ {},
41443
+ "agent_settings_discovery_cancelled"
41444
+ ) : error62;
41445
+ audit.record({
41446
+ commandId: command2.requestId,
41447
+ details: { agentId: command2.agentId, code: operationErrorCode(failure2) },
41448
+ event: "agent_settings_discovery_failed",
41449
+ sessionId: `agent-settings:${command2.agentId}`
41450
+ });
41451
+ if (socket.readyState === WebSocket2.OPEN) {
41452
+ send(
41453
+ socket,
41454
+ encodeAgentSettingsDiscoveryFailedEvent({
41455
+ code: operationErrorCode(failure2),
41456
+ kind: AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
41457
+ message: operationErrorMessage(failure2),
41458
+ requestId: command2.requestId
41459
+ })
41460
+ );
41461
+ }
41462
+ } finally {
41463
+ timeout.cancel();
41464
+ agentSettingsDiscoveries.delete(command2.requestId);
41465
+ }
41466
+ })();
41467
+ agentSettingsDiscoveries.set(command2.requestId, {
41468
+ agentId: command2.agentId,
41469
+ completion,
41470
+ controller
41471
+ });
41472
+ return;
41473
+ }
41275
41474
  if (kind === NATIVE_SESSION_REQUEST_KIND) {
41276
41475
  const command2 = decodeNativeSessionCommand(encoded);
41277
41476
  const previous2 = [...nativeRequests.values()].filter(
@@ -41656,7 +41855,10 @@ async function runRelayConnection(config2, directories, audit, sessions, install
41656
41855
  });
41657
41856
  } finally {
41658
41857
  connectionController.abort();
41659
- await Promise.all([...nativeRequests.values()].map((request) => request.completion));
41858
+ await Promise.all([
41859
+ ...[...nativeRequests.values()].map((request) => request.completion),
41860
+ ...[...agentSettingsDiscoveries.values()].map((request) => request.completion)
41861
+ ]);
41660
41862
  }
41661
41863
  }
41662
41864
  async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
@@ -41700,7 +41902,31 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
41700
41902
  installationAudit
41701
41903
  );
41702
41904
  let connectionEpoch = 0;
41905
+ let automaticIntegrationProvisioningStarted = false;
41906
+ let automaticIntegrationProvisioning = Promise.resolve();
41703
41907
  let connectionAnnounced = false;
41908
+ let catalogPublished = false;
41909
+ let readinessAnnounced = false;
41910
+ const startAutomaticIntegrationProvisioning = () => {
41911
+ if (!connectionAnnounced || !catalogPublished || automaticIntegrationProvisioningStarted) {
41912
+ return;
41913
+ }
41914
+ automaticIntegrationProvisioningStarted = true;
41915
+ automaticIntegrationProvisioning = installDetectedAgentIntegrations(config2, installations, signal).catch(
41916
+ (error62) => {
41917
+ if (!signal.aborted) {
41918
+ console.error("Mobius daemon could not automatically install detected Agent integrations", error62);
41919
+ }
41920
+ }
41921
+ );
41922
+ };
41923
+ const announceReadiness = () => {
41924
+ if (!connectionAnnounced || !catalogPublished || readinessAnnounced) {
41925
+ return;
41926
+ }
41927
+ readinessAnnounced = true;
41928
+ process.stdout.write("Mobius daemon is ready for Agent requests.\n");
41929
+ };
41704
41930
  const announceConnection = () => {
41705
41931
  if (connectionAnnounced) {
41706
41932
  return;
@@ -41714,8 +41940,18 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
41714
41940
 
41715
41941
  `
41716
41942
  );
41943
+ announceReadiness();
41944
+ startAutomaticIntegrationProvisioning();
41717
41945
  };
41718
41946
  const catalogPublication = publishAgentCatalogUntilAvailable(config2, diagnostics, signal, timer);
41947
+ void catalogPublication.then(() => {
41948
+ if (signal.aborted) {
41949
+ return;
41950
+ }
41951
+ catalogPublished = true;
41952
+ announceReadiness();
41953
+ startAutomaticIntegrationProvisioning();
41954
+ });
41719
41955
  try {
41720
41956
  await ipc.listen(signal);
41721
41957
  while (!signal.aborted) {
@@ -41761,24 +41997,28 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
41761
41997
  await catalogPublication;
41762
41998
  } finally {
41763
41999
  try {
41764
- await installations.close();
42000
+ await automaticIntegrationProvisioning;
41765
42001
  } finally {
41766
42002
  try {
41767
- await ipc.close();
42003
+ await installations.close();
41768
42004
  } finally {
41769
42005
  try {
41770
- await sessions.close();
42006
+ await ipc.close();
41771
42007
  } finally {
41772
42008
  try {
41773
- sessionStore.close();
42009
+ await sessions.close();
41774
42010
  } finally {
41775
42011
  try {
41776
- grants.close();
42012
+ sessionStore.close();
41777
42013
  } finally {
41778
42014
  try {
41779
- publisher.close();
42015
+ grants.close();
41780
42016
  } finally {
41781
- outbox.close();
42017
+ try {
42018
+ publisher.close();
42019
+ } finally {
42020
+ outbox.close();
42021
+ }
41782
42022
  }
41783
42023
  }
41784
42024
  }