turbollm 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE.md +105 -105
  2. package/bin/turbollm.mjs +25 -25
  3. package/dist/cli.js +12 -3
  4. package/dist/webdist/assets/{AgentsScreen-qd7_yqju.js → AgentsScreen-Bm0dlNUs.js} +1 -1
  5. package/dist/webdist/assets/{ChatScreen-DYeJQoLV.js → ChatScreen-De7mfm87.js} +3 -3
  6. package/dist/webdist/assets/{CustomizeScreen-DBXBuQPm.js → CustomizeScreen-BhJkwqO1.js} +1 -1
  7. package/dist/webdist/assets/{DeveloperScreen-CCWBQQ4y.js → DeveloperScreen-EeXXJhPl.js} +1 -1
  8. package/dist/webdist/assets/{EnginesScreen-DQQLI0Qv.js → EnginesScreen-4MCxOhkl.js} +1 -1
  9. package/dist/webdist/assets/{ModelDetailDialog-C-dRTp-J.js → ModelDetailDialog-BhySVphP.js} +1 -1
  10. package/dist/webdist/assets/{ModelDirs-E_tFMIjS.js → ModelDirs-ChNMfQlk.js} +1 -1
  11. package/dist/webdist/assets/{ModelsScreen-JeCIZIdr.js → ModelsScreen-DSZhXs2J.js} +1 -1
  12. package/dist/webdist/assets/{SettingsScreen-BFhQBO1d.js → SettingsScreen-fyDtvMAN.js} +1 -1
  13. package/dist/webdist/assets/{arc-820YYJ1l.js → arc-CuIEySlm.js} +1 -1
  14. package/dist/webdist/assets/{architectureDiagram-3BPJPVTR-BTSJZjgr.js → architectureDiagram-3BPJPVTR-CDtTHNKE.js} +1 -1
  15. package/dist/webdist/assets/{arrow-left-BJXqu8NS.js → arrow-left-BhWtMEXH.js} +1 -1
  16. package/dist/webdist/assets/{blockDiagram-GPEHLZMM-E_gowUIA.js → blockDiagram-GPEHLZMM--Dy7JNXf.js} +1 -1
  17. package/dist/webdist/assets/{c4Diagram-AAUBKEIU-DwJcumW7.js → c4Diagram-AAUBKEIU-XVnczljG.js} +1 -1
  18. package/dist/webdist/assets/channel-C4W_mju9.js +1 -0
  19. package/dist/webdist/assets/check-BJnna3cY.js +1 -0
  20. package/dist/webdist/assets/{chevron-right-BTg0-ylt.js → chevron-right-DJQHNjeM.js} +1 -1
  21. package/dist/webdist/assets/{chunk-2J33WTMH-DWJ9qmM_.js → chunk-2J33WTMH-C077hTl3.js} +1 -1
  22. package/dist/webdist/assets/{chunk-4BX2VUAB-DgyEqU31.js → chunk-4BX2VUAB-DKdVCoaf.js} +1 -1
  23. package/dist/webdist/assets/{chunk-55IACEB6-CsI85v4r.js → chunk-55IACEB6-COscQ2lU.js} +1 -1
  24. package/dist/webdist/assets/{chunk-727SXJPM-YRdSK3U3.js → chunk-727SXJPM-DWN7NXCr.js} +1 -1
  25. package/dist/webdist/assets/{chunk-AQP2D5EJ-BnTfokPI.js → chunk-AQP2D5EJ-DunZhDts.js} +1 -1
  26. package/dist/webdist/assets/{chunk-FMBD7UC4-Dt8O7iM6.js → chunk-FMBD7UC4-Cs40cRbK.js} +1 -1
  27. package/dist/webdist/assets/{chunk-ND2GUHAM-OsM9VDgQ.js → chunk-ND2GUHAM-DpXYV_RZ.js} +1 -1
  28. package/dist/webdist/assets/{chunk-QZHKN3VN-CW3L84fX.js → chunk-QZHKN3VN-D6BC_875.js} +1 -1
  29. package/dist/webdist/assets/{circle-check-iwGQW5-3.js → circle-check-CYzq3xdq.js} +1 -1
  30. package/dist/webdist/assets/{circle-x-CDfcuELr.js → circle-x-A-lKHO2r.js} +1 -1
  31. package/dist/webdist/assets/classDiagram-4FO5ZUOK-CcUXUVK5.js +1 -0
  32. package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-CcUXUVK5.js +1 -0
  33. package/dist/webdist/assets/{common-BstanhE0.js → common-Bs-nRFXO.js} +1 -1
  34. package/dist/webdist/assets/{copy-button-DrRexlJn.js → copy-button-BDBGYJyK.js} +1 -1
  35. package/dist/webdist/assets/{cose-bilkent-S5V4N54A-cNqjZyGk.js → cose-bilkent-S5V4N54A-CBdxwvXL.js} +1 -1
  36. package/dist/webdist/assets/{dagre-BM42HDAG-zr_aSu4P.js → dagre-BM42HDAG--TuZmFxK.js} +1 -1
  37. package/dist/webdist/assets/{diagram-2AECGRRQ-D8fYvWd0.js → diagram-2AECGRRQ-CBd1wCAj.js} +1 -1
  38. package/dist/webdist/assets/{diagram-5GNKFQAL-Cp2jBV3j.js → diagram-5GNKFQAL-CGhx3UWE.js} +1 -1
  39. package/dist/webdist/assets/{diagram-KO2AKTUF-SdWp_DPO.js → diagram-KO2AKTUF-Cao3Duro.js} +1 -1
  40. package/dist/webdist/assets/{diagram-LMA3HP47-DHwQz9MP.js → diagram-LMA3HP47-WjRqqdMT.js} +1 -1
  41. package/dist/webdist/assets/{diagram-OG6HWLK6-FGejDPqJ.js → diagram-OG6HWLK6-2ox056u5.js} +1 -1
  42. package/dist/webdist/assets/{dialog-Cpwjl0SL.js → dialog-CxAGijbe.js} +1 -1
  43. package/dist/webdist/assets/{erDiagram-TEJ5UH35-Ci0ArYoY.js → erDiagram-TEJ5UH35-ArZ5ZZJa.js} +1 -1
  44. package/dist/webdist/assets/{flowDiagram-I6XJVG4X-g96T9cRZ.js → flowDiagram-I6XJVG4X-B9tLKPOZ.js} +1 -1
  45. package/dist/webdist/assets/{ganttDiagram-6RSMTGT7-CFGWWtss.js → ganttDiagram-6RSMTGT7-C-N7wsLt.js} +1 -1
  46. package/dist/webdist/assets/{gitGraphDiagram-PVQCEYII-FFeX8xGw.js → gitGraphDiagram-PVQCEYII-WMWkUM9v.js} +1 -1
  47. package/dist/webdist/assets/{index-CM4wnT7v.js → index-BEuak5p5.js} +2 -2
  48. package/dist/webdist/assets/{infoDiagram-5YYISTIA-CTuVSOzN.js → infoDiagram-5YYISTIA-cGx1kqp-.js} +1 -1
  49. package/dist/webdist/assets/{ishikawaDiagram-YF4QCWOH-BMyIM99h.js → ishikawaDiagram-YF4QCWOH-CKuSQqaZ.js} +1 -1
  50. package/dist/webdist/assets/{journeyDiagram-JHISSGLW-CcKLWYl8.js → journeyDiagram-JHISSGLW-3nxSzaVj.js} +1 -1
  51. package/dist/webdist/assets/{kanban-definition-UN3LZRKU-CuzVk9Q_.js → kanban-definition-UN3LZRKU-_hSS8ZRB.js} +1 -1
  52. package/dist/webdist/assets/{linear-DvYrxcXL.js → linear-DcWs5d6j.js} +1 -1
  53. package/dist/webdist/assets/{mermaid.core-DIGvaW9x.js → mermaid.core-vZsS4NJL.js} +4 -4
  54. package/dist/webdist/assets/{mindmap-definition-RKZ34NQL-Dh_7fzN2.js → mindmap-definition-RKZ34NQL-DB5Mtp7f.js} +1 -1
  55. package/dist/webdist/assets/{pencil-veezqsms.js → pencil-BC_D38u5.js} +1 -1
  56. package/dist/webdist/assets/{pieDiagram-4H26LBE5-G_BsYb0k.js → pieDiagram-4H26LBE5-C1qmat-q.js} +1 -1
  57. package/dist/webdist/assets/{plus-BLEwDzPR.js → plus-CYdaHYzw.js} +1 -1
  58. package/dist/webdist/assets/{quadrantDiagram-W4KKPZXB-B1DekSy3.js → quadrantDiagram-W4KKPZXB-Boa-e85b.js} +1 -1
  59. package/dist/webdist/assets/{refresh-cw-ByeAabM7.js → refresh-cw-CAf-srhC.js} +1 -1
  60. package/dist/webdist/assets/{requirementDiagram-4Y6WPE33-DPYkFc77.js → requirementDiagram-4Y6WPE33-Bmp1KNz5.js} +1 -1
  61. package/dist/webdist/assets/{sankeyDiagram-5OEKKPKP-HfCQTOkK.js → sankeyDiagram-5OEKKPKP-BW5ZiXqU.js} +1 -1
  62. package/dist/webdist/assets/{save-CuyovDOw.js → save-CuovAu9V.js} +1 -1
  63. package/dist/webdist/assets/{sequenceDiagram-3UESZ5HK-C71xQD9L.js → sequenceDiagram-3UESZ5HK-Dqsa-4BM.js} +1 -1
  64. package/dist/webdist/assets/{skeleton-XeFkC2WF.js → skeleton-sJWGKoPW.js} +1 -1
  65. package/dist/webdist/assets/{stateDiagram-AJRCARHV-C0m1fR_s.js → stateDiagram-AJRCARHV-BBfHSXy1.js} +1 -1
  66. package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-DHCBzQwe.js +1 -0
  67. package/dist/webdist/assets/{timeline-definition-PNZ67QCA-B5SB89Kk.js → timeline-definition-PNZ67QCA-BHarWHkU.js} +1 -1
  68. package/dist/webdist/assets/{trash-2-MMGQet84.js → trash-2-BxB6A4uU.js} +1 -1
  69. package/dist/webdist/assets/{vennDiagram-CIIHVFJN-Bs3E_UnU.js → vennDiagram-CIIHVFJN-DTvjLJ1x.js} +1 -1
  70. package/dist/webdist/assets/{wardley-L42UT6IY-D-lZEV6Q.js → wardley-L42UT6IY-DOFy2Cyi.js} +1 -1
  71. package/dist/webdist/assets/{wardleyDiagram-YWT4CUSO-DIiAQmgm.js → wardleyDiagram-YWT4CUSO-FMOMz9fW.js} +1 -1
  72. package/dist/webdist/assets/{wrench-C7hemMKG.js → wrench-C8ZOI3oB.js} +1 -1
  73. package/dist/webdist/assets/{xychartDiagram-2RQKCTM6-DViSTAkf.js → xychartDiagram-2RQKCTM6-pxISvXSk.js} +1 -1
  74. package/dist/webdist/favicon.svg +4 -4
  75. package/dist/webdist/index.html +17 -17
  76. package/package.json +1 -1
  77. package/dist/webdist/assets/channel-6NEG4b4S.js +0 -1
  78. package/dist/webdist/assets/check-GYT4Bnhm.js +0 -1
  79. package/dist/webdist/assets/classDiagram-4FO5ZUOK-jpAzq28n.js +0 -1
  80. package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-jpAzq28n.js +0 -1
  81. package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-C1sHKz6d.js +0 -1
package/LICENSE.md CHANGED
@@ -1,105 +1,105 @@
1
- # Functional Source License, Version 1.1, ALv2 Future License
2
-
3
- ## Abbreviation
4
-
5
- FSL-1.1-ALv2
6
-
7
- ## Notice
8
-
9
- Copyright 2026 Mohit Soni
10
-
11
- ## Terms and Conditions
12
-
13
- ### Licensor ("We")
14
-
15
- The party offering the Software under these Terms and Conditions.
16
-
17
- ### The Software
18
-
19
- The "Software" is each version of the software that we make available under
20
- these Terms and Conditions, as indicated by our inclusion of these Terms and
21
- Conditions with the Software.
22
-
23
- ### License Grant
24
-
25
- Subject to your compliance with this License Grant and the Patents,
26
- Redistribution and Trademark clauses below, we hereby grant you the right to
27
- use, copy, modify, create derivative works, publicly perform, publicly display
28
- and redistribute the Software for any Permitted Purpose identified below.
29
-
30
- ### Permitted Purpose
31
-
32
- A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
- means making the Software available to others in a commercial product or
34
- service that:
35
-
36
- 1. substitutes for the Software;
37
-
38
- 2. substitutes for any other product or service we offer using the Software
39
- that exists as of the date we make the Software available; or
40
-
41
- 3. offers the same or substantially similar functionality as the Software.
42
-
43
- Permitted Purposes specifically include using the Software:
44
-
45
- 1. for your internal use and access;
46
-
47
- 2. for non-commercial education;
48
-
49
- 3. for non-commercial research; and
50
-
51
- 4. in connection with professional services that you provide to a licensee
52
- using the Software in accordance with these Terms and Conditions.
53
-
54
- ### Patents
55
-
56
- To the extent your use for a Permitted Purpose would necessarily infringe our
57
- patents, the license grant above includes a license under our patents. If you
58
- make a claim against any party that the Software infringes or contributes to
59
- the infringement of any patent, then your patent license to the Software ends
60
- immediately.
61
-
62
- ### Redistribution
63
-
64
- The Terms and Conditions apply to all copies, modifications and derivatives of
65
- the Software.
66
-
67
- If you redistribute any copies, modifications or derivatives of the Software,
68
- you must include a copy of or a link to these Terms and Conditions and not
69
- remove any copyright notices provided in or with the Software.
70
-
71
- ### Disclaimer
72
-
73
- THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
- IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
- PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
-
77
- IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
- SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
- EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
-
81
- ### Trademarks
82
-
83
- Except for displaying the License Details and identifying us as the origin of
84
- the Software, you have no right under these Terms and Conditions to use our
85
- trademarks, trade names, service marks or product names.
86
-
87
- ## Grant of Future License
88
-
89
- We hereby irrevocably grant you an additional license to use the Software under
90
- the Apache License, Version 2.0 that is effective on the second anniversary of
91
- the date we make the Software available. On or after that date, you may use the
92
- Software under the Apache License, Version 2.0, in which case the following
93
- will apply:
94
-
95
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
- this file except in compliance with the License.
97
-
98
- You may obtain a copy of the License at
99
-
100
- http://www.apache.org/licenses/LICENSE-2.0
101
-
102
- Unless required by applicable law or agreed to in writing, software distributed
103
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
- specific language governing permissions and limitations under the License.
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Mohit Soni
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/bin/turbollm.mjs CHANGED
@@ -1,25 +1,25 @@
1
- #!/usr/bin/env node
2
- // Hand-written launcher shim — NOT bundled by tsup. It runs before the bundled
3
- // daemon (dist/cli.js) loads, so it can do two things that must happen before
4
- // node:sqlite is imported (the bundle hoists that import, emitting an experimental
5
- // warning that PowerShell renders as a scary red error block on every run):
6
- // 1. Guard the Node version with a friendly message (node:sqlite needs Node 22+).
7
- // 2. Register a 'warning' filter that swallows the node:sqlite experimental notice
8
- // while still printing every other warning.
9
- // Then it hands off to the real CLI via dynamic import (same process; argv intact).
10
- const major = Number(process.versions.node.split('.')[0])
11
- if (major < 22) {
12
- process.stderr.write(
13
- `TurboLLM requires Node.js 22 or newer.\n` +
14
- `You are running Node.js ${process.versions.node}.\n` +
15
- `Please upgrade: https://nodejs.org\n`,
16
- )
17
- process.exit(1)
18
- }
19
-
20
- process.on('warning', (w) => {
21
- if (w.name === 'ExperimentalWarning' && /SQLite/i.test(w.message)) return
22
- process.stderr.write(`${w.stack ?? `${w.name}: ${w.message}`}\n`)
23
- })
24
-
25
- await import('../dist/cli.js')
1
+ #!/usr/bin/env node
2
+ // Hand-written launcher shim — NOT bundled by tsup. It runs before the bundled
3
+ // daemon (dist/cli.js) loads, so it can do two things that must happen before
4
+ // node:sqlite is imported (the bundle hoists that import, emitting an experimental
5
+ // warning that PowerShell renders as a scary red error block on every run):
6
+ // 1. Guard the Node version with a friendly message (node:sqlite needs Node 22+).
7
+ // 2. Register a 'warning' filter that swallows the node:sqlite experimental notice
8
+ // while still printing every other warning.
9
+ // Then it hands off to the real CLI via dynamic import (same process; argv intact).
10
+ const major = Number(process.versions.node.split('.')[0])
11
+ if (major < 22) {
12
+ process.stderr.write(
13
+ `TurboLLM requires Node.js 22 or newer.\n` +
14
+ `You are running Node.js ${process.versions.node}.\n` +
15
+ `Please upgrade: https://nodejs.org\n`,
16
+ )
17
+ process.exit(1)
18
+ }
19
+
20
+ process.on('warning', (w) => {
21
+ if (w.name === 'ExperimentalWarning' && /SQLite/i.test(w.message)) return
22
+ process.stderr.write(`${w.stack ?? `${w.name}: ${w.message}`}\n`)
23
+ })
24
+
25
+ await import('../dist/cli.js')
package/dist/cli.js CHANGED
@@ -3746,7 +3746,15 @@ function resolveProfile(m, sys, saved, overrides, defaults) {
3746
3746
  // missing some fields) keeps the rest of the defaults instead of going undefined.
3747
3747
  gpu: { ...base2.gpu, ...saved?.gpu ?? {}, ...overrides?.gpu ?? {} },
3748
3748
  // vllm deep-merged for the same reason — old/partial profiles keep the defaults.
3749
- vllm: { ...base2.vllm, ...saved?.vllm ?? {}, ...overrides?.vllm ?? {} }
3749
+ vllm: { ...base2.vllm, ...saved?.vllm ?? {}, ...overrides?.vllm ?? {} },
3750
+ // useMmproj has no UI control (only mmprojGpu — GPU-vs-CPU placement — is user-facing;
3751
+ // see ModelDetailDialog's "Vision encoder on GPU" toggle), so there is no legitimate way
3752
+ // for a saved profile or draft override to carry a meaningful `false` here. Forcing it to
3753
+ // track the model's own vision capability makes it self-healing: any profile saved with a
3754
+ // stale/incorrect useMmproj (e.g. auto-tune runs prior to the bench.ts fix that persisted
3755
+ // false) is corrected on the very next resolve, for every user, with no reset/migration
3756
+ // needed and no other tuned setting touched.
3757
+ useMmproj: m.vision
3750
3758
  };
3751
3759
  }
3752
3760
  function profileToArgs(p, m, caps, cores = 0) {
@@ -4991,7 +4999,7 @@ var BenchRunner = class {
4991
4999
  const saved = this.store.snapshot().modelProfiles[modelKey];
4992
5000
  const defaults = this.store.snapshot().modelDefaults;
4993
5001
  const resolved = resolveProfile(entry, sys, saved, base2, defaults);
4994
- const baseProfile = { ...resolved, speculative: "off", mtpHeadPath: "", draftModelPath: "", useMmproj: false };
5002
+ const baseProfile = { ...resolved, speculative: "off", mtpHeadPath: "", draftModelPath: "" };
4995
5003
  const results = [];
4996
5004
  let best = null;
4997
5005
  const kvCandidates = pickKvQuants(baseProfile.kvTypeK, caps.kvTypes);
@@ -12068,9 +12076,10 @@ async function* streamToAnthropic(oaiStream, modelName, msgId, onUsage, onLive)
12068
12076
  yield cbStop(blockIdx);
12069
12077
  blockIdx++;
12070
12078
  }
12079
+ const nonCachedInput = Math.max(0, inputTokens - cacheReadTokens);
12071
12080
  yield sse("message_delta", {
12072
12081
  delta: { stop_reason: stopReason, stop_sequence: null },
12073
- usage: { input_tokens: inputTokens, output_tokens: outputTokens, cache_read_input_tokens: cacheReadTokens }
12082
+ usage: { input_tokens: nonCachedInput, output_tokens: outputTokens, cache_read_input_tokens: cacheReadTokens }
12074
12083
  });
12075
12084
  yield sse("message_stop", {});
12076
12085
  if (onUsage) {
@@ -1,2 +1,2 @@
1
- import{j as e}from"./radix-4XwKfE88.js";import{r as u}from"./vendor-CKtmMAvG.js";import{c as w,b as k,A as T,u as v,L as h,d as S,a as b,e as C,f as q,X as A}from"./index-CM4wnT7v.js";import{P as N}from"./plus-BLEwDzPR.js";import{C as y}from"./circle-x-CDfcuELr.js";import{C as O}from"./circle-check-iwGQW5-3.js";import{W as E}from"./wrench-C7hemMKG.js";const _=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],D=w("circle-dot",_);const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],P=w("clock",L),p={all:["agent-runs"],list:()=>[...p.all,"list"],detail:t=>[...p.all,"detail",t]};async function g(t,a){const l={Accept:"application/json",...k(),...a?.headers??{}},i=await fetch(t,{...a,headers:l});if(i.status===204)return;const r=await i.text(),o=r?JSON.parse(r):void 0;if(!i.ok){const d=o;throw new T(d?.error?.code??"http_error",d?.error?.message??`Request failed with status ${i.status}.`,i.status)}return o}async function $(){return g("/api/v1/agents/runs")}async function I(t){return g(`/api/v1/agents/runs/${t}`)}async function Q(t){return g("/api/v1/agents/runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function K(t){await g(`/api/v1/agents/runs/${t}`,{method:"DELETE"})}async function*F(t,a=0,l){const i=`/api/v1/agents/runs/${t}/stream?fromSeq=${a}`,r=await fetch(i,{headers:{Accept:"text/event-stream",...k()},signal:l});if(!r.ok||!r.body)throw new Error(`Stream error: ${r.status}`);const o=r.body.getReader(),d=new TextDecoder;let m="";try{for(;;){const{done:s,value:x}=await o.read();if(s)break;m+=d.decode(x,{stream:!0});const c=m.split(`
1
+ import{j as e}from"./radix-4XwKfE88.js";import{r as u}from"./vendor-CKtmMAvG.js";import{c as w,b as k,A as T,u as v,L as h,d as S,a as b,e as C,f as q,X as A}from"./index-BEuak5p5.js";import{P as N}from"./plus-CYdaHYzw.js";import{C as y}from"./circle-x-A-lKHO2r.js";import{C as O}from"./circle-check-CYzq3xdq.js";import{W as E}from"./wrench-C8ZOI3oB.js";const _=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],D=w("circle-dot",_);const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],P=w("clock",L),p={all:["agent-runs"],list:()=>[...p.all,"list"],detail:t=>[...p.all,"detail",t]};async function g(t,a){const l={Accept:"application/json",...k(),...a?.headers??{}},i=await fetch(t,{...a,headers:l});if(i.status===204)return;const r=await i.text(),o=r?JSON.parse(r):void 0;if(!i.ok){const d=o;throw new T(d?.error?.code??"http_error",d?.error?.message??`Request failed with status ${i.status}.`,i.status)}return o}async function $(){return g("/api/v1/agents/runs")}async function I(t){return g(`/api/v1/agents/runs/${t}`)}async function Q(t){return g("/api/v1/agents/runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function K(t){await g(`/api/v1/agents/runs/${t}`,{method:"DELETE"})}async function*F(t,a=0,l){const i=`/api/v1/agents/runs/${t}/stream?fromSeq=${a}`,r=await fetch(i,{headers:{Accept:"text/event-stream",...k()},signal:l});if(!r.ok||!r.body)throw new Error(`Stream error: ${r.status}`);const o=r.body.getReader(),d=new TextDecoder;let m="";try{for(;;){const{done:s,value:x}=await o.read();if(s)break;m+=d.decode(x,{stream:!0});const c=m.split(`
2
2
  `);m=c.pop()??"";let n="message";for(const f of c){if(f.startsWith("event: ")){n=f.slice(7).trim();continue}if(f.startsWith("data: ")){const j=f.slice(6).trim();if(j==="[DONE]")return;try{const R=JSON.parse(j);if(yield{event:n,data:R},n==="done"||n==="error")return}catch{}n="message"}}}}finally{o.cancel()}}const J={queued:e.jsx(P,{size:12}),running:e.jsx(h,{size:12,className:"animate-spin"}),done:e.jsx(O,{size:12}),failed:e.jsx(y,{size:12}),cancelled:e.jsx(y,{size:12}),interrupted:e.jsx(y,{size:12})},M={queued:"text-muted",running:"text-accent",done:"text-green-500",failed:"text-red-500",cancelled:"text-muted",interrupted:"text-orange-500"};function z({status:t}){return e.jsxs("span",{className:b("flex items-center gap-1 text-[11px] capitalize",M[t]),children:[J[t],t]})}function W(t){const a=Date.now()-new Date(t).getTime();return a<6e4?"just now":a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:new Date(t).toLocaleDateString()}const U=[{id:"web_search",label:"Web search",hint:"Search the web (needs a provider configured in Settings)"},{id:"fetch_url",label:"Fetch URL",hint:"Read the contents of a web page"},{id:"run_code",label:"Run code",hint:"Execute JS in a sandbox — no mid-run confirmation, opt in only if you trust the task"}];function B({onClose:t,onCreated:a}){const[l,i]=u.useState(""),[r,o]=u.useState(""),[d,m]=u.useState({web_search:!0,fetch_url:!0,run_code:!1}),s=C(),x=n=>m(f=>({...f,[n]:!f[n]})),c=q({mutationFn:()=>Q({title:l.slice(0,60)||"Agent run",systemPrompt:r||void 0,userMessage:l,allowedTools:Object.entries(d).filter(([,n])=>n).map(([n])=>n)}),onSuccess:n=>{s.invalidateQueries({queryKey:p.list()}),a(n.id),t()}});return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:t,children:e.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-border bg-panel p-5 shadow-xl",onClick:n=>n.stopPropagation(),children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[15px] font-semibold",children:"New agent run"}),e.jsx("button",{type:"button",onClick:t,className:"text-faint hover:text-ink",children:e.jsx(A,{size:16})})]}),e.jsx("label",{className:"mb-1 block text-[12px] text-muted",children:"Task"}),e.jsx("textarea",{autoFocus:!0,value:l,onChange:n=>i(n.target.value),placeholder:"Describe what the agent should do…",rows:4,className:"mb-3 w-full resize-none rounded-lg border border-border bg-input px-3 py-2 text-[13px] text-ink placeholder:text-faint focus:border-accent focus:outline-none"}),e.jsxs("label",{className:"mb-1 block text-[12px] text-muted",children:["System prompt ",e.jsx("span",{className:"text-faint",children:"(optional)"})]}),e.jsx("textarea",{value:r,onChange:n=>o(n.target.value),placeholder:"You are a helpful assistant…",rows:2,className:"mb-4 w-full resize-none rounded-lg border border-border bg-input px-3 py-2 text-[13px] text-ink placeholder:text-faint focus:border-accent focus:outline-none"}),e.jsx("label",{className:"mb-1.5 block text-[12px] text-muted",children:"Tools"}),e.jsx("div",{className:"mb-4 space-y-1.5",children:U.map(n=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg border border-border px-2.5 py-2 hover:bg-panel-2",children:[e.jsx("input",{type:"checkbox",checked:d[n.id],onChange:()=>x(n.id),className:"mt-0.5 accent-[var(--accent)]"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-[13px] font-medium text-ink",children:n.label}),e.jsx("span",{className:"block text-[11px] leading-snug text-faint",children:n.hint})]})]},n.id))}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:t,className:"rounded-lg px-3 py-1.5 text-[13px] text-muted hover:text-ink",children:"Cancel"}),e.jsxs("button",{type:"button",disabled:!l.trim()||c.isPending,onClick:()=>c.mutate(),className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-1.5 text-[13px] font-medium text-white disabled:opacity-50",children:[c.isPending?e.jsx(h,{size:13,className:"animate-spin"}):e.jsx(S,{size:13}),"Run agent"]})]}),c.isError&&e.jsx("p",{className:"mt-2 text-[12px]",style:{color:"var(--err)"},children:c.error.message})]})})}function X({call:t}){const[a,l]=u.useState(!1),i=typeof t.args?.query=="string"?t.args.query:typeof t.args?.url=="string"?t.args.url:JSON.stringify(t.args??{});return e.jsxs("div",{className:"w-full max-w-[85%] rounded-lg border border-border bg-panel px-2.5 py-1.5 text-[12px]",children:[e.jsxs("button",{type:"button",onClick:()=>l(r=>!r),className:"flex w-full items-center gap-1.5 text-left text-muted hover:text-ink",children:[e.jsx(E,{size:12,className:"shrink-0 text-accent"}),e.jsx("span",{className:"font-medium text-ink",children:t.name}),e.jsx("span",{className:"truncate text-faint",children:i})]}),a&&e.jsx("pre",{className:"mt-1.5 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-panel-2 p-2 text-[11px] text-muted",children:t.result})]})}function H({run:t}){const a=C(),l=u.useRef(null),[i,r]=u.useState(""),o=u.useRef(null),d=q({mutationFn:()=>K(t.id),onSuccess:()=>{a.invalidateQueries({queryKey:p.list()})}});u.useEffect(()=>{if(t.status!=="running"&&t.status!=="queued")return;const s=new AbortController;l.current=s;let x="";return(async()=>{try{for await(const c of F(t.id,0,s.signal))if(c.event==="delta")x+=c.data.delta,r(x);else if(c.event==="done"||c.event==="error"){r(""),a.invalidateQueries({queryKey:p.detail(t.id)}),a.invalidateQueries({queryKey:p.list()});break}}catch{}})(),()=>{s.abort(),l.current=null}},[t.id,t.status,a]),u.useEffect(()=>{o.current?.scrollIntoView({behavior:"smooth"})},[i,t.messages?.length]);const m=t.messages??[];return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-2.5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-medium text-ink",children:t.title}),e.jsx(z,{status:t.status})]}),(t.status==="running"||t.status==="queued")&&e.jsx("button",{type:"button",onClick:()=>d.mutate(),className:"rounded-lg border border-border px-3 py-1 text-[12px] text-muted transition-colors hover:border-red-400 hover:text-red-500",children:d.isPending?e.jsx(h,{size:12,className:"inline animate-spin"}):"Cancel"})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto p-4",children:[m.map(s=>e.jsxs("div",{className:b("flex flex-col gap-1.5",s.role==="user"?"items-end":"items-start"),children:[s.toolCalls?.map(x=>e.jsx(X,{call:x},x.id)),(s.content||s.role==="user"||t.status==="running")&&e.jsx("div",{className:b("max-w-[85%] rounded-xl px-3 py-2 text-[13px] leading-relaxed",s.role==="user"?"bg-accent/15 text-ink":"bg-panel-2 text-ink"),children:e.jsx("p",{className:"whitespace-pre-wrap break-words",children:s.content||(s.role==="assistant"&&t.status==="running"?"…":"")})})]},s.id)),i&&e.jsx("div",{className:"flex gap-2",children:e.jsx("div",{className:"max-w-[85%] rounded-xl bg-panel-2 px-3 py-2 text-[13px] leading-relaxed text-ink",children:e.jsx("p",{className:"whitespace-pre-wrap break-words",children:i})})}),t.error&&e.jsxs("div",{className:"rounded-lg bg-red-500/10 px-3 py-2 text-[12px] text-red-500",children:["Error: ",t.error]}),e.jsx("div",{ref:o})]})]})}function ne(){const[t,a]=u.useState(null),[l,i]=u.useState(!1),r=v({queryKey:p.list(),queryFn:$,refetchInterval:s=>(s.state.data??[]).some(n=>n.status==="queued"||n.status==="running")?3e3:!1}),o=v({queryKey:p.detail(t??""),queryFn:()=>I(t),enabled:!!t,refetchInterval:s=>{const x=s.state.data;return x?.status==="queued"||x?.status==="running"?5e3:!1}}),d=r.data??[],m=o.data;return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2.5",children:[e.jsx("span",{className:"text-[13px] font-semibold text-ink",children:"Agents"}),e.jsxs("button",{type:"button",title:"New agent run",onClick:()=>i(!0),className:"flex items-center gap-1 rounded-lg bg-accent px-2 py-1 text-[11px] font-medium text-white transition-opacity hover:opacity-90",children:[e.jsx(N,{size:11})," New"]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r.isLoading&&e.jsx("div",{className:"flex h-20 items-center justify-center",children:e.jsx(h,{size:16,className:"animate-spin text-faint"})}),d.length===0&&!r.isLoading&&e.jsxs("div",{className:"px-4 py-8 text-center",children:[e.jsx(S,{size:28,className:"mx-auto mb-2 text-faint"}),e.jsx("p",{className:"text-[12px] text-muted",children:"No agent runs yet."}),e.jsx("p",{className:"mt-0.5 text-[11px] text-faint",children:"Click “New” to start one."})]}),d.map(s=>e.jsxs("button",{type:"button",onClick:()=>a(s.id),className:b("w-full border-b border-border px-3 py-2.5 text-left transition-colors hover:bg-panel-2",t===s.id&&"bg-panel-2"),children:[e.jsx("p",{className:"mb-0.5 truncate text-[13px] font-medium text-ink",children:s.title}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(z,{status:s.status}),e.jsx("span",{className:"text-[10px] text-faint",children:W(s.createdAt)})]})]},s.id))]})]}),e.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:t?o.isLoading?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(h,{size:20,className:"animate-spin text-faint"})}):m?e.jsx(H,{run:m}):null:e.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[e.jsx(D,{size:32,className:"mb-3 text-faint"}),e.jsx("p",{className:"text-[14px] font-medium text-ink",children:"Select a run"}),e.jsx("p",{className:"mt-1 text-[12px] text-muted",children:"or create a new agent run to get started"}),e.jsxs("button",{type:"button",onClick:()=>i(!0),className:"mt-4 flex items-center gap-1.5 rounded-lg bg-accent px-3 py-1.5 text-[13px] font-medium text-white hover:opacity-90",children:[e.jsx(N,{size:13})," New agent run"]})]})}),l&&e.jsx(B,{onClose:()=>i(!1),onCreated:s=>{a(s),r.refetch()}})]})}export{ne as AgentsScreen};