frizz 0.7.7 → 0.7.8
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/README.md +11 -46
- package/dist/dev-child.js +201 -63
- package/dist/frizz.js +918 -398
- package/package.json +1 -1
- package/runtime/cc-worker/DECISIONS.md +2 -1
- package/runtime/cc-worker/bin/frizz-mcp.mjs +3 -2
- package/web-dist/assets/{TerminalPane-Cb8jOFP9.js → TerminalPane-ubcEP7X3.js} +1 -1
- package/web-dist/assets/{abnfDiagram-VRR7QNED-Dtbg2eZ0.js → abnfDiagram-VRR7QNED-0brfnieb.js} +1 -1
- package/web-dist/assets/architecture-TIHT7OUA-DksosNDW.js +1 -0
- package/web-dist/assets/{architectureDiagram-ZJ3FMSHR-DzQjWW7u.js → architectureDiagram-ZJ3FMSHR-Dji-XBdF.js} +1 -1
- package/web-dist/assets/{blockDiagram-677ZJIJ3-BJnpkLMt.js → blockDiagram-677ZJIJ3-BQMyz3Q9.js} +1 -1
- package/web-dist/assets/{c4Diagram-LMCZKHZV-COdatsYu.js → c4Diagram-LMCZKHZV-BMNws0Oi.js} +1 -1
- package/web-dist/assets/channel-DqoPvfQz.js +1 -0
- package/web-dist/assets/{chunk-32BRIVSS-CORMw4Vm.js → chunk-32BRIVSS-CVv1ae7n.js} +1 -1
- package/web-dist/assets/{chunk-52WLFC77-C7lEadTg.js → chunk-52WLFC77-BYhPlKCT.js} +1 -1
- package/web-dist/assets/{chunk-C7G6YPKG-DZy4F97l.js → chunk-C7G6YPKG-Cn4HhNwb.js} +1 -1
- package/web-dist/assets/{chunk-EX3LRPZG-HynlfV9p.js → chunk-EX3LRPZG-P3ZYFC1W.js} +1 -1
- package/web-dist/assets/{chunk-FWX5IMBZ-BbwKNhKm.js → chunk-FWX5IMBZ-Ba3NpEQa.js} +2 -2
- package/web-dist/assets/{chunk-HOUHSVGY-lIhOZSmL.js → chunk-HOUHSVGY-BCWyMhwJ.js} +1 -1
- package/web-dist/assets/{chunk-ICXQ74PX-WGxaMO8c.js → chunk-ICXQ74PX-DWAAqHL7.js} +1 -1
- package/web-dist/assets/{chunk-MOJQB5TN-B-cx0f3u.js → chunk-MOJQB5TN-pc5VJ4Nq.js} +1 -1
- package/web-dist/assets/{chunk-OGEWGWER-DJceVwZH.js → chunk-OGEWGWER-DUxmbiuX.js} +1 -1
- package/web-dist/assets/{chunk-PUDLZKDR-CGwHZns8.js → chunk-PUDLZKDR-DRdZWzxX.js} +1 -1
- package/web-dist/assets/{chunk-Q4XR5HBZ-PTSWtmk1.js → chunk-Q4XR5HBZ-Bafzu7s-.js} +1 -1
- package/web-dist/assets/{chunk-V7JOEXUC-VNxHZPcf.js → chunk-V7JOEXUC-Bj0A8ftW.js} +1 -1
- package/web-dist/assets/{chunk-VAUOI2AC-ZXYCz_Aw.js → chunk-VAUOI2AC-DBgVQKIO.js} +1 -1
- package/web-dist/assets/{chunk-VR4S4FIN-9WCtmFJp.js → chunk-VR4S4FIN-DU-1KtuM.js} +1 -1
- package/web-dist/assets/{chunk-WYO6CB5R-V4EBjpmt.js → chunk-WYO6CB5R-DzVb3-Rj.js} +1 -1
- package/web-dist/assets/{chunk-ZGVPDNZ5-CPW0Z0ae.js → chunk-ZGVPDNZ5-BPKQvduj.js} +1 -1
- package/web-dist/assets/classDiagram-OUVF2IWQ-DwUs74RB.js +1 -0
- package/web-dist/assets/classDiagram-v2-EOCWNBFH-DwUs74RB.js +1 -0
- package/web-dist/assets/{cynefin-VYW2F7L2-E7PklfJD.js → cynefin-VYW2F7L2-lo8PqVCk.js} +1 -1
- package/web-dist/assets/{cynefinDiagram-TSTJHNR4-JIXAPjDf.js → cynefinDiagram-TSTJHNR4-BtQLaDV0.js} +1 -1
- package/web-dist/assets/{dagre-VKFMJZFB-DjXrdcNx.js → dagre-VKFMJZFB-BJ2-f-A0.js} +1 -1
- package/web-dist/assets/{diagram-FQU43EPY--i9i0qhm.js → diagram-FQU43EPY-CLM-8r74.js} +1 -1
- package/web-dist/assets/{diagram-G47NLZAW-DxgcENZ_.js → diagram-G47NLZAW-CfuoJGpN.js} +1 -1
- package/web-dist/assets/{diagram-NH7WQ7WH-CUy9Nr90.js → diagram-NH7WQ7WH-DfxxRwH8.js} +1 -1
- package/web-dist/assets/{diagram-OA4YK3LP-DbTbUaCb.js → diagram-OA4YK3LP-D7knxZee.js} +1 -1
- package/web-dist/assets/{diagram-WEI45ONY-2gk6xhOq.js → diagram-WEI45ONY-C2WfMXWl.js} +1 -1
- package/web-dist/assets/{ebnfDiagram-CCIWWBDH-uE2iDETg.js → ebnfDiagram-CCIWWBDH-DRSZ24tF.js} +1 -1
- package/web-dist/assets/{erDiagram-Q63AITRT-dztd4MUw.js → erDiagram-Q63AITRT-DXe0OrbY.js} +1 -1
- package/web-dist/assets/eventmodeling-45OFAUF4-CUIjQ7kE.js +1 -0
- package/web-dist/assets/flowDiagram-23GEKE2U-Dka-3F3n.js +1 -0
- package/web-dist/assets/{ganttDiagram-NO4QXBWP-DAds6Aht.js → ganttDiagram-NO4QXBWP-wGqOgjvs.js} +1 -1
- package/web-dist/assets/{gitGraph-TEB2WS4Q-Ci0XVvIa.js → gitGraph-TEB2WS4Q-BygokG6y.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-IHSO6WYX-C6FULyt8.js → gitGraphDiagram-IHSO6WYX-CV1933_M.js} +1 -1
- package/web-dist/assets/index-CmrDpsD8.css +1 -0
- package/web-dist/assets/{index-CNy5uOpI.js → index-DB1d3eMJ.js} +75 -75
- package/web-dist/assets/{info-DKCQHKI2-9N77dOiw.js → info-DKCQHKI2-DLavbzui.js} +1 -1
- package/web-dist/assets/{infoDiagram-FWYZ7A6U-BymP3PgG.js → infoDiagram-FWYZ7A6U-Biouxd9G.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-FXEZZL3T-CU_kQBz1.js → ishikawaDiagram-FXEZZL3T-DJxwwS3R.js} +1 -1
- package/web-dist/assets/{journeyDiagram-5HDEW3XC-DZN15HSd.js → journeyDiagram-5HDEW3XC-Clx_WkdW.js} +1 -1
- package/web-dist/assets/{kanban-definition-HUTT4EX6-J4wR5g_3.js → kanban-definition-HUTT4EX6-Bf7bX_96.js} +1 -1
- package/web-dist/assets/{line-SRzGpiDr.js → line-CV2v49IN.js} +1 -1
- package/web-dist/assets/{mermaid-parser.core-CGBscNGo.js → mermaid-parser.core-BPsFhEi6.js} +3 -3
- package/web-dist/assets/{mermaid.core-xNdwXb1r.js → mermaid.core-0EWDNL_R.js} +3 -3
- package/web-dist/assets/{mindmap-definition-LN4V7U3C-gR2dbzrj.js → mindmap-definition-LN4V7U3C-C1y4yy3Z.js} +1 -1
- package/web-dist/assets/{packet-7NZHBO7P-DrR4W6I3.js → packet-7NZHBO7P-CpcpxruB.js} +1 -1
- package/web-dist/assets/{pegDiagram-2B236MQR-DN7R-_t4.js → pegDiagram-2B236MQR-CVlVP4cH.js} +1 -1
- package/web-dist/assets/{pie-RZYD4A2V-C8VjQAFZ.js → pie-RZYD4A2V-BcVPOhTZ.js} +1 -1
- package/web-dist/assets/{pieDiagram-ENE6RG2P-5w64zdD1.js → pieDiagram-ENE6RG2P-DZv4Tfae.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-ABIIQ3AL-B4rbezq_.js → quadrantDiagram-ABIIQ3AL-DOzS_U_a.js} +1 -1
- package/web-dist/assets/{radar-I7S5WNFK-CTbbPB8m.js → radar-I7S5WNFK-8YADxkdT.js} +1 -1
- package/web-dist/assets/{railroad-3IZDKUUU-CY1er15b.js → railroad-3IZDKUUU-DzndPrRy.js} +1 -1
- package/web-dist/assets/railroad-abnf-AHOZXSZD-CCnWa6K9.js +1 -0
- package/web-dist/assets/railroad-ebnf-EBAXGLYW-jtVdzv7e.js +1 -0
- package/web-dist/assets/railroad-peg-LSFZ7HO6-B8D6TyEe.js +1 -0
- package/web-dist/assets/{railroadDiagram-RFXS5EU6-Bx2HJ3yT.js → railroadDiagram-RFXS5EU6-CPJAH-r7.js} +1 -1
- package/web-dist/assets/{requirementDiagram-TGXJPOKE-BLK-Y2rx.js → requirementDiagram-TGXJPOKE-BVFJZfwl.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-HTMAVEWB-Dk-8Miv-.js → sankeyDiagram-HTMAVEWB-CUhvFPmE.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-DBY2YBRQ-DL2alfR-.js → sequenceDiagram-DBY2YBRQ-Cy9CGhNq.js} +1 -1
- package/web-dist/assets/{stateDiagram-2N3HPSRC-Bka44wf1.js → stateDiagram-2N3HPSRC-CqOnmPLp.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-6OUMAXLB-DWKW-4qu.js +1 -0
- package/web-dist/assets/{swimlanes-5IMT3BWC-e0GbMwIr.js → swimlanes-5IMT3BWC-c_zBqkb9.js} +1 -1
- package/web-dist/assets/swimlanesDiagram-G3AALYLV-DZKoB7ae.js +8 -0
- package/web-dist/assets/{timeline-definition-FHXFAJF6-CT3GFq89.js → timeline-definition-FHXFAJF6-y_QM62SK.js} +1 -1
- package/web-dist/assets/{treeView-QDETBFTQ-BJauJ0bm.js → treeView-QDETBFTQ-T3y_1KXV.js} +1 -1
- package/web-dist/assets/{treemap-6X3UGDF4-DCX7A-nx.js → treemap-6X3UGDF4-CzvqucqY.js} +1 -1
- package/web-dist/assets/{vennDiagram-L72KCM5P-D4dm2iTR.js → vennDiagram-L72KCM5P-6-HNOpN0.js} +1 -1
- package/web-dist/assets/{wardley-OPB4EBWU-DklTDSId.js → wardley-OPB4EBWU-BrsaqsLL.js} +1 -1
- package/web-dist/assets/{wardleyDiagram-EHGQE667-CikP5hBd.js → wardleyDiagram-EHGQE667-Cr_rCzwd.js} +1 -1
- package/web-dist/assets/{xychartDiagram-FW5EYKEG-FXuOAFpz.js → xychartDiagram-FW5EYKEG-BnX6ccx4.js} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/architecture-TIHT7OUA-CTxVpl9_.js +0 -1
- package/web-dist/assets/channel-COS0Ygbp.js +0 -1
- package/web-dist/assets/classDiagram-OUVF2IWQ-Df5TLnrN.js +0 -1
- package/web-dist/assets/classDiagram-v2-EOCWNBFH-Df5TLnrN.js +0 -1
- package/web-dist/assets/eventmodeling-45OFAUF4-DPVPOEaJ.js +0 -1
- package/web-dist/assets/flowDiagram-23GEKE2U-BMIMgVYd.js +0 -1
- package/web-dist/assets/index-D6LsViUY.css +0 -1
- package/web-dist/assets/railroad-abnf-AHOZXSZD-DfEpkrtJ.js +0 -1
- package/web-dist/assets/railroad-ebnf-EBAXGLYW-Csunejgu.js +0 -1
- package/web-dist/assets/railroad-peg-LSFZ7HO6-BgRslbM_.js +0 -1
- package/web-dist/assets/stateDiagram-v2-6OUMAXLB-6KcScVPX.js +0 -1
- package/web-dist/assets/swimlanesDiagram-G3AALYLV-jaJhlDbE.js +0 -8
package/dist/dev-child.js
CHANGED
|
@@ -19518,42 +19518,29 @@ var init_storage = __esm({
|
|
|
19518
19518
|
}
|
|
19519
19519
|
});
|
|
19520
19520
|
|
|
19521
|
-
// packages/server/src/
|
|
19521
|
+
// packages/server/src/machine-config.ts
|
|
19522
19522
|
import { closeSync as closeSync5, fsyncSync as fsyncSync5, mkdirSync as mkdirSync7, openSync as openSync6, readFileSync as readFileSync6, renameSync as renameSync5, rmSync as rmSync6, writeFileSync as writeFileSync6 } from "node:fs";
|
|
19523
19523
|
import { dirname as dirname6, join as join9 } from "node:path";
|
|
19524
|
-
function
|
|
19525
|
-
return join9(frizzPaths({ home }).data, "
|
|
19526
|
-
}
|
|
19527
|
-
function pickMachine(settings) {
|
|
19528
|
-
return Object.fromEntries(MACHINE_KEYS.map((key) => [key, settings[key]]));
|
|
19524
|
+
function machineConfigPath(home) {
|
|
19525
|
+
return join9(frizzPaths({ home }).data, "config.json");
|
|
19529
19526
|
}
|
|
19530
|
-
function
|
|
19527
|
+
function readAll(home) {
|
|
19531
19528
|
let raw2;
|
|
19532
19529
|
try {
|
|
19533
|
-
raw2 = JSON.parse(readFileSync6(
|
|
19530
|
+
raw2 = JSON.parse(readFileSync6(machineConfigPath(home), "utf8"));
|
|
19534
19531
|
} catch {
|
|
19535
19532
|
return {};
|
|
19536
19533
|
}
|
|
19537
|
-
|
|
19538
|
-
const parsed = Settings.partial().safeParse(raw2);
|
|
19539
|
-
if (!parsed.success) return {};
|
|
19540
|
-
return pickPresent(parsed.data);
|
|
19534
|
+
return raw2 && typeof raw2 === "object" && !Array.isArray(raw2) ? raw2 : {};
|
|
19541
19535
|
}
|
|
19542
|
-
function
|
|
19543
|
-
const
|
|
19544
|
-
for (const key of MACHINE_KEYS) if (partial[key] !== void 0) Object.assign(out, { [key]: partial[key] });
|
|
19545
|
-
return out;
|
|
19546
|
-
}
|
|
19547
|
-
function writeMachineSettings(next, home) {
|
|
19548
|
-
writeMachineFile(machineSettingsPath(home), next);
|
|
19549
|
-
}
|
|
19550
|
-
function writeMachineFile(path, value) {
|
|
19536
|
+
function writeAll(home, all) {
|
|
19537
|
+
const path = machineConfigPath(home);
|
|
19551
19538
|
mkdirSync7(dirname6(path), { recursive: true });
|
|
19552
19539
|
const temp = `${path}.${process.pid}.tmp`;
|
|
19553
19540
|
let fd;
|
|
19554
19541
|
try {
|
|
19555
19542
|
fd = openSync6(temp, "w", 384);
|
|
19556
|
-
writeFileSync6(fd, `${JSON.stringify(
|
|
19543
|
+
writeFileSync6(fd, `${JSON.stringify(all, null, 2)}
|
|
19557
19544
|
`, "utf8");
|
|
19558
19545
|
fsyncSync5(fd);
|
|
19559
19546
|
closeSync5(fd);
|
|
@@ -19570,6 +19557,58 @@ function writeMachineFile(path, value) {
|
|
|
19570
19557
|
}
|
|
19571
19558
|
}
|
|
19572
19559
|
}
|
|
19560
|
+
function readMachineConfig(home, key, schema) {
|
|
19561
|
+
const value = readAll(home)[key];
|
|
19562
|
+
if (value === void 0) return void 0;
|
|
19563
|
+
const parsed = schema.safeParse(value);
|
|
19564
|
+
return parsed.success ? parsed.data : void 0;
|
|
19565
|
+
}
|
|
19566
|
+
function writeMachineConfig(home, key, value) {
|
|
19567
|
+
writeAll(home, { ...readAll(home), [key]: value });
|
|
19568
|
+
}
|
|
19569
|
+
function deleteMachineConfig(home, key) {
|
|
19570
|
+
const all = readAll(home);
|
|
19571
|
+
if (!(key in all)) return;
|
|
19572
|
+
delete all[key];
|
|
19573
|
+
writeAll(home, all);
|
|
19574
|
+
}
|
|
19575
|
+
var init_machine_config = __esm({
|
|
19576
|
+
"packages/server/src/machine-config.ts"() {
|
|
19577
|
+
"use strict";
|
|
19578
|
+
init_frizz_paths();
|
|
19579
|
+
}
|
|
19580
|
+
});
|
|
19581
|
+
|
|
19582
|
+
// packages/server/src/settings.ts
|
|
19583
|
+
import { readFileSync as readFileSync7, rmSync as rmSync7 } from "node:fs";
|
|
19584
|
+
import { join as join10 } from "node:path";
|
|
19585
|
+
function legacyMachineSettingsPath(home) {
|
|
19586
|
+
return join10(frizzPaths({ home }).data, "settings.json");
|
|
19587
|
+
}
|
|
19588
|
+
function pickMachine(settings) {
|
|
19589
|
+
return Object.fromEntries(MACHINE_KEYS.map((key) => [key, settings[key]]));
|
|
19590
|
+
}
|
|
19591
|
+
function readMachineSettings(home) {
|
|
19592
|
+
const stored = readMachineConfig(home, SETTINGS_KEY, MachineSettingsRecord);
|
|
19593
|
+
if (stored) return pickPresent(stored);
|
|
19594
|
+
let raw2;
|
|
19595
|
+
try {
|
|
19596
|
+
raw2 = JSON.parse(readFileSync7(legacyMachineSettingsPath(home), "utf8"));
|
|
19597
|
+
} catch {
|
|
19598
|
+
return {};
|
|
19599
|
+
}
|
|
19600
|
+
if (!raw2 || typeof raw2 !== "object") return {};
|
|
19601
|
+
const parsed = MachineSettingsRecord.safeParse(raw2);
|
|
19602
|
+
return parsed.success ? pickPresent(parsed.data) : {};
|
|
19603
|
+
}
|
|
19604
|
+
function pickPresent(partial) {
|
|
19605
|
+
const out = {};
|
|
19606
|
+
for (const key of MACHINE_KEYS) if (partial[key] !== void 0) Object.assign(out, { [key]: partial[key] });
|
|
19607
|
+
return out;
|
|
19608
|
+
}
|
|
19609
|
+
function writeMachineSettings(next, home) {
|
|
19610
|
+
writeMachineConfig(home, SETTINGS_KEY, next);
|
|
19611
|
+
}
|
|
19573
19612
|
function getSettings(storage, home) {
|
|
19574
19613
|
const raw2 = storage.getSetting(SETTINGS_KEY);
|
|
19575
19614
|
const project = raw2 === void 0 ? defaultSettings() : Settings.safeParse({ ...defaultSettings(), ...raw2 }).data ?? defaultSettings();
|
|
@@ -19583,20 +19622,23 @@ function setSettings(storage, next, home) {
|
|
|
19583
19622
|
}
|
|
19584
19623
|
function resetSettings(storage, home) {
|
|
19585
19624
|
storage.deleteSetting(SETTINGS_KEY);
|
|
19625
|
+
deleteMachineConfig(home, SETTINGS_KEY);
|
|
19586
19626
|
try {
|
|
19587
|
-
|
|
19627
|
+
rmSync7(legacyMachineSettingsPath(home), { force: true });
|
|
19588
19628
|
} catch {
|
|
19589
19629
|
}
|
|
19590
19630
|
return defaultSettings();
|
|
19591
19631
|
}
|
|
19592
|
-
var SETTINGS_KEY, MACHINE_KEYS, defaultSettings;
|
|
19632
|
+
var SETTINGS_KEY, MACHINE_KEYS, MachineSettingsRecord, defaultSettings;
|
|
19593
19633
|
var init_settings = __esm({
|
|
19594
19634
|
"packages/server/src/settings.ts"() {
|
|
19595
19635
|
"use strict";
|
|
19596
19636
|
init_src();
|
|
19597
19637
|
init_frizz_paths();
|
|
19638
|
+
init_machine_config();
|
|
19598
19639
|
SETTINGS_KEY = "settings";
|
|
19599
19640
|
MACHINE_KEYS = ["font", "notifications", "localFileOpener", "projectRail"];
|
|
19641
|
+
MachineSettingsRecord = Settings.partial();
|
|
19600
19642
|
defaultSettings = () => ({
|
|
19601
19643
|
// `bypassPermissions` = claude's --dangerously-skip-permissions: a headless worker never stops on an
|
|
19602
19644
|
// approval card. Shipped default since 0.7.2 (maintainer 2026-08-24); the Settings "Permissions"
|
|
@@ -19617,20 +19659,8 @@ var init_settings = __esm({
|
|
|
19617
19659
|
});
|
|
19618
19660
|
|
|
19619
19661
|
// packages/server/src/dispatch-preferences.ts
|
|
19620
|
-
import { readFileSync as readFileSync7 } from "node:fs";
|
|
19621
|
-
import { join as join10 } from "node:path";
|
|
19622
|
-
function machineDispatchPreferencesPath(home) {
|
|
19623
|
-
return join10(frizzPaths({ home }).data, "dispatch-preferences.json");
|
|
19624
|
-
}
|
|
19625
19662
|
function readMachineDispatchPreferences(home) {
|
|
19626
|
-
|
|
19627
|
-
try {
|
|
19628
|
-
raw2 = JSON.parse(readFileSync7(machineDispatchPreferencesPath(home), "utf8"));
|
|
19629
|
-
} catch {
|
|
19630
|
-
return void 0;
|
|
19631
|
-
}
|
|
19632
|
-
const parsed = DispatchPreferences.safeParse(raw2);
|
|
19633
|
-
return parsed.success ? parsed.data : void 0;
|
|
19663
|
+
return readMachineConfig(home, MACHINE_KEY, DispatchPreferences);
|
|
19634
19664
|
}
|
|
19635
19665
|
function permissionFor(backend, mode) {
|
|
19636
19666
|
if (backend === "codex") {
|
|
@@ -19682,18 +19712,18 @@ function setDispatchPreference(storage, settings, home, update, codexModels = []
|
|
|
19682
19712
|
};
|
|
19683
19713
|
}
|
|
19684
19714
|
const validated = DispatchPreferences.parse(next);
|
|
19685
|
-
|
|
19715
|
+
writeMachineConfig(home, MACHINE_KEY, validated);
|
|
19686
19716
|
storage.setSetting(KEY, validated);
|
|
19687
19717
|
return validated;
|
|
19688
19718
|
}
|
|
19689
|
-
var KEY;
|
|
19719
|
+
var KEY, MACHINE_KEY;
|
|
19690
19720
|
var init_dispatch_preferences = __esm({
|
|
19691
19721
|
"packages/server/src/dispatch-preferences.ts"() {
|
|
19692
19722
|
"use strict";
|
|
19693
19723
|
init_src();
|
|
19694
|
-
|
|
19695
|
-
init_settings();
|
|
19724
|
+
init_machine_config();
|
|
19696
19725
|
KEY = "dispatch-preferences.v1";
|
|
19726
|
+
MACHINE_KEY = "dispatchPreferences";
|
|
19697
19727
|
}
|
|
19698
19728
|
});
|
|
19699
19729
|
|
|
@@ -19795,7 +19825,7 @@ var init_discover = __esm({
|
|
|
19795
19825
|
});
|
|
19796
19826
|
|
|
19797
19827
|
// packages/server/src/session-files.ts
|
|
19798
|
-
import { lstatSync, rmSync as
|
|
19828
|
+
import { lstatSync, rmSync as rmSync8 } from "node:fs";
|
|
19799
19829
|
import { join as join12 } from "node:path";
|
|
19800
19830
|
function systemPromptPath(sessionId) {
|
|
19801
19831
|
if (!SESSION_ID_RE.test(sessionId)) throw new Error("invalid session id");
|
|
@@ -19821,7 +19851,7 @@ function unlinkDirectChild(parent, filename) {
|
|
|
19821
19851
|
if (!isDirectDirectory(parent)) return pathAbsent(parent);
|
|
19822
19852
|
const child = join12(parent, filename);
|
|
19823
19853
|
try {
|
|
19824
|
-
|
|
19854
|
+
rmSync8(child, { force: true });
|
|
19825
19855
|
} catch {
|
|
19826
19856
|
return false;
|
|
19827
19857
|
}
|
|
@@ -19836,7 +19866,7 @@ function cleanupAdoptionSessionFiles(projectDir, sessionId) {
|
|
|
19836
19866
|
if (isDirectDirectory(threads)) {
|
|
19837
19867
|
const child = join12(threads, sessionId);
|
|
19838
19868
|
try {
|
|
19839
|
-
|
|
19869
|
+
rmSync8(child, { recursive: true, force: true });
|
|
19840
19870
|
} catch {
|
|
19841
19871
|
clean = false;
|
|
19842
19872
|
}
|
|
@@ -35042,7 +35072,7 @@ var init_auth_status = __esm({
|
|
|
35042
35072
|
});
|
|
35043
35073
|
|
|
35044
35074
|
// packages/server/src/dispatch.ts
|
|
35045
|
-
import { closeSync as closeSync12, constants, existsSync as existsSync10, fstatSync as fstatSync2, lstatSync as lstatSync3, openSync as openSync13, readFileSync as readFileSync17, realpathSync as realpathSync7, statSync as statSync12, writeFileSync as writeFileSync10, mkdirSync as mkdirSync13, rmSync as
|
|
35075
|
+
import { closeSync as closeSync12, constants, existsSync as existsSync10, fstatSync as fstatSync2, lstatSync as lstatSync3, openSync as openSync13, readFileSync as readFileSync17, realpathSync as realpathSync7, statSync as statSync12, writeFileSync as writeFileSync10, mkdirSync as mkdirSync13, rmSync as rmSync9 } from "node:fs";
|
|
35046
35076
|
import { basename as basename6, join as join28, dirname as dirname11 } from "node:path";
|
|
35047
35077
|
import { createHash as createHash11, randomUUID as randomUUID13 } from "node:crypto";
|
|
35048
35078
|
function fallbackTitle(prompt) {
|
|
@@ -35341,7 +35371,7 @@ function createDispatcher(deps) {
|
|
|
35341
35371
|
function cleanupPrewrites(built) {
|
|
35342
35372
|
for (const path of new Set(built.prewrite.map((file) => file.path))) {
|
|
35343
35373
|
try {
|
|
35344
|
-
|
|
35374
|
+
rmSync9(path, { force: true });
|
|
35345
35375
|
} catch {
|
|
35346
35376
|
}
|
|
35347
35377
|
}
|
|
@@ -35349,7 +35379,7 @@ function createDispatcher(deps) {
|
|
|
35349
35379
|
function cleanupDispatchFiles(scratchRel, built, sessionId) {
|
|
35350
35380
|
cleanupPrewrites(built);
|
|
35351
35381
|
try {
|
|
35352
|
-
|
|
35382
|
+
rmSync9(join28(deps.project.dir, scratchRel), { force: true, recursive: true });
|
|
35353
35383
|
} catch {
|
|
35354
35384
|
}
|
|
35355
35385
|
cleanupAdoptionSessionFiles(deps.project.dir, sessionId);
|
|
@@ -35967,7 +35997,7 @@ function hasFreshDelivery(row, processGone) {
|
|
|
35967
35997
|
if (processGone) return false;
|
|
35968
35998
|
return parseDeliveryLedger(row.delivery_ledger).some((d) => d.state === "pending" || d.state === "enqueued" || d.state === "delivered");
|
|
35969
35999
|
}
|
|
35970
|
-
function deriveNeedsYou(row, tele, runtime, hasActionableInteraction = false, nowMs = Date.now(), limitPause = void 0, excuseLiveOwnWork = true, deliveryProcessGone = false, github = {}, registeredPrWatches = /* @__PURE__ */ new Set()) {
|
|
36000
|
+
function deriveNeedsYou(row, tele, runtime, hasActionableInteraction = false, nowMs = Date.now(), limitPause = void 0, excuseLiveOwnWork = true, deliveryProcessGone = false, github = {}, registeredPrWatches = /* @__PURE__ */ new Set(), armedTimerIds = /* @__PURE__ */ new Set()) {
|
|
35971
36001
|
if (futureSnooze(row, nowMs)) return false;
|
|
35972
36002
|
if (hasActionableInteraction) return true;
|
|
35973
36003
|
if (runtime === "perm-prompt") return true;
|
|
@@ -35982,7 +36012,7 @@ function deriveNeedsYou(row, tele, runtime, hasActionableInteraction = false, no
|
|
|
35982
36012
|
if (excuseLiveOwnWork && runtime !== "exited" && hasLiveBackgroundWork(tele) && !tele?.lastFence) return false;
|
|
35983
36013
|
if (excuseLiveOwnWork && runtime !== "exited" && hasDeclaredBackgroundPark(tele, nowMs)) return false;
|
|
35984
36014
|
if (excuseLiveOwnWork && runtime !== "exited" && heldByRunningChecks(tele, github, registeredPrWatches)) return false;
|
|
35985
|
-
if (runtime !== "exited" && hasLiveOwnWork(tele) && tele?.lastFence?.kind !== "done") return !bgSnoozeArmed(row);
|
|
36015
|
+
if (runtime !== "exited" && (hasLiveOwnWork(tele) || hasParkedTimerWatch(tele, armedTimerIds)) && tele?.lastFence?.kind !== "done") return !bgSnoozeArmed(row);
|
|
35986
36016
|
if (tele?.lastFence?.kind === "done") return true;
|
|
35987
36017
|
return true;
|
|
35988
36018
|
}
|
|
@@ -35993,7 +36023,7 @@ function deriveAwaitingBackground(row, tele, runtime, hasActionableInteraction =
|
|
|
35993
36023
|
if (tele?.lastFence?.kind === "awaiting" && !hasParkedPrWatch(tele) && !hasDeclaredBackgroundPark(tele, nowMs) && // A TIMER PARK IS THE SAME EXCEPTION AGAIN (2026-08-24): its fence has no park action either, so
|
|
35994
36024
|
// suppressing this card left the wait stated nowhere but the fence's own machinery footer.
|
|
35995
36025
|
!hasParkedTimerWatch(tele, armedTimerIds)) return false;
|
|
35996
|
-
return deriveNeedsYou({ ...row, bg_snooze_rested_at: null }, tele, runtime, hasActionableInteraction, nowMs, limitPause, false, deliveryProcessGone);
|
|
36026
|
+
return deriveNeedsYou({ ...row, bg_snooze_rested_at: null }, tele, runtime, hasActionableInteraction, nowMs, limitPause, false, deliveryProcessGone, {}, /* @__PURE__ */ new Set(), armedTimerIds);
|
|
35997
36027
|
}
|
|
35998
36028
|
function resolveSessionProfile(row, tele) {
|
|
35999
36029
|
const persistedModel = row.model?.trim() || void 0;
|
|
@@ -36099,7 +36129,7 @@ function sessionThreadView(projectDir, storage, row, tele, registeredLegacyTermi
|
|
|
36099
36129
|
const state = effectiveSessionState(row, registeredLegacyTerminal);
|
|
36100
36130
|
const archived = state === "archived";
|
|
36101
36131
|
const limitPause = resolveLimitPause(row, tele, nowMs);
|
|
36102
|
-
const needsYou = archived ? false : deriveNeedsYou(row, tele, runtime, interactionPresence.needsUser, nowMs, limitPause, true, deliveryProcessGone, github, registeredPrWatches);
|
|
36132
|
+
const needsYou = archived ? false : deriveNeedsYou(row, tele, runtime, interactionPresence.needsUser, nowMs, limitPause, true, deliveryProcessGone, github, registeredPrWatches, armedTimerIds);
|
|
36103
36133
|
const awaitingBackground = archived ? false : deriveAwaitingBackground(row, tele, runtime, interactionPresence.needsUser, nowMs, limitPause, deliveryProcessGone, github, registeredPrWatches, armedTimerIds);
|
|
36104
36134
|
const crashed = runtime === "exited" && (tele?.turn === "in-flight" || hasLiveBackgroundWork(tele) || headlessLostWork);
|
|
36105
36135
|
const snoozedUntil = futureSnooze(row, nowMs);
|
|
@@ -36585,7 +36615,8 @@ function delivery(row) {
|
|
|
36585
36615
|
createdAt: row.created_at,
|
|
36586
36616
|
updatedAt: row.updated_at,
|
|
36587
36617
|
deliveredAt: row.delivered_at,
|
|
36588
|
-
terminalAt: row.terminal_at
|
|
36618
|
+
terminalAt: row.terminal_at,
|
|
36619
|
+
sentAt: row.sent_at ?? null
|
|
36589
36620
|
};
|
|
36590
36621
|
}
|
|
36591
36622
|
function createWakeDeliveryStore(db) {
|
|
@@ -36608,11 +36639,14 @@ function createWakeDeliveryStore(db) {
|
|
|
36608
36639
|
updated_at INTEGER NOT NULL,
|
|
36609
36640
|
delivered_at INTEGER,
|
|
36610
36641
|
terminal_at INTEGER,
|
|
36642
|
+
sent_at INTEGER,
|
|
36611
36643
|
UNIQUE(thread_slug, session_id, fence_id)
|
|
36612
36644
|
);
|
|
36613
36645
|
CREATE INDEX IF NOT EXISTS wake_delivery_due
|
|
36614
36646
|
ON wake_delivery(state, next_attempt_at, created_at);
|
|
36615
36647
|
`);
|
|
36648
|
+
const columns = db.prepare("PRAGMA table_info(wake_delivery)").all();
|
|
36649
|
+
if (!columns.some((c) => c.name === "sent_at")) db.exec("ALTER TABLE wake_delivery ADD COLUMN sent_at INTEGER");
|
|
36616
36650
|
const byId = db.prepare("SELECT * FROM wake_delivery WHERE id = ?");
|
|
36617
36651
|
const all = db.prepare("SELECT * FROM wake_delivery ORDER BY created_at, id");
|
|
36618
36652
|
const open = db.prepare(
|
|
@@ -36649,7 +36683,7 @@ function createWakeDeliveryStore(db) {
|
|
|
36649
36683
|
const claimStmt = db.prepare(`
|
|
36650
36684
|
UPDATE wake_delivery SET
|
|
36651
36685
|
state = 'leased', attempts = attempts + 1, lease_owner = @owner, lease_until = @leaseUntil,
|
|
36652
|
-
last_error = NULL, updated_at = @now
|
|
36686
|
+
last_error = NULL, sent_at = NULL, updated_at = @now
|
|
36653
36687
|
WHERE id = @id AND state = 'pending' AND next_attempt_at <= @now AND attempts < @maxAttempts
|
|
36654
36688
|
`);
|
|
36655
36689
|
const deferFailureStmt = db.prepare(`
|
|
@@ -36657,6 +36691,11 @@ function createWakeDeliveryStore(db) {
|
|
|
36657
36691
|
lease_until = @retryAt, last_error = @error, updated_at = @now
|
|
36658
36692
|
WHERE id = @id AND state = 'leased' AND lease_owner = @owner
|
|
36659
36693
|
`);
|
|
36694
|
+
const markSentStmt = db.prepare(`
|
|
36695
|
+
UPDATE wake_delivery SET
|
|
36696
|
+
sent_at = @now, lease_until = @confirmUntil, last_error = NULL, updated_at = @now
|
|
36697
|
+
WHERE id = @id AND state = 'leased' AND lease_owner = @owner
|
|
36698
|
+
`);
|
|
36660
36699
|
const recoverExpiredStmt = db.prepare(`
|
|
36661
36700
|
UPDATE wake_delivery SET
|
|
36662
36701
|
state = CASE WHEN attempts >= @maxAttempts THEN 'exhausted' ELSE 'pending' END,
|
|
@@ -36725,6 +36764,7 @@ function createWakeDeliveryStore(db) {
|
|
|
36725
36764
|
return row ? delivery(row) : void 0;
|
|
36726
36765
|
},
|
|
36727
36766
|
acknowledge: (id, owner, now) => acknowledgeStmt.run({ id, owner, now }).changes === 1,
|
|
36767
|
+
markSent: (id, owner, now, confirmUntil) => markSentStmt.run({ id, owner, now, confirmUntil }).changes === 1,
|
|
36728
36768
|
confirm: (id, now) => confirmStmt.run({ id, now }).changes === 1,
|
|
36729
36769
|
supersede: (id, now, reason) => supersedeStmt.run({ id, now, reason: reason.slice(0, 500) }).changes === 1
|
|
36730
36770
|
};
|
|
@@ -37277,6 +37317,28 @@ function isTimerFenceId(fenceId) {
|
|
|
37277
37317
|
function timerIdOf(fenceId) {
|
|
37278
37318
|
return fenceId.slice(TIMER_FENCE_PREFIX.length + 1);
|
|
37279
37319
|
}
|
|
37320
|
+
function conciseGhError(err) {
|
|
37321
|
+
const code = err?.code;
|
|
37322
|
+
if (code === "ENOENT") return "the `gh` CLI is not installed on the PATH of the process Frizz runs as";
|
|
37323
|
+
if (err?.killed || code === "ETIMEDOUT") return "`gh` did not answer within 15s";
|
|
37324
|
+
const stderr = typeof err?.stderr === "string" ? err.stderr : "";
|
|
37325
|
+
const line = stderr.trim().split(/\r?\n/).map((l) => l.trim()).find((l) => l.length > 0);
|
|
37326
|
+
if (line) return line.slice(0, 300);
|
|
37327
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
37328
|
+
return message.trim().split(/\r?\n/, 1)[0]?.slice(0, 300) || "unknown error";
|
|
37329
|
+
}
|
|
37330
|
+
async function probePrReadable(ref) {
|
|
37331
|
+
try {
|
|
37332
|
+
await execFileAsync4(
|
|
37333
|
+
"gh",
|
|
37334
|
+
["pr", "view", String(ref.number), "--repo", `${ref.owner}/${ref.repo}`, "--json", "state"],
|
|
37335
|
+
{ timeout: 15e3, maxBuffer: 1e6, env: { ...process.env, GH_PAGER: "cat", GH_PROMPT_DISABLED: "1" } }
|
|
37336
|
+
);
|
|
37337
|
+
return { ok: true };
|
|
37338
|
+
} catch (err) {
|
|
37339
|
+
return { ok: false, reason: conciseGhError(err) };
|
|
37340
|
+
}
|
|
37341
|
+
}
|
|
37280
37342
|
async function defaultFetchPr(ref) {
|
|
37281
37343
|
try {
|
|
37282
37344
|
const { stdout } = await execFileAsync4(
|
|
@@ -37303,8 +37365,8 @@ async function defaultFetchPr(ref) {
|
|
|
37303
37365
|
reviewDecision: typeof j.reviewDecision === "string" ? j.reviewDecision : void 0,
|
|
37304
37366
|
workflowRuns
|
|
37305
37367
|
};
|
|
37306
|
-
} catch {
|
|
37307
|
-
|
|
37368
|
+
} catch (err) {
|
|
37369
|
+
throw new Error(conciseGhError(err));
|
|
37308
37370
|
}
|
|
37309
37371
|
}
|
|
37310
37372
|
function createScheduler(deps) {
|
|
@@ -37317,6 +37379,7 @@ function createScheduler(deps) {
|
|
|
37317
37379
|
const retryBaseMs = Math.max(1, deps.retryBaseMs ?? 5e3);
|
|
37318
37380
|
const retryMaxMs = Math.max(retryBaseMs, deps.retryMaxMs ?? 5 * 6e4);
|
|
37319
37381
|
const maxDeliveryAttempts = Math.max(1, deps.maxDeliveryAttempts ?? 6);
|
|
37382
|
+
const confirmGraceMs = Math.max(1, deps.confirmGraceMs ?? 6e4);
|
|
37320
37383
|
const deliveryBatchSize = Math.max(0, deps.deliveryBatchSize ?? 50);
|
|
37321
37384
|
const deliveryOwner = randomUUID14();
|
|
37322
37385
|
const outbox = createWakeDeliveryStore(deps.storage.db);
|
|
@@ -37446,6 +37509,23 @@ function createScheduler(deps) {
|
|
|
37446
37509
|
log3(`waker: GitHub review check failed for ${key} (${slug}) [${result.failure.kind}] \u2014 ${result.failure.message}${suppressed}`);
|
|
37447
37510
|
reviewFailures.set(key, { signature, loggedAt: at, suppressed: 0 });
|
|
37448
37511
|
}
|
|
37512
|
+
const statusFailures = /* @__PURE__ */ new Map();
|
|
37513
|
+
function recordStatusFailure(key, message, at) {
|
|
37514
|
+
const prior = statusFailures.get(key);
|
|
37515
|
+
if (prior?.signature === message && at - prior.loggedAt < 15 * 6e4) {
|
|
37516
|
+
prior.suppressed++;
|
|
37517
|
+
return;
|
|
37518
|
+
}
|
|
37519
|
+
const suppressed = prior?.suppressed ? ` (${prior.suppressed} identical repeats suppressed)` : "";
|
|
37520
|
+
log3(`waker: PR status check failed for ${key} \u2014 ${message}${suppressed}; CI and merge wakes cannot fire until \`gh\` can read it`);
|
|
37521
|
+
statusFailures.set(key, { signature: message, loggedAt: at, suppressed: 0 });
|
|
37522
|
+
}
|
|
37523
|
+
function recordStatusSuccess(key) {
|
|
37524
|
+
const prior = statusFailures.get(key);
|
|
37525
|
+
if (!prior) return;
|
|
37526
|
+
statusFailures.delete(key);
|
|
37527
|
+
log3(`waker: PR status check recovered for ${key}${prior.suppressed ? `; ${prior.suppressed} identical repeats were suppressed` : ""}`);
|
|
37528
|
+
}
|
|
37449
37529
|
function recordReviewSuccess(key, slug) {
|
|
37450
37530
|
const prior = reviewFailures.get(key);
|
|
37451
37531
|
if (!prior) return;
|
|
@@ -37790,9 +37870,10 @@ ${clock}`;
|
|
|
37790
37870
|
if (pr) {
|
|
37791
37871
|
status.set(key, githubWatchStatus(pr, new Date(nowMs).toISOString()));
|
|
37792
37872
|
publishGithubStatus(key, pr, nowMs);
|
|
37873
|
+
recordStatusSuccess(key);
|
|
37793
37874
|
}
|
|
37794
37875
|
} catch (err) {
|
|
37795
|
-
|
|
37876
|
+
recordStatusFailure(key, err instanceof Error ? err.message : String(err), nowMs);
|
|
37796
37877
|
}
|
|
37797
37878
|
try {
|
|
37798
37879
|
const result = normalizeReviewResult(await fetchGithubReview(ref));
|
|
@@ -38086,6 +38167,38 @@ ${clock}`;
|
|
|
38086
38167
|
continue;
|
|
38087
38168
|
}
|
|
38088
38169
|
if (item.state !== "leased" || item.leaseUntil === null || item.leaseUntil > nowMs) continue;
|
|
38170
|
+
if (item.sentAt !== null) {
|
|
38171
|
+
const runtime = deps.wakeRuntimeState?.(item.slug, item.sessionId) ?? "unknown";
|
|
38172
|
+
if (runtime !== "dead") {
|
|
38173
|
+
if (outbox.confirm(item.id, nowMs)) {
|
|
38174
|
+
settleSnooze(item);
|
|
38175
|
+
settleSchedulePrompt(item);
|
|
38176
|
+
settleRestPrompt(item);
|
|
38177
|
+
settleCompactPrompt(item);
|
|
38178
|
+
settleTimer(item);
|
|
38179
|
+
settleSignoffNudge(item);
|
|
38180
|
+
log3(`waker: delivered ${item.slug} \u2014 ${item.reason}${item.attempts > 1 ? ` (on attempt ${item.attempts})` : ""}`);
|
|
38181
|
+
}
|
|
38182
|
+
continue;
|
|
38183
|
+
}
|
|
38184
|
+
if (context !== "current-idle") continue;
|
|
38185
|
+
const recovered2 = outbox.recoverExpired(
|
|
38186
|
+
item.id,
|
|
38187
|
+
nowMs,
|
|
38188
|
+
nowMs + retryDelay(item.attempts),
|
|
38189
|
+
maxDeliveryAttempts,
|
|
38190
|
+
"the worker's process died before it read this wake"
|
|
38191
|
+
);
|
|
38192
|
+
if (!recovered2) continue;
|
|
38193
|
+
if (recovered2.state === "exhausted") {
|
|
38194
|
+
settleSnooze(item);
|
|
38195
|
+
settleTimer(item);
|
|
38196
|
+
log3(`waker: delivery EXHAUSTED for ${item.slug} after ${recovered2.attempts} attempts \u2014 ${recovered2.lastError ?? "unknown error"}`);
|
|
38197
|
+
} else {
|
|
38198
|
+
log3(`waker: wake LOST for ${item.slug} \u2014 ${item.reason}: the worker's process died before it read it; sending again (attempt ${item.attempts} of ${maxDeliveryAttempts} spent)`);
|
|
38199
|
+
}
|
|
38200
|
+
continue;
|
|
38201
|
+
}
|
|
38089
38202
|
if (context !== "current-idle") continue;
|
|
38090
38203
|
const recovered = outbox.recoverExpired(
|
|
38091
38204
|
item.id,
|
|
@@ -38155,6 +38268,15 @@ ${clock}`;
|
|
|
38155
38268
|
log3(`waker: delivery FAILED for ${item.slug} (attempt ${item.attempts} of ${maxDeliveryAttempts}): ${message}`);
|
|
38156
38269
|
continue;
|
|
38157
38270
|
}
|
|
38271
|
+
const runtime = deps.wakeRuntimeState?.(item.slug, item.sessionId) ?? "unknown";
|
|
38272
|
+
if (runtime !== "unknown") {
|
|
38273
|
+
const sentAt = now();
|
|
38274
|
+
if (outbox.markSent(item.id, deliveryOwner, sentAt, sentAt + confirmGraceMs)) {
|
|
38275
|
+
log3(`waker: sent ${item.slug} \u2014 ${item.reason}; confirming within ${Math.round(confirmGraceMs / 1e3)}s`);
|
|
38276
|
+
checkpoint("after-delivery", item);
|
|
38277
|
+
continue;
|
|
38278
|
+
}
|
|
38279
|
+
}
|
|
38158
38280
|
const retried = item.attempts > 1 ? ` (on attempt ${item.attempts})` : "";
|
|
38159
38281
|
log3(`waker: delivered ${item.slug} \u2014 ${item.reason}${retried}`);
|
|
38160
38282
|
checkpoint("after-delivery", item);
|
|
@@ -39578,6 +39700,15 @@ function createContextUnchecked(opts, resources) {
|
|
|
39578
39700
|
// instant for a weekly limit, whose message text carries a clock but no date; readQuota memoizes,
|
|
39579
39701
|
// so consulting it per tick costs a live request only every few minutes.
|
|
39580
39702
|
readQuota,
|
|
39703
|
+
// The only runtime that can answer is the broker: its daemon record is on disk while the daemon
|
|
39704
|
+
// lives and is unlinked when it dies (liveBrokerRecords checks the pid), so "did the process that
|
|
39705
|
+
// took this wake survive" is one directory read. Codex and any row whose session moved on answer
|
|
39706
|
+
// "unknown", which keeps their wakes on the delivered-on-return path they always had.
|
|
39707
|
+
wakeRuntimeState: (slug, sessionId) => {
|
|
39708
|
+
const row = storage.getSession(slug);
|
|
39709
|
+
if (!row || row.session_id !== sessionId || row.backend !== "claude" || row.claude_runtime !== "broker" || !claudeBroker) return "unknown";
|
|
39710
|
+
return liveBrokerRecords(project.stateDir).some((r) => r.sessionId === sessionId) ? "alive" : "dead";
|
|
39711
|
+
},
|
|
39581
39712
|
resume: (slug, message, deliveryId) => {
|
|
39582
39713
|
const deliveryMessage = `${message}
|
|
39583
39714
|
|
|
@@ -39659,6 +39790,7 @@ ${wakeDeliveryToken(deliveryId)}`;
|
|
|
39659
39790
|
tailer,
|
|
39660
39791
|
dispatcher,
|
|
39661
39792
|
scheduler,
|
|
39793
|
+
probePr: probePrReadable,
|
|
39662
39794
|
stopSubscriptions,
|
|
39663
39795
|
backendFor,
|
|
39664
39796
|
getSettings: () => getSettings(storage, home),
|
|
@@ -45101,7 +45233,7 @@ var MARKDOWN_FILE_EXT, MARKDOWN_READ_LIMIT;
|
|
|
45101
45233
|
var init_local_file = __esm({
|
|
45102
45234
|
"packages/server/src/local-file.ts"() {
|
|
45103
45235
|
"use strict";
|
|
45104
|
-
MARKDOWN_FILE_EXT = /\.(?:md|markdown)$/i;
|
|
45236
|
+
MARKDOWN_FILE_EXT = /\.(?:md|mdx|markdown)$/i;
|
|
45105
45237
|
MARKDOWN_READ_LIMIT = 1024 * 1024;
|
|
45106
45238
|
}
|
|
45107
45239
|
});
|
|
@@ -45783,7 +45915,7 @@ import { readFileSync as readFileSync23, statSync as statSync17 } from "node:fs"
|
|
|
45783
45915
|
import { join as join36, resolve as resolve8 } from "node:path";
|
|
45784
45916
|
import { randomUUID as randomUUID16 } from "node:crypto";
|
|
45785
45917
|
import { basename as basename9, dirname as dirname14 } from "node:path";
|
|
45786
|
-
import { existsSync as existsSync14, mkdirSync as mkdirSync16, rmSync as
|
|
45918
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync16, rmSync as rmSync10, writeFileSync as writeFileSync13 } from "node:fs";
|
|
45787
45919
|
import { homedir as homedir16 } from "node:os";
|
|
45788
45920
|
function validateGithubDispatchProfile(input) {
|
|
45789
45921
|
validateThreadProfile(input.backend, input.model, input.effort);
|
|
@@ -45974,12 +46106,12 @@ function storeProjectIcon(id, name, bytes) {
|
|
|
45974
46106
|
mkdirSync16(dirname14(path), { recursive: true });
|
|
45975
46107
|
writeFileSync13(path, bytes);
|
|
45976
46108
|
if (!imageDimensions(path)) {
|
|
45977
|
-
|
|
46109
|
+
rmSync10(path, { force: true });
|
|
45978
46110
|
throw new Error("That file does not look like an image Frizz can draw.");
|
|
45979
46111
|
}
|
|
45980
46112
|
for (const stale of PROJECT_ICON_EXTENSIONS) {
|
|
45981
46113
|
const other = customIconPath(id, `.${stale}`);
|
|
45982
|
-
if (other !== path)
|
|
46114
|
+
if (other !== path) rmSync10(other, { force: true });
|
|
45983
46115
|
}
|
|
45984
46116
|
const updated = setProjectIcon(id, path);
|
|
45985
46117
|
if (!updated) throw new Error("No such project.");
|
|
@@ -47130,6 +47262,12 @@ ${gapNote}` : input.message;
|
|
|
47130
47262
|
if (forMs === null) {
|
|
47131
47263
|
throw new Error(`\`for: ${input.for}\` is not a duration \u2014 give one like \`30m\`, \`2h\` or \`3d\` (max 24h)`);
|
|
47132
47264
|
}
|
|
47265
|
+
const probe = await ctx.probePr(ref);
|
|
47266
|
+
if (!probe.ok) {
|
|
47267
|
+
throw new Error(
|
|
47268
|
+
`\`${target}\` cannot be watched \u2014 the server's \`gh\` could not read it: ${probe.reason}. Frizz polls with the \`gh\` of the process it runs as, not yours: check \`gh auth status\` there and that the repo is reachable, then register again. If GitHub itself was briefly down, registering again in a minute is enough.`
|
|
47269
|
+
);
|
|
47270
|
+
}
|
|
47133
47271
|
const now = Date.now();
|
|
47134
47272
|
const id = `prw_${randomUUID16().replace(/-/g, "").slice(0, 12)}`;
|
|
47135
47273
|
ctx.storage.armPrWatch({ id, slug: input.slug, owner: ref.owner, repo: ref.repo, number: ref.number, createdAtMs: now, expiresAtMs: now + forMs });
|
|
@@ -47597,7 +47735,7 @@ ${gapNote}` : input.message;
|
|
|
47597
47735
|
output: ProjectCard,
|
|
47598
47736
|
handler: async ({ input }) => {
|
|
47599
47737
|
for (const extension2 of PROJECT_ICON_EXTENSIONS) {
|
|
47600
|
-
|
|
47738
|
+
rmSync10(customIconPath(input.id, `.${extension2}`), { force: true });
|
|
47601
47739
|
}
|
|
47602
47740
|
const updated = clearProjectIcon(input.id);
|
|
47603
47741
|
if (!updated) throw new Error("No such project.");
|
|
@@ -49820,7 +49958,7 @@ var init_app_socket = __esm({
|
|
|
49820
49958
|
});
|
|
49821
49959
|
|
|
49822
49960
|
// packages/server/src/boot-progress.ts
|
|
49823
|
-
import { mkdirSync as mkdirSync18, readFileSync as readFileSync27, renameSync as renameSync10, rmSync as
|
|
49961
|
+
import { mkdirSync as mkdirSync18, readFileSync as readFileSync27, renameSync as renameSync10, rmSync as rmSync11, writeFileSync as writeFileSync15 } from "node:fs";
|
|
49824
49962
|
import { basename as basename11, dirname as dirname16, join as join40 } from "node:path";
|
|
49825
49963
|
function bootProgressPath(stateDir) {
|
|
49826
49964
|
return join40(stateDir, BOOT_PROGRESS_NAME);
|
|
@@ -49854,7 +49992,7 @@ function createBootProgressPublisher(stateDir, minIntervalMs = 200) {
|
|
|
49854
49992
|
return Object.assign(write, {
|
|
49855
49993
|
done: () => {
|
|
49856
49994
|
try {
|
|
49857
|
-
|
|
49995
|
+
rmSync11(path, { force: true });
|
|
49858
49996
|
} catch {
|
|
49859
49997
|
}
|
|
49860
49998
|
}
|