frizz-server 0.15.63 → 0.15.64
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/dev-child.js +346 -176
- package/package.json +1 -1
- package/runtime/cc-worker/lib/frizz-tools.mjs +367 -55
- package/web-dist/assets/{abnfDiagram-VCTEODGH-CJ9DY67I.js → abnfDiagram-VCTEODGH-D5EqHQdx.js} +1 -1
- package/web-dist/assets/architecture-7GRP2DOG-CPrgjw61.js +1 -0
- package/web-dist/assets/{architectureDiagram-5GKGNRK7-DRM8-zOu.js → architectureDiagram-5GKGNRK7-gq825RUa.js} +1 -1
- package/web-dist/assets/{blockDiagram-I7D4REHJ-DNjmHPSZ.js → blockDiagram-I7D4REHJ-C3kbcova.js} +1 -1
- package/web-dist/assets/{c4Diagram-7LVT6UL2-Dz9J-TTp.js → c4Diagram-7LVT6UL2-DSdiPLXk.js} +1 -1
- package/web-dist/assets/channel-c26qxF0z.js +1 -0
- package/web-dist/assets/{chunk-2E4U76K2-BPsB3sRI.js → chunk-2E4U76K2-BVgft5ii.js} +1 -1
- package/web-dist/assets/{chunk-4HAMMTFA-NHElOJMR.js → chunk-4HAMMTFA-zVCpOazU.js} +1 -1
- package/web-dist/assets/{chunk-75Z2AOVW-Brw7EmiG.js → chunk-75Z2AOVW-KVNTSyn6.js} +1 -1
- package/web-dist/assets/{chunk-CLGD4ZFX-BNp8YhnD.js → chunk-CLGD4ZFX-DaCd56Bs.js} +1 -1
- package/web-dist/assets/{chunk-DU6HZSFF-DyPlNm7J.js → chunk-DU6HZSFF-Dltf3cFo.js} +1 -1
- package/web-dist/assets/{chunk-F27PBJKO-BCONkN6p.js → chunk-F27PBJKO-HNYY-fg6.js} +1 -1
- package/web-dist/assets/{chunk-GMAD6QVW-DbFBBOx6.js → chunk-GMAD6QVW-B1qwCavq.js} +1 -1
- package/web-dist/assets/{chunk-GVQU2GXP-BZL8UVk_.js → chunk-GVQU2GXP-0tGYVw7V.js} +1 -1
- package/web-dist/assets/{chunk-IMKFNOWR-DNBC3Npf.js → chunk-IMKFNOWR-xV54i1G0.js} +1 -1
- package/web-dist/assets/{chunk-L3NEJ4N5-pTT6R-Eu.js → chunk-L3NEJ4N5-DeTgpeAQ.js} +1 -1
- package/web-dist/assets/{chunk-OSK3NFVY-DhJh3Vid.js → chunk-OSK3NFVY-CDvPPEY9.js} +1 -1
- package/web-dist/assets/{chunk-P2QGCYS3-CWok-LvO.js → chunk-P2QGCYS3-BFxT0iW2.js} +1 -1
- package/web-dist/assets/{chunk-POPQ4Y6H-CWc6iGW-.js → chunk-POPQ4Y6H-g4jad-CP.js} +1 -1
- package/web-dist/assets/{chunk-PWAF6VOD-DkXvdk8S.js → chunk-PWAF6VOD-DxDAJOIK.js} +1 -1
- package/web-dist/assets/{chunk-SHT3W25Y-DWMGbqb_.js → chunk-SHT3W25Y-CWehUFxT.js} +1 -1
- package/web-dist/assets/{chunk-SVP7TREG-LcbJaowy.js → chunk-SVP7TREG-6Wvgv7qH.js} +1 -1
- package/web-dist/assets/{chunk-TICWLB2K-BxiaZoIt.js → chunk-TICWLB2K-hqgNuTQA.js} +1 -1
- package/web-dist/assets/{chunk-TLUHSLCS-bJGTUnJT.js → chunk-TLUHSLCS-CwXYeqEB.js} +2 -2
- package/web-dist/assets/classDiagram-ZZMXUADV-CW3HOlqk.js +1 -0
- package/web-dist/assets/classDiagram-v2-VYDZK3BY-CW3HOlqk.js +1 -0
- package/web-dist/assets/{cynefin-OW5HDTMX-BOKyDT0B.js → cynefin-OW5HDTMX-XWQcd7FR.js} +1 -1
- package/web-dist/assets/{cynefinDiagram-5FMLGOSQ-BYgd80zj.js → cynefinDiagram-5FMLGOSQ-BhLkDCGl.js} +1 -1
- package/web-dist/assets/{dagre-GXQ25YYZ-UKxnfAQZ.js → dagre-GXQ25YYZ-CEoBRa9n.js} +1 -1
- package/web-dist/assets/{diagram-S7CK7UJ4-POdoYLe9.js → diagram-S7CK7UJ4-DHk02-f8.js} +1 -1
- package/web-dist/assets/{diagram-UQ7AKVKN-B2ervceJ.js → diagram-UQ7AKVKN-CrtOBX4M.js} +1 -1
- package/web-dist/assets/{diagram-VSXAHHWV-RV0WG_Vh.js → diagram-VSXAHHWV-BQlVmaCU.js} +1 -1
- package/web-dist/assets/{diagram-VX7I27RA-DNFAC4Mo.js → diagram-VX7I27RA-Br3LNVAh.js} +1 -1
- package/web-dist/assets/{diagram-Z3DM3KII-DBbaSMbG.js → diagram-Z3DM3KII-DO8RnVJu.js} +1 -1
- package/web-dist/assets/{ebnfDiagram-PWID7BFC-nUP2mVRG.js → ebnfDiagram-PWID7BFC-DPJHGedI.js} +1 -1
- package/web-dist/assets/{erDiagram-RLTQ6QDP-CX2-ZFwk.js → erDiagram-RLTQ6QDP-aVp1cHLr.js} +1 -1
- package/web-dist/assets/eventmodeling-NTZA5JFV-BPWcI0I_.js +1 -0
- package/web-dist/assets/flowDiagram-HODETNUW-yGIuO3Wj.js +1 -0
- package/web-dist/assets/{ganttDiagram-EL5Y4UJY-CMdxpgt0.js → ganttDiagram-EL5Y4UJY-hGh2T28b.js} +1 -1
- package/web-dist/assets/{gitGraph-4MIJSDKK-UdI0LKxb.js → gitGraph-4MIJSDKK-BP-Alggb.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-WWUBYQGX-CJLoNdf2.js → gitGraphDiagram-WWUBYQGX-BEPvlTMD.js} +1 -1
- package/web-dist/assets/index-D4bBjzdK.js +262 -0
- package/web-dist/assets/index-DjVez4iB.css +2 -0
- package/web-dist/assets/{info-A6RAGUB7-CxnQJxLm.js → info-A6RAGUB7--TsjfXti.js} +1 -1
- package/web-dist/assets/{infoDiagram-27XIBGKW-HVKt8WDS.js → infoDiagram-27XIBGKW-B_gxNeQz.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-5VMMS53U-DI0M5sb-.js → ishikawaDiagram-5VMMS53U-CsBNJzZc.js} +1 -1
- package/web-dist/assets/{journeyDiagram-3NMN7TZE-B2GBTQj8.js → journeyDiagram-3NMN7TZE-CbaAx84c.js} +1 -1
- package/web-dist/assets/{kanban-definition-UXKFOSKX-BCMomB_2.js → kanban-definition-UXKFOSKX-Qnp78nfx.js} +1 -1
- package/web-dist/assets/{line-MCY_uLZm.js → line-BJrSvIrG.js} +1 -1
- package/web-dist/assets/{mermaid-parser.core-DTKPYi2J.js → mermaid-parser.core-CpqT4SIU.js} +3 -3
- package/web-dist/assets/{mermaid.core-DAYSZV3J.js → mermaid.core-B1c_wthC.js} +3 -3
- package/web-dist/assets/{mindmap-definition-YA3MSWOX-DDyg0vDb.js → mindmap-definition-YA3MSWOX-DVVk9yW1.js} +1 -1
- package/web-dist/assets/{packet-AYTQ26CC-ByyMe2pH.js → packet-AYTQ26CC-iZErOx2H.js} +1 -1
- package/web-dist/assets/{pegDiagram-XKGWAZYB-DnWoyrgK.js → pegDiagram-XKGWAZYB-Da5p8rFF.js} +1 -1
- package/web-dist/assets/{pie-WAS4IAKB-BI7-FKCx.js → pie-WAS4IAKB-DA7GELw3.js} +1 -1
- package/web-dist/assets/{pieDiagram-E7YTZNPT-BN6SWotB.js → pieDiagram-E7YTZNPT-BZ9ObHqc.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-AXDQQJYC-QKDpcrgh.js → quadrantDiagram-AXDQQJYC-9azv0gR1.js} +1 -1
- package/web-dist/assets/{radar-RG4KPBEZ-B5iqAJfo.js → radar-RG4KPBEZ-BX9sHDPS.js} +1 -1
- package/web-dist/assets/{railroad-74A4TZTK-CblcgEJv.js → railroad-74A4TZTK-Brs7_Tyl.js} +1 -1
- package/web-dist/assets/railroad-abnf-HS5TGJTU-BeJB0nBn.js +1 -0
- package/web-dist/assets/railroad-ebnf-LZEXJU2U-BpiILSS0.js +1 -0
- package/web-dist/assets/railroad-peg-WCYAUIDC-Bm6eAoYO.js +1 -0
- package/web-dist/assets/{railroadDiagram-O6MQD6OU-BIaxvbGE.js → railroadDiagram-O6MQD6OU-DRhzaWFO.js} +1 -1
- package/web-dist/assets/{requirementDiagram-BXWQKSXE-ys-OBQpS.js → requirementDiagram-BXWQKSXE-CQcrIknF.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-P5KCCOFB-DPLCMgnR.js → sankeyDiagram-P5KCCOFB-DkUbT70z.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-WJ2MYXX4-DxGzvovq.js → sequenceDiagram-WJ2MYXX4-BqKV7sY4.js} +1 -1
- package/web-dist/assets/{stateDiagram-D77RDMKH-TlJA-aW6.js → stateDiagram-D77RDMKH-CPiwkHGu.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-MP3YSRHH-Cg2HXf9n.js +1 -0
- package/web-dist/assets/{swimlanes-42K2YHIH-CEtwhIRy.js → swimlanes-42K2YHIH-CP-V5WFz.js} +1 -1
- package/web-dist/assets/swimlanesDiagram-VR7AAH4N-DGdb-xhi.js +8 -0
- package/web-dist/assets/threadSurfaces-dttA_8fg.js +140 -0
- package/web-dist/assets/{timeline-definition-24CTP7MA-Cgp09gy-.js → timeline-definition-24CTP7MA-DKY-PWS4.js} +1 -1
- package/web-dist/assets/{treeView-Q6P3EWNA-BtzFipdV.js → treeView-Q6P3EWNA-Gk9FLh78.js} +1 -1
- package/web-dist/assets/{treemap-WGGIJYW6-b7alBdhh.js → treemap-WGGIJYW6-BYnxP1dg.js} +1 -1
- package/web-dist/assets/{vennDiagram-4TSXK5OY-D8ap0toR.js → vennDiagram-4TSXK5OY-CQCcg6lv.js} +1 -1
- package/web-dist/assets/{wardley-WFR3VGLG-BFeDzhb0.js → wardley-WFR3VGLG-m7RO5npi.js} +1 -1
- package/web-dist/assets/{wardleyDiagram-VM6X3IG4-ZoCDFcAK.js → wardleyDiagram-VM6X3IG4-f0WZbMup.js} +1 -1
- package/web-dist/assets/{xychartDiagram-S5SC5T6Z-D1bLKZ_Z.js → xychartDiagram-S5SC5T6Z-C4OuY-EY.js} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/architecture-7GRP2DOG-CQLKjTke.js +0 -1
- package/web-dist/assets/channel-CF0ISgB3.js +0 -1
- package/web-dist/assets/classDiagram-ZZMXUADV-DN0vKKhs.js +0 -1
- package/web-dist/assets/classDiagram-v2-VYDZK3BY-DN0vKKhs.js +0 -1
- package/web-dist/assets/eventmodeling-NTZA5JFV-CsTmGcSv.js +0 -1
- package/web-dist/assets/flowDiagram-HODETNUW-C-xVGGSk.js +0 -1
- package/web-dist/assets/index-C73MQv-A.js +0 -262
- package/web-dist/assets/index-DC88IHP5.css +0 -2
- package/web-dist/assets/railroad-abnf-HS5TGJTU-Briaj5gq.js +0 -1
- package/web-dist/assets/railroad-ebnf-LZEXJU2U-vCfM8ZS4.js +0 -1
- package/web-dist/assets/railroad-peg-WCYAUIDC-BXkNOypp.js +0 -1
- package/web-dist/assets/stateDiagram-v2-MP3YSRHH-BIvvxNxn.js +0 -1
- package/web-dist/assets/swimlanesDiagram-VR7AAH4N-Dy_0ufxt.js +0 -8
- package/web-dist/assets/threadSurfaces-DXKHZ7Ci.js +0 -140
package/dist/dev-child.js
CHANGED
|
@@ -1022,6 +1022,9 @@ function recordedProjectDir(stateDir) {
|
|
|
1022
1022
|
function listProjects(home = homedir4()) {
|
|
1023
1023
|
const byRecency = (a, b) => a.lastOpenedAt < b.lastOpenedAt ? 1 : a.lastOpenedAt > b.lastOpenedAt ? -1 : 0;
|
|
1024
1024
|
return readRegistry(home).projects.map((p) => ({ ...p, stale: !existsSync3(p.path) })).sort((a, b) => {
|
|
1025
|
+
const aHome = isHomeDirectory(a.path, home);
|
|
1026
|
+
const bHome = isHomeDirectory(b.path, home);
|
|
1027
|
+
if (aHome !== bHome) return aHome ? -1 : 1;
|
|
1025
1028
|
if (a.order === void 0 && b.order === void 0) return byRecency(a, b);
|
|
1026
1029
|
if (a.order === void 0) return 1;
|
|
1027
1030
|
if (b.order === void 0) return -1;
|
|
@@ -1030,11 +1033,14 @@ function listProjects(home = homedir4()) {
|
|
|
1030
1033
|
}
|
|
1031
1034
|
function reorderProjects(ids, home = homedir4()) {
|
|
1032
1035
|
const registry = readRegistry(home);
|
|
1036
|
+
const isHome = (entry) => isHomeDirectory(entry.path, home);
|
|
1037
|
+
const pinned = registry.projects.filter(isHome);
|
|
1038
|
+
const movable = registry.projects.filter((p) => !isHome(p));
|
|
1033
1039
|
const rank = new Map(ids.map((id2, index) => [id2, index]));
|
|
1034
|
-
const known =
|
|
1035
|
-
const rest = listProjects(home).filter((p) => !rank.has(p.id));
|
|
1040
|
+
const known = movable.filter((p) => rank.has(p.id));
|
|
1041
|
+
const rest = listProjects(home).filter((p) => !isHome(p) && !rank.has(p.id));
|
|
1036
1042
|
known.sort((a, b) => rank.get(a.id) - rank.get(b.id));
|
|
1037
|
-
[...known, ...rest].forEach((entry, index) => {
|
|
1043
|
+
[...pinned, ...known, ...rest].forEach((entry, index) => {
|
|
1038
1044
|
const target = registry.projects.find((p) => p.id === entry.id);
|
|
1039
1045
|
if (target) target.order = index;
|
|
1040
1046
|
});
|
|
@@ -14890,6 +14896,9 @@ function opencodeModelRef(model) {
|
|
|
14890
14896
|
function isAntigravityModel(model) {
|
|
14891
14897
|
return typeof model === "string" && model.startsWith(ANTIGRAVITY_MODEL_PREFIX);
|
|
14892
14898
|
}
|
|
14899
|
+
function antigravityModelSlug(modelId) {
|
|
14900
|
+
return `${ANTIGRAVITY_MODEL_PREFIX}${modelId ?? ""}`;
|
|
14901
|
+
}
|
|
14893
14902
|
function antigravityModelId(model) {
|
|
14894
14903
|
if (!isAntigravityModel(model)) return void 0;
|
|
14895
14904
|
return model.slice(ANTIGRAVITY_MODEL_PREFIX.length) || void 0;
|
|
@@ -15383,17 +15392,17 @@ function signoffNudgeText(needsInput) {
|
|
|
15383
15392
|
"is genuinely finished. A milestone, a green test run and a long turn are none of them endings, and",
|
|
15384
15393
|
"neither is naming the next step or writing it into a scratch file.",
|
|
15385
15394
|
"",
|
|
15386
|
-
"**AND THAT TASK IS ALSO THE CEILING \u2014 finish it, and nothing else.** Work you notice on
|
|
15387
|
-
"FINDING TO
|
|
15388
|
-
"
|
|
15389
|
-
"
|
|
15390
|
-
"
|
|
15391
|
-
"it.",
|
|
15395
|
+
"**AND THAT TASK IS ALSO THE CEILING \u2014 finish it, and take on nothing else unasked.** Work you notice on",
|
|
15396
|
+
"the way is a FINDING TO OFFER in your sign-off, never work to take on unasked: the bug beside the one you",
|
|
15397
|
+
"were sent for, the second issue the first one touches. Widening the job is not thoroughness \u2014 it is a",
|
|
15398
|
+
"different job nobody asked for, and it buries the answer they did ask for under changes they now have to",
|
|
15399
|
+
"review. If it should be done, offer it in a ```question whose recommended option has this thread do it,",
|
|
15400
|
+
"so one answer carries it through. Never leave it as a line for the human to dispatch.",
|
|
15392
15401
|
"",
|
|
15393
15402
|
"**IF WHAT YOU WERE ASKED FOR IS A DOCUMENT, THE DOCUMENT IS THE ENDING.** A triage, a review, an",
|
|
15394
15403
|
"investigation, a recommendation, a plan \u2014 when that is the deliverable, the finished write-up IS the",
|
|
15395
15404
|
"work. Implementing what it proposes is the NEXT job, and not yours unless you were asked. Sign off with",
|
|
15396
|
-
"the write-up.",
|
|
15405
|
+
"the write-up, and offer the implementation in a ```question.",
|
|
15397
15406
|
"",
|
|
15398
15407
|
"**DECIDE RATHER THAN ASK.** Stop only for a decision that is genuinely the human's AND that blocks you",
|
|
15399
15408
|
"right now: ask that one in a ```question fence. Every other open choice INSIDE the task \u2014 a name, a",
|
|
@@ -15833,6 +15842,7 @@ function hasLiveSubAgents(t) {
|
|
|
15833
15842
|
function hasLiveOps(t) {
|
|
15834
15843
|
if (watchingRest(t)) return false;
|
|
15835
15844
|
if (hasLiveSubAgents(t)) return true;
|
|
15845
|
+
if (t.waitStatus === "working" && t.runtime === "turn-idle") return true;
|
|
15836
15846
|
return t.awaitingBackground === true && !parkedOnArmedTimerAlone(t);
|
|
15837
15847
|
}
|
|
15838
15848
|
function watchingRest(t) {
|
|
@@ -16509,7 +16519,10 @@ var init_src = __esm({
|
|
|
16509
16519
|
});
|
|
16510
16520
|
CompletionHoldOp = external_exports.object({
|
|
16511
16521
|
label: external_exports.string(),
|
|
16512
|
-
state: external_exports.enum(["running", "stale"])
|
|
16522
|
+
state: external_exports.enum(["running", "stale"]),
|
|
16523
|
+
// ISO of its launch, for the dialog's running clock beside each row, as every other row of live work
|
|
16524
|
+
// carries one. Optional: an older server sends none, and the row then draws no reading.
|
|
16525
|
+
startedAt: external_exports.string().optional()
|
|
16513
16526
|
});
|
|
16514
16527
|
CompletionHold = external_exports.object({
|
|
16515
16528
|
turnInFlight: external_exports.boolean().default(false),
|
|
@@ -17451,9 +17464,6 @@ ${ANSWER_CONTINUATION_INDENT}`);
|
|
|
17451
17464
|
// ISO8601 of the newest REAL user interaction (answer/steer/dispatch) — the chronological listing
|
|
17452
17465
|
// sort key. Optional; the listing falls back to spawnedAt when absent (a dispatch IS an interaction).
|
|
17453
17466
|
lastUserAt: external_exports.string().optional(),
|
|
17454
|
-
// The thread's last turn ended because a person pressed Stop, and nothing has happened since. Its rest
|
|
17455
|
-
// is the human's act, so it is not drawn as one without a sign-off. Absent otherwise.
|
|
17456
|
-
operatorStopped: external_exports.boolean().optional(),
|
|
17457
17467
|
// Runtime provider-auth rejection (claude-auth plan): the session's provider positively rejected
|
|
17458
17468
|
// its credential (Claude: synthetic isApiErrorMessage 401 record, or the 401/login text on a
|
|
17459
17469
|
// boot-failed pane). Bounded by design — only the typed category travels, never raw provider/pane
|
|
@@ -17507,6 +17517,9 @@ ${ANSWER_CONTINUATION_INDENT}`);
|
|
|
17507
17517
|
// project's board, nor the other way round. The instant is the Console's pinned band's order across
|
|
17508
17518
|
// every project, and like the project pin it outranks every derived state.
|
|
17509
17519
|
consolePinnedAt: external_exports.string().optional(),
|
|
17520
|
+
// The human answered "Leave pinned" to Mark as done's pin question once, so Done on this thread keeps
|
|
17521
|
+
// its pin without asking again, whichever shelf it is on (absent = ask).
|
|
17522
|
+
leavePinned: external_exports.literal(true).optional(),
|
|
17510
17523
|
/** CHILD THREADS (Settings.childThreads): the thread that spawned this one with `frizzctl spawn-child`.
|
|
17511
17524
|
* Present only while that thread still exists. A child is never a row of its own on the board — not in
|
|
17512
17525
|
* any band, the queue, a count or a badge — and is drawn under its parent instead, unless it stands at a
|
|
@@ -17532,9 +17545,9 @@ ${ANSWER_CONTINUATION_INDENT}`);
|
|
|
17532
17545
|
* The header's "Until activity" (SnoozeMenu, 2026-10-19) arms the same snooze on any rested thread. */
|
|
17533
17546
|
bgSnoozed: external_exports.boolean().optional(),
|
|
17534
17547
|
/** Something of the thread's own can wake it without a person — a running sub-agent or shell, an
|
|
17535
|
-
* armed watch or timer, a Goal that fires on rest or on
|
|
17536
|
-
* menu greys out "Until activity" without it, and the server
|
|
17537
|
-
* goes false. Absent on a dead worker and on an archived thread. */
|
|
17548
|
+
* armed watch or timer, a child thread whose handoff is still to come, a Goal that fires on rest or on
|
|
17549
|
+
* a clock (board.wakesOnItsOwn). The snooze menu greys out "Until activity" without it, and the server
|
|
17550
|
+
* stops honouring that snooze once it goes false. Absent on a dead worker and on an archived thread. */
|
|
17538
17551
|
wakesOnItsOwn: external_exports.boolean().optional(),
|
|
17539
17552
|
/** A QUIET PARK THE BOARD REFUSED because an earlier `needs_input` handoff still stands: the human has
|
|
17540
17553
|
* neither typed to the thread nor snoozed a rest since it (board handoffStands). The surfaces keep that
|
|
@@ -25475,7 +25488,7 @@ function groupBySlug(rows) {
|
|
|
25475
25488
|
}
|
|
25476
25489
|
function ensureStorageSchema(db2) {
|
|
25477
25490
|
db2.exec(STORAGE_SCHEMA);
|
|
25478
|
-
for (const column of ["pinned_at TEXT", "acp_agent TEXT", "worker_surface TEXT", "console_pinned_at TEXT", "archived_at TEXT", "running_since TEXT", "parent_slug TEXT", "child_reported_at TEXT", "held_releases TEXT"]) {
|
|
25491
|
+
for (const column of ["pinned_at TEXT", "acp_agent TEXT", "worker_surface TEXT", "console_pinned_at TEXT", "archived_at TEXT", "running_since TEXT", "parent_slug TEXT", "child_reported_at TEXT", "held_releases TEXT", "leave_pinned_at TEXT"]) {
|
|
25479
25492
|
try {
|
|
25480
25493
|
db2.exec(`ALTER TABLE session ADD COLUMN ${column}`);
|
|
25481
25494
|
} catch {
|
|
@@ -25839,6 +25852,7 @@ function createStorage(source, projectId) {
|
|
|
25839
25852
|
});
|
|
25840
25853
|
});
|
|
25841
25854
|
const consolePinnedAtStmt = scope.prepare("UPDATE session SET console_pinned_at = ? WHERE project_id = @project_id AND slug = ?");
|
|
25855
|
+
const leavePinnedAtStmt = scope.prepare("UPDATE session SET leave_pinned_at = ? WHERE project_id = @project_id AND slug = ?");
|
|
25842
25856
|
const placeConsolePinStmt = scope.prepare(
|
|
25843
25857
|
"UPDATE session SET console_pinned_at = ? WHERE project_id = @project_id AND slug = ? AND console_pinned_at IS NOT NULL"
|
|
25844
25858
|
);
|
|
@@ -26691,6 +26705,7 @@ function createStorage(source, projectId) {
|
|
|
26691
26705
|
setRunningSince: (slug, at2) => void runningSinceStmt.run(at2, slug),
|
|
26692
26706
|
reorderPinned: (slugs) => reorderPinned(slugs),
|
|
26693
26707
|
setConsolePinnedAt: (slug, at2) => void consolePinnedAtStmt.run(at2, slug),
|
|
26708
|
+
setLeavePinnedAt: (slug, at2) => void leavePinnedAtStmt.run(at2, slug),
|
|
26694
26709
|
placeConsolePins: (pins) => placeConsolePins(pins),
|
|
26695
26710
|
setBgSnoozeRestedAtIfCurrent: (slug, sessionId, generation, restedAt) => bgSnoozeRestedAtIfCurrentStmt.run(restedAt, slug, sessionId, generation).changes === 1,
|
|
26696
26711
|
setRecurringPromptIfCurrent: (slug, sessionId, generation, write) => recurringStmt.run(...recurringArgs(write), slug, sessionId, generation).changes === 1,
|
|
@@ -27098,6 +27113,8 @@ var init_storage = __esm({
|
|
|
27098
27113
|
child_reported_at TEXT,
|
|
27099
27114
|
-- SessionRow.held_releases. Also in the ALTER list below.
|
|
27100
27115
|
held_releases TEXT,
|
|
27116
|
+
-- SessionRow.leave_pinned_at. Also in the ALTER list below.
|
|
27117
|
+
leave_pinned_at TEXT,
|
|
27101
27118
|
-- THE RECURRING PROMPT (scheduler.ts SOURCES 4, 5 and 7): one text, three independent triggers \u2014
|
|
27102
27119
|
-- every time the thread rests, every N ms on a clock, and/or every time its context is compacted.
|
|
27103
27120
|
-- All flags 0 = off; there is no separate enable column, because another flag could only ever
|
|
@@ -27825,11 +27842,14 @@ function projectAcpTranscript(raw2, identityPrefix = "acp", userProjector, diale
|
|
|
27825
27842
|
const pushUser = userProjector?.(out);
|
|
27826
27843
|
let current2;
|
|
27827
27844
|
let currentMessageId;
|
|
27845
|
+
let turnReasoning;
|
|
27846
|
+
let thoughtSinceText = false;
|
|
27828
27847
|
const openTools = /* @__PURE__ */ new Map();
|
|
27829
27848
|
const lines = raw2.split("\n");
|
|
27830
27849
|
const close2 = () => {
|
|
27831
27850
|
current2 = void 0;
|
|
27832
27851
|
currentMessageId = void 0;
|
|
27852
|
+
thoughtSinceText = false;
|
|
27833
27853
|
};
|
|
27834
27854
|
const openAssistant = (i, at2) => {
|
|
27835
27855
|
if (!current2) {
|
|
@@ -27838,9 +27858,11 @@ function projectAcpTranscript(raw2, identityPrefix = "acp", userProjector, diale
|
|
|
27838
27858
|
}
|
|
27839
27859
|
return current2;
|
|
27840
27860
|
};
|
|
27841
|
-
const appendText = (msg, text2) => {
|
|
27861
|
+
const appendText = (msg, text2, separate = false) => {
|
|
27842
27862
|
const last = msg.parts[msg.parts.length - 1];
|
|
27843
|
-
if (last?.kind === "text") last.text
|
|
27863
|
+
if (last?.kind === "text") last.text = separate && last.text ? `${last.text}
|
|
27864
|
+
|
|
27865
|
+
${text2}` : last.text + text2;
|
|
27844
27866
|
else msg.parts.push({ kind: "text", text: text2 });
|
|
27845
27867
|
msg.text = msg.parts.filter((p) => p.kind === "text").map((p) => p.text).join("\n\n");
|
|
27846
27868
|
};
|
|
@@ -27865,6 +27887,7 @@ function projectAcpTranscript(raw2, identityPrefix = "acp", userProjector, diale
|
|
|
27865
27887
|
break;
|
|
27866
27888
|
case "user-message": {
|
|
27867
27889
|
close2();
|
|
27890
|
+
turnReasoning = void 0;
|
|
27868
27891
|
const text2 = rec.text ?? "";
|
|
27869
27892
|
if (!pushUser) {
|
|
27870
27893
|
out.push({ sourceId: `${identityPrefix}:${i}`, role: "user", text: text2, tools: [], parts: [], ...rec.at ? { at: rec.at } : {}, ...rec.synthetic ? { wake: true } : {} });
|
|
@@ -27880,19 +27903,33 @@ function projectAcpTranscript(raw2, identityPrefix = "acp", userProjector, diale
|
|
|
27880
27903
|
break;
|
|
27881
27904
|
}
|
|
27882
27905
|
case "turn-start":
|
|
27906
|
+
turnReasoning = void 0;
|
|
27883
27907
|
break;
|
|
27884
27908
|
case "turn-end":
|
|
27885
27909
|
close2();
|
|
27910
|
+
turnReasoning = void 0;
|
|
27886
27911
|
break;
|
|
27887
27912
|
case "reasoning": {
|
|
27888
|
-
|
|
27889
|
-
|
|
27913
|
+
const shaped = dialect?.reasoning ? dialect.reasoning(rec.text) : rec.text;
|
|
27914
|
+
const text2 = shaped?.replace(/\r\n?/g, "\n").trim();
|
|
27915
|
+
if (!text2) break;
|
|
27916
|
+
if (turnReasoning) {
|
|
27917
|
+
turnReasoning.text = `${turnReasoning.text}
|
|
27918
|
+
|
|
27919
|
+
${text2}`;
|
|
27920
|
+
thoughtSinceText = true;
|
|
27921
|
+
} else {
|
|
27922
|
+
close2();
|
|
27923
|
+
turnReasoning = { sourceId: `${identityPrefix}:${i}`, role: "assistant", kind: "reasoning", text: text2, tools: [], parts: [], ...rec.at ? { at: rec.at } : {} };
|
|
27924
|
+
out.push(turnReasoning);
|
|
27925
|
+
}
|
|
27890
27926
|
break;
|
|
27891
27927
|
}
|
|
27892
27928
|
case "assistant-text": {
|
|
27893
27929
|
const msg = openAssistant(i, rec.at);
|
|
27894
27930
|
const mid = rec.messageId;
|
|
27895
27931
|
if (mid && mid === currentMessageId) {
|
|
27932
|
+
thoughtSinceText = false;
|
|
27896
27933
|
const last = msg.parts[msg.parts.length - 1];
|
|
27897
27934
|
if (last?.kind === "text") {
|
|
27898
27935
|
last.text += rec.text;
|
|
@@ -27900,13 +27937,16 @@ function projectAcpTranscript(raw2, identityPrefix = "acp", userProjector, diale
|
|
|
27900
27937
|
break;
|
|
27901
27938
|
}
|
|
27902
27939
|
}
|
|
27940
|
+
const separate = Boolean(mid && currentMessageId && mid !== currentMessageId || thoughtSinceText);
|
|
27941
|
+
thoughtSinceText = false;
|
|
27903
27942
|
currentMessageId = mid;
|
|
27904
|
-
appendText(msg, rec.text);
|
|
27943
|
+
appendText(msg, rec.text, separate);
|
|
27905
27944
|
break;
|
|
27906
27945
|
}
|
|
27907
27946
|
case "tool-call": {
|
|
27908
27947
|
const msg = openAssistant(i, rec.at);
|
|
27909
27948
|
currentMessageId = void 0;
|
|
27949
|
+
thoughtSinceText = false;
|
|
27910
27950
|
const call = dialect?.toolCall?.(rec) ?? toolCallFor(rec, rec.acp);
|
|
27911
27951
|
openTools.set(rec.id, call);
|
|
27912
27952
|
appendTool(msg, call);
|
|
@@ -27937,6 +27977,7 @@ function projectAcpTranscript(raw2, identityPrefix = "acp", userProjector, diale
|
|
|
27937
27977
|
// the message that failed read as delivered (2026-11-06).
|
|
27938
27978
|
case "provider-error": {
|
|
27939
27979
|
close2();
|
|
27980
|
+
turnReasoning = void 0;
|
|
27940
27981
|
out.push({ sourceId: `${identityPrefix}:${i}`, role: "assistant", kind: "event", text: rec.error.message, providerError: rec.error, tools: [], parts: [], ...rec.at ? { at: rec.at } : {} });
|
|
27941
27982
|
break;
|
|
27942
27983
|
}
|
|
@@ -31634,8 +31675,6 @@ function humanStepsOf(state) {
|
|
|
31634
31675
|
function applyEvent(state, ev) {
|
|
31635
31676
|
if ("at" in ev && typeof ev.at === "string" && ev.kind !== "context-usage") state.lastActivityAt = ev.at;
|
|
31636
31677
|
if (ev.kind === "tool-call" || ev.kind === "tool-result" || ev.kind === "user-message" || ev.kind === "turn-start") state.assistantMessage = void 0;
|
|
31637
|
-
if (ev.kind === "turn-end") state.operatorStopped = ev.stoppedBy === "operator" || void 0;
|
|
31638
|
-
else if (STOP_CLEARING_KINDS.has(ev.kind)) state.operatorStopped = void 0;
|
|
31639
31678
|
switch (ev.kind) {
|
|
31640
31679
|
case "provider-error":
|
|
31641
31680
|
state.sawRecords = true;
|
|
@@ -33429,7 +33468,7 @@ ${detail2}
|
|
|
33429
33468
|
function telemetryOf(s, row) {
|
|
33430
33469
|
const pendingQuestion = s.lastAssistantHasQuestion && questionFencesLive(row?.spawned_at);
|
|
33431
33470
|
const nowMs = now();
|
|
33432
|
-
return { turn: s.turn, permPrompt: s.permPrompt, permPolicy: s.permPolicy, permDenies: s.permDenies, model: s.model, effort: s.effort, profileAt: s.profileAt, profileRevision: s.profileRevision, permissionMode: s.permissionMode, permissionModeAt: s.permissionModeAt, permissionModeRevision: s.permissionModeRevision, lastActivityAt: s.lastActivityAt, wakeTokens: s.wakeTokens, lastAssistantAt: s.lastAssistantAt, lastAssistant: s.lastAssistant, lastAssistantLine: s.lastAssistantLine, liveTool: newestLiveTool(s), aiTitle: s.aiTitle, customTitle: s.customTitle, customTitleRevision: s.customTitleRevision, subAgents: subAgentViews(s, nowMs, sidecarDirOnGrain(s, row)), droppedReports: [...s.queuedReports.values()], bgShells: [...bgShellViews(s), ...codexBgShellViews(s)], retiredShells: retiredShellViews(s), retiredSubAgents: retiredSubAgentViews(s), questionSightings: s.questionSightings, pendingAsk: s.pendingAsk, pendingQuestion, lastAssistantAllDone: s.lastAssistantAllDone, lastAssistantFenceAlone: s.lastAssistantFenceAlone, lastAssistantFencesOnly: s.lastAssistantFencesOnly, lastUserAt: s.lastUserAt, lastMidTurnDeliveryAt: s.lastMidTurnDeliveryAt, restFromAt: heldTypedAt(s, row), handoffAt: s.handoffAt, stepsDoneAt: s.stepsDoneAt, humanSteps: humanStepsOf(s), questionCorrectedAt: s.questionCorrectedAt, repairAskedAt: s.repairAskedAt, lastUserText: s.lastUserText, firstUserText: s.firstUserText, lastFence: s.lastFence, strayFence: s.strayFence, noTranscript: s.noTranscript, authFault: s.authFault, apiFault: s.apiFault,
|
|
33471
|
+
return { turn: s.turn, permPrompt: s.permPrompt, permPolicy: s.permPolicy, permDenies: s.permDenies, model: s.model, effort: s.effort, profileAt: s.profileAt, profileRevision: s.profileRevision, permissionMode: s.permissionMode, permissionModeAt: s.permissionModeAt, permissionModeRevision: s.permissionModeRevision, lastActivityAt: s.lastActivityAt, wakeTokens: s.wakeTokens, lastAssistantAt: s.lastAssistantAt, lastAssistant: s.lastAssistant, lastAssistantLine: s.lastAssistantLine, liveTool: newestLiveTool(s), aiTitle: s.aiTitle, customTitle: s.customTitle, customTitleRevision: s.customTitleRevision, subAgents: subAgentViews(s, nowMs, sidecarDirOnGrain(s, row)), droppedReports: [...s.queuedReports.values()], bgShells: [...bgShellViews(s), ...codexBgShellViews(s)], retiredShells: retiredShellViews(s), retiredSubAgents: retiredSubAgentViews(s), questionSightings: s.questionSightings, pendingAsk: s.pendingAsk, pendingQuestion, lastAssistantAllDone: s.lastAssistantAllDone, lastAssistantFenceAlone: s.lastAssistantFenceAlone, lastAssistantFencesOnly: s.lastAssistantFencesOnly, lastUserAt: s.lastUserAt, lastMidTurnDeliveryAt: s.lastMidTurnDeliveryAt, restFromAt: heldTypedAt(s, row), handoffAt: s.handoffAt, stepsDoneAt: s.stepsDoneAt, humanSteps: humanStepsOf(s), questionCorrectedAt: s.questionCorrectedAt, repairAskedAt: s.repairAskedAt, lastUserText: s.lastUserText, firstUserText: s.firstUserText, lastFence: s.lastFence, strayFence: s.strayFence, noTranscript: s.noTranscript, authFault: s.authFault, apiFault: s.apiFault, providerError: s.providerError, limitFault: s.limitFault, contextTokens: s.contextTokens, contextWindow: s.contextWindow, lastCompactionAt: s.lastCompactionAt };
|
|
33433
33472
|
}
|
|
33434
33473
|
const touches = /* @__PURE__ */ new WeakMap();
|
|
33435
33474
|
const telemetryMemos = /* @__PURE__ */ new WeakMap();
|
|
@@ -33537,7 +33576,7 @@ function landsAfterRead(eventAt, lastReadAt) {
|
|
|
33537
33576
|
if (!Number.isFinite(e8) || !Number.isFinite(r)) return true;
|
|
33538
33577
|
return e8 > r;
|
|
33539
33578
|
}
|
|
33540
|
-
var IDLE_BACKSTOP_MS, RUNTIME_CHASE_MAX, POLL_MS2, MAX_PRIME_ROWS_PER_TICK, PRIME_BUDGET_MS, TRANSCRIPT_READ_WINDOW, EMPTY_BUFFER, LINE_FAULT_LOG_CAP, MAX_POLL_MS, QUIET_POLL_MS, DORMANT_SWEEP_MS, SUBAGENT_STALE_MS, SUSPENDED_GAP_MS, BASH_TIMEOUT_CEILING_MS, PENDING_CALL_TAIL_BYTES, SHELL_PROBE_TTL_MS, SHELL_PROBE_GRACE_MS, SHELL_PROBE_TTL_MAX_MS, SHELL_PROBE_TTL_AGE_SHARE, execFileAsync2, shellProbeExec, FOREIGN_FRESH_MS, FOREIGN_MAX, FOREIGN_SCAN_EVERY, CACHE_FLUSH_MS, PRIME_PROGRESS_EVERY, DISCOVER_RETRY_MS, DISCOVER_RETRY_MAX_MS, RETAINED_SUBAGENTS_MAX, RETAINED_SHELLS_MAX, MONITOR_LOGS_MAX, MONITOR_EVENTS_MAX, MONITOR_EVENT_CHARS_MAX, MONITOR_LOG_CHARS_MAX, MONITOR_SEEN_MAX, QUESTION_SIGHTINGS_MAX, DESCENDANT_TERMINALS_MAX, PENDING_RESUMES_MAX, PENDING_SHELLS_MAX, LIVE_TOOLS_MAX, RESUME_REPLAY_SLACK_MS, FIRST_USER_TEXT_MAX, ASSISTANT_LINE_MAX, QUESTION_BLOCK_RE, FENCE_BODY_MAX, LOCAL_COMMAND_RECEIPT, QUEUED_HUMAN_TEXTS_MAX, WAKE_TOKEN_RE, WAKE_TOKENS_MAX, LAUNCH_ACK_RE, AUTO_BACKGROUND_ACK_RE, ASYNC_AGENT_ACK_RE, FOLDED_TERMINALS_MAX, AGENT_TRANSCRIPT_PATH_RE, DESCENDANT_SIDECAR_MAX, DESCENDANT_NOTIFY_GRACE_MS, NOTIFICATION_ENTITIES, MAX_OWNED_TOOL_USE_IDS, humanStepsAtRest, unlistedAtRest,
|
|
33579
|
+
var IDLE_BACKSTOP_MS, RUNTIME_CHASE_MAX, POLL_MS2, MAX_PRIME_ROWS_PER_TICK, PRIME_BUDGET_MS, TRANSCRIPT_READ_WINDOW, EMPTY_BUFFER, LINE_FAULT_LOG_CAP, MAX_POLL_MS, QUIET_POLL_MS, DORMANT_SWEEP_MS, SUBAGENT_STALE_MS, SUSPENDED_GAP_MS, BASH_TIMEOUT_CEILING_MS, PENDING_CALL_TAIL_BYTES, SHELL_PROBE_TTL_MS, SHELL_PROBE_GRACE_MS, SHELL_PROBE_TTL_MAX_MS, SHELL_PROBE_TTL_AGE_SHARE, execFileAsync2, shellProbeExec, FOREIGN_FRESH_MS, FOREIGN_MAX, FOREIGN_SCAN_EVERY, CACHE_FLUSH_MS, PRIME_PROGRESS_EVERY, DISCOVER_RETRY_MS, DISCOVER_RETRY_MAX_MS, RETAINED_SUBAGENTS_MAX, RETAINED_SHELLS_MAX, MONITOR_LOGS_MAX, MONITOR_EVENTS_MAX, MONITOR_EVENT_CHARS_MAX, MONITOR_LOG_CHARS_MAX, MONITOR_SEEN_MAX, QUESTION_SIGHTINGS_MAX, DESCENDANT_TERMINALS_MAX, PENDING_RESUMES_MAX, PENDING_SHELLS_MAX, LIVE_TOOLS_MAX, RESUME_REPLAY_SLACK_MS, FIRST_USER_TEXT_MAX, ASSISTANT_LINE_MAX, QUESTION_BLOCK_RE, FENCE_BODY_MAX, LOCAL_COMMAND_RECEIPT, QUEUED_HUMAN_TEXTS_MAX, WAKE_TOKEN_RE, WAKE_TOKENS_MAX, LAUNCH_ACK_RE, AUTO_BACKGROUND_ACK_RE, ASYNC_AGENT_ACK_RE, FOLDED_TERMINALS_MAX, AGENT_TRANSCRIPT_PATH_RE, DESCENDANT_SIDECAR_MAX, DESCENDANT_NOTIFY_GRACE_MS, NOTIFICATION_ENTITIES, MAX_OWNED_TOOL_USE_IDS, humanStepsAtRest, unlistedAtRest, FRIZZ_HOOK_FILES, FRIZZ_HOOK_COMMAND, HOOK_FAILURE_REPORT_EVERY_MS, BROKER_LIVENESS_TTL_MS, UNRESTORED_TAIL_FIELDS;
|
|
33541
33580
|
var init_tailer = __esm({
|
|
33542
33581
|
"packages/server/src/tailer.ts"() {
|
|
33543
33582
|
"use strict";
|
|
@@ -33630,7 +33669,6 @@ var init_tailer = __esm({
|
|
|
33630
33669
|
MAX_OWNED_TOOL_USE_IDS = 25e3;
|
|
33631
33670
|
humanStepsAtRest = /* @__PURE__ */ new WeakMap();
|
|
33632
33671
|
unlistedAtRest = /* @__PURE__ */ new WeakMap();
|
|
33633
|
-
STOP_CLEARING_KINDS = /* @__PURE__ */ new Set(["turn-start", "user-message", "assistant-text", "tool-call", "tool-result", "reasoning", "provider-error", "agent-report"]);
|
|
33634
33672
|
FRIZZ_HOOK_FILES = /* @__PURE__ */ new Set([
|
|
33635
33673
|
"agent-bind.mjs",
|
|
33636
33674
|
"agent-dispatch.mjs",
|
|
@@ -49284,8 +49322,8 @@ exactly ONE of them.
|
|
|
49284
49322
|
the thread found more** \u2014 none of its exits is stretching \`done\`.
|
|
49285
49323
|
- **A \`done\` MESSAGE SAYS WHAT HAPPENED. DELETE EVERY DANGLING "WORTH DOING LATER".** "One thing to
|
|
49286
49324
|
carry forward\u2026", "a follow-up could\u2026" \u2014 a forward-reference in a dismissal card is too weak to act
|
|
49287
|
-
on and archived unread. Each one resolves four ways and there is no fifth \u2014 DO it,
|
|
49288
|
-
its own card,
|
|
49325
|
+
on and archived unread. Each one resolves four ways and there is no fifth \u2014 DO it, OFFER it, SPAWN
|
|
49326
|
+
it onto its own card, or DROP it. Something the human must DO ("re-pull before you
|
|
49289
49327
|
restart") is not a dangling idea either: hand it to them under \`steps:\` in an \` \`\`\`awaiting \`
|
|
49290
49328
|
fence, which keeps the thread in their queue until they report back.
|
|
49291
49329
|
- Two cases earn \`done\` without landed code, by the same test \u2014 the deliverable is a FILE the human
|
|
@@ -49527,10 +49565,10 @@ how you break it. Take the first exit that fits:
|
|
|
49527
49565
|
SUB-AGENT: its result comes BACK to you, so the follow-up lands on YOUR card, in your diff, under one
|
|
49528
49566
|
review. A finished child that already covered the topic takes the follow-up first: re-steer it rather
|
|
49529
49567
|
than dispatching a fresh one. Then \`done\` is honest with nothing left over.
|
|
49530
|
-
2. **
|
|
49531
|
-
pending" is not an objection. This is the exit for
|
|
49532
|
-
|
|
49533
|
-
than a card you create for them.
|
|
49568
|
+
2. **OFFER IT** \u2014 a \` \`\`\`question \` fence offering to do it on this thread, your recommendation
|
|
49569
|
+
marked and its road hung on the yes; "nothing was pending" is not an objection. This is the exit for
|
|
49570
|
+
work past your mandate, work you cannot bound or verify, or a call that is genuinely the human's \u2014
|
|
49571
|
+
and it is where a separable effort goes, as an OPTION they pick, rather than a card you create for them.
|
|
49534
49572
|
3. **HAND IT OFF TO ITS OWN CARD \u2014 the LAST resort, not the tidy one.** \`frizzctl spawn-thread\` puts
|
|
49535
49573
|
a separable effort on the board as its own thread; put the \`[title](/thread/<slug>)\` link it prints
|
|
49536
49574
|
in the body. **A spawned thread is FIRE-AND-FORGET: it reports to the HUMAN, not to you, and
|
|
@@ -49970,6 +50008,11 @@ paragraph it belongs to if the human has typed past it, and left where it is if
|
|
|
49970
50008
|
thread in their queue until it is answered.`;
|
|
49971
50009
|
STOP_CRITERION = `## The stop criterion
|
|
49972
50010
|
|
|
50011
|
+
**A THREAD IS MEASURED BY HOW MUCH IT FINISHES PER HUMAN INTERACTION.** Each round-trip costs the human a
|
|
50012
|
+
read and leaves the work idle for hours, so every rest that reaches them carries the work as far as it
|
|
50013
|
+
can go: everything you can do, done; everything that needs them, asked in that one message; every
|
|
50014
|
+
natural next step, offered with its road, so one reply takes it to its end.
|
|
50015
|
+
|
|
49973
50016
|
**COMING TO REST IS A STOP, and it needs the same justification as a question.** The far more common
|
|
49974
50017
|
failure is quiet: you finish one part of a multi-part instruction, write it up, and rest with the rest
|
|
49975
50018
|
of the mandate untouched \u2014 a handoff produced because a handoff was the shape closest to hand. That is
|
|
@@ -49982,15 +50025,18 @@ starting X" with no tool call); writing the next action into a scratch file and
|
|
|
49982
50025
|
doing work; notes are crash insurance, never a handoff \u2014 if the action you wrote down is what the human asked for, do it
|
|
49983
50026
|
NOW); and stopping because the turn feels long.
|
|
49984
50027
|
|
|
49985
|
-
**AND THE INSTRUCTION IS ALSO THE CEILING
|
|
49986
|
-
always more to do in any repository \u2014 so finish the
|
|
49987
|
-
|
|
49988
|
-
|
|
50028
|
+
**AND THE INSTRUCTION IS ALSO THE CEILING \u2014 ON WHAT YOU DO UNASKED, NEVER ON WHAT YOU OFFER.** "Keep
|
|
50029
|
+
going" has no upper bound of its own \u2014 there is always more to do in any repository \u2014 so finish the
|
|
50030
|
+
mandate you were given, and take on nothing else unasked: widening buries the answer they asked for
|
|
50031
|
+
under changes they now have to review. Work you notice on the way is a FINDING, not a task \u2014 and never
|
|
50032
|
+
a line left for the human to dispatch. The same bug in a sibling, the issue your fix also closes, the
|
|
50033
|
+
step the result implies: OFFER each, in a \` \`\`\`question \` whose recommended option has THIS thread
|
|
50034
|
+
do it, its road hung on that yes. Offer only what you would recommend; drop the rest.
|
|
49989
50035
|
If the deliverable is a DOCUMENT \u2014 a triage, a review, an investigation, a recommendation, a plan \u2014
|
|
49990
50036
|
the document is the ending: the finished write-up IS the work.
|
|
49991
|
-
Implementing what it proposes is the NEXT job, not yours unless you were asked
|
|
49992
|
-
unanswered question is not permission to build the answer: decide what the task itself
|
|
49993
|
-
carry on INSIDE it.
|
|
50037
|
+
Implementing what it proposes is the NEXT job, not yours unless you were asked, and the first thing
|
|
50038
|
+
you offer. An unanswered question is not permission to build the answer: decide what the task itself
|
|
50039
|
+
needs and carry on INSIDE it.
|
|
49994
50040
|
|
|
49995
50041
|
**Your default is to DECIDE.** A reversible call costs minutes to redo; a round-trip to the human
|
|
49996
50042
|
costs hours, with the whole effort idle meanwhile. Anything derivable from the code, the conventions, or
|
|
@@ -50000,8 +50046,8 @@ already know the answer \u2014 so implement it instead of asking.** The same goe
|
|
|
50000
50046
|
on a bug you were dispatched to fix, "should I also handle X?" where X is obviously in scope, and any
|
|
50001
50047
|
question about a name, a default value, a file location, an error message, a flag spelling, or which of
|
|
50002
50048
|
two equivalent designs to use \u2014 granular implementation calls the human can see and reverse in a line
|
|
50003
|
-
of code. (A bug you merely NOTICED is
|
|
50004
|
-
|
|
50049
|
+
of code. (A bug you merely NOTICED is the exception: it lies past your mandate, so you OFFER it rather
|
|
50050
|
+
than fix it, because widening the scope is the human's call.) **"Run it now, or leave it for the human?" is never a question:** a safe, reversible command that
|
|
50005
50051
|
fixes what you found \u2014 an install, a rebuild, a cache clear, a restart of a process you own \u2014 is run
|
|
50006
50052
|
and reported, not offered. Only the ACT behind a command can earn a card (destructive, irreversible,
|
|
50007
50053
|
outside your boundary), and then the question is whether the thing happens, never who types it.
|
|
@@ -50539,22 +50585,24 @@ lands on another card and never reaches you. Use \`spawn-thread\` ONLY for a dis
|
|
|
50539
50585
|
effort that deserves its own card and whose output you do not need.
|
|
50540
50586
|
|
|
50541
50587
|
Give it a self-contained prompt (\`--prompt-file\`) and choose \`--model\` + \`--effort\` by the new task's complexity (both
|
|
50542
|
-
required
|
|
50588
|
+
required for Claude and Codex; \`--effort\` is optional for Antigravity, OpenCode and ACP agents). Pass
|
|
50589
|
+
\`--backend claude|codex|antigravity|opencode|acp\` to choose the harness (default \`claude\`; run \`frizzctl models\`
|
|
50590
|
+
to list available backends, ACP agents, models and efforts). It starts on YOUR project's board; \`--project <slug>\` (the slug that project's board URL
|
|
50543
50591
|
shows) starts it on another project's board instead, in that repo's checkout. It prints a
|
|
50544
50592
|
\`[title](/thread/<slug>)\` link, or \`[title](/project/<slug>/thread/<slug>)\` for another project \u2014 put that
|
|
50545
50593
|
in your handoff so the human can open it.
|
|
50546
50594
|
|
|
50547
50595
|
**It is the LAST resort among the exits, never the tidy one.** A finding you turned up is not by itself a
|
|
50548
50596
|
reason to spawn: the ordered exits put DOING it (with a sub-agent, whose result comes back to you) first
|
|
50549
|
-
and
|
|
50597
|
+
and OFFERING it second, precisely because both keep the work reachable. A spawned thread does not \u2014 it reports
|
|
50550
50598
|
to the HUMAN and nothing it learns returns to you or to its siblings unless someone steers it across, so a
|
|
50551
50599
|
chain of them re-derives the same facts in parallel and nobody notices. Spawn only when the work genuinely
|
|
50552
50600
|
cannot ride on your card, and never merely to clear your own \` \`\`\`done \`. See **When the work is
|
|
50553
50601
|
finished but the thread found more**.`;
|
|
50554
50602
|
CHILD_THREADS = `## Child threads (an experiment the operator switched on)
|
|
50555
50603
|
|
|
50556
|
-
\`frizzctl spawn-child\` starts a CHILD THREAD: a full Frizz thread on your board
|
|
50557
|
-
works for YOU. It runs on its harness's own runtime with the project's skills and instructions, rests like any
|
|
50604
|
+
\`frizzctl spawn-child\` starts a CHILD THREAD: a full Frizz thread on your board \u2014 on Claude Code, Codex,
|
|
50605
|
+
Antigravity, OpenCode or any installed ACP agent \u2014 that works for YOU. It runs on its harness's own runtime with the project's skills and instructions, rests like any
|
|
50558
50606
|
thread, and owns its own watchers. Every rest of its that would have gone to the human \u2014 its \`done\`, a
|
|
50559
50607
|
\`needs_input\` handoff, a stop or a crash \u2014 comes to YOU instead, as a \`<thread-message>\` that wakes you; answer
|
|
50560
50608
|
it, or give it more work, with \`frizzctl steer <slug>\`. It sits under your thread on the board, never in the
|
|
@@ -52338,7 +52386,8 @@ function createDispatcher(deps) {
|
|
|
52338
52386
|
async dispatch(input, opts) {
|
|
52339
52387
|
input = DispatchInput.parse(input);
|
|
52340
52388
|
const settings = deps.getSettings();
|
|
52341
|
-
const
|
|
52389
|
+
const inferredKind = isAntigravityModel(input.model) ? "antigravity" : isOpencodeModel(input.model) ? "opencode" : typeof input.model === "string" && input.model.startsWith(ACP_MODEL_PREFIX) ? "acp" : void 0;
|
|
52390
|
+
const kind = opts?.backend ?? inferredKind ?? "claude";
|
|
52342
52391
|
if (kind !== "acp" && kind !== "opencode" && kind !== "antigravity" && deps.preflightAuth && await deps.preflightAuth(kind).catch(() => "unknown") === "signed-out") {
|
|
52343
52392
|
throw new ProviderAuthRequiredError(kind);
|
|
52344
52393
|
}
|
|
@@ -52425,14 +52474,16 @@ function createDispatcher(deps) {
|
|
|
52425
52474
|
}
|
|
52426
52475
|
if (kind === "acp") {
|
|
52427
52476
|
const bridge = deps.acpBridge;
|
|
52428
|
-
const
|
|
52477
|
+
const rawModel = input.model?.trim();
|
|
52478
|
+
const acpModel = rawModel ? rawModel.startsWith(ACP_MODEL_PREFIX) ? rawModel : `${ACP_MODEL_PREFIX}${rawModel}` : void 0;
|
|
52479
|
+
const agentId = acpAgentIdFromModel(acpModel);
|
|
52429
52480
|
if (!bridge || !agentId) {
|
|
52430
52481
|
cleanupDispatchFiles(scratchRel, { argv: [], env: {}, prewrite: [] }, sessionId);
|
|
52431
|
-
throw new Error(!bridge ? "The ACP bridge is unavailable; cannot start this thread." : `An ACP dispatch needs an agent: pick one in the composer (model \`acp:<agent>\`), got ${JSON.stringify(model ?? null)}.`);
|
|
52482
|
+
throw new Error(!bridge ? "The ACP bridge is unavailable; cannot start this thread." : `An ACP dispatch needs an agent: pick one in the composer (model \`acp:<agent>\`), got ${JSON.stringify(input.model ?? null)}.`);
|
|
52432
52483
|
}
|
|
52433
52484
|
const firstPrompt = [acpWorkerContract(sessionId, deps.project.dir, { childThreads: settings.childThreads }), prompt].filter(Boolean).join("\n\n");
|
|
52434
52485
|
try {
|
|
52435
|
-
const spawned = await bridge.spawnDispatch({ threadSlug: slug, sessionId, cwd: deps.project.dir, agentId, modelId: acpModelIdFromModel(
|
|
52486
|
+
const spawned = await bridge.spawnDispatch({ threadSlug: slug, sessionId, cwd: deps.project.dir, agentId, modelId: acpModelIdFromModel(acpModel), prompt: firstPrompt, userText: input.prompt });
|
|
52436
52487
|
deps.storage.upsertSession({
|
|
52437
52488
|
slug,
|
|
52438
52489
|
session_id: sessionId,
|
|
@@ -52450,7 +52501,7 @@ function createDispatcher(deps) {
|
|
|
52450
52501
|
meta: null,
|
|
52451
52502
|
seen_at: null,
|
|
52452
52503
|
transcript_id: null,
|
|
52453
|
-
model:
|
|
52504
|
+
model: acpModel ?? null,
|
|
52454
52505
|
effort: null,
|
|
52455
52506
|
permission_mode: permissionMode
|
|
52456
52507
|
});
|
|
@@ -52477,7 +52528,12 @@ function createDispatcher(deps) {
|
|
|
52477
52528
|
cleanupDispatchFiles(scratchRel, { argv: [], env: {}, prewrite: [] }, sessionId);
|
|
52478
52529
|
throw new Error("The OpenCode bridge is unavailable; cannot start this thread.");
|
|
52479
52530
|
}
|
|
52480
|
-
const
|
|
52531
|
+
const rawModel = input.model?.trim();
|
|
52532
|
+
let ocModel = rawModel ? isOpencodeModel(rawModel) ? rawModel : `${OPENCODE_MODEL_PREFIX}${rawModel}` : OPENCODE_MODEL_PREFIX;
|
|
52533
|
+
if (input.effort && !ocModel.includes("#") && opencodeModelRef(ocModel)) {
|
|
52534
|
+
ocModel = `${ocModel}#${input.effort}`;
|
|
52535
|
+
}
|
|
52536
|
+
const selected = opencodeModelRef(ocModel);
|
|
52481
52537
|
try {
|
|
52482
52538
|
const spawned = await bridge.spawnDispatch({ threadSlug: slug, sessionId, cwd: deps.project.dir, ...selected ? { model: selected } : {}, mode: opencodeModeOf(permissionMode), prompt });
|
|
52483
52539
|
deps.storage.upsertSession({
|
|
@@ -52497,7 +52553,7 @@ function createDispatcher(deps) {
|
|
|
52497
52553
|
meta: null,
|
|
52498
52554
|
seen_at: null,
|
|
52499
52555
|
transcript_id: null,
|
|
52500
|
-
model:
|
|
52556
|
+
model: ocModel,
|
|
52501
52557
|
effort: null,
|
|
52502
52558
|
permission_mode: permissionMode
|
|
52503
52559
|
});
|
|
@@ -52523,9 +52579,11 @@ function createDispatcher(deps) {
|
|
|
52523
52579
|
cleanupDispatchFiles(scratchRel, { argv: [], env: {}, prewrite: [] }, sessionId);
|
|
52524
52580
|
throw new Error("The Antigravity bridge is unavailable; cannot start this thread.");
|
|
52525
52581
|
}
|
|
52582
|
+
const rawModel = input.model?.trim();
|
|
52583
|
+
const agyModel = rawModel ? isAntigravityModel(rawModel) ? rawModel : antigravityModelSlug(rawModel) : ANTIGRAVITY_MODEL_PREFIX;
|
|
52526
52584
|
const level = input.effort ?? null;
|
|
52527
52585
|
try {
|
|
52528
|
-
const spawned = await bridge.spawnDispatch({ threadSlug: slug, sessionId, cwd: deps.project.dir, modelId: antigravityModelId(
|
|
52586
|
+
const spawned = await bridge.spawnDispatch({ threadSlug: slug, sessionId, cwd: deps.project.dir, modelId: antigravityModelId(agyModel) ?? null, effort: level, permissionMode, prompt, userText: input.prompt });
|
|
52529
52587
|
deps.storage.upsertSession({
|
|
52530
52588
|
slug,
|
|
52531
52589
|
session_id: sessionId,
|
|
@@ -52543,7 +52601,7 @@ function createDispatcher(deps) {
|
|
|
52543
52601
|
meta: null,
|
|
52544
52602
|
seen_at: null,
|
|
52545
52603
|
transcript_id: null,
|
|
52546
|
-
model:
|
|
52604
|
+
model: agyModel,
|
|
52547
52605
|
// What the session actually runs at: the level asked for, or the model's own default.
|
|
52548
52606
|
effort: spawned.effort ?? null,
|
|
52549
52607
|
permission_mode: permissionMode
|
|
@@ -53207,9 +53265,9 @@ function hasParkedPrWatch(tele, registered) {
|
|
|
53207
53265
|
function bgSnoozeArmed(row) {
|
|
53208
53266
|
return row.bg_snooze_rested_at != null && row.rested_at != null && row.bg_snooze_rested_at === row.rested_at;
|
|
53209
53267
|
}
|
|
53210
|
-
function wakesOnItsOwn(row, tele, registeredWatches, armedTimerIds) {
|
|
53268
|
+
function wakesOnItsOwn(row, tele, registeredWatches, armedTimerIds, liveChildren = /* @__PURE__ */ new Set()) {
|
|
53211
53269
|
const goal = Boolean(row.recurring_prompt && row.recurring_armed_at) && (row.recurring_on_rest === 1 || row.recurring_on_schedule === 1);
|
|
53212
|
-
return goal || registeredWatches.size > 0 || armedTimerIds.size > 0 || Boolean(
|
|
53270
|
+
return goal || registeredWatches.size > 0 || armedTimerIds.size > 0 || liveChildren.size > 0 || Boolean(
|
|
53213
53271
|
tele?.subAgents?.some((agent) => isDirectSubAgent(agent) && agent.state === "running") || tele?.bgShells?.some((shell) => shell.state === "running")
|
|
53214
53272
|
);
|
|
53215
53273
|
}
|
|
@@ -53328,7 +53386,7 @@ function deriveNeedsYou(row, tele, runtime, hasActionableInteraction = false, no
|
|
|
53328
53386
|
if (runtime === "exited" && tele?.turn === "in-flight") return true;
|
|
53329
53387
|
if (hasFreshDelivery(row, deliveryProcessGone)) return false;
|
|
53330
53388
|
if (answerInFlight) return false;
|
|
53331
|
-
if (runtime !== "exited" && bgSnoozeArmed(row) && wakesOnItsOwn(row, tele, registeredPrWatches, armedTimerIds)) return false;
|
|
53389
|
+
if (runtime !== "exited" && bgSnoozeArmed(row) && wakesOnItsOwn(row, tele, registeredPrWatches, armedTimerIds, liveChildren)) return false;
|
|
53332
53390
|
if (tele?.providerError && !tele.providerError.retrying) return true;
|
|
53333
53391
|
if (tele?.pendingQuestion) return true;
|
|
53334
53392
|
if (openQuestions > 0) return true;
|
|
@@ -53393,11 +53451,11 @@ function deriveAwaitingBackground(row, tele, runtime, hasActionableInteraction =
|
|
|
53393
53451
|
!hasHumanSteps(tele)) return false;
|
|
53394
53452
|
return deriveNeedsYou({ ...row, bg_snooze_rested_at: null }, tele, runtime, hasActionableInteraction, nowMs, limitPause, false, deliveryProcessGone, {}, /* @__PURE__ */ new Set(), armedTimerIds, armedWatches);
|
|
53395
53453
|
}
|
|
53396
|
-
function deriveWaitStatus(tele, runtime, needsYou, awaitingBackground, messageInFlight, nowMs, github = {}, registeredPrWatches = /* @__PURE__ */ new Set(), armedWatches = []) {
|
|
53454
|
+
function deriveWaitStatus(tele, runtime, needsYou, awaitingBackground, messageInFlight, nowMs, github = {}, registeredPrWatches = /* @__PURE__ */ new Set(), armedWatches = [], liveChildren = /* @__PURE__ */ new Set()) {
|
|
53397
53455
|
if (runtime !== "turn-idle" || needsYou || messageInFlight) return void 0;
|
|
53398
|
-
const liveChild = hasLiveBackgroundWork(tele);
|
|
53399
|
-
if (!awaitingBackground && !liveChild) return void 0;
|
|
53400
53456
|
const fence = tele?.lastFence?.kind === "awaiting" ? tele.lastFence : void 0;
|
|
53457
|
+
const liveChild = hasLiveBackgroundWork(tele) || readAwaitingPark(fence?.hints ?? []).items.some((i) => i.kind === "thread" && liveChildren.has(i.value));
|
|
53458
|
+
if (!awaitingBackground && !liveChild) return void 0;
|
|
53401
53459
|
const declared = fence ? awaitingStatus(fence.hints) : null;
|
|
53402
53460
|
if (declared === "needs_input") return void 0;
|
|
53403
53461
|
if (declared === "watching") return "watching";
|
|
@@ -53631,7 +53689,7 @@ function sessionThreadView(projectDir, storage, row, rawTele, registeredLegacyTe
|
|
|
53631
53689
|
const needsYou = queuesForHuman && !handoffToParent;
|
|
53632
53690
|
const deliveryInFlight = !archived && deriveDeliveryInFlight(row, runtime, needsYou, deliveryProcessGone, answerInFlight, nowMs);
|
|
53633
53691
|
const awaitingBackground = archived ? false : deriveAwaitingBackground(row, tele, runtime, interactionPresence.needsUser, nowMs, limitPause, deliveryProcessGone, github, registeredPrWatches, armedTimerIds, armedWatches);
|
|
53634
|
-
const waitStatus = archived ? void 0 : deriveWaitStatus(tele, runtime, needsYou, awaitingBackground, answerInFlight || hasFreshDelivery(row, deliveryProcessGone), nowMs, github, registeredPrWatches, armedWatches);
|
|
53692
|
+
const waitStatus = archived ? void 0 : deriveWaitStatus(tele, runtime, needsYou, awaitingBackground, answerInFlight || hasFreshDelivery(row, deliveryProcessGone), nowMs, github, registeredPrWatches, armedWatches, liveChildren);
|
|
53635
53693
|
const crashed = runtime === "exited" && (tele?.turn === "in-flight" || hasLiveBackgroundWork(tele) || headlessLostWork);
|
|
53636
53694
|
const plainReport = derivePlainReport({
|
|
53637
53695
|
needsYou,
|
|
@@ -53704,8 +53762,6 @@ function sessionThreadView(projectDir, storage, row, rawTele, registeredLegacyTe
|
|
|
53704
53762
|
answersInFlight: inFlightAnswers,
|
|
53705
53763
|
deliveryInFlight: deliveryInFlight || void 0,
|
|
53706
53764
|
lastUserAt: tele?.lastUserAt,
|
|
53707
|
-
// The last turn ended on a person's Stop (FoldState.operatorStopped): no "Rested without a sign-off".
|
|
53708
|
-
...tele?.operatorStopped ? { operatorStopped: true } : {},
|
|
53709
53765
|
// Runtime provider-auth rejection (claude-auth plan): only the typed category travels — the raw
|
|
53710
53766
|
// error/provider text never leaves the server. Drives the trusted sign-in recovery card in ChatView.
|
|
53711
53767
|
providerFault: tele?.authFault ? { backend: row.backend === "codex" ? "codex" : "claude", category: tele.authFault } : void 0,
|
|
@@ -53730,6 +53786,7 @@ function sessionThreadView(projectDir, storage, row, rawTele, registeredLegacyTe
|
|
|
53730
53786
|
snoozePrompt: snoozedUntil ? row.snooze_prompt ?? void 0 : void 0,
|
|
53731
53787
|
pinnedAt: row.pinned_at ?? void 0,
|
|
53732
53788
|
consolePinnedAt: row.console_pinned_at ?? void 0,
|
|
53789
|
+
leavePinned: row.leave_pinned_at ? true : void 0,
|
|
53733
53790
|
parentSlug,
|
|
53734
53791
|
handoffToParent: handoffToParent ? true : void 0,
|
|
53735
53792
|
handoffRestAt: handoffToParent ? tele?.lastAssistantAt : void 0,
|
|
@@ -53739,7 +53796,7 @@ function sessionThreadView(projectDir, storage, row, rawTele, registeredLegacyTe
|
|
|
53739
53796
|
bgSnoozed: bgSnoozeArmed(row) || void 0,
|
|
53740
53797
|
// Whether "Until activity" can be offered: see wakesOnItsOwn. False on a dead worker and on an archived
|
|
53741
53798
|
// thread, which nothing wakes.
|
|
53742
|
-
wakesOnItsOwn: !archived && runtime !== "exited" && wakesOnItsOwn(row, tele, registeredPrWatches, armedTimerIds) || void 0,
|
|
53799
|
+
wakesOnItsOwn: !archived && runtime !== "exited" && wakesOnItsOwn(row, tele, registeredPrWatches, armedTimerIds, liveChildren) || void 0,
|
|
53743
53800
|
// Only where the handoff is what queued it: the park would otherwise have held (QueuedBy).
|
|
53744
53801
|
heldHandoff: queuedBy.heldHandoff || void 0,
|
|
53745
53802
|
claudeRuntime: row.claude_runtime === "broker" ? "broker" : void 0,
|
|
@@ -56354,7 +56411,6 @@ function createScheduler(deps) {
|
|
|
56354
56411
|
if (tele.restFromAt && Date.parse(tele.restFromAt) >= Date.parse(spokeAt)) continue;
|
|
56355
56412
|
if (tele.authFault) continue;
|
|
56356
56413
|
if (tele.apiFault) continue;
|
|
56357
|
-
if (tele.operatorStopped) continue;
|
|
56358
56414
|
const needsInput = needsInputRequired(row.spawned_at);
|
|
56359
56415
|
const questionRows = deps.storage.listThreadQuestions(row.slug);
|
|
56360
56416
|
const standing = standingQuestions(questionRows, tele, deps.questionFaults?.of(row.slug));
|
|
@@ -58665,8 +58721,14 @@ function antigravityToolCalls(path5) {
|
|
|
58665
58721
|
}
|
|
58666
58722
|
return { settled, open: [...open.values()].map(({ turn: madeIn, ...call }) => ({ ...call, inOpenTurn: turnOpen && madeIn === turn })) };
|
|
58667
58723
|
}
|
|
58724
|
+
function cleanAntigravityReasoning(text2) {
|
|
58725
|
+
return text2.replace(/\r\n?/g, "\n").split("\n").filter((line) => !ANTIGRAVITY_REASONING_FILLER.test(line.trim())).join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
58726
|
+
}
|
|
58668
58727
|
function projectAntigravityTranscript(raw2, identityPrefix, buildCards, userProjector) {
|
|
58669
|
-
return projectAcpTranscript(raw2, identityPrefix, userProjector,
|
|
58728
|
+
return projectAcpTranscript(raw2, identityPrefix, userProjector, {
|
|
58729
|
+
...frizzToolDialect(buildCards),
|
|
58730
|
+
reasoning: (text2) => cleanAntigravityReasoning(text2) || null
|
|
58731
|
+
});
|
|
58670
58732
|
}
|
|
58671
58733
|
function readAntigravityTranscriptFile(absPath, buildCards, nativeId = absPath, userProjector) {
|
|
58672
58734
|
try {
|
|
@@ -58675,7 +58737,7 @@ function readAntigravityTranscriptFile(absPath, buildCards, nativeId = absPath,
|
|
|
58675
58737
|
return [];
|
|
58676
58738
|
}
|
|
58677
58739
|
}
|
|
58678
|
-
var ANTIGRAVITY_TRANSCRIPT_DIR;
|
|
58740
|
+
var ANTIGRAVITY_TRANSCRIPT_DIR, ANTIGRAVITY_REASONING_FILLER;
|
|
58679
58741
|
var init_antigravity_transcript = __esm({
|
|
58680
58742
|
"packages/server/src/backend/antigravity-transcript.ts"() {
|
|
58681
58743
|
"use strict";
|
|
@@ -58683,6 +58745,7 @@ var init_antigravity_transcript = __esm({
|
|
|
58683
58745
|
init_acp_transcript();
|
|
58684
58746
|
init_opencode_transcript();
|
|
58685
58747
|
ANTIGRAVITY_TRANSCRIPT_DIR = "antigravity";
|
|
58748
|
+
ANTIGRAVITY_REASONING_FILLER = /^I['’]m thinking through how to approach this\.?$/i;
|
|
58686
58749
|
}
|
|
58687
58750
|
});
|
|
58688
58751
|
|
|
@@ -62338,9 +62401,6 @@ var init_opencode_bridge = __esm({
|
|
|
62338
62401
|
turnOpen = false;
|
|
62339
62402
|
/** The last finished step stopped on its own: a user message delivered now starts a new turn. */
|
|
62340
62403
|
lastStepStopped = false;
|
|
62341
|
-
/** A person pressed Stop on this turn (interruptTurn): the turn's end is written as theirs, which keeps
|
|
62342
|
-
* the sign-off reminder and the "Rested without a sign-off" card off it (FoldState.operatorStopped). */
|
|
62343
|
-
stopRequested = false;
|
|
62344
62404
|
textWritten = /* @__PURE__ */ new Map();
|
|
62345
62405
|
reasoningSeen = /* @__PURE__ */ new Set();
|
|
62346
62406
|
toolNames = /* @__PURE__ */ new Map();
|
|
@@ -62529,7 +62589,6 @@ ${e8.message}` : e8.message;
|
|
|
62529
62589
|
this.lastError = void 0;
|
|
62530
62590
|
this.turnOpen = true;
|
|
62531
62591
|
this.lastStepStopped = false;
|
|
62532
|
-
this.stopRequested = false;
|
|
62533
62592
|
this.writer.append({ kind: "turn-start", at: at2 });
|
|
62534
62593
|
}
|
|
62535
62594
|
closeTurn(successful, at2) {
|
|
@@ -62545,9 +62604,7 @@ ${e8.message}` : e8.message;
|
|
|
62545
62604
|
this.finalText = "";
|
|
62546
62605
|
this.finalMessage = void 0;
|
|
62547
62606
|
this.lastStepStopped = false;
|
|
62548
|
-
|
|
62549
|
-
this.stopRequested = false;
|
|
62550
|
-
this.writer.append({ kind: "turn-end", at: at2, ...finalText ? { finalText } : {}, successful, ...stopped ? { stoppedBy: "operator" } : {} });
|
|
62607
|
+
this.writer.append({ kind: "turn-end", at: at2, ...finalText ? { finalText } : {}, successful });
|
|
62551
62608
|
this.hooks.onTurnClosed?.(this);
|
|
62552
62609
|
}
|
|
62553
62610
|
deliverUser(inboxId, eventText, at2) {
|
|
@@ -63443,22 +63500,12 @@ ${input.text}` : input.text, delivery: input.delivery }, live2.cwd);
|
|
|
63443
63500
|
return { opencodeSessionId: live2.opencodeId, state: delivered ? "delivered" : "queued" };
|
|
63444
63501
|
}
|
|
63445
63502
|
/** Stop the running turn. Pending input stays in the inbox and goes out, as on every other backend. */
|
|
63446
|
-
async interruptTurn(threadSlug, sessionId
|
|
63503
|
+
async interruptTurn(threadSlug, sessionId) {
|
|
63447
63504
|
const live2 = this.sessions.get(sessionId);
|
|
63448
|
-
if (live2
|
|
63449
|
-
const id2 = live2?.opencodeId ?? opencodeSessionId;
|
|
63450
|
-
if (!id2) return { interrupted: false };
|
|
63451
|
-
if (live2 && !live2.stream.turnOpen) return { interrupted: false };
|
|
63505
|
+
if (!live2 || live2.slug !== threadSlug || !live2.stream.turnOpen) return { interrupted: false };
|
|
63452
63506
|
const client = this.hub.client ?? await this.connect();
|
|
63453
|
-
const
|
|
63454
|
-
|
|
63455
|
-
if (live2) live2.stream.stopRequested = true;
|
|
63456
|
-
try {
|
|
63457
|
-
await client.interrupt(id2, { resume: pending.length > 0, ...directory ? { directory } : {} });
|
|
63458
|
-
} catch (error) {
|
|
63459
|
-
if (live2) live2.stream.stopRequested = false;
|
|
63460
|
-
throw error;
|
|
63461
|
-
}
|
|
63507
|
+
const pending = await client.inbox(live2.opencodeId, live2.cwd).catch(() => []);
|
|
63508
|
+
await client.interrupt(live2.opencodeId, { resume: pending.length > 0, directory: live2.cwd });
|
|
63462
63509
|
return { interrupted: true };
|
|
63463
63510
|
}
|
|
63464
63511
|
/** Stop this runtime tracking a session and stop its turn. The session stays in OpenCode, where the
|
|
@@ -104684,7 +104731,8 @@ function completionConfirmationHold(telemetry) {
|
|
|
104684
104731
|
function holdOps(ops) {
|
|
104685
104732
|
return ops.slice(0, HOLD_OPS_MAX).map((op) => ({
|
|
104686
104733
|
label: op.label.trim().slice(0, HOLD_LABEL_MAX) || "(unnamed)",
|
|
104687
|
-
state: op.state
|
|
104734
|
+
state: op.state,
|
|
104735
|
+
...op.startedAt ? { startedAt: op.startedAt } : {}
|
|
104688
104736
|
}));
|
|
104689
104737
|
}
|
|
104690
104738
|
function cutOffHold(telemetry) {
|
|
@@ -104932,22 +104980,142 @@ function createRouter(ctx) {
|
|
|
104932
104980
|
const mode = PermissionMode.safeParse(row.permission_pending ?? row.permission_mode);
|
|
104933
104981
|
return { backend: row.backend ?? "claude", ...mode.success ? { permissionMode: mode.data } : {} };
|
|
104934
104982
|
}
|
|
104983
|
+
function prefixedBackendOf(model) {
|
|
104984
|
+
if (isAntigravityModel(model)) return "antigravity";
|
|
104985
|
+
if (isOpencodeModel(model)) return "opencode";
|
|
104986
|
+
if (typeof model === "string" && model.startsWith(ACP_MODEL_PREFIX)) return "acp";
|
|
104987
|
+
return void 0;
|
|
104988
|
+
}
|
|
104989
|
+
function resolveSpawnTarget(input) {
|
|
104990
|
+
const prefixed = prefixedBackendOf(input.model);
|
|
104991
|
+
if (input.backend && prefixed && input.backend !== prefixed) {
|
|
104992
|
+
throw new RpcRefusal(`model \`${input.model}\` is a \`${prefixed}\` model slug and cannot be used with backend \`${input.backend}\`. Pass \`--backend ${prefixed}\` (or omit \`--backend\`)`);
|
|
104993
|
+
}
|
|
104994
|
+
const inferred = !input.backend ? prefixed : void 0;
|
|
104995
|
+
const backend = input.backend ?? inferred ?? "claude";
|
|
104996
|
+
const dispatchBackend = input.backend ?? inferred;
|
|
104997
|
+
if (backend === "antigravity") {
|
|
104998
|
+
const raw2 = input.model?.trim();
|
|
104999
|
+
const model = raw2 ? isAntigravityModel(raw2) ? raw2 : antigravityModelSlug(raw2) : ANTIGRAVITY_MODEL_PREFIX;
|
|
105000
|
+
return { backend, dispatchBackend: "antigravity", model };
|
|
105001
|
+
}
|
|
105002
|
+
if (backend === "opencode") {
|
|
105003
|
+
const raw2 = input.model?.trim();
|
|
105004
|
+
let model = raw2 ? isOpencodeModel(raw2) ? raw2 : `${OPENCODE_MODEL_PREFIX}${raw2}` : OPENCODE_MODEL_PREFIX;
|
|
105005
|
+
if (model !== OPENCODE_MODEL_PREFIX) {
|
|
105006
|
+
const ref = opencodeModelRef(model);
|
|
105007
|
+
if (!ref) {
|
|
105008
|
+
throw new RpcRefusal(`OpenCode model \`${raw2}\` must be \`<provider>/<id>\` (or \`opencode:\` for the default). Run \`frizzctl models opencode\` to list available models`);
|
|
105009
|
+
}
|
|
105010
|
+
if (input.effort) {
|
|
105011
|
+
if (ref.variant && ref.variant !== input.effort) {
|
|
105012
|
+
throw new RpcRefusal(`OpenCode model \`${model}\` already specifies variant \`${ref.variant}\`, which disagrees with \`--effort ${input.effort}\`. Give one`);
|
|
105013
|
+
}
|
|
105014
|
+
if (!ref.variant) model = `${model}#${input.effort}`;
|
|
105015
|
+
}
|
|
105016
|
+
}
|
|
105017
|
+
return { backend, dispatchBackend: "opencode", model };
|
|
105018
|
+
}
|
|
105019
|
+
if (backend === "acp") {
|
|
105020
|
+
const raw2 = input.model?.trim();
|
|
105021
|
+
const model = raw2 ? raw2.startsWith(ACP_MODEL_PREFIX) ? raw2 : `${ACP_MODEL_PREFIX}${raw2}` : "";
|
|
105022
|
+
if (!acpAgentIdFromModel(model)) {
|
|
105023
|
+
const installed = listAcpAgents(ctx.getSettings().acpAgents).filter((a) => a.bin).map((a) => `\`${a.id}\``);
|
|
105024
|
+
const hint = installed.length ? ` Installed agents: ${installed.join(", ")}.` : "";
|
|
105025
|
+
throw new RpcRefusal(`an ACP spawn needs an agent id (\`acp:<agent>\` or \`acp:<agent>@<model>\`).${hint} Run \`frizzctl models acp\` to list agents`);
|
|
105026
|
+
}
|
|
105027
|
+
return { backend, dispatchBackend: "acp", model };
|
|
105028
|
+
}
|
|
105029
|
+
return { backend, dispatchBackend, model: input.model };
|
|
105030
|
+
}
|
|
105031
|
+
async function validateSpawnTarget(backend, model, effort) {
|
|
105032
|
+
if (backend === "antigravity") {
|
|
105033
|
+
if (!ctx.antigravityBridge) return;
|
|
105034
|
+
const catalogue = await ctx.antigravityBridge.models(ctx.project.dir);
|
|
105035
|
+
if (!catalogue.available) {
|
|
105036
|
+
throw new RpcRefusal(catalogue.error ?? "Antigravity is not installed on this machine (`agy` is not on PATH)");
|
|
105037
|
+
}
|
|
105038
|
+
if (catalogue.error && catalogue.models.length === 0) {
|
|
105039
|
+
throw new RpcRefusal(catalogue.error);
|
|
105040
|
+
}
|
|
105041
|
+
const modelId = antigravityModelId(model);
|
|
105042
|
+
if (!modelId || catalogue.models.length === 0) return;
|
|
105043
|
+
const entry = catalogue.models.find((m) => m.id === modelId);
|
|
105044
|
+
if (!entry) {
|
|
105045
|
+
const available = catalogue.models.map((m) => m.efforts.length ? `\`${m.id}\` (${m.efforts.join("/")})` : `\`${m.id}\``).join(", ");
|
|
105046
|
+
throw new RpcRefusal(`Antigravity does not offer model \`${modelId}\` on this account. Available models: ${available}. Run \`frizzctl models antigravity\` for details`);
|
|
105047
|
+
}
|
|
105048
|
+
if (effort && entry.efforts.length > 0 && !entry.efforts.includes(effort)) {
|
|
105049
|
+
const def = entry.defaultEffort ? ` (default: ${entry.defaultEffort})` : "";
|
|
105050
|
+
throw new RpcRefusal(`Antigravity model \`${modelId}\` does not accept effort \`${effort}\`. Supported efforts: ${entry.efforts.join(", ")}${def}`);
|
|
105051
|
+
}
|
|
105052
|
+
return;
|
|
105053
|
+
}
|
|
105054
|
+
if (backend === "acp") {
|
|
105055
|
+
const agentId = acpAgentIdFromModel(model);
|
|
105056
|
+
if (!agentId) return;
|
|
105057
|
+
const custom2 = ctx.getSettings().acpAgents;
|
|
105058
|
+
const spec = resolveAcpAgent(agentId, custom2);
|
|
105059
|
+
if (!spec) {
|
|
105060
|
+
const known = listAcpAgents(custom2).map((a) => `\`${a.id}\`${a.bin ? " (installed)" : ""}`).join(", ");
|
|
105061
|
+
throw new RpcRefusal(`unknown ACP agent \`${agentId}\`. Known agents: ${known}. Run \`frizzctl models acp\` to see what is installed`);
|
|
105062
|
+
}
|
|
105063
|
+
if (!spec.bin) {
|
|
105064
|
+
const installed = listAcpAgents(custom2).filter((a) => a.bin).map((a) => `\`${a.id}\``);
|
|
105065
|
+
const others = installed.length ? ` Installed ACP agents: ${installed.join(", ")}.` : "";
|
|
105066
|
+
throw new RpcRefusal(`ACP agent "${spec.label}" is not installed (\`${spec.command}\` is not on PATH).${others} Run \`frizzctl models acp\` to see what is installed`);
|
|
105067
|
+
}
|
|
105068
|
+
const modelId = acpModelIdFromModel(model);
|
|
105069
|
+
if (modelId && ctx.acpBridge) {
|
|
105070
|
+
const catalogue = await ctx.acpBridge.agentModels(agentId, ctx.project.dir);
|
|
105071
|
+
if (catalogue.models.length > 0 && !catalogue.models.some((m) => m.id === modelId)) {
|
|
105072
|
+
const available = catalogue.models.slice(0, 12).map((m) => `\`${m.id}\``).join(", ");
|
|
105073
|
+
const more = catalogue.models.length > 12 ? ` (+${catalogue.models.length - 12} more)` : "";
|
|
105074
|
+
throw new RpcRefusal(`ACP agent \`${agentId}\` does not advertise model \`${modelId}\`. Available models: ${available}${more}. Run \`frizzctl models acp:${agentId}\` for the full list`);
|
|
105075
|
+
}
|
|
105076
|
+
}
|
|
105077
|
+
return;
|
|
105078
|
+
}
|
|
105079
|
+
if (backend === "opencode") {
|
|
105080
|
+
if (!ctx.opencodeBridge) return;
|
|
105081
|
+
const catalogue = await ctx.opencodeBridge.models(ctx.project.dir);
|
|
105082
|
+
if (!catalogue.available) {
|
|
105083
|
+
throw new RpcRefusal(catalogue.error ?? "OpenCode is not installed on this machine (or is below the native minimum version)");
|
|
105084
|
+
}
|
|
105085
|
+
if (catalogue.error && catalogue.models.length === 0) {
|
|
105086
|
+
throw new RpcRefusal(catalogue.error);
|
|
105087
|
+
}
|
|
105088
|
+
const ref = opencodeModelRef(model);
|
|
105089
|
+
if (!ref || catalogue.models.length === 0) return;
|
|
105090
|
+
const entry = catalogue.models.find((m) => m.providerID === ref.providerID && m.id === ref.id);
|
|
105091
|
+
if (!entry) {
|
|
105092
|
+
const sample2 = catalogue.models.slice(0, 10).map((m) => `\`${m.providerID}/${m.id}\``).join(", ");
|
|
105093
|
+
const more = catalogue.models.length > 10 ? ` (+${catalogue.models.length - 10} more)` : "";
|
|
105094
|
+
throw new RpcRefusal(`OpenCode does not offer model \`${ref.providerID}/${ref.id}\`. Available: ${sample2}${more}. Run \`frizzctl models opencode\` for the full list`);
|
|
105095
|
+
}
|
|
105096
|
+
if (ref.variant && entry.variants.length > 0 && !entry.variants.includes(ref.variant)) {
|
|
105097
|
+
throw new RpcRefusal(`OpenCode model \`${ref.providerID}/${ref.id}\` does not accept variant \`${ref.variant}\`. Supported variants: ${entry.variants.join(", ")}`);
|
|
105098
|
+
}
|
|
105099
|
+
}
|
|
105100
|
+
}
|
|
104935
105101
|
function spawnForThread({ from, input, spawner }) {
|
|
104936
|
-
const
|
|
105102
|
+
const inferred = prefixedBackendOf(input.model);
|
|
105103
|
+
const resolvedBackend = input.backend ?? inferred ?? "claude";
|
|
105104
|
+
const permissionMode = spawnedThreadPermission(resolvedBackend, spawner, ctx.getSettings());
|
|
104937
105105
|
return audit(
|
|
104938
105106
|
"dispatch",
|
|
104939
105107
|
{
|
|
104940
105108
|
project: thisProject,
|
|
104941
105109
|
detail: {
|
|
104942
105110
|
prompt: textDigest(input.prompt),
|
|
104943
|
-
backend:
|
|
105111
|
+
backend: resolvedBackend,
|
|
104944
105112
|
model: input.model ?? null,
|
|
104945
105113
|
effort: input.effort ?? null,
|
|
104946
105114
|
spawnedBy: { thread: from.slug, ...from.project ? { project: from.project } : {} },
|
|
104947
105115
|
permissionMode
|
|
104948
105116
|
}
|
|
104949
105117
|
},
|
|
104950
|
-
() => ctx.dispatcher.dispatch(input, { backend: input.backend, permissionMode }),
|
|
105118
|
+
() => ctx.dispatcher.dispatch(input, { backend: input.backend ?? inferred, permissionMode }),
|
|
104951
105119
|
(result) => ({ thread: result.slug, detail: { sessionId: result.sessionId } })
|
|
104952
105120
|
);
|
|
104953
105121
|
}
|
|
@@ -106235,15 +106403,19 @@ ${gapNote}` : input.message;
|
|
|
106235
106403
|
// Omitted ⇒ the dispatcher defaults to "claude", so an old client (no backend field) is
|
|
106236
106404
|
// byte-identical. The resume path needs NO analog — resume reads the backend from the row's
|
|
106237
106405
|
// `backend` column (backendFor(row.backend)), which dispatch already stamped for a codex thread.
|
|
106238
|
-
handler: ({ input }) =>
|
|
106239
|
-
|
|
106240
|
-
|
|
106241
|
-
|
|
106242
|
-
|
|
106243
|
-
|
|
106244
|
-
|
|
106245
|
-
|
|
106246
|
-
|
|
106406
|
+
handler: ({ input }) => {
|
|
106407
|
+
const inferred = prefixedBackendOf(input.model);
|
|
106408
|
+
const backend = input.backend ?? inferred ?? "claude";
|
|
106409
|
+
return audit(
|
|
106410
|
+
"dispatch",
|
|
106411
|
+
{
|
|
106412
|
+
project: thisProject,
|
|
106413
|
+
detail: { prompt: textDigest(input.prompt), backend, model: input.model ?? null, effort: input.effort ?? null }
|
|
106414
|
+
},
|
|
106415
|
+
() => ctx.dispatcher.dispatch(input, { backend: input.backend ?? inferred }),
|
|
106416
|
+
(result) => ({ thread: result.slug, detail: { sessionId: result.sessionId, permissionMode: ctx.storage.getSession(result.slug)?.permission_mode ?? null } })
|
|
106417
|
+
);
|
|
106418
|
+
}
|
|
106247
106419
|
}),
|
|
106248
106420
|
// Cold-adopt a pre-existing thread (no session row): spawn a fresh worker on its file.
|
|
106249
106421
|
adoptThread: mutation({
|
|
@@ -106337,29 +106509,39 @@ ${gapNote}` : input.message;
|
|
|
106337
106509
|
spawnThread: mutation({
|
|
106338
106510
|
input: SpawnThreadInput,
|
|
106339
106511
|
output: SpawnThreadResult,
|
|
106340
|
-
handler: ({ input }) =>
|
|
106341
|
-
|
|
106342
|
-
|
|
106343
|
-
|
|
106344
|
-
|
|
106345
|
-
|
|
106346
|
-
|
|
106347
|
-
|
|
106348
|
-
|
|
106349
|
-
|
|
106350
|
-
|
|
106351
|
-
|
|
106352
|
-
|
|
106353
|
-
|
|
106354
|
-
|
|
106355
|
-
|
|
106356
|
-
|
|
106357
|
-
|
|
106358
|
-
|
|
106359
|
-
|
|
106360
|
-
|
|
106361
|
-
|
|
106362
|
-
|
|
106512
|
+
handler: ({ input }) => {
|
|
106513
|
+
const auditBackend = input.backend ?? prefixedBackendOf(input.model) ?? "claude";
|
|
106514
|
+
return audit("spawnThread", {
|
|
106515
|
+
project: thisProject,
|
|
106516
|
+
thread: input.from,
|
|
106517
|
+
detail: { ...input.project ? { toProject: input.project } : {}, prompt: textDigest(input.prompt), backend: auditBackend, model: input.model ?? null, effort: input.effort ?? null }
|
|
106518
|
+
}, async () => {
|
|
106519
|
+
const sender = ctx.storage.getSession(input.from);
|
|
106520
|
+
if (!sender) throw new RpcRefusal(`the calling thread ${input.from} is not registered in this project`);
|
|
106521
|
+
const target = resolveSpawnTarget(input);
|
|
106522
|
+
await validateSpawnTarget(target.backend, target.model, input.effort);
|
|
106523
|
+
const named = input.project ? findProjectBySegment(input.project) : void 0;
|
|
106524
|
+
if (named && named.id !== ctx.project.id && !otherOpenProjects().some((open2) => open2.project.id === named.id)) {
|
|
106525
|
+
await ctx.openProject?.(named.id);
|
|
106526
|
+
}
|
|
106527
|
+
const open = input.project ? openProjectNamed(input.project, "no thread can be started there from here") : void 0;
|
|
106528
|
+
if (open && !open.threadSpawner) {
|
|
106529
|
+
throw new RpcRefusal(`project \`${projectSlugOf(open.project.id)}\` is open in Frizz but not taking new threads yet; retry in a moment`);
|
|
106530
|
+
}
|
|
106531
|
+
const from = { slug: sender.slug, title: threadTitleOf(sender), ...open ? { project: projectSlugOf(ctx.project.id) } : {} };
|
|
106532
|
+
const { from: _from, project: _project, ...rest } = input;
|
|
106533
|
+
const dispatch = {
|
|
106534
|
+
...rest,
|
|
106535
|
+
...target.dispatchBackend !== void 0 ? { backend: target.dispatchBackend } : {},
|
|
106536
|
+
...target.model !== void 0 ? { model: target.model } : {},
|
|
106537
|
+
prompt: input.prompt + spawnedThreadFooter(from)
|
|
106538
|
+
};
|
|
106539
|
+
const spawner = threadPermissionOf(sender);
|
|
106540
|
+
if (!open) return spawnForThread({ from, input: dispatch, spawner });
|
|
106541
|
+
const made = await open.threadSpawner({ from, input: dispatch, spawner });
|
|
106542
|
+
return { ...made, project: projectSlugOf(open.project.id) };
|
|
106543
|
+
}, (result) => ({ detail: { spawned: result.slug, ...result.project ? { spawnedIn: result.project } : {} } }));
|
|
106544
|
+
}
|
|
106363
106545
|
}),
|
|
106364
106546
|
// CHILD THREADS — `frizzctl spawn-child` (Settings.childThreads, 2026-11-04). A new thread on THIS board,
|
|
106365
106547
|
// dispatched exactly as any thread is (so it runs on its harness's own runtime, with the project's
|
|
@@ -106375,29 +106557,39 @@ ${gapNote}` : input.message;
|
|
|
106375
106557
|
spawnChild: mutation({
|
|
106376
106558
|
input: SpawnChildInput,
|
|
106377
106559
|
output: SpawnChildResult,
|
|
106378
|
-
handler: ({ input }) =>
|
|
106379
|
-
|
|
106380
|
-
|
|
106381
|
-
|
|
106382
|
-
|
|
106383
|
-
|
|
106384
|
-
|
|
106385
|
-
|
|
106386
|
-
|
|
106387
|
-
|
|
106388
|
-
|
|
106389
|
-
|
|
106390
|
-
|
|
106391
|
-
|
|
106392
|
-
|
|
106393
|
-
|
|
106394
|
-
|
|
106395
|
-
|
|
106396
|
-
|
|
106397
|
-
|
|
106398
|
-
|
|
106399
|
-
|
|
106400
|
-
|
|
106560
|
+
handler: ({ input }) => {
|
|
106561
|
+
const auditBackend = input.backend ?? prefixedBackendOf(input.model) ?? "claude";
|
|
106562
|
+
return audit("spawnChild", {
|
|
106563
|
+
project: thisProject,
|
|
106564
|
+
thread: input.from,
|
|
106565
|
+
detail: { prompt: textDigest(input.prompt), backend: auditBackend, model: input.model ?? null, effort: input.effort ?? null }
|
|
106566
|
+
}, async () => {
|
|
106567
|
+
if (!ctx.getSettings().childThreads) {
|
|
106568
|
+
return { refused: "child threads are an experiment that is switched off on this machine (Settings \u2192 Child threads). Use an in-session sub-agent, or `frizzctl spawn-thread` for separate work" };
|
|
106569
|
+
}
|
|
106570
|
+
const sender = ctx.storage.getSession(input.from);
|
|
106571
|
+
if (!sender) throw new RpcRefusal(`the calling thread ${input.from} is not registered in this project`);
|
|
106572
|
+
if (sender.parent_slug && ctx.storage.getSession(sender.parent_slug)) {
|
|
106573
|
+
return { refused: "this thread is itself a child thread, and children cannot start children of their own. Use an in-session sub-agent, or hand the work back to your parent in your handoff" };
|
|
106574
|
+
}
|
|
106575
|
+
const target = resolveSpawnTarget(input);
|
|
106576
|
+
await validateSpawnTarget(target.backend, target.model, input.effort);
|
|
106577
|
+
const kind = target.backend;
|
|
106578
|
+
const inherited = kind === (sender.backend ?? "claude") ? PermissionMode.safeParse(sender.permission_pending ?? sender.permission_mode) : void 0;
|
|
106579
|
+
const from = { slug: sender.slug, title: threadTitleOf(sender) };
|
|
106580
|
+
const { from: _from, ...rest } = input;
|
|
106581
|
+
const made = await ctx.dispatcher.dispatch(
|
|
106582
|
+
{
|
|
106583
|
+
...rest,
|
|
106584
|
+
...target.dispatchBackend !== void 0 ? { backend: target.dispatchBackend } : {},
|
|
106585
|
+
...target.model !== void 0 ? { model: target.model } : {},
|
|
106586
|
+
prompt: input.prompt + childThreadFooter(from)
|
|
106587
|
+
},
|
|
106588
|
+
{ backend: kind, parentSlug: sender.slug, ...inherited?.success ? { permissionMode: inherited.data } : {} }
|
|
106589
|
+
);
|
|
106590
|
+
return { slug: made.slug, sessionId: made.sessionId };
|
|
106591
|
+
}, (result) => ({ detail: "refused" in result ? { refused: result.refused } : { spawned: result.slug } }));
|
|
106592
|
+
}
|
|
106401
106593
|
}),
|
|
106402
106594
|
// The × on a FAILED send's bubble, and the second half of its Edit (the client has already put the
|
|
106403
106595
|
// words back into the prompt box). The only way a failed entry leaves the ledger by hand — nothing
|
|
@@ -106877,7 +107069,10 @@ ${gapNote}` : input.message;
|
|
|
106877
107069
|
// “Mark as done” stops a resting provider shell and archives in one action. The server—not the
|
|
106878
107070
|
// client—asks for confirmation only when current telemetry shows an executing/ambiguous turn.
|
|
106879
107071
|
completeThread: mutation({
|
|
106880
|
-
|
|
107072
|
+
// `leavePinned`: the human answered "Leave pinned" to the pin question this Done asked, which the
|
|
107073
|
+
// thread remembers once the completion lands (SessionRow.leave_pinned_at), so its next Done asks
|
|
107074
|
+
// nothing.
|
|
107075
|
+
input: external_exports.object({ slug: ThreadSlug, sessionId: external_exports.string().min(1), terminateLive: external_exports.boolean().default(false), leavePinned: external_exports.boolean().optional() }).strict(),
|
|
106881
107076
|
// `hold` rides along only with needsConfirmation:true — it is the evidence the dialog names.
|
|
106882
107077
|
output: external_exports.object({ needsConfirmation: external_exports.boolean(), hold: CompletionHold.optional() }),
|
|
106883
107078
|
handler: async ({ input }) => {
|
|
@@ -106894,6 +107089,7 @@ ${gapNote}` : input.message;
|
|
|
106894
107089
|
ctx.opencodeBridge
|
|
106895
107090
|
);
|
|
106896
107091
|
if (!result.needsConfirmation) {
|
|
107092
|
+
if (input.leavePinned && !row.leave_pinned_at) ctx.storage.setLeavePinnedAt(input.slug, (/* @__PURE__ */ new Date()).toISOString());
|
|
106897
107093
|
ctx.board.refresh();
|
|
106898
107094
|
if (backendUsesAcpTransport(row.backend)) void releaseHeldFollowUps(input.slug);
|
|
106899
107095
|
}
|
|
@@ -108130,31 +108326,6 @@ Say which way you went and why in your write-up, so the human can course-correct
|
|
|
108130
108326
|
return { title: title.trim() };
|
|
108131
108327
|
}
|
|
108132
108328
|
}),
|
|
108133
|
-
// STOP THE TURN, and only the turn: the thread stays where it is, ready for the next message. OpenCode
|
|
108134
|
-
// and Antigravity, the backends whose stop leaves the session open and nothing to reattach.
|
|
108135
|
-
stopThreadTurn: mutation({
|
|
108136
|
-
input: external_exports.object({ slug: ThreadSlug, sessionId: external_exports.string().min(1) }).strict(),
|
|
108137
|
-
output: external_exports.object({ interrupted: external_exports.boolean() }),
|
|
108138
|
-
handler: ({ input }) => audit(
|
|
108139
|
-
"stopThreadTurn",
|
|
108140
|
-
{ project: thisProject, thread: input.slug },
|
|
108141
|
-
async () => {
|
|
108142
|
-
const row = currentOwnedSession(input.slug, input.sessionId);
|
|
108143
|
-
if (!row) throw new Error("This thread is no longer the session this tab is looking at");
|
|
108144
|
-
if (row.backend === "antigravity") {
|
|
108145
|
-
if (!ctx.antigravityBridge) throw new Error("The Antigravity bridge is unavailable; cannot stop this turn");
|
|
108146
|
-
const result2 = await ctx.antigravityBridge.interruptTurn(input.slug, row.session_id);
|
|
108147
|
-
ctx.board.refresh();
|
|
108148
|
-
return result2;
|
|
108149
|
-
}
|
|
108150
|
-
if (row.backend !== "opencode") throw new Error("This thread's runtime has no stop for a single turn");
|
|
108151
|
-
if (!ctx.opencodeBridge) throw new Error("The OpenCode bridge is unavailable; cannot stop this turn");
|
|
108152
|
-
const result = await ctx.opencodeBridge.interruptTurn(input.slug, row.session_id, row.agent_session_id, ctx.project.dir);
|
|
108153
|
-
ctx.board.refresh();
|
|
108154
|
-
return result;
|
|
108155
|
-
}
|
|
108156
|
-
)
|
|
108157
|
-
}),
|
|
108158
108329
|
killAgent: mutation({
|
|
108159
108330
|
input: SlugInput,
|
|
108160
108331
|
handler: async ({ input }) => {
|
|
@@ -109287,7 +109458,6 @@ var init_remote_gate = __esm({
|
|
|
109287
109458
|
opencodeModels: "full",
|
|
109288
109459
|
antigravityModels: "full",
|
|
109289
109460
|
antigravityQuota: "full",
|
|
109290
|
-
stopThreadTurn: "full",
|
|
109291
109461
|
// MCP, provider and GitHub sign-ins.
|
|
109292
109462
|
mcpStatus: "full",
|
|
109293
109463
|
mcpReload: "full",
|