frizz-server 0.13.9 → 0.14.1
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/claude-agent-broker.js +10859 -10590
- package/dist/dev-child.js +162 -43
- package/package.json +1 -1
- package/web-dist/assets/{TerminalPane-uhdLUx67.js → TerminalPane-C0ndNP2R.js} +1 -1
- package/web-dist/assets/{abnfDiagram-VRR7QNED-gpWvs3KP.js → abnfDiagram-VRR7QNED-Cnsh1t8G.js} +1 -1
- package/web-dist/assets/architecture-TIHT7OUA-BFTL2lQD.js +1 -0
- package/web-dist/assets/{architectureDiagram-ZJ3FMSHR-Di1xsjNG.js → architectureDiagram-ZJ3FMSHR-DnVeuKCI.js} +1 -1
- package/web-dist/assets/{blockDiagram-677ZJIJ3-CO85-Qea.js → blockDiagram-677ZJIJ3-DqKYXGJI.js} +1 -1
- package/web-dist/assets/{c4Diagram-LMCZKHZV-B32PSJlR.js → c4Diagram-LMCZKHZV-DRNawTpl.js} +1 -1
- package/web-dist/assets/channel-Nm8jIZOi.js +1 -0
- package/web-dist/assets/{chunk-32BRIVSS-B-7ltfTH.js → chunk-32BRIVSS-BKqSe_nC.js} +1 -1
- package/web-dist/assets/{chunk-52WLFC77-B68qDE3i.js → chunk-52WLFC77-BCaLFglM.js} +1 -1
- package/web-dist/assets/{chunk-C7G6YPKG-9I1vJXzs.js → chunk-C7G6YPKG-vlAetigo.js} +1 -1
- package/web-dist/assets/{chunk-EX3LRPZG-50O1GLJq.js → chunk-EX3LRPZG-C1O5APJY.js} +1 -1
- package/web-dist/assets/{chunk-FWX5IMBZ-DavZMlKl.js → chunk-FWX5IMBZ-DRBYKkzP.js} +2 -2
- package/web-dist/assets/{chunk-HOUHSVGY-BGjNDQbr.js → chunk-HOUHSVGY-C7BVwG9_.js} +1 -1
- package/web-dist/assets/{chunk-ICXQ74PX-D4yFEGU8.js → chunk-ICXQ74PX-DVwDQwtI.js} +1 -1
- package/web-dist/assets/{chunk-MOJQB5TN-CsQKxzjy.js → chunk-MOJQB5TN-5DhQ9vKC.js} +1 -1
- package/web-dist/assets/{chunk-OGEWGWER-B2ujmhTF.js → chunk-OGEWGWER-Bgg5ovNG.js} +1 -1
- package/web-dist/assets/{chunk-PUDLZKDR-B_Cnk_kp.js → chunk-PUDLZKDR-B-hJsSaU.js} +1 -1
- package/web-dist/assets/{chunk-Q4XR5HBZ-CNJi7ivq.js → chunk-Q4XR5HBZ-BRKTCm77.js} +1 -1
- package/web-dist/assets/{chunk-V7JOEXUC-qL-RXxQy.js → chunk-V7JOEXUC-DLg_AuLv.js} +1 -1
- package/web-dist/assets/{chunk-VAUOI2AC-C_AO-SE_.js → chunk-VAUOI2AC-CRKn6Hdz.js} +1 -1
- package/web-dist/assets/{chunk-VR4S4FIN-NU1W8e1J.js → chunk-VR4S4FIN-C3tBNXjB.js} +1 -1
- package/web-dist/assets/{chunk-WYO6CB5R-B3l7AohL.js → chunk-WYO6CB5R-LRVUOcLK.js} +1 -1
- package/web-dist/assets/{chunk-ZGVPDNZ5-gw3883_4.js → chunk-ZGVPDNZ5-BbjZAQf3.js} +1 -1
- package/web-dist/assets/classDiagram-OUVF2IWQ-C8nDRy2s.js +1 -0
- package/web-dist/assets/classDiagram-v2-EOCWNBFH-C8nDRy2s.js +1 -0
- package/web-dist/assets/{cynefin-VYW2F7L2-IYSCSMTe.js → cynefin-VYW2F7L2-BiFACRL6.js} +1 -1
- package/web-dist/assets/{cynefinDiagram-TSTJHNR4-CP8LReQc.js → cynefinDiagram-TSTJHNR4-Ba2A7L8f.js} +1 -1
- package/web-dist/assets/{dagre-VKFMJZFB-C_cDOY4h.js → dagre-VKFMJZFB-B1gwugR0.js} +1 -1
- package/web-dist/assets/{diagram-FQU43EPY-Bdt-bbPx.js → diagram-FQU43EPY-D3yeDptD.js} +1 -1
- package/web-dist/assets/{diagram-G47NLZAW-D4bM_nDs.js → diagram-G47NLZAW-C3ckNGcW.js} +1 -1
- package/web-dist/assets/{diagram-NH7WQ7WH-_TSAwrFN.js → diagram-NH7WQ7WH-Be2tn4YY.js} +1 -1
- package/web-dist/assets/{diagram-OA4YK3LP-DWpUifZA.js → diagram-OA4YK3LP-Dwj1ohx-.js} +1 -1
- package/web-dist/assets/{diagram-WEI45ONY-29lN_-MQ.js → diagram-WEI45ONY-Dt-jAW5B.js} +1 -1
- package/web-dist/assets/{ebnfDiagram-CCIWWBDH-vNac3Nkb.js → ebnfDiagram-CCIWWBDH-Bz3-UuRU.js} +1 -1
- package/web-dist/assets/{erDiagram-Q63AITRT-Q8Lyeen0.js → erDiagram-Q63AITRT-BaCr3-Qz.js} +1 -1
- package/web-dist/assets/eventmodeling-45OFAUF4-CD9TITDK.js +1 -0
- package/web-dist/assets/flowDiagram-23GEKE2U-Womg_Wqj.js +1 -0
- package/web-dist/assets/{ganttDiagram-NO4QXBWP-wqnUf4eS.js → ganttDiagram-NO4QXBWP-BvCR51Ob.js} +1 -1
- package/web-dist/assets/{gitGraph-TEB2WS4Q-Dp2PnWq2.js → gitGraph-TEB2WS4Q-ClGknGDf.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-IHSO6WYX-BxGiqVQZ.js → gitGraphDiagram-IHSO6WYX-D9a31pAE.js} +1 -1
- package/web-dist/assets/{index-DqXGLIwz.js → index-CTcjL-eO.js} +102 -102
- package/web-dist/assets/{info-DKCQHKI2-BhzY4Uni.js → info-DKCQHKI2-BGPJKOjY.js} +1 -1
- package/web-dist/assets/{infoDiagram-FWYZ7A6U-DOAJbOl-.js → infoDiagram-FWYZ7A6U-B9toNDZt.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-FXEZZL3T-mBZHeiuC.js → ishikawaDiagram-FXEZZL3T-COi6cP-a.js} +1 -1
- package/web-dist/assets/{journeyDiagram-5HDEW3XC-BIN13T_S.js → journeyDiagram-5HDEW3XC-jDqNUKQG.js} +1 -1
- package/web-dist/assets/{kanban-definition-HUTT4EX6-BXIeyjSB.js → kanban-definition-HUTT4EX6-CtxeJlFi.js} +1 -1
- package/web-dist/assets/{line-CXrqIQ_6.js → line-uNWy2FRa.js} +1 -1
- package/web-dist/assets/{mermaid-parser.core-B-ewc93S.js → mermaid-parser.core-Cfuj8tio.js} +3 -3
- package/web-dist/assets/{mermaid.core-4Ulv5sd_.js → mermaid.core-BtNCexa9.js} +3 -3
- package/web-dist/assets/{mindmap-definition-LN4V7U3C-CUlmsgpu.js → mindmap-definition-LN4V7U3C-B2u_kZ9E.js} +1 -1
- package/web-dist/assets/{packet-7NZHBO7P-DOU_OPIg.js → packet-7NZHBO7P-DNfwFIg5.js} +1 -1
- package/web-dist/assets/{pegDiagram-2B236MQR-ClVC15zM.js → pegDiagram-2B236MQR-Cm9NTz0P.js} +1 -1
- package/web-dist/assets/{pie-RZYD4A2V-9fj9kCZg.js → pie-RZYD4A2V-CMjAC3_C.js} +1 -1
- package/web-dist/assets/{pieDiagram-ENE6RG2P-BQAuzbqi.js → pieDiagram-ENE6RG2P-DZegJin2.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-ABIIQ3AL-B6v8OzIX.js → quadrantDiagram-ABIIQ3AL-Cr1P0TiT.js} +1 -1
- package/web-dist/assets/{radar-I7S5WNFK-ggR6yaoH.js → radar-I7S5WNFK-D_BiHAza.js} +1 -1
- package/web-dist/assets/{railroad-3IZDKUUU-NRPKG8Tz.js → railroad-3IZDKUUU-Kx4om6Pi.js} +1 -1
- package/web-dist/assets/railroad-abnf-AHOZXSZD-pLt2-q5a.js +1 -0
- package/web-dist/assets/railroad-ebnf-EBAXGLYW-BvNkqSim.js +1 -0
- package/web-dist/assets/railroad-peg-LSFZ7HO6-g9R2pEue.js +1 -0
- package/web-dist/assets/{railroadDiagram-RFXS5EU6-CIJqRzYi.js → railroadDiagram-RFXS5EU6-CGiAkwN0.js} +1 -1
- package/web-dist/assets/{requirementDiagram-TGXJPOKE-7Dvam68t.js → requirementDiagram-TGXJPOKE-Uh5FVpIq.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-HTMAVEWB-BYX8p13G.js → sankeyDiagram-HTMAVEWB-CMBZWUwb.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-DBY2YBRQ-Bmqmc3Hh.js → sequenceDiagram-DBY2YBRQ-CL7uvgun.js} +1 -1
- package/web-dist/assets/{stateDiagram-2N3HPSRC-Cv1jr6R9.js → stateDiagram-2N3HPSRC-CSU2s89c.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-6OUMAXLB-BjWfwAZ4.js +1 -0
- package/web-dist/assets/{swimlanes-5IMT3BWC-BHlN3gYO.js → swimlanes-5IMT3BWC-sfLI2FY3.js} +1 -1
- package/web-dist/assets/swimlanesDiagram-G3AALYLV-B5co78bI.js +8 -0
- package/web-dist/assets/{timeline-definition-FHXFAJF6-DO8eivQs.js → timeline-definition-FHXFAJF6-Dl3Dx33l.js} +1 -1
- package/web-dist/assets/{treeView-QDETBFTQ-DOmZ_jrX.js → treeView-QDETBFTQ-C6i-QhBd.js} +1 -1
- package/web-dist/assets/{treemap-6X3UGDF4-BsObxxTm.js → treemap-6X3UGDF4-kjzleK2t.js} +1 -1
- package/web-dist/assets/{vennDiagram-L72KCM5P-BRy9Xi2q.js → vennDiagram-L72KCM5P-BVYuCdzD.js} +1 -1
- package/web-dist/assets/{wardley-OPB4EBWU-BYP-hY4S.js → wardley-OPB4EBWU-Dd-gYK7z.js} +1 -1
- package/web-dist/assets/{wardleyDiagram-EHGQE667-BQVbSUex.js → wardleyDiagram-EHGQE667-BkLQ_w49.js} +1 -1
- package/web-dist/assets/{xychartDiagram-FW5EYKEG-tK-MC6wE.js → xychartDiagram-FW5EYKEG-Cm4pNjto.js} +1 -1
- package/web-dist/index.html +1 -1
- package/web-dist/assets/architecture-TIHT7OUA-DjmwW7vl.js +0 -1
- package/web-dist/assets/channel-2QEC6BP8.js +0 -1
- package/web-dist/assets/classDiagram-OUVF2IWQ-BZmKD91m.js +0 -1
- package/web-dist/assets/classDiagram-v2-EOCWNBFH-BZmKD91m.js +0 -1
- package/web-dist/assets/eventmodeling-45OFAUF4-DOaq-8am.js +0 -1
- package/web-dist/assets/flowDiagram-23GEKE2U-DIB-knUj.js +0 -1
- package/web-dist/assets/railroad-abnf-AHOZXSZD-icGR3Mej.js +0 -1
- package/web-dist/assets/railroad-ebnf-EBAXGLYW-7uKDbF2e.js +0 -1
- package/web-dist/assets/railroad-peg-LSFZ7HO6-CJwY09fs.js +0 -1
- package/web-dist/assets/stateDiagram-v2-6OUMAXLB-CWOLQn_o.js +0 -1
- package/web-dist/assets/swimlanesDiagram-G3AALYLV-cd1Z89Mn.js +0 -8
package/dist/dev-child.js
CHANGED
|
@@ -16141,6 +16141,39 @@ function resolveProjectIcon(id, detect, options = {}) {
|
|
|
16141
16141
|
}, home);
|
|
16142
16142
|
return found;
|
|
16143
16143
|
}
|
|
16144
|
+
function renameProject(id, update, home = homedir4()) {
|
|
16145
|
+
const registry = readRegistry(home);
|
|
16146
|
+
const entry = registry.projects.find((p) => p.id === id);
|
|
16147
|
+
if (!entry) return void 0;
|
|
16148
|
+
if (update.slug !== void 0) {
|
|
16149
|
+
const slug = slugifyProject(update.slug);
|
|
16150
|
+
if (RESERVED.has(slug)) throw new Error(`"${slug}" is reserved by Frizz itself`);
|
|
16151
|
+
if (registry.projects.some((p) => p.id !== id && p.slug === slug)) {
|
|
16152
|
+
throw new Error(`another project already uses "${slug}"`);
|
|
16153
|
+
}
|
|
16154
|
+
entry.slug = slug;
|
|
16155
|
+
}
|
|
16156
|
+
if (update.name === null) delete entry.name;
|
|
16157
|
+
else if (update.name !== void 0) entry.name = update.name;
|
|
16158
|
+
if (update.archived !== void 0) entry.archived = update.archived;
|
|
16159
|
+
writeRegistry(registry, home);
|
|
16160
|
+
return entry;
|
|
16161
|
+
}
|
|
16162
|
+
function moveProjectDirectory(id, newBasename, home = homedir4()) {
|
|
16163
|
+
const entry = findById(id, home);
|
|
16164
|
+
if (!entry) throw new Error("No such project.");
|
|
16165
|
+
const name = newBasename.trim();
|
|
16166
|
+
if (!name || name === "." || name === ".." || /[\\/\0]/u.test(name)) {
|
|
16167
|
+
throw new Error("A folder name cannot contain a slash.");
|
|
16168
|
+
}
|
|
16169
|
+
if (!existsSync3(entry.path)) throw new Error(`The folder is missing: ${entry.path}`);
|
|
16170
|
+
const target = join5(dirname4(entry.path), name);
|
|
16171
|
+
if (target === entry.path) return entry;
|
|
16172
|
+
if (existsSync3(target)) throw new Error(`Something already exists at ${target}`);
|
|
16173
|
+
renameSync3(entry.path, target);
|
|
16174
|
+
const moved = registerProject({ dir: target, id }, home);
|
|
16175
|
+
return moved.entry ?? entry;
|
|
16176
|
+
}
|
|
16144
16177
|
function forgetProject(id, home = homedir4()) {
|
|
16145
16178
|
const registry = readRegistry(home);
|
|
16146
16179
|
const before = registry.projects.length;
|
|
@@ -31789,6 +31822,7 @@ var init_codex_execution_health = __esm({
|
|
|
31789
31822
|
|
|
31790
31823
|
// packages/server/src/backend/codex-app-server.ts
|
|
31791
31824
|
import { createHash as createHash10, randomUUID as randomUUID11 } from "node:crypto";
|
|
31825
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
31792
31826
|
import { StringDecoder as StringDecoder3 } from "node:string_decoder";
|
|
31793
31827
|
function selectCodexHostKind(flagValue, platform3, hasSpawn) {
|
|
31794
31828
|
if (hasSpawn) return "direct";
|
|
@@ -32453,11 +32487,11 @@ var init_codex_app_server = __esm({
|
|
|
32453
32487
|
init_logging();
|
|
32454
32488
|
CODEX_APP_SERVER_PROVIDER = "codex-app-server";
|
|
32455
32489
|
CODEX_NATIVE_LISTEN_FLAG = "FRIZZ_CODEX_NATIVE_LISTEN";
|
|
32456
|
-
CODEX_APP_SERVER_SUPPORTED_VERSION = "0.155.
|
|
32490
|
+
CODEX_APP_SERVER_SUPPORTED_VERSION = "0.155.1";
|
|
32457
32491
|
CODEX_APP_SERVER_PROTOCOL_REVISION = Object.freeze({
|
|
32458
32492
|
packageVersion: CODEX_APP_SERVER_SUPPORTED_VERSION,
|
|
32459
|
-
sourceTag: "rust-v0.155.
|
|
32460
|
-
sourceCommit: "
|
|
32493
|
+
sourceTag: "rust-v0.155.1",
|
|
32494
|
+
sourceCommit: "be2951ea34f0d295ed0becf97079f92fa5f6950e"
|
|
32461
32495
|
});
|
|
32462
32496
|
PROTOCOL_FINGERPRINT = [
|
|
32463
32497
|
CODEX_APP_SERVER_PROTOCOL_REVISION.sourceTag,
|
|
@@ -33161,11 +33195,13 @@ var init_codex_app_server = __esm({
|
|
|
33161
33195
|
}
|
|
33162
33196
|
if (binding.state === "active" && binding.connection_epoch === this.connectionEpoch) return bindingFromRow(binding);
|
|
33163
33197
|
if (binding.ephemeral === 1) throw new Error("disposable Codex app-server session is detached");
|
|
33198
|
+
const cwdOverride = this.resumeCwdOverride(binding);
|
|
33164
33199
|
const rawResponse = await connection.request("thread/resume", {
|
|
33165
33200
|
threadId: binding.codex_thread_id,
|
|
33166
33201
|
excludeTurns: true,
|
|
33167
33202
|
approvalsReviewer: "user",
|
|
33168
33203
|
...this.resumeSandboxOverride(binding),
|
|
33204
|
+
...cwdOverride,
|
|
33169
33205
|
// A resume by an app-server that ALREADY holds this thread keeps the MCP child it started
|
|
33170
33206
|
// with, so this changes nothing there. It matters on a resume by a FRESH app-server — the
|
|
33171
33207
|
// one after a daemon death or a frizz restart — which is exactly when the thread would
|
|
@@ -33177,6 +33213,7 @@ var init_codex_app_server = __esm({
|
|
|
33177
33213
|
throw new Error("Codex app-server resumed a different or disposable thread");
|
|
33178
33214
|
}
|
|
33179
33215
|
this.updateResumedBinding(binding, response.thread.sessionId, effectiveResumeSandbox(rawResponse));
|
|
33216
|
+
this.recordResumedCwd(binding, cwdOverride);
|
|
33180
33217
|
return bindingFromRow(this.bindingForScope(threadSlug, sessionId));
|
|
33181
33218
|
} finally {
|
|
33182
33219
|
releaseOperation();
|
|
@@ -33991,14 +34028,26 @@ var init_codex_app_server = __esm({
|
|
|
33991
34028
|
continue;
|
|
33992
34029
|
}
|
|
33993
34030
|
try {
|
|
34031
|
+
const cwdOverride = this.resumeCwdOverride(row);
|
|
33994
34032
|
const rawResponse = await connection.request("thread/resume", {
|
|
33995
34033
|
threadId: row.codex_thread_id,
|
|
33996
34034
|
excludeTurns: true,
|
|
33997
34035
|
approvalsReviewer: "user",
|
|
33998
|
-
...this.resumeSandboxOverride(row)
|
|
34036
|
+
...this.resumeSandboxOverride(row),
|
|
34037
|
+
...cwdOverride,
|
|
34038
|
+
// The per-thread frizz MCP mount, exactly as resumeOwnedSession sends it. THIS is the resume a
|
|
34039
|
+
// Frizz restart issues for every thread that was mid-turn when the app-server died, and it
|
|
34040
|
+
// was the one resume that did not carry it (2026-09-18, hypergres/this-is-a-fresh-project-i:
|
|
34041
|
+
// the 0.13.9 restart replaced the daemon, this path resumed the thread with no mount, and the
|
|
34042
|
+
// worker's next registry probe listed no `mcp__frizz__*` at all — "The restart removed
|
|
34043
|
+
// Frizz's question-registration tool"). The argv mount is not a fallback here: a thread
|
|
34044
|
+
// resumed onto a FRESH app-server gets its MCP children from this call, so without the
|
|
34045
|
+
// override it keeps neither its identity nor, in practice, the tools.
|
|
34046
|
+
...this.threadConfig(row.thread_slug)
|
|
33999
34047
|
});
|
|
34000
34048
|
const response = ThreadResponse.parse(rawResponse);
|
|
34001
34049
|
if (response.thread.id !== row.codex_thread_id || response.thread.ephemeral) throw new Error("resume ownership mismatch");
|
|
34050
|
+
this.recordResumedCwd(row, cwdOverride);
|
|
34002
34051
|
const interruptedTurn = row.current_turn_id;
|
|
34003
34052
|
if (interruptedTurn && row.capability_revision === this.capabilityRevision && resumedThreadHasLiveTurn(rawResponse)) {
|
|
34004
34053
|
this.scope.prepare(`
|
|
@@ -34164,6 +34213,29 @@ var init_codex_app_server = __esm({
|
|
|
34164
34213
|
const intent = (isCodexSandboxMode(row.intended_sandbox) ? row.intended_sandbox : void 0) ?? this.options.sandboxFor?.(row.thread_slug, row.frizz_session_id) ?? CODEX_DEFAULT_SANDBOX;
|
|
34165
34214
|
return { sandbox: intent, approvalPolicy: CODEX_APPROVAL_POLICY };
|
|
34166
34215
|
}
|
|
34216
|
+
/**
|
|
34217
|
+
* The `cwd` to attach to a `thread/resume` — and only when the recorded one is GONE.
|
|
34218
|
+
*
|
|
34219
|
+
* A thread's cwd is fixed at thread/start and every resume reads it back from the rollout. A project
|
|
34220
|
+
* directory rename (3baa6371 reopens the project at its new path) leaves every existing codex thread
|
|
34221
|
+
* recorded at a path that no longer exists, and codex does not merely fail the thread's next command:
|
|
34222
|
+
* it spawns NO stdio MCP child for the thread at all, so the worker's registry lists no
|
|
34223
|
+
* `mcp__frizz__*` and it cannot ask, sign off or name itself. Measured 2026-09-18 with
|
|
34224
|
+
* `_live_codex_resume_mcp.mts` (`STALE_CWD=1`: no child spawned, the model answers NOTOOL) after
|
|
34225
|
+
* hypergres → porg took `this-is-a-fresh-project-i` down exactly that way. `thread/resume` takes a
|
|
34226
|
+
* `cwd` override, so a resume whose recorded cwd is missing retargets the thread at the project's
|
|
34227
|
+
* CURRENT directory — the only path a frizz worker was ever dispatched into — and the binding is
|
|
34228
|
+
* re-recorded on success (recordResumedCwd). A cwd that still exists is left alone: an adopted
|
|
34229
|
+
* external rollout may legitimately live somewhere else.
|
|
34230
|
+
*/
|
|
34231
|
+
resumeCwdOverride(row) {
|
|
34232
|
+
if (existsSync8(row.cwd)) return {};
|
|
34233
|
+
return { cwd: this.options.projectDir };
|
|
34234
|
+
}
|
|
34235
|
+
recordResumedCwd(row, override) {
|
|
34236
|
+
if (!override.cwd) return;
|
|
34237
|
+
this.scope.prepare("UPDATE codex_app_server_session SET cwd = ?, updated_at = ? WHERE project_id = @project_id AND frizz_session_id = ?").run(override.cwd, this.now().toISOString(), row.frizz_session_id);
|
|
34238
|
+
}
|
|
34167
34239
|
/**
|
|
34168
34240
|
* Change a LIVE thread's sandbox, eagerly, without waiting for a resume.
|
|
34169
34241
|
*
|
|
@@ -35218,7 +35290,7 @@ var init_local_path = __esm({
|
|
|
35218
35290
|
|
|
35219
35291
|
// packages/server/src/local-file.ts
|
|
35220
35292
|
import { spawn as spawn5 } from "node:child_process";
|
|
35221
|
-
import { existsSync as
|
|
35293
|
+
import { existsSync as existsSync9, readFileSync as readFileSync18, realpathSync as realpathSync6, statSync as statSync13 } from "node:fs";
|
|
35222
35294
|
import { homedir as homedir11 } from "node:os";
|
|
35223
35295
|
import { dirname as dirname10, isAbsolute as isAbsolute4, join as join26, resolve as resolve5, sep as sep2 } from "node:path";
|
|
35224
35296
|
function isUnder(real, root) {
|
|
@@ -35321,7 +35393,7 @@ function localFileOpenCommand(path3, selected, options = {}) {
|
|
|
35321
35393
|
if (selected === "finder") return { command: "explorer.exe", args: [`/select,${path3}`] };
|
|
35322
35394
|
const editor = WINDOWS_EDITOR_EXE[selected];
|
|
35323
35395
|
const env = options.env ?? process.env;
|
|
35324
|
-
const exists = options.exists ??
|
|
35396
|
+
const exists = options.exists ?? existsSync9;
|
|
35325
35397
|
const localAppData = env.LOCALAPPDATA;
|
|
35326
35398
|
if (localAppData) {
|
|
35327
35399
|
const exe = join26(localAppData, ...editor.exe);
|
|
@@ -35683,17 +35755,17 @@ var init_project_mcp_servers = __esm({
|
|
|
35683
35755
|
});
|
|
35684
35756
|
|
|
35685
35757
|
// packages/server/src/worker-plugin-dir.ts
|
|
35686
|
-
import { existsSync as
|
|
35758
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
35687
35759
|
import { dirname as dirname12, join as join29 } from "node:path";
|
|
35688
35760
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
35689
35761
|
function resolveWorkerPluginDir(moduleUrl = import.meta.url, env = process.env) {
|
|
35690
35762
|
const override = env.FRIZZ_WORKER_PLUGIN_DIR;
|
|
35691
|
-
if (override &&
|
|
35763
|
+
if (override && existsSync10(join29(override, ".claude-plugin", "plugin.json")))
|
|
35692
35764
|
return override;
|
|
35693
35765
|
let current = dirname12(fileURLToPath3(moduleUrl));
|
|
35694
35766
|
for (; ; ) {
|
|
35695
35767
|
const candidate = join29(current, "cc-worker");
|
|
35696
|
-
if (
|
|
35768
|
+
if (existsSync10(join29(candidate, ".claude-plugin", "plugin.json"))) return candidate;
|
|
35697
35769
|
const parent = dirname12(current);
|
|
35698
35770
|
if (parent === current) return void 0;
|
|
35699
35771
|
current = parent;
|
|
@@ -37666,7 +37738,7 @@ var init_claude_agent_broker_bridge = __esm({
|
|
|
37666
37738
|
});
|
|
37667
37739
|
|
|
37668
37740
|
// packages/server/src/dispatch.ts
|
|
37669
|
-
import { closeSync as closeSync12, constants as constants2, existsSync as
|
|
37741
|
+
import { closeSync as closeSync12, constants as constants2, existsSync as existsSync11, fstatSync as fstatSync2, lstatSync as lstatSync3, openSync as openSync13, readFileSync as readFileSync20, realpathSync as realpathSync8, statSync as statSync15, writeFileSync as writeFileSync10, mkdirSync as mkdirSync13, rmSync as rmSync9 } from "node:fs";
|
|
37670
37742
|
import { basename as basename6, join as join31, dirname as dirname13 } from "node:path";
|
|
37671
37743
|
import { createHash as createHash11, randomUUID as randomUUID13 } from "node:crypto";
|
|
37672
37744
|
function fallbackTitle(prompt) {
|
|
@@ -37686,7 +37758,7 @@ function fallbackTitle(prompt) {
|
|
|
37686
37758
|
}
|
|
37687
37759
|
function resolveSlug(frizzDir, base, taken) {
|
|
37688
37760
|
base = ThreadSlug.parse(base);
|
|
37689
|
-
const isTaken = (slug) =>
|
|
37761
|
+
const isTaken = (slug) => existsSync11(join31(frizzDir, `${slug}.md`)) || (taken?.(slug) ?? false);
|
|
37690
37762
|
if (!isTaken(base)) return base;
|
|
37691
37763
|
for (let n = 2; ; n++) {
|
|
37692
37764
|
const suffix = `-${n}`;
|
|
@@ -37783,7 +37855,7 @@ function monitorScriptsDir() {
|
|
|
37783
37855
|
const plugin = workerPluginDir();
|
|
37784
37856
|
if (!plugin) return void 0;
|
|
37785
37857
|
const dir = join31(plugin, "skills", "gh", "scripts");
|
|
37786
|
-
return
|
|
37858
|
+
return existsSync11(join31(dir, "ci-watch.mjs")) ? dir : void 0;
|
|
37787
37859
|
}
|
|
37788
37860
|
function codexScratchpadHookConfig(hookScript, sessionId) {
|
|
37789
37861
|
if (!hookScript || !sessionId) return {};
|
|
@@ -37882,7 +37954,7 @@ function resolveFrizzMcp(target, moduleUrl = import.meta.url, env = process.env,
|
|
|
37882
37954
|
const pluginDir = resolveWorkerPluginDir(moduleUrl, env);
|
|
37883
37955
|
if (!pluginDir) return void 0;
|
|
37884
37956
|
const scriptPath = join31(pluginDir, "bin", FRIZZ_MCP.script);
|
|
37885
|
-
if (!
|
|
37957
|
+
if (!existsSync11(scriptPath)) return void 0;
|
|
37886
37958
|
return {
|
|
37887
37959
|
scriptPath,
|
|
37888
37960
|
stateDir,
|
|
@@ -42335,7 +42407,7 @@ var init_claude = __esm({
|
|
|
42335
42407
|
});
|
|
42336
42408
|
|
|
42337
42409
|
// packages/server/src/backend/acp-transcript.ts
|
|
42338
|
-
import { appendFileSync as appendFileSync3, existsSync as
|
|
42410
|
+
import { appendFileSync as appendFileSync3, existsSync as existsSync13, mkdirSync as mkdirSync14, readFileSync as readFileSync21 } from "node:fs";
|
|
42339
42411
|
import { dirname as dirname15, join as join34 } from "node:path";
|
|
42340
42412
|
function acpTranscriptPath(stateDir, sessionId) {
|
|
42341
42413
|
return join34(stateDir, ACP_TRANSCRIPT_DIR, `${sessionId}.jsonl`);
|
|
@@ -42540,7 +42612,7 @@ var init_acp_transcript = __esm({
|
|
|
42540
42612
|
constructor(path3) {
|
|
42541
42613
|
this.path = path3;
|
|
42542
42614
|
mkdirSync14(dirname15(path3), { recursive: true });
|
|
42543
|
-
if (!
|
|
42615
|
+
if (!existsSync13(path3)) appendFileSync3(path3, "");
|
|
42544
42616
|
}
|
|
42545
42617
|
append(record) {
|
|
42546
42618
|
appendFileSync3(this.path, JSON.stringify(record) + "\n");
|
|
@@ -47467,7 +47539,7 @@ var init_server = __esm({
|
|
|
47467
47539
|
});
|
|
47468
47540
|
|
|
47469
47541
|
// packages/server/src/repair.ts
|
|
47470
|
-
import { existsSync as
|
|
47542
|
+
import { existsSync as existsSync14, readFileSync as readFileSync23, writeFileSync as writeFileSync11 } from "node:fs";
|
|
47471
47543
|
import { basename as basename7, dirname as dirname17, resolve as resolve8 } from "node:path";
|
|
47472
47544
|
function quoteValue(v) {
|
|
47473
47545
|
if (/^[\w./#:+-]+$/.test(v)) return v;
|
|
@@ -47482,7 +47554,7 @@ function repairThreadFile(frizzDir, file) {
|
|
|
47482
47554
|
const abs = resolve8(root, file);
|
|
47483
47555
|
if (dirname17(abs) !== root) throw new RepairError(`refusing to repair "${file}": not directly under .frizz/`);
|
|
47484
47556
|
if (!abs.endsWith(".md")) throw new RepairError(`refusing to repair "${file}": not a .md thread file`);
|
|
47485
|
-
if (!
|
|
47557
|
+
if (!existsSync14(abs)) throw new RepairError(`no thread file to repair: ${basename7(abs)}`);
|
|
47486
47558
|
const content = readFileSync23(abs, "utf8");
|
|
47487
47559
|
const firstLine2 = content.replace(/^/, "").split(/\r?\n/).find((l) => l.trim() !== "");
|
|
47488
47560
|
if (firstLine2?.trim() === "---") {
|
|
@@ -47840,7 +47912,7 @@ var init_bash_background = __esm({
|
|
|
47840
47912
|
});
|
|
47841
47913
|
|
|
47842
47914
|
// packages/server/src/transcript.ts
|
|
47843
|
-
import { closeSync as closeSync13, existsSync as
|
|
47915
|
+
import { closeSync as closeSync13, existsSync as existsSync15, fstatSync as fstatSync3, mkdirSync as mkdirSync16, openSync as openSync14, readdirSync as readdirSync9, readFileSync as readFileSync25, readSync as readSync7, renameSync as renameSync9, statSync as statSync17, unlinkSync as unlinkSync5, writeFileSync as writeFileSync12 } from "node:fs";
|
|
47844
47916
|
import { createHash as createHash13 } from "node:crypto";
|
|
47845
47917
|
import { StringDecoder as StringDecoder5 } from "node:string_decoder";
|
|
47846
47918
|
import { join as join38 } from "node:path";
|
|
@@ -48462,7 +48534,7 @@ function persistBase64Image(mediaType, data, idKey) {
|
|
|
48462
48534
|
const name = createHash13("sha256").update(idKey).digest("hex").slice(0, 32);
|
|
48463
48535
|
const path3 = join38(SCREENSHOT_CACHE_DIR, `${name}.${ext}`);
|
|
48464
48536
|
try {
|
|
48465
|
-
if (
|
|
48537
|
+
if (existsSync15(path3)) return path3;
|
|
48466
48538
|
if (data.length > SCREENSHOT_MAX_BASE64) return void 0;
|
|
48467
48539
|
const buf = Buffer.from(data, "base64");
|
|
48468
48540
|
if (buf.length === 0 || !looksLikeImage(buf, ext)) return void 0;
|
|
@@ -48483,7 +48555,7 @@ function persistSentFile(srcPath, idKey) {
|
|
|
48483
48555
|
try {
|
|
48484
48556
|
const name = createHash13("sha256").update(idKey).digest("hex").slice(0, 32);
|
|
48485
48557
|
const dest = join38(SCREENSHOT_CACHE_DIR, `${name}.${outExt}`);
|
|
48486
|
-
if (
|
|
48558
|
+
if (existsSync15(dest)) return dest;
|
|
48487
48559
|
const size = statSync17(srcPath).size;
|
|
48488
48560
|
if (size === 0 || size > SENT_IMAGE_MAX_BYTES) return void 0;
|
|
48489
48561
|
const buf = readFileSync25(srcPath);
|
|
@@ -50024,7 +50096,7 @@ function sourceForThread(project, storage, slug, backendFor) {
|
|
|
50024
50096
|
}
|
|
50025
50097
|
if (!FOREIGN_SESSION_ID_RE.test(slug)) return void 0;
|
|
50026
50098
|
const claudePath = resolveTranscriptPath(project, slug);
|
|
50027
|
-
if (
|
|
50099
|
+
if (existsSync15(claudePath)) {
|
|
50028
50100
|
return { slug, sessionId: slug, nativeId: slug, backend: "claude", runtimeGeneration: 0, path: claudePath };
|
|
50029
50101
|
}
|
|
50030
50102
|
const rollout = (backendFor?.("codex") ?? defaultCodexBackend()).transcriptPath(slug);
|
|
@@ -51162,7 +51234,7 @@ import { readFileSync as readFileSync26, statSync as statSync19 } from "node:fs"
|
|
|
51162
51234
|
import { join as join39, resolve as resolve9 } from "node:path";
|
|
51163
51235
|
import { randomUUID as randomUUID16 } from "node:crypto";
|
|
51164
51236
|
import { basename as basename9, dirname as dirname18 } from "node:path";
|
|
51165
|
-
import { existsSync as
|
|
51237
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync17, rmSync as rmSync10, writeFileSync as writeFileSync13 } from "node:fs";
|
|
51166
51238
|
import { homedir as homedir17 } from "node:os";
|
|
51167
51239
|
function validateGithubDispatchProfile(input) {
|
|
51168
51240
|
if (input.backend === "acp") return;
|
|
@@ -53464,7 +53536,48 @@ Say which way you went and why in your write-up, so the human can course-correct
|
|
|
53464
53536
|
}
|
|
53465
53537
|
const updated = clearProjectIcon(input.id);
|
|
53466
53538
|
if (!updated) throw new Error("No such project.");
|
|
53467
|
-
return projectCard(updated, !
|
|
53539
|
+
return projectCard(updated, !existsSync16(updated.path));
|
|
53540
|
+
}
|
|
53541
|
+
}),
|
|
53542
|
+
/**
|
|
53543
|
+
* Rename a project — the name Frizz shows and the URL it answers on, and, only when asked, the
|
|
53544
|
+
* folder itself.
|
|
53545
|
+
*
|
|
53546
|
+
* The name is the registry's display override, cleared again when it matches the folder so the
|
|
53547
|
+
* card keeps following a later `mv`. The slug follows the name on purpose: a rename is the one
|
|
53548
|
+
* time an operator has said what this project is called, and `deriveSlug`'s never-re-derive rule
|
|
53549
|
+
* exists to protect bookmarks from SILENT changes, not from this one. A taken or reserved slug is
|
|
53550
|
+
* refused with the registry's own message, and nothing is written.
|
|
53551
|
+
*
|
|
53552
|
+
* `renameDirectory` is opt-in and the dialog only offers it when the folder is already named after
|
|
53553
|
+
* the project (maintainer 2026-09-18: "without actually changing the directory name by default").
|
|
53554
|
+
* It moves the folder to a sibling of the same name and re-registers the id there, then closes
|
|
53555
|
+
* the tenant so the next request reopens it at the new path — a context built on the old one
|
|
53556
|
+
* would spawn every worker into a directory that no longer exists. The launching project is
|
|
53557
|
+
* refused for the same reason `projectRemove` refuses it: this process is standing in it.
|
|
53558
|
+
*/
|
|
53559
|
+
projectRename: mutation({
|
|
53560
|
+
input: external_exports.object({
|
|
53561
|
+
id: external_exports.string().min(1),
|
|
53562
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
53563
|
+
renameDirectory: external_exports.boolean().optional()
|
|
53564
|
+
}).strict(),
|
|
53565
|
+
output: ProjectCard,
|
|
53566
|
+
handler: async ({ input }) => {
|
|
53567
|
+
const entry = findById(input.id);
|
|
53568
|
+
if (!entry) throw new Error("No such project.");
|
|
53569
|
+
const name = input.name.trim();
|
|
53570
|
+
let path3 = entry.path;
|
|
53571
|
+
if (input.renameDirectory && name !== basename9(entry.path)) {
|
|
53572
|
+
if (ctx.launchProjectId === entry.id) {
|
|
53573
|
+
throw new Error("Frizz is serving from this project, so its folder cannot be renamed. Restart Frizz from another folder first.");
|
|
53574
|
+
}
|
|
53575
|
+
path3 = moveProjectDirectory(entry.id, name).path;
|
|
53576
|
+
await ctx.teardownProject?.(entry.id, {});
|
|
53577
|
+
}
|
|
53578
|
+
const updated = renameProject(entry.id, { name: name === basename9(path3) ? null : name, slug: name });
|
|
53579
|
+
if (!updated) throw new Error("No such project.");
|
|
53580
|
+
return projectCard(updated, !existsSync16(updated.path));
|
|
53468
53581
|
}
|
|
53469
53582
|
}),
|
|
53470
53583
|
/**
|
|
@@ -55888,12 +56001,12 @@ var init_boot_progress = __esm({
|
|
|
55888
56001
|
});
|
|
55889
56002
|
|
|
55890
56003
|
// packages/server/src/runtime-lease.ts
|
|
55891
|
-
import { existsSync as
|
|
56004
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync20, readdirSync as readdirSync12, readFileSync as readFileSync31, unlinkSync as unlinkSync6, writeFileSync as writeFileSync16 } from "node:fs";
|
|
55892
56005
|
import { dirname as dirname22, join as join44 } from "node:path";
|
|
55893
56006
|
function runtimeVersionDir(bin) {
|
|
55894
56007
|
let dir = dirname22(bin);
|
|
55895
56008
|
for (let step = 0; step < MAX_ASCENT; step++) {
|
|
55896
|
-
if (
|
|
56009
|
+
if (existsSync17(join44(dir, PROVISIONED_MARKER))) return dir;
|
|
55897
56010
|
const parent = dirname22(dir);
|
|
55898
56011
|
if (parent === dir) return void 0;
|
|
55899
56012
|
dir = parent;
|
|
@@ -55973,7 +56086,7 @@ import { createHash as createHash15 } from "node:crypto";
|
|
|
55973
56086
|
import {
|
|
55974
56087
|
chmodSync as chmodSync2,
|
|
55975
56088
|
closeSync as closeSync16,
|
|
55976
|
-
existsSync as
|
|
56089
|
+
existsSync as existsSync18,
|
|
55977
56090
|
mkdirSync as mkdirSync21,
|
|
55978
56091
|
openSync as openSync17,
|
|
55979
56092
|
readFileSync as readFileSync32,
|
|
@@ -56017,7 +56130,7 @@ function provisionedBinary(backend, root, label) {
|
|
|
56017
56130
|
}
|
|
56018
56131
|
if (typeof marker.binary !== "string" || marker.label !== label) return void 0;
|
|
56019
56132
|
const bin = join45(dir, marker.binary);
|
|
56020
|
-
return
|
|
56133
|
+
return existsSync18(bin) ? bin : void 0;
|
|
56021
56134
|
}
|
|
56022
56135
|
function octal(buffer, offset, length) {
|
|
56023
56136
|
const text2 = buffer.toString("latin1", offset, offset + length).replace(/\0.*$/su, "").trim();
|
|
@@ -56039,7 +56152,7 @@ function safeEntryPath(dest, name) {
|
|
|
56039
56152
|
function locateBinary(dir, backend, binary) {
|
|
56040
56153
|
if (backend === "claude") {
|
|
56041
56154
|
const direct = join45(dir, binary);
|
|
56042
|
-
return
|
|
56155
|
+
return existsSync18(direct) ? direct : void 0;
|
|
56043
56156
|
}
|
|
56044
56157
|
const vendor = join45(dir, "vendor");
|
|
56045
56158
|
let triples;
|
|
@@ -56050,7 +56163,7 @@ function locateBinary(dir, backend, binary) {
|
|
|
56050
56163
|
}
|
|
56051
56164
|
for (const triple of triples) {
|
|
56052
56165
|
const candidate = join45(vendor, triple, "bin", binary);
|
|
56053
|
-
if (
|
|
56166
|
+
if (existsSync18(candidate)) return candidate;
|
|
56054
56167
|
}
|
|
56055
56168
|
return void 0;
|
|
56056
56169
|
}
|
|
@@ -56123,7 +56236,7 @@ async function provisionRuntime(backend, options) {
|
|
|
56123
56236
|
rename2(partial, finalDir);
|
|
56124
56237
|
break;
|
|
56125
56238
|
} catch (err) {
|
|
56126
|
-
if (attempt >= RENAME_ATTEMPTS || !TRANSIENT_HANDLE_CODES.has(errorCode4(err) ?? "") ||
|
|
56239
|
+
if (attempt >= RENAME_ATTEMPTS || !TRANSIENT_HANDLE_CODES.has(errorCode4(err) ?? "") || existsSync18(finalDir)) throw err;
|
|
56127
56240
|
await new Promise((resolve12) => setTimeout(resolve12, options.retryDelayMs ?? RENAME_RETRY_DELAY_MS));
|
|
56128
56241
|
}
|
|
56129
56242
|
}
|
|
@@ -56245,8 +56358,8 @@ var init_runtimes = __esm({
|
|
|
56245
56358
|
init_codex_app_server();
|
|
56246
56359
|
init_frizz_paths();
|
|
56247
56360
|
init_runtime_lease();
|
|
56248
|
-
CLAUDE_AGENT_SDK_VERSION = "0.3.
|
|
56249
|
-
CLAUDE_CODE_VERSION = "2.1.
|
|
56361
|
+
CLAUDE_AGENT_SDK_VERSION = "0.3.277";
|
|
56362
|
+
CLAUDE_CODE_VERSION = "2.1.277";
|
|
56250
56363
|
CODEX_VERSION = CODEX_APP_SERVER_SUPPORTED_VERSION;
|
|
56251
56364
|
RUNTIMES_MODE_ENV = "FRIZZ_RUNTIMES";
|
|
56252
56365
|
RUNTIMES_DIR_ENV = "FRIZZ_RUNTIMES_DIR";
|
|
@@ -56402,11 +56515,15 @@ function createTenantMap(options) {
|
|
|
56402
56515
|
};
|
|
56403
56516
|
async function activate(project) {
|
|
56404
56517
|
const already = open.get(project.id);
|
|
56405
|
-
if (already) return already.ctx;
|
|
56518
|
+
if (already && already.project.dir === project.dir) return already.ctx;
|
|
56406
56519
|
const inFlight = opening.get(project.id);
|
|
56407
56520
|
if (inFlight) return inFlight;
|
|
56408
56521
|
const attempt = (async () => {
|
|
56409
56522
|
try {
|
|
56523
|
+
if (already) {
|
|
56524
|
+
log.info("tenants", `project ${project.name} (${project.id}) moved from ${already.project.dir} to ${project.dir}; reopening it there`);
|
|
56525
|
+
await deactivate(project.id);
|
|
56526
|
+
}
|
|
56410
56527
|
const ctx = await options.createContext({ ...options.contextOptions, project });
|
|
56411
56528
|
open.set(project.id, { project, ctx, app: options.createApp?.(ctx) });
|
|
56412
56529
|
await options.startProducers?.(ctx);
|
|
@@ -56920,7 +57037,7 @@ var init_legacy_project_db = __esm({
|
|
|
56920
57037
|
});
|
|
56921
57038
|
|
|
56922
57039
|
// packages/server/src/frizz-db.ts
|
|
56923
|
-
import { existsSync as
|
|
57040
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync22, readdirSync as readdirSync14, renameSync as renameSync12, statSync as statSync25 } from "node:fs";
|
|
56924
57041
|
import { basename as basename13, dirname as dirname24, join as join46 } from "node:path";
|
|
56925
57042
|
function frizzDatabaseLocation(options) {
|
|
56926
57043
|
if (options.stateDir !== void 0) {
|
|
@@ -57005,7 +57122,7 @@ function openFrizzDatabase(options = {}) {
|
|
|
57005
57122
|
};
|
|
57006
57123
|
}
|
|
57007
57124
|
function projectIdsWithFile(projectsDir, file) {
|
|
57008
|
-
if (!
|
|
57125
|
+
if (!existsSync19(projectsDir)) return [];
|
|
57009
57126
|
return readdirSync14(projectsDir).filter((name) => {
|
|
57010
57127
|
try {
|
|
57011
57128
|
return statSync25(join46(projectsDir, name, file)).isFile();
|
|
@@ -57018,7 +57135,7 @@ function legacyProjectIds(projectsDir) {
|
|
|
57018
57135
|
return projectIdsWithFile(projectsDir, "ui.db");
|
|
57019
57136
|
}
|
|
57020
57137
|
function retiredLegacyProjectIds(projectsDir) {
|
|
57021
|
-
return projectIdsWithFile(projectsDir, "ui.db.imported").filter((id) => !
|
|
57138
|
+
return projectIdsWithFile(projectsDir, "ui.db.imported").filter((id) => !existsSync19(join46(projectsDir, id, "ui.db")));
|
|
57022
57139
|
}
|
|
57023
57140
|
function tableColumns(db, schema, table) {
|
|
57024
57141
|
return db.prepare(`PRAGMA ${schema}.table_info(${table})`).all().map((c) => c.name);
|
|
@@ -57223,7 +57340,7 @@ __export(index_exports, {
|
|
|
57223
57340
|
unknownProjectPage: () => unknownProjectPage
|
|
57224
57341
|
});
|
|
57225
57342
|
import { createServer } from "node:http";
|
|
57226
|
-
import { readFileSync as readFileSync33, existsSync as
|
|
57343
|
+
import { readFileSync as readFileSync33, existsSync as existsSync20, statSync as statSync26 } from "node:fs";
|
|
57227
57344
|
import { dirname as dirname26, join as join47, resolve as resolve11, extname as extname4, posix as posix2, sep as sep6 } from "node:path";
|
|
57228
57345
|
function readServerAddressHolder(path3) {
|
|
57229
57346
|
try {
|
|
@@ -57354,7 +57471,7 @@ function serveStatic(distDir, req, res) {
|
|
|
57354
57471
|
const rel = posix2.normalize((req.url ?? "/").split("?")[0].replace(/\\/g, "/")).replace(/^(\.\.[/\\])+/, "");
|
|
57355
57472
|
let file = join47(distDir, rel === "/" ? "index.html" : rel);
|
|
57356
57473
|
if (!file.startsWith(distDir + sep6)) file = join47(distDir, "index.html");
|
|
57357
|
-
if (!
|
|
57474
|
+
if (!existsSync20(file)) file = join47(distDir, "index.html");
|
|
57358
57475
|
try {
|
|
57359
57476
|
const stats = statSync26(file);
|
|
57360
57477
|
const cacheControl = file.startsWith(join47(distDir, "assets") + sep6) ? STATIC_CACHE_IMMUTABLE : STATIC_CACHE_REVALIDATE;
|
|
@@ -57798,7 +57915,9 @@ async function startServer(opts = {}) {
|
|
|
57798
57915
|
const entry = findProjectBySegment(split.slug);
|
|
57799
57916
|
if (!entry) return void 0;
|
|
57800
57917
|
const existing = tenants.appFor(entry.id);
|
|
57801
|
-
if (existing
|
|
57918
|
+
if (existing && (entry.id === project.id || tenants.get(entry.id)?.project.dir === entry.path)) {
|
|
57919
|
+
return { surfaces: existing, url: split.rest };
|
|
57920
|
+
}
|
|
57802
57921
|
if (!await tenants.activate(projectFromRegistryEntry(entry))) return void 0;
|
|
57803
57922
|
const built = tenants.appFor(entry.id);
|
|
57804
57923
|
return built ? { surfaces: built, url: split.rest } : void 0;
|
|
@@ -57861,7 +57980,7 @@ async function startServer(opts = {}) {
|
|
|
57861
57980
|
});
|
|
57862
57981
|
return;
|
|
57863
57982
|
}
|
|
57864
|
-
if (
|
|
57983
|
+
if (existsSync20(distDir)) {
|
|
57865
57984
|
serveStatic(distDir, req, res);
|
|
57866
57985
|
return;
|
|
57867
57986
|
}
|
|
@@ -58082,7 +58201,7 @@ init_project();
|
|
|
58082
58201
|
init_project_launch();
|
|
58083
58202
|
init_shutdown();
|
|
58084
58203
|
init_logging();
|
|
58085
|
-
import { existsSync as
|
|
58204
|
+
import { existsSync as existsSync21 } from "node:fs";
|
|
58086
58205
|
import { join as join48 } from "node:path";
|
|
58087
58206
|
|
|
58088
58207
|
// packages/server/src/native-helper.ts
|
|
@@ -58160,9 +58279,9 @@ try {
|
|
|
58160
58279
|
["FRIZZ_SCRIPTS_DIR", process.env.FRIZZ_SCRIPTS_DIR, "index.mjs"],
|
|
58161
58280
|
["FRIZZ_WORKER_PLUGIN_DIR", process.env.FRIZZ_WORKER_PLUGIN_DIR, ".claude-plugin/plugin.json"]
|
|
58162
58281
|
];
|
|
58163
|
-
if (!
|
|
58282
|
+
if (!existsSync21(stableWebDist)) throw new Error("stable artifact launch is missing its verified web directory");
|
|
58164
58283
|
for (const [name, directory, requiredFile] of required) {
|
|
58165
|
-
if (!directory || !
|
|
58284
|
+
if (!directory || !existsSync21(join48(directory, requiredFile)))
|
|
58166
58285
|
throw new Error(`stable artifact launch is missing verified ${name}`);
|
|
58167
58286
|
}
|
|
58168
58287
|
}
|