@moxt-ai/cli 0.15.23 → 0.15.24
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/daemon-observer.cjs +1 -1
- package/dist/index.cjs +224 -118
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -961,8 +961,8 @@ async function executeProcess(executable, argumentsList, workingDirectory, envir
|
|
|
961
961
|
let executionFailure;
|
|
962
962
|
let reportFailure;
|
|
963
963
|
const failure3 = new Promise(
|
|
964
|
-
(
|
|
965
|
-
reportFailure =
|
|
964
|
+
(resolve30) => {
|
|
965
|
+
reportFailure = resolve30;
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
968
|
const fail = (error64) => {
|
|
@@ -1572,7 +1572,7 @@ function extractKnownCodexVersion(userAgent) {
|
|
|
1572
1572
|
return matched === null ? {} : { value: matched[1] };
|
|
1573
1573
|
}
|
|
1574
1574
|
async function probeCodexVersion(executable, processBaseDirectory, environment) {
|
|
1575
|
-
const result = await new Promise((
|
|
1575
|
+
const result = await new Promise((resolve30) => {
|
|
1576
1576
|
(0, import_node_child_process4.execFile)(
|
|
1577
1577
|
executable,
|
|
1578
1578
|
["--version"],
|
|
@@ -1586,10 +1586,10 @@ async function probeCodexVersion(executable, processBaseDirectory, environment)
|
|
|
1586
1586
|
},
|
|
1587
1587
|
(error64, stdout) => {
|
|
1588
1588
|
if (error64 !== null || typeof stdout !== "string") {
|
|
1589
|
-
|
|
1589
|
+
resolve30({});
|
|
1590
1590
|
return;
|
|
1591
1591
|
}
|
|
1592
|
-
|
|
1592
|
+
resolve30({ output: stdout });
|
|
1593
1593
|
}
|
|
1594
1594
|
);
|
|
1595
1595
|
});
|
|
@@ -1641,12 +1641,12 @@ async function completionWithinExit(child, milliseconds) {
|
|
|
1641
1641
|
if (child.exitCode !== null || child.signalCode !== null) {
|
|
1642
1642
|
return;
|
|
1643
1643
|
}
|
|
1644
|
-
await new Promise((
|
|
1645
|
-
const timeout = setTimeout(
|
|
1644
|
+
await new Promise((resolve30) => {
|
|
1645
|
+
const timeout = setTimeout(resolve30, milliseconds);
|
|
1646
1646
|
timeout.unref();
|
|
1647
1647
|
child.once("close", () => {
|
|
1648
1648
|
clearTimeout(timeout);
|
|
1649
|
-
|
|
1649
|
+
resolve30();
|
|
1650
1650
|
});
|
|
1651
1651
|
});
|
|
1652
1652
|
}
|
|
@@ -1656,8 +1656,8 @@ async function completionWithinProcessTreeExit(child, stopTarget, milliseconds)
|
|
|
1656
1656
|
if (!await appServerProcessTreeIsRunning(child, stopTarget)) {
|
|
1657
1657
|
return;
|
|
1658
1658
|
}
|
|
1659
|
-
await new Promise((
|
|
1660
|
-
setTimeout(
|
|
1659
|
+
await new Promise((resolve30) => {
|
|
1660
|
+
setTimeout(resolve30, processTreePollMilliseconds);
|
|
1661
1661
|
});
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
@@ -1795,7 +1795,7 @@ async function captureAppServerProcessTree(child) {
|
|
|
1795
1795
|
};
|
|
1796
1796
|
}
|
|
1797
1797
|
async function appServerProcessTable() {
|
|
1798
|
-
const listed = await new Promise((
|
|
1798
|
+
const listed = await new Promise((resolve30) => {
|
|
1799
1799
|
(0, import_node_child_process4.execFile)(
|
|
1800
1800
|
processTableExecutable(),
|
|
1801
1801
|
["-axo", "pid=,ppid=,lstart="],
|
|
@@ -1807,10 +1807,10 @@ async function appServerProcessTable() {
|
|
|
1807
1807
|
},
|
|
1808
1808
|
(error64, stdout) => {
|
|
1809
1809
|
if (error64 !== null || typeof stdout !== "string") {
|
|
1810
|
-
|
|
1810
|
+
resolve30({});
|
|
1811
1811
|
return;
|
|
1812
1812
|
}
|
|
1813
|
-
|
|
1813
|
+
resolve30({ output: stdout });
|
|
1814
1814
|
}
|
|
1815
1815
|
);
|
|
1816
1816
|
});
|
|
@@ -1862,8 +1862,8 @@ async function appServerProcessTableWithRetry() {
|
|
|
1862
1862
|
return processTable;
|
|
1863
1863
|
}
|
|
1864
1864
|
if (attempt < maximumProcessTableAttempts) {
|
|
1865
|
-
await new Promise((
|
|
1866
|
-
setTimeout(
|
|
1865
|
+
await new Promise((resolve30) => {
|
|
1866
|
+
setTimeout(resolve30, processTableRetryMilliseconds);
|
|
1867
1867
|
});
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
@@ -2129,13 +2129,13 @@ var init_app_server_client = __esm({
|
|
|
2129
2129
|
const id = this.nextRequestId;
|
|
2130
2130
|
this.nextRequestId += 1;
|
|
2131
2131
|
const key = String(id);
|
|
2132
|
-
const response = new Promise((
|
|
2132
|
+
const response = new Promise((resolve30, reject2) => {
|
|
2133
2133
|
const timeout = setTimeout(() => {
|
|
2134
2134
|
this.pending.delete(key);
|
|
2135
2135
|
reject2(new AppServerRequestTimeoutError(method));
|
|
2136
2136
|
}, timeoutMilliseconds);
|
|
2137
2137
|
timeout.unref();
|
|
2138
|
-
this.pending.set(key, { reject: reject2, resolve:
|
|
2138
|
+
this.pending.set(key, { reject: reject2, resolve: resolve30, timeout });
|
|
2139
2139
|
});
|
|
2140
2140
|
try {
|
|
2141
2141
|
const [result] = await Promise.all([
|
|
@@ -2333,12 +2333,12 @@ var init_app_server_client = __esm({
|
|
|
2333
2333
|
throw new AppServerProcessLostError(
|
|
2334
2334
|
"Codex App Server process is closed"
|
|
2335
2335
|
);
|
|
2336
|
-
await new Promise((
|
|
2336
|
+
await new Promise((resolve30, reject2) => {
|
|
2337
2337
|
this.child.stdin.write(frame, (error64) => {
|
|
2338
2338
|
if (error64) {
|
|
2339
2339
|
reject2(error64);
|
|
2340
2340
|
} else {
|
|
2341
|
-
|
|
2341
|
+
resolve30();
|
|
2342
2342
|
}
|
|
2343
2343
|
});
|
|
2344
2344
|
});
|
|
@@ -4268,6 +4268,18 @@ function isConnectorCredentialName(name) {
|
|
|
4268
4268
|
name.slice("MOXT_MACHINE_".length)
|
|
4269
4269
|
);
|
|
4270
4270
|
}
|
|
4271
|
+
function mergeSearchPath(preferredPath, fallbackPath) {
|
|
4272
|
+
if (preferredPath === void 0) return fallbackPath;
|
|
4273
|
+
if (fallbackPath === void 0) return preferredPath;
|
|
4274
|
+
const known = new Set(preferredPath.split(import_node_path7.delimiter));
|
|
4275
|
+
const additional = [];
|
|
4276
|
+
for (const entry of fallbackPath.split(import_node_path7.delimiter)) {
|
|
4277
|
+
if (!(0, import_node_path7.isAbsolute)(entry) || known.has(entry)) continue;
|
|
4278
|
+
known.add(entry);
|
|
4279
|
+
additional.push(entry);
|
|
4280
|
+
}
|
|
4281
|
+
return [preferredPath, ...additional].filter((part) => part.length > 0).join(import_node_path7.delimiter);
|
|
4282
|
+
}
|
|
4271
4283
|
async function validateShell(shellPath) {
|
|
4272
4284
|
if (!(0, import_node_path7.isAbsolute)(shellPath)) throw new Error("default shell is not absolute");
|
|
4273
4285
|
const canonicalPath2 = await validateExecutable(shellPath);
|
|
@@ -4653,7 +4665,10 @@ var init_shell_environment = __esm({
|
|
|
4653
4665
|
try {
|
|
4654
4666
|
const snapshot = parseNullSeparatedEnvironment(result.stdout);
|
|
4655
4667
|
const capturedEnvironment = sanitizeEnvironment(snapshot);
|
|
4656
|
-
const effectivePath =
|
|
4668
|
+
const effectivePath = mergeSearchPath(
|
|
4669
|
+
capturedEnvironment.PATH,
|
|
4670
|
+
this.daemonEnvironment.PATH
|
|
4671
|
+
);
|
|
4657
4672
|
return {
|
|
4658
4673
|
environment: freezeEnvironment({
|
|
4659
4674
|
...this.daemonEnvironment,
|
|
@@ -8953,9 +8968,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
8953
8968
|
}
|
|
8954
8969
|
close(callback) {
|
|
8955
8970
|
if (callback === void 0) {
|
|
8956
|
-
return new Promise((
|
|
8971
|
+
return new Promise((resolve30, reject2) => {
|
|
8957
8972
|
this.close((err2, data) => {
|
|
8958
|
-
return err2 ? reject2(err2) :
|
|
8973
|
+
return err2 ? reject2(err2) : resolve30(data);
|
|
8959
8974
|
});
|
|
8960
8975
|
});
|
|
8961
8976
|
}
|
|
@@ -8993,9 +9008,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
8993
9008
|
err2 = null;
|
|
8994
9009
|
}
|
|
8995
9010
|
if (callback === void 0) {
|
|
8996
|
-
return new Promise((
|
|
9011
|
+
return new Promise((resolve30, reject2) => {
|
|
8997
9012
|
this.destroy(err2, (err3, data) => {
|
|
8998
|
-
return err3 ? reject2(err3) :
|
|
9013
|
+
return err3 ? reject2(err3) : resolve30(data);
|
|
8999
9014
|
});
|
|
9000
9015
|
});
|
|
9001
9016
|
}
|
|
@@ -13969,12 +13984,12 @@ upgrade: ${upgrade}\r
|
|
|
13969
13984
|
cb2();
|
|
13970
13985
|
}
|
|
13971
13986
|
}
|
|
13972
|
-
const waitForDrain = () => new Promise((
|
|
13987
|
+
const waitForDrain = () => new Promise((resolve30, reject2) => {
|
|
13973
13988
|
assert3(callback === null);
|
|
13974
13989
|
if (socket[kError]) {
|
|
13975
13990
|
reject2(socket[kError]);
|
|
13976
13991
|
} else {
|
|
13977
|
-
callback =
|
|
13992
|
+
callback = resolve30;
|
|
13978
13993
|
}
|
|
13979
13994
|
});
|
|
13980
13995
|
socket.on("close", onDrain).on("drain", onDrain);
|
|
@@ -15358,12 +15373,12 @@ var require_client_h2 = __commonJS({
|
|
|
15358
15373
|
cb2();
|
|
15359
15374
|
}
|
|
15360
15375
|
}
|
|
15361
|
-
const waitForDrain = () => new Promise((
|
|
15376
|
+
const waitForDrain = () => new Promise((resolve30, reject2) => {
|
|
15362
15377
|
assert3(callback === null);
|
|
15363
15378
|
if (socket[kError]) {
|
|
15364
15379
|
reject2(socket[kError]);
|
|
15365
15380
|
} else {
|
|
15366
|
-
callback =
|
|
15381
|
+
callback = resolve30;
|
|
15367
15382
|
}
|
|
15368
15383
|
});
|
|
15369
15384
|
h2stream.on("close", onDrain).on("drain", onDrain);
|
|
@@ -15733,16 +15748,16 @@ var require_client = __commonJS({
|
|
|
15733
15748
|
return this[kNeedDrain] < 2;
|
|
15734
15749
|
}
|
|
15735
15750
|
[kClose]() {
|
|
15736
|
-
return new Promise((
|
|
15751
|
+
return new Promise((resolve30) => {
|
|
15737
15752
|
if (this[kSize]) {
|
|
15738
|
-
this[kClosedResolve] =
|
|
15753
|
+
this[kClosedResolve] = resolve30;
|
|
15739
15754
|
} else {
|
|
15740
|
-
|
|
15755
|
+
resolve30(null);
|
|
15741
15756
|
}
|
|
15742
15757
|
});
|
|
15743
15758
|
}
|
|
15744
15759
|
[kDestroy](err2) {
|
|
15745
|
-
return new Promise((
|
|
15760
|
+
return new Promise((resolve30) => {
|
|
15746
15761
|
const requests = this[kQueue].splice(this[kPendingIdx]);
|
|
15747
15762
|
for (let i3 = 0; i3 < requests.length; i3++) {
|
|
15748
15763
|
const request2 = requests[i3];
|
|
@@ -15755,7 +15770,7 @@ var require_client = __commonJS({
|
|
|
15755
15770
|
this[kClosedResolve]();
|
|
15756
15771
|
this[kClosedResolve] = null;
|
|
15757
15772
|
}
|
|
15758
|
-
|
|
15773
|
+
resolve30(null);
|
|
15759
15774
|
};
|
|
15760
15775
|
if (this[kHTTPContext]) {
|
|
15761
15776
|
this[kHTTPContext].destroy(err2, callback);
|
|
@@ -16170,8 +16185,8 @@ var require_pool_base = __commonJS({
|
|
|
16170
16185
|
}
|
|
16171
16186
|
return Promise.all(closeAll);
|
|
16172
16187
|
} else {
|
|
16173
|
-
return new Promise((
|
|
16174
|
-
this[kClosedResolve] =
|
|
16188
|
+
return new Promise((resolve30) => {
|
|
16189
|
+
this[kClosedResolve] = resolve30;
|
|
16175
16190
|
});
|
|
16176
16191
|
}
|
|
16177
16192
|
}
|
|
@@ -18848,7 +18863,7 @@ var require_readable = __commonJS({
|
|
|
18848
18863
|
if (this._readableState.closeEmitted) {
|
|
18849
18864
|
return Promise.resolve(null);
|
|
18850
18865
|
}
|
|
18851
|
-
return new Promise((
|
|
18866
|
+
return new Promise((resolve30, reject2) => {
|
|
18852
18867
|
if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
|
|
18853
18868
|
this.destroy(new AbortError2());
|
|
18854
18869
|
}
|
|
@@ -18862,11 +18877,11 @@ var require_readable = __commonJS({
|
|
|
18862
18877
|
if (signal.aborted) {
|
|
18863
18878
|
reject2(signal.reason ?? new AbortError2());
|
|
18864
18879
|
} else {
|
|
18865
|
-
|
|
18880
|
+
resolve30(null);
|
|
18866
18881
|
}
|
|
18867
18882
|
});
|
|
18868
18883
|
} else {
|
|
18869
|
-
this.on("close",
|
|
18884
|
+
this.on("close", resolve30);
|
|
18870
18885
|
}
|
|
18871
18886
|
this.on("error", noop2).on("data", () => {
|
|
18872
18887
|
if (this[kBytesRead] > limit) {
|
|
@@ -18894,7 +18909,7 @@ var require_readable = __commonJS({
|
|
|
18894
18909
|
}
|
|
18895
18910
|
function consume(stream, type) {
|
|
18896
18911
|
assert3(!stream[kConsume]);
|
|
18897
|
-
return new Promise((
|
|
18912
|
+
return new Promise((resolve30, reject2) => {
|
|
18898
18913
|
if (isUnusable(stream)) {
|
|
18899
18914
|
const rState = stream._readableState;
|
|
18900
18915
|
if (rState.destroyed && rState.closeEmitted === false) {
|
|
@@ -18909,7 +18924,7 @@ var require_readable = __commonJS({
|
|
|
18909
18924
|
stream[kConsume] = {
|
|
18910
18925
|
type,
|
|
18911
18926
|
stream,
|
|
18912
|
-
resolve:
|
|
18927
|
+
resolve: resolve30,
|
|
18913
18928
|
reject: reject2,
|
|
18914
18929
|
length: 0,
|
|
18915
18930
|
body: []
|
|
@@ -18987,18 +19002,18 @@ var require_readable = __commonJS({
|
|
|
18987
19002
|
return buffer2;
|
|
18988
19003
|
}
|
|
18989
19004
|
function consumeEnd(consume2, encoding) {
|
|
18990
|
-
const { type, body, resolve:
|
|
19005
|
+
const { type, body, resolve: resolve30, stream, length } = consume2;
|
|
18991
19006
|
try {
|
|
18992
19007
|
if (type === "text") {
|
|
18993
|
-
|
|
19008
|
+
resolve30(chunksDecode(body, length, encoding));
|
|
18994
19009
|
} else if (type === "json") {
|
|
18995
|
-
|
|
19010
|
+
resolve30(JSON.parse(chunksDecode(body, length, encoding)));
|
|
18996
19011
|
} else if (type === "arrayBuffer") {
|
|
18997
|
-
|
|
19012
|
+
resolve30(chunksConcat(body, length).buffer);
|
|
18998
19013
|
} else if (type === "blob") {
|
|
18999
|
-
|
|
19014
|
+
resolve30(new Blob(body, { type: stream[kContentType] }));
|
|
19000
19015
|
} else if (type === "bytes") {
|
|
19001
|
-
|
|
19016
|
+
resolve30(chunksConcat(body, length));
|
|
19002
19017
|
}
|
|
19003
19018
|
consumeFinish(consume2);
|
|
19004
19019
|
} catch (err2) {
|
|
@@ -19218,9 +19233,9 @@ var require_api_request = __commonJS({
|
|
|
19218
19233
|
};
|
|
19219
19234
|
function request2(opts, callback) {
|
|
19220
19235
|
if (callback === void 0) {
|
|
19221
|
-
return new Promise((
|
|
19236
|
+
return new Promise((resolve30, reject2) => {
|
|
19222
19237
|
request2.call(this, opts, (err2, data) => {
|
|
19223
|
-
return err2 ? reject2(err2) :
|
|
19238
|
+
return err2 ? reject2(err2) : resolve30(data);
|
|
19224
19239
|
});
|
|
19225
19240
|
});
|
|
19226
19241
|
}
|
|
@@ -19483,9 +19498,9 @@ var require_api_stream = __commonJS({
|
|
|
19483
19498
|
};
|
|
19484
19499
|
function stream(opts, factory, callback) {
|
|
19485
19500
|
if (callback === void 0) {
|
|
19486
|
-
return new Promise((
|
|
19501
|
+
return new Promise((resolve30, reject2) => {
|
|
19487
19502
|
stream.call(this, opts, factory, (err2, data) => {
|
|
19488
|
-
return err2 ? reject2(err2) :
|
|
19503
|
+
return err2 ? reject2(err2) : resolve30(data);
|
|
19489
19504
|
});
|
|
19490
19505
|
});
|
|
19491
19506
|
}
|
|
@@ -19787,9 +19802,9 @@ var require_api_upgrade = __commonJS({
|
|
|
19787
19802
|
};
|
|
19788
19803
|
function upgrade(opts, callback) {
|
|
19789
19804
|
if (callback === void 0) {
|
|
19790
|
-
return new Promise((
|
|
19805
|
+
return new Promise((resolve30, reject2) => {
|
|
19791
19806
|
upgrade.call(this, opts, (err2, data) => {
|
|
19792
|
-
return err2 ? reject2(err2) :
|
|
19807
|
+
return err2 ? reject2(err2) : resolve30(data);
|
|
19793
19808
|
});
|
|
19794
19809
|
});
|
|
19795
19810
|
}
|
|
@@ -19884,9 +19899,9 @@ var require_api_connect = __commonJS({
|
|
|
19884
19899
|
};
|
|
19885
19900
|
function connect(opts, callback) {
|
|
19886
19901
|
if (callback === void 0) {
|
|
19887
|
-
return new Promise((
|
|
19902
|
+
return new Promise((resolve30, reject2) => {
|
|
19888
19903
|
connect.call(this, opts, (err2, data) => {
|
|
19889
|
-
return err2 ? reject2(err2) :
|
|
19904
|
+
return err2 ? reject2(err2) : resolve30(data);
|
|
19890
19905
|
});
|
|
19891
19906
|
});
|
|
19892
19907
|
}
|
|
@@ -21365,7 +21380,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
21365
21380
|
"use strict";
|
|
21366
21381
|
init_cjs_shims();
|
|
21367
21382
|
var { writeFile: writeFile7, readFile: readFile15, mkdir: mkdir10 } = require("node:fs/promises");
|
|
21368
|
-
var { dirname: dirname18, resolve:
|
|
21383
|
+
var { dirname: dirname18, resolve: resolve30 } = require("node:path");
|
|
21369
21384
|
var { setTimeout: setTimeout3, clearTimeout: clearTimeout2 } = require("node:timers");
|
|
21370
21385
|
var { InvalidArgumentError: InvalidArgumentError2, UndiciError } = require_errors();
|
|
21371
21386
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -21581,7 +21596,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
21581
21596
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
21582
21597
|
}
|
|
21583
21598
|
try {
|
|
21584
|
-
const data = await readFile15(
|
|
21599
|
+
const data = await readFile15(resolve30(path9), "utf8");
|
|
21585
21600
|
const parsed = JSON.parse(data);
|
|
21586
21601
|
if (Array.isArray(parsed)) {
|
|
21587
21602
|
this.#snapshots.clear();
|
|
@@ -21610,7 +21625,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
21610
21625
|
if (!path9) {
|
|
21611
21626
|
throw new InvalidArgumentError2("Snapshot path is required");
|
|
21612
21627
|
}
|
|
21613
|
-
const resolvedPath =
|
|
21628
|
+
const resolvedPath = resolve30(path9);
|
|
21614
21629
|
await mkdir10(dirname18(resolvedPath), { recursive: true });
|
|
21615
21630
|
const data = Array.from(this.#snapshots.entries()).map(([hash3, snapshot]) => ({
|
|
21616
21631
|
hash: hash3,
|
|
@@ -26637,10 +26652,10 @@ var require_headers = __commonJS({
|
|
|
26637
26652
|
const lowercaseName = isLowerCase ? name : name.toLowerCase();
|
|
26638
26653
|
const exists2 = this.headersMap.get(lowercaseName);
|
|
26639
26654
|
if (exists2) {
|
|
26640
|
-
const
|
|
26655
|
+
const delimiter5 = lowercaseName === "cookie" ? "; " : ", ";
|
|
26641
26656
|
this.headersMap.set(lowercaseName, {
|
|
26642
26657
|
name: exists2.name,
|
|
26643
|
-
value: `${exists2.value}${
|
|
26658
|
+
value: `${exists2.value}${delimiter5}${value}`
|
|
26644
26659
|
});
|
|
26645
26660
|
} else {
|
|
26646
26661
|
this.headersMap.set(lowercaseName, { name, value });
|
|
@@ -29298,7 +29313,7 @@ var require_fetch = __commonJS({
|
|
|
29298
29313
|
const hasTrailingQuestionMark = url3.search.length === 0 && url3.href[url3.href.length - url3.hash.length - 1] === "?";
|
|
29299
29314
|
return dispatchWithProtocolPreference(body);
|
|
29300
29315
|
function dispatchWithProtocolPreference(body2, allowH2) {
|
|
29301
|
-
return new Promise((
|
|
29316
|
+
return new Promise((resolve30, reject2) => agent2.dispatch(
|
|
29302
29317
|
{
|
|
29303
29318
|
path: hasTrailingQuestionMark ? `${path9}?` : path9,
|
|
29304
29319
|
origin: url3.origin,
|
|
@@ -29381,7 +29396,7 @@ var require_fetch = __commonJS({
|
|
|
29381
29396
|
}
|
|
29382
29397
|
}
|
|
29383
29398
|
const onError = (err2) => this.onResponseError(controller, err2);
|
|
29384
|
-
|
|
29399
|
+
resolve30({
|
|
29385
29400
|
status,
|
|
29386
29401
|
statusText,
|
|
29387
29402
|
headersList,
|
|
@@ -29414,7 +29429,7 @@ var require_fetch = __commonJS({
|
|
|
29414
29429
|
fetchParams.controller.off("terminated", this.abort);
|
|
29415
29430
|
}
|
|
29416
29431
|
if (request2.mode === "websocket" && allowH2 !== false && error64?.code === "UND_ERR_INFO" && error64?.message === "HTTP/2: Extended CONNECT protocol not supported by server") {
|
|
29417
|
-
|
|
29432
|
+
resolve30(dispatchWithProtocolPreference(body2, false));
|
|
29418
29433
|
return;
|
|
29419
29434
|
}
|
|
29420
29435
|
this.body?.destroy(error64);
|
|
@@ -29431,7 +29446,7 @@ var require_fetch = __commonJS({
|
|
|
29431
29446
|
const rawHeaders = controller?.rawHeaders ?? [];
|
|
29432
29447
|
const headersList = new HeadersList();
|
|
29433
29448
|
appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders);
|
|
29434
|
-
|
|
29449
|
+
resolve30({
|
|
29435
29450
|
status,
|
|
29436
29451
|
statusText: STATUS_CODES[status],
|
|
29437
29452
|
headersList,
|
|
@@ -35298,8 +35313,8 @@ var init_regexes = __esm({
|
|
|
35298
35313
|
_emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
35299
35314
|
ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
35300
35315
|
ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
35301
|
-
mac = (
|
|
35302
|
-
const escapedDelim = escapeRegex(
|
|
35316
|
+
mac = (delimiter5) => {
|
|
35317
|
+
const escapedDelim = escapeRegex(delimiter5 ?? ":");
|
|
35303
35318
|
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
35304
35319
|
};
|
|
35305
35320
|
cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
@@ -38331,7 +38346,7 @@ function isRef(value) {
|
|
|
38331
38346
|
function cloneIssues(issues) {
|
|
38332
38347
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
38333
38348
|
}
|
|
38334
|
-
function isRecursive(inst, stack,
|
|
38349
|
+
function isRecursive(inst, stack, resolve30) {
|
|
38335
38350
|
const cached3 = recursive.get(inst);
|
|
38336
38351
|
if (cached3 !== void 0)
|
|
38337
38352
|
return cached3 ? PROVEN : NONE;
|
|
@@ -38341,7 +38356,7 @@ function isRecursive(inst, stack, resolve29) {
|
|
|
38341
38356
|
let result = NONE;
|
|
38342
38357
|
const check3 = (child) => {
|
|
38343
38358
|
if (result !== PROVEN && child?._zod) {
|
|
38344
|
-
const answer = isRecursive(child, stack,
|
|
38359
|
+
const answer = isRecursive(child, stack, resolve30);
|
|
38345
38360
|
if (answer > result)
|
|
38346
38361
|
result = answer;
|
|
38347
38362
|
}
|
|
@@ -38352,7 +38367,7 @@ function isRecursive(inst, stack, resolve29) {
|
|
|
38352
38367
|
const desc2 = Object.getOwnPropertyDescriptor(sh, key);
|
|
38353
38368
|
if (spread && !desc2.enumerable)
|
|
38354
38369
|
continue;
|
|
38355
|
-
const child = desc2.get ? ASSUMED : desc2.value?._zod ? isRecursive(desc2.value, stack,
|
|
38370
|
+
const child = desc2.get ? ASSUMED : desc2.value?._zod ? isRecursive(desc2.value, stack, resolve30) : NONE;
|
|
38356
38371
|
if (child > answer)
|
|
38357
38372
|
answer = child;
|
|
38358
38373
|
}
|
|
@@ -38416,7 +38431,7 @@ function isRecursive(inst, stack, resolve29) {
|
|
|
38416
38431
|
break;
|
|
38417
38432
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
38418
38433
|
case "lazy": {
|
|
38419
|
-
const inner = def._cachedInner ?? (
|
|
38434
|
+
const inner = def._cachedInner ?? (resolve30 ? inst._zod.innerType : void 0);
|
|
38420
38435
|
merge3(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
38421
38436
|
break;
|
|
38422
38437
|
}
|
|
@@ -56656,11 +56671,11 @@ var init_jsonrpc = __esm({
|
|
|
56656
56671
|
const id = this.nextRequestId++;
|
|
56657
56672
|
let cancel = () => {
|
|
56658
56673
|
};
|
|
56659
|
-
const response = new Promise((
|
|
56674
|
+
const response = new Promise((resolve30, reject2) => {
|
|
56660
56675
|
const pendingResponse = {
|
|
56661
56676
|
resolve: (value) => {
|
|
56662
56677
|
try {
|
|
56663
|
-
|
|
56678
|
+
resolve30(mapResponse ? mapResponse(value) : value);
|
|
56664
56679
|
} catch (error64) {
|
|
56665
56680
|
reject2(error64);
|
|
56666
56681
|
}
|
|
@@ -56717,8 +56732,8 @@ var init_jsonrpc = __esm({
|
|
|
56717
56732
|
this.stream = stream;
|
|
56718
56733
|
this.staticHandlers = handlers;
|
|
56719
56734
|
this.allowBatches = options?.allowBatches ?? true;
|
|
56720
|
-
this.closedPromise = new Promise((
|
|
56721
|
-
this.abortController.signal.addEventListener("abort", () =>
|
|
56735
|
+
this.closedPromise = new Promise((resolve30) => {
|
|
56736
|
+
this.abortController.signal.addEventListener("abort", () => resolve30());
|
|
56722
56737
|
});
|
|
56723
56738
|
void this.receive();
|
|
56724
56739
|
}
|
|
@@ -57648,8 +57663,8 @@ var init_acp = __esm({
|
|
|
57648
57663
|
if (this.failed) {
|
|
57649
57664
|
return Promise.reject(this.failure);
|
|
57650
57665
|
}
|
|
57651
|
-
return new Promise((
|
|
57652
|
-
this.waiters.push({ resolve:
|
|
57666
|
+
return new Promise((resolve30, reject2) => {
|
|
57667
|
+
this.waiters.push({ resolve: resolve30, reject: reject2 });
|
|
57653
57668
|
});
|
|
57654
57669
|
}
|
|
57655
57670
|
};
|
|
@@ -149880,11 +149895,11 @@ var init_executable = __esm({
|
|
|
149880
149895
|
|
|
149881
149896
|
// src/machine-connector/runtime/mobius-runtime/worker-protocol.ts
|
|
149882
149897
|
function runtimeWorkerSignal() {
|
|
149883
|
-
let
|
|
149898
|
+
let resolve30;
|
|
149884
149899
|
const promise3 = new Promise((resolvePromise) => {
|
|
149885
|
-
|
|
149900
|
+
resolve30 = resolvePromise;
|
|
149886
149901
|
});
|
|
149887
|
-
return { promise: promise3, resolve:
|
|
149902
|
+
return { promise: promise3, resolve: resolve30 };
|
|
149888
149903
|
}
|
|
149889
149904
|
function readRuntimeWorkerMessage(value) {
|
|
149890
149905
|
if (typeof value === "object" && value !== null && "kind" in value) {
|
|
@@ -149981,6 +149996,7 @@ var init_runtime_host = __esm({
|
|
|
149981
149996
|
init_execution_context();
|
|
149982
149997
|
init_retry_backoff();
|
|
149983
149998
|
init_runtime_types();
|
|
149999
|
+
init_shell_environment();
|
|
149984
150000
|
init_config();
|
|
149985
150001
|
minimumRestartMilliseconds = 1e3;
|
|
149986
150002
|
maximumRestartMilliseconds = 6e4;
|
|
@@ -150054,9 +150070,12 @@ var init_runtime_host = __esm({
|
|
|
150054
150070
|
};
|
|
150055
150071
|
}
|
|
150056
150072
|
async runWorker() {
|
|
150073
|
+
const shellEnvironment = this.environment.current();
|
|
150074
|
+
const searchPath = this.channel.agentSearchPath ?? mergeSearchPath(process.env.PATH, shellEnvironment.PATH);
|
|
150057
150075
|
const environment = {
|
|
150058
150076
|
...process.env,
|
|
150059
|
-
...
|
|
150077
|
+
...shellEnvironment,
|
|
150078
|
+
...searchPath === void 0 ? {} : { PATH: searchPath },
|
|
150060
150079
|
MOXT_MACHINE_HOME: this.store.baseDirectory,
|
|
150061
150080
|
[machineExecutionContextEnvironmentName]: serializeMobiusRuntimeExecutionContext(
|
|
150062
150081
|
this.store.baseDirectory
|
|
@@ -152052,12 +152071,12 @@ function isInactiveTurnInterruptResponse(error64) {
|
|
|
152052
152071
|
}
|
|
152053
152072
|
function createActiveAttempt(claim3, durable, workingDirectory) {
|
|
152054
152073
|
let resolveTerminal = (_value) => void 0;
|
|
152055
|
-
const terminal = new Promise((
|
|
152056
|
-
resolveTerminal =
|
|
152074
|
+
const terminal = new Promise((resolve30) => {
|
|
152075
|
+
resolveTerminal = resolve30;
|
|
152057
152076
|
});
|
|
152058
152077
|
let resolveFatal = (_error) => void 0;
|
|
152059
|
-
const fatal = new Promise((
|
|
152060
|
-
resolveFatal =
|
|
152078
|
+
const fatal = new Promise((resolve30) => {
|
|
152079
|
+
resolveFatal = resolve30;
|
|
152061
152080
|
});
|
|
152062
152081
|
return {
|
|
152063
152082
|
acceptedByAppServer: false,
|
|
@@ -152087,8 +152106,8 @@ function createActiveAttempt(claim3, durable, workingDirectory) {
|
|
|
152087
152106
|
}
|
|
152088
152107
|
function createThreadTitleGenerationState(threadId) {
|
|
152089
152108
|
let resolveCompletion = () => void 0;
|
|
152090
|
-
const completion = new Promise((
|
|
152091
|
-
resolveCompletion =
|
|
152109
|
+
const completion = new Promise((resolve30) => {
|
|
152110
|
+
resolveCompletion = resolve30;
|
|
152092
152111
|
});
|
|
152093
152112
|
const state = {
|
|
152094
152113
|
completed: false,
|
|
@@ -152545,7 +152564,7 @@ async function probeExecutable(executable, environment) {
|
|
|
152545
152564
|
const output3 = [];
|
|
152546
152565
|
child.stdout?.on("data", (chunk) => output3.push(chunk));
|
|
152547
152566
|
try {
|
|
152548
|
-
const code = await new Promise((
|
|
152567
|
+
const code = await new Promise((resolve30, reject2) => {
|
|
152549
152568
|
const timeout = setTimeout(() => {
|
|
152550
152569
|
child.kill("SIGTERM");
|
|
152551
152570
|
reject2(new Error("Executable probe timed out"));
|
|
@@ -152557,7 +152576,7 @@ async function probeExecutable(executable, environment) {
|
|
|
152557
152576
|
});
|
|
152558
152577
|
child.once("close", (exitCode) => {
|
|
152559
152578
|
clearTimeout(timeout);
|
|
152560
|
-
|
|
152579
|
+
resolve30(exitCode ?? 1);
|
|
152561
152580
|
});
|
|
152562
152581
|
});
|
|
152563
152582
|
if (code !== 0) {
|
|
@@ -152578,11 +152597,11 @@ async function waitForAbort2(signal, milliseconds) {
|
|
|
152578
152597
|
if (signal.aborted) {
|
|
152579
152598
|
return;
|
|
152580
152599
|
}
|
|
152581
|
-
await new Promise((
|
|
152600
|
+
await new Promise((resolve30) => {
|
|
152582
152601
|
const complete = () => {
|
|
152583
152602
|
clearTimeout(timeout);
|
|
152584
152603
|
signal.removeEventListener("abort", complete);
|
|
152585
|
-
|
|
152604
|
+
resolve30();
|
|
152586
152605
|
};
|
|
152587
152606
|
const timeout = setTimeout(complete, milliseconds);
|
|
152588
152607
|
timeout.unref();
|
|
@@ -157628,7 +157647,7 @@ async function stopManagedObserver(store) {
|
|
|
157628
157647
|
while (Date.now() < deadline) {
|
|
157629
157648
|
if (!await observerIsRunning(store, pid)) return true;
|
|
157630
157649
|
await new Promise(
|
|
157631
|
-
(
|
|
157650
|
+
(resolve30) => setTimeout(resolve30, connectorStopPollMilliseconds)
|
|
157632
157651
|
);
|
|
157633
157652
|
}
|
|
157634
157653
|
throw new Error(`The managed daemon observer on PID ${pid} did not stop`);
|
|
@@ -164013,7 +164032,7 @@ var init_file_selector = __esm({
|
|
|
164013
164032
|
|
|
164014
164033
|
// src/utils/http.ts
|
|
164015
164034
|
function getUserAgent() {
|
|
164016
|
-
return `moxt-cli/${"0.15.
|
|
164035
|
+
return `moxt-cli/${"0.15.24"} (${(0, import_os10.platform)()}/${(0, import_os10.arch)()}) node/${process.versions.node}`;
|
|
164017
164036
|
}
|
|
164018
164037
|
async function sendRequest(method, path9, init) {
|
|
164019
164038
|
let authentication2;
|
|
@@ -166630,8 +166649,8 @@ var require_common = __commonJS({
|
|
|
166630
166649
|
}
|
|
166631
166650
|
return debug2;
|
|
166632
166651
|
}
|
|
166633
|
-
function extend3(namespace,
|
|
166634
|
-
const newDebug = createDebug(this.namespace + (typeof
|
|
166652
|
+
function extend3(namespace, delimiter5) {
|
|
166653
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter5 === "undefined" ? ":" : delimiter5) + namespace);
|
|
166635
166654
|
newDebug.log = this.log;
|
|
166636
166655
|
return newDebug;
|
|
166637
166656
|
}
|
|
@@ -171937,10 +171956,10 @@ function resolveAll(constructs2, events, context) {
|
|
|
171937
171956
|
const called = [];
|
|
171938
171957
|
let index3 = -1;
|
|
171939
171958
|
while (++index3 < constructs2.length) {
|
|
171940
|
-
const
|
|
171941
|
-
if (
|
|
171942
|
-
events =
|
|
171943
|
-
called.push(
|
|
171959
|
+
const resolve30 = constructs2[index3].resolveAll;
|
|
171960
|
+
if (resolve30 && !called.includes(resolve30)) {
|
|
171961
|
+
events = resolve30(events, context);
|
|
171962
|
+
called.push(resolve30);
|
|
171944
171963
|
}
|
|
171945
171964
|
}
|
|
171946
171965
|
return events;
|
|
@@ -178147,11 +178166,55 @@ async function claimMobiusMachineRegistration(options, signal) {
|
|
|
178147
178166
|
const mobiusPairingId = value["mobiusPairingId"];
|
|
178148
178167
|
const mobiusRelayOrigin = value["mobiusRelayOrigin"];
|
|
178149
178168
|
const outcome = value["outcome"];
|
|
178150
|
-
|
|
178151
|
-
|
|
178169
|
+
const completionRequired = value["completionRequired"];
|
|
178170
|
+
if (typeof mobiusPairingId === "string" && mobiusPairingId.length > 0 && typeof mobiusRelayOrigin === "string" && isAllowedRelayOrigin(mobiusRelayOrigin) && (completionRequired === void 0 || typeof completionRequired === "boolean") && (outcome === "continue" /* Continue */ || outcome === "already_registered" /* AlreadyRegistered */)) {
|
|
178171
|
+
return {
|
|
178172
|
+
mobiusPairingId,
|
|
178173
|
+
mobiusRelayOrigin,
|
|
178174
|
+
outcome,
|
|
178175
|
+
completionRequired: completionRequired === true
|
|
178176
|
+
};
|
|
178152
178177
|
}
|
|
178153
178178
|
throw new Error("Moxt returned an invalid Machine registration response");
|
|
178154
178179
|
}
|
|
178180
|
+
async function completeMobiusMachineRegistration(registration, signal) {
|
|
178181
|
+
const { createMachineRegistrationProof: createMachineRegistrationProof2, MachineRuntimeStore: MachineRuntimeStore3 } = await Promise.resolve().then(() => (init_machine_connector(), machine_connector_exports));
|
|
178182
|
+
const store = new MachineRuntimeStore3();
|
|
178183
|
+
await store.initialize();
|
|
178184
|
+
const proof = await createMachineRegistrationProof2(store, {
|
|
178185
|
+
pairingCode: registration.pairingCode,
|
|
178186
|
+
pairingId: registration.registrationId
|
|
178187
|
+
});
|
|
178188
|
+
const completion = new URL(registration.registrationUrl);
|
|
178189
|
+
completion.pathname = completion.pathname.replace(
|
|
178190
|
+
/\/machine-claim$/u,
|
|
178191
|
+
"/machine-complete"
|
|
178192
|
+
);
|
|
178193
|
+
const response = await fetch(completion, {
|
|
178194
|
+
body: JSON.stringify({
|
|
178195
|
+
devicePublicKey: proof.devicePublicKey,
|
|
178196
|
+
machineSignature: proof.machineSignature,
|
|
178197
|
+
pairingCode: registration.pairingCode
|
|
178198
|
+
}),
|
|
178199
|
+
headers: { "content-type": "application/json" },
|
|
178200
|
+
method: "POST",
|
|
178201
|
+
signal: AbortSignal.any([
|
|
178202
|
+
signal,
|
|
178203
|
+
AbortSignal.timeout(registrationTimeoutMilliseconds)
|
|
178204
|
+
])
|
|
178205
|
+
});
|
|
178206
|
+
const value = parseResponse(await response.text());
|
|
178207
|
+
if (!response.ok) {
|
|
178208
|
+
throw new Error(
|
|
178209
|
+
`Moxt could not finish the Machine registration (${response.status}): ${registrationErrorMessage(value)}. Retry the same connection command.`
|
|
178210
|
+
);
|
|
178211
|
+
}
|
|
178212
|
+
if (!isRecord12(value) || value["ok"] !== true) {
|
|
178213
|
+
throw new Error(
|
|
178214
|
+
"Moxt returned an invalid Machine registration completion response"
|
|
178215
|
+
);
|
|
178216
|
+
}
|
|
178217
|
+
}
|
|
178155
178218
|
async function prepareMobiusMachineWorkspace(rootPath) {
|
|
178156
178219
|
const requested = (0, import_node_path68.resolve)(rootPath);
|
|
178157
178220
|
await (0, import_promises59.mkdir)(requested, { mode: 448, recursive: true });
|
|
@@ -178263,6 +178326,31 @@ var init_mobius_machine_registration = __esm({
|
|
|
178263
178326
|
}
|
|
178264
178327
|
});
|
|
178265
178328
|
|
|
178329
|
+
// src/machine-connector/runtime/mobius-runtime/agent-search-path.ts
|
|
178330
|
+
async function captureAgentSearchPath(searchPath, workingDirectory) {
|
|
178331
|
+
const entries = await Promise.all(
|
|
178332
|
+
searchPath.split(import_node_path69.delimiter).map(async (entry) => {
|
|
178333
|
+
if (entry.length === 0) return entry;
|
|
178334
|
+
const absolutePath = (0, import_node_path69.resolve)(workingDirectory, entry);
|
|
178335
|
+
try {
|
|
178336
|
+
return await (0, import_promises60.realpath)(absolutePath);
|
|
178337
|
+
} catch {
|
|
178338
|
+
return absolutePath;
|
|
178339
|
+
}
|
|
178340
|
+
})
|
|
178341
|
+
);
|
|
178342
|
+
return entries.join(import_node_path69.delimiter);
|
|
178343
|
+
}
|
|
178344
|
+
var import_promises60, import_node_path69;
|
|
178345
|
+
var init_agent_search_path = __esm({
|
|
178346
|
+
"src/machine-connector/runtime/mobius-runtime/agent-search-path.ts"() {
|
|
178347
|
+
"use strict";
|
|
178348
|
+
init_cjs_shims();
|
|
178349
|
+
import_promises60 = require("node:fs/promises");
|
|
178350
|
+
import_node_path69 = require("node:path");
|
|
178351
|
+
}
|
|
178352
|
+
});
|
|
178353
|
+
|
|
178266
178354
|
// src/commands/machine.ts
|
|
178267
178355
|
function registerMachineCommand(program2, cliVersion) {
|
|
178268
178356
|
const machine = program2.command("machine").description("Connect and operate a Local Machine");
|
|
@@ -178430,19 +178518,21 @@ function registerMachineCommand(program2, cliVersion) {
|
|
|
178430
178518
|
}
|
|
178431
178519
|
async function pairAndRunMobiusRuntime(input3) {
|
|
178432
178520
|
await withShutdownSignal(async (signal) => {
|
|
178521
|
+
let registrationCode;
|
|
178433
178522
|
if (input3.registrationId !== void 0) {
|
|
178434
178523
|
if (input3.moxtRelayOrigin === void 0) {
|
|
178435
178524
|
throw new Error(
|
|
178436
178525
|
"--moxt-relay is required for a Moxt Machine registration"
|
|
178437
178526
|
);
|
|
178438
178527
|
}
|
|
178528
|
+
registrationCode = legacyMobiusMachineRegistrationCode(
|
|
178529
|
+
input3.moxtRelayOrigin,
|
|
178530
|
+
input3.registrationId,
|
|
178531
|
+
input3.code
|
|
178532
|
+
);
|
|
178439
178533
|
const registration = await claimMobiusMachineRegistration(
|
|
178440
178534
|
{
|
|
178441
|
-
registration:
|
|
178442
|
-
input3.moxtRelayOrigin,
|
|
178443
|
-
input3.registrationId,
|
|
178444
|
-
input3.code
|
|
178445
|
-
),
|
|
178535
|
+
registration: registrationCode,
|
|
178446
178536
|
rootPath: input3.root
|
|
178447
178537
|
},
|
|
178448
178538
|
signal
|
|
@@ -178453,10 +178543,14 @@ async function pairAndRunMobiusRuntime(input3) {
|
|
|
178453
178543
|
);
|
|
178454
178544
|
return;
|
|
178455
178545
|
}
|
|
178546
|
+
if (!registration.completionRequired) {
|
|
178547
|
+
registrationCode = void 0;
|
|
178548
|
+
}
|
|
178456
178549
|
}
|
|
178457
178550
|
await pairAndRunRuntime(
|
|
178458
178551
|
{
|
|
178459
178552
|
...input3,
|
|
178553
|
+
...registrationCode === void 0 ? {} : { registration: registrationCode },
|
|
178460
178554
|
...input3.moxtRelayOrigin === void 0 ? {} : { apiOrigin: new URL(input3.moxtRelayOrigin).origin }
|
|
178461
178555
|
},
|
|
178462
178556
|
signal
|
|
@@ -178481,6 +178575,7 @@ async function pairAndRunRegisteredMobiusRuntime(input3) {
|
|
|
178481
178575
|
await pairAndRunRuntime(
|
|
178482
178576
|
{
|
|
178483
178577
|
code: input3.registration.pairingCode,
|
|
178578
|
+
...claimed.completionRequired ? { registration: input3.registration } : {},
|
|
178484
178579
|
apiOrigin: new URL(input3.registration.registrationUrl).origin,
|
|
178485
178580
|
pairingId: claimed.mobiusPairingId,
|
|
178486
178581
|
relayOrigin: claimed.mobiusRelayOrigin,
|
|
@@ -178498,9 +178593,13 @@ async function pairAndRunRuntime(input3, signal) {
|
|
|
178498
178593
|
]);
|
|
178499
178594
|
const defaultWorkspace = await prepareMobiusMachineWorkspace(input3.root);
|
|
178500
178595
|
await ensureMobiusDataMigrated(input3.service, signal);
|
|
178596
|
+
const agentSearchPath = await captureAgentSearchPath(
|
|
178597
|
+
process.env.PATH ?? "",
|
|
178598
|
+
process.cwd()
|
|
178599
|
+
);
|
|
178501
178600
|
const engine = new MobiusRuntimeEngine2({
|
|
178502
178601
|
engineDataDir: await currentMobiusEngineDataDirectory2(),
|
|
178503
|
-
agentLaunchEnvironment: process.env
|
|
178602
|
+
agentLaunchEnvironment: { ...process.env, PATH: agentSearchPath }
|
|
178504
178603
|
});
|
|
178505
178604
|
const paired = await engine.pair(
|
|
178506
178605
|
{
|
|
@@ -178511,15 +178610,20 @@ async function pairAndRunRuntime(input3, signal) {
|
|
|
178511
178610
|
},
|
|
178512
178611
|
signal
|
|
178513
178612
|
);
|
|
178514
|
-
await activateMachine(
|
|
178613
|
+
const activation = await activateMachine(
|
|
178515
178614
|
{
|
|
178516
178615
|
channelId: paired.channelId,
|
|
178517
178616
|
...input3.apiOrigin === void 0 ? {} : { apiOrigin: input3.apiOrigin },
|
|
178518
178617
|
mobiusConnectionId: paired.connectionId,
|
|
178618
|
+
agentSearchPath,
|
|
178519
178619
|
workspaceRootPath: defaultWorkspace
|
|
178520
178620
|
},
|
|
178521
178621
|
input3.service
|
|
178522
178622
|
);
|
|
178623
|
+
if (input3.registration !== void 0) {
|
|
178624
|
+
await completeMobiusMachineRegistration(input3.registration, signal);
|
|
178625
|
+
}
|
|
178626
|
+
await reportMachineOutcome(activation, [defaultWorkspace]);
|
|
178523
178627
|
}
|
|
178524
178628
|
async function ensureMobiusDataMigrated(service, signal) {
|
|
178525
178629
|
const {
|
|
@@ -178597,6 +178701,7 @@ async function activateMachine(input3, service) {
|
|
|
178597
178701
|
await store.initialize();
|
|
178598
178702
|
const result = await registerMobiusRuntimeChannel2(store, {
|
|
178599
178703
|
channel: {
|
|
178704
|
+
agentSearchPath: input3.agentSearchPath,
|
|
178600
178705
|
channelId: input3.channelId,
|
|
178601
178706
|
...input3.apiOrigin === void 0 ? {} : { apiOrigin: input3.apiOrigin },
|
|
178602
178707
|
mobiusConnectionId: input3.mobiusConnectionId,
|
|
@@ -178606,7 +178711,7 @@ async function activateMachine(input3, service) {
|
|
|
178606
178711
|
preference: await defaultServiceManagerPreference(),
|
|
178607
178712
|
service: serviceInstallOptions(service)
|
|
178608
178713
|
});
|
|
178609
|
-
|
|
178714
|
+
return result;
|
|
178610
178715
|
}
|
|
178611
178716
|
function serviceInstallOptions(service) {
|
|
178612
178717
|
return {
|
|
@@ -178662,18 +178767,19 @@ function appendOption2(argumentsList, flag, value) {
|
|
|
178662
178767
|
}
|
|
178663
178768
|
}
|
|
178664
178769
|
function defaultMachineWorkspacePath() {
|
|
178665
|
-
return
|
|
178770
|
+
return import_node_path70.default.join((0, import_node_os25.homedir)(), ".moxt", "workspace");
|
|
178666
178771
|
}
|
|
178667
|
-
var import_node_os25,
|
|
178772
|
+
var import_node_os25, import_node_path70;
|
|
178668
178773
|
var init_machine = __esm({
|
|
178669
178774
|
"src/commands/machine.ts"() {
|
|
178670
178775
|
"use strict";
|
|
178671
178776
|
init_cjs_shims();
|
|
178672
178777
|
init_esm();
|
|
178673
178778
|
import_node_os25 = require("node:os");
|
|
178674
|
-
|
|
178779
|
+
import_node_path70 = __toESM(require("node:path"), 1);
|
|
178675
178780
|
init_machine_dump();
|
|
178676
178781
|
init_mobius_machine_registration();
|
|
178782
|
+
init_agent_search_path();
|
|
178677
178783
|
}
|
|
178678
178784
|
});
|
|
178679
178785
|
|
|
@@ -179633,7 +179739,7 @@ async function resolveLinkedLinkTitles(item, workspaceId) {
|
|
|
179633
179739
|
`/files/read-by-url?url=${encodeURIComponent(link.url)}`
|
|
179634
179740
|
);
|
|
179635
179741
|
if (!response.ok || response.data.type !== "file") return link.url;
|
|
179636
|
-
return
|
|
179742
|
+
return import_node_path71.posix.basename(response.data.path) || link.url;
|
|
179637
179743
|
} catch {
|
|
179638
179744
|
return link.url;
|
|
179639
179745
|
}
|
|
@@ -180299,13 +180405,13 @@ function registerRunCommands(workflow) {
|
|
|
180299
180405
|
stopSpinner(true, `Abort accepted: ${pipelineId}`);
|
|
180300
180406
|
});
|
|
180301
180407
|
}
|
|
180302
|
-
var fs8,
|
|
180408
|
+
var fs8, import_node_path71, import_node_util13, MAX_DESC_LENGTH, MAX_COMMENT_CONTENT_LENGTH, MAX_COMMENT_CONTENT_BYTES, WorkflowOptionsError;
|
|
180303
180409
|
var init_workflow = __esm({
|
|
180304
180410
|
"src/commands/workflow.ts"() {
|
|
180305
180411
|
"use strict";
|
|
180306
180412
|
init_cjs_shims();
|
|
180307
180413
|
fs8 = __toESM(require("node:fs"), 1);
|
|
180308
|
-
|
|
180414
|
+
import_node_path71 = require("node:path");
|
|
180309
180415
|
import_node_util13 = require("node:util");
|
|
180310
180416
|
init_file_selector();
|
|
180311
180417
|
init_http();
|
|
@@ -180392,7 +180498,7 @@ var FLUSH_TIMEOUT_MS = 3e3;
|
|
|
180392
180498
|
var MAX_BATCH_SIZE = 100;
|
|
180393
180499
|
function commonLabels() {
|
|
180394
180500
|
return {
|
|
180395
|
-
cli_version: "0.15.
|
|
180501
|
+
cli_version: "0.15.24",
|
|
180396
180502
|
node_version: process.versions.node,
|
|
180397
180503
|
os: (0, import_node_os.platform)(),
|
|
180398
180504
|
arch: (0, import_node_os.arch)(),
|
|
@@ -180438,7 +180544,7 @@ async function flush() {
|
|
|
180438
180544
|
}
|
|
180439
180545
|
const batch = buffer.splice(0, MAX_BATCH_SIZE);
|
|
180440
180546
|
const payload = {
|
|
180441
|
-
release_id: "0.15.
|
|
180547
|
+
release_id: "0.15.24",
|
|
180442
180548
|
client_type: "cli",
|
|
180443
180549
|
metric_data_list: batch.map((m) => ({
|
|
180444
180550
|
profile: "cli",
|
|
@@ -180844,9 +180950,9 @@ void runCli();
|
|
|
180844
180950
|
async function runCli() {
|
|
180845
180951
|
try {
|
|
180846
180952
|
const { createProgram: createProgram2 } = await Promise.resolve().then(() => (init_program(), program_exports));
|
|
180847
|
-
const program2 = createProgram2("0.15.
|
|
180848
|
-
installDaemonReconcileHook(program2, "0.15.
|
|
180849
|
-
installUpdateHook(program2, "0.15.
|
|
180953
|
+
const program2 = createProgram2("0.15.24");
|
|
180954
|
+
installDaemonReconcileHook(program2, "0.15.24");
|
|
180955
|
+
installUpdateHook(program2, "0.15.24", process.argv[1] ?? "");
|
|
180850
180956
|
instrumentProgram(program2);
|
|
180851
180957
|
installExitHandler();
|
|
180852
180958
|
await program2.parseAsync(process.argv);
|