turbollm 1.12.6 → 1.12.7
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/{chunk-4D7DDGNU.js → chunk-UXU6FBYT.js} +5 -1
- package/dist/cli.js +55 -3
- package/dist/code-routes.js +1 -1
- package/dist/code-run-manager.js +1 -1
- package/dist/webdist/assets/{AgentEditPage-83hUJ_yq.js → AgentEditPage-BRPYpq9a.js} +1 -1
- package/dist/webdist/assets/{ChatScreen-B1QzE7QZ.js → ChatScreen-DTTY9wd-.js} +1 -1
- package/dist/webdist/assets/{CodeComposer-C7I5ykvn.js → CodeComposer-DF58g5Mt.js} +1 -1
- package/dist/webdist/assets/{CodeHomeScreen-ZKpbgn7S.js → CodeHomeScreen-BSZgPs3R.js} +1 -1
- package/dist/webdist/assets/{CodeSessionScreen-Ot25EuHL.js → CodeSessionScreen-BTaqnPDG.js} +1 -1
- package/dist/webdist/assets/{CustomizeScreen-COme_lV-.js → CustomizeScreen-JP8QF4R8.js} +1 -1
- package/dist/webdist/assets/{EnginesScreen-BGT8oVOe.js → EnginesScreen-B_KytfmB.js} +2 -2
- package/dist/webdist/assets/{HardwareSection-BQ1HHDGX.js → HardwareSection-DZOpWhB6.js} +1 -1
- package/dist/webdist/assets/ModelDetailDialog-DIksqyCL.js +1 -0
- package/dist/webdist/assets/{ModelLoadMenu-B1925839.js → ModelLoadMenu-CdIcDI1C.js} +1 -1
- package/dist/webdist/assets/{ModelsScreen-Bhna_QQc.js → ModelsScreen-Bo2sUZOB.js} +1 -1
- package/dist/webdist/assets/{OnboardingScreen-DA-e7mgD.js → OnboardingScreen-Ie9u6FL7.js} +1 -1
- package/dist/webdist/assets/{RoutineEditPage-CiRYzGIb.js → RoutineEditPage-BzcrTN_l.js} +1 -1
- package/dist/webdist/assets/{RoutinesPanel-D0CXz1fD.js → RoutinesPanel-Ds40Ioe-.js} +1 -1
- package/dist/webdist/assets/{SettingsScreen-V1RyXQTQ.js → SettingsScreen-UzNxPglH.js} +1 -1
- package/dist/webdist/assets/{SidebarResizeHandle-D01qRHL1.js → SidebarResizeHandle-BLtix_xK.js} +1 -1
- package/dist/webdist/assets/{SkillEditPage-CBPJBxDt.js → SkillEditPage-CXrtjkw8.js} +1 -1
- package/dist/webdist/assets/{ToolApprovalBar-HX3wUiyv.js → ToolApprovalBar-DvCc6Gdx.js} +3 -3
- package/dist/webdist/assets/WorkspaceScreen-B94zkxcQ.js +1 -0
- package/dist/webdist/assets/{abnfDiagram-N423BO3Z-DmDyVjOZ.js → abnfDiagram-N423BO3Z-DPk69JgJ.js} +1 -1
- package/dist/webdist/assets/{agent-api-Dv4kFt_M.js → agent-api-BxmkSoWa.js} +1 -1
- package/dist/webdist/assets/{alert-dialog-CeVkt2LM.js → alert-dialog-DQcboI89.js} +1 -1
- package/dist/webdist/assets/{arc-CGS2bj3o.js → arc-DufH27dI.js} +1 -1
- package/dist/webdist/assets/{architectureDiagram-T3A2C74G-3UBZe_2N.js → architectureDiagram-T3A2C74G-DDLaV5mR.js} +1 -1
- package/dist/webdist/assets/{blockDiagram-VBNYF7ZC-BGZHOIDA.js → blockDiagram-VBNYF7ZC-BO5DH4ib.js} +1 -1
- package/dist/webdist/assets/{c4Diagram-5PPSVZJV-CVr3SBA9.js → c4Diagram-5PPSVZJV-C3TpPVAI.js} +1 -1
- package/dist/webdist/assets/channel-CfnCcXh9.js +1 -0
- package/dist/webdist/assets/{chat-api-CfcKVstJ.js → chat-api-h23XF3XS.js} +1 -1
- package/dist/webdist/assets/{chat-queries-Bs6QY5PQ.js → chat-queries-BzV0kYTY.js} +1 -1
- package/dist/webdist/assets/{chevron-down-CEa7raRZ.js → chevron-down-Dm0voDEL.js} +1 -1
- package/dist/webdist/assets/{chevron-left-0LNFGtRG.js → chevron-left-BY6aqkSe.js} +1 -1
- package/dist/webdist/assets/{chevron-right-DuO7WTV_.js → chevron-right-BqwIVl2b.js} +1 -1
- package/dist/webdist/assets/{chunk-2GRJ4B5K-BYI-LerK.js → chunk-2GRJ4B5K-CAfBhFH0.js} +1 -1
- package/dist/webdist/assets/{chunk-2Q5K7J3B-Dkj_wKAt.js → chunk-2Q5K7J3B-kql4pLAX.js} +1 -1
- package/dist/webdist/assets/{chunk-5RXB4S5H-D51WXISK.js → chunk-5RXB4S5H-C-O-c8HR.js} +1 -1
- package/dist/webdist/assets/{chunk-5VM5RSS4-DMPfjebF.js → chunk-5VM5RSS4-Cr7gNnxK.js} +1 -1
- package/dist/webdist/assets/{chunk-6Q2QTUOP-CBL9afjp.js → chunk-6Q2QTUOP-BiOvy9QL.js} +1 -1
- package/dist/webdist/assets/{chunk-GF5L2VYU-DrjMJ7im.js → chunk-GF5L2VYU-BjpJI4hK.js} +1 -1
- package/dist/webdist/assets/{chunk-JWPE2WC7-D8uoAsSs.js → chunk-JWPE2WC7-tfBlhdpp.js} +1 -1
- package/dist/webdist/assets/{chunk-KBJHAD2P-DXy_zXRD.js → chunk-KBJHAD2P-BwL7MQin.js} +1 -1
- package/dist/webdist/assets/{chunk-RYQCIY6F-BFfWYngV.js → chunk-RYQCIY6F-HkUytFKR.js} +1 -1
- package/dist/webdist/assets/{chunk-XXDRQBXY-LSo4Wwng.js → chunk-XXDRQBXY-Br2UC1Vo.js} +1 -1
- package/dist/webdist/assets/{circle-check-CbP2NbCv.js → circle-check-Z3h__RWH.js} +1 -1
- package/dist/webdist/assets/{circle-x-CORyJhPm.js → circle-x-C8G7K3YQ.js} +1 -1
- package/dist/webdist/assets/classDiagram-JCYQIIEL-B9JcRBfI.js +1 -0
- package/dist/webdist/assets/classDiagram-v2-OCEON4UE-B9JcRBfI.js +1 -0
- package/dist/webdist/assets/{collapsible-DZpLSmdU.js → collapsible-CeSNrOdw.js} +1 -1
- package/dist/webdist/assets/{common-BCP_8FXi.js → common-DzcoqTTp.js} +1 -1
- package/dist/webdist/assets/{cose-bilkent-JH36ORCC-Bg5TawlK.js → cose-bilkent-JH36ORCC-B_EHjq48.js} +1 -1
- package/dist/webdist/assets/{cynefin-VYW2F7L2-BC_4Qgc0.js → cynefin-VYW2F7L2-DYe8__wT.js} +1 -1
- package/dist/webdist/assets/{cynefinDiagram-MW4NZA55-P7PoJnC2.js → cynefinDiagram-MW4NZA55-CpFTlY4Y.js} +1 -1
- package/dist/webdist/assets/{dagre-VZM6K2ZE-evM-NLk2.js → dagre-VZM6K2ZE-Dh-viNvO.js} +1 -1
- package/dist/webdist/assets/{diagram-7IWD3JNH-PAxQ_wr0.js → diagram-7IWD3JNH-BcSJ2PsZ.js} +1 -1
- package/dist/webdist/assets/{diagram-B4RE2ZJO-Bu3fmLib.js → diagram-B4RE2ZJO-0Nk8vrzt.js} +1 -1
- package/dist/webdist/assets/{diagram-LBJQPF4R-Bs_VUWBn.js → diagram-LBJQPF4R-CSFqWH3q.js} +1 -1
- package/dist/webdist/assets/{diagram-Q27KOJAE-Cad84O0g.js → diagram-Q27KOJAE-B_3sIQD0.js} +1 -1
- package/dist/webdist/assets/{diagram-UB23O5K3-D9XevR5W.js → diagram-UB23O5K3-B4L5TvOQ.js} +1 -1
- package/dist/webdist/assets/{dropdown-menu-B3NbEIpW.js → dropdown-menu-B86NIBT-.js} +1 -1
- package/dist/webdist/assets/{ebnfDiagram-BXEA7PRR-CeyZABmQ.js → ebnfDiagram-BXEA7PRR-BeV8Cy8K.js} +1 -1
- package/dist/webdist/assets/{erDiagram-JOGREHBK-BWj7r7f_.js → erDiagram-JOGREHBK-CO8ynmd8.js} +1 -1
- package/dist/webdist/assets/{external-link-C-heG_eP.js → external-link-DQjSoFRG.js} +1 -1
- package/dist/webdist/assets/{file-text-BviBPHS7.js → file-text-GbvlPv0Q.js} +1 -1
- package/dist/webdist/assets/{flowDiagram-UKHOOZJN-dIRrnOHF.js → flowDiagram-UKHOOZJN-CLtJnyp2.js} +1 -1
- package/dist/webdist/assets/{folder-input-CDnz-CpO.js → folder-input-BPR-Adbc.js} +1 -1
- package/dist/webdist/assets/{folder-plus-BvULhXve.js → folder-plus-DWk9qU7x.js} +1 -1
- package/dist/webdist/assets/{ganttDiagram-PKOTCBZU-P2ujOmDN.js → ganttDiagram-PKOTCBZU-CLgv4mMu.js} +1 -1
- package/dist/webdist/assets/{git-branch-BMQV1Eoo.js → git-branch-BibrRBYo.js} +1 -1
- package/dist/webdist/assets/{gitGraphDiagram-DS77QQ5N-9ZuOYAew.js → gitGraphDiagram-DS77QQ5N-uutHpXkv.js} +1 -1
- package/dist/webdist/assets/{index-DRZzRh8I.js → index-Cr2HZaij.js} +2 -2
- package/dist/webdist/assets/{infoDiagram-6WML65LV-B0oOAcZ5.js → infoDiagram-6WML65LV--aGVdsNr.js} +1 -1
- package/dist/webdist/assets/{ishikawaDiagram-WSZJBQD7-C1z7dwL9.js → ishikawaDiagram-WSZJBQD7-BE4gWNPf.js} +1 -1
- package/dist/webdist/assets/{journeyDiagram-NVQOT4AX-DX2iwVzj.js → journeyDiagram-NVQOT4AX-6sMELJCk.js} +1 -1
- package/dist/webdist/assets/{kanban-definition-27J2QSJJ-MS_XBVwt.js → kanban-definition-27J2QSJJ-BGF3usqI.js} +1 -1
- package/dist/webdist/assets/{linear-9EuaFWzG.js → linear-B1nxm8OC.js} +1 -1
- package/dist/webdist/assets/{lock-CwFkt95D.js → lock-Bv8wpWcB.js} +1 -1
- package/dist/webdist/assets/{mermaid.core-DsEshkc5.js → mermaid.core-3HHSPcJF.js} +4 -4
- package/dist/webdist/assets/{mindmap-definition-FAOFIHXS-BrK5pDF4.js → mindmap-definition-FAOFIHXS-DssfNWeM.js} +1 -1
- package/dist/webdist/assets/{monitor-DcNUwU1K.js → monitor-BLCpjBhL.js} +1 -1
- package/dist/webdist/assets/{pegDiagram-VL7TDLO6-CDLleNta.js → pegDiagram-VL7TDLO6-DU36GtZC.js} +1 -1
- package/dist/webdist/assets/{pencil-C4iQOpgc.js → pencil-CDxnOOyr.js} +1 -1
- package/dist/webdist/assets/{personas-3m0q0AiZ.js → personas-D2Dg_IAH.js} +3 -3
- package/dist/webdist/assets/{pieDiagram-7S7Q4E2Y-BJlv6KM2.js → pieDiagram-7S7Q4E2Y-DtwQXlMb.js} +1 -1
- package/dist/webdist/assets/{quadrantDiagram-CIZ2JOQS-C1gwpXVO.js → quadrantDiagram-CIZ2JOQS-DN0HnKEO.js} +1 -1
- package/dist/webdist/assets/{railroadDiagram-AXF67PYL-nngwWCQp.js → railroadDiagram-AXF67PYL-8Jqm1nS3.js} +1 -1
- package/dist/webdist/assets/{refresh-cw-Bn2nBksC.js → refresh-cw-DXXBsOG3.js} +1 -1
- package/dist/webdist/assets/{remote-failure-jYHkUgHs.js → remote-failure-CmTQQ1uH.js} +1 -1
- package/dist/webdist/assets/{requirementDiagram-LRYGKXZP-Y-PeM7-r.js → requirementDiagram-LRYGKXZP-Cj13Y2hz.js} +1 -1
- package/dist/webdist/assets/{rocket-DGrWcprG.js → rocket-Bj4ApfKl.js} +1 -1
- package/dist/webdist/assets/{rotate-ccw-D4vhApcg.js → rotate-ccw-CxxhPPFM.js} +1 -1
- package/dist/webdist/assets/{sankeyDiagram-W5VNT64P-B8nJ4yLi.js → sankeyDiagram-W5VNT64P-CTknNvD_.js} +1 -1
- package/dist/webdist/assets/{sequenceDiagram-SI44F4Z6-DBAJ-1WL.js → sequenceDiagram-SI44F4Z6-EAswn3ur.js} +1 -1
- package/dist/webdist/assets/{sheet-DUfI5KUY.js → sheet-BTqGtPKS.js} +1 -1
- package/dist/webdist/assets/{sizeCapture-X5ZJPWSS-NPaGO72S.js → sizeCapture-X5ZJPWSS-B3ARQYq1.js} +1 -1
- package/dist/webdist/assets/{skeleton-BscnHwe0.js → skeleton-CVigrsbx.js} +1 -1
- package/dist/webdist/assets/{sliders-horizontal-Ad_TM776.js → sliders-horizontal-DR1gLqie.js} +1 -1
- package/dist/webdist/assets/{sparkles-BmmyzYKJ.js → sparkles-CcwAGbg6.js} +1 -1
- package/dist/webdist/assets/{star-DuwMnlui.js → star-0Bk66gA1.js} +1 -1
- package/dist/webdist/assets/{stateDiagram-OKZ733FA-B4r14qk_.js → stateDiagram-OKZ733FA-BaankOWR.js} +1 -1
- package/dist/webdist/assets/stateDiagram-v2-UEYNNEHI-COSyUhZo.js +1 -0
- package/dist/webdist/assets/{swimlanes-SLNWSIFB-Y0bnACb6.js → swimlanes-SLNWSIFB-CszIRQqO.js} +2 -2
- package/dist/webdist/assets/swimlanesDiagram-ULZ7WXOC-C0RxbOtY.js +8 -0
- package/dist/webdist/assets/{switch-Dq0BXsMd.js → switch-DzbQrsK-.js} +1 -1
- package/dist/webdist/assets/{terminal-CQ80Bs_v.js → terminal-Ksy_OeYC.js} +1 -1
- package/dist/webdist/assets/{timeline-definition-Z64GVDOM-ikXMcDZb.js → timeline-definition-Z64GVDOM-C9Vf_8zn.js} +1 -1
- package/dist/webdist/assets/{trash-2-DlCrDcbC.js → trash-2-DuGsj8hz.js} +1 -1
- package/dist/webdist/assets/{triangle-alert-BKR5vNTt.js → triangle-alert-DhZpcntH.js} +1 -1
- package/dist/webdist/assets/{vennDiagram-T6HMQDX7-BtVjPxY-.js → vennDiagram-T6HMQDX7-CuuDuTDm.js} +1 -1
- package/dist/webdist/assets/{wardleyDiagram-T6FBY63Y-D9Hl5cAG.js → wardleyDiagram-T6FBY63Y-Bl8oAdjj.js} +1 -1
- package/dist/webdist/assets/{wrench-C3cJ5YjD.js → wrench-f0FxN_96.js} +1 -1
- package/dist/webdist/assets/{xychartDiagram-ELKLHX3M-BAGx-qub.js → xychartDiagram-ELKLHX3M-pr-zww3p.js} +1 -1
- package/dist/webdist/index.html +1 -1
- package/package.json +3 -3
- package/dist/webdist/assets/ModelDetailDialog-9b2F83QQ.js +0 -1
- package/dist/webdist/assets/WorkspaceScreen-BNtXiOWM.js +0 -1
- package/dist/webdist/assets/channel-ycP7LIsi.js +0 -1
- package/dist/webdist/assets/classDiagram-JCYQIIEL-D83VGEBW.js +0 -1
- package/dist/webdist/assets/classDiagram-v2-OCEON4UE-D83VGEBW.js +0 -1
- package/dist/webdist/assets/stateDiagram-v2-UEYNNEHI-UJd0HPyU.js +0 -1
- package/dist/webdist/assets/swimlanesDiagram-ULZ7WXOC-bjFfMuvz.js +0 -8
|
@@ -23,7 +23,11 @@ import { dirname, join } from "path";
|
|
|
23
23
|
|
|
24
24
|
// src/chat/reasoning-effort.ts
|
|
25
25
|
var VALID = /* @__PURE__ */ new Set(["off", "low", "medium", "xhigh"]);
|
|
26
|
-
var ALIASES = /* @__PURE__ */ new Map([
|
|
26
|
+
var ALIASES = /* @__PURE__ */ new Map([
|
|
27
|
+
["high", "xhigh"],
|
|
28
|
+
["none", "off"],
|
|
29
|
+
["minimal", "low"]
|
|
30
|
+
]);
|
|
27
31
|
function parseReasoningEffort(value) {
|
|
28
32
|
if (typeof value !== "string") return void 0;
|
|
29
33
|
if (VALID.has(value)) return value;
|
package/dist/cli.js
CHANGED
|
@@ -9556,6 +9556,47 @@ function applyGlobalDefaults(base2, m, sys, defaults) {
|
|
|
9556
9556
|
imageMaxTokens: defaults.imageMaxTokens ?? base2.imageMaxTokens
|
|
9557
9557
|
};
|
|
9558
9558
|
}
|
|
9559
|
+
function tokenizeExtraArgs(entries) {
|
|
9560
|
+
const out = [];
|
|
9561
|
+
for (const entry of entries ?? []) {
|
|
9562
|
+
if (typeof entry !== "string") continue;
|
|
9563
|
+
if (!needsTokenize(entry)) {
|
|
9564
|
+
if (entry.trim()) out.push(entry);
|
|
9565
|
+
continue;
|
|
9566
|
+
}
|
|
9567
|
+
let cur = "";
|
|
9568
|
+
let quote = null;
|
|
9569
|
+
for (const ch of entry) {
|
|
9570
|
+
if (quote) {
|
|
9571
|
+
if (ch === quote) quote = null;
|
|
9572
|
+
else cur += ch;
|
|
9573
|
+
} else if (ch === '"' || ch === "'") {
|
|
9574
|
+
quote = ch;
|
|
9575
|
+
} else if (/\s/.test(ch)) {
|
|
9576
|
+
if (cur) out.push(cur);
|
|
9577
|
+
cur = "";
|
|
9578
|
+
} else {
|
|
9579
|
+
cur += ch;
|
|
9580
|
+
}
|
|
9581
|
+
}
|
|
9582
|
+
if (cur) out.push(cur);
|
|
9583
|
+
}
|
|
9584
|
+
return out;
|
|
9585
|
+
}
|
|
9586
|
+
function needsTokenize(entry) {
|
|
9587
|
+
if (!entry.trimStart().startsWith("-")) return false;
|
|
9588
|
+
let quote = null;
|
|
9589
|
+
for (const ch of entry.trim()) {
|
|
9590
|
+
if (quote) {
|
|
9591
|
+
if (ch === quote) quote = null;
|
|
9592
|
+
} else if (ch === '"' || ch === "'") {
|
|
9593
|
+
quote = ch;
|
|
9594
|
+
} else if (/\s/.test(ch)) {
|
|
9595
|
+
return true;
|
|
9596
|
+
}
|
|
9597
|
+
}
|
|
9598
|
+
return false;
|
|
9599
|
+
}
|
|
9559
9600
|
function resolveProfile(m, sys, saved, overrides, defaults) {
|
|
9560
9601
|
const base2 = applyGlobalDefaults(deriveDefault(m, sys), m, sys, defaults);
|
|
9561
9602
|
return {
|
|
@@ -9575,7 +9616,12 @@ function resolveProfile(m, sys, saved, overrides, defaults) {
|
|
|
9575
9616
|
// stale/incorrect useMmproj (e.g. auto-tune runs prior to the bench.ts fix that persisted
|
|
9576
9617
|
// false) is corrected on the very next resolve, for every user, with no reset/migration
|
|
9577
9618
|
// needed and no other tuned setting touched.
|
|
9578
|
-
useMmproj: m.vision
|
|
9619
|
+
useMmproj: m.vision,
|
|
9620
|
+
// GitHub #221: normalise run-together flags (`--load-mode dio` typed as one entry)
|
|
9621
|
+
// into real argv elements. Doing it here — after the merge, on the one path every
|
|
9622
|
+
// load goes through — heals already-saved profiles and hand-edited config.json with
|
|
9623
|
+
// no migration, and covers overrides/API callers that never touch the UI.
|
|
9624
|
+
extraArgs: tokenizeExtraArgs(overrides?.extraArgs ?? saved?.extraArgs ?? base2.extraArgs)
|
|
9579
9625
|
};
|
|
9580
9626
|
}
|
|
9581
9627
|
var ROCM_APU_NOMMAP_MIN_BYTES = 30 * 1024 ** 3;
|
|
@@ -9667,7 +9713,9 @@ function profileToArgs(p, m, caps, cores = 0, sys, binPath) {
|
|
|
9667
9713
|
}
|
|
9668
9714
|
if (m.embedding && has("--embeddings")) a.push("--embeddings");
|
|
9669
9715
|
if (p.grammar && has("--grammar")) a.push("--grammar", p.grammar);
|
|
9670
|
-
if (
|
|
9716
|
+
if (p.loadMode && has("--load-mode")) a.push("--load-mode", p.loadMode);
|
|
9717
|
+
const autoNoMmap = isRocmUnifiedApuLoad(m, sys, binPath) && !p.extraArgs.includes("-dio");
|
|
9718
|
+
if ((p.noMmap === true || autoNoMmap) && has("--no-mmap") && !p.extraArgs.includes("--no-mmap")) {
|
|
9671
9719
|
a.push("--no-mmap");
|
|
9672
9720
|
}
|
|
9673
9721
|
a.push(...p.extraArgs);
|
|
@@ -18850,7 +18898,11 @@ function needsExtraPass(content) {
|
|
|
18850
18898
|
|
|
18851
18899
|
// src/chat/reasoning-effort.ts
|
|
18852
18900
|
var VALID = /* @__PURE__ */ new Set(["off", "low", "medium", "xhigh"]);
|
|
18853
|
-
var ALIASES = /* @__PURE__ */ new Map([
|
|
18901
|
+
var ALIASES = /* @__PURE__ */ new Map([
|
|
18902
|
+
["high", "xhigh"],
|
|
18903
|
+
["none", "off"],
|
|
18904
|
+
["minimal", "low"]
|
|
18905
|
+
]);
|
|
18854
18906
|
function parseReasoningEffort(value) {
|
|
18855
18907
|
if (typeof value !== "string") return void 0;
|
|
18856
18908
|
if (VALID.has(value)) return value;
|
package/dist/code-routes.js
CHANGED
package/dist/code-run-manager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-BhMTW0nu.js";import{b as W,u as $,r as b}from"./vendor-C1I6euDx.js";import{u as G,d as H,e as Y,f as J,g as U,a as z,B as C,t as j,c as q,b as h,A as _}from"./index-DRZzRh8I.js";import{f as V}from"./chat-api-CfcKVstJ.js";import{f as X,a as Z}from"./agent-api-Dv4kFt_M.js";import{P as B}from"./personas-3m0q0AiZ.js";import{C as ee}from"./chevron-left-0LNFGtRG.js";import{R as te}from"./rotate-ccw-D4vhApcg.js";import{T as se}from"./trash-2-DlCrDcbC.js";import{C as ne}from"./chevron-right-DuO7WTV_.js";import"./dropdown-menu-B3NbEIpW.js";const ae=()=>({name:"",description:"",systemPrompt:"",skillIds:[],tools:[]});function oe(s){const d=[],x=new Map;for(const n of s){const a=/^mcp__([^_]+(?:_[^_]+)*)__/.exec(n.name);if(!a){d.push(n);continue}const i=a[1],p=/^\[([^\]]+)\]/.exec(n.description),c=p?p[1]:i.replace(/_/g," ");x.has(i)||x.set(i,{key:i,label:c,tools:[]}),x.get(i).tools.push(n)}return{builtin:d,groups:[...x.values()].sort((n,a)=>n.label.localeCompare(a.label))}}function le(s){return s.replace(/^mcp__[^_]+(?:_[^_]+)*__/,"")}function re(s){return s.replace(/^\[[^\]]+\]\s*/,"")}function D({tool:s,checked:d,onToggle:x}){return e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:d,onChange:x}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"font-mono text-ink",children:le(s.name)}),s.description&&e.jsx("span",{className:"text-faint",children:re(s.description)})]})]})}function ie({group:s,selected:d,onToggleAll:x,onToggleOne:n}){const[a,i]=b.useState(!1),p=s.tools.map(l=>l.name),c=p.filter(l=>d.has(l)).length,o=c===p.length,g=c>0&&!o,u=b.useRef(null);return b.useEffect(()=>{u.current&&(u.current.indeterminate=g)},[g]),e.jsxs("div",{className:"rounded-md border border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2",children:[e.jsx("input",{ref:u,type:"checkbox",checked:o,onChange:()=>x(p,!o)}),e.jsxs("button",{type:"button",onClick:()=>{j("agents","toggle_agent_tool_group"),i(l=>!l)},className:"flex flex-1 items-center gap-1.5 text-left text-[13px] text-ink",children:[e.jsx(ne,{size:12,className:q("shrink-0 text-faint transition-transform",a&&"rotate-90")}),s.label,e.jsxs("span",{className:"text-[11px] text-faint",children:["(",c,"/",p.length,")"]})]})]}),a&&e.jsx("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2 pl-9",children:s.tools.map(l=>e.jsx(D,{tool:l,checked:d.has(l.name),onToggle:()=>n(l.name)},l.name))})]})}function ce({tools:s,selected:d,onChange:x}){const n=new Set(d),{builtin:a,groups:i}=oe(s),p=o=>x(n.has(o)?d.filter(g=>g!==o):[...d,o]),c=(o,g)=>{const u=d.filter(l=>!o.includes(l));x(g?[...u,...o]:u)};return s.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No tools available yet."}):e.jsxs("div",{className:"flex flex-col gap-2",children:[a.length>0&&e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:a.map(o=>e.jsx(D,{tool:o,checked:n.has(o.name),onToggle:()=>p(o.name)},o.name))}),i.map(o=>e.jsx(ie,{group:o,selected:n,onToggleAll:c,onToggleOne:p},o.key))]})}function je(){const{agentId:s="new"}=W(),d=$(),x=G(),n=s==="new",a=!n&&B.some(t=>t.id===s),i=a?B.find(t=>t.id===s):void 0,p=H(),c=!n&&!a?(p.data??[]).find(t=>t.id===s):void 0,o=Y(),g=J(),u=U(),l=a?g.data?.[s]:void 0,I=z({queryKey:Z.list(),queryFn:X,staleTime:0}),k=I.data??[],w=z({queryKey:["available-tools"],queryFn:V}),N=w.data??[],[m,f]=b.useState(ae()),[S,T]=b.useState(!1),[A,P]=b.useState(!1),[L,R]=b.useState(!1),[E,Q]=b.useState("skills");n&&!S&&(k.length||N.length)&&(f(t=>({...t,skillIds:k.map(r=>r.id),tools:N.map(r=>r.name)})),T(!0)),!n&&!a&&!S&&c&&(f({name:c.name,description:c.description,systemPrompt:c.systemPrompt,skillIds:c.skillIds,tools:c.tools}),T(!0)),a&&!S&&i&&g.isSuccess&&(k.length||N.length)&&(f({name:l?.name??i.name,description:l?.description??i.description,systemPrompt:l?.systemPrompt??i.systemPrompt,skillIds:l?.skillIds??k.map(t=>t.id),tools:l?.tools??N.map(t=>t.name)}),T(!0));const y=()=>{j("agents","back_to_agents"),d("/customize")},O=t=>f(r=>({...r,skillIds:r.skillIds.includes(t)?r.skillIds.filter(v=>v!==t):[...r.skillIds,t]})),F=()=>{if(!m.name.trim()){h.error("Name is required.");return}P(!0);const t={name:m.name.trim(),description:m.description.trim(),systemPrompt:m.systemPrompt,skillIds:m.skillIds,tools:m.tools};if(a){u.save.mutate({id:s,override:t},{onSuccess:()=>{h.success("Agent saved."),y()},onError:v=>{h.error(v instanceof _?v.message:"Could not save agent."),P(!1)}});return}const r={onSuccess:()=>{x.invalidateQueries({queryKey:["chat-agents"]}),h.success(n?"Agent created.":"Agent saved."),y()},onError:v=>{h.error(v instanceof _?v.message:"Could not save agent."),P(!1)}};n?o.add.mutate(t,r):o.update.mutate({id:s,patch:t},r)},K=()=>{u.reset.mutate(s,{onSuccess:()=>{h.success("Reset to default."),i&&f({name:i.name,description:i.description,systemPrompt:i.systemPrompt,skillIds:k.map(t=>t.id),tools:N.map(t=>t.name)})},onError:t=>h.error(t instanceof _?t.message:"Could not reset agent.")})},M=()=>{o.remove.mutate(s,{onSuccess:()=>{h.success("Agent deleted."),y()},onError:t=>h.error(t instanceof _?t.message:"Could not delete agent.")})};return!n&&!a&&p.isSuccess&&!c?e.jsxs("div",{className:"flex w-full flex-col items-center gap-3 px-8 py-16",children:[e.jsx("p",{className:"text-[14px] text-muted",children:"That agent no longer exists."}),e.jsx(C,{size:"sm",variant:"outline",onClick:y,children:"Back to agents"})]}):e.jsxs("div",{className:"flex w-full max-w-4xl flex-col gap-5 px-4 py-6 md:px-8",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:y,className:"text-faint hover:text-ink",title:"Back to agents",children:e.jsx(ee,{size:18})}),e.jsx("span",{className:"text-[15px] font-medium text-ink",children:n?"New agent":a?l?"Edit agent (modified built-in)":"Edit agent (built-in)":"Edit agent"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a&&e.jsxs(C,{size:"sm",variant:"outline",onClick:()=>{j("agents","reset_agent_to_default"),K()},disabled:u.reset.isPending,children:[e.jsx(te,{size:13})," Reset to default"]}),e.jsx(C,{size:"sm",variant:"outline",onClick:y,children:"Cancel"}),e.jsx(C,{size:"sm",onClick:()=>{j("agents","save_agent"),F()},disabled:A||!m.name.trim(),children:A?"Saving…":"Save"})]})]}),a&&e.jsx("p",{className:"rounded-md border border-border bg-panel px-3 py-2 text-[12px] text-muted",children:"Built-in agents can be edited in place — Reset to default discards your changes and restores TurboLLM's original prompt and access."}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Name"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"Release Notes Writer",value:m.name,onChange:t=>f(r=>({...r,name:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Description"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"What this agent is for, in one line",value:m.description,onChange:t=>f(r=>({...r,description:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"System prompt"}),e.jsx("textarea",{className:"min-h-[160px] resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-[12px] leading-relaxed text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"You are…",value:m.systemPrompt,onChange:t=>f(r=>({...r,systemPrompt:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"inline-flex w-fit rounded-md border border-border p-0.5",children:["skills","tools"].map(t=>e.jsx("button",{type:"button",onClick:()=>{j("agents","switch_agent_form_tab"),Q(t)},className:q("rounded px-3 py-1.5 text-[13px] font-medium transition-colors",E===t?"bg-accent/12 text-accent":"text-muted hover:text-ink"),children:t==="skills"?`Skills (${m.skillIds.length})`:`Tools (${m.tools.length})`},t))}),E==="skills"?I.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):k.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No skills yet — create one under Customize → Skills."}):e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:k.map(t=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:m.skillIds.includes(t.id),onChange:()=>O(t.id)}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-ink",children:t.name}),t.description&&e.jsx("span",{className:"text-[12px] text-muted",children:t.description})]})]},t.id))}):w.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):e.jsx(ce,{tools:N,selected:m.tools,onChange:t=>f(r=>({...r,tools:t}))})]}),!n&&!a&&(L?e.jsxs("div",{className:"flex items-center gap-2 self-start rounded-md border border-border bg-panel p-2 text-[12px]",children:[e.jsx("span",{className:"flex-1 text-muted",children:"Delete this agent?"}),e.jsx("button",{type:"button",onClick:()=>{j("agents","delete_agent"),M()},className:"rounded px-2 py-1 text-[color:var(--err)] hover:bg-[color:color-mix(in_srgb,var(--err)_12%,transparent)]",children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>{j("agents","cancel_delete_agent"),R(!1)},className:"rounded px-2 py-1 text-faint hover:text-ink",children:"Cancel"})]}):e.jsxs("button",{type:"button",onClick:()=>R(!0),className:"flex items-center gap-1.5 self-start text-[12px] text-faint hover:text-[color:var(--err)]",children:[e.jsx(se,{size:13})," Delete agent"]}))]})}export{je as AgentEditPage};
|
|
1
|
+
import{j as e}from"./radix-BhMTW0nu.js";import{b as W,u as $,r as b}from"./vendor-C1I6euDx.js";import{u as G,d as H,e as Y,f as J,g as U,a as z,B as C,t as j,c as q,b as h,A as _}from"./index-Cr2HZaij.js";import{f as V}from"./chat-api-h23XF3XS.js";import{f as X,a as Z}from"./agent-api-BxmkSoWa.js";import{P as B}from"./personas-D2Dg_IAH.js";import{C as ee}from"./chevron-left-BY6aqkSe.js";import{R as te}from"./rotate-ccw-CxxhPPFM.js";import{T as se}from"./trash-2-DuGsj8hz.js";import{C as ne}from"./chevron-right-BqwIVl2b.js";import"./dropdown-menu-B86NIBT-.js";const ae=()=>({name:"",description:"",systemPrompt:"",skillIds:[],tools:[]});function oe(s){const d=[],x=new Map;for(const n of s){const a=/^mcp__([^_]+(?:_[^_]+)*)__/.exec(n.name);if(!a){d.push(n);continue}const i=a[1],p=/^\[([^\]]+)\]/.exec(n.description),c=p?p[1]:i.replace(/_/g," ");x.has(i)||x.set(i,{key:i,label:c,tools:[]}),x.get(i).tools.push(n)}return{builtin:d,groups:[...x.values()].sort((n,a)=>n.label.localeCompare(a.label))}}function le(s){return s.replace(/^mcp__[^_]+(?:_[^_]+)*__/,"")}function re(s){return s.replace(/^\[[^\]]+\]\s*/,"")}function D({tool:s,checked:d,onToggle:x}){return e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:d,onChange:x}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"font-mono text-ink",children:le(s.name)}),s.description&&e.jsx("span",{className:"text-faint",children:re(s.description)})]})]})}function ie({group:s,selected:d,onToggleAll:x,onToggleOne:n}){const[a,i]=b.useState(!1),p=s.tools.map(l=>l.name),c=p.filter(l=>d.has(l)).length,o=c===p.length,g=c>0&&!o,u=b.useRef(null);return b.useEffect(()=>{u.current&&(u.current.indeterminate=g)},[g]),e.jsxs("div",{className:"rounded-md border border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2",children:[e.jsx("input",{ref:u,type:"checkbox",checked:o,onChange:()=>x(p,!o)}),e.jsxs("button",{type:"button",onClick:()=>{j("agents","toggle_agent_tool_group"),i(l=>!l)},className:"flex flex-1 items-center gap-1.5 text-left text-[13px] text-ink",children:[e.jsx(ne,{size:12,className:q("shrink-0 text-faint transition-transform",a&&"rotate-90")}),s.label,e.jsxs("span",{className:"text-[11px] text-faint",children:["(",c,"/",p.length,")"]})]})]}),a&&e.jsx("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2 pl-9",children:s.tools.map(l=>e.jsx(D,{tool:l,checked:d.has(l.name),onToggle:()=>n(l.name)},l.name))})]})}function ce({tools:s,selected:d,onChange:x}){const n=new Set(d),{builtin:a,groups:i}=oe(s),p=o=>x(n.has(o)?d.filter(g=>g!==o):[...d,o]),c=(o,g)=>{const u=d.filter(l=>!o.includes(l));x(g?[...u,...o]:u)};return s.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No tools available yet."}):e.jsxs("div",{className:"flex flex-col gap-2",children:[a.length>0&&e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:a.map(o=>e.jsx(D,{tool:o,checked:n.has(o.name),onToggle:()=>p(o.name)},o.name))}),i.map(o=>e.jsx(ie,{group:o,selected:n,onToggleAll:c,onToggleOne:p},o.key))]})}function je(){const{agentId:s="new"}=W(),d=$(),x=G(),n=s==="new",a=!n&&B.some(t=>t.id===s),i=a?B.find(t=>t.id===s):void 0,p=H(),c=!n&&!a?(p.data??[]).find(t=>t.id===s):void 0,o=Y(),g=J(),u=U(),l=a?g.data?.[s]:void 0,I=z({queryKey:Z.list(),queryFn:X,staleTime:0}),k=I.data??[],w=z({queryKey:["available-tools"],queryFn:V}),N=w.data??[],[m,f]=b.useState(ae()),[S,T]=b.useState(!1),[A,P]=b.useState(!1),[L,R]=b.useState(!1),[E,Q]=b.useState("skills");n&&!S&&(k.length||N.length)&&(f(t=>({...t,skillIds:k.map(r=>r.id),tools:N.map(r=>r.name)})),T(!0)),!n&&!a&&!S&&c&&(f({name:c.name,description:c.description,systemPrompt:c.systemPrompt,skillIds:c.skillIds,tools:c.tools}),T(!0)),a&&!S&&i&&g.isSuccess&&(k.length||N.length)&&(f({name:l?.name??i.name,description:l?.description??i.description,systemPrompt:l?.systemPrompt??i.systemPrompt,skillIds:l?.skillIds??k.map(t=>t.id),tools:l?.tools??N.map(t=>t.name)}),T(!0));const y=()=>{j("agents","back_to_agents"),d("/customize")},O=t=>f(r=>({...r,skillIds:r.skillIds.includes(t)?r.skillIds.filter(v=>v!==t):[...r.skillIds,t]})),F=()=>{if(!m.name.trim()){h.error("Name is required.");return}P(!0);const t={name:m.name.trim(),description:m.description.trim(),systemPrompt:m.systemPrompt,skillIds:m.skillIds,tools:m.tools};if(a){u.save.mutate({id:s,override:t},{onSuccess:()=>{h.success("Agent saved."),y()},onError:v=>{h.error(v instanceof _?v.message:"Could not save agent."),P(!1)}});return}const r={onSuccess:()=>{x.invalidateQueries({queryKey:["chat-agents"]}),h.success(n?"Agent created.":"Agent saved."),y()},onError:v=>{h.error(v instanceof _?v.message:"Could not save agent."),P(!1)}};n?o.add.mutate(t,r):o.update.mutate({id:s,patch:t},r)},K=()=>{u.reset.mutate(s,{onSuccess:()=>{h.success("Reset to default."),i&&f({name:i.name,description:i.description,systemPrompt:i.systemPrompt,skillIds:k.map(t=>t.id),tools:N.map(t=>t.name)})},onError:t=>h.error(t instanceof _?t.message:"Could not reset agent.")})},M=()=>{o.remove.mutate(s,{onSuccess:()=>{h.success("Agent deleted."),y()},onError:t=>h.error(t instanceof _?t.message:"Could not delete agent.")})};return!n&&!a&&p.isSuccess&&!c?e.jsxs("div",{className:"flex w-full flex-col items-center gap-3 px-8 py-16",children:[e.jsx("p",{className:"text-[14px] text-muted",children:"That agent no longer exists."}),e.jsx(C,{size:"sm",variant:"outline",onClick:y,children:"Back to agents"})]}):e.jsxs("div",{className:"flex w-full max-w-4xl flex-col gap-5 px-4 py-6 md:px-8",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:y,className:"text-faint hover:text-ink",title:"Back to agents",children:e.jsx(ee,{size:18})}),e.jsx("span",{className:"text-[15px] font-medium text-ink",children:n?"New agent":a?l?"Edit agent (modified built-in)":"Edit agent (built-in)":"Edit agent"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a&&e.jsxs(C,{size:"sm",variant:"outline",onClick:()=>{j("agents","reset_agent_to_default"),K()},disabled:u.reset.isPending,children:[e.jsx(te,{size:13})," Reset to default"]}),e.jsx(C,{size:"sm",variant:"outline",onClick:y,children:"Cancel"}),e.jsx(C,{size:"sm",onClick:()=>{j("agents","save_agent"),F()},disabled:A||!m.name.trim(),children:A?"Saving…":"Save"})]})]}),a&&e.jsx("p",{className:"rounded-md border border-border bg-panel px-3 py-2 text-[12px] text-muted",children:"Built-in agents can be edited in place — Reset to default discards your changes and restores TurboLLM's original prompt and access."}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Name"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"Release Notes Writer",value:m.name,onChange:t=>f(r=>({...r,name:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"Description"}),e.jsx("input",{className:"rounded-md border border-border bg-bg px-3 py-1.5 text-[13px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"What this agent is for, in one line",value:m.description,onChange:t=>f(r=>({...r,description:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[12px] font-medium text-muted",children:"System prompt"}),e.jsx("textarea",{className:"min-h-[160px] resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-[12px] leading-relaxed text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"You are…",value:m.systemPrompt,onChange:t=>f(r=>({...r,systemPrompt:t.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"inline-flex w-fit rounded-md border border-border p-0.5",children:["skills","tools"].map(t=>e.jsx("button",{type:"button",onClick:()=>{j("agents","switch_agent_form_tab"),Q(t)},className:q("rounded px-3 py-1.5 text-[13px] font-medium transition-colors",E===t?"bg-accent/12 text-accent":"text-muted hover:text-ink"),children:t==="skills"?`Skills (${m.skillIds.length})`:`Tools (${m.tools.length})`},t))}),E==="skills"?I.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):k.length===0?e.jsx("p",{className:"text-[12px] text-faint",children:"No skills yet — create one under Customize → Skills."}):e.jsx("div",{className:"flex flex-col gap-2 rounded-md border border-border bg-panel-2 p-3",children:k.map(t=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:m.skillIds.includes(t.id),onChange:()=>O(t.id)}),e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-ink",children:t.name}),t.description&&e.jsx("span",{className:"text-[12px] text-muted",children:t.description})]})]},t.id))}):w.isLoading?e.jsx("p",{className:"text-[12px] text-faint",children:"Loading…"}):e.jsx(ce,{tools:N,selected:m.tools,onChange:t=>f(r=>({...r,tools:t}))})]}),!n&&!a&&(L?e.jsxs("div",{className:"flex items-center gap-2 self-start rounded-md border border-border bg-panel p-2 text-[12px]",children:[e.jsx("span",{className:"flex-1 text-muted",children:"Delete this agent?"}),e.jsx("button",{type:"button",onClick:()=>{j("agents","delete_agent"),M()},className:"rounded px-2 py-1 text-[color:var(--err)] hover:bg-[color:color-mix(in_srgb,var(--err)_12%,transparent)]",children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>{j("agents","cancel_delete_agent"),R(!1)},className:"rounded px-2 py-1 text-faint hover:text-ink",children:"Cancel"})]}):e.jsxs("button",{type:"button",onClick:()=>R(!0),className:"flex items-center gap-1.5 self-start text-[12px] text-faint hover:text-[color:var(--err)]",children:[e.jsx(se,{size:13})," Delete agent"]}))]})}export{je as AgentEditPage};
|