@hachej/boring-ui-cli 0.1.77 → 0.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/server/modeApps.js +2 -2
- package/dist/server/pluginDiscovery.js +4 -3
- package/package.json +9 -8
- package/public/assets/{DebugDrawer-DH80atiV.js → DebugDrawer-Cvs32ZdL.js} +1 -1
- package/public/assets/{DiagramPane-DAgdN3YX.js → DiagramPane-Wf-HXd6E.js} +5 -5
- package/public/assets/{abnfDiagram-VRR7QNED-DHFtXKha.js → abnfDiagram-VRR7QNED-Dt8-RhJP.js} +1 -1
- package/public/assets/{architectureDiagram-ZJ3FMSHR-BqXoOqPc.js → architectureDiagram-ZJ3FMSHR-BSRHKE-m.js} +1 -1
- package/public/assets/{blockDiagram-677ZJIJ3-CwBNw3pP.js → blockDiagram-677ZJIJ3-w82UNb0-.js} +1 -1
- package/public/assets/{c4Diagram-LMCZKHZV-DbzngMZS.js → c4Diagram-LMCZKHZV-CnLTnzzV.js} +1 -1
- package/public/assets/channel-DE2XmAQG.js +1 -0
- package/public/assets/{chunk-32BRIVSS-CJKug8ts.js → chunk-32BRIVSS-DogxYg_s.js} +1 -1
- package/public/assets/{chunk-C7G6YPKG-BFN4wniS.js → chunk-C7G6YPKG-BZ0GT7YN.js} +1 -1
- package/public/assets/{chunk-EX3LRPZG-D_T6tXSz.js → chunk-EX3LRPZG-BYVb3IAw.js} +1 -1
- package/public/assets/{chunk-HOUHSVGY-OsF2bElz.js → chunk-HOUHSVGY-DlGWDwwE.js} +1 -1
- package/public/assets/{chunk-ICXQ74PX-E0PPsDNl.js → chunk-ICXQ74PX-DVqBJ4f8.js} +1 -1
- package/public/assets/{chunk-MOJQB5TN-CP_dQviu.js → chunk-MOJQB5TN-CgjrD8Od.js} +1 -1
- package/public/assets/{chunk-OGEWGWER-B_ShcHCB.js → chunk-OGEWGWER-DVvbukYU.js} +1 -1
- package/public/assets/{chunk-PUDLZKDR-DCfWKUqx.js → chunk-PUDLZKDR-hBf8GnAd.js} +1 -1
- package/public/assets/{chunk-Q4XR5HBZ-DncequgQ.js → chunk-Q4XR5HBZ-Cr1DWu55.js} +1 -1
- package/public/assets/{chunk-V7JOEXUC-CkWfMBya.js → chunk-V7JOEXUC-DsBAd-bv.js} +1 -1
- package/public/assets/{chunk-VR4S4FIN-Bwauz6ax.js → chunk-VR4S4FIN-sNODziEP.js} +1 -1
- package/public/assets/{chunk-WYO6CB5R-BYQBPZdV.js → chunk-WYO6CB5R-46RnbQFq.js} +2 -2
- package/public/assets/{chunk-ZGVPDNZ5-w40EBMAk.js → chunk-ZGVPDNZ5-7uuk8xCo.js} +1 -1
- package/public/assets/classDiagram-OUVF2IWQ-DCkLnpJB.js +1 -0
- package/public/assets/classDiagram-v2-EOCWNBFH-DCkLnpJB.js +1 -0
- package/public/assets/{createLucideIcon-CwPc8Vzh.js → createLucideIcon-Wu4zuv2w.js} +1 -1
- package/public/assets/{cynefinDiagram-TSTJHNR4-MqlLfQLV.js → cynefinDiagram-TSTJHNR4-B6yp4qEq.js} +1 -1
- package/public/assets/{dagre-VKFMJZFB-BtMel0jZ.js → dagre-VKFMJZFB-DkmyS-cK.js} +1 -1
- package/public/assets/{diagram-FQU43EPY-BLn2JOxM.js → diagram-FQU43EPY-DwGL8br_.js} +1 -1
- package/public/assets/{diagram-G47NLZAW-CcU7cY2d.js → diagram-G47NLZAW-iN9_l81P.js} +1 -1
- package/public/assets/{diagram-NH7WQ7WH-DFv5wLuq.js → diagram-NH7WQ7WH-C5qg58pO.js} +1 -1
- package/public/assets/{diagram-OA4YK3LP-srdMEEtw.js → diagram-OA4YK3LP-Cbm9-jVo.js} +1 -1
- package/public/assets/{diagram-WEI45ONY-CtD4L13_.js → diagram-WEI45ONY-CLcge7ST.js} +1 -1
- package/public/assets/{dist-DNd1zfJo.js → dist-B7vsEq-M.js} +1 -1
- package/public/assets/{ebnfDiagram-CCIWWBDH-_-229G-a.js → ebnfDiagram-CCIWWBDH-DRYda71b.js} +1 -1
- package/public/assets/{erDiagram-Q63AITRT-DJYYhyDf.js → erDiagram-Q63AITRT-C50x4kv9.js} +1 -1
- package/public/assets/flowDiagram-23GEKE2U-T6aK2e27.js +1 -0
- package/public/assets/{ganttDiagram-NO4QXBWP-BDWjR2BL.js → ganttDiagram-NO4QXBWP-CzjvdLdl.js} +1 -1
- package/public/assets/{gitGraphDiagram-IHSO6WYX-6VNHaoaE.js → gitGraphDiagram-IHSO6WYX-HmD8gMoK.js} +1 -1
- package/public/assets/{highlighted-body-OFNGDK62-ClTUT11e.js → highlighted-body-OFNGDK62-Q4gQw1P3.js} +1 -1
- package/public/assets/index-De98Q2XI.js +871 -0
- package/public/assets/{infoDiagram-FWYZ7A6U-C8nPo8f6.js → infoDiagram-FWYZ7A6U-BDOkL07R.js} +1 -1
- package/public/assets/{ishikawaDiagram-FXEZZL3T-DhhRWuLD.js → ishikawaDiagram-FXEZZL3T-B7CHS-KX.js} +1 -1
- package/public/assets/{journeyDiagram-5HDEW3XC-CTgKZqOm.js → journeyDiagram-5HDEW3XC-BgPXXiCJ.js} +1 -1
- package/public/assets/{kanban-definition-HUTT4EX6-CoVQymWJ.js → kanban-definition-HUTT4EX6-BbIJZ7B-.js} +1 -1
- package/public/assets/{line-DIJ2uGIx.js → line-Cd13SzRb.js} +1 -1
- package/public/assets/mermaid-GHXKKRXX-D-z0GHSU.js +1 -0
- package/public/assets/{mindmap-definition-LN4V7U3C-CnBQGuc8.js → mindmap-definition-LN4V7U3C-ea3qn5kb.js} +1 -1
- package/public/assets/{pegDiagram-2B236MQR-DS30M766.js → pegDiagram-2B236MQR-Bs7XJiI0.js} +1 -1
- package/public/assets/{pieDiagram-ENE6RG2P-BiFYahi8.js → pieDiagram-ENE6RG2P-C01cxejD.js} +1 -1
- package/public/assets/{quadrantDiagram-ABIIQ3AL-7RXOQFPw.js → quadrantDiagram-ABIIQ3AL-Bmr2CzYs.js} +1 -1
- package/public/assets/{railroadDiagram-RFXS5EU6-BfYMSm1Y.js → railroadDiagram-RFXS5EU6-SVkCP9zD.js} +1 -1
- package/public/assets/{requirementDiagram-TGXJPOKE-BcPpT5PP.js → requirementDiagram-TGXJPOKE-CEY-npdU.js} +1 -1
- package/public/assets/{sankeyDiagram-HTMAVEWB-BGYvXFPC.js → sankeyDiagram-HTMAVEWB-BSdnx5W8.js} +1 -1
- package/public/assets/{sequenceDiagram-DBY2YBRQ-BQDw_5wi.js → sequenceDiagram-DBY2YBRQ-BYjKenZ9.js} +1 -1
- package/public/assets/{stateDiagram-2N3HPSRC-tGXvsFbG.js → stateDiagram-2N3HPSRC-DAtddhRS.js} +1 -1
- package/public/assets/stateDiagram-v2-6OUMAXLB-DRN_cmUW.js +1 -0
- package/public/assets/{swimlanes-5IMT3BWC-COzjOnAn.js → swimlanes-5IMT3BWC-Cs_LTy64.js} +1 -1
- package/public/assets/swimlanesDiagram-G3AALYLV-_4EG4bfC.js +8 -0
- package/public/assets/{timeline-definition-FHXFAJF6-D3-XwGPp.js → timeline-definition-FHXFAJF6-BNdGHM8h.js} +1 -1
- package/public/assets/{vennDiagram-L72KCM5P-eBsFqZoN.js → vennDiagram-L72KCM5P-DF7H8jiJ.js} +1 -1
- package/public/assets/{wardleyDiagram-EHGQE667-CKvJIjcw.js → wardleyDiagram-EHGQE667-DogfvxG4.js} +1 -1
- package/public/assets/{xychartDiagram-FW5EYKEG-C49Uf4Nk.js → xychartDiagram-FW5EYKEG-BbVtwAPw.js} +1 -1
- package/public/index.html +10 -10
- package/public/assets/channel-C6WZXm7Y.js +0 -1
- package/public/assets/classDiagram-OUVF2IWQ-D19WQ2fv.js +0 -1
- package/public/assets/classDiagram-v2-EOCWNBFH-D19WQ2fv.js +0 -1
- package/public/assets/flowDiagram-23GEKE2U-DVtDhScs.js +0 -1
- package/public/assets/index-B52MzomI.js +0 -871
- package/public/assets/mermaid-GHXKKRXX-NeIk_INh.js +0 -1
- package/public/assets/stateDiagram-v2-6OUMAXLB-CYSK2pph.js +0 -1
- package/public/assets/swimlanesDiagram-G3AALYLV-2xI_2ZRC.js +0 -8
package/README.md
CHANGED
|
@@ -39,6 +39,20 @@ configured it prints a guide: in another terminal run `pi` (or
|
|
|
39
39
|
sign in to a subscription (Claude Pro/Max, ChatGPT Plus, Copilot). Credentials
|
|
40
40
|
are saved at `~/.pi/agent/auth.json`; refresh the browser afterward.
|
|
41
41
|
|
|
42
|
+
### Invoke scheduled automations
|
|
43
|
+
|
|
44
|
+
Folder mode exposes a loopback-only due-operation endpoint. It evaluates only
|
|
45
|
+
the current cron minute and never starts a background timer or daemon:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
curl --fail --silent --show-error -X POST \
|
|
49
|
+
http://127.0.0.1:5200/api/v1/boring-automation/due
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Configure that command in user-owned cron/systemd while `boring-ui` is already
|
|
53
|
+
running. Missed minutes are intentionally not backfilled. The endpoint is
|
|
54
|
+
unavailable in workspaces mode and hosted deployments.
|
|
55
|
+
|
|
42
56
|
---
|
|
43
57
|
|
|
44
58
|
## Commands
|
package/dist/server/modeApps.js
CHANGED
|
@@ -263,7 +263,7 @@ async function createFolderModeApp(opts) {
|
|
|
263
263
|
const runtimeHost = await createPluginFrontRuntimeHost({
|
|
264
264
|
onDiagnostic: (diagnostic) => diagnosticsStore.record(diagnostic)
|
|
265
265
|
});
|
|
266
|
-
const pluginDirs = pluginDiscovery.resolveCliBoringPluginDirs(workspaceRoot);
|
|
266
|
+
const pluginDirs = pluginDiscovery.resolveCliBoringPluginDirs(workspaceRoot, { includeFolderModeAutomation: true });
|
|
267
267
|
const runtimeProvisioning = await provisionCliWorkspaceRuntime({
|
|
268
268
|
workspaceRoot,
|
|
269
269
|
mode: opts.mode,
|
|
@@ -283,7 +283,7 @@ async function createFolderModeApp(opts) {
|
|
|
283
283
|
// CLI-bundled internal plugins, resolved to absolute package dirs. This
|
|
284
284
|
// drives the server-side install array (boot-time routes/agentTools);
|
|
285
285
|
// additionalBoringPluginDirs only feeds the asset-manager scan.
|
|
286
|
-
defaultPluginPackages: pluginDiscovery.resolveCliDefaultPluginPackagePaths(),
|
|
286
|
+
defaultPluginPackages: pluginDiscovery.resolveCliDefaultPluginPackagePaths({ includeFolderModeAutomation: true }),
|
|
287
287
|
additionalBoringPluginDirs: pluginDirs,
|
|
288
288
|
workspaceBridge: { allowInsecureLocalCliBrowserAuth: opts.allowInsecureLocalBridgeAuth === true },
|
|
289
289
|
boringPluginFrontTargetResolver: runtimeHost.createFrontTargetResolver(FOLDER_RUNTIME_PLUGIN_WORKSPACE_ID)
|
|
@@ -24,11 +24,12 @@ function getGlobalPiAgentRoot(options = {}) {
|
|
|
24
24
|
return resolve(options.globalAgentRoot ?? dirname(getGlobalPiExtensionsRoot(options)));
|
|
25
25
|
}
|
|
26
26
|
const CLI_DEFAULT_PLUGIN_PACKAGES = ["@hachej/boring-ask-user", "@hachej/boring-diagram", "@hachej/boring-tasks"];
|
|
27
|
-
|
|
27
|
+
const CLI_FOLDER_MODE_PLUGIN_PACKAGES = [...CLI_DEFAULT_PLUGIN_PACKAGES, "@hachej/boring-automation"];
|
|
28
|
+
function resolveCliDefaultPluginPackagePaths(options = {}) {
|
|
28
29
|
try {
|
|
29
30
|
return resolveDefaultWorkspacePluginPackagePaths({
|
|
30
31
|
anchorDir: resolveBoringUiCliPackageRoot(),
|
|
31
|
-
defaultPluginPackages: CLI_DEFAULT_PLUGIN_PACKAGES
|
|
32
|
+
defaultPluginPackages: options.includeFolderModeAutomation ? CLI_FOLDER_MODE_PLUGIN_PACKAGES : CLI_DEFAULT_PLUGIN_PACKAGES
|
|
32
33
|
});
|
|
33
34
|
} catch (error) {
|
|
34
35
|
console.error("[boring-ui] failed to resolve default plugin packages:", error instanceof Error ? error.message : String(error));
|
|
@@ -46,7 +47,7 @@ function resolveCliBoringPluginDirs(workspaceRoot, options = {}) {
|
|
|
46
47
|
];
|
|
47
48
|
const includeDefaultPackages = options.includeDefaultPackages ?? true;
|
|
48
49
|
const roots = [
|
|
49
|
-
...includeDefaultPackages ? resolveCliDefaultPluginPackagePaths().map((rootDir) => ({ rootDir, kind: "internal" })) : [],
|
|
50
|
+
...includeDefaultPackages ? resolveCliDefaultPluginPackagePaths({ includeFolderModeAutomation: options.includeFolderModeAutomation }).map((rootDir) => ({ rootDir, kind: "internal" })) : [],
|
|
50
51
|
{ rootDir: getGlobalPiExtensionsRoot(options), kind: "external" },
|
|
51
52
|
{ rootDir: globalScope.npmDir, kind: "external" },
|
|
52
53
|
{ rootDir: globalScope.gitDir, kind: "external" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-ui-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.79",
|
|
4
4
|
"description": "Turn an agent into an app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,13 +21,14 @@
|
|
|
21
21
|
"typescript": "^6.0.3",
|
|
22
22
|
"vite": "^8.1.2",
|
|
23
23
|
"yaml": "^2.9.0",
|
|
24
|
-
"@hachej/boring-ask-user": "0.1.
|
|
25
|
-
"@hachej/boring-
|
|
26
|
-
"@hachej/boring-
|
|
27
|
-
"@hachej/boring-
|
|
28
|
-
"@hachej/boring-
|
|
29
|
-
"@hachej/boring-ui-
|
|
30
|
-
"@hachej/boring-
|
|
24
|
+
"@hachej/boring-ask-user": "0.1.79",
|
|
25
|
+
"@hachej/boring-agent": "0.1.79",
|
|
26
|
+
"@hachej/boring-automation": "0.1.79",
|
|
27
|
+
"@hachej/boring-diagram": "0.1.79",
|
|
28
|
+
"@hachej/boring-tasks": "0.1.79",
|
|
29
|
+
"@hachej/boring-ui-kit": "0.1.79",
|
|
30
|
+
"@hachej/boring-ui-plugin-cli": "0.1.79",
|
|
31
|
+
"@hachej/boring-workspace": "0.1.79"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@tailwindcss/vite": "^4.3.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{n as t,t as n}from"./jsx-runtime-CBD9r_Rc.js";import{Ct as r,G as i,St as a,Tt as o,d as s,wt as c}from"./createLucideIcon-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{n as t,t as n}from"./jsx-runtime-CBD9r_Rc.js";import{Ct as r,G as i,St as a,Tt as o,d as s,wt as c}from"./createLucideIcon-Wu4zuv2w.js";import{A as l,E as u,M as d,N as f,T as p,j as m,k as h}from"./index-De98Q2XI.js";var g=e(t(),1),_=e(n(),1);function v({value:e,label:t}){let[n,r]=(0,g.useState)(!1);return(0,_.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-xs`,onClick:(0,g.useCallback)(()=>{p(e).then(e=>{e&&(r(!0),window.setTimeout(()=>r(!1),1200))})},[e]),className:`text-muted-foreground/60`,"aria-label":t,title:t,children:n?(0,_.jsx)(f,{className:`h-3 w-3`}):(0,_.jsx)(l,{className:`h-3 w-3`})})}function y({label:e,value:t}){return(0,_.jsxs)(`div`,{className:`rounded-md border border-border/40 bg-muted/20 p-2`,children:[(0,_.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,_.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,_.jsx)(v,{value:t,label:`Copy ${e}`})]}),(0,_.jsx)(`code`,{className:`block break-all font-mono text-[11px] leading-relaxed text-foreground dark:text-zinc-100`,children:t})]})}function b({sessionId:e}){return(0,_.jsxs)(`div`,{className:`flex flex-col gap-3 overflow-auto p-3 text-[11px] text-muted-foreground dark:text-zinc-300`,children:[(0,_.jsx)(`p`,{className:`text-muted-foreground dark:text-zinc-300`,children:`This web chat is backed by a runtime session. Use the id below for support or debugging.`}),(0,_.jsx)(y,{label:`Runtime session id`,value:e})]})}var x=2500,S=20;function C({apiBaseUrl:e,fetch:t,sessionId:n,requestHeaders:r,storageScope:a}){let[o,s]=(0,g.useState)({kind:`loading`}),[c,l]=(0,g.useState)(0),u=(0,g.useRef)(0),d=(0,g.useCallback)(()=>{u.current=0,l(e=>e+1)},[]);return(0,g.useEffect)(()=>{let i=!1,o=null;return s({kind:`loading`}),(t??globalThis.fetch.bind(globalThis))(j(e,`/api/v1/agent/sessions/${encodeURIComponent(n)}/system-prompt`),{headers:M(r,a)}).then(async e=>{if(i)return;if(e.ok){let t=await e.json();if(typeof t.systemPrompt==`string`){u.current=0,s({kind:`ok`,text:t.systemPrompt});return}}let t=(await e.json().catch(()=>null))?.error?.message??`HTTP ${e.status}`;e.status===404&&u.current<S?(s({kind:`empty`,reason:t}),o=setTimeout(()=>{i||(u.current++,l(e=>e+1))},x)):s(e.status===404?{kind:`empty`,reason:t}:{kind:`error`,reason:t})}).catch(e=>{i||s({kind:`error`,reason:e instanceof Error?e.message:String(e)})}),()=>{i=!0,o&&clearTimeout(o)}},[e,t,n,r,c,a]),(0,_.jsxs)(`div`,{className:`flex flex-col h-full min-h-0`,children:[(0,_.jsxs)(`div`,{className:`shrink-0 flex items-center justify-between px-3 pt-2 pb-1 border-b border-border/40`,children:[(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 font-mono`,children:o.kind===`ok`?`${o.text.length.toLocaleString()} chars`:o.kind===`loading`?`loading…`:o.kind===`empty`?`waiting for session · retry ${u.current}/${S}`:`error`}),o.kind!==`loading`&&(0,_.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-xs`,onClick:d,className:`text-muted-foreground/60`,"aria-label":`Refresh system prompt`,children:(0,_.jsx)(h,{className:`h-3 w-3`})})]}),(o.kind===`loading`||o.kind===`empty`)&&(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground p-3`,children:o.kind===`loading`?`Loading…`:o.reason}),o.kind===`error`&&(0,_.jsx)(`p`,{className:`text-[11px] text-destructive p-3`,children:o.reason}),o.kind===`ok`&&(0,_.jsx)(`pre`,{className:`flex-1 overflow-auto px-3 py-2 font-mono text-[11px] leading-relaxed text-foreground whitespace-pre-wrap break-words`,children:o.text})]})}function w(e){let t=e,n=t?.type??`?`;if(n===`text`){let e=String(t.text??``);return e.slice(0,80)+(e.length>80?`…`:``)}if(n===`tool-invocation`){let e=t.toolInvocation,n=String(e?.state??``);return`${e?.toolName??`?`}() · ${n}`}if(n===`reasoning`){let e=String(t.text??t.reasoning??``);return e.slice(0,80)+(e.length>80?`…`:``)}return n}function T(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=r,a=i.createdAt?new Date(i.createdAt).toISOString().slice(11,23):null;for(let e=0;e<r.parts.length;e++){let i=r.parts[e];t.push({msgId:r.id,msgIndex:n,role:r.role,time:a,partIndex:e,partType:i?.type??`unknown`,part:i})}}return t}function E({messages:e}){let t=T(e),[n,r]=(0,g.useState)(null),i=(0,g.useRef)(null),a=(0,g.useRef)(t.length);return(0,g.useEffect)(()=>{t.length!==a.current&&(i.current?.scrollIntoView({behavior:`smooth`}),a.current=t.length)},[t.length]),t.length===0?(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground p-3`,children:`No messages yet.`}):(0,_.jsxs)(`div`,{className:`flex flex-col h-full min-h-0`,children:[(0,_.jsxs)(`div`,{className:`shrink-0 px-3 pt-2 pb-1 text-[10px] text-muted-foreground/80 font-mono border-b border-border/40`,children:[e.length,` msg · `,t.length,` parts`]}),(0,_.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[t.map(e=>{let t=`${e.msgId}:${e.partIndex}`,i=n===t;return(0,_.jsxs)(`div`,{className:`border-b border-border/30 last:border-0`,children:[(0,_.jsxs)(s,{type:`button`,variant:`ghost`,onClick:()=>r(i?null:t),className:`h-auto w-full justify-start gap-1.5 rounded-none px-2 py-1.5 text-left`,children:[(0,_.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground/40`,children:i?(0,_.jsx)(d,{className:`h-3 w-3`}):(0,_.jsx)(m,{className:`h-3 w-3`})}),(0,_.jsx)(`span`,{className:`font-mono text-[10px] shrink-0 w-20`,children:e.time?(0,_.jsx)(`span`,{className:`text-muted-foreground/60`,children:e.time}):(0,_.jsxs)(`span`,{className:`text-muted-foreground/30`,children:[`m`,e.msgIndex]})}),(0,_.jsx)(`span`,{className:u(`shrink-0 font-mono text-[10px] w-14`,e.role===`user`?`text-accent`:`text-muted-foreground`),children:e.role}),(0,_.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/60 w-24`,children:e.partType}),(0,_.jsx)(`span`,{className:`flex-1 min-w-0 font-mono text-[11px] text-foreground truncate`,children:w(e.part)})]}),i&&(0,_.jsx)(`pre`,{className:`px-3 pb-2 font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap break-words bg-muted/20`,children:JSON.stringify(e.part,null,2)})]},t)}),(0,_.jsx)(`div`,{ref:i})]})]})}var D=[{id:`session`,label:`Session`},{id:`prompt`,label:`System prompt`},{id:`messages`,label:`Messages`}],O=280,k=800;function A({apiBaseUrl:e,fetch:t,sessionId:n,messages:i,requestHeaders:s,storageScope:l,width:d,onWidthChange:f}){let[p,m]=(0,g.useState)(`session`);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{onMouseDown:(0,g.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=d,r=e=>{let r=t-e.clientX;f(Math.min(k,Math.max(O,n+r)))},i=()=>{window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i)};window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)},[d,f]),className:`w-1 shrink-0 cursor-col-resize hover:bg-accent/40 active:bg-accent/60 transition-colors`,"aria-hidden":!0}),(0,_.jsx)(`aside`,{style:{width:d},className:u(`flex h-full shrink-0 flex-col border-l border-border/60`,`bg-[oklch(from_var(--background)_calc(l-0.01)_c_h)]`),children:(0,_.jsxs)(a,{value:p,onValueChange:e=>m(e),className:`flex flex-col flex-1 min-h-0 overflow-hidden`,children:[(0,_.jsx)(`header`,{className:`flex shrink-0 items-center gap-0 border-b border-border/60 px-1`,children:(0,_.jsx)(c,{variant:`line`,className:`h-auto gap-0 p-0 w-full`,children:D.map(({id:e,label:t})=>(0,_.jsx)(o,{value:e,className:`h-8 flex-none px-3 py-2 text-[11px] font-medium data-[state=active]:after:bg-[color:var(--accent)]`,children:t},e))})}),(0,_.jsx)(r,{value:`session`,forceMount:!0,className:`flex flex-col flex-1 min-h-0 overflow-hidden data-[state=inactive]:hidden`,children:(0,_.jsx)(b,{sessionId:n})}),(0,_.jsx)(r,{value:`prompt`,forceMount:!0,className:`flex flex-col flex-1 min-h-0 overflow-hidden data-[state=inactive]:hidden`,children:(0,_.jsx)(C,{apiBaseUrl:e,fetch:t,sessionId:n,requestHeaders:s,storageScope:l})}),(0,_.jsx)(r,{value:`messages`,forceMount:!0,className:`flex flex-col flex-1 min-h-0 overflow-hidden data-[state=inactive]:hidden`,children:(0,_.jsx)(E,{messages:i})})]})})]})}function j(e,t){return`${e?.replace(/\/$/,``)??``}${t}`}function M(e,t){if(!e&&!t)return;let n={...e??{}},r=Object.keys(n).some(e=>e.toLowerCase()===`x-boring-storage-scope`);return t&&!r&&(n[`x-boring-storage-scope`]=t),n}export{A as DebugDrawer};
|