kennel 0.2.11 → 0.2.13
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/cli/src/plugins/external.js +19 -7
- package/dist/cli/src/site/server-plugins.d.ts +1 -4
- package/dist/core/api-client.js +3 -11
- package/dist/core/runtime.js +84 -695
- package/dist/package/preview.js +99 -729
- package/dist/plugins/external.js +19 -7
- package/dist/site/server-plugins.d.ts +1 -4
- package/dist/site/server-plugins.js +28 -537
- package/kernel/apps/web/package.json +0 -1
- package/kernel/apps/web/src/app.css +0 -1
- package/kernel/apps/web/src/app.tsx +7 -24
- package/kernel/apps/web/src/folder-plugin-view.tsx +6 -3
- package/kernel/apps/web/src/plugins.ts +2 -14
- package/kernel/apps/web/vite.config.ts +22 -20
- package/kernel/packages/api/openapi.json +85 -224
- package/kernel/packages/api/package.json +0 -1
- package/kernel/packages/api/src/contracts/schemas.ts +1 -9
- package/kernel/packages/api/src/server/folder-metadata-plugin.ts +9 -151
- package/kernel/packages/api/src/server/plugins.ts +11 -26
- package/kernel/packages/api/src/shared/viewer-route.ts +3 -5
- package/kernel/packages/api-client/src/generated.d.ts +16 -53
- package/kernel/packages/markdown/README.md +2 -2
- package/kernel/packages/notes/package.json +1 -0
- package/kernel/packages/notes/src/client.tsx +0 -1
- package/kernel/packages/notes/src/manifest.ts +7 -0
- package/kernel/packages/notes/src/pages/notes-page.tsx +1 -1
- package/kernel/packages/notes/src/ui/folder-notes-list.tsx +52 -7
- package/kernel/packages/plugins/SKILL.md +3 -2
- package/kernel/packages/plugins/package.json +5 -1
- package/kernel/packages/plugins/src/hooks.ts +24 -0
- package/kernel/packages/plugins/src/index.ts +1 -7
- package/kernel/packages/plugins/src/page.ts +0 -7
- package/kernel/packages/plugins/src/types.ts +8 -0
- package/kernel/packages/plugins/tsconfig.json +1 -1
- package/kernel/packages/plugins/tsup.config.ts +1 -0
- package/kernel/packages/ui/src/components/folder-activity.tsx +16 -98
- package/kernel/packages/ui/src/components/folder-landing.tsx +4 -0
- package/kernel/packages/ui/src/components/markdown-copy-block.tsx +78 -0
- package/kernel/packages/ui/src/components/pagination.tsx +88 -2
- package/kernel/packages/ui/src/components/plugin-icon.tsx +19 -0
- package/kernel/packages/ui/src/lib/folder-activity.ts +4 -17
- package/kernel/packages/ui/src/lib/source-components.tsx +12 -6
- package/kernel/packages/ui/src/styles/folder-activity.css +1 -31
- package/package.json +2 -2
- package/web/assets/{abnfDiagram-VRR7QNED-CSaxgLw6.js → abnfDiagram-VRR7QNED-Dt7QEF5H.js} +1 -1
- package/web/assets/app-C1j063QX.js +2 -0
- package/web/assets/app-options-98-a6ivv.js +25 -0
- package/web/assets/{app-view-header-Cpx74SQs.js → app-view-header-BJ9CWTE1.js} +1 -1
- package/web/assets/{arc-DOrTJz--.js → arc-PFB0H7oD.js} +1 -1
- package/web/assets/{architectureDiagram-ZJ3FMSHR-EjOjwlGK.js → architectureDiagram-ZJ3FMSHR-BHLqEXlZ.js} +1 -1
- package/web/assets/{ask-tray-DLEoRbpV.js → ask-tray-C3gBesHJ.js} +1 -1
- package/web/assets/{blockDiagram-677ZJIJ3-Dg2LWLOW.js → blockDiagram-677ZJIJ3-UbnYoYDg.js} +1 -1
- package/web/assets/{button-C6arH7zt.js → button-CuuAtS1I.js} +1 -1
- package/web/assets/{c4Diagram-LMCZKHZV-CWHqGPk8.js → c4Diagram-LMCZKHZV-4OSx1V4W.js} +1 -1
- package/web/assets/channel-BuvY5cQN.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-Dzz0QWV_.js → chunk-2Q5K7J3B-CgxJ1aJb.js} +1 -1
- package/web/assets/{chunk-32BRIVSS-BocStooX.js → chunk-32BRIVSS-Bfwxg2LM.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-D8BF5Y5h.js → chunk-5VM5RSS4-BZN9a2hI.js} +1 -1
- package/web/assets/{chunk-EX3LRPZG-CWMl9KkL.js → chunk-EX3LRPZG-CrH6hhqq.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-BZEr7iFk.js → chunk-JWPE2WC7-Ddn7ZSp8.js} +1 -1
- package/web/assets/{chunk-MOJQB5TN-DbKnLJ33.js → chunk-MOJQB5TN-9lJ7f_hI.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-BF9KWoi2.js → chunk-RYQCIY6F-QrFo_00s.js} +1 -1
- package/web/assets/{chunk-V7JOEXUC-e88zamUH.js → chunk-V7JOEXUC-Dn0lQjVf.js} +1 -1
- package/web/assets/{chunk-VR4S4FIN-NDHM58HJ.js → chunk-VR4S4FIN-DXVPySkB.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-BtzSzNoD.js → chunk-XXDRQBXY-CBiFDOdZ.js} +1 -1
- package/web/assets/classDiagram-OUVF2IWQ-DCYNCJhe.js +1 -0
- package/web/assets/classDiagram-v2-EOCWNBFH-DCYNCJhe.js +1 -0
- package/web/assets/client-DBJY3XDL.js +43 -0
- package/web/assets/client-DKJs0w4y.js +6 -0
- package/web/assets/{command-BWtewOrt.js → command-onjTnuXT.js} +1 -1
- package/web/assets/{copy-context-YESgZ_hu.js → copy-context-CciRaLNN.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-i7x8jZ9M.js → cose-bilkent-JH36ORCC-CGRic2um.js} +1 -1
- package/web/assets/{cynefin-VYW2F7L2-D8HPrHMt.js → cynefin-VYW2F7L2-Blk0Lu0l.js} +1 -1
- package/web/assets/{cynefinDiagram-TSTJHNR4-BtkeCNXb.js → cynefinDiagram-TSTJHNR4-DpnnHRDK.js} +1 -1
- package/web/assets/{dagre-VKFMJZFB-oIThwshO.js → dagre-VKFMJZFB-llzMokKp.js} +1 -1
- package/web/assets/{diagram-FQU43EPY-DTuhEo03.js → diagram-FQU43EPY-DC6xHovR.js} +1 -1
- package/web/assets/{diagram-G47NLZAW-BcQ_4_fE.js → diagram-G47NLZAW-B8GVS3EA.js} +1 -1
- package/web/assets/{diagram-NH7WQ7WH-BA4VC8Du.js → diagram-NH7WQ7WH-DWUaARfh.js} +1 -1
- package/web/assets/{diagram-OA4YK3LP-BOpyrmty.js → diagram-OA4YK3LP-9Uaes_Yi.js} +1 -1
- package/web/assets/{diagram-WEI45ONY-BzrSPDJ7.js → diagram-WEI45ONY-DPPTBWud.js} +1 -1
- package/web/assets/document-D23WzFsW.js +23 -0
- package/web/assets/{ebnfDiagram-CCIWWBDH-BNV_4xDp.js → ebnfDiagram-CCIWWBDH-BPrKneNw.js} +1 -1
- package/web/assets/{entities-D0qpC3B9.js → entities-DPg0B8vd.js} +1 -1
- package/web/assets/{erDiagram-Q63AITRT-NT1La9pi.js → erDiagram-Q63AITRT-CFqYBcnb.js} +1 -1
- package/web/assets/{file-viewer-C1N6vaip.js → file-viewer-Ck73SsLA.js} +1 -1
- package/web/assets/{flowDiagram-23GEKE2U-CIYWUYkz.js → flowDiagram-23GEKE2U-C7RpYqaT.js} +1 -1
- package/web/assets/folder-filter-bar-DzejUj87.js +4 -0
- package/web/assets/{folder-image-Bz0xznQT.js → folder-image-BjIicmQ6.js} +1 -1
- package/web/assets/folder-landing-CCIXZfkp.js +55 -0
- package/web/assets/folder-list-TuRwuTss.js +1 -0
- package/web/assets/folder-mobile-bar-Bqnfwi-z.js +1 -0
- package/web/assets/folder-plugin-view-CrinCX1o.js +2 -0
- package/web/assets/{ganttDiagram-NO4QXBWP-DeUfoXQA.js → ganttDiagram-NO4QXBWP-Cz2sxU8F.js} +1 -1
- package/web/assets/{gitGraphDiagram-IHSO6WYX-DMeTgUPh.js → gitGraphDiagram-IHSO6WYX-BSuz0yF-.js} +1 -1
- package/web/assets/{index-CCXE8zc9.js → index-BVyeNcuc.js} +1 -1
- package/web/assets/{index-CegvVQ1C.js → index-Cg-gtBkw.js} +1 -1
- package/web/assets/index-DLn_2LPp.js +2 -0
- package/web/assets/{index-DY0VGBht.js → index-DbVDdnzL.js} +1 -1
- package/web/assets/index-uY9jLiL5.css +1 -0
- package/web/assets/{infoDiagram-FWYZ7A6U-DI_P8Ghi.js → infoDiagram-FWYZ7A6U-CpeKgqoS.js} +1 -1
- package/web/assets/input-Bz_puamS.js +9 -0
- package/web/assets/{ishikawaDiagram-FXEZZL3T-B8bM-8CD.js → ishikawaDiagram-FXEZZL3T-5c2Tmknb.js} +1 -1
- package/web/assets/{journeyDiagram-5HDEW3XC-pviYejXU.js → journeyDiagram-5HDEW3XC-Cu-wRkR4.js} +1 -1
- package/web/assets/{kanban-definition-HUTT4EX6-DfvdDvpU.js → kanban-definition-HUTT4EX6-BunSqkPe.js} +1 -1
- package/web/assets/{linear-DNOuKTk_.js → linear-C8e8bGVv.js} +1 -1
- package/web/assets/{mermaid.core-CisVJ_Cs.js → mermaid.core-DLgjY1g2.js} +4 -4
- package/web/assets/{metadata-C7E_6HIN.js → metadata-DEfJKlnd.js} +1 -1
- package/web/assets/{mindmap-definition-LN4V7U3C-DzdcaduN.js → mindmap-definition-LN4V7U3C-W9ENYFOD.js} +1 -1
- package/web/assets/{pegDiagram-2B236MQR-D_7xhlXd.js → pegDiagram-2B236MQR-0vPlHCFp.js} +1 -1
- package/web/assets/{pieDiagram-ENE6RG2P-CisikHMW.js → pieDiagram-ENE6RG2P-CakaveRV.js} +1 -1
- package/web/assets/{popover-D7MTK-sz.js → popover-3AMcPJpt.js} +1 -1
- package/web/assets/{project-search-dialog-BsHc39D0.js → project-search-dialog-BSKA4peX.js} +1 -1
- package/web/assets/{quadrantDiagram-ABIIQ3AL-D6adg-7z.js → quadrantDiagram-ABIIQ3AL-jxHw_egj.js} +1 -1
- package/web/assets/{railroadDiagram-RFXS5EU6-CyPAHeJ-.js → railroadDiagram-RFXS5EU6-lIjDXPZt.js} +1 -1
- package/web/assets/{requirementDiagram-TGXJPOKE-CgpSiPTv.js → requirementDiagram-TGXJPOKE-C-JiT4bc.js} +1 -1
- package/web/assets/{sankeyDiagram-HTMAVEWB-BxvReW6S.js → sankeyDiagram-HTMAVEWB-SuLPAw9X.js} +1 -1
- package/web/assets/{search-DEgwpq-P.js → search-CKujW14f.js} +1 -1
- package/web/assets/{selection-popup-d94JnDPy.js → selection-popup-CtxT9SWn.js} +3 -3
- package/web/assets/{sequenceDiagram-DBY2YBRQ-uuplzETI.js → sequenceDiagram-DBY2YBRQ-o9UwTkZR.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-Bi3F7nOa.js → sizeCapture-X5ZJPWSS-ClbWGybF.js} +1 -1
- package/web/assets/{stateDiagram-2N3HPSRC-DqypF7lE.js → stateDiagram-2N3HPSRC-Ce4avoWx.js} +1 -1
- package/web/assets/stateDiagram-v2-6OUMAXLB-CsrPTZoJ.js +1 -0
- package/web/assets/{swimlanes-5IMT3BWC-CGD9YT1l.js → swimlanes-5IMT3BWC-DMZI4XZT.js} +2 -2
- package/web/assets/swimlanesDiagram-G3AALYLV-pShSVcTd.js +8 -0
- package/web/assets/{timeline-definition-FHXFAJF6-DCjNS9Ol.js → timeline-definition-FHXFAJF6-CPIpIgPN.js} +1 -1
- package/web/assets/{utils-DCaHk0Gm.js → utils-Cg80pk1W.js} +1 -1
- package/web/assets/{vennDiagram-L72KCM5P-BJ58yQgD.js → vennDiagram-L72KCM5P-_rha8uDZ.js} +1 -1
- package/web/assets/view-context-BDtIUHQy.js +229 -0
- package/web/assets/{viewer-capabilities-DCuJdf64.js → viewer-capabilities-YYZqMs56.js} +1 -1
- package/web/assets/{wardleyDiagram-EHGQE667-BiLuq9mr.js → wardleyDiagram-EHGQE667-D4EAOS35.js} +1 -1
- package/web/assets/{xychartDiagram-FW5EYKEG-DzAZpIRG.js → xychartDiagram-FW5EYKEG-DR8PwXpe.js} +1 -1
- package/web/index.html +2 -2
- package/kernel/packages/agents/eslint.config.js +0 -10
- package/kernel/packages/agents/package.json +0 -75
- package/kernel/packages/agents/src/agent-card.tsx +0 -334
- package/kernel/packages/agents/src/client.tsx +0 -13
- package/kernel/packages/agents/src/index.ts +0 -18
- package/kernel/packages/agents/src/manifest.ts +0 -7
- package/kernel/packages/agents/src/node.ts +0 -447
- package/kernel/packages/agents/src/profiles.ts +0 -137
- package/kernel/packages/agents/src/resolve.ts +0 -69
- package/kernel/packages/agents/src/server.ts +0 -60
- package/kernel/packages/agents/src/types.ts +0 -82
- package/kernel/packages/agents/src/viewer.tsx +0 -370
- package/kernel/packages/agents/test/profiles.test.mjs +0 -88
- package/kernel/packages/agents/test/resolve.test.mjs +0 -729
- package/kernel/packages/agents/tsconfig.json +0 -17
- package/kernel/packages/api/test/agents-loading.test.ts +0 -94
- package/kernel/packages/ui/src/components/folder-skill-list.tsx +0 -62
- package/web/assets/app-DoXXGPMx.js +0 -2
- package/web/assets/app-options-jTBHy0A7.js +0 -25
- package/web/assets/channel-54w4vQjC.js +0 -1
- package/web/assets/classDiagram-OUVF2IWQ-Bh9Ib2pw.js +0 -1
- package/web/assets/classDiagram-v2-EOCWNBFH-Bh9Ib2pw.js +0 -1
- package/web/assets/client-BgUDusrU.js +0 -5
- package/web/assets/client-COaHUqSC.js +0 -17
- package/web/assets/client-UC06V2VL.js +0 -22
- package/web/assets/document-BDtU3CbX.js +0 -19
- package/web/assets/folder-filter-bar-C_2Mobfq.js +0 -4
- package/web/assets/folder-landing-3gqbGaYS.js +0 -54
- package/web/assets/folder-list-DDI0TF2e.js +0 -1
- package/web/assets/folder-metadata-DjV3ZUra.js +0 -2
- package/web/assets/folder-mobile-bar-CF4CpJXL.js +0 -1
- package/web/assets/folder-plugin-view-C48J0HKe.js +0 -3
- package/web/assets/index-Bp9DidgD.js +0 -1
- package/web/assets/index-CXhBn-ar.js +0 -1
- package/web/assets/index-CtuOSBHa.js +0 -2
- package/web/assets/index-Dwhf8F_U.css +0 -1
- package/web/assets/select-DGaccqVB.js +0 -30
- package/web/assets/stateDiagram-v2-6OUMAXLB-EsEb0a5Q.js +0 -1
- package/web/assets/swimlanesDiagram-G3AALYLV-DKIYuN5l.js +0 -8
- package/web/assets/use-folder-filter-hA6fa7nm.js +0 -1
- package/web/assets/view-context-BrzQ7WBV.js +0 -229
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./tanstack-YzX_Mi37.js";import{a as i}from"./view-context-
|
|
1
|
+
import{m as e}from"./tanstack-YzX_Mi37.js";import{a as i}from"./view-context-BDtIUHQy.js";const a={acp:!1,download:!1,hostActions:"none",local:!1,viewer:"unknown"};async function t(){return i.capabilities().catch(()=>a)}function n(){return e.useQuery({gcTime:5*6e4,queryKey:["viewer-capabilities"],queryFn:t,staleTime:6e4})}export{n as u};
|
package/web/assets/{wardleyDiagram-EHGQE667-BiLuq9mr.js → wardleyDiagram-EHGQE667-D4EAOS35.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as Mt}from"./chunk-JWPE2WC7-Ddn7ZSp8.js";import{_ as u,s as Nt,g as zt,o as Lt,n as Tt,a as At,b as Xt,E as Et,y as Yt,A as J,l as Q,D as It,e as Bt,p as Ft,c as V}from"./mermaid.core-DLgjY1g2.js";import{p as Rt}from"./cynefin-VYW2F7L2-Blk0Lu0l.js";import"./index-DLn_2LPp.js";import"./react-B9jn2M18.js";import"./markdown-Bw9RgUGR.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
package/web/assets/{xychartDiagram-FW5EYKEG-DzAZpIRG.js → xychartDiagram-FW5EYKEG-DR8PwXpe.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as n,s as xi,g as di,o as Yt,n as fi,a as pi,b as mi,l as Nt,D as yi,e as bi,p as Ai,y as kt,A as Ht,B as wi,E as Ci,i as Si,az as Ri,P as Ot}from"./mermaid.core-
|
|
1
|
+
import{_ as n,s as xi,g as di,o as Yt,n as fi,a as pi,b as mi,l as Nt,D as yi,e as bi,p as Ai,y as kt,A as Ht,B as wi,E as Ci,i as Si,az as Ri,P as Ot}from"./mermaid.core-DLgjY1g2.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as Wt}from"./linear-C8e8bGVv.js";import"./index-DLn_2LPp.js";import"./react-B9jn2M18.js";import"./markdown-Bw9RgUGR.js";import"./defaultLocale-C4B-KCzX.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,f=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),f&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),f&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,f=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(f=!!b,_()):f},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(f).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],f=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var p=r.length-1;switch(C){case 5:x.setOrientation(r[p]);break;case 9:x.setDiagramTitle(r[p].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[p]);break;case 13:x.setLineData(r[p-1],r[p]);break;case 14:x.setBarData({text:"",type:"text"},r[p]);break;case 15:x.setBarData(r[p-1],r[p]);break;case 16:this.$=r[p].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[p].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[p-1];break;case 20:case 30:this.$=[r[p-2],...r[p]];break;case 21:case 31:this.$=[r[p]];break;case 22:this.$={value:Number(r[p-1]),label:r[p]};break;case 23:this.$={value:Number(r[p]),label:""};break;case 24:x.setXAxisTitle(r[p]);break;case 25:x.setXAxisTitle(r[p-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[p]);break;case 28:x.setXAxisRangeData(Number(r[p-2]),Number(r[p]));break;case 29:this.$=r[p-1];break;case 32:x.setYAxisTitle(r[p]);break;case 33:x.setYAxisTitle(r[p-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[p-2]),Number(r[p]));break;case 39:this.$={text:r[p],type:"text"};break;case 40:this.$={text:r[p],type:"text"};break;case 41:this.$={text:r[p],type:"markdown"};break;case 42:this.$=r[p];break;case 43:this.$=r[p-1]+""+r[p];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,36]),e(f,[2,37]),e(f,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,p="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),U={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&(U.yy[mt]=this.yy[mt]);v.setInput(h,U.yy),U.yy.lexer=v,U.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,$,O,bt,G={},xt,N,Vt,dt;;){if($=g[g.length-1],this.defaultActions[$]?O=this.defaultActions[$]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[$]&&rt[$][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[$])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
|
|
2
2
|
`+v.showPosition()+`
|
|
3
3
|
Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==zt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,p=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[p,Mt,gt,U.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Vt=rt[g[g.length-2]][g[g.length-1]],g.push(Vt);break;case 3:return!0}}return!0},"parse")},ot=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
package/web/index.html
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
<meta name="theme-color" content="#f7f6f2" />
|
|
10
10
|
<link rel="icon" href="/favicon.svg" />
|
|
11
11
|
<title>Kennel</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-DLn_2LPp.js"></script>
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/markdown-Bw9RgUGR.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/react-B9jn2M18.js">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-uY9jLiL5.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"name": "@raggle-ai/agents",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"description": "Agents folder plugin: read-only instruction source discovery and viewer for Kennel folders.",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"prettier": "@raggle-ai/prettier-config",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/raggle-ai/kennel.git",
|
|
12
|
-
"directory": "packages/agents"
|
|
13
|
-
},
|
|
14
|
-
"publishConfig": {
|
|
15
|
-
"registry": "https://registry.npmjs.org",
|
|
16
|
-
"access": "public"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"src"
|
|
20
|
-
],
|
|
21
|
-
"exports": {
|
|
22
|
-
".": "./src/index.ts",
|
|
23
|
-
"./client": "./src/client.tsx",
|
|
24
|
-
"./manifest": "./src/manifest.ts",
|
|
25
|
-
"./node": "./src/node.ts",
|
|
26
|
-
"./profiles": "./src/profiles.ts",
|
|
27
|
-
"./resolve": "./src/resolve.ts",
|
|
28
|
-
"./server": "./src/server.ts",
|
|
29
|
-
"./types": "./src/types.ts",
|
|
30
|
-
"./viewer": "./src/viewer.tsx"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"test": "bun test test/*.test.mjs",
|
|
34
|
-
"typecheck": "tsc --noEmit",
|
|
35
|
-
"format": "prettier . --check --cache --cache-location .cache/.prettiercache --ignore-path ../../.prettierignore",
|
|
36
|
-
"format:fix": "prettier . --write --cache --cache-location .cache/.prettiercache --ignore-path ../../.prettierignore",
|
|
37
|
-
"lint": "eslint . --cache --cache-location .cache/.eslintcache",
|
|
38
|
-
"lint:fix": "eslint . --fix --cache --cache-location .cache/.eslintcache",
|
|
39
|
-
"clean": "git clean -xdf dist node_modules .cache .turbo/cache",
|
|
40
|
-
"pack:check": "npm pack --dry-run",
|
|
41
|
-
"publish:public:dry-run": "npm --@raggle-ai:registry=https://registry.npmjs.org publish --dry-run --access public --registry=https://registry.npmjs.org"
|
|
42
|
-
},
|
|
43
|
-
"dependencies": {
|
|
44
|
-
"kennel-plugins": "workspace:*",
|
|
45
|
-
"@raggle-ai/markdown": "workspace:*",
|
|
46
|
-
"@raggle-ai/ui": "workspace:*",
|
|
47
|
-
"@tanstack/react-query": "catalog:tanstack",
|
|
48
|
-
"lucide-react": "^0.562.0"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"react": ">=18.3.0"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@eslint/compat": "catalog:eslint",
|
|
55
|
-
"@eslint/eslintrc": "catalog:eslint",
|
|
56
|
-
"@ianvs/prettier-plugin-sort-imports": "catalog:prettier",
|
|
57
|
-
"@prettier/plugin-oxc": "catalog:prettier",
|
|
58
|
-
"@raggle-ai/eslint-config": "workspace:*",
|
|
59
|
-
"@raggle-ai/prettier-config": "workspace:*",
|
|
60
|
-
"@raggle-ai/tsconfig": "workspace:*",
|
|
61
|
-
"@types/node": "catalog:",
|
|
62
|
-
"@types/react": "catalog:react19",
|
|
63
|
-
"@types/react-dom": "catalog:react19",
|
|
64
|
-
"eslint": "catalog:eslint",
|
|
65
|
-
"eslint-plugin-unused-imports": "catalog:eslint",
|
|
66
|
-
"prettier": "catalog:prettier",
|
|
67
|
-
"prettier-plugin-classnames": "catalog:prettier",
|
|
68
|
-
"prettier-plugin-merge": "catalog:prettier",
|
|
69
|
-
"prettier-plugin-tailwindcss": "catalog:prettier",
|
|
70
|
-
"react": "catalog:react19",
|
|
71
|
-
"react-dom": "catalog:react19",
|
|
72
|
-
"typescript": "catalog:",
|
|
73
|
-
"typescript-eslint": "catalog:eslint"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react"
|
|
2
|
-
import { useMemo, useState } from "react"
|
|
3
|
-
import { FilePlus2, LoaderCircle, Pencil } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import type { FolderPluginHostActions } from "kennel-plugins/client"
|
|
6
|
-
import { BarkdownMarkdown, markdownMetadata } from "@raggle-ai/markdown"
|
|
7
|
-
import { FolderContextIcon } from "@raggle-ai/ui/components/folder-filter-bar"
|
|
8
|
-
import {
|
|
9
|
-
FolderMetadata,
|
|
10
|
-
folderName,
|
|
11
|
-
} from "@raggle-ai/ui/components/folder-metadata"
|
|
12
|
-
import { toast } from "@raggle-ai/ui/components/sonner"
|
|
13
|
-
|
|
14
|
-
import type { AgentChainEntry, AgentSource } from "./types.ts"
|
|
15
|
-
|
|
16
|
-
export { folderName }
|
|
17
|
-
|
|
18
|
-
/** Shared spacing for folder summaries and instruction-file headers. */
|
|
19
|
-
export const agentCardClass =
|
|
20
|
-
"min-w-0 overflow-hidden rounded-lg border border-[#e7ebe7] bg-white"
|
|
21
|
-
|
|
22
|
-
export const agentActionClass =
|
|
23
|
-
"inline-flex min-h-11 shrink-0 items-center justify-center gap-2 rounded-md border border-[#d5dcd5] bg-white px-3 py-2 text-sm font-medium text-[#4a554b] transition-colors hover:bg-[#f3f5f2] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#56725e] disabled:cursor-wait disabled:opacity-60"
|
|
24
|
-
|
|
25
|
-
/** Compact form of {@link agentActionClass} for inline actions like the create button. */
|
|
26
|
-
export const agentActionCompactClass =
|
|
27
|
-
"inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-md border border-[#d5dcd5] bg-white px-2.5 text-xs font-medium text-[#4a554b] transition-colors hover:bg-[#f3f5f2] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#56725e] disabled:cursor-wait disabled:opacity-60"
|
|
28
|
-
|
|
29
|
-
export function AgentCardHeader({
|
|
30
|
-
children,
|
|
31
|
-
actions,
|
|
32
|
-
}: {
|
|
33
|
-
children: ReactNode
|
|
34
|
-
actions?: ReactNode
|
|
35
|
-
}) {
|
|
36
|
-
return (
|
|
37
|
-
<div className="flex min-w-0 items-start justify-between gap-3 p-4">
|
|
38
|
-
<div className="min-w-0 flex-1 space-y-2">{children}</div>
|
|
39
|
-
{actions ? (
|
|
40
|
-
<div className="ml-auto flex shrink-0 items-center gap-2">
|
|
41
|
-
{actions}
|
|
42
|
-
</div>
|
|
43
|
-
) : null}
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* One instruction file: its name, the project it belongs to, an edit action
|
|
50
|
-
* that opens the physical file in the default Markdown app, and the full
|
|
51
|
-
* instruction text read by the selected client.
|
|
52
|
-
*
|
|
53
|
-
* The edit action is a host action injected by the viewer shell, so it is a
|
|
54
|
-
* plain fetch (never a navigation to the API URL) and disappears entirely on
|
|
55
|
-
* hosts that cannot open local files (e.g. a phone on `--lan`).
|
|
56
|
-
*/
|
|
57
|
-
export function AgentCard({
|
|
58
|
-
hostActions,
|
|
59
|
-
source,
|
|
60
|
-
embedded = false,
|
|
61
|
-
}: {
|
|
62
|
-
hostActions?: FolderPluginHostActions
|
|
63
|
-
source: AgentSource
|
|
64
|
-
/** The containing folder card supplies the outer border. */
|
|
65
|
-
embedded?: boolean
|
|
66
|
-
}) {
|
|
67
|
-
const [opening, setOpening] = useState(false)
|
|
68
|
-
const open = hostActions?.openPath
|
|
69
|
-
const markdown = useMemo(
|
|
70
|
-
() => (source.status === "loaded" ? markdownMetadata(source.text) : null),
|
|
71
|
-
[source],
|
|
72
|
-
)
|
|
73
|
-
return (
|
|
74
|
-
<article className={embedded ? "min-w-0" : agentCardClass}>
|
|
75
|
-
<AgentCardHeader
|
|
76
|
-
actions={
|
|
77
|
-
open ? (
|
|
78
|
-
<button
|
|
79
|
-
aria-label={`Edit ${source.filename} in the default Markdown app`}
|
|
80
|
-
className={agentActionClass}
|
|
81
|
-
disabled={opening}
|
|
82
|
-
title={`Edit ${source.filename} in the default Markdown app`}
|
|
83
|
-
type="button"
|
|
84
|
-
onClick={() => {
|
|
85
|
-
setOpening(true)
|
|
86
|
-
void open(source.path).then(
|
|
87
|
-
() => {
|
|
88
|
-
setOpening(false)
|
|
89
|
-
toast.success(`Opened ${source.filename}`)
|
|
90
|
-
},
|
|
91
|
-
(error: unknown) => {
|
|
92
|
-
setOpening(false)
|
|
93
|
-
toast.error(
|
|
94
|
-
error instanceof Error
|
|
95
|
-
? error.message
|
|
96
|
-
: `Could not open ${source.filename}`,
|
|
97
|
-
)
|
|
98
|
-
},
|
|
99
|
-
)
|
|
100
|
-
}}
|
|
101
|
-
>
|
|
102
|
-
{opening ? (
|
|
103
|
-
<LoaderCircle
|
|
104
|
-
aria-hidden="true"
|
|
105
|
-
className="size-3.5 animate-spin"
|
|
106
|
-
/>
|
|
107
|
-
) : (
|
|
108
|
-
<Pencil aria-hidden="true" className="size-3.5" />
|
|
109
|
-
)}
|
|
110
|
-
Edit
|
|
111
|
-
</button>
|
|
112
|
-
) : null
|
|
113
|
-
}
|
|
114
|
-
>
|
|
115
|
-
<FolderMetadata
|
|
116
|
-
className="max-w-full"
|
|
117
|
-
path={source.directory}
|
|
118
|
-
icon={<FolderContextIcon folder={source.directory} />}
|
|
119
|
-
/>
|
|
120
|
-
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
121
|
-
<h4 className="m-0 text-sm font-semibold break-words text-[#2f382f]">
|
|
122
|
-
{source.filename}
|
|
123
|
-
</h4>
|
|
124
|
-
{source.override ? (
|
|
125
|
-
<span
|
|
126
|
-
className="rounded bg-[#f3f5f2] px-2 py-1 text-xs text-[#4a554b]"
|
|
127
|
-
>
|
|
128
|
-
override
|
|
129
|
-
</span>
|
|
130
|
-
) : null}
|
|
131
|
-
</div>
|
|
132
|
-
</AgentCardHeader>
|
|
133
|
-
<div className="min-w-0 overflow-x-auto px-4 pb-4 break-words">
|
|
134
|
-
{source.status === "loaded" ? (
|
|
135
|
-
source.text.trim() && markdown ? (
|
|
136
|
-
<>
|
|
137
|
-
{markdown.entries.length ? (
|
|
138
|
-
<details
|
|
139
|
-
className="mb-4 rounded-lg border border-[#e7ebe7]
|
|
140
|
-
bg-[#fafbfa] px-3 py-2"
|
|
141
|
-
>
|
|
142
|
-
<summary
|
|
143
|
-
className="cursor-pointer text-sm font-semibold
|
|
144
|
-
text-[#435447]"
|
|
145
|
-
>
|
|
146
|
-
Document details ({markdown.entries.length})
|
|
147
|
-
</summary>
|
|
148
|
-
<dl className="mt-3 grid gap-2 text-sm">
|
|
149
|
-
{markdown.entries.map(([key, value]) => (
|
|
150
|
-
<div
|
|
151
|
-
className="grid grid-cols-[120px_1fr] gap-3
|
|
152
|
-
max-[767px]:grid-cols-1"
|
|
153
|
-
key={key}
|
|
154
|
-
>
|
|
155
|
-
<dt className="font-semibold text-[#5a6b5c] capitalize">
|
|
156
|
-
{key.replaceAll(/[-_]/g, " ")}
|
|
157
|
-
</dt>
|
|
158
|
-
<dd className="m-0 text-[#2f382f]">
|
|
159
|
-
{Array.isArray(value)
|
|
160
|
-
? value.map(String).join(", ")
|
|
161
|
-
: typeof value === "object" && value
|
|
162
|
-
? JSON.stringify(value)
|
|
163
|
-
: String(value ?? "")}
|
|
164
|
-
</dd>
|
|
165
|
-
</div>
|
|
166
|
-
))}
|
|
167
|
-
</dl>
|
|
168
|
-
</details>
|
|
169
|
-
) : null}
|
|
170
|
-
{markdown.body.trim() ? (
|
|
171
|
-
<div
|
|
172
|
-
className="prose prose-neutral max-w-none
|
|
173
|
-
[&>:first-child]:mt-0 [&>:last-child]:mb-0"
|
|
174
|
-
>
|
|
175
|
-
<BarkdownMarkdown value={markdown.body} />
|
|
176
|
-
</div>
|
|
177
|
-
) : null}
|
|
178
|
-
</>
|
|
179
|
-
) : (
|
|
180
|
-
<p className="m-0 mt-2 text-[0.8rem] text-[#6c7a6d]">
|
|
181
|
-
(empty file)
|
|
182
|
-
</p>
|
|
183
|
-
)
|
|
184
|
-
) : (
|
|
185
|
-
<p className="m-0 mt-2 text-[0.8rem] text-[#9c3a3a]">
|
|
186
|
-
{source.reason ?? "Could not read this file"}
|
|
187
|
-
</p>
|
|
188
|
-
)}
|
|
189
|
-
</div>
|
|
190
|
-
</article>
|
|
191
|
-
)
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Create-an-empty-AGENTS.md action for a folder that has no instruction file
|
|
196
|
-
* of its own. The action is a host action injected by the viewer shell, so
|
|
197
|
-
* it disappears entirely on hosts that cannot create local files (e.g. a
|
|
198
|
-
* phone on `--lan`).
|
|
199
|
-
*/
|
|
200
|
-
export function CreateAgentsButton({
|
|
201
|
-
folder,
|
|
202
|
-
createAction,
|
|
203
|
-
onCreated,
|
|
204
|
-
}: {
|
|
205
|
-
folder: string
|
|
206
|
-
createAction?: (folder: string) => Promise<{ path: string }>
|
|
207
|
-
onCreated: () => void
|
|
208
|
-
}) {
|
|
209
|
-
const [working, setWorking] = useState(false)
|
|
210
|
-
if (!createAction) return null
|
|
211
|
-
|
|
212
|
-
const create = async () => {
|
|
213
|
-
setWorking(true)
|
|
214
|
-
try {
|
|
215
|
-
const result = await createAction(folder)
|
|
216
|
-
const createdPath =
|
|
217
|
-
result &&
|
|
218
|
-
typeof result === "object" &&
|
|
219
|
-
"path" in result &&
|
|
220
|
-
typeof result.path === "string"
|
|
221
|
-
? result.path
|
|
222
|
-
: null
|
|
223
|
-
toast.success(
|
|
224
|
-
createdPath
|
|
225
|
-
? `Created ${folderName(createdPath)} — edit it to add instructions`
|
|
226
|
-
: "AGENTS.md created",
|
|
227
|
-
)
|
|
228
|
-
onCreated()
|
|
229
|
-
} catch (error) {
|
|
230
|
-
toast.error(
|
|
231
|
-
error instanceof Error ? error.message : "Could not create AGENTS.md",
|
|
232
|
-
)
|
|
233
|
-
} finally {
|
|
234
|
-
setWorking(false)
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
return (
|
|
239
|
-
<button
|
|
240
|
-
className={agentActionCompactClass}
|
|
241
|
-
title={`Create an empty AGENTS.md in ${folder}`}
|
|
242
|
-
disabled={working}
|
|
243
|
-
type="button"
|
|
244
|
-
onClick={() => void create()}
|
|
245
|
-
>
|
|
246
|
-
{working ? (
|
|
247
|
-
<LoaderCircle aria-hidden="true" className="size-3.5 animate-spin" />
|
|
248
|
-
) : (
|
|
249
|
-
<FilePlus2 aria-hidden="true" className="size-3.5" />
|
|
250
|
-
)}
|
|
251
|
-
Create
|
|
252
|
-
</button>
|
|
253
|
-
)
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* The folder being inspected: its identity, full path, and whether it has
|
|
258
|
-
* its own instruction file. When it has none, the create action lives inside
|
|
259
|
-
* this box. The copy affordance and host actions are gated on the host
|
|
260
|
-
* providing them, like every other Kennel plugin action.
|
|
261
|
-
*/
|
|
262
|
-
export function CurrentFolderBox({
|
|
263
|
-
folder,
|
|
264
|
-
hasOwn,
|
|
265
|
-
createAction,
|
|
266
|
-
onCreated,
|
|
267
|
-
}: {
|
|
268
|
-
folder: string
|
|
269
|
-
hasOwn: boolean
|
|
270
|
-
createAction?: (folder: string) => Promise<{ path: string }>
|
|
271
|
-
onCreated: () => void
|
|
272
|
-
}) {
|
|
273
|
-
return (
|
|
274
|
-
<AgentCardHeader
|
|
275
|
-
actions={
|
|
276
|
-
!hasOwn ? (
|
|
277
|
-
<CreateAgentsButton
|
|
278
|
-
createAction={createAction}
|
|
279
|
-
folder={folder}
|
|
280
|
-
onCreated={onCreated}
|
|
281
|
-
/>
|
|
282
|
-
) : undefined
|
|
283
|
-
}
|
|
284
|
-
>
|
|
285
|
-
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
286
|
-
<FolderMetadata
|
|
287
|
-
className="max-w-full"
|
|
288
|
-
path={folder}
|
|
289
|
-
icon={<FolderContextIcon folder={folder} />}
|
|
290
|
-
/>
|
|
291
|
-
</div>
|
|
292
|
-
</AgentCardHeader>
|
|
293
|
-
)
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* One directory in the ancestor walk going up from the working folder: its
|
|
298
|
-
* identity, where it sits in the chain, and whether the selected client
|
|
299
|
-
* found an instruction file there. Directories with no file stay visible
|
|
300
|
-
* with their own create action, so the full chain is always actionable.
|
|
301
|
-
*/
|
|
302
|
-
export function FolderRow({
|
|
303
|
-
entry,
|
|
304
|
-
createAction,
|
|
305
|
-
onCreated,
|
|
306
|
-
}: {
|
|
307
|
-
entry: AgentChainEntry
|
|
308
|
-
createAction?: (folder: string) => Promise<{ path: string }>
|
|
309
|
-
onCreated: () => void
|
|
310
|
-
}) {
|
|
311
|
-
const hasInstructions = entry.filenames.length > 0
|
|
312
|
-
return (
|
|
313
|
-
<AgentCardHeader
|
|
314
|
-
actions={
|
|
315
|
-
!hasInstructions ? (
|
|
316
|
-
<CreateAgentsButton
|
|
317
|
-
createAction={createAction}
|
|
318
|
-
folder={entry.directory}
|
|
319
|
-
onCreated={onCreated}
|
|
320
|
-
/>
|
|
321
|
-
) : undefined
|
|
322
|
-
}
|
|
323
|
-
>
|
|
324
|
-
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
325
|
-
<FolderMetadata
|
|
326
|
-
className="max-w-full"
|
|
327
|
-
icon={<FolderContextIcon folder={entry.directory} />}
|
|
328
|
-
name={folderName(entry.directory) || "Filesystem root"}
|
|
329
|
-
path={entry.directory}
|
|
330
|
-
/>
|
|
331
|
-
</div>
|
|
332
|
-
</AgentCardHeader>
|
|
333
|
-
)
|
|
334
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FolderPluginViewProps } from "kennel-plugins/client"
|
|
2
|
-
|
|
3
|
-
import { agentsManifest } from "./manifest.ts"
|
|
4
|
-
import { AgentsPluginView } from "./viewer.tsx"
|
|
5
|
-
|
|
6
|
-
export function AgentsPlugin(props: FolderPluginViewProps) {
|
|
7
|
-
return <AgentsPluginView {...props} />
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const agentsClient = {
|
|
11
|
-
...agentsManifest,
|
|
12
|
-
component: AgentsPlugin,
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
AgentClientId,
|
|
3
|
-
AgentSource,
|
|
4
|
-
AgentSourceStatus,
|
|
5
|
-
AgentsResolution,
|
|
6
|
-
AgentWarning,
|
|
7
|
-
ClientFilter,
|
|
8
|
-
SourceLevel,
|
|
9
|
-
} from "./types.ts"
|
|
10
|
-
export {
|
|
11
|
-
CLIENT_ORDER,
|
|
12
|
-
FILTERS,
|
|
13
|
-
PROFILES,
|
|
14
|
-
clientLabel,
|
|
15
|
-
parseClientFilter,
|
|
16
|
-
} from "./profiles.ts"
|
|
17
|
-
export type { ClientProfile } from "./profiles.ts"
|
|
18
|
-
export { agentsManifest } from "./manifest.ts"
|