@moxt-ai/mobius 0.0.82 → 0.0.89
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/acp/session-config/session-config-registry.d.ts +1 -1
- package/dist/acp/session-config/session-config-registry.d.ts.map +1 -1
- package/dist/acp/session-config/session-config-registry.js +2 -3
- package/dist/acp/session-config/session-config-registry.js.map +1 -1
- package/dist/agent-catalog/agent-specification.d.ts +2 -0
- package/dist/agent-catalog/agent-specification.d.ts.map +1 -1
- package/dist/agent-catalog/agent-specification.js +2 -0
- package/dist/agent-catalog/agent-specification.js.map +1 -1
- package/dist/agent-catalog/agent-version.d.ts +3 -0
- package/dist/agent-catalog/agent-version.d.ts.map +1 -0
- package/dist/agent-catalog/agent-version.js +54 -0
- package/dist/agent-catalog/agent-version.js.map +1 -0
- package/dist/agent-catalog/agents/claude-code-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/claude-code-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/claude-code-agent.js +2 -0
- package/dist/agent-catalog/agents/claude-code-agent.js.map +1 -1
- package/dist/agent-catalog/agents/codex-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/codex-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/codex-agent.js +2 -0
- package/dist/agent-catalog/agents/codex-agent.js.map +1 -1
- package/dist/agent-catalog/agents/copilot-cli-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/copilot-cli-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/copilot-cli-agent.js +2 -0
- package/dist/agent-catalog/agents/copilot-cli-agent.js.map +1 -1
- package/dist/agent-catalog/agents/cursor-cli-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/cursor-cli-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/cursor-cli-agent.js +2 -0
- package/dist/agent-catalog/agents/cursor-cli-agent.js.map +1 -1
- package/dist/agent-catalog/agents/deepseek-harness-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/deepseek-harness-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/deepseek-harness-agent.js +2 -0
- package/dist/agent-catalog/agents/deepseek-harness-agent.js.map +1 -1
- package/dist/agent-catalog/agents/gemini-cli-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/gemini-cli-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/gemini-cli-agent.js +2 -0
- package/dist/agent-catalog/agents/gemini-cli-agent.js.map +1 -1
- package/dist/agent-catalog/agents/grok-build-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/grok-build-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/grok-build-agent.js +2 -0
- package/dist/agent-catalog/agents/grok-build-agent.js.map +1 -1
- package/dist/agent-catalog/agents/hermes-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/hermes-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/hermes-agent.js +2 -0
- package/dist/agent-catalog/agents/hermes-agent.js.map +1 -1
- package/dist/agent-catalog/agents/oh-my-pi-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/oh-my-pi-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/oh-my-pi-agent.js +2 -0
- package/dist/agent-catalog/agents/oh-my-pi-agent.js.map +1 -1
- package/dist/agent-catalog/agents/opencode-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/opencode-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/opencode-agent.js +2 -0
- package/dist/agent-catalog/agents/opencode-agent.js.map +1 -1
- package/dist/agent-catalog/agents/pi-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/pi-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/pi-agent.js +2 -0
- package/dist/agent-catalog/agents/pi-agent.js.map +1 -1
- package/dist/agent-catalog/agents/workbuddy-agent.d.ts +2 -0
- package/dist/agent-catalog/agents/workbuddy-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/workbuddy-agent.js +2 -0
- package/dist/agent-catalog/agents/workbuddy-agent.js.map +1 -1
- package/dist/agent-catalog/discover-agent.d.ts.map +1 -1
- package/dist/agent-catalog/discover-agent.js +9 -0
- package/dist/agent-catalog/discover-agent.js.map +1 -1
- package/dist/agent-installation/deepseek-managed-package.d.ts.map +1 -1
- package/dist/agent-installation/deepseek-managed-package.js +3 -2
- package/dist/agent-installation/deepseek-managed-package.js.map +1 -1
- package/dist/cli.js +1151 -536
- package/dist/cli.js.map +4 -4
- package/dist/config.d.ts +2 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -10
- package/dist/config.js.map +1 -1
- package/dist/daemon-manager.d.ts +51 -0
- package/dist/daemon-manager.d.ts.map +1 -0
- package/dist/daemon-manager.js +589 -0
- package/dist/daemon-manager.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +336 -431
- package/dist/index.js.map +4 -4
- package/dist/pairing/pair-local-machine.d.ts.map +1 -1
- package/dist/pairing/pair-local-machine.js +26 -40
- package/dist/pairing/pair-local-machine.js.map +1 -1
- package/dist/relay-connection/session-event-outbox.d.ts.map +1 -1
- package/dist/relay-connection/session-event-outbox.js +0 -62
- package/dist/relay-connection/session-event-outbox.js.map +1 -1
- package/dist/run-daemon.d.ts +1 -0
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +16 -4
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +317 -383
- package/dist/runtime.js.map +4 -4
- package/dist/storage/runtime-installation-store.d.ts +14 -5
- package/dist/storage/runtime-installation-store.d.ts.map +1 -1
- package/dist/storage/runtime-installation-store.js +136 -89
- package/dist/storage/runtime-installation-store.js.map +1 -1
- package/package.json +1 -1
- package/dist/acp/session-config/grok-build-session-config.d.ts +0 -10
- package/dist/acp/session-config/grok-build-session-config.d.ts.map +0 -1
- package/dist/acp/session-config/grok-build-session-config.js +0 -197
- package/dist/acp/session-config/grok-build-session-config.js.map +0 -1
package/dist/runtime.js
CHANGED
|
@@ -1181,6 +1181,8 @@ function normalizeVersionOutput(output2) {
|
|
|
1181
1181
|
var VERSION_PROBE_TIMEOUT_MILLISECONDS = 3e4;
|
|
1182
1182
|
var ACP_PROBE_TIMEOUT_MILLISECONDS = 6e4;
|
|
1183
1183
|
var LocalAgentSpecification = class {
|
|
1184
|
+
minimumSupportedAgentVersion = "0.0.0";
|
|
1185
|
+
maximumTestedAgentVersion = "0.0.0";
|
|
1184
1186
|
acpProbeTimeoutMilliseconds = ACP_PROBE_TIMEOUT_MILLISECONDS;
|
|
1185
1187
|
authenticationCommand = () => "";
|
|
1186
1188
|
adapterVersionArguments = ["--version"];
|
|
@@ -1263,6 +1265,8 @@ var ClaudeCodeAgentSpecification = class extends BridgedAcpAgentDefinition {
|
|
|
1263
1265
|
agentOverrideVariable = "MOBIUS_CLAUDE_PATH";
|
|
1264
1266
|
id = "claude";
|
|
1265
1267
|
label = "Claude Code";
|
|
1268
|
+
minimumSupportedAgentVersion = "2.1.273";
|
|
1269
|
+
maximumTestedAgentVersion = "2.1.273";
|
|
1266
1270
|
managedAdapterExecutablePath = [
|
|
1267
1271
|
"adapters",
|
|
1268
1272
|
"claude",
|
|
@@ -22495,6 +22499,8 @@ var CodexAgentSpecification = class extends InProcessAcpAgentDefinition2 {
|
|
|
22495
22499
|
createEndpoint = (options) => new CodexAcpAgent(options);
|
|
22496
22500
|
id = "codex";
|
|
22497
22501
|
label = "Codex";
|
|
22502
|
+
minimumSupportedAgentVersion = "0.153.0";
|
|
22503
|
+
maximumTestedAgentVersion = "0.154.0";
|
|
22498
22504
|
constructor() {
|
|
22499
22505
|
super("MOBIUS_CODEX_PATH", ["agents", "codex", "bin", "codex"]);
|
|
22500
22506
|
}
|
|
@@ -22557,6 +22563,8 @@ var CopilotCliAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22557
22563
|
agentExecutable = "copilot";
|
|
22558
22564
|
id = "github-copilot-cli";
|
|
22559
22565
|
label = "GitHub Copilot CLI";
|
|
22566
|
+
minimumSupportedAgentVersion = COPILOT_CLI_TESTED_VERSION;
|
|
22567
|
+
maximumTestedAgentVersion = COPILOT_CLI_TESTED_VERSION;
|
|
22560
22568
|
versionProbeTimeoutMilliseconds = 1e4;
|
|
22561
22569
|
constructor() {
|
|
22562
22570
|
super(
|
|
@@ -22587,6 +22595,8 @@ var CursorCliAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22587
22595
|
agentExecutable = "cursor-agent";
|
|
22588
22596
|
id = "cursor";
|
|
22589
22597
|
label = "Cursor CLI";
|
|
22598
|
+
minimumSupportedAgentVersion = CURSOR_CLI_TESTED_VERSION;
|
|
22599
|
+
maximumTestedAgentVersion = CURSOR_CLI_TESTED_VERSION;
|
|
22590
22600
|
constructor() {
|
|
22591
22601
|
super(
|
|
22592
22602
|
"MOBIUS_CURSOR_PATH",
|
|
@@ -22609,16 +22619,16 @@ import { isAbsolute as isAbsolute3, join as join6, normalize } from "node:path";
|
|
|
22609
22619
|
|
|
22610
22620
|
// src/agent-installation/deepseek-managed-package.ts
|
|
22611
22621
|
var DeepSeekHarnessManagedPackage = class extends SriManagedNpmPackageDefinition {
|
|
22612
|
-
dependencyResolutionArguments = Object.freeze(["--before=2026-09-
|
|
22622
|
+
dependencyResolutionArguments = Object.freeze(["--before=2026-09-23T00:00:00.000Z"]);
|
|
22613
22623
|
includeOptionalDependencies = true;
|
|
22614
22624
|
verifyDependencyClosure = true;
|
|
22615
22625
|
};
|
|
22616
22626
|
var DEEPSEEK_HARNESS_PACKAGE = new DeepSeekHarnessManagedPackage(
|
|
22617
22627
|
"@deepseek-ai/dsh",
|
|
22618
|
-
"0.1.5-rc.
|
|
22628
|
+
"0.1.5-rc.3",
|
|
22619
22629
|
"dsh",
|
|
22620
|
-
"sha512-
|
|
22621
|
-
"https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.
|
|
22630
|
+
"sha512-c0W6Xqc4ChjFcCJkbzPeIxZQdnbKqe+QAcJzWGtogg0ZzsnZRcw3vopMyZ5oZU6E2fmyqGcyDR1sBeiCH4yHcg==",
|
|
22631
|
+
"https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz"
|
|
22622
22632
|
);
|
|
22623
22633
|
|
|
22624
22634
|
// src/storage/state-directory.ts
|
|
@@ -22673,6 +22683,8 @@ var DeepSeekHarnessAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22673
22683
|
agentExecutable = "dsh";
|
|
22674
22684
|
id = "deepseek-harness";
|
|
22675
22685
|
label = "DeepSeek Harness";
|
|
22686
|
+
minimumSupportedAgentVersion = "0.1.2-rc.1";
|
|
22687
|
+
maximumTestedAgentVersion = DEEPSEEK_HARNESS_PACKAGE.version;
|
|
22676
22688
|
constructor() {
|
|
22677
22689
|
super(
|
|
22678
22690
|
"MOBIUS_DEEPSEEK_HARNESS_PATH",
|
|
@@ -22743,6 +22755,8 @@ var GeminiCliAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22743
22755
|
agentExecutable = "gemini";
|
|
22744
22756
|
id = "gemini-cli";
|
|
22745
22757
|
label = "Gemini CLI";
|
|
22758
|
+
minimumSupportedAgentVersion = GEMINI_CLI_TESTED_VERSION;
|
|
22759
|
+
maximumTestedAgentVersion = GEMINI_CLI_TESTED_VERSION;
|
|
22746
22760
|
versionProbeTimeoutMilliseconds = 1e4;
|
|
22747
22761
|
constructor() {
|
|
22748
22762
|
super(
|
|
@@ -22844,6 +22858,8 @@ var GrokBuildAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22844
22858
|
adapterVersionArguments = ["version"];
|
|
22845
22859
|
id = "grok-build";
|
|
22846
22860
|
label = "Grok Build";
|
|
22861
|
+
minimumSupportedAgentVersion = GROK_BUILD_MANAGED_VERSION;
|
|
22862
|
+
maximumTestedAgentVersion = GROK_BUILD_MANAGED_VERSION;
|
|
22847
22863
|
constructor() {
|
|
22848
22864
|
super(
|
|
22849
22865
|
"MOBIUS_GROK_BUILD_PATH",
|
|
@@ -22915,6 +22931,8 @@ var HermesAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22915
22931
|
agentVersionArguments = ["acp", "--version"];
|
|
22916
22932
|
id = "hermes";
|
|
22917
22933
|
label = "Hermes Agent";
|
|
22934
|
+
minimumSupportedAgentVersion = HERMES_TESTED_VERSION;
|
|
22935
|
+
maximumTestedAgentVersion = HERMES_TESTED_VERSION;
|
|
22918
22936
|
constructor() {
|
|
22919
22937
|
super("MOBIUS_HERMES_PATH", ["acp"], ["agents", "hermes", HERMES_TESTED_VERSION, "bin", "hermes"]);
|
|
22920
22938
|
}
|
|
@@ -22943,6 +22961,8 @@ var OhMyPiAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
22943
22961
|
agentOverrideVariable = "MOBIUS_OH_MY_PI_PATH";
|
|
22944
22962
|
id = "oh-my-pi";
|
|
22945
22963
|
label = "Oh My Pi";
|
|
22964
|
+
minimumSupportedAgentVersion = OH_MY_PI_TESTED_VERSION;
|
|
22965
|
+
maximumTestedAgentVersion = OH_MY_PI_TESTED_VERSION;
|
|
22946
22966
|
constructor() {
|
|
22947
22967
|
super("MOBIUS_OH_MY_PI_PATH", ["acp"], ["agents", "oh-my-pi", OH_MY_PI_TESTED_VERSION, "bin", "omp"]);
|
|
22948
22968
|
}
|
|
@@ -23334,6 +23354,8 @@ var OpenCodeAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
23334
23354
|
agentExecutable = "opencode";
|
|
23335
23355
|
id = "opencode";
|
|
23336
23356
|
label = "OpenCode";
|
|
23357
|
+
minimumSupportedAgentVersion = OPENCODE_MANAGED_VERSION;
|
|
23358
|
+
maximumTestedAgentVersion = OPENCODE_MANAGED_VERSION;
|
|
23337
23359
|
constructor() {
|
|
23338
23360
|
super(
|
|
23339
23361
|
"MOBIUS_OPENCODE_PATH",
|
|
@@ -23408,6 +23430,8 @@ var PiAgentSpecification = class extends BridgedAcpAgentDefinition {
|
|
|
23408
23430
|
agentOverrideVariable = "MOBIUS_PI_PATH";
|
|
23409
23431
|
id = "pi";
|
|
23410
23432
|
label = "Pi";
|
|
23433
|
+
minimumSupportedAgentVersion = PI_AGENT_PACKAGE.version;
|
|
23434
|
+
maximumTestedAgentVersion = PI_AGENT_PACKAGE.version;
|
|
23411
23435
|
managedAdapterExecutablePath = [
|
|
23412
23436
|
"adapters",
|
|
23413
23437
|
"pi",
|
|
@@ -23502,6 +23526,8 @@ var WorkBuddyAgentSpecification = class extends DirectAcpAgentDefinition {
|
|
|
23502
23526
|
agentExecutable = "codebuddy";
|
|
23503
23527
|
id = "workbuddy";
|
|
23504
23528
|
label = "WorkBuddy";
|
|
23529
|
+
minimumSupportedAgentVersion = "2.115.0";
|
|
23530
|
+
maximumTestedAgentVersion = WORKBUDDY_MANAGED_VERSION;
|
|
23505
23531
|
constructor() {
|
|
23506
23532
|
super(
|
|
23507
23533
|
"MOBIUS_WORKBUDDY_PATH",
|
|
@@ -23844,6 +23870,61 @@ async function probeAcpReadiness(specification, agent, environment, defaultWorks
|
|
|
23844
23870
|
}
|
|
23845
23871
|
}
|
|
23846
23872
|
|
|
23873
|
+
// src/agent-catalog/agent-version.ts
|
|
23874
|
+
function parseVersion(value) {
|
|
23875
|
+
const match = /(?:^|[^0-9])v?(\d+(?:\.\d+)+)(?:-([0-9A-Za-z.-]+))?/u.exec(value);
|
|
23876
|
+
if (match?.[1] === void 0) {
|
|
23877
|
+
return null;
|
|
23878
|
+
}
|
|
23879
|
+
return {
|
|
23880
|
+
core: match[1].split(".").map(Number),
|
|
23881
|
+
prerelease: match[2]?.split(".") ?? []
|
|
23882
|
+
};
|
|
23883
|
+
}
|
|
23884
|
+
function comparePrerelease(left, right) {
|
|
23885
|
+
if (left.length === 0 || right.length === 0) {
|
|
23886
|
+
return left.length === right.length ? 0 : left.length === 0 ? 1 : -1;
|
|
23887
|
+
}
|
|
23888
|
+
for (let index2 = 0; index2 < Math.max(left.length, right.length); index2 += 1) {
|
|
23889
|
+
const leftPart = left[index2];
|
|
23890
|
+
const rightPart = right[index2];
|
|
23891
|
+
if (leftPart === void 0 || rightPart === void 0) {
|
|
23892
|
+
return leftPart === rightPart ? 0 : leftPart === void 0 ? -1 : 1;
|
|
23893
|
+
}
|
|
23894
|
+
if (leftPart === rightPart) {
|
|
23895
|
+
continue;
|
|
23896
|
+
}
|
|
23897
|
+
const leftNumber = /^\d+$/u.test(leftPart) ? Number(leftPart) : null;
|
|
23898
|
+
const rightNumber = /^\d+$/u.test(rightPart) ? Number(rightPart) : null;
|
|
23899
|
+
if (leftNumber !== null && rightNumber !== null) {
|
|
23900
|
+
return Math.sign(leftNumber - rightNumber);
|
|
23901
|
+
}
|
|
23902
|
+
if (leftNumber !== null || rightNumber !== null) {
|
|
23903
|
+
return leftNumber !== null ? -1 : 1;
|
|
23904
|
+
}
|
|
23905
|
+
return leftPart.localeCompare(rightPart);
|
|
23906
|
+
}
|
|
23907
|
+
return 0;
|
|
23908
|
+
}
|
|
23909
|
+
function compareAgentVersions(left, right) {
|
|
23910
|
+
const parsedLeft = parseVersion(left);
|
|
23911
|
+
const parsedRight = parseVersion(right);
|
|
23912
|
+
if (parsedLeft === null || parsedRight === null) {
|
|
23913
|
+
return null;
|
|
23914
|
+
}
|
|
23915
|
+
for (let index2 = 0; index2 < Math.max(parsedLeft.core.length, parsedRight.core.length); index2 += 1) {
|
|
23916
|
+
const difference = (parsedLeft.core[index2] ?? 0) - (parsedRight.core[index2] ?? 0);
|
|
23917
|
+
if (difference !== 0) {
|
|
23918
|
+
return Math.sign(difference);
|
|
23919
|
+
}
|
|
23920
|
+
}
|
|
23921
|
+
return comparePrerelease(parsedLeft.prerelease, parsedRight.prerelease);
|
|
23922
|
+
}
|
|
23923
|
+
function isAgentVersionSupported(reportedVersion, minimumSupportedVersion) {
|
|
23924
|
+
const comparison = compareAgentVersions(reportedVersion, minimumSupportedVersion);
|
|
23925
|
+
return comparison === null ? null : comparison >= 0;
|
|
23926
|
+
}
|
|
23927
|
+
|
|
23847
23928
|
// src/agent-catalog/executable-discovery.ts
|
|
23848
23929
|
import { isAbsolute as isAbsolute7, join as join13 } from "node:path";
|
|
23849
23930
|
|
|
@@ -24125,6 +24206,18 @@ async function discoverAgent(specification, context) {
|
|
|
24125
24206
|
lastFailure = agentProbeFailure(specification, error62);
|
|
24126
24207
|
continue;
|
|
24127
24208
|
}
|
|
24209
|
+
const supportedVersion = isAgentVersionSupported(agentVersion, specification.minimumSupportedAgentVersion);
|
|
24210
|
+
if (supportedVersion === null) {
|
|
24211
|
+
lastFailure = new AgentProbeFailed(
|
|
24212
|
+
specification,
|
|
24213
|
+
"agent_probe_failed",
|
|
24214
|
+
"Agent reported an unrecognized version"
|
|
24215
|
+
);
|
|
24216
|
+
continue;
|
|
24217
|
+
}
|
|
24218
|
+
if (!supportedVersion) {
|
|
24219
|
+
continue;
|
|
24220
|
+
}
|
|
24128
24221
|
const installedAgent = new AgentIntegrationDefinition(
|
|
24129
24222
|
specification.id,
|
|
24130
24223
|
specification.label,
|
|
@@ -26176,16 +26269,7 @@ var OpaqueDaemonReconnectTarget = class extends DaemonReconnectTarget {
|
|
|
26176
26269
|
this.commandArgument = `--connection ${connectionId2}`;
|
|
26177
26270
|
}
|
|
26178
26271
|
};
|
|
26179
|
-
|
|
26180
|
-
channelId;
|
|
26181
|
-
commandArgument;
|
|
26182
|
-
constructor(channelId) {
|
|
26183
|
-
super();
|
|
26184
|
-
this.channelId = channelId;
|
|
26185
|
-
this.commandArgument = `--channel ${channelId}`;
|
|
26186
|
-
}
|
|
26187
|
-
};
|
|
26188
|
-
function createDaemonConfig(connection, agents = [], installableAgents = [], localContext = new DaemonLocalContext(readStateDirectory(), process.env), reconnectTarget = new ChannelDaemonReconnectTarget(connection.channelId)) {
|
|
26272
|
+
function createDaemonConfig(connection, agents = [], installableAgents = [], localContext = new DaemonLocalContext(readStateDirectory(), process.env), reconnectTarget = null) {
|
|
26189
26273
|
const daemonAgents = agents.map((agent) => withDaemonEnvironment(agent, localContext.environment));
|
|
26190
26274
|
return {
|
|
26191
26275
|
agents: daemonAgents,
|
|
@@ -34302,7 +34386,6 @@ var nativeSessionPageSchema = external_exports.object({
|
|
|
34302
34386
|
|
|
34303
34387
|
// src/acp/session-config/session-config-protocol.ts
|
|
34304
34388
|
import { methods as methods7 } from "@agentclientprotocol/sdk";
|
|
34305
|
-
var AGENT_DEFAULT_REASONING_EFFORT = "agent_default";
|
|
34306
34389
|
var MAXIMUM_CONFIG_OPTIONS = 100;
|
|
34307
34390
|
var SessionConfigProtocolError = class extends Error {
|
|
34308
34391
|
code = "invalid_session_configuration_response";
|
|
@@ -34500,207 +34583,9 @@ var StandardSessionConfigProtocol = class {
|
|
|
34500
34583
|
};
|
|
34501
34584
|
var standardSessionConfigProtocol = new StandardSessionConfigProtocol();
|
|
34502
34585
|
|
|
34503
|
-
// src/acp/session-config/grok-build-session-config.ts
|
|
34504
|
-
var LEGACY_MODEL_CONFIG_ID = "grok_build_legacy_model";
|
|
34505
|
-
var LEGACY_REASONING_EFFORT_CONFIG_ID = "grok_build_legacy_reasoning_effort";
|
|
34506
|
-
function legacyOptions(response) {
|
|
34507
|
-
if (!isRecord6(response)) {
|
|
34508
|
-
return [];
|
|
34509
|
-
}
|
|
34510
|
-
const metadata = response["_meta"];
|
|
34511
|
-
if (!isRecord6(metadata)) {
|
|
34512
|
-
return [];
|
|
34513
|
-
}
|
|
34514
|
-
const sessionConfig = metadata["x.ai/sessionConfig"];
|
|
34515
|
-
if (!isRecord6(sessionConfig) || !Array.isArray(sessionConfig["options"])) {
|
|
34516
|
-
return [];
|
|
34517
|
-
}
|
|
34518
|
-
return sessionConfig["options"].slice(0, 500).filter(isRecord6);
|
|
34519
|
-
}
|
|
34520
|
-
function legacyValue(option) {
|
|
34521
|
-
const value = readString2(option["id"]);
|
|
34522
|
-
return {
|
|
34523
|
-
description: readString2(option["description"]).slice(0, 500),
|
|
34524
|
-
groupId: "",
|
|
34525
|
-
groupName: "",
|
|
34526
|
-
name: readString2(option["label"], value).slice(0, 255),
|
|
34527
|
-
value: value.slice(0, 500)
|
|
34528
|
-
};
|
|
34529
|
-
}
|
|
34530
|
-
function modelsRecord(response) {
|
|
34531
|
-
if (!isRecord6(response) || !isRecord6(response["models"])) {
|
|
34532
|
-
return {};
|
|
34533
|
-
}
|
|
34534
|
-
return response["models"];
|
|
34535
|
-
}
|
|
34536
|
-
function legacyModelOptions(response) {
|
|
34537
|
-
const options = legacyOptions(response);
|
|
34538
|
-
const models = modelsRecord(response);
|
|
34539
|
-
const values = [];
|
|
34540
|
-
for (const option of options) {
|
|
34541
|
-
if (option["category"] === "model") {
|
|
34542
|
-
const value = legacyValue(option);
|
|
34543
|
-
if (value.value.length > 0 && !values.some((existing) => existing.value === value.value)) {
|
|
34544
|
-
values.push(value);
|
|
34545
|
-
}
|
|
34546
|
-
}
|
|
34547
|
-
}
|
|
34548
|
-
if (values.length === 0 && Array.isArray(models["availableModels"])) {
|
|
34549
|
-
for (const model of models["availableModels"]) {
|
|
34550
|
-
if (!isRecord6(model)) {
|
|
34551
|
-
continue;
|
|
34552
|
-
}
|
|
34553
|
-
const value = readString2(model["modelId"]).slice(0, 500);
|
|
34554
|
-
if (value.length === 0) {
|
|
34555
|
-
continue;
|
|
34556
|
-
}
|
|
34557
|
-
if (!values.some((existing) => existing.value === value)) {
|
|
34558
|
-
values.push({
|
|
34559
|
-
description: "",
|
|
34560
|
-
groupId: "",
|
|
34561
|
-
groupName: "",
|
|
34562
|
-
name: readString2(model["name"], value).slice(0, 255),
|
|
34563
|
-
value
|
|
34564
|
-
});
|
|
34565
|
-
}
|
|
34566
|
-
}
|
|
34567
|
-
}
|
|
34568
|
-
const selected = options.find((option) => option["category"] === "model" && option["selected"] === true);
|
|
34569
|
-
const currentValue = readString2(
|
|
34570
|
-
models["currentModelId"],
|
|
34571
|
-
selected === void 0 ? "" : readString2(selected["id"])
|
|
34572
|
-
).slice(0, 500);
|
|
34573
|
-
if (values.length === 0 || !values.some((value) => value.value === currentValue)) {
|
|
34574
|
-
return [];
|
|
34575
|
-
}
|
|
34576
|
-
const result = {
|
|
34577
|
-
booleanValue: false,
|
|
34578
|
-
category: "model",
|
|
34579
|
-
currentValue,
|
|
34580
|
-
description: "Model used by Grok Build",
|
|
34581
|
-
id: LEGACY_MODEL_CONFIG_ID,
|
|
34582
|
-
name: "Model",
|
|
34583
|
-
type: "select",
|
|
34584
|
-
values: values.slice(0, 500)
|
|
34585
|
-
};
|
|
34586
|
-
return [result];
|
|
34587
|
-
}
|
|
34588
|
-
function legacyReasoningEffortOptions(response) {
|
|
34589
|
-
const options = legacyOptions(response);
|
|
34590
|
-
const values = [];
|
|
34591
|
-
for (const option of options) {
|
|
34592
|
-
if (option["category"] !== "mode") {
|
|
34593
|
-
continue;
|
|
34594
|
-
}
|
|
34595
|
-
const value = legacyValue(option);
|
|
34596
|
-
if (value.value.length > 0 && !values.some((existing) => existing.value === value.value)) {
|
|
34597
|
-
values.push(value);
|
|
34598
|
-
}
|
|
34599
|
-
}
|
|
34600
|
-
if (values.length === 0) {
|
|
34601
|
-
return [];
|
|
34602
|
-
}
|
|
34603
|
-
const selected = options.find((option) => option["category"] === "mode" && option["selected"] === true);
|
|
34604
|
-
if (selected === void 0) {
|
|
34605
|
-
values.unshift({
|
|
34606
|
-
description: "Use the selected model's default reasoning effort",
|
|
34607
|
-
groupId: "",
|
|
34608
|
-
groupName: "",
|
|
34609
|
-
name: "Agent default",
|
|
34610
|
-
value: AGENT_DEFAULT_REASONING_EFFORT
|
|
34611
|
-
});
|
|
34612
|
-
}
|
|
34613
|
-
const currentValue = selected === void 0 ? AGENT_DEFAULT_REASONING_EFFORT : readString2(selected["id"], AGENT_DEFAULT_REASONING_EFFORT);
|
|
34614
|
-
if (!values.some((value) => value.value === currentValue)) {
|
|
34615
|
-
return [];
|
|
34616
|
-
}
|
|
34617
|
-
const result = {
|
|
34618
|
-
booleanValue: false,
|
|
34619
|
-
category: "thought_level",
|
|
34620
|
-
currentValue,
|
|
34621
|
-
description: "Reasoning effort used by Grok Build",
|
|
34622
|
-
id: LEGACY_REASONING_EFFORT_CONFIG_ID,
|
|
34623
|
-
name: "Reasoning effort",
|
|
34624
|
-
type: "select",
|
|
34625
|
-
values: values.slice(0, 500)
|
|
34626
|
-
};
|
|
34627
|
-
return [result];
|
|
34628
|
-
}
|
|
34629
|
-
function normalizeGrokLifecycle(response) {
|
|
34630
|
-
const lifecycle = isRecord6(response) ? response : {};
|
|
34631
|
-
const standard = normalizeConfigOptions(lifecycle["configOptions"], lifecycle["modes"]);
|
|
34632
|
-
const normalized = [...standard];
|
|
34633
|
-
if (!normalized.some((option) => option.category === "model")) {
|
|
34634
|
-
normalized.push(...legacyModelOptions(response));
|
|
34635
|
-
}
|
|
34636
|
-
if (!normalized.some((option) => option.category === "thought_level")) {
|
|
34637
|
-
const efforts = legacyReasoningEffortOptions(response);
|
|
34638
|
-
if (efforts.length > 0) {
|
|
34639
|
-
const modelIndex = normalized.findIndex((option) => option.category === "model");
|
|
34640
|
-
normalized.splice(modelIndex < 0 ? normalized.length : modelIndex + 1, 0, ...efforts);
|
|
34641
|
-
}
|
|
34642
|
-
}
|
|
34643
|
-
return normalized.slice(0, 100);
|
|
34644
|
-
}
|
|
34645
|
-
function updateCurrentValue2(current, category, value) {
|
|
34646
|
-
return current.map((option) => option.category === category ? { ...option, currentValue: value } : option);
|
|
34647
|
-
}
|
|
34648
|
-
function validateGrokResponse(response, modelId) {
|
|
34649
|
-
if (!isRecord6(response) || !isRecord6(response["_meta"])) {
|
|
34650
|
-
throw new SessionConfigProtocolError("Grok Build returned an invalid session configuration response");
|
|
34651
|
-
}
|
|
34652
|
-
const model = response["_meta"]["model"];
|
|
34653
|
-
const appliedModel = isRecord6(model) ? model["Ok"] : model;
|
|
34654
|
-
if (appliedModel !== modelId) {
|
|
34655
|
-
throw new SessionConfigProtocolError("Grok Build returned an invalid session configuration response");
|
|
34656
|
-
}
|
|
34657
|
-
}
|
|
34658
|
-
var GrokBuildSessionConfigProtocol = class {
|
|
34659
|
-
configure = async (current, change, nativeSessionId, transport) => {
|
|
34660
|
-
const existing = current.find((option) => option.id === change.configId);
|
|
34661
|
-
if (existing === void 0 || existing.id !== LEGACY_MODEL_CONFIG_ID && existing.id !== LEGACY_REASONING_EFFORT_CONFIG_ID) {
|
|
34662
|
-
return await standardSessionConfigProtocol.configure(current, change, nativeSessionId, transport);
|
|
34663
|
-
}
|
|
34664
|
-
const model = current.find((option) => option.category === "model");
|
|
34665
|
-
if (model === void 0) {
|
|
34666
|
-
return current;
|
|
34667
|
-
}
|
|
34668
|
-
if (existing.category === "thought_level" && change.value === AGENT_DEFAULT_REASONING_EFFORT) {
|
|
34669
|
-
return current;
|
|
34670
|
-
}
|
|
34671
|
-
const modelId = existing.category === "model" ? change.value : model.currentValue;
|
|
34672
|
-
const params = {
|
|
34673
|
-
modelId,
|
|
34674
|
-
sessionId: nativeSessionId
|
|
34675
|
-
};
|
|
34676
|
-
if (existing.category === "thought_level") {
|
|
34677
|
-
params["_meta"] = {
|
|
34678
|
-
reasoningEffort: change.value
|
|
34679
|
-
};
|
|
34680
|
-
}
|
|
34681
|
-
const response = await transport.request(
|
|
34682
|
-
"session/set_model",
|
|
34683
|
-
params,
|
|
34684
|
-
existing.category === "model" ? "Grok Build exited while setting the session model" : "Grok Build exited while setting reasoning effort",
|
|
34685
|
-
change.signal
|
|
34686
|
-
);
|
|
34687
|
-
validateGrokResponse(response, modelId);
|
|
34688
|
-
const updated = updateCurrentValue2(current, existing.category, change.value);
|
|
34689
|
-
return existing.category === "thought_level" ? updated.map(
|
|
34690
|
-
(option) => option.category === "thought_level" ? {
|
|
34691
|
-
...option,
|
|
34692
|
-
values: option.values.filter((value) => value.value !== AGENT_DEFAULT_REASONING_EFFORT)
|
|
34693
|
-
} : option
|
|
34694
|
-
) : updated;
|
|
34695
|
-
};
|
|
34696
|
-
normalizeLifecycle = (response) => normalizeGrokLifecycle(response);
|
|
34697
|
-
normalizeUpdate = (current, value) => standardSessionConfigProtocol.normalizeUpdate(current, value);
|
|
34698
|
-
};
|
|
34699
|
-
var grokBuildSessionConfigProtocol = new GrokBuildSessionConfigProtocol();
|
|
34700
|
-
|
|
34701
34586
|
// src/acp/session-config/session-config-registry.ts
|
|
34702
|
-
function sessionConfigProtocolForAgent(
|
|
34703
|
-
return
|
|
34587
|
+
function sessionConfigProtocolForAgent(_agentId) {
|
|
34588
|
+
return standardSessionConfigProtocol;
|
|
34704
34589
|
}
|
|
34705
34590
|
|
|
34706
34591
|
// src/acp/session-history.ts
|
|
@@ -40704,71 +40589,7 @@ var SessionEventOutbox = class {
|
|
|
40704
40589
|
received_at INTEGER NOT NULL
|
|
40705
40590
|
) STRICT;
|
|
40706
40591
|
`);
|
|
40707
|
-
const deadLetterTable = this.#database.prepare(
|
|
40708
|
-
`SELECT sql FROM sqlite_master
|
|
40709
|
-
WHERE type = 'table' AND name = 'relay_session_event_dead_letters'`
|
|
40710
|
-
).get();
|
|
40711
|
-
const deadLetterSql = typeof deadLetterTable === "object" && deadLetterTable !== null ? Reflect.get(deadLetterTable, "sql") : void 0;
|
|
40712
|
-
if (typeof deadLetterSql !== "string" || !deadLetterSql.includes("'session_rejected'")) {
|
|
40713
|
-
this.#database.exec(`
|
|
40714
|
-
BEGIN IMMEDIATE;
|
|
40715
|
-
ALTER TABLE relay_session_event_dead_letters
|
|
40716
|
-
RENAME TO relay_session_event_dead_letters_legacy;
|
|
40717
|
-
CREATE TABLE relay_session_event_dead_letters (
|
|
40718
|
-
ordinal INTEGER PRIMARY KEY,
|
|
40719
|
-
event_id TEXT NOT NULL UNIQUE,
|
|
40720
|
-
session_id TEXT NOT NULL,
|
|
40721
|
-
envelope_json TEXT NOT NULL,
|
|
40722
|
-
rejection_code TEXT NOT NULL CHECK (
|
|
40723
|
-
rejection_code IN ('session_deleted', 'session_not_found', 'session_rejected')
|
|
40724
|
-
)
|
|
40725
|
-
) STRICT;
|
|
40726
|
-
INSERT INTO relay_session_event_dead_letters (
|
|
40727
|
-
ordinal, event_id, session_id, envelope_json, rejection_code
|
|
40728
|
-
)
|
|
40729
|
-
SELECT ordinal, event_id, session_id, envelope_json, rejection_code
|
|
40730
|
-
FROM relay_session_event_dead_letters_legacy;
|
|
40731
|
-
DROP TABLE relay_session_event_dead_letters_legacy;
|
|
40732
|
-
COMMIT;
|
|
40733
|
-
`);
|
|
40734
|
-
}
|
|
40735
|
-
const outboxColumns = this.#database.prepare("PRAGMA table_info(relay_session_event_outbox)").all();
|
|
40736
|
-
const hasSourceKey = outboxColumns.some(
|
|
40737
|
-
(column) => typeof column === "object" && column !== null && Reflect.get(column, "name") === "source_key"
|
|
40738
|
-
);
|
|
40739
|
-
if (!hasSourceKey) {
|
|
40740
|
-
this.#database.exec(`
|
|
40741
|
-
ALTER TABLE relay_session_event_outbox
|
|
40742
|
-
ADD COLUMN source_key TEXT NOT NULL DEFAULT '';
|
|
40743
|
-
`);
|
|
40744
|
-
}
|
|
40745
|
-
const hasByteLength = outboxColumns.some(
|
|
40746
|
-
(column) => typeof column === "object" && column !== null && Reflect.get(column, "name") === "byte_length"
|
|
40747
|
-
);
|
|
40748
|
-
if (!hasByteLength) {
|
|
40749
|
-
this.#database.exec(`
|
|
40750
|
-
ALTER TABLE relay_session_event_outbox
|
|
40751
|
-
ADD COLUMN byte_length INTEGER NOT NULL DEFAULT 0;
|
|
40752
|
-
`);
|
|
40753
|
-
}
|
|
40754
40592
|
this.#database.exec(`
|
|
40755
|
-
UPDATE relay_session_event_outbox
|
|
40756
|
-
SET source_key = CASE json_extract(envelope_json, '$.source.kind')
|
|
40757
|
-
WHEN 'attempt' THEN
|
|
40758
|
-
'attempt:' || session_id || ':' || json_extract(envelope_json, '$.source.attemptId')
|
|
40759
|
-
ELSE 'runtime:' || session_id
|
|
40760
|
-
END
|
|
40761
|
-
WHERE source_key = '';
|
|
40762
|
-
UPDATE relay_session_event_outbox
|
|
40763
|
-
SET byte_length = length(CAST(envelope_json AS BLOB))
|
|
40764
|
-
WHERE byte_length = 0;
|
|
40765
|
-
UPDATE relay_session_event_outbox_state
|
|
40766
|
-
SET event_count = (SELECT COUNT(*) FROM relay_session_event_outbox),
|
|
40767
|
-
total_bytes = (
|
|
40768
|
-
SELECT COALESCE(SUM(byte_length), 0)
|
|
40769
|
-
FROM relay_session_event_outbox
|
|
40770
|
-
)
|
|
40771
|
-
WHERE singleton = 1;
|
|
40772
40593
|
CREATE INDEX IF NOT EXISTS relay_session_event_outbox_source_order
|
|
40773
40594
|
ON relay_session_event_outbox(source_key, ordinal);
|
|
40774
40595
|
`);
|
|
@@ -43980,7 +43801,11 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
43980
43801
|
);
|
|
43981
43802
|
};
|
|
43982
43803
|
const announceReadiness = () => {
|
|
43983
|
-
if (!connectionAnnounced || !catalogPublished
|
|
43804
|
+
if (!connectionAnnounced || !catalogPublished) {
|
|
43805
|
+
return;
|
|
43806
|
+
}
|
|
43807
|
+
options.onConnectionStatus?.("online");
|
|
43808
|
+
if (readinessAnnounced) {
|
|
43984
43809
|
return;
|
|
43985
43810
|
}
|
|
43986
43811
|
readinessAnnounced = true;
|
|
@@ -43991,14 +43816,16 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
43991
43816
|
return;
|
|
43992
43817
|
}
|
|
43993
43818
|
connectionAnnounced = true;
|
|
43994
|
-
const reconnectCommand = `npx --yes @moxt-ai/mobius start ${config2.reconnectTarget.commandArgument}`;
|
|
43995
43819
|
process.stdout.write("Mobius daemon connected to the relay.\n\n");
|
|
43996
|
-
|
|
43997
|
-
|
|
43820
|
+
if (config2.reconnectTarget !== null) {
|
|
43821
|
+
const reconnectCommand = `mobius start ${config2.reconnectTarget.commandArgument}`;
|
|
43822
|
+
process.stdout.write(
|
|
43823
|
+
`${styleText(["bold", "yellow"], `Reconnect this local connection later:
|
|
43998
43824
|
${reconnectCommand}`)}
|
|
43999
43825
|
|
|
44000
43826
|
`
|
|
44001
|
-
|
|
43827
|
+
);
|
|
43828
|
+
}
|
|
44002
43829
|
announceReadiness();
|
|
44003
43830
|
startAutomaticIntegrationProvisioning();
|
|
44004
43831
|
};
|
|
@@ -44029,7 +43856,12 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
44029
43856
|
activeAttemptIds,
|
|
44030
43857
|
connectionEpoch,
|
|
44031
43858
|
diagnostics,
|
|
44032
|
-
|
|
43859
|
+
() => {
|
|
43860
|
+
if (catalogPublished) {
|
|
43861
|
+
options.onConnectionStatus?.("online");
|
|
43862
|
+
}
|
|
43863
|
+
announceConnection();
|
|
43864
|
+
},
|
|
44033
43865
|
signal,
|
|
44034
43866
|
timer,
|
|
44035
43867
|
resolveAgentCatalogEnvironment
|
|
@@ -44043,6 +43875,7 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
44043
43875
|
}
|
|
44044
43876
|
diagnostics.connectionFailed(connectionEpoch, error62, "connection");
|
|
44045
43877
|
}
|
|
43878
|
+
options.onConnectionStatus?.("reconnecting");
|
|
44046
43879
|
await waitForRelayRetry(signal, timer);
|
|
44047
43880
|
}
|
|
44048
43881
|
} finally {
|
|
@@ -44087,7 +43920,7 @@ import { fetch as fetch5 } from "undici";
|
|
|
44087
43920
|
|
|
44088
43921
|
// src/storage/runtime-installation-store.ts
|
|
44089
43922
|
import { createHash as createHash4, randomUUID as randomUUID4 } from "node:crypto";
|
|
44090
|
-
import { mkdir as mkdir4, open as open5, rename as rename3, unlink, writeFile as writeFile3 } from "node:fs/promises";
|
|
43923
|
+
import { mkdir as mkdir4, open as open5, readdir as readdir3, rename as rename3, unlink, writeFile as writeFile3 } from "node:fs/promises";
|
|
44091
43924
|
import { dirname as dirname7, join as join17, resolve as resolve5 } from "node:path";
|
|
44092
43925
|
var APPLICATION_ID_PATTERN = /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+){1,31}$/;
|
|
44093
43926
|
var CONNECTION_ID_PATTERN = /^mcn_[a-f0-9]{32}$/;
|
|
@@ -44104,18 +43937,31 @@ var CHANNEL_INDEX_KEYS = [
|
|
|
44104
43937
|
"version"
|
|
44105
43938
|
];
|
|
44106
43939
|
var VERIFIED_CONNECTION_KEYS = [
|
|
43940
|
+
"activation",
|
|
43941
|
+
"appId",
|
|
44107
43942
|
"applicationId",
|
|
44108
43943
|
"channelId",
|
|
44109
43944
|
"connectionId",
|
|
44110
43945
|
"defaultWorkspace",
|
|
44111
43946
|
"installationId",
|
|
44112
43947
|
"kind",
|
|
43948
|
+
"pairingId",
|
|
44113
43949
|
"relayOrigin",
|
|
44114
43950
|
"runtimeCredential",
|
|
44115
43951
|
"runtimeId",
|
|
44116
43952
|
"version"
|
|
44117
43953
|
];
|
|
43954
|
+
var VERSION_THREE_VERIFIED_CONNECTION_KEYS = VERIFIED_CONNECTION_KEYS.filter(
|
|
43955
|
+
(key) => key !== "activation"
|
|
43956
|
+
);
|
|
43957
|
+
var VERSION_TWO_VERIFIED_CONNECTION_KEYS = VERSION_THREE_VERIFIED_CONNECTION_KEYS.filter(
|
|
43958
|
+
(key) => key !== "pairingId"
|
|
43959
|
+
);
|
|
43960
|
+
var LEGACY_VERIFIED_CONNECTION_KEYS = VERSION_TWO_VERIFIED_CONNECTION_KEYS.filter(
|
|
43961
|
+
(key) => key !== "appId"
|
|
43962
|
+
);
|
|
44118
43963
|
var IMPORTED_LEGACY_CONNECTION_KEYS = [
|
|
43964
|
+
"activation",
|
|
44119
43965
|
"applicationId",
|
|
44120
43966
|
"channelId",
|
|
44121
43967
|
"connectionId",
|
|
@@ -44126,13 +43972,9 @@ var IMPORTED_LEGACY_CONNECTION_KEYS = [
|
|
|
44126
43972
|
"runtimeCredential",
|
|
44127
43973
|
"version"
|
|
44128
43974
|
];
|
|
44129
|
-
var
|
|
44130
|
-
"
|
|
44131
|
-
|
|
44132
|
-
"relayOrigin",
|
|
44133
|
-
"runtimeCredential"
|
|
44134
|
-
];
|
|
44135
|
-
var LEGACY_CONNECTION_KEYS = ["defaultWorkspace", "channelId", "daemonToken", "relayOrigin"];
|
|
43975
|
+
var VERSION_ONE_IMPORTED_LEGACY_CONNECTION_KEYS = IMPORTED_LEGACY_CONNECTION_KEYS.filter(
|
|
43976
|
+
(key) => key !== "activation"
|
|
43977
|
+
);
|
|
44136
43978
|
var RuntimeInstallationStoreError = class extends Error {
|
|
44137
43979
|
code;
|
|
44138
43980
|
constructor(code, message, options = {}) {
|
|
@@ -44142,19 +43984,25 @@ var RuntimeInstallationStoreError = class extends Error {
|
|
|
44142
43984
|
}
|
|
44143
43985
|
};
|
|
44144
43986
|
var StoredRuntimeConnection = class {
|
|
43987
|
+
activation;
|
|
43988
|
+
appId;
|
|
44145
43989
|
applicationId;
|
|
44146
43990
|
channelId;
|
|
44147
43991
|
connectionId;
|
|
44148
43992
|
defaultWorkspace;
|
|
44149
43993
|
installationId;
|
|
43994
|
+
pairingId;
|
|
44150
43995
|
relayOrigin;
|
|
44151
43996
|
runtimeCredential;
|
|
44152
|
-
constructor(applicationId, installationId2, connectionId2, channelId, defaultWorkspace, relayOrigin, runtimeCredential2) {
|
|
43997
|
+
constructor(activation, applicationId, appId, installationId2, connectionId2, channelId, defaultWorkspace, pairingId, relayOrigin, runtimeCredential2) {
|
|
43998
|
+
this.activation = activation;
|
|
44153
43999
|
this.applicationId = applicationId;
|
|
44000
|
+
this.appId = appId;
|
|
44154
44001
|
this.channelId = channelId;
|
|
44155
44002
|
this.connectionId = connectionId2;
|
|
44156
44003
|
this.defaultWorkspace = defaultWorkspace;
|
|
44157
44004
|
this.installationId = installationId2;
|
|
44005
|
+
this.pairingId = pairingId;
|
|
44158
44006
|
this.relayOrigin = relayOrigin;
|
|
44159
44007
|
this.runtimeCredential = runtimeCredential2;
|
|
44160
44008
|
}
|
|
@@ -44162,15 +44010,37 @@ var StoredRuntimeConnection = class {
|
|
|
44162
44010
|
var VerifiedRuntimeConnection = class extends StoredRuntimeConnection {
|
|
44163
44011
|
kind = "verified";
|
|
44164
44012
|
runtimeId;
|
|
44165
|
-
constructor(applicationId, installationId2, connectionId2, channelId, defaultWorkspace, relayOrigin, runtimeCredential2, runtimeId) {
|
|
44166
|
-
super(
|
|
44013
|
+
constructor(activation, applicationId, appId, installationId2, connectionId2, channelId, defaultWorkspace, pairingId, relayOrigin, runtimeCredential2, runtimeId) {
|
|
44014
|
+
super(
|
|
44015
|
+
activation,
|
|
44016
|
+
applicationId,
|
|
44017
|
+
appId,
|
|
44018
|
+
installationId2,
|
|
44019
|
+
connectionId2,
|
|
44020
|
+
channelId,
|
|
44021
|
+
defaultWorkspace,
|
|
44022
|
+
pairingId,
|
|
44023
|
+
relayOrigin,
|
|
44024
|
+
runtimeCredential2
|
|
44025
|
+
);
|
|
44167
44026
|
this.runtimeId = runtimeId;
|
|
44168
44027
|
}
|
|
44169
44028
|
};
|
|
44170
44029
|
var ImportedLegacyRuntimeConnection = class extends StoredRuntimeConnection {
|
|
44171
44030
|
kind = "legacy_imported";
|
|
44172
|
-
constructor(applicationId, installationId2, connectionId2, channelId, defaultWorkspace, relayOrigin, runtimeCredential2) {
|
|
44173
|
-
super(
|
|
44031
|
+
constructor(activation, applicationId, installationId2, connectionId2, channelId, defaultWorkspace, relayOrigin, runtimeCredential2) {
|
|
44032
|
+
super(
|
|
44033
|
+
activation,
|
|
44034
|
+
applicationId,
|
|
44035
|
+
"unknown",
|
|
44036
|
+
installationId2,
|
|
44037
|
+
connectionId2,
|
|
44038
|
+
channelId,
|
|
44039
|
+
defaultWorkspace,
|
|
44040
|
+
"",
|
|
44041
|
+
relayOrigin,
|
|
44042
|
+
runtimeCredential2
|
|
44043
|
+
);
|
|
44174
44044
|
}
|
|
44175
44045
|
};
|
|
44176
44046
|
function isRecord9(value) {
|
|
@@ -44189,6 +44059,12 @@ function validateApplicationId(value) {
|
|
|
44189
44059
|
}
|
|
44190
44060
|
return value;
|
|
44191
44061
|
}
|
|
44062
|
+
function validateRemoteAppId(value) {
|
|
44063
|
+
if (!IDENTIFIER_PATTERN5.test(value)) {
|
|
44064
|
+
throw new RuntimeInstallationStoreError("invalid_app_id", "The remote App ID is invalid");
|
|
44065
|
+
}
|
|
44066
|
+
return value;
|
|
44067
|
+
}
|
|
44192
44068
|
function validateConnectionId(value) {
|
|
44193
44069
|
if (!CONNECTION_ID_PATTERN.test(value)) {
|
|
44194
44070
|
throw new RuntimeInstallationStoreError("invalid_connection_id", "The local connection ID is invalid");
|
|
@@ -44268,46 +44144,61 @@ function decodeChannelIndex(value) {
|
|
|
44268
44144
|
};
|
|
44269
44145
|
}
|
|
44270
44146
|
function decodeVerifiedConnection(value) {
|
|
44271
|
-
|
|
44147
|
+
const current = hasExactKeys(value, VERIFIED_CONNECTION_KEYS) && value["version"] === 4;
|
|
44148
|
+
const versionThree = hasExactKeys(value, VERSION_THREE_VERIFIED_CONNECTION_KEYS) && value["version"] === 3;
|
|
44149
|
+
const versionTwo = hasExactKeys(value, VERSION_TWO_VERIFIED_CONNECTION_KEYS) && value["version"] === 2;
|
|
44150
|
+
const legacy = hasExactKeys(value, LEGACY_VERIFIED_CONNECTION_KEYS) && value["version"] === 1;
|
|
44151
|
+
if (!current && !versionThree && !versionTwo && !legacy || value["kind"] !== "verified") {
|
|
44272
44152
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44273
44153
|
}
|
|
44274
44154
|
const applicationId = value["applicationId"];
|
|
44155
|
+
const activation = current ? value["activation"] : "active";
|
|
44156
|
+
const appId = typeof value["appId"] === "string" ? value["appId"] : "unknown";
|
|
44275
44157
|
const channelId = value["channelId"];
|
|
44276
44158
|
const connectionId2 = value["connectionId"];
|
|
44277
44159
|
const defaultWorkspace = value["defaultWorkspace"];
|
|
44278
44160
|
const storedInstallationId = value["installationId"];
|
|
44161
|
+
const pairingId = value["pairingId"];
|
|
44162
|
+
const savedPairingId = typeof pairingId === "string" ? pairingId : "";
|
|
44279
44163
|
const relayOrigin = value["relayOrigin"];
|
|
44280
44164
|
const runtimeCredential2 = value["runtimeCredential"];
|
|
44281
44165
|
const runtimeId = value["runtimeId"];
|
|
44282
|
-
if (typeof applicationId !== "string" || typeof channelId !== "string" || typeof connectionId2 !== "string" || typeof defaultWorkspace !== "string" || typeof storedInstallationId !== "string" || typeof relayOrigin !== "string" || typeof runtimeCredential2 !== "string" || typeof runtimeId !== "string") {
|
|
44166
|
+
if (typeof applicationId !== "string" || activation !== "active" && activation !== "stopped" || (current || versionThree || versionTwo) && typeof value["appId"] !== "string" || typeof channelId !== "string" || typeof connectionId2 !== "string" || typeof defaultWorkspace !== "string" || typeof storedInstallationId !== "string" || (current || versionThree) && typeof pairingId !== "string" || typeof relayOrigin !== "string" || typeof runtimeCredential2 !== "string" || typeof runtimeId !== "string") {
|
|
44283
44167
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44284
44168
|
}
|
|
44285
44169
|
return new VerifiedRuntimeConnection(
|
|
44170
|
+
activation,
|
|
44286
44171
|
validateApplicationId(applicationId),
|
|
44172
|
+
validateRemoteAppId(appId),
|
|
44287
44173
|
validateInstallationId(storedInstallationId),
|
|
44288
44174
|
validateConnectionId(connectionId2),
|
|
44289
44175
|
validateIdentifier(channelId, "invalid_connection"),
|
|
44290
44176
|
defaultWorkspace,
|
|
44177
|
+
(current || versionThree) && savedPairingId.length > 0 ? validateIdentifier(savedPairingId, "invalid_connection") : "",
|
|
44291
44178
|
parseRelayOrigin(relayOrigin),
|
|
44292
44179
|
validateRuntimeCredential(runtimeCredential2),
|
|
44293
44180
|
validateIdentifier(runtimeId, "invalid_connection")
|
|
44294
44181
|
);
|
|
44295
44182
|
}
|
|
44296
44183
|
function decodeImportedLegacyConnection(value) {
|
|
44297
|
-
|
|
44184
|
+
const current = hasExactKeys(value, IMPORTED_LEGACY_CONNECTION_KEYS) && value["version"] === 2;
|
|
44185
|
+
const legacy = hasExactKeys(value, VERSION_ONE_IMPORTED_LEGACY_CONNECTION_KEYS) && value["version"] === 1;
|
|
44186
|
+
if (!current && !legacy || value["kind"] !== "legacy_imported" || value["version"] !== 1 && value["version"] !== 2) {
|
|
44298
44187
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44299
44188
|
}
|
|
44300
44189
|
const applicationId = value["applicationId"];
|
|
44190
|
+
const activation = current ? value["activation"] : "active";
|
|
44301
44191
|
const channelId = value["channelId"];
|
|
44302
44192
|
const connectionId2 = value["connectionId"];
|
|
44303
44193
|
const defaultWorkspace = value["defaultWorkspace"];
|
|
44304
44194
|
const storedInstallationId = value["installationId"];
|
|
44305
44195
|
const relayOrigin = value["relayOrigin"];
|
|
44306
44196
|
const runtimeCredential2 = value["runtimeCredential"];
|
|
44307
|
-
if (typeof applicationId !== "string" || typeof channelId !== "string" || typeof connectionId2 !== "string" || typeof defaultWorkspace !== "string" || typeof storedInstallationId !== "string" || typeof relayOrigin !== "string" || typeof runtimeCredential2 !== "string") {
|
|
44197
|
+
if (typeof applicationId !== "string" || activation !== "active" && activation !== "stopped" || typeof channelId !== "string" || typeof connectionId2 !== "string" || typeof defaultWorkspace !== "string" || typeof storedInstallationId !== "string" || typeof relayOrigin !== "string" || typeof runtimeCredential2 !== "string") {
|
|
44308
44198
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44309
44199
|
}
|
|
44310
44200
|
return new ImportedLegacyRuntimeConnection(
|
|
44201
|
+
activation,
|
|
44311
44202
|
validateApplicationId(applicationId),
|
|
44312
44203
|
validateInstallationId(storedInstallationId),
|
|
44313
44204
|
validateConnectionId(connectionId2),
|
|
@@ -44329,24 +44220,6 @@ function decodeConnection(value) {
|
|
|
44329
44220
|
}
|
|
44330
44221
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44331
44222
|
}
|
|
44332
|
-
function decodeLegacyConnection(value, expectedChannelId) {
|
|
44333
|
-
if (!isRecord9(value) || !hasExactKeys(value, CURRENT_CONNECTION_KEYS) && !hasExactKeys(value, LEGACY_CONNECTION_KEYS)) {
|
|
44334
|
-
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44335
|
-
}
|
|
44336
|
-
const channelId = value["channelId"];
|
|
44337
|
-
const defaultWorkspace = value["defaultWorkspace"];
|
|
44338
|
-
const relayOrigin = value["relayOrigin"];
|
|
44339
|
-
const runtimeCredential2 = value["runtimeCredential"] ?? value["daemonToken"];
|
|
44340
|
-
if (typeof channelId !== "string" || channelId !== expectedChannelId || typeof defaultWorkspace !== "string" || typeof relayOrigin !== "string" || typeof runtimeCredential2 !== "string") {
|
|
44341
|
-
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
44342
|
-
}
|
|
44343
|
-
return {
|
|
44344
|
-
channelId: validateIdentifier(channelId, "invalid_connection"),
|
|
44345
|
-
defaultWorkspace,
|
|
44346
|
-
relayOrigin: parseRelayOrigin(relayOrigin),
|
|
44347
|
-
runtimeCredential: validateRuntimeCredential(runtimeCredential2)
|
|
44348
|
-
};
|
|
44349
|
-
}
|
|
44350
44223
|
async function readJsonFile(path2, signal, missingCode) {
|
|
44351
44224
|
signal.throwIfAborted();
|
|
44352
44225
|
let handle;
|
|
@@ -44477,23 +44350,16 @@ var RuntimeInstallationStore = class _RuntimeInstallationStore {
|
|
|
44477
44350
|
}
|
|
44478
44351
|
return await this.readConnection(index2.connectionId, signal);
|
|
44479
44352
|
};
|
|
44480
|
-
migrateLegacyConnection = async (legacyStateDirectory, channelId, signal) => {
|
|
44481
|
-
try {
|
|
44482
|
-
return await this.#readConnectionForChannel(channelId, signal);
|
|
44483
|
-
} catch (cause) {
|
|
44484
|
-
if (!(cause instanceof RuntimeInstallationStoreError) || cause.code !== "connection_not_found") {
|
|
44485
|
-
throw cause;
|
|
44486
|
-
}
|
|
44487
|
-
}
|
|
44488
|
-
return await this.importLegacyConnection(legacyStateDirectory, channelId, signal);
|
|
44489
|
-
};
|
|
44490
44353
|
saveConnection = async (input2, signal) => {
|
|
44491
44354
|
const stored = new VerifiedRuntimeConnection(
|
|
44355
|
+
"active",
|
|
44492
44356
|
this.applicationId,
|
|
44357
|
+
validateRemoteAppId(input2.appId),
|
|
44493
44358
|
this.installationId,
|
|
44494
44359
|
connectionId(),
|
|
44495
44360
|
validateIdentifier(input2.channelId, "invalid_connection"),
|
|
44496
44361
|
input2.defaultWorkspace,
|
|
44362
|
+
input2.pairingId.length === 0 ? "" : validateIdentifier(input2.pairingId, "invalid_pairing_id"),
|
|
44497
44363
|
parseRelayOrigin(input2.relayOrigin.toString()),
|
|
44498
44364
|
validateRuntimeCredential(input2.runtimeCredential),
|
|
44499
44365
|
validateIdentifier(input2.runtimeId, "invalid_connection")
|
|
@@ -44501,25 +44367,6 @@ var RuntimeInstallationStore = class _RuntimeInstallationStore {
|
|
|
44501
44367
|
await this.writeConnection(stored, signal);
|
|
44502
44368
|
return stored;
|
|
44503
44369
|
};
|
|
44504
|
-
importLegacyConnection = async (legacyStateDirectory, channelId, signal) => {
|
|
44505
|
-
const normalizedChannelId = validateIdentifier(channelId, "invalid_channel_id");
|
|
44506
|
-
const legacyPath = join17(resolve5(legacyStateDirectory), "connections", `${normalizedChannelId}.json`);
|
|
44507
|
-
const legacy = decodeLegacyConnection(
|
|
44508
|
-
await readJsonFile(legacyPath, signal, "connection_not_found"),
|
|
44509
|
-
normalizedChannelId
|
|
44510
|
-
);
|
|
44511
|
-
const stored = new ImportedLegacyRuntimeConnection(
|
|
44512
|
-
this.applicationId,
|
|
44513
|
-
this.installationId,
|
|
44514
|
-
connectionId(),
|
|
44515
|
-
legacy.channelId,
|
|
44516
|
-
legacy.defaultWorkspace,
|
|
44517
|
-
legacy.relayOrigin,
|
|
44518
|
-
legacy.runtimeCredential
|
|
44519
|
-
);
|
|
44520
|
-
await this.writeConnection(stored, signal);
|
|
44521
|
-
return stored;
|
|
44522
|
-
};
|
|
44523
44370
|
writeConnection = async (stored, signal) => {
|
|
44524
44371
|
signal.throwIfAborted();
|
|
44525
44372
|
try {
|
|
@@ -44533,49 +44380,134 @@ var RuntimeInstallationStore = class _RuntimeInstallationStore {
|
|
|
44533
44380
|
throw cause;
|
|
44534
44381
|
}
|
|
44535
44382
|
}
|
|
44536
|
-
|
|
44537
|
-
|
|
44538
|
-
|
|
44539
|
-
|
|
44383
|
+
await this.overwriteConnection(stored, signal);
|
|
44384
|
+
await writeJsonAtomically(
|
|
44385
|
+
this.channelIndexPath(stored.channelId),
|
|
44386
|
+
{
|
|
44387
|
+
applicationId: this.applicationId,
|
|
44388
|
+
channelId: stored.channelId,
|
|
44389
|
+
connectionId: stored.connectionId,
|
|
44390
|
+
installationId: this.installationId,
|
|
44391
|
+
version: 1
|
|
44392
|
+
},
|
|
44393
|
+
signal
|
|
44394
|
+
);
|
|
44395
|
+
};
|
|
44396
|
+
listConnections = async (signal) => {
|
|
44397
|
+
signal.throwIfAborted();
|
|
44398
|
+
let entries;
|
|
44399
|
+
try {
|
|
44400
|
+
entries = await readdir3(this.#connectionDirectory);
|
|
44401
|
+
} catch (cause) {
|
|
44402
|
+
if (isNodeError(cause, "ENOENT")) {
|
|
44403
|
+
return [];
|
|
44404
|
+
}
|
|
44405
|
+
throw new RuntimeInstallationStoreError(
|
|
44406
|
+
"connection_unavailable",
|
|
44407
|
+
"Saved Runtime connections cannot be listed",
|
|
44540
44408
|
{
|
|
44541
|
-
|
|
44542
|
-
|
|
44543
|
-
connectionId: stored.connectionId,
|
|
44544
|
-
defaultWorkspace: stored.defaultWorkspace,
|
|
44545
|
-
installationId: stored.installationId,
|
|
44546
|
-
kind: stored.kind,
|
|
44547
|
-
relayOrigin: stored.relayOrigin.toString(),
|
|
44548
|
-
runtimeCredential: stored.runtimeCredential,
|
|
44549
|
-
runtimeId: stored.runtimeId,
|
|
44550
|
-
version: 1
|
|
44551
|
-
},
|
|
44552
|
-
signal
|
|
44409
|
+
cause
|
|
44410
|
+
}
|
|
44553
44411
|
);
|
|
44554
|
-
}
|
|
44412
|
+
}
|
|
44413
|
+
const connections = [];
|
|
44414
|
+
for (const entry of [...entries].sort()) {
|
|
44415
|
+
signal.throwIfAborted();
|
|
44416
|
+
const match = /^(mcn_[a-f0-9]{32})\.json$/.exec(entry);
|
|
44417
|
+
if (match?.[1] !== void 0) {
|
|
44418
|
+
connections.push(await this.readConnection(match[1], signal));
|
|
44419
|
+
}
|
|
44420
|
+
}
|
|
44421
|
+
return connections;
|
|
44422
|
+
};
|
|
44423
|
+
readConnectionForPairing = async (pairingId, signal) => {
|
|
44424
|
+
const normalizedPairingId = validateIdentifier(pairingId, "invalid_pairing_id");
|
|
44425
|
+
const connections = await this.listConnections(signal);
|
|
44426
|
+
return connections.find((connection) => connection.pairingId === normalizedPairingId) ?? null;
|
|
44427
|
+
};
|
|
44428
|
+
setConnectionActivation = async (connectionId2, activation, signal) => {
|
|
44429
|
+
const connection = await this.readConnection(connectionId2, signal);
|
|
44430
|
+
const updated = connection instanceof VerifiedRuntimeConnection ? new VerifiedRuntimeConnection(
|
|
44431
|
+
activation,
|
|
44432
|
+
connection.applicationId,
|
|
44433
|
+
connection.appId,
|
|
44434
|
+
connection.installationId,
|
|
44435
|
+
connection.connectionId,
|
|
44436
|
+
connection.channelId,
|
|
44437
|
+
connection.defaultWorkspace,
|
|
44438
|
+
connection.pairingId,
|
|
44439
|
+
connection.relayOrigin,
|
|
44440
|
+
connection.runtimeCredential,
|
|
44441
|
+
connection.runtimeId
|
|
44442
|
+
) : new ImportedLegacyRuntimeConnection(
|
|
44443
|
+
activation,
|
|
44444
|
+
connection.applicationId,
|
|
44445
|
+
connection.installationId,
|
|
44446
|
+
connection.connectionId,
|
|
44447
|
+
connection.channelId,
|
|
44448
|
+
connection.defaultWorkspace,
|
|
44449
|
+
connection.relayOrigin,
|
|
44450
|
+
connection.runtimeCredential
|
|
44451
|
+
);
|
|
44452
|
+
await this.overwriteConnection(updated, signal);
|
|
44453
|
+
return updated;
|
|
44454
|
+
};
|
|
44455
|
+
removeConnection = async (connectionId2, signal) => {
|
|
44456
|
+
const connection = await this.readConnection(connectionId2, signal);
|
|
44457
|
+
signal.throwIfAborted();
|
|
44458
|
+
try {
|
|
44459
|
+
await unlink(this.connectionPath(connection.connectionId));
|
|
44460
|
+
signal.throwIfAborted();
|
|
44461
|
+
await unlink(this.channelIndexPath(connection.channelId));
|
|
44462
|
+
} catch (cause) {
|
|
44463
|
+
signal.throwIfAborted();
|
|
44464
|
+
if (isNodeError(cause, "ENOENT")) {
|
|
44465
|
+
return;
|
|
44466
|
+
}
|
|
44467
|
+
throw new RuntimeInstallationStoreError(
|
|
44468
|
+
"connection_unavailable",
|
|
44469
|
+
"The saved Runtime connection cannot be removed",
|
|
44470
|
+
{ cause }
|
|
44471
|
+
);
|
|
44472
|
+
}
|
|
44473
|
+
};
|
|
44474
|
+
overwriteConnection = async (connection, signal) => {
|
|
44475
|
+
const connectionPath = this.connectionPath(connection.connectionId);
|
|
44476
|
+
if (connection instanceof VerifiedRuntimeConnection) {
|
|
44555
44477
|
await writeJsonAtomically(
|
|
44556
44478
|
connectionPath,
|
|
44557
44479
|
{
|
|
44558
|
-
|
|
44559
|
-
|
|
44560
|
-
|
|
44561
|
-
|
|
44562
|
-
|
|
44563
|
-
|
|
44564
|
-
|
|
44565
|
-
|
|
44566
|
-
|
|
44480
|
+
activation: connection.activation,
|
|
44481
|
+
applicationId: connection.applicationId,
|
|
44482
|
+
appId: connection.appId,
|
|
44483
|
+
channelId: connection.channelId,
|
|
44484
|
+
connectionId: connection.connectionId,
|
|
44485
|
+
defaultWorkspace: connection.defaultWorkspace,
|
|
44486
|
+
installationId: connection.installationId,
|
|
44487
|
+
kind: connection.kind,
|
|
44488
|
+
pairingId: connection.pairingId,
|
|
44489
|
+
relayOrigin: connection.relayOrigin.toString(),
|
|
44490
|
+
runtimeCredential: connection.runtimeCredential,
|
|
44491
|
+
runtimeId: connection.runtimeId,
|
|
44492
|
+
version: 4
|
|
44567
44493
|
},
|
|
44568
44494
|
signal
|
|
44569
44495
|
);
|
|
44496
|
+
return;
|
|
44570
44497
|
}
|
|
44571
44498
|
await writeJsonAtomically(
|
|
44572
|
-
|
|
44499
|
+
connectionPath,
|
|
44573
44500
|
{
|
|
44574
|
-
|
|
44575
|
-
|
|
44576
|
-
|
|
44577
|
-
|
|
44578
|
-
|
|
44501
|
+
activation: connection.activation,
|
|
44502
|
+
applicationId: connection.applicationId,
|
|
44503
|
+
channelId: connection.channelId,
|
|
44504
|
+
connectionId: connection.connectionId,
|
|
44505
|
+
defaultWorkspace: connection.defaultWorkspace,
|
|
44506
|
+
installationId: connection.installationId,
|
|
44507
|
+
kind: connection.kind,
|
|
44508
|
+
relayOrigin: connection.relayOrigin.toString(),
|
|
44509
|
+
runtimeCredential: connection.runtimeCredential,
|
|
44510
|
+
version: 2
|
|
44579
44511
|
},
|
|
44580
44512
|
signal
|
|
44581
44513
|
);
|
|
@@ -44808,8 +44740,10 @@ async function pairRuntime(installation, options, signal, environment) {
|
|
|
44808
44740
|
const claim2 = await claimPairing(options, defaultWorkspace, agents, inventory.installable, signal);
|
|
44809
44741
|
const connection = await installation.saveConnection(
|
|
44810
44742
|
{
|
|
44743
|
+
appId: options.appId,
|
|
44811
44744
|
channelId: claim2.channelId,
|
|
44812
44745
|
defaultWorkspace,
|
|
44746
|
+
pairingId: options.pairingId,
|
|
44813
44747
|
relayOrigin: options.relayOrigin,
|
|
44814
44748
|
runtimeCredential: claim2.runtimeCredential,
|
|
44815
44749
|
runtimeId: claim2.runtimeId
|
|
@@ -44822,6 +44756,7 @@ async function pairMobiusRuntime(installation, options, signal, environment = pr
|
|
|
44822
44756
|
return await pairRuntime(
|
|
44823
44757
|
installation,
|
|
44824
44758
|
{
|
|
44759
|
+
appId: "embedded",
|
|
44825
44760
|
code: parsePairingCode(options.pairingCode),
|
|
44826
44761
|
pairingId: validatePairingId(options.pairingId),
|
|
44827
44762
|
relayOrigin: parseRelayOrigin2(options.relayOrigin),
|
|
@@ -44974,6 +44909,7 @@ var MobiusRuntimeEngine = class {
|
|
|
44974
44909
|
const audit = new AuditStore(this.#config.auditDatabasePath);
|
|
44975
44910
|
try {
|
|
44976
44911
|
await runDaemon(this.#config, audit, signal, void 0, {
|
|
44912
|
+
...this.#options.onConnectionStatus === void 0 ? {} : { onConnectionStatus: this.#options.onConnectionStatus },
|
|
44977
44913
|
...this.#options.resolveAgentCatalogEnvironment === void 0 ? {} : { resolveAgentCatalogEnvironment: this.#options.resolveAgentCatalogEnvironment }
|
|
44978
44914
|
});
|
|
44979
44915
|
} finally {
|
|
@@ -44983,10 +44919,8 @@ var MobiusRuntimeEngine = class {
|
|
|
44983
44919
|
};
|
|
44984
44920
|
};
|
|
44985
44921
|
export {
|
|
44986
|
-
ChannelDaemonReconnectTarget,
|
|
44987
44922
|
DaemonLocalContext,
|
|
44988
44923
|
DaemonReconnectTarget,
|
|
44989
|
-
ImportedLegacyRuntimeConnection,
|
|
44990
44924
|
MobiusRuntimeConfigurationError,
|
|
44991
44925
|
MobiusRuntimeEngine,
|
|
44992
44926
|
OpaqueDaemonReconnectTarget,
|