@chibitek/chibi 0.1.210 → 0.1.213
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/assets/{TerminalPanel-DxQoOfkY.js → TerminalPanel-mkQO42zG.js} +1 -1
- package/dist/assets/{abnfDiagram-O67JEVCF-Ds2qYdjS.js → abnfDiagram-O67JEVCF-D_YvZb12.js} +1 -1
- package/dist/assets/{arc-1O9tchZk.js → arc-u7NcCAzn.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-CWuQ1x2F.js → architectureDiagram-NJMV4G6O-CvoIt_0y.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-CNcEkXEx.js → blockDiagram-BEXU5L5S-B0Ry3uOJ.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-BKI_wi9I.js → c4Diagram-YGBWAQC7-DQQBHqDt.js} +1 -1
- package/dist/assets/channel-BG3AR6Y6.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-gO88emfN.js → chunk-2Q5K7J3B-B4IxGiPz.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-DbKNT_-r.js → chunk-3FUC2YCW-BxR5i6Mq.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-BbJCoZVg.js → chunk-5VM5RSS4-CqmFQLrB.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-DXurSCcp.js → chunk-GTNCS2PH-C9lKwjYE.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-BWyt0I_m.js → chunk-GWA4HPMP-DKAnucqk.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-6iWSsogl.js → chunk-JWPE2WC7-CE4DRhto.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-CFoqO9Hw.js → chunk-NETBCI7D-UziBzgi9.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-BZEzAlNi.js → chunk-WEXAMYUT-DVo_P12S.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-W4hfC50f.js → chunk-XXDRQBXY-CBwStBk5.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-BsGmL9e7.js → classDiagram-v2-NBCMYWYE-D4xfjrAt.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-CYtTgIzk.js → cose-bilkent-JH36ORCC-DNpZWduJ.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-DLOi2Q2V.js → cynefin-OW5HDTMX-CMegK4fD.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-BXcXJ3hv.js → cynefinDiagram-VND7K2PF-BBRJHq6u.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-BdBOiuzt.js → dagre-6A5THRUB-BwneJkAI.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-DCf3M4WE.js → diagram-22UHCM2B-p4tq7l1f.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-CzdF-UXi.js → diagram-3UASUU5V-C8BCnB5c.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-_UmmlMOD.js → diagram-ATOU4E4O-Da-Fc2pA.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-DrQODVuX.js → diagram-CDSNMT55-CH7l4Als.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-CE16iJlJ.js → diagram-MLGK6HIB-xO-efOVl.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-DJuTbhbP.js → diagram-MPIPVDR6-CjWQ4FpH.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-f1VEI2Po.js → ebnfDiagram-ZINNZB2B-DbyEj47I.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-BRbs9WzY.js → elk-276RUBZZ-B0uak8Gs.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-DvMp_cQr.js → erDiagram-OPXOYQCR-DHYzl46p.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-CYS1A0fu.js → flowDiagram-KWPJA3E3-CjUIIif9.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-qya_JE9x.js → ganttDiagram-FUAMR5RP-CPjVOkNO.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-ChMUJ3hH.js → gitGraphDiagram-X574FWY7-DnI_xNjh.js} +1 -1
- package/dist/assets/{index-COH7BlyH.js → index-C8wABnWu.js} +177 -177
- package/dist/assets/{index-xE4Li_H2.js → index-kYL6p_po.js} +1 -1
- package/dist/assets/{infoDiagram-VRGFBTTK-B2VudqsE.js → infoDiagram-VRGFBTTK-SXQSkFFT.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-Bdk47y0t.js → ishikawaDiagram-OU5B5YK6-DF3AQU1D.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-A4StgNQ9.js → journeyDiagram-ZHPQQLJL-IWRv1Evh.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-DZo45dQw.js → kanban-definition-PNTS6WVX-BKpuGZmD.js} +1 -1
- package/dist/assets/{linear-D_rK-Ord.js → linear-S9gqQWWc.js} +1 -1
- package/dist/assets/{mermaid.core-C7CvDDvz.js → mermaid.core-BHRIdye5.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-6fmVPMyc.js → mindmap-definition-NLK3R4M7-BTD52Pxv.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-CD4Qg24h.js → pegDiagram-GJSIUBJH-C91CNvYA.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-DmzQ883B.js → pieDiagram-5QR66LMP-0aP3PVSg.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-BW37utPZ.js → quadrantDiagram-O4NWA36T-CN-CB1dj.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-CWXiMlAb.js → railroadDiagram-XR7U4H2S-DUwKNVqn.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-DHSfr9U3.js → requirementDiagram-PLB6GJNP-BwiKCqXR.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-PebTt4eq.js → sankeyDiagram-IPEJSGJF-DK2nk983.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-DPwp8fia.js → sequenceDiagram-PO4LG4MO-DGQaL2CK.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-BX_46o3S.js → sizeCapture-INFHLROL-DjxAs07q.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-W2e0RRrZ.js → stateDiagram-v2-GCMORJYK-DfhvmAHx.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-CkyXpQX9.js → swimlanes-2SLR337P-g4YraApj.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BnxrvDBt.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-BS-sCjlN.js → timeline-definition-EJHVYXUP-Bh6Ow15M.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-BQre-k6x.js → usecaseDiagram-POWQR4AR-wRtBj8_e.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-CEWCsi_s.js → vennDiagram-UO4OBE2U-D4QR4Odj.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-CXUxqghG.js → wardleyDiagram-VNRHLVJA-DthL_SDi.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-DBgVMpwp.js → xychartDiagram-PMCCYNJV-CK-QrbHO.js} +1 -1
- package/dist/handbook/atomic-handbook.html +1 -1
- package/dist/index.html +1 -1
- package/dist-server/drivers/agents-proxy.js +2 -3
- package/dist-server/index.js +2405 -1990
- package/dist-server/openmausbot.js +180 -95
- package/dist-server/pair-cli.js +180 -95
- package/dist-server/server/auto-approve.js +12 -0
- package/dist-server/server/drivers/acp/core.js +4 -6
- package/dist-server/server/drivers/acp/custom.js +3 -1
- package/dist-server/server/drivers/acp/hermes.js +2 -1
- package/dist-server/server/drivers/agents-catalog.js +2 -2
- package/dist-server/server/drivers/chat-mcp-tools.js +1 -21
- package/dist-server/server/drivers/claude.js +69 -66
- package/dist-server/server/drivers/codex.js +4 -3
- package/dist-server/server/drivers/hermes-context-floor.js +68 -0
- package/dist-server/server/drivers/openai-chat.js +1 -1
- package/dist-server/server/drivers/session-allow-key.js +22 -5
- package/dist-server/server/engine-tiers.js +3 -7
- package/dist-server/server/god-mode-goal.js +78 -0
- package/dist-server/server/god-mode-run-host.js +69 -0
- package/dist-server/server/index.js +70 -73
- package/dist-server/server/model-fallback-repair.js +20 -0
- package/dist-server/server/new-bot-defaults.js +3 -1
- package/dist-server/server/personal-goal-runtime.js +29 -3
- package/dist-server/server/personal-goal-turn.js +2 -1
- package/dist-server/server/personal-goals.js +20 -2
- package/dist-server/server/routes/thread-stop.js +15 -2
- package/dist-server/server/surface.js +1 -1
- package/dist-server/shared/god-mode-run.js +173 -0
- package/dist-server/shared/personal-goal.js +42 -0
- package/package.json +1 -1
- package/dist/assets/channel-CT5xRPK0.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BH9Yry0J.js +0 -8
|
@@ -28069,7 +28069,6 @@ function createAcpDriver(support12) {
|
|
|
28069
28069
|
const DRIVER_KIND8 = support12.driverKind;
|
|
28070
28070
|
const SOURCE = support12.nativeSource;
|
|
28071
28071
|
const decodeConfig9 = decodeAcpConfig(support12.defaultCli);
|
|
28072
|
-
const DENY_TIMEOUT_NOTE3 = "Atomic: nobody answered this permission request in time. Skip this action and finish what you can without it.";
|
|
28073
28072
|
return {
|
|
28074
28073
|
driverKind: DRIVER_KIND8,
|
|
28075
28074
|
metadata: {
|
|
@@ -28453,11 +28452,8 @@ function createAcpDriver(support12) {
|
|
|
28453
28452
|
approvalScope: current.controlsHost ? "local-computer" : void 0
|
|
28454
28453
|
});
|
|
28455
28454
|
};
|
|
28456
|
-
const timer = setTimeout(() =>
|
|
28457
|
-
|
|
28458
|
-
finish("deny", "timeout");
|
|
28459
|
-
}, 15 * 6e4);
|
|
28460
|
-
timer.unref?.();
|
|
28455
|
+
const timer = isQuestion ? setTimeout(() => finish("answer", "timeout"), 15 * 6e4) : void 0;
|
|
28456
|
+
timer?.unref?.();
|
|
28461
28457
|
current.asks.set(requestId, finish);
|
|
28462
28458
|
emit({
|
|
28463
28459
|
...base3(threadId, current.turnId),
|
|
@@ -30623,11 +30619,23 @@ var init_approval_grants = __esm({
|
|
|
30623
30619
|
});
|
|
30624
30620
|
|
|
30625
30621
|
// server/drivers/session-allow-key.ts
|
|
30622
|
+
import { realpathSync } from "node:fs";
|
|
30623
|
+
import { isAbsolute as isAbsolute3 } from "node:path";
|
|
30626
30624
|
function sessionAllowKey(ask) {
|
|
30627
30625
|
const tool2 = typeof ask.tool === "string" ? ask.tool.trim() : "";
|
|
30628
30626
|
if (!tool2) return null;
|
|
30629
30627
|
if (tool2.startsWith("mcp__")) return JSON.stringify(["tool", tool2]);
|
|
30630
|
-
|
|
30628
|
+
if ((tool2 === "Read" || tool2 === "Edit") && typeof ask.input?.file_path === "string" && isAbsolute3(ask.input.file_path)) {
|
|
30629
|
+
try {
|
|
30630
|
+
return JSON.stringify(["file", tool2, realpathSync(ask.input.file_path)]);
|
|
30631
|
+
} catch {
|
|
30632
|
+
}
|
|
30633
|
+
}
|
|
30634
|
+
const shell = isShellTool(tool2) && typeof ask.input?.command === "string" ? ask.input.command : null;
|
|
30635
|
+
const cd = shell && !/[\r\n]/.test(shell) ? /^\s*cd\s+(?:--\s+)?(?:"(\/[\w ./-]*)"|'(\/[\w ./-]*)'|(\/[\w./-]*))\s+&&\s+(.+)$/.exec(shell) : null;
|
|
30636
|
+
const prefix = cd ? commandPrefix(cd[4]) : null;
|
|
30637
|
+
if (cd && prefix) return JSON.stringify(["directory-command", tool2, cd[1] ?? cd[2] ?? cd[3], prefix]);
|
|
30638
|
+
const command = shell && !/[\r\n]/.test(shell) ? commandPrefix(shell) : null;
|
|
30631
30639
|
if (command) return JSON.stringify(["command", tool2, command]);
|
|
30632
30640
|
const stable = (value) => Array.isArray(value) ? value.map(stable) : value && typeof value === "object" ? Object.fromEntries(Object.keys(value).sort().map((key) => [key, stable(value[key])])) : value;
|
|
30633
30641
|
return JSON.stringify(["input", tool2, stable(ask.input ?? {})]);
|
|
@@ -30750,13 +30758,13 @@ var init_claude_auth_status = __esm({
|
|
|
30750
30758
|
|
|
30751
30759
|
// server/drivers/claude-login-auth.ts
|
|
30752
30760
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
30753
|
-
import { realpathSync } from "node:fs";
|
|
30761
|
+
import { realpathSync as realpathSync2 } from "node:fs";
|
|
30754
30762
|
import { homedir as homedir9 } from "node:os";
|
|
30755
|
-
import { basename as basename6, dirname as dirname9, isAbsolute as
|
|
30763
|
+
import { basename as basename6, dirname as dirname9, isAbsolute as isAbsolute4, join as join26, resolve as resolve7 } from "node:path";
|
|
30756
30764
|
import { stripVTControlCharacters as stripVTControlCharacters5 } from "node:util";
|
|
30757
30765
|
function canonicalPath(path4) {
|
|
30758
30766
|
try {
|
|
30759
|
-
return
|
|
30767
|
+
return realpathSync2(path4);
|
|
30760
30768
|
} catch {
|
|
30761
30769
|
const parent = dirname9(path4);
|
|
30762
30770
|
return parent === path4 ? path4 : join26(canonicalPath(parent), basename6(path4));
|
|
@@ -30814,7 +30822,7 @@ var init_claude_login_auth = __esm({
|
|
|
30814
30822
|
if (this.disposed) throw new Error("This provider was removed. Refresh Settings before signing in.");
|
|
30815
30823
|
const env = this.options.environment();
|
|
30816
30824
|
const home = env.HOME || env.USERPROFILE || homedir9();
|
|
30817
|
-
if (!
|
|
30825
|
+
if (!isAbsolute4(home) || env.CLAUDE_CONFIG_DIR && !isAbsolute4(env.CLAUDE_CONFIG_DIR)) {
|
|
30818
30826
|
throw new Error("Use an absolute HOME and CLAUDE_CONFIG_DIR path for this server's Claude provider before signing in.");
|
|
30819
30827
|
}
|
|
30820
30828
|
const homeKey = canonicalPath(resolve7(env.CLAUDE_CONFIG_DIR || join26(home, ".claude")));
|
|
@@ -30910,7 +30918,7 @@ var init_claude_login_auth = __esm({
|
|
|
30910
30918
|
if (this.disposed) throw new Error("This provider was removed. Refresh Settings before signing out.");
|
|
30911
30919
|
const env = this.options.environment();
|
|
30912
30920
|
const home = env.HOME || env.USERPROFILE || homedir9();
|
|
30913
|
-
if (!
|
|
30921
|
+
if (!isAbsolute4(home) || env.CLAUDE_CONFIG_DIR && !isAbsolute4(env.CLAUDE_CONFIG_DIR)) {
|
|
30914
30922
|
throw new Error("Use an absolute HOME and CLAUDE_CONFIG_DIR path for this server's Claude provider before signing out.");
|
|
30915
30923
|
}
|
|
30916
30924
|
const homeKey = canonicalPath(resolve7(env.CLAUDE_CONFIG_DIR || join26(home, ".claude")));
|
|
@@ -31434,12 +31442,12 @@ import { createHash as createHash8, randomBytes as randomBytes3 } from "node:cry
|
|
|
31434
31442
|
import { chmodSync as chmodSync5, existsSync as existsSync14, mkdirSync as mkdirSync12, mkdtempSync as mkdtempSync3, readFileSync as readFileSync11, rmSync as rmSync7, unlinkSync as unlinkSync4, writeFileSync as writeFileSync8 } from "node:fs";
|
|
31435
31443
|
import { createServer as createNetServer } from "node:net";
|
|
31436
31444
|
import { homedir as homedir10, tmpdir as tmpdir4 } from "node:os";
|
|
31437
|
-
import { join as join27, dirname as dirname10, isAbsolute as
|
|
31445
|
+
import { join as join27, dirname as dirname10, isAbsolute as isAbsolute5, normalize } from "node:path";
|
|
31438
31446
|
function resolveClaudeConfigDir(configDir2, env = process.env) {
|
|
31439
31447
|
const home = env.HOME || env.USERPROFILE || homedir10();
|
|
31440
31448
|
const configured = configDir2?.trim() || env.CLAUDE_CONFIG_DIR?.trim() || join27(home, ".claude");
|
|
31441
31449
|
const expanded = configured === "~" ? home : configured.startsWith("~/") ? join27(home, configured.slice(2)) : configured;
|
|
31442
|
-
if (!
|
|
31450
|
+
if (!isAbsolute5(expanded) || /[\p{Cc}\p{Cf}]/u.test(expanded)) {
|
|
31443
31451
|
throw new Error("claude: configDir must be an absolute path or start with ~/");
|
|
31444
31452
|
}
|
|
31445
31453
|
return normalize(expanded);
|
|
@@ -31662,6 +31670,17 @@ function brokerSocketCandidates(threadId, botId) {
|
|
|
31662
31670
|
async function createPermissionBroker(opts) {
|
|
31663
31671
|
const timeoutMs = opts.timeoutMs ?? 15 * 6e4;
|
|
31664
31672
|
const pending = /* @__PURE__ */ new Map();
|
|
31673
|
+
let holding = false;
|
|
31674
|
+
const holdAsk = (askId) => {
|
|
31675
|
+
const p3 = pending.get(askId);
|
|
31676
|
+
if (!p3) return;
|
|
31677
|
+
if (p3.timer) {
|
|
31678
|
+
clearTimeout(p3.timer);
|
|
31679
|
+
p3.timer = void 0;
|
|
31680
|
+
}
|
|
31681
|
+
holding = true;
|
|
31682
|
+
opts.onHold?.(p3.ask);
|
|
31683
|
+
};
|
|
31665
31684
|
let closed = false;
|
|
31666
31685
|
let boundPath = opts.socketPaths[0] ?? "";
|
|
31667
31686
|
const connectionHandler = (conn) => {
|
|
@@ -31724,8 +31743,9 @@ async function createPermissionBroker(opts) {
|
|
|
31724
31743
|
continue;
|
|
31725
31744
|
}
|
|
31726
31745
|
const finish = (behavior, message3, source2, always) => {
|
|
31746
|
+
const current = pending.get(askId);
|
|
31727
31747
|
if (!pending.delete(askId)) return;
|
|
31728
|
-
clearTimeout(timer);
|
|
31748
|
+
if (current?.timer) clearTimeout(current.timer);
|
|
31729
31749
|
if (always && behavior === "allow" && source2 === "user" && sessionKey) opts.sessionAllows?.add(sessionKey);
|
|
31730
31750
|
try {
|
|
31731
31751
|
const updatedInput = behavior === "allow" && kind === "permission" ? opts.inputOnAllow?.(ask) : void 0;
|
|
@@ -31736,12 +31756,17 @@ async function createPermissionBroker(opts) {
|
|
|
31736
31756
|
}
|
|
31737
31757
|
opts.onResolve({ ...ask, behavior, source: source2 });
|
|
31738
31758
|
};
|
|
31739
|
-
const
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31759
|
+
const entry = { ask, finish };
|
|
31760
|
+
if (!(kind === "permission" && holding)) {
|
|
31761
|
+
entry.timer = setTimeout(
|
|
31762
|
+
() => kind === "question" ? finish("answer", QUESTION_TIMEOUT_NOTE, "timeout") : holdAsk(askId),
|
|
31763
|
+
timeoutMs
|
|
31764
|
+
);
|
|
31765
|
+
entry.timer.unref?.();
|
|
31766
|
+
} else {
|
|
31767
|
+
opts.onHold?.(ask);
|
|
31768
|
+
}
|
|
31769
|
+
pending.set(askId, entry);
|
|
31745
31770
|
opts.onAsk(ask);
|
|
31746
31771
|
}
|
|
31747
31772
|
});
|
|
@@ -31811,6 +31836,16 @@ async function createPermissionBroker(opts) {
|
|
|
31811
31836
|
pause() {
|
|
31812
31837
|
drain();
|
|
31813
31838
|
},
|
|
31839
|
+
hold() {
|
|
31840
|
+
holding = true;
|
|
31841
|
+
for (const id of Array.from(pending.keys())) holdAsk(id);
|
|
31842
|
+
},
|
|
31843
|
+
resumeHold() {
|
|
31844
|
+
holding = false;
|
|
31845
|
+
},
|
|
31846
|
+
isHolding() {
|
|
31847
|
+
return holding;
|
|
31848
|
+
},
|
|
31814
31849
|
close() {
|
|
31815
31850
|
closed = true;
|
|
31816
31851
|
drain();
|
|
@@ -31866,7 +31901,7 @@ function decodeConfig2(raw) {
|
|
|
31866
31901
|
...disallowedTools !== void 0 ? { disallowedTools } : {}
|
|
31867
31902
|
};
|
|
31868
31903
|
}
|
|
31869
|
-
var CONNECTOR_CACHE_MS, CLAUDE_ACCOUNT_ENV_KEYS, DEFAULT_AUTOCOMPACT_TOKENS, CLAUDE_FLAG_FLOORS, CLAUDE_CONTEXT_CONTROL_MIN_VERSION, DRIVER_KIND2, HARNESS_REPLACED_BUILTINS, STATIC_CLAUDE_MODELS, CLAUDE_MODEL_ID, PERM_PROXY_PATH, DWEB_PROXY_PATH, HOOK_HELPER_PATH, RTK_HOOK_PATH, NODE_ENV_FLAG,
|
|
31904
|
+
var CONNECTOR_CACHE_MS, CLAUDE_ACCOUNT_ENV_KEYS, DEFAULT_AUTOCOMPACT_TOKENS, CLAUDE_FLAG_FLOORS, CLAUDE_CONTEXT_CONTROL_MIN_VERSION, DRIVER_KIND2, HARNESS_REPLACED_BUILTINS, STATIC_CLAUDE_MODELS, CLAUDE_MODEL_ID, PERM_PROXY_PATH, DWEB_PROXY_PATH, HOOK_HELPER_PATH, RTK_HOOK_PATH, NODE_ENV_FLAG, QUESTION_TIMEOUT_NOTE, DUPLICATE_ASK_ID_NOTE, NEXUS_PRIVATE_SCOPE_TOOLS, ClaudeDriver;
|
|
31870
31905
|
var init_claude = __esm({
|
|
31871
31906
|
"server/drivers/claude.ts"() {
|
|
31872
31907
|
"use strict";
|
|
@@ -31945,7 +31980,6 @@ var init_claude = __esm({
|
|
|
31945
31980
|
HOOK_HELPER_PATH = SPAWNED_PROXIES.hook;
|
|
31946
31981
|
RTK_HOOK_PATH = SPAWNED_PROXIES.rtkHook;
|
|
31947
31982
|
NODE_ENV_FLAG = { ELECTRON_RUN_AS_NODE: "1" };
|
|
31948
|
-
DENY_TIMEOUT_NOTE = "Atomic: nobody answered this permission request in time. Skip this action and finish what you can without it.";
|
|
31949
31983
|
QUESTION_TIMEOUT_NOTE = "Atomic: nobody answered in time. Use your best judgment and continue.";
|
|
31950
31984
|
DUPLICATE_ASK_ID_NOTE = "Atomic: duplicate ask id \u2014 skipping this request.";
|
|
31951
31985
|
NEXUS_PRIVATE_SCOPE_TOOLS = [
|
|
@@ -32444,7 +32478,7 @@ var init_claude = __esm({
|
|
|
32444
32478
|
let targetExisted = false;
|
|
32445
32479
|
try {
|
|
32446
32480
|
const target = resolveCli(config2.cli, []).command;
|
|
32447
|
-
targetExisted =
|
|
32481
|
+
targetExisted = isAbsolute5(target) && existsSync14(target);
|
|
32448
32482
|
} catch {
|
|
32449
32483
|
}
|
|
32450
32484
|
let child;
|
|
@@ -33039,6 +33073,18 @@ var init_claude = __esm({
|
|
|
33039
33073
|
sendTurn,
|
|
33040
33074
|
steer,
|
|
33041
33075
|
interruptTurn: async (threadId) => active.get(threadId)?.stop(),
|
|
33076
|
+
holdTurn: async (threadId) => {
|
|
33077
|
+
const broker = active.get(threadId)?.broker ?? sessions.get(threadId)?.broker;
|
|
33078
|
+
if (!broker) return "unavailable";
|
|
33079
|
+
broker.hold();
|
|
33080
|
+
return "held";
|
|
33081
|
+
},
|
|
33082
|
+
resumeTurn: async (threadId) => {
|
|
33083
|
+
const broker = active.get(threadId)?.broker ?? sessions.get(threadId)?.broker;
|
|
33084
|
+
if (!broker) return "unavailable";
|
|
33085
|
+
broker.resumeHold();
|
|
33086
|
+
return "resumed";
|
|
33087
|
+
},
|
|
33042
33088
|
respondToRequest: async (threadId, requestId, decision) => {
|
|
33043
33089
|
const confirmation = elicitations.respond(threadId, requestId, decision);
|
|
33044
33090
|
if (confirmation) return confirmation;
|
|
@@ -33362,7 +33408,7 @@ var init_mcp_auth_signal = __esm({
|
|
|
33362
33408
|
// server/drivers/codex-mcp-names.ts
|
|
33363
33409
|
import { readFileSync as readFileSync13 } from "node:fs";
|
|
33364
33410
|
import { homedir as homedir11 } from "node:os";
|
|
33365
|
-
import { isAbsolute as
|
|
33411
|
+
import { isAbsolute as isAbsolute6, join as join29, resolve as resolve8 } from "node:path";
|
|
33366
33412
|
function mcpServerNamesInToml(toml) {
|
|
33367
33413
|
const names = /* @__PURE__ */ new Set();
|
|
33368
33414
|
for (const match of toml.matchAll(HEADER)) {
|
|
@@ -33389,7 +33435,7 @@ function mcpServersInToml(toml) {
|
|
|
33389
33435
|
}
|
|
33390
33436
|
function codexHomeFor(env, cwd) {
|
|
33391
33437
|
const configured = env.CODEX_HOME;
|
|
33392
|
-
if (configured) return
|
|
33438
|
+
if (configured) return isAbsolute6(configured) ? configured : resolve8(cwd ?? process.cwd(), configured);
|
|
33393
33439
|
return join29(env.HOME || env.USERPROFILE || homedir11(), ".codex");
|
|
33394
33440
|
}
|
|
33395
33441
|
function codexConfigMcpServers(env, cwd) {
|
|
@@ -34169,13 +34215,13 @@ var init_codex_instructions = __esm({
|
|
|
34169
34215
|
|
|
34170
34216
|
// server/drivers/codex-device-auth.ts
|
|
34171
34217
|
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
34172
|
-
import { realpathSync as
|
|
34218
|
+
import { realpathSync as realpathSync3 } from "node:fs";
|
|
34173
34219
|
import { homedir as homedir14 } from "node:os";
|
|
34174
|
-
import { basename as basename8, dirname as dirname11, isAbsolute as
|
|
34220
|
+
import { basename as basename8, dirname as dirname11, isAbsolute as isAbsolute7, join as join34, resolve as resolve10 } from "node:path";
|
|
34175
34221
|
import { stripVTControlCharacters as stripVTControlCharacters6 } from "node:util";
|
|
34176
34222
|
function canonicalPath2(path4) {
|
|
34177
34223
|
try {
|
|
34178
|
-
return
|
|
34224
|
+
return realpathSync3(path4);
|
|
34179
34225
|
} catch {
|
|
34180
34226
|
const parent = dirname11(path4);
|
|
34181
34227
|
return parent === path4 ? path4 : join34(canonicalPath2(parent), basename8(path4));
|
|
@@ -34226,7 +34272,7 @@ var init_codex_device_auth = __esm({
|
|
|
34226
34272
|
if (this.disposed) throw new Error("This provider was removed. Refresh Settings before signing in.");
|
|
34227
34273
|
const env = this.options.environment();
|
|
34228
34274
|
const home = env.HOME || env.USERPROFILE || homedir14();
|
|
34229
|
-
if (!
|
|
34275
|
+
if (!isAbsolute7(home) || env.CODEX_HOME && !isAbsolute7(env.CODEX_HOME)) {
|
|
34230
34276
|
throw new Error("Use an absolute HOME and CODEX_HOME path for this server's Codex provider before signing in.");
|
|
34231
34277
|
}
|
|
34232
34278
|
const homeKey = canonicalPath2(resolve10(env.CODEX_HOME || join34(home, ".codex")));
|
|
@@ -34305,7 +34351,7 @@ var init_codex_device_auth = __esm({
|
|
|
34305
34351
|
if (this.disposed) throw new Error("This provider was removed. Refresh Settings before signing out.");
|
|
34306
34352
|
const env = this.options.environment();
|
|
34307
34353
|
const home = env.HOME || env.USERPROFILE || homedir14();
|
|
34308
|
-
if (!
|
|
34354
|
+
if (!isAbsolute7(home) || env.CODEX_HOME && !isAbsolute7(env.CODEX_HOME)) {
|
|
34309
34355
|
throw new Error("Use an absolute HOME and CODEX_HOME path for this server's Codex provider before signing out.");
|
|
34310
34356
|
}
|
|
34311
34357
|
const homeKey = canonicalPath2(resolve10(env.CODEX_HOME || join34(home, ".codex")));
|
|
@@ -34467,15 +34513,15 @@ var init_codex_device_auth = __esm({
|
|
|
34467
34513
|
|
|
34468
34514
|
// server/drivers/codex-identity.ts
|
|
34469
34515
|
import { homedir as homedir15 } from "node:os";
|
|
34470
|
-
import { isAbsolute as
|
|
34516
|
+
import { isAbsolute as isAbsolute8, join as join35, resolve as resolve11 } from "node:path";
|
|
34471
34517
|
function codexHome2(env) {
|
|
34472
|
-
if (env.CODEX_HOME) return
|
|
34518
|
+
if (env.CODEX_HOME) return isAbsolute8(env.CODEX_HOME) ? resolve11(env.CODEX_HOME) : null;
|
|
34473
34519
|
const home = env.HOME || env.USERPROFILE || homedir15();
|
|
34474
|
-
return
|
|
34520
|
+
return isAbsolute8(home) ? join35(home, ".codex") : null;
|
|
34475
34521
|
}
|
|
34476
34522
|
async function codexAccountEmail(cli, env, timeoutMs = 3e3) {
|
|
34477
34523
|
const cwd = env.HOME || env.USERPROFILE || homedir15();
|
|
34478
|
-
if (!
|
|
34524
|
+
if (!isAbsolute8(cwd) || !codexHome2(env)) return null;
|
|
34479
34525
|
return new Promise((resolveEmail) => {
|
|
34480
34526
|
let child;
|
|
34481
34527
|
try {
|
|
@@ -34854,7 +34900,7 @@ function mountMcpServer(appServerArgs, env, name, server, preApproved = true) {
|
|
|
34854
34900
|
appServerArgs.push("-c", `${prefix}.default_tools_approval_mode="auto"`);
|
|
34855
34901
|
}
|
|
34856
34902
|
}
|
|
34857
|
-
var DRIVER_KIND3, ASTRA_MODEL_ID, ASTRA_MIN_CODEX_VERSION, CodexRpcError, QUESTION_TIMEOUT_NOTE2,
|
|
34903
|
+
var DRIVER_KIND3, ASTRA_MODEL_ID, ASTRA_MIN_CODEX_VERSION, CodexRpcError, QUESTION_TIMEOUT_NOTE2, notedMcpServers, plainRecord2, CodexDriver;
|
|
34858
34904
|
var init_codex = __esm({
|
|
34859
34905
|
"server/drivers/codex.ts"() {
|
|
34860
34906
|
"use strict";
|
|
@@ -34896,7 +34942,6 @@ var init_codex = __esm({
|
|
|
34896
34942
|
}
|
|
34897
34943
|
};
|
|
34898
34944
|
QUESTION_TIMEOUT_NOTE2 = "No answer was given \u2014 use your best judgment.";
|
|
34899
|
-
DENY_TIMEOUT_NOTE2 = "Atomic: nobody answered this permission request in time. Skip this action and finish what you can without it.";
|
|
34900
34945
|
notedMcpServers = /* @__PURE__ */ new Set();
|
|
34901
34946
|
plainRecord2 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
34902
34947
|
CodexDriver = {
|
|
@@ -35267,11 +35312,8 @@ var init_codex = __esm({
|
|
|
35267
35312
|
}
|
|
35268
35313
|
emit({ ...base3(threadId, turnId), type: "request.resolved", requestId, behavior, source: source2 });
|
|
35269
35314
|
};
|
|
35270
|
-
const timer = setTimeout(
|
|
35271
|
-
|
|
35272
|
-
15 * 6e4
|
|
35273
|
-
);
|
|
35274
|
-
timer.unref?.();
|
|
35315
|
+
const timer = isQuestion ? setTimeout(() => finish("answer", QUESTION_TIMEOUT_NOTE2, "timeout"), 15 * 6e4) : void 0;
|
|
35316
|
+
timer?.unref?.();
|
|
35275
35317
|
asks.set(requestId, finish);
|
|
35276
35318
|
emit({
|
|
35277
35319
|
...base3(threadId, turnId),
|
|
@@ -44901,7 +44943,6 @@ var init_chat_box_tools = __esm({
|
|
|
44901
44943
|
});
|
|
44902
44944
|
|
|
44903
44945
|
// server/drivers/chat-mcp-tools.ts
|
|
44904
|
-
import { homedir as homedir17 } from "node:os";
|
|
44905
44946
|
function object2(value) {
|
|
44906
44947
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
44907
44948
|
}
|
|
@@ -44936,17 +44977,7 @@ function boundedText(value) {
|
|
|
44936
44977
|
return `${bytes.subarray(0, end).toString()}
|
|
44937
44978
|
[MCP result truncated at 50KB; request less output.]`;
|
|
44938
44979
|
}
|
|
44939
|
-
function
|
|
44940
|
-
const slash = (text7) => text7.replaceAll("\\", "/").toLowerCase();
|
|
44941
|
-
const needles = roots.flatMap((root) => {
|
|
44942
|
-
const full = slash(root).replace(/\/+$/, "");
|
|
44943
|
-
const base3 = slash(home).replace(/\/+$/, "");
|
|
44944
|
-
return full.startsWith(`${base3}/`) ? [full, `~/${full.slice(base3.length + 1)}`, full.slice(base3.length + 1)] : [full];
|
|
44945
|
-
});
|
|
44946
|
-
const visit3 = (value) => typeof value === "string" ? needles.some((needle) => slash(value).includes(needle)) : Array.isArray(value) ? value.some(visit3) : object2(value) ? Object.values(value).some(visit3) : false;
|
|
44947
|
-
return needles.length > 0 && visit3(args);
|
|
44948
|
-
}
|
|
44949
|
-
async function mountChatTools(integrations, signal, computerUse = false, report = reportMcpFailure, blockedPaths = []) {
|
|
44980
|
+
async function mountChatTools(integrations, signal, computerUse = false, report = reportMcpFailure) {
|
|
44950
44981
|
const servers = [];
|
|
44951
44982
|
if (computerUse && integrations?.computer) servers.push(["computer", integrations.computer]);
|
|
44952
44983
|
if (computerUse && integrations?.localComputer) servers.push(["computer", integrations.localComputer]);
|
|
@@ -45064,9 +45095,6 @@ async function mountChatTools(integrations, signal, computerUse = false, report
|
|
|
45064
45095
|
if (!tool2) throw new Error("The requested tool was not advertised for this turn");
|
|
45065
45096
|
if (dropped.has(tool2.server)) throw new Error(`The "${tool2.server}" tools stopped working earlier in this turn and are unavailable now; carry on without them.`);
|
|
45066
45097
|
if (!object2(args) || !tool2.schema(args)) throw new Error("Tool arguments do not match the advertised input schema; use its required fields and types");
|
|
45067
|
-
if (namesBlockedPath(args, blockedPaths)) {
|
|
45068
|
-
throw new Error("This turn runs on a free model, so the PAW and ICM folders are off limits. Work only from the message itself.");
|
|
45069
|
-
}
|
|
45070
45098
|
};
|
|
45071
45099
|
return {
|
|
45072
45100
|
definitions,
|
|
@@ -45747,7 +45775,7 @@ function createOpenAIChatRuntime(options) {
|
|
|
45747
45775
|
const denials = [];
|
|
45748
45776
|
const seenCalls = /* @__PURE__ */ new Set();
|
|
45749
45777
|
try {
|
|
45750
|
-
tools = await mountChatTools(options.tools === false ? void 0 : turn.integrations, abort.signal, options.computerUse
|
|
45778
|
+
tools = await mountChatTools(options.tools === false ? void 0 : turn.integrations, abort.signal, options.computerUse);
|
|
45751
45779
|
for (let round = 0; round < 16; round++) {
|
|
45752
45780
|
abort.signal.throwIfAborted();
|
|
45753
45781
|
native("out", options.nativeLog.outgoing(turn, messages, model));
|
|
@@ -46070,7 +46098,7 @@ var init_grok = __esm({
|
|
|
46070
46098
|
|
|
46071
46099
|
// server/drivers/acp/grok.ts
|
|
46072
46100
|
import { existsSync as existsSync17, readFileSync as readFileSync20, writeFileSync as writeFileSync13 } from "node:fs";
|
|
46073
|
-
import { homedir as
|
|
46101
|
+
import { homedir as homedir17 } from "node:os";
|
|
46074
46102
|
import { join as join39 } from "node:path";
|
|
46075
46103
|
function decodeGrokModelText(text7) {
|
|
46076
46104
|
if (/\bnot authenticated\b/i.test(text7)) return null;
|
|
@@ -46105,7 +46133,7 @@ function fetchGrokModels(cli, env, run2 = execCli) {
|
|
|
46105
46133
|
}
|
|
46106
46134
|
function grokHome(env) {
|
|
46107
46135
|
if (env.GROK_HOME) return env.GROK_HOME;
|
|
46108
|
-
return join39(env.HOME || env.USERPROFILE ||
|
|
46136
|
+
return join39(env.HOME || env.USERPROFILE || homedir17(), ".grok");
|
|
46109
46137
|
}
|
|
46110
46138
|
function unquote2(raw) {
|
|
46111
46139
|
const value = raw.trim();
|
|
@@ -46350,7 +46378,7 @@ var init_grok2 = __esm({
|
|
|
46350
46378
|
pickAuthMethod: (methods) => methods.some((m3) => m3.id === "cached_token") ? "cached_token" : null,
|
|
46351
46379
|
authFailure: "fail",
|
|
46352
46380
|
classifyError: classifyGrokError,
|
|
46353
|
-
isAuthenticated: (env) => existsSync17(env.GROK_HOME ? join39(env.GROK_HOME, "auth.json") : join39(
|
|
46381
|
+
isAuthenticated: (env) => existsSync17(env.GROK_HOME ? join39(env.GROK_HOME, "auth.json") : join39(homedir17(), ".grok", "auth.json")),
|
|
46354
46382
|
// `--append-system-prompt`/`--rules` are accepted by the CLI but do NOT
|
|
46355
46383
|
// reach the agent-stdio system prompt (verified against 1.0.0), so the
|
|
46356
46384
|
// persona is prepended codex-style.
|
|
@@ -46364,11 +46392,11 @@ ${turn.text}` : turn.text
|
|
|
46364
46392
|
|
|
46365
46393
|
// server/drivers/acp/gemini.ts
|
|
46366
46394
|
import { existsSync as existsSync18, readFileSync as readFileSync21 } from "node:fs";
|
|
46367
|
-
import { homedir as
|
|
46395
|
+
import { homedir as homedir18 } from "node:os";
|
|
46368
46396
|
import { join as join40 } from "node:path";
|
|
46369
46397
|
function liveOauthCredential() {
|
|
46370
46398
|
try {
|
|
46371
|
-
const creds = JSON.parse(readFileSync21(join40(
|
|
46399
|
+
const creds = JSON.parse(readFileSync21(join40(homedir18(), ".gemini", "oauth_creds.json"), "utf8"));
|
|
46372
46400
|
if (typeof creds.access_token !== "string" || creds.access_token.trim().length === 0) return false;
|
|
46373
46401
|
const hasRefresh = typeof creds.refresh_token === "string" && creds.refresh_token.trim().length > 0;
|
|
46374
46402
|
if (creds.expiry_date !== void 0) {
|
|
@@ -46381,7 +46409,7 @@ function liveOauthCredential() {
|
|
|
46381
46409
|
}
|
|
46382
46410
|
}
|
|
46383
46411
|
function geminiIsAuthenticated(env) {
|
|
46384
|
-
return nonBlank(env.GEMINI_API_KEY) || nonBlank(env.GOOGLE_API_KEY) || existsSync18(join40(
|
|
46412
|
+
return nonBlank(env.GEMINI_API_KEY) || nonBlank(env.GOOGLE_API_KEY) || existsSync18(join40(homedir18(), ".gemini", "oauth_creds.json")) && liveOauthCredential();
|
|
46385
46413
|
}
|
|
46386
46414
|
function geminiApprovalArgs(fullAuto, approvalMode) {
|
|
46387
46415
|
if (fullAuto) return ["--yolo"];
|
|
@@ -46487,13 +46515,13 @@ var init_kimi_turn_failure = __esm({
|
|
|
46487
46515
|
|
|
46488
46516
|
// server/drivers/acp/kimi.ts
|
|
46489
46517
|
import { existsSync as existsSync20, mkdirSync as mkdirSync18, readFileSync as readFileSync22, writeFileSync as writeFileSync14 } from "node:fs";
|
|
46490
|
-
import { homedir as
|
|
46518
|
+
import { homedir as homedir19 } from "node:os";
|
|
46491
46519
|
import { join as join42 } from "node:path";
|
|
46492
46520
|
function isLocalInjectAlias(slug) {
|
|
46493
46521
|
return LOCAL_PROVIDER_PREFIXES.some((prefix) => slug.startsWith(prefix));
|
|
46494
46522
|
}
|
|
46495
46523
|
function kimiDataRoot(env) {
|
|
46496
|
-
return env.KIMI_CODE_HOME || join42(env.HOME || env.USERPROFILE ||
|
|
46524
|
+
return env.KIMI_CODE_HOME || join42(env.HOME || env.USERPROFILE || homedir19(), ".kimi-code");
|
|
46497
46525
|
}
|
|
46498
46526
|
function credentialsPath(env) {
|
|
46499
46527
|
return join42(kimiDataRoot(env), "credentials", "kimi-code.json");
|
|
@@ -47005,10 +47033,10 @@ ${turn.text}` : turn.text,
|
|
|
47005
47033
|
|
|
47006
47034
|
// server/drivers/acp/droid.ts
|
|
47007
47035
|
import { existsSync as existsSync21, mkdirSync as mkdirSync19, readFileSync as readFileSync23, writeFileSync as writeFileSync15 } from "node:fs";
|
|
47008
|
-
import { homedir as
|
|
47036
|
+
import { homedir as homedir20 } from "node:os";
|
|
47009
47037
|
import { join as join43 } from "node:path";
|
|
47010
47038
|
function authFilePaths(env) {
|
|
47011
|
-
const home = env.FACTORY_HOME_OVERRIDE || env.HOME ||
|
|
47039
|
+
const home = env.FACTORY_HOME_OVERRIDE || env.HOME || homedir20();
|
|
47012
47040
|
return AUTH_FILES.map((name) => join43(home, ".factory", name));
|
|
47013
47041
|
}
|
|
47014
47042
|
function droidInjectId(host, model) {
|
|
@@ -47016,7 +47044,7 @@ function droidInjectId(host, model) {
|
|
|
47016
47044
|
return `${INJECT_ID_PREFIX}${safe}`;
|
|
47017
47045
|
}
|
|
47018
47046
|
function factoryHome(env) {
|
|
47019
|
-
return env.FACTORY_HOME_OVERRIDE || env.HOME || env.USERPROFILE ||
|
|
47047
|
+
return env.FACTORY_HOME_OVERRIDE || env.HOME || env.USERPROFILE || homedir20();
|
|
47020
47048
|
}
|
|
47021
47049
|
function ensureDroidInjectModel(modelId, env = process.env) {
|
|
47022
47050
|
const inject = decodeInjectId(modelId);
|
|
@@ -48955,11 +48983,11 @@ var init_muse_code_login = __esm({
|
|
|
48955
48983
|
// server/drivers/muse-code.ts
|
|
48956
48984
|
import { existsSync as existsSync22, mkdtempSync as mkdtempSync4, readFileSync as readFileSync24, rmSync as rmSync9, statSync as statSync6 } from "node:fs";
|
|
48957
48985
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
48958
|
-
import { homedir as
|
|
48986
|
+
import { homedir as homedir21, tmpdir as tmpdir6 } from "node:os";
|
|
48959
48987
|
import { join as join44 } from "node:path";
|
|
48960
48988
|
function museCredentialPath(env, platform = process.platform) {
|
|
48961
48989
|
if (env.MUSE_AUTH_PATH?.trim()) return env.MUSE_AUTH_PATH.trim();
|
|
48962
|
-
const home = (platform === "win32" ? env.USERPROFILE || env.HOME : env.HOME) ||
|
|
48990
|
+
const home = (platform === "win32" ? env.USERPROFILE || env.HOME : env.HOME) || homedir21();
|
|
48963
48991
|
return join44(env.XDG_CONFIG_HOME?.trim() || join44(home, ".config"), "muse", "auth.json");
|
|
48964
48992
|
}
|
|
48965
48993
|
function museCredential(path4) {
|
|
@@ -49719,7 +49747,7 @@ ${body}` : body;
|
|
|
49719
49747
|
|
|
49720
49748
|
// server/drivers/acp/opencode-go.ts
|
|
49721
49749
|
import { existsSync as existsSync23, mkdirSync as mkdirSync20, readFileSync as readFileSync25, writeFileSync as writeFileSync16 } from "node:fs";
|
|
49722
|
-
import { homedir as
|
|
49750
|
+
import { homedir as homedir22 } from "node:os";
|
|
49723
49751
|
import { join as join45 } from "node:path";
|
|
49724
49752
|
function labelForModel(id) {
|
|
49725
49753
|
return id.split(/[-_.]+/g).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
@@ -49822,7 +49850,7 @@ async function discoverOpenCodeModels(environment, cli = "opencode") {
|
|
|
49822
49850
|
}
|
|
49823
49851
|
}
|
|
49824
49852
|
function opencodeConfigDir(env) {
|
|
49825
|
-
const home = env.HOME || env.USERPROFILE ||
|
|
49853
|
+
const home = env.HOME || env.USERPROFILE || homedir22();
|
|
49826
49854
|
return join45(env.XDG_CONFIG_HOME || join45(home, ".config"), "opencode");
|
|
49827
49855
|
}
|
|
49828
49856
|
function ensureOpenCodeInjectModel(modelId, env = process.env) {
|
|
@@ -49869,7 +49897,7 @@ function ensureOpenCodeInjectModel(modelId, env = process.env) {
|
|
|
49869
49897
|
return native;
|
|
49870
49898
|
}
|
|
49871
49899
|
function storedAuthPaths(env) {
|
|
49872
|
-
const home = env.HOME || env.USERPROFILE ||
|
|
49900
|
+
const home = env.HOME || env.USERPROFILE || homedir22();
|
|
49873
49901
|
const roots = [
|
|
49874
49902
|
env.XDG_DATA_HOME || join45(home, ".local", "share"),
|
|
49875
49903
|
process.platform === "darwin" ? join45(home, "Library", "Application Support") : process.platform === "win32" ? env.LOCALAPPDATA || join45(home, "AppData", "Local") : ""
|
|
@@ -50032,10 +50060,10 @@ ${turn.text}` : turn.text
|
|
|
50032
50060
|
// server/drivers/acp/qwen.ts
|
|
50033
50061
|
import { chmodSync as chmodSync6, existsSync as existsSync24, mkdirSync as mkdirSync21, readFileSync as readFileSync26, writeFileSync as writeFileSync17 } from "node:fs";
|
|
50034
50062
|
import { createHash as createHash14 } from "node:crypto";
|
|
50035
|
-
import { homedir as
|
|
50063
|
+
import { homedir as homedir23 } from "node:os";
|
|
50036
50064
|
import { join as join46 } from "node:path";
|
|
50037
50065
|
function qwenHome(env) {
|
|
50038
|
-
const home = process.platform === "win32" ? env.USERPROFILE || env.HOME ||
|
|
50066
|
+
const home = process.platform === "win32" ? env.USERPROFILE || env.HOME || homedir23() : env.HOME || env.USERPROFILE || homedir23();
|
|
50039
50067
|
return join46(home, ".qwen");
|
|
50040
50068
|
}
|
|
50041
50069
|
function isRecord5(value) {
|
|
@@ -50777,13 +50805,13 @@ var init_atomic_engine_local = __esm({
|
|
|
50777
50805
|
|
|
50778
50806
|
// server/atomic-engine-accounts.ts
|
|
50779
50807
|
import { mkdirSync as mkdirSync22, readFileSync as readFileSync27, writeFileSync as writeFileSync18 } from "node:fs";
|
|
50780
|
-
import { homedir as
|
|
50808
|
+
import { homedir as homedir24 } from "node:os";
|
|
50781
50809
|
import { join as join47 } from "node:path";
|
|
50782
50810
|
function rawConfig2(entry) {
|
|
50783
50811
|
return entry.config && typeof entry.config === "object" && !Array.isArray(entry.config) ? entry.config : {};
|
|
50784
50812
|
}
|
|
50785
50813
|
function expandHome(path4) {
|
|
50786
|
-
return path4 === "~" ?
|
|
50814
|
+
return path4 === "~" ? homedir24() : path4.startsWith("~/") ? join47(homedir24(), path4.slice(2)) : path4;
|
|
50787
50815
|
}
|
|
50788
50816
|
function asAccount(id, entry) {
|
|
50789
50817
|
if (entry.enabled === false) return null;
|
|
@@ -50815,7 +50843,7 @@ function asAccount(id, entry) {
|
|
|
50815
50843
|
kind: "codex-cli",
|
|
50816
50844
|
label,
|
|
50817
50845
|
billing: "subscription",
|
|
50818
|
-
home: home ? expandHome(home) : join47(
|
|
50846
|
+
home: home ? expandHome(home) : join47(homedir24(), ".codex"),
|
|
50819
50847
|
model: FAILOVER_MODEL["openai-codex"]
|
|
50820
50848
|
} };
|
|
50821
50849
|
}
|
|
@@ -51129,6 +51157,61 @@ var init_atomic_engine_runtime = __esm({
|
|
|
51129
51157
|
}
|
|
51130
51158
|
});
|
|
51131
51159
|
|
|
51160
|
+
// server/drivers/hermes-context-floor.ts
|
|
51161
|
+
function ollamaServedWindow(show) {
|
|
51162
|
+
if (!show || typeof show !== "object") return void 0;
|
|
51163
|
+
const { parameters, model_info: info } = show;
|
|
51164
|
+
if (typeof parameters === "string") {
|
|
51165
|
+
for (const line of parameters.split("\n")) {
|
|
51166
|
+
const parts = line.trim().split(/\s+/);
|
|
51167
|
+
const value = Number(parts.at(-1));
|
|
51168
|
+
if (parts[0] === "num_ctx" && Number.isInteger(value) && value > 0) return value;
|
|
51169
|
+
}
|
|
51170
|
+
}
|
|
51171
|
+
if (info && typeof info === "object") {
|
|
51172
|
+
for (const [key, value] of Object.entries(info)) {
|
|
51173
|
+
if (key.endsWith("context_length") && typeof value === "number" && value > 0) return value;
|
|
51174
|
+
}
|
|
51175
|
+
}
|
|
51176
|
+
return void 0;
|
|
51177
|
+
}
|
|
51178
|
+
async function ollamaShow(host, model, env, fetchImpl) {
|
|
51179
|
+
try {
|
|
51180
|
+
const response = await fetchImpl(`${anthropicBaseUrl(host)}/api/show`, {
|
|
51181
|
+
method: "POST",
|
|
51182
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${hostApiKey(host, env)}` },
|
|
51183
|
+
body: JSON.stringify({ model }),
|
|
51184
|
+
signal: AbortSignal.timeout(1500)
|
|
51185
|
+
});
|
|
51186
|
+
return response.ok ? await response.json() : null;
|
|
51187
|
+
} catch {
|
|
51188
|
+
return null;
|
|
51189
|
+
}
|
|
51190
|
+
}
|
|
51191
|
+
async function hermesWindow(id, env, fetchImpl) {
|
|
51192
|
+
const inject = decodeInjectId(id);
|
|
51193
|
+
const host = inject ? localHost(inject.host) : void 0;
|
|
51194
|
+
if (!inject || !host || !OLLAMA_HOSTS.has(host.id) || isOllamaCloudModel(inject.model)) return void 0;
|
|
51195
|
+
return ollamaServedWindow(await ollamaShow(host, inject.model, env, fetchImpl));
|
|
51196
|
+
}
|
|
51197
|
+
async function withoutUnderSizedLocalModels(catalog2, env = process.env, fetchImpl = fetch) {
|
|
51198
|
+
const windows = await Promise.all(catalog2.options.map((option) => hermesWindow(option.id, env, fetchImpl)));
|
|
51199
|
+
const options = catalog2.options.filter((_3, index) => (windows[index] ?? HERMES_MIN_CONTEXT) >= HERMES_MIN_CONTEXT);
|
|
51200
|
+
if (options.length === catalog2.options.length) return catalog2;
|
|
51201
|
+
const kept = new Set(options.map((option) => option.id));
|
|
51202
|
+
return { default: kept.has(catalog2.default) ? catalog2.default : options[0]?.id ?? "", options };
|
|
51203
|
+
}
|
|
51204
|
+
var HERMES_MIN_CONTEXT, OLLAMA_HOSTS;
|
|
51205
|
+
var init_hermes_context_floor = __esm({
|
|
51206
|
+
"server/drivers/hermes-context-floor.ts"() {
|
|
51207
|
+
"use strict";
|
|
51208
|
+
init_local_models();
|
|
51209
|
+
init_local_inject();
|
|
51210
|
+
HERMES_MIN_CONTEXT = 64e3;
|
|
51211
|
+
OLLAMA_HOSTS = /* @__PURE__ */ new Set(["ollama", "local_ollama"]);
|
|
51212
|
+
}
|
|
51213
|
+
});
|
|
51214
|
+
|
|
51132
51215
|
// ../atomic-harness-skills/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/identity.js
|
|
51133
51216
|
function isCollection(node) {
|
|
51134
51217
|
if (node && typeof node === "object")
|
|
@@ -58086,7 +58169,7 @@ var init_hermes_hosts = __esm({
|
|
|
58086
58169
|
// server/drivers/acp/hermes.ts
|
|
58087
58170
|
import { spawn as spawn7 } from "node:child_process";
|
|
58088
58171
|
import { mkdirSync as mkdirSync25, readFileSync as readFileSync30, writeFileSync as writeFileSync21 } from "node:fs";
|
|
58089
|
-
import { homedir as
|
|
58172
|
+
import { homedir as homedir25 } from "node:os";
|
|
58090
58173
|
import { join as join50 } from "node:path";
|
|
58091
58174
|
function bindHermesScreenshotCompat(env, modelId) {
|
|
58092
58175
|
delete env[HERMES_OPENMAUS_SCREENSHOT_COMPAT];
|
|
@@ -58097,7 +58180,7 @@ function bindHermesScreenshotCompat(env, modelId) {
|
|
|
58097
58180
|
env[HERMES_OPENMAUS_SCREENSHOT_COMPAT_MODEL] = inject.model;
|
|
58098
58181
|
}
|
|
58099
58182
|
function hermesHome(env) {
|
|
58100
|
-
return env.HERMES_HOME || join50(env.HOME || env.USERPROFILE ||
|
|
58183
|
+
return env.HERMES_HOME || join50(env.HOME || env.USERPROFILE || homedir25(), ".hermes");
|
|
58101
58184
|
}
|
|
58102
58185
|
function quoteYaml(value) {
|
|
58103
58186
|
if (/^[\w./:+-]+$/.test(value)) return value;
|
|
@@ -58411,7 +58494,7 @@ async function fetchHermesAcpModels(cli, env) {
|
|
|
58411
58494
|
}
|
|
58412
58495
|
if (msg?.id === initId) {
|
|
58413
58496
|
if (!msg.result) return done([]);
|
|
58414
|
-
sessionId = send("session/new", { cwd: env.HOME || env.USERPROFILE ||
|
|
58497
|
+
sessionId = send("session/new", { cwd: env.HOME || env.USERPROFILE || homedir25(), mcpServers: [] });
|
|
58415
58498
|
} else if (sessionId && msg?.id === sessionId) {
|
|
58416
58499
|
const list = Array.isArray(msg.result?.models?.availableModels) ? msg.result.models.availableModels : [];
|
|
58417
58500
|
done(
|
|
@@ -58433,7 +58516,7 @@ async function fetchHermesAcpModels(cli, env) {
|
|
|
58433
58516
|
});
|
|
58434
58517
|
}
|
|
58435
58518
|
async function resolveHermesModels(env, config2) {
|
|
58436
|
-
const catalog2 = await mergeLocalInject(EMPTY2, env);
|
|
58519
|
+
const catalog2 = await withoutUnderSizedLocalModels(await mergeLocalInject(EMPTY2, env), env);
|
|
58437
58520
|
const configured = hermesConfiguredModel(env);
|
|
58438
58521
|
const hostDefault = hermesConfiguredHostModel(env);
|
|
58439
58522
|
const signedIn = hermesAuthStoreModels(env);
|
|
@@ -58460,6 +58543,7 @@ var init_hermes = __esm({
|
|
|
58460
58543
|
init_procs();
|
|
58461
58544
|
init_spawn_command();
|
|
58462
58545
|
init_local_inject();
|
|
58546
|
+
init_hermes_context_floor();
|
|
58463
58547
|
init_core3();
|
|
58464
58548
|
init_hermes_hosts();
|
|
58465
58549
|
init_hermes_memory_lock();
|
|
@@ -58536,7 +58620,7 @@ ${turn.text}` : turn.text
|
|
|
58536
58620
|
});
|
|
58537
58621
|
|
|
58538
58622
|
// server/drivers/acp/custom.ts
|
|
58539
|
-
import { homedir as
|
|
58623
|
+
import { homedir as homedir26 } from "node:os";
|
|
58540
58624
|
import { basename as basename9, join as join51 } from "node:path";
|
|
58541
58625
|
function isAtomicEngine(instanceId, cli) {
|
|
58542
58626
|
const program = (cli ?? "").trim().split(/\s+/)[0] ?? "";
|
|
@@ -58562,7 +58646,7 @@ async function customAcpSnapshot(env, cli, instanceId) {
|
|
|
58562
58646
|
return { state: "available", version: version2, authenticated: true };
|
|
58563
58647
|
}
|
|
58564
58648
|
function atomicEngineHome2(env) {
|
|
58565
|
-
return env.HERMES_HOME || join51(env.HOME || env.USERPROFILE ||
|
|
58649
|
+
return env.HERMES_HOME || join51(env.HOME || env.USERPROFILE || homedir26(), ".atomic");
|
|
58566
58650
|
}
|
|
58567
58651
|
function applyAtomicEngineAccounts(env, instanceId, cli, accounts = currentAtomicEngineAccounts) {
|
|
58568
58652
|
if (!isAtomicEngine(instanceId, cli)) return;
|
|
@@ -58577,7 +58661,7 @@ function lockAtomicEngineMemory(env, instanceId, cli) {
|
|
|
58577
58661
|
async function customAcpModels(env, config2, instanceId, fetchImpl = fetch) {
|
|
58578
58662
|
if (!isAtomicEngine(instanceId, config2?.cli)) return PASSTHROUGH;
|
|
58579
58663
|
const own = { default: ATOMIC_AUTO_MODEL, options: [{ id: ATOMIC_AUTO_MODEL, label: "Atomic Engine (Auto)", custom: true }] };
|
|
58580
|
-
const catalog2 = await mergeLocalInject(own, env, fetchImpl);
|
|
58664
|
+
const catalog2 = await withoutUnderSizedLocalModels(await mergeLocalInject(own, env, fetchImpl), env, fetchImpl);
|
|
58581
58665
|
rememberLocalModels(catalog2.options);
|
|
58582
58666
|
return catalog2;
|
|
58583
58667
|
}
|
|
@@ -58632,6 +58716,7 @@ var init_custom = __esm({
|
|
|
58632
58716
|
init_atomic_engine_runtime();
|
|
58633
58717
|
init_env_path();
|
|
58634
58718
|
init_procs();
|
|
58719
|
+
init_hermes_context_floor();
|
|
58635
58720
|
init_local_inject();
|
|
58636
58721
|
init_core3();
|
|
58637
58722
|
init_hermes_memory_lock();
|
|
@@ -59123,7 +59208,7 @@ var init_openai_compat = __esm({
|
|
|
59123
59208
|
|
|
59124
59209
|
// server/drivers/pi.ts
|
|
59125
59210
|
import { chmodSync as chmodSync7, existsSync as existsSync26, mkdirSync as mkdirSync26, mkdtempSync as mkdtempSync5, readFileSync as readFileSync31, rmSync as rmSync11, writeFileSync as writeFileSync22 } from "node:fs";
|
|
59126
|
-
import { homedir as
|
|
59211
|
+
import { homedir as homedir27, tmpdir as tmpdir7 } from "node:os";
|
|
59127
59212
|
import { join as join52 } from "node:path";
|
|
59128
59213
|
function readPiPromptImages(turn) {
|
|
59129
59214
|
return (turn.images ?? []).map((image) => ({
|
|
@@ -59246,7 +59331,7 @@ async function applyPiLocalCatalog(catalog2, env = process.env, fetchImpl = fetc
|
|
|
59246
59331
|
return preferPiInjectRows(await mergeLocalInject(catalog2, env, fetchImpl));
|
|
59247
59332
|
}
|
|
59248
59333
|
function piAgentDir(env) {
|
|
59249
|
-
return join52(env.HOME || env.USERPROFILE ||
|
|
59334
|
+
return join52(env.HOME || env.USERPROFILE || homedir27(), ".pi", "agent");
|
|
59250
59335
|
}
|
|
59251
59336
|
function ensurePiInjectModel(modelId, env = process.env) {
|
|
59252
59337
|
const split = splitPiModel(modelId);
|
|
@@ -59311,7 +59396,7 @@ function ensurePiInjectModel(modelId, env = process.env) {
|
|
|
59311
59396
|
return split;
|
|
59312
59397
|
}
|
|
59313
59398
|
function readPiDefaultModel(env) {
|
|
59314
|
-
const home = env.HOME || env.USERPROFILE ||
|
|
59399
|
+
const home = env.HOME || env.USERPROFILE || homedir27();
|
|
59315
59400
|
try {
|
|
59316
59401
|
const s4 = JSON.parse(readFileSync31(`${home}/.pi/agent/settings.json`, "utf8"));
|
|
59317
59402
|
return s4.defaultProvider && s4.defaultModel ? `${s4.defaultProvider}/${s4.defaultModel}` : "";
|
|
@@ -59979,13 +60064,13 @@ var init_mistral = __esm({
|
|
|
59979
60064
|
|
|
59980
60065
|
// server/drivers/minimax.ts
|
|
59981
60066
|
import { readFileSync as readFileSync32 } from "node:fs";
|
|
59982
|
-
import { homedir as
|
|
60067
|
+
import { homedir as homedir28 } from "node:os";
|
|
59983
60068
|
import { join as join53 } from "node:path";
|
|
59984
60069
|
function normalizedApiUrl(value) {
|
|
59985
60070
|
const root = value.trim().replace(/\/+$/, "");
|
|
59986
60071
|
return root.endsWith("/v1") ? root : `${root}/v1`;
|
|
59987
60072
|
}
|
|
59988
|
-
function loadLocalMiniMaxConfig(home =
|
|
60073
|
+
function loadLocalMiniMaxConfig(home = homedir28()) {
|
|
59989
60074
|
try {
|
|
59990
60075
|
const raw = localConfigSchema.parse(JSON.parse(readFileSync32(join53(home, ".mmx", "config.json"), "utf8")));
|
|
59991
60076
|
const configuredUrl = raw.base_url?.trim() ? raw.base_url : raw.region === "cn" ? CN_URL : DEFAULT_URL3;
|
|
@@ -61101,7 +61186,7 @@ var import_qrcode_terminal = __toESM(require_main(), 1);
|
|
|
61101
61186
|
import { spawn as spawn10 } from "node:child_process";
|
|
61102
61187
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
61103
61188
|
import { closeSync as closeSync7, existsSync as existsSync27, mkdirSync as mkdirSync27, openSync as openSync7, readFileSync as readFileSync34 } from "node:fs";
|
|
61104
|
-
import { homedir as
|
|
61189
|
+
import { homedir as homedir29 } from "node:os";
|
|
61105
61190
|
import { dirname as dirname13, join as join56, resolve as resolve13 } from "node:path";
|
|
61106
61191
|
import { createInterface as createInterface2 } from "node:readline/promises";
|
|
61107
61192
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -65031,7 +65116,7 @@ function parseArgs2(argv, env = process.env) {
|
|
|
65031
65116
|
const options = {
|
|
65032
65117
|
command: command === "--help" || command === "-h" ? "help" : command,
|
|
65033
65118
|
port: Number(env.OMB_PORT || 8799),
|
|
65034
|
-
dataDir: env.OMB_DATA_DIR || join56(
|
|
65119
|
+
dataDir: env.OMB_DATA_DIR || join56(homedir29(), ".atomic-app"),
|
|
65035
65120
|
tailscale: false,
|
|
65036
65121
|
tunnel: false,
|
|
65037
65122
|
client: false,
|
|
@@ -65594,7 +65679,7 @@ async function runServe(options, log = console.log) {
|
|
|
65594
65679
|
console.error(`something already answers on http://127.0.0.1:${options.port}; use \`chibi pair\` against it, or --port for a second server`);
|
|
65595
65680
|
return 1;
|
|
65596
65681
|
}
|
|
65597
|
-
if (await reportBusyPort(options.port, options.dataDir === join56(
|
|
65682
|
+
if (await reportBusyPort(options.port, options.dataDir === join56(homedir29(), ".atomic-app") ? "" : ` --data-dir ${options.dataDir}`)) return 1;
|
|
65598
65683
|
let publicUrl = options.publicUrl;
|
|
65599
65684
|
let tailscale = null;
|
|
65600
65685
|
if (options.tailscale) {
|
|
@@ -65862,7 +65947,7 @@ async function runOnboardingCommand(options, io2 = defaultIo(), startServer = ru
|
|
|
65862
65947
|
saveCliStartup2(options.dataDir, startupPreferences(launch));
|
|
65863
65948
|
}
|
|
65864
65949
|
if (options.command === "setup") {
|
|
65865
|
-
const flags = [options.dataDir !== join56(
|
|
65950
|
+
const flags = [options.dataDir !== join56(homedir29(), ".atomic-app") && ` --data-dir ${options.dataDir}`, options.port !== 8799 && ` --port ${options.port}`].filter(Boolean).join("");
|
|
65866
65951
|
io2.log(`
|
|
65867
65952
|
All set. Start with: chibi${flags ? ` start${flags}` : ""} (or npx @chibitek/chibi without a global install).`);
|
|
65868
65953
|
return 0;
|