@ashx-j/lunr 0.2.24 → 0.2.25
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/CHANGELOG.md +9 -1
- package/dist/gateway/adapters/discord.d.ts.map +1 -1
- package/dist/gateway/adapters/discord.js +2 -7
- package/dist/gateway/adapters/discord.js.map +1 -1
- package/dist/gateway/adapters/telegram.d.ts.map +1 -1
- package/dist/gateway/adapters/telegram.js +7 -0
- package/dist/gateway/adapters/telegram.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +4 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +57 -17
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/buttons.d.ts.map +1 -1
- package/dist/gateway/buttons.js +29 -19
- package/dist/gateway/buttons.js.map +1 -1
- package/dist/gateway/commands.d.ts +2 -0
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +39 -18
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/config.d.ts +1 -0
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js +2 -0
- package/dist/gateway/config.js.map +1 -1
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +2 -2
- package/dist/gateway/cron.js.map +1 -1
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +26 -26
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts.map +1 -1
- package/dist/gateway/mobile-commands.js +3 -3
- package/dist/gateway/mobile-commands.js.map +1 -1
- package/dist/gateway/presenter.d.ts +12 -1
- package/dist/gateway/presenter.d.ts.map +1 -1
- package/dist/gateway/presenter.js +146 -48
- package/dist/gateway/presenter.js.map +1 -1
- package/dist/gateway/router.d.ts +5 -5
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +95 -41
- package/dist/gateway/router.js.map +1 -1
- package/dist/gateway/service.d.ts.map +1 -1
- package/dist/gateway/service.js +13 -4
- package/dist/gateway/service.js.map +1 -1
- package/dist/gateway/setup.d.ts +5 -0
- package/dist/gateway/setup.d.ts.map +1 -1
- package/dist/gateway/setup.js +98 -42
- package/dist/gateway/setup.js.map +1 -1
- package/dist/gateway/stream.d.ts +6 -5
- package/dist/gateway/stream.d.ts.map +1 -1
- package/dist/gateway/stream.js +24 -11
- package/dist/gateway/stream.js.map +1 -1
- package/dist/node-runtime/{agent-session-services-IEF7LQWD.js → agent-session-services-YXXFCP5J.js} +7 -6
- package/dist/node-runtime/{builtin-extensions-EBAWTH4M.js → builtin-extensions-ZLAX7TUH.js} +1 -1
- package/dist/node-runtime/{chunk-OF7PWMG4.js → chunk-2HHLJWGD.js} +3 -87
- package/dist/node-runtime/{chunk-VWCE2HSZ.js → chunk-2HMIRK7W.js} +4 -4
- package/dist/node-runtime/{chunk-K5AGHH57.js → chunk-3XPLBUEM.js} +1 -1
- package/dist/node-runtime/{chunk-RORY2HMJ.js → chunk-6XL67VVY.js} +1 -1
- package/dist/node-runtime/chunk-7S3T6YEA.js +97 -0
- package/dist/node-runtime/{chunk-R3K2F5GI.js → chunk-B4HP6ZWM.js} +2 -0
- package/dist/node-runtime/{chunk-YVI6L6LU.js → chunk-E4D3IGP2.js} +38 -22
- package/dist/node-runtime/{chunk-5Q3EHOHI.js → chunk-IJIFHRTB.js} +14 -12
- package/dist/node-runtime/{chunk-Y73WPE6S.js → chunk-KWIYUUZK.js} +63 -37
- package/dist/node-runtime/{chunk-F4FLTQKV.js → chunk-LQP3RB67.js} +184 -1527
- package/dist/node-runtime/{chunk-FU6OODRZ.js → chunk-NRKGMJYU.js} +1 -1
- package/dist/node-runtime/{chunk-IGV54Q5V.js → chunk-QTU6AKNJ.js} +128 -63
- package/dist/node-runtime/{chunk-L3LX4SNR.js → chunk-RC7DMV45.js} +5 -5
- package/dist/node-runtime/{chunk-UWPJL22I.js → chunk-SLVOAQOY.js} +15 -4
- package/dist/node-runtime/{chunk-WHLRAGUQ.js → chunk-TORR5XBV.js} +6 -6
- package/dist/node-runtime/{chunk-UP2XBVH5.js → chunk-UOEDI7RP.js} +1 -1
- package/dist/node-runtime/{chunk-DE2JB6J5.js → chunk-VQFSUJJG.js} +2 -2
- package/dist/node-runtime/{chunk-QM43FEAE.js → chunk-WF7PGWRZ.js} +3 -3
- package/dist/node-runtime/chunk-YCUZEGJG.js +1361 -0
- package/dist/node-runtime/{command-7BG7VVTS.js → command-6WDOYKS6.js} +5 -5
- package/dist/node-runtime/{commands-QFDKNQTL.js → commands-QC6VUZJQ.js} +5 -5
- package/dist/node-runtime/{config-RORQUQFG.js → config-D4QUPAHX.js} +1 -1
- package/dist/node-runtime/{gateway-TWR3N65G.js → gateway-INAYBF4Q.js} +134 -78
- package/dist/node-runtime/index.js +15 -12
- package/dist/node-runtime/{install-cli-VAP6KBFN.js → install-cli-KL4UDDAD.js} +3 -3
- package/dist/node-runtime/{interactive-mode-6J5VZ2TT.js → interactive-mode-Z5M7WYYZ.js} +8 -7
- package/dist/node-runtime/{lunr-browser-J5ZZYVGM.js → lunr-browser-IR7TL3J7.js} +3 -3
- package/dist/node-runtime/{lunr-cron-CXOL37AL.js → lunr-cron-LWIZJM2N.js} +5 -5
- package/dist/node-runtime/main.js +12 -10
- package/dist/node-runtime/{mobile-commands-VTBM5DSZ.js → mobile-commands-J7OJEKFO.js} +4 -4
- package/dist/node-runtime/{package-manager-cli-ZLW5DZXF.js → package-manager-cli-VYZM5WHN.js} +10 -7
- package/dist/node-runtime/{pi-subagents-XPCLLKIM.js → pi-subagents-DNY7EAIG.js} +6 -6
- package/dist/node-runtime/rpc-entry.js +12 -10
- package/dist/node-runtime/{runtime-bridges-QYXUX2TG.js → runtime-bridges-VRDDR73P.js} +5 -5
- package/dist/node-runtime/{service-ISSP6VHE.js → service-MDQIPQ26.js} +1 -1
- package/dist/node-runtime/{settings-manager-WCQDUVQB.js → settings-manager-J4SPQPDJ.js} +4 -4
- package/dist/node-runtime/setup-CQ2NLVK5.js +214 -0
- package/dist/node-runtime/{subagent-executor-OTNISDQU.js → subagent-executor-KZZQGAKV.js} +5 -5
- package/dist/node-runtime/{update-cli-VBR2777K.js → update-cli-GTFJC7XK.js} +4 -4
- package/docs/features.md +4 -4
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
- package/dist/node-runtime/setup-YRBKH2LD.js +0 -155
|
@@ -8,11 +8,11 @@ async function handleGatewayCommand(args) {
|
|
|
8
8
|
try {
|
|
9
9
|
let sub = args[1];
|
|
10
10
|
if (sub === "setup")
|
|
11
|
-
await (await import("./setup-
|
|
11
|
+
await (await import("./setup-CQ2NLVK5.js")).setupGateway();
|
|
12
12
|
else if (sub === "pair" && args[2] === "approve" && args.includes("--owner"))
|
|
13
|
-
console.log((await import("./setup-
|
|
13
|
+
console.log((await import("./setup-CQ2NLVK5.js")).approveGatewayOwner(args[3], args[4]));
|
|
14
14
|
else if (["start", "stop", "restart", "status", "logs", "doctor", "autostart"].includes(sub)) {
|
|
15
|
-
let service = await import("./service-
|
|
15
|
+
let service = await import("./service-MDQIPQ26.js");
|
|
16
16
|
if (sub === "start" && console.log(await service.startGatewayService()), sub === "stop" && console.log(await service.stopGatewayService()), sub === "restart" && (await service.stopGatewayService(), console.log(await service.startGatewayService())), (sub === "status" || sub === "doctor") && console.log(service.serviceStatusText()), sub === "logs" && console.log(service.readGatewayLog()), sub === "autostart") {
|
|
17
17
|
let mode = args[2];
|
|
18
18
|
if (mode !== "off" && mode !== "login" && mode !== "boot")
|
|
@@ -20,7 +20,7 @@ async function handleGatewayCommand(args) {
|
|
|
20
20
|
await service.configureStartup(mode), console.log(`Automatic startup: ${mode}`);
|
|
21
21
|
}
|
|
22
22
|
if (sub === "doctor") {
|
|
23
|
-
let { loadGatewayConfig, resolvePlatformToken } = await import("./config-
|
|
23
|
+
let { loadGatewayConfig, resolvePlatformToken } = await import("./config-D4QUPAHX.js"), cfg = loadGatewayConfig();
|
|
24
24
|
for (let platform of ["telegram", "discord"])
|
|
25
25
|
console.log(`${platform}: ${cfg[platform].enabled ? "enabled" : "disabled"}, token ${resolvePlatformToken(platform, cfg[platform]) ? "configured" : "missing"}, owners ${cfg.owners?.[platform].length ?? 0}`);
|
|
26
26
|
console.log(`Project roots: ${cfg.projectRoots?.length ?? 0}. Run lunr gateway setup to change these.
|
|
@@ -32,7 +32,7 @@ lunr gateway autostart off|login|boot
|
|
|
32
32
|
lunr gateway pair approve <platform> <code> [--owner]
|
|
33
33
|
lunr gateway pair list`);
|
|
34
34
|
else {
|
|
35
|
-
let { runGateway } = await import("./gateway-
|
|
35
|
+
let { runGateway } = await import("./gateway-INAYBF4Q.js");
|
|
36
36
|
process.exitCode = await runGateway(sub === "run" ? args.slice(2) : args.slice(1));
|
|
37
37
|
}
|
|
38
38
|
} catch (error) {
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
formatHelpText,
|
|
6
6
|
runChatCommand,
|
|
7
7
|
sendCommandReply
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-E4D3IGP2.js";
|
|
9
|
+
import "./chunk-TORR5XBV.js";
|
|
10
|
+
import "./chunk-QTU6AKNJ.js";
|
|
11
11
|
import "./chunk-RMQZU2YU.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-SLVOAQOY.js";
|
|
13
13
|
import "./chunk-CDVHZOOK.js";
|
|
14
14
|
import "./chunk-GYIXXQAO.js";
|
|
15
15
|
import "./chunk-GJ2RDBRL.js";
|
|
@@ -21,7 +21,7 @@ import "./chunk-2KIPT4HJ.js";
|
|
|
21
21
|
import "./chunk-FVDOXRUD.js";
|
|
22
22
|
import "./chunk-IMLCWLPI.js";
|
|
23
23
|
import "./chunk-UAEOTO52.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-B4HP6ZWM.js";
|
|
25
25
|
import "./chunk-E24EO34J.js";
|
|
26
26
|
import "./chunk-RDDAZOMU.js";
|
|
27
27
|
import "./chunk-FQMM2EZ2.js";
|
|
@@ -3,26 +3,32 @@ import {
|
|
|
3
3
|
AgentBridge,
|
|
4
4
|
QUEUED,
|
|
5
5
|
startGatewayCron
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KWIYUUZK.js";
|
|
7
7
|
import {
|
|
8
8
|
CHAT_COMMANDS,
|
|
9
9
|
botCommandSpecs,
|
|
10
10
|
runChatCommand,
|
|
11
11
|
sendCommandReply
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import
|
|
12
|
+
} from "./chunk-E4D3IGP2.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveWithinRoots
|
|
15
|
+
} from "./chunk-TORR5XBV.js";
|
|
14
16
|
import {
|
|
15
17
|
acceptGatewayInput,
|
|
16
18
|
addAllowedUser,
|
|
17
19
|
bindConversation,
|
|
18
20
|
conversationBinding,
|
|
21
|
+
gatewayEpoch,
|
|
22
|
+
getSession,
|
|
19
23
|
handleApprovalCallback,
|
|
20
24
|
handleCallback,
|
|
21
25
|
invalidateGatewayDialogs,
|
|
22
26
|
isAuthorized,
|
|
23
27
|
isGatewayOwner,
|
|
24
28
|
listSessions,
|
|
29
|
+
queueGatewayText,
|
|
25
30
|
registerGatewayApprovalHandler,
|
|
31
|
+
rememberGatewayRole,
|
|
26
32
|
requireGatewayOwner,
|
|
27
33
|
runWithApprovalContext,
|
|
28
34
|
splitMessage,
|
|
@@ -30,19 +36,19 @@ import {
|
|
|
30
36
|
startGatewayPresenter,
|
|
31
37
|
stopButtonSweeper,
|
|
32
38
|
stopGatewayPresenter
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-QTU6AKNJ.js";
|
|
34
40
|
import {
|
|
35
41
|
createPairingStore
|
|
36
42
|
} from "./chunk-RMQZU2YU.js";
|
|
37
43
|
import {
|
|
38
44
|
claimGateway
|
|
39
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-SLVOAQOY.js";
|
|
40
46
|
import "./chunk-CJECDQKP.js";
|
|
41
47
|
import "./chunk-CDVHZOOK.js";
|
|
42
48
|
import "./chunk-AD6VXAO7.js";
|
|
43
49
|
import {
|
|
44
50
|
isFeatureEnabled
|
|
45
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-2HMIRK7W.js";
|
|
46
52
|
import "./chunk-GYIXXQAO.js";
|
|
47
53
|
import "./chunk-GJ2RDBRL.js";
|
|
48
54
|
import "./chunk-CGBXPL3E.js";
|
|
@@ -61,8 +67,9 @@ import {
|
|
|
61
67
|
gatewayConfigPath,
|
|
62
68
|
loadGatewayConfig,
|
|
63
69
|
platformConfigFor,
|
|
64
|
-
resolvePlatformToken
|
|
65
|
-
|
|
70
|
+
resolvePlatformToken,
|
|
71
|
+
saveGatewayConfig
|
|
72
|
+
} from "./chunk-B4HP6ZWM.js";
|
|
66
73
|
import "./chunk-E24EO34J.js";
|
|
67
74
|
import "./chunk-RDDAZOMU.js";
|
|
68
75
|
import "./chunk-FQMM2EZ2.js";
|
|
@@ -474,16 +481,12 @@ ${event.text}`,
|
|
|
474
481
|
return null;
|
|
475
482
|
try {
|
|
476
483
|
let channel = await this.client.channels.fetch(id);
|
|
477
|
-
if (this.channelCache.set(id, channel), this.channelCache.size > CHANNEL_CACHE_CAP) {
|
|
484
|
+
if (channel && this.channelCache.set(id, channel), this.channelCache.size > CHANNEL_CACHE_CAP) {
|
|
478
485
|
let oldest = this.channelCache.keys().next().value;
|
|
479
486
|
oldest !== void 0 && this.channelCache.delete(oldest);
|
|
480
487
|
}
|
|
481
488
|
return channel;
|
|
482
489
|
} catch {
|
|
483
|
-
if (this.channelCache.set(id, null), this.channelCache.size > CHANNEL_CACHE_CAP) {
|
|
484
|
-
let oldest = this.channelCache.keys().next().value;
|
|
485
|
-
oldest !== void 0 && this.channelCache.delete(oldest);
|
|
486
|
-
}
|
|
487
490
|
return null;
|
|
488
491
|
}
|
|
489
492
|
}
|
|
@@ -933,6 +936,10 @@ ${event.text}`,
|
|
|
933
936
|
let result = await this.callApi("sendMessage", body);
|
|
934
937
|
return { success: !0, messageId: String(result.message_id) };
|
|
935
938
|
} catch (err) {
|
|
939
|
+
if (err instanceof TelegramApiError && err.status === 400 && body.reply_parameters !== void 0 && /message to be replied not found/i.test(err.message)) {
|
|
940
|
+
let { reply_parameters: _dropped, ...plain } = body;
|
|
941
|
+
return this.callSend(plain);
|
|
942
|
+
}
|
|
936
943
|
if (err instanceof TelegramApiError && err.status === 400 && body.parse_mode !== void 0 && MARKDOWN_PARSE_ERROR_RE.test(err.message)) {
|
|
937
944
|
let { parse_mode: _dropped, ...plain } = body;
|
|
938
945
|
return this.callSend(plain);
|
|
@@ -1047,6 +1054,7 @@ var StreamConsumer = class {
|
|
|
1047
1054
|
options;
|
|
1048
1055
|
buffer = "";
|
|
1049
1056
|
flushedLen = 0;
|
|
1057
|
+
lastPreview = "";
|
|
1050
1058
|
messageId = null;
|
|
1051
1059
|
lastFlushAt = 0;
|
|
1052
1060
|
chain = Promise.resolve();
|
|
@@ -1059,9 +1067,9 @@ var StreamConsumer = class {
|
|
|
1059
1067
|
push(delta) {
|
|
1060
1068
|
this.buffer += delta, this.buffer.length - this.flushedLen >= this.options.threshold && this.now() - this.lastFlushAt >= this.options.intervalMs && this.schedule();
|
|
1061
1069
|
}
|
|
1062
|
-
/**
|
|
1070
|
+
/** Wait for pending previews; final delivery belongs to the router. */
|
|
1063
1071
|
async finalize() {
|
|
1064
|
-
return
|
|
1072
|
+
return await this.chain, this.buffer;
|
|
1065
1073
|
}
|
|
1066
1074
|
/** The platform message id of the preview, when one was successfully sent. */
|
|
1067
1075
|
get sentMessageId() {
|
|
@@ -1071,12 +1079,19 @@ var StreamConsumer = class {
|
|
|
1071
1079
|
get truncated() {
|
|
1072
1080
|
return this.buffer.length > this.maxPreview;
|
|
1073
1081
|
}
|
|
1074
|
-
/**
|
|
1082
|
+
/** Preview visible text without a trailing silence-marker fragment. */
|
|
1075
1083
|
preview() {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1084
|
+
let lines = this.buffer.split(`
|
|
1085
|
+
`), last = lines.at(-1)?.trim() ?? "";
|
|
1086
|
+
(SILENCE_MARKERS.has(last) || last && [...SILENCE_MARKERS].some((marker) => marker.startsWith(last))) && lines.pop(), lines.length && isMarkerLine(lines[0]) && lines.shift();
|
|
1087
|
+
let visible = lines.join(`
|
|
1088
|
+
`).trim();
|
|
1089
|
+
if (!visible)
|
|
1090
|
+
return "";
|
|
1091
|
+
if (visible.length <= this.maxPreview)
|
|
1092
|
+
return visible;
|
|
1093
|
+
let cut = this.maxPreview - 3, code = visible.charCodeAt(cut - 1);
|
|
1094
|
+
return code >= 55296 && code <= 56319 && (cut -= 1), `${visible.slice(0, cut)}\u2026`;
|
|
1080
1095
|
}
|
|
1081
1096
|
schedule(force = !1) {
|
|
1082
1097
|
this.chain = this.chain.then(() => this.flush(force)).catch(() => {
|
|
@@ -1086,12 +1101,15 @@ var StreamConsumer = class {
|
|
|
1086
1101
|
if (!(this.buffer.length > this.flushedLen) || !force && this.messageId !== null && this.now() - this.lastFlushAt < this.options.intervalMs)
|
|
1087
1102
|
return;
|
|
1088
1103
|
let text = this.preview();
|
|
1104
|
+
if (!text || text === this.lastPreview)
|
|
1105
|
+
return;
|
|
1106
|
+
let length = this.buffer.length;
|
|
1089
1107
|
if (this.messageId === null) {
|
|
1090
1108
|
if (this.messageId = await this.options.sendInitial(text), this.messageId === null)
|
|
1091
1109
|
return;
|
|
1092
1110
|
} else
|
|
1093
1111
|
await this.options.edit(this.messageId, text);
|
|
1094
|
-
this.flushedLen = this.
|
|
1112
|
+
this.flushedLen = length, this.lastPreview = text, this.lastFlushAt = this.now();
|
|
1095
1113
|
}
|
|
1096
1114
|
};
|
|
1097
1115
|
|
|
@@ -1118,10 +1136,12 @@ function createRouter(deps) {
|
|
|
1118
1136
|
}
|
|
1119
1137
|
return initialCfg;
|
|
1120
1138
|
}
|
|
1121
|
-
async function sendError(adapter, event, message) {
|
|
1122
|
-
await
|
|
1139
|
+
async function sendError(adapter, event, key, cfg, message, epoch) {
|
|
1140
|
+
await queueGatewayText(key, event.source, adapter, `\u26A0 ${oneLine(message)}`, {
|
|
1141
|
+
kind: "notice",
|
|
1123
1142
|
replyTo: event.messageId,
|
|
1124
|
-
|
|
1143
|
+
cfg,
|
|
1144
|
+
epoch
|
|
1125
1145
|
});
|
|
1126
1146
|
}
|
|
1127
1147
|
function isGroupGated(event, cfg) {
|
|
@@ -1141,7 +1161,23 @@ function createRouter(deps) {
|
|
|
1141
1161
|
if (source.chatType !== "dm" || cfg.unauthorizedDmBehavior !== "pair")
|
|
1142
1162
|
return !0;
|
|
1143
1163
|
let code = pairing.issueCode(source.platform, source.userId);
|
|
1144
|
-
return code === null || await adapter.send(source.chatId, `Your lunR pairing code: ${formatPairingCode(code)}
|
|
1164
|
+
return code === null || await adapter.send(source.chatId, `Your lunR pairing code: ${formatPairingCode(code)}. Ask the computer's owner to run lunr gateway pair approve ${source.platform} ${formatPairingCode(code)} --owner if this is their account. Approval without --owner grants chat access only.`, { replyTo: event.messageId, threadId: source.threadId }), !0;
|
|
1165
|
+
}
|
|
1166
|
+
function workspaceReadiness(event, key, cfg) {
|
|
1167
|
+
if (getSession(key) || conversationBinding(key)?.cwd)
|
|
1168
|
+
return;
|
|
1169
|
+
if (!isGatewayOwner(event.source, cfg))
|
|
1170
|
+
return "This chat is paired but has no project. Ask the computer's gateway owner to configure your access locally. /project and /continue require owner access.";
|
|
1171
|
+
let root = cfg.defaultProject;
|
|
1172
|
+
if (!root)
|
|
1173
|
+
return "No default project selected. Use /project in this private chat to choose an approved folder.";
|
|
1174
|
+
try {
|
|
1175
|
+
let cwd = resolveWithinRoots(root, cfg.projectRoots ?? []);
|
|
1176
|
+
bindConversation(key, event.source, { cwd, owner: event.source.userId });
|
|
1177
|
+
return;
|
|
1178
|
+
} catch {
|
|
1179
|
+
return "Default project is no longer an approved folder. Use /project to choose an approved folder.";
|
|
1180
|
+
}
|
|
1145
1181
|
}
|
|
1146
1182
|
async function handleSlash(adapter, event, key) {
|
|
1147
1183
|
let text = event.text.trim();
|
|
@@ -1149,7 +1185,7 @@ function createRouter(deps) {
|
|
|
1149
1185
|
return !1;
|
|
1150
1186
|
let firstToken = text.split(/\s+/, 1)[0].toLowerCase(), commandWord = firstToken.split("@")[0].slice(1), args = text.slice(firstToken.length).trim();
|
|
1151
1187
|
if (deps.remoteControls) {
|
|
1152
|
-
let { handleMobileCommand, cancelMobileTransfer } = await import("./mobile-commands-
|
|
1188
|
+
let { handleMobileCommand, cancelMobileTransfer } = await import("./mobile-commands-J7OJEKFO.js");
|
|
1153
1189
|
if (["stop", "stopall", "new", "cancel"].includes(commandWord) && cancelMobileTransfer(key), commandWord === "cancel")
|
|
1154
1190
|
return invalidateGatewayDialogs(key), await adapter.send(event.source.chatId, "Cancelled the pending selection or transfer.", {
|
|
1155
1191
|
threadId: event.source.threadId
|
|
@@ -1159,6 +1195,23 @@ function createRouter(deps) {
|
|
|
1159
1195
|
if (!event.text.startsWith("/"))
|
|
1160
1196
|
return !1;
|
|
1161
1197
|
}
|
|
1198
|
+
if (commandWord === "start") {
|
|
1199
|
+
let issue = deps.remoteControls ? workspaceReadiness(event, key, freshCfg()) : void 0;
|
|
1200
|
+
if (issue)
|
|
1201
|
+
return await sendCommandReply(adapter, event, issue), !0;
|
|
1202
|
+
try {
|
|
1203
|
+
let session = await bridge.getSession(key, !0), models = await session?.modelRuntime.getAvailable();
|
|
1204
|
+
models?.length ? !session?.model || !models.some((model) => model.id === session.model?.id && model.provider === session.model.provider) ? await sendCommandReply(adapter, event, "No available model selected. Use /model here to choose one.") : await sendCommandReply(adapter, event, "Ready. Send a message to begin, or use /model to choose a model.") : await sendCommandReply(adapter, event, "No authenticated model available. Use /login on your computer, then try /start again.");
|
|
1205
|
+
} catch {
|
|
1206
|
+
await sendCommandReply(adapter, event, "Session setup failed. Run lunr gateway doctor on your computer, then try /start again.");
|
|
1207
|
+
}
|
|
1208
|
+
return !0;
|
|
1209
|
+
}
|
|
1210
|
+
if (deps.remoteControls && commandWord === "model") {
|
|
1211
|
+
let issue = workspaceReadiness(event, key, freshCfg());
|
|
1212
|
+
if (issue)
|
|
1213
|
+
return await sendCommandReply(adapter, event, issue), !0;
|
|
1214
|
+
}
|
|
1162
1215
|
let cmd = CHAT_COMMANDS.find((c) => c.name === commandWord || c.aliases?.includes(commandWord));
|
|
1163
1216
|
if (!cmd)
|
|
1164
1217
|
return event.source.chatType !== "dm";
|
|
@@ -1167,36 +1220,37 @@ function createRouter(deps) {
|
|
|
1167
1220
|
key,
|
|
1168
1221
|
adapter,
|
|
1169
1222
|
bridge,
|
|
1223
|
+
cfg: freshCfg(),
|
|
1170
1224
|
args,
|
|
1171
1225
|
reply: (message) => sendCommandReply(adapter, event, message)
|
|
1172
1226
|
};
|
|
1173
1227
|
return runWithApprovalContext({ key, adapter, source: event.source }, () => runChatCommand(cmd, ctx));
|
|
1174
1228
|
}
|
|
1175
|
-
async function deliver(adapter, event, text, opts) {
|
|
1229
|
+
async function deliver(adapter, event, text, key, cfg, opts) {
|
|
1176
1230
|
let filtered = applySilenceFilter(text);
|
|
1177
|
-
if (filtered
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1231
|
+
if (filtered !== null) {
|
|
1232
|
+
if (opts.editMessageId) {
|
|
1233
|
+
let chunks = splitMessage(filtered, adapter.maxMessageLength);
|
|
1234
|
+
if ((await adapter.editMessage(event.source.chatId, opts.editMessageId, opts.previewTruncated ? chunks[0] : filtered).catch(() => ({ success: !1 }))).success) {
|
|
1235
|
+
if (!opts.previewTruncated)
|
|
1236
|
+
return;
|
|
1237
|
+
await queueGatewayText(key, event.source, adapter, chunks.slice(1).join(""), {
|
|
1238
|
+
kind: "result",
|
|
1239
|
+
cfg,
|
|
1240
|
+
chunks: chunks.slice(1)
|
|
1241
|
+
});
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1184
1244
|
}
|
|
1185
|
-
await
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
replyTo: opts.reply && index === 0 ? event.messageId : void 0,
|
|
1190
|
-
threadId: event.source.threadId
|
|
1245
|
+
await queueGatewayText(key, event.source, adapter, filtered, {
|
|
1246
|
+
kind: "result",
|
|
1247
|
+
replyTo: opts.reply ? event.messageId : void 0,
|
|
1248
|
+
cfg
|
|
1191
1249
|
});
|
|
1192
|
-
if (!result.success) {
|
|
1193
|
-
console.error(`[gateway] send failed on ${adapter.platform}: ${result.error ?? "unknown error"}`);
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
1250
|
}
|
|
1197
1251
|
}
|
|
1198
1252
|
async function runTurn(adapter, event, key, cfg) {
|
|
1199
|
-
let streaming = cfg.streaming.enabled && typeof adapter.editMessage == "function", consumer;
|
|
1253
|
+
let epoch = gatewayEpoch(key), streaming = cfg.streaming.enabled && typeof adapter.editMessage == "function", consumer;
|
|
1200
1254
|
streaming && (consumer = new StreamConsumer({
|
|
1201
1255
|
sendInitial: async (text) => {
|
|
1202
1256
|
let result2 = await adapter.send(event.source.chatId, text, {
|
|
@@ -1206,7 +1260,9 @@ function createRouter(deps) {
|
|
|
1206
1260
|
return result2.success ? result2.messageId ?? null : null;
|
|
1207
1261
|
},
|
|
1208
1262
|
edit: async (messageId, text) => {
|
|
1209
|
-
await adapter.editMessage(event.source.chatId, messageId, text);
|
|
1263
|
+
let result2 = await adapter.editMessage(event.source.chatId, messageId, text);
|
|
1264
|
+
if (!result2.success)
|
|
1265
|
+
throw new Error(result2.error ?? "Preview edit failed");
|
|
1210
1266
|
},
|
|
1211
1267
|
intervalMs: cfg.streaming.editIntervalMs,
|
|
1212
1268
|
threshold: cfg.streaming.bufferThreshold,
|
|
@@ -1215,13 +1271,13 @@ function createRouter(deps) {
|
|
|
1215
1271
|
let callbacks = {
|
|
1216
1272
|
onDelta: consumer ? (delta) => consumer.push(delta) : void 0,
|
|
1217
1273
|
onFollowUpResult: (text) => {
|
|
1218
|
-
deliver(adapter, event, text, { reply: !1 });
|
|
1274
|
+
deliver(adapter, event, text, key, cfg, { reply: !1 }).catch((error) => console.error("[gateway] follow-up delivery failed:", error));
|
|
1219
1275
|
},
|
|
1220
1276
|
onError: (message) => {
|
|
1221
|
-
sendError(adapter, event, message);
|
|
1277
|
+
sendError(adapter, event, key, cfg, message, epoch).catch((error) => console.error("[gateway] error delivery failed:", error));
|
|
1222
1278
|
}
|
|
1223
1279
|
}, result = await runWithApprovalContext({ key, adapter, source: event.source }, () => bridge.runTurn(key, event, callbacks));
|
|
1224
|
-
result !== QUEUED && (consumer && await consumer.finalize(), await deliver(adapter, event, result, {
|
|
1280
|
+
result !== QUEUED && (consumer && await consumer.finalize(), await deliver(adapter, event, result, key, cfg, {
|
|
1225
1281
|
reply: !consumer,
|
|
1226
1282
|
editMessageId: consumer?.sentMessageId ?? void 0,
|
|
1227
1283
|
previewTruncated: consumer?.truncated ?? !1
|
|
@@ -1232,11 +1288,10 @@ function createRouter(deps) {
|
|
|
1232
1288
|
let adapter = adapters.get(event.source.platform);
|
|
1233
1289
|
if (!adapter)
|
|
1234
1290
|
return;
|
|
1235
|
-
let cfg = freshCfg();
|
|
1291
|
+
let cfg = freshCfg(), key = buildSessionKey(event.source, { groupSessionsPerUser: cfg.groupSessionsPerUser }), epoch = gatewayEpoch(key);
|
|
1236
1292
|
try {
|
|
1237
|
-
if (isGroupGated(event, cfg) || await isDenied(adapter, event, cfg))
|
|
1293
|
+
if (isGroupGated(event, cfg) || (rememberGatewayRole(key, event.source), await isDenied(adapter, event, cfg)))
|
|
1238
1294
|
return;
|
|
1239
|
-
let key = buildSessionKey(event.source, { groupSessionsPerUser: cfg.groupSessionsPerUser });
|
|
1240
1295
|
if (deps.remoteControls) {
|
|
1241
1296
|
let binding = conversationBinding(key);
|
|
1242
1297
|
if (binding?.owner && (requireGatewayOwner(event.source, cfg), binding.owner !== event.source.userId))
|
|
@@ -1246,10 +1301,15 @@ function createRouter(deps) {
|
|
|
1246
1301
|
}
|
|
1247
1302
|
if (await handleSlash(adapter, event, key))
|
|
1248
1303
|
return;
|
|
1304
|
+
let issue = deps.remoteControls ? workspaceReadiness(event, key, cfg) : void 0;
|
|
1305
|
+
if (issue) {
|
|
1306
|
+
await sendCommandReply(adapter, event, issue);
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1249
1309
|
await adapter.sendTyping(event.source.chatId, event.source.threadId).catch(() => {
|
|
1250
1310
|
}), await runTurn(adapter, event, key, cfg);
|
|
1251
1311
|
} catch (err) {
|
|
1252
|
-
await sendError(adapter, event, err instanceof Error ? err.message : String(err)).catch(() => {
|
|
1312
|
+
await sendError(adapter, event, key, cfg, err instanceof Error ? err.message : String(err), epoch).catch(() => {
|
|
1253
1313
|
});
|
|
1254
1314
|
}
|
|
1255
1315
|
}
|
|
@@ -1261,16 +1321,8 @@ var ADAPTER_FACTORIES = {
|
|
|
1261
1321
|
telegram: (cfg) => new TelegramAdapter(cfg),
|
|
1262
1322
|
discord: (cfg) => new DiscordAdapter(cfg)
|
|
1263
1323
|
}, KNOWN_PLATFORMS = ["telegram", "discord"], SETUP_INSTRUCTIONS = {
|
|
1264
|
-
telegram: [
|
|
1265
|
-
|
|
1266
|
-
" <agentDir>/gateway.json (telegram.token) or export LUNR_TELEGRAM_BOT_TOKEN,",
|
|
1267
|
-
" then set telegram.enabled = true."
|
|
1268
|
-
],
|
|
1269
|
-
discord: [
|
|
1270
|
-
"Discord: discord.com/developers \u2192 New Application \u2192 Bot \u2192 copy the token into",
|
|
1271
|
-
" <agentDir>/gateway.json (discord.token) or export LUNR_DISCORD_BOT_TOKEN,",
|
|
1272
|
-
" enable the MESSAGE CONTENT intent, then set discord.enabled = true."
|
|
1273
|
-
]
|
|
1324
|
+
telegram: ["Telegram: run lunr gateway setup locally to configure the bot token and owner ID."],
|
|
1325
|
+
discord: ["Discord: run lunr gateway setup locally to configure the bot token and owner ID."]
|
|
1274
1326
|
};
|
|
1275
1327
|
function printSetupInstructions(enabledButUnrunnable) {
|
|
1276
1328
|
console.log("lunR gateway: no runnable platforms configured.");
|
|
@@ -1280,18 +1332,24 @@ function printSetupInstructions(enabledButUnrunnable) {
|
|
|
1280
1332
|
for (let line of SETUP_INSTRUCTIONS[platform])
|
|
1281
1333
|
console.log(line);
|
|
1282
1334
|
}
|
|
1283
|
-
async function runPairApprove(platform, code) {
|
|
1335
|
+
async function runPairApprove(platform, code, owner = !1) {
|
|
1284
1336
|
if (!code)
|
|
1285
|
-
return console.error("Usage: lunr gateway pair approve <platform> <code>"), 1;
|
|
1337
|
+
return console.error("Usage: lunr gateway pair approve <platform> <code> [--owner]"), 1;
|
|
1286
1338
|
let userId = createPairingStore().approve(platform, code);
|
|
1287
1339
|
if (userId === null)
|
|
1288
1340
|
return console.error(`Pairing failed: no valid pending code "${code}" for ${platform} (wrong, expired, or locked out).`), 1;
|
|
1289
1341
|
try {
|
|
1290
|
-
|
|
1342
|
+
if (owner) {
|
|
1343
|
+
let cfg = loadGatewayConfig();
|
|
1344
|
+
if (platform !== "telegram" && platform !== "discord")
|
|
1345
|
+
throw new Error("Unknown platform.");
|
|
1346
|
+
cfg.owners ??= { telegram: [], discord: [] }, cfg.owners[platform] = [.../* @__PURE__ */ new Set([...cfg.owners[platform], userId])], cfg[platform].allowedUsers = [.../* @__PURE__ */ new Set([...cfg[platform].allowedUsers, userId])], saveGatewayConfig(cfg);
|
|
1347
|
+
} else
|
|
1348
|
+
addAllowedUser(platform, userId);
|
|
1291
1349
|
} catch (err) {
|
|
1292
1350
|
return console.error(`Paired ${platform} user ${userId}, but could not persist allowedUsers: ${err}`), 1;
|
|
1293
1351
|
}
|
|
1294
|
-
return console.log(`Approved ${platform} user ${userId}
|
|
1352
|
+
return console.log(`Approved ${platform} user ${userId}${owner ? " as owner with local project and TUI access" : " for chat only; owner access requires local --owner approval"}.`), 0;
|
|
1295
1353
|
}
|
|
1296
1354
|
function runPairList() {
|
|
1297
1355
|
let pairing = createPairingStore(), pending = pairing.listPending(), approved = pairing.listApproved();
|
|
@@ -1359,19 +1417,17 @@ async function runDaemon() {
|
|
|
1359
1417
|
await bridge.shutdown(), await Promise.all([...adapters.values()].map((adapter) => adapter.disconnect().catch(() => {
|
|
1360
1418
|
}))), stopGatewayPresenter(), owner.release(), process.removeListener("SIGINT", shutdown), process.removeListener("SIGTERM", shutdown), finish();
|
|
1361
1419
|
})().catch((error) => {
|
|
1362
|
-
console.error("Gateway shutdown failed:", error instanceof Error ? error.message : String(error)), stopping = !1, owner.update(platformStatus, "ready"), startButtonSweeper(), cron = startGatewayCron({ adapters, cfg });
|
|
1420
|
+
console.error("Gateway shutdown failed:", error instanceof Error ? error.message : String(error)), stopping = !1, owner.update(platformStatus, Object.values(platformStatus).includes("connected") ? "ready" : "starting"), startButtonSweeper(), cron = startGatewayCron({ adapters, cfg });
|
|
1363
1421
|
for (let [platform, adapter] of adapters)
|
|
1364
1422
|
platformStatus[platform] !== "connected" && connect(platform, adapter);
|
|
1365
1423
|
});
|
|
1366
1424
|
}
|
|
1367
1425
|
}, owner = claimGateway(shutdown);
|
|
1368
|
-
process.on("SIGINT", shutdown), process.on("SIGTERM", shutdown), startGatewayPresenter(adapters);
|
|
1369
|
-
let connected = [];
|
|
1370
|
-
startButtonSweeper();
|
|
1426
|
+
process.on("SIGINT", shutdown), process.on("SIGTERM", shutdown), startGatewayPresenter(adapters), startButtonSweeper();
|
|
1371
1427
|
let connect = async (platform, adapter) => {
|
|
1372
1428
|
if (!stopping) {
|
|
1373
1429
|
try {
|
|
1374
|
-
if (platformStatus[platform] = "connecting", owner.update(platformStatus, "starting"), !await adapter.connect())
|
|
1430
|
+
if (platformStatus[platform] = "connecting", owner.update(platformStatus, Object.values(platformStatus).includes("connected") ? "ready" : "starting"), !await adapter.connect())
|
|
1375
1431
|
throw new Error("Connection failed");
|
|
1376
1432
|
adapter.onMessage((event) => {
|
|
1377
1433
|
router.handleEvent(event);
|
|
@@ -1387,9 +1443,9 @@ async function runDaemon() {
|
|
|
1387
1443
|
await adapter.disconnect();
|
|
1388
1444
|
return;
|
|
1389
1445
|
}
|
|
1390
|
-
|
|
1446
|
+
platformStatus[platform] = "connected", console.log(`lunR gateway: ${platform} connected`);
|
|
1391
1447
|
} catch {
|
|
1392
|
-
if (platformStatus[platform] = "disconnected, retrying", await adapter.disconnect().catch(() => {
|
|
1448
|
+
if (platformStatus[platform] = "disconnected, retrying (check gateway logs)", await adapter.disconnect().catch(() => {
|
|
1393
1449
|
}), !stopping) {
|
|
1394
1450
|
let retry = setTimeout(() => {
|
|
1395
1451
|
retries.delete(retry), connect(platform, adapter);
|
|
@@ -1397,18 +1453,18 @@ async function runDaemon() {
|
|
|
1397
1453
|
retries.add(retry);
|
|
1398
1454
|
}
|
|
1399
1455
|
}
|
|
1400
|
-
stopping || owner.update(platformStatus);
|
|
1456
|
+
stopping || owner.update(platformStatus, Object.values(platformStatus).includes("connected") ? "ready" : "starting");
|
|
1401
1457
|
}
|
|
1402
1458
|
};
|
|
1403
1459
|
for (let [platform, adapter] of adapters)
|
|
1404
1460
|
connect(platform, adapter);
|
|
1405
|
-
return cron = startGatewayCron({ adapters, cfg }), console.log(`lunR gateway: cron scheduler started (${cron.intervalMs / 1e3}s interval)`), owner.update(platformStatus), await stopped, 0;
|
|
1461
|
+
return cron = startGatewayCron({ adapters, cfg }), console.log(`lunR gateway: cron scheduler started (${cron.intervalMs / 1e3}s interval)`), owner.update(platformStatus, "starting"), await stopped, 0;
|
|
1406
1462
|
}
|
|
1407
1463
|
async function runGateway(args) {
|
|
1408
1464
|
let [sub, ...rest] = args;
|
|
1409
1465
|
if (sub === "pair") {
|
|
1410
|
-
let [action, platform, code] = rest;
|
|
1411
|
-
return action === "approve" && platform ? runPairApprove(platform, code) : action === "list" ? runPairList() : (console.error("Usage: lunr gateway pair approve <platform> <code> | lunr gateway pair list"), 1);
|
|
1466
|
+
let [action, platform, code, flag] = rest;
|
|
1467
|
+
return action === "approve" && platform && (flag === void 0 || flag === "--owner") ? runPairApprove(platform, code, flag === "--owner") : action === "list" ? runPairList() : (console.error("Usage: lunr gateway pair approve <platform> <code> [--owner] | lunr gateway pair list"), 1);
|
|
1412
1468
|
}
|
|
1413
1469
|
return sub === "status" ? runStatus() : sub === void 0 ? runDaemon() : (console.error(`Unknown gateway sub-command "${sub}". Expected: pair approve | pair list | status`), 1);
|
|
1414
1470
|
}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
TreeSelectorComponent,
|
|
20
20
|
UserMessageComponent,
|
|
21
21
|
UserMessageSelectorComponent
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RC7DMV45.js";
|
|
23
23
|
import {
|
|
24
24
|
attachJsonlLineReader,
|
|
25
25
|
runRpcMode,
|
|
@@ -39,9 +39,10 @@ import "./chunk-RWTKOC3B.js";
|
|
|
39
39
|
import "./chunk-7N3YHTYF.js";
|
|
40
40
|
import {
|
|
41
41
|
main
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-IJIFHRTB.js";
|
|
43
|
+
import "./chunk-WF7PGWRZ.js";
|
|
44
|
+
import "./chunk-7S3T6YEA.js";
|
|
45
|
+
import "./chunk-2HHLJWGD.js";
|
|
45
46
|
import "./chunk-YPHAIRZT.js";
|
|
46
47
|
import "./chunk-PL6JKXWI.js";
|
|
47
48
|
import "./chunk-5ZH3ZFIZ.js";
|
|
@@ -57,10 +58,9 @@ import {
|
|
|
57
58
|
parseSkillBlock,
|
|
58
59
|
wrapRegisteredTool,
|
|
59
60
|
wrapRegisteredTools
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-VQFSUJJG.js";
|
|
61
62
|
import "./chunk-CCCN2UCX.js";
|
|
62
63
|
import {
|
|
63
|
-
DefaultPackageManager,
|
|
64
64
|
DefaultResourceLoader,
|
|
65
65
|
createEventBus,
|
|
66
66
|
createExtensionRuntime,
|
|
@@ -70,7 +70,10 @@ import {
|
|
|
70
70
|
loadProjectContextFiles,
|
|
71
71
|
loadSkills,
|
|
72
72
|
loadSkillsFromDir
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-YCUZEGJG.js";
|
|
74
|
+
import {
|
|
75
|
+
DefaultPackageManager
|
|
76
|
+
} from "./chunk-LQP3RB67.js";
|
|
74
77
|
import "./chunk-OBMWP3I5.js";
|
|
75
78
|
import "./chunk-DVGWF6A2.js";
|
|
76
79
|
import {
|
|
@@ -120,12 +123,12 @@ import {
|
|
|
120
123
|
ModelRuntime,
|
|
121
124
|
readStoredCredential
|
|
122
125
|
} from "./chunk-KJ6DWS3K.js";
|
|
123
|
-
import "./chunk-
|
|
126
|
+
import "./chunk-NRKGMJYU.js";
|
|
124
127
|
import {
|
|
125
128
|
SettingsManager
|
|
126
|
-
} from "./chunk-
|
|
127
|
-
import "./chunk-
|
|
128
|
-
import "./chunk-
|
|
129
|
+
} from "./chunk-6XL67VVY.js";
|
|
130
|
+
import "./chunk-UOEDI7RP.js";
|
|
131
|
+
import "./chunk-2HMIRK7W.js";
|
|
129
132
|
import {
|
|
130
133
|
ProjectTrustStore,
|
|
131
134
|
hasTrustRequiringProjectResources
|
|
@@ -213,7 +216,7 @@ import {
|
|
|
213
216
|
isToolCallEventType,
|
|
214
217
|
isWriteToolResult
|
|
215
218
|
} from "./chunk-OR4L3IB2.js";
|
|
216
|
-
import "./chunk-
|
|
219
|
+
import "./chunk-B4HP6ZWM.js";
|
|
217
220
|
import {
|
|
218
221
|
parseArgs
|
|
219
222
|
} from "./chunk-E24EO34J.js";
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
loadInstallFeatures,
|
|
13
13
|
parseFeatureFlags,
|
|
14
14
|
saveInstallFeatures
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2HMIRK7W.js";
|
|
16
16
|
import {
|
|
17
17
|
loadGatewayConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B4HP6ZWM.js";
|
|
19
19
|
import {
|
|
20
20
|
APP_NAME,
|
|
21
21
|
NPM_CLI_PACKAGE,
|
|
@@ -132,7 +132,7 @@ async function runSetup(argv) {
|
|
|
132
132
|
for (let id of applied.disabledIds)
|
|
133
133
|
await FEATURE_HANDLERS[id].disable({ purgeSecrets: !1 });
|
|
134
134
|
} else
|
|
135
|
-
return await (await import("./setup-
|
|
135
|
+
return await (await import("./setup-CQ2NLVK5.js")).setupGateway(), 0;
|
|
136
136
|
let { installBrowser } = await import("./setup-JBKOLJ6F.js");
|
|
137
137
|
return await installBrowser(!1), saveInstallFeatures(next), appendInstallLog(`setup installerVersion=${VERSION}`), console.log(`Writing ${getAgentDir()}/install-features.json`), console.log(`
|
|
138
138
|
Next:`), console.log(` 1. Restart this shell (or add ${resolveInstallPrefix()}/bin to PATH)`), console.log(` 2. Run: ${APP_NAME}`), console.log(" 3. In the TUI: /login"), 0;
|