@loicngr/kobo 1.6.2 → 1.6.4
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/mcp-server/kobo-tasks-handlers.js +145 -0
- package/dist/mcp-server/kobo-tasks-server.js +144 -54
- package/dist/server/routes/workspaces.js +63 -5
- package/dist/server/services/agent/engines/claude-code/args-builder.js +30 -3
- package/dist/server/services/settings-service.js +25 -1
- package/dist/server/utils/git-ops.js +96 -0
- package/package.json +1 -1
- package/src/client/dist/spa/assets/ActivityFeed-Bsm5QUA9.js +7 -0
- package/src/client/dist/spa/assets/ActivityFeed-GAoo1WOT.css +1 -0
- package/src/client/dist/spa/assets/ClosePopup-DTgXzcoa.js +1 -0
- package/src/client/dist/spa/assets/{CreatePage-sGrkfyOm.js → CreatePage-CyHlqcZv.js} +1 -1
- package/src/client/dist/spa/assets/DiffViewer-BC81-2me.css +1 -0
- package/src/client/dist/spa/assets/DiffViewer-BDOGx54T.js +2 -0
- package/src/client/dist/spa/assets/{HealthPage-BO-bMpEu.js → HealthPage-CwaLsB_m.js} +1 -1
- package/src/client/dist/spa/assets/MainLayout-CKGnqXNp.css +1 -0
- package/src/client/dist/spa/assets/{MainLayout-BpqOChIX.js → MainLayout-CYMzO0e8.js} +17 -17
- package/src/client/dist/spa/assets/QChip-1nQ_KMFF.js +1 -0
- package/src/client/dist/spa/assets/QDialog-G448EJG4.js +1 -0
- package/src/client/dist/spa/assets/{QExpansionItem-DCRks-Ra.js → QExpansionItem-HLBjHx-0.js} +1 -1
- package/src/client/dist/spa/assets/QScrollArea-CBW6shMb.js +1 -0
- package/src/client/dist/spa/assets/{QSeparator-rkjCbX2M.js → QSeparator-DNSiXYrN.js} +1 -1
- package/src/client/dist/spa/assets/QTabPanels-Cw4nnIbR.js +1 -0
- package/src/client/dist/spa/assets/QTooltip-DbEBexRN.js +1 -0
- package/src/client/dist/spa/assets/{SearchPage-BrUbbtgI.js → SearchPage-D5C4I5SC.js} +1 -1
- package/src/client/dist/spa/assets/{SettingsPage-B3elO1PX.js → SettingsPage-DIDwr-uq.js} +1 -1
- package/src/client/dist/spa/assets/TouchPan-Y_Bxzun2.js +1 -0
- package/src/client/dist/spa/assets/{WorkspacePage-BHl17_tY.js → WorkspacePage-Bx_w4QNi.js} +3 -3
- package/src/client/dist/spa/assets/{build-path-tree-Bgl2q74t.js → build-path-tree-TBMtG2me.js} +1 -1
- package/src/client/dist/spa/assets/{cssMode-B1wQ-79R.js → cssMode-noDDoaIu.js} +1 -1
- package/src/client/dist/spa/assets/{documents-CHc8t22V.js → documents-C8qHepC2.js} +1 -1
- package/src/client/dist/spa/assets/{editor.api-CRb_5Zw6.js → editor.api-CtzJLjGf.js} +1 -1
- package/src/client/dist/spa/assets/{editor.main-C5sdCvGW.js → editor.main-DPd-buqm.js} +3 -3
- package/src/client/dist/spa/assets/{formatters-BDadphwz.js → formatters-D7eTm7uK.js} +1 -1
- package/src/client/dist/spa/assets/{freemarker2-CVSnsZk-.js → freemarker2-BbnROwW1.js} +1 -1
- package/src/client/dist/spa/assets/{handlebars-uL_pucGI.js → handlebars-Ksvxefhe.js} +1 -1
- package/src/client/dist/spa/assets/{html-CatZVwWp.js → html-C-hmwqXO.js} +1 -1
- package/src/client/dist/spa/assets/{htmlMode-DTDzEngo.js → htmlMode-DrAVxVod.js} +1 -1
- package/src/client/dist/spa/assets/i18n-Dah5k8f2.js +1 -0
- package/src/client/dist/spa/assets/index-Y9eYNsHp.js +2 -0
- package/src/client/dist/spa/assets/{javascript-DeHBpolA.js → javascript-CPLPvA_S.js} +1 -1
- package/src/client/dist/spa/assets/{jsonMode-Bma_YGGm.js → jsonMode-DOTbDLvn.js} +1 -1
- package/src/client/dist/spa/assets/{liquid-CW7xQEG_.js → liquid-CdSz2rzX.js} +1 -1
- package/src/client/dist/spa/assets/{mdx-BsYUhMzF.js → mdx-D9jK81Jo.js} +1 -1
- package/src/client/dist/spa/assets/models-DVnzXKOh.js +1 -0
- package/src/client/dist/spa/assets/{monaco.contribution-Du0atePv.js → monaco.contribution-BuL3dvHW.js} +2 -2
- package/src/client/dist/spa/assets/private.use-form-C5G_3nU5.js +1 -0
- package/src/client/dist/spa/assets/{python-D7DQWXZm.js → python-Dge5WJA8.js} +1 -1
- package/src/client/dist/spa/assets/{razor-B2ZxF301.js → razor-CuTUK6Ln.js} +1 -1
- package/src/client/dist/spa/assets/scroll-C-Vz5BD9.js +1 -0
- package/src/client/dist/spa/assets/touch-B2uuAH_y.js +1 -0
- package/src/client/dist/spa/assets/{tsMode-B4Xul5xA.js → tsMode-CV1esWeE.js} +1 -1
- package/src/client/dist/spa/assets/{typescript-CdsKQuLT.js → typescript-CG_BbDRI.js} +1 -1
- package/src/client/dist/spa/assets/{use-checkbox-DYiZQsbF.js → use-checkbox-BduGd8xg.js} +1 -1
- package/src/client/dist/spa/assets/{use-id-CeduaJbU.js → use-id-BmXMngYX.js} +1 -1
- package/src/client/dist/spa/assets/{xml-Wap00dMv.js → xml-GLWDavVQ.js} +1 -1
- package/src/client/dist/spa/assets/{yaml-BxRDHC24.js → yaml-BFBo2noB.js} +1 -1
- package/src/client/dist/spa/index.html +8 -9
- package/src/mcp-server/kobo-tasks-handlers.ts +191 -0
- package/src/mcp-server/kobo-tasks-server.ts +158 -53
- package/src/client/dist/spa/assets/ActivityFeed-CFuT6H5u.js +0 -7
- package/src/client/dist/spa/assets/ActivityFeed-DXYafbn4.css +0 -1
- package/src/client/dist/spa/assets/ClosePopup-DhM1C4Zw.js +0 -1
- package/src/client/dist/spa/assets/DiffViewer-BVU58ujc.css +0 -1
- package/src/client/dist/spa/assets/DiffViewer-BwSRtVRI.js +0 -2
- package/src/client/dist/spa/assets/MainLayout-BiBJtDTk.css +0 -1
- package/src/client/dist/spa/assets/QChip-KJoHYE6F.js +0 -1
- package/src/client/dist/spa/assets/QDialog-DQeAxY3-.js +0 -1
- package/src/client/dist/spa/assets/QScrollArea-e5qTqwcb.js +0 -1
- package/src/client/dist/spa/assets/QTabPanels--6cYe2US.js +0 -1
- package/src/client/dist/spa/assets/QTooltip-C4CPesBX.js +0 -1
- package/src/client/dist/spa/assets/TouchPan-BT6phK1f.js +0 -1
- package/src/client/dist/spa/assets/format-Bttc9ToS.js +0 -1
- package/src/client/dist/spa/assets/i18n-D-VdPLEh.js +0 -1
- package/src/client/dist/spa/assets/index-CUI-zN26.js +0 -2
- package/src/client/dist/spa/assets/models-BbSRHL9b.js +0 -1
- package/src/client/dist/spa/assets/private.use-form-D1RuEt2P.js +0 -1
- package/src/client/dist/spa/assets/scroll-JVVkg2Ng.js +0 -1
- package/src/client/dist/spa/assets/touch-CBLrR6_z.js +0 -1
- package/src/client/dist/spa/assets/use-portal-DBe4lcC2.js +0 -1
- /package/src/client/dist/spa/assets/{QBadge-DqtcDv8D.js → QBadge-Di02fu2H.js} +0 -0
- /package/src/client/dist/spa/assets/{QItemLabel-Codqjisk.js → QItemLabel-Czw5g0px.js} +0 -0
- /package/src/client/dist/spa/assets/{QItemSection-CGpX7GcL.js → QItemSection-BzWLL-V-.js} +0 -0
- /package/src/client/dist/spa/assets/{QList-B-MkPF7n.js → QList-D2GuTeLl.js} +0 -0
- /package/src/client/dist/spa/assets/{QPage-yqdKDG7-.js → QPage-BTzNQlb1.js} +0 -0
- /package/src/client/dist/spa/assets/{QSlideTransition-BQxI8l5r.js → QSlideTransition-s6ZkYsLs.js} +0 -0
- /package/src/client/dist/spa/assets/{QSpace-BNr0AftG.js → QSpace-0zdF1m5x.js} +0 -0
- /package/src/client/dist/spa/assets/{QSpinnerDots-DEiRooBD.js → QSpinnerDots-By20ptst.js} +0 -0
- /package/src/client/dist/spa/assets/{_plugin-vue_export-helper-r4mAJOHR.js → _plugin-vue_export-helper-Cj6tcsj6.js} +0 -0
- /package/src/client/dist/spa/assets/{abap-Bgec7Keq.js → abap-DiwvWnMr.js} +0 -0
- /package/src/client/dist/spa/assets/{apex-VBlPwEoQ.js → apex-CmtZjKlf.js} +0 -0
- /package/src/client/dist/spa/assets/{azcli-DKqrEFBx.js → azcli-DL2My_i-.js} +0 -0
- /package/src/client/dist/spa/assets/{bat-DdgQWy_0.js → bat-B-nC98wG.js} +0 -0
- /package/src/client/dist/spa/assets/{bicep-CRMM43EB.js → bicep-Ju5MwOgh.js} +0 -0
- /package/src/client/dist/spa/assets/{cameligo-UatALtML.js → cameligo-8Eu1TyBr.js} +0 -0
- /package/src/client/dist/spa/assets/{clojure-D8JU08RA.js → clojure-u-RpMkH3.js} +0 -0
- /package/src/client/dist/spa/assets/{coffee-C56wu358.js → coffee-CdA7bbTe.js} +0 -0
- /package/src/client/dist/spa/assets/{cpp-CyZLvhJG.js → cpp-CzNFP8ks.js} +0 -0
- /package/src/client/dist/spa/assets/{csharp-BJl3ixva.js → csharp-j1LThmcE.js} +0 -0
- /package/src/client/dist/spa/assets/{csp-CxEKxmO-.js → csp-CLRC61y6.js} +0 -0
- /package/src/client/dist/spa/assets/{css-B0t_muXd.js → css-r6rC_7P2.js} +0 -0
- /package/src/client/dist/spa/assets/{cypher-D1hqiMFD.js → cypher-CW08XVUh.js} +0 -0
- /package/src/client/dist/spa/assets/{dart-Bz550Pyv.js → dart-Cs9aL5T_.js} +0 -0
- /package/src/client/dist/spa/assets/{dockerfile-CIXgVAuA.js → dockerfile-BWM0M184.js} +0 -0
- /package/src/client/dist/spa/assets/{ecl-D9qbvZoA.js → ecl-MJJuer5P.js} +0 -0
- /package/src/client/dist/spa/assets/{elixir-b2M38fAy.js → elixir-D2AIuXqn.js} +0 -0
- /package/src/client/dist/spa/assets/{flow9-Dq1UYMkt.js → flow9-B2H24giC.js} +0 -0
- /package/src/client/dist/spa/assets/{fsharp-CFNadkg7.js → fsharp-CMk2OIJN.js} +0 -0
- /package/src/client/dist/spa/assets/{go-dSur1iB2.js → go-BrMkuJg0.js} +0 -0
- /package/src/client/dist/spa/assets/{graphql-qyhAo11d.js → graphql-PSR1UKGv.js} +0 -0
- /package/src/client/dist/spa/assets/{hcl-DFzjMyzm.js → hcl-DAQrbDOW.js} +0 -0
- /package/src/client/dist/spa/assets/{ini-TdzA8TIl.js → ini-0TG5BxW0.js} +0 -0
- /package/src/client/dist/spa/assets/{java-CSGA9pkE.js → java-rgorz17v.js} +0 -0
- /package/src/client/dist/spa/assets/{julia-9izz5OsY.js → julia-C8VMdHm8.js} +0 -0
- /package/src/client/dist/spa/assets/{kotlin-DuPK7AtF.js → kotlin-CllWo3gX.js} +0 -0
- /package/src/client/dist/spa/assets/{less-B8d93iCg.js → less-Cgca25AP.js} +0 -0
- /package/src/client/dist/spa/assets/{lexon-DWtEIyu7.js → lexon-D0GHdBaw.js} +0 -0
- /package/src/client/dist/spa/assets/{lua-Ciq0OGgt.js → lua-DmRsNG-P.js} +0 -0
- /package/src/client/dist/spa/assets/{m3-Cki6JWj_.js → m3-BgL5dNKT.js} +0 -0
- /package/src/client/dist/spa/assets/{markdown-Cu47xwU0.js → markdown-BuJfycGS.js} +0 -0
- /package/src/client/dist/spa/assets/{mips-BM8ui995.js → mips-C9m_93PR.js} +0 -0
- /package/src/client/dist/spa/assets/{msdax-DqLio0_c.js → msdax-CpFHC9OI.js} +0 -0
- /package/src/client/dist/spa/assets/{mysql-v1wbjJOq.js → mysql-qFvltsqN.js} +0 -0
- /package/src/client/dist/spa/assets/{objective-c-CQl3PGSB.js → objective-c-Bnmr858J.js} +0 -0
- /package/src/client/dist/spa/assets/{pascal-D4iW0ZtD.js → pascal-WP0_D5AO.js} +0 -0
- /package/src/client/dist/spa/assets/{pascaligo-BdC9CZdj.js → pascaligo-Blom4Rij.js} +0 -0
- /package/src/client/dist/spa/assets/{perl-BL10m4XD.js → perl-B-vk8g64.js} +0 -0
- /package/src/client/dist/spa/assets/{pgsql-Be_oqVo3.js → pgsql-Cgvz6v67.js} +0 -0
- /package/src/client/dist/spa/assets/{php-BtvXSFRI.js → php-8a3Lrw9m.js} +0 -0
- /package/src/client/dist/spa/assets/{pla-B2vUy15C.js → pla-DuFqEZ8V.js} +0 -0
- /package/src/client/dist/spa/assets/{postiats-CbmTTfXr.js → postiats-DkLtSgkp.js} +0 -0
- /package/src/client/dist/spa/assets/{powerquery-DszLhJGx.js → powerquery-BJ1aNepW.js} +0 -0
- /package/src/client/dist/spa/assets/{powershell-B0dYktF6.js → powershell-rE98k687.js} +0 -0
- /package/src/client/dist/spa/assets/{protobuf-CZvaj1VX.js → protobuf-CUheFacr.js} +0 -0
- /package/src/client/dist/spa/assets/{pug-CPDx1B3S.js → pug-LDcAMD8w.js} +0 -0
- /package/src/client/dist/spa/assets/{qsharp-CDP9TFLl.js → qsharp-DUKSQoR1.js} +0 -0
- /package/src/client/dist/spa/assets/{r-8DbbFX2l.js → r-D-QApv87.js} +0 -0
- /package/src/client/dist/spa/assets/{rate-limit-labels-BoDORKFj.js → rate-limit-labels-Su-L56A2.js} +0 -0
- /package/src/client/dist/spa/assets/{redis-DRWj9MtJ.js → redis-SXdDyWR9.js} +0 -0
- /package/src/client/dist/spa/assets/{redshift-C6cElE_5.js → redshift-Y6lsCryn.js} +0 -0
- /package/src/client/dist/spa/assets/{restructuredtext-W9pS9n3m.js → restructuredtext-edObr9a8.js} +0 -0
- /package/src/client/dist/spa/assets/{ruby-BKnzWnk-.js → ruby-CNnUfF-8.js} +0 -0
- /package/src/client/dist/spa/assets/{rust-YPCclWwe.js → rust-IHUZWzBr.js} +0 -0
- /package/src/client/dist/spa/assets/{sb-BgM4DTFb.js → sb-DrUvY44N.js} +0 -0
- /package/src/client/dist/spa/assets/{scala-fz1OPLMl.js → scala-B4hbXGLM.js} +0 -0
- /package/src/client/dist/spa/assets/{scheme-8Uz1RIbu.js → scheme-BGrd12j3.js} +0 -0
- /package/src/client/dist/spa/assets/{scss-Djo3IYXr.js → scss-x5G1ES4U.js} +0 -0
- /package/src/client/dist/spa/assets/{shell-CINF5Tx_.js → shell-DOehe2Y8.js} +0 -0
- /package/src/client/dist/spa/assets/{solidity-GgiNEuUm.js → solidity-BeRvcwWV.js} +0 -0
- /package/src/client/dist/spa/assets/{sophia-Culj97P9.js → sophia-DZbkUNjy.js} +0 -0
- /package/src/client/dist/spa/assets/{sparql-C2ZlpxOY.js → sparql-B7_oi5-h.js} +0 -0
- /package/src/client/dist/spa/assets/{sql-BEf5Pg7Y.js → sql-CTlsFWVE.js} +0 -0
- /package/src/client/dist/spa/assets/{st-CT6UUoeH.js → st-DJVEJdPE.js} +0 -0
- /package/src/client/dist/spa/assets/{swift-B5g0xTG3.js → swift-CwhT3fYa.js} +0 -0
- /package/src/client/dist/spa/assets/{systemverilog-CEgQz9DR.js → systemverilog-BQN63pkN.js} +0 -0
- /package/src/client/dist/spa/assets/{tcl-D0qL2L0I.js → tcl-DqwfpskA.js} +0 -0
- /package/src/client/dist/spa/assets/{twig-BFUAVf1E.js → twig-BiyenUgc.js} +0 -0
- /package/src/client/dist/spa/assets/{typespec-CjVVcNKm.js → typespec-CWOJribt.js} +0 -0
- /package/src/client/dist/spa/assets/{use-quasar-Ch82z8H5.js → use-quasar-BBrzedjR.js} +0 -0
- /package/src/client/dist/spa/assets/{vb-CZJr-DQz.js → vb-Cq5F87m3.js} +0 -0
- /package/src/client/dist/spa/assets/{vue-i18n-CeG0hR0Z.js → vue-i18n-eUDnMrPl.js} +0 -0
- /package/src/client/dist/spa/assets/{wgsl-ivoXUo2e.js → wgsl-BAvW2lVr.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./editor.api-
|
|
1
|
+
import{m as e}from"./editor.api-CtzJLjGf.js";var t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of r(a))!i.call(e,c)&&c!==o&&t(e,c,{get:()=>a[c],enumerable:!(s=n(a,c))||s.enumerable});return e},o=(e,t,n)=>(a(e,t,`default`),n&&a(n,t,`default`)),s={};o(s,e);var c={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:s.languages.IndentAction.Indent}}]},l={tokenPostfix:`.yaml`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:[`true`,`True`,`TRUE`,`false`,`False`,`FALSE`,`null`,`Null`,`Null`,`~`],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:`@whitespace`},{include:`@comment`},[/%[^ ]+.*$/,`meta.directive`],[/---/,`operators.directivesEnd`],[/\.{3}/,`operators.documentEnd`],[/[-?:](?= )/,`operators`],{include:`@anchor`},{include:`@tagHandle`},{include:`@flowCollections`},{include:`@blockStyle`},[/@numberInteger(?![ \t]*\S+)/,`number`],[/@numberFloat(?![ \t]*\S+)/,`number.float`],[/@numberOctal(?![ \t]*\S+)/,`number.octal`],[/@numberHex(?![ \t]*\S+)/,`number.hex`],[/@numberInfinity(?![ \t]*\S+)/,`number.infinity`],[/@numberNaN(?![ \t]*\S+)/,`number.nan`],[/@numberDate(?![ \t]*\S+)/,`number.date`],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,[`type`,`white`,`operators`,`white`]],{include:`@flowScalars`},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],object:[{include:`@whitespace`},{include:`@comment`},[/\}/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],[/:(?= )/,`operators`],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,`type`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\},]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],array:[{include:`@whitespace`},{include:`@comment`},[/\]/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\],]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],multiString:[[/^( +).+$/,`string`,`@multiStringContinued.$1`]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":`string`,"@default":{token:`@rematch`,next:`@popall`}}}]],whitespace:[[/[ \t\r\n]+/,`white`]],comment:[[/#.*$/,`comment`]],flowCollections:[[/\[/,`@brackets`,`@array`],[/\{/,`@brackets`,`@object`]],flowScalars:[[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'[^']*'/,`string`],[/"/,`string`,`@doubleQuotedString`]],doubleQuotedString:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],blockStyle:[[/[>|][0-9]*[+-]?$/,`operators`,`@multiString`]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,`number`],[/@numberFloat(?=[ \t]*[,\]\}])/,`number.float`],[/@numberOctal(?=[ \t]*[,\]\}])/,`number.octal`],[/@numberHex(?=[ \t]*[,\]\}])/,`number.hex`],[/@numberInfinity(?=[ \t]*[,\]\}])/,`number.infinity`],[/@numberNaN(?=[ \t]*[,\]\}])/,`number.nan`],[/@numberDate(?=[ \t]*[,\]\}])/,`number.date`]],tagHandle:[[/\![^ ]*/,`tag`]],anchor:[[/[&*][^ ]+/,`namespace`]]}};export{c as conf,l as language};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><title>Kōbō</title><link rel=icon type=image/svg+xml href=/favicon.svg><meta charset=utf-8><meta name=description content="Kōbō — multi-workspace agent manager for Claude Code"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width,height=device-height"> <script type="module" crossorigin src="/assets/index-
|
|
1
|
+
<!DOCTYPE html><html><head><title>Kōbō</title><link rel=icon type=image/svg+xml href=/favicon.svg><meta charset=utf-8><meta name=description content="Kōbō — multi-workspace agent manager for Claude Code"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width,height=device-height"> <script type="module" crossorigin src="/assets/index-Y9eYNsHp.js"></script>
|
|
2
2
|
<link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-C3IgBgY5.js">
|
|
3
|
-
<link rel="modulepreload" crossorigin href="/assets/vue-i18n-
|
|
3
|
+
<link rel="modulepreload" crossorigin href="/assets/vue-i18n-eUDnMrPl.js">
|
|
4
4
|
<link rel="modulepreload" crossorigin href="/assets/QIcon-B0-pH3Qs.js">
|
|
5
|
-
<link rel="modulepreload" crossorigin href="/assets/QSeparator-
|
|
6
|
-
<link rel="modulepreload" crossorigin href="/assets/use-id-
|
|
5
|
+
<link rel="modulepreload" crossorigin href="/assets/QSeparator-DNSiXYrN.js">
|
|
6
|
+
<link rel="modulepreload" crossorigin href="/assets/use-id-BmXMngYX.js">
|
|
7
7
|
<link rel="modulepreload" crossorigin href="/assets/QBtn-CyzfM9-_.js">
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/assets/private.use-form-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/assets/use-checkbox-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/scroll-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/QDialog-DQeAxY3-.js">
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/private.use-form-C5G_3nU5.js">
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/use-checkbox-BduGd8xg.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/scroll-C-Vz5BD9.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/QDialog-G448EJG4.js">
|
|
13
12
|
<link rel="modulepreload" crossorigin href="/assets/symbols-DCYodwb2.js">
|
|
14
13
|
<link rel="stylesheet" crossorigin href="/assets/index-eX_lKHSg.css">
|
|
15
14
|
</head><body><div id=q-app></div></body></html>
|
|
@@ -306,3 +306,194 @@ export function listWorkspaceImagesHandler(worktreePath: string): WorkspaceImage
|
|
|
306
306
|
}
|
|
307
307
|
})
|
|
308
308
|
}
|
|
309
|
+
|
|
310
|
+
// ── Documents ────────────────────────────────────────────────────────────────
|
|
311
|
+
|
|
312
|
+
/** Directories (relative to the worktree root) scanned for AI-generated docs. */
|
|
313
|
+
export const DOCUMENT_DIRS = ['docs/plans', 'docs/superpowers', '.ai/thoughts'] as const
|
|
314
|
+
|
|
315
|
+
/** Depth cap to keep recursion bounded even on pathological symlink loops. */
|
|
316
|
+
const DOC_MAX_DEPTH = 8
|
|
317
|
+
|
|
318
|
+
/** Metadata for a markdown document surfaced by the documents tools. */
|
|
319
|
+
export interface DocumentDto {
|
|
320
|
+
path: string
|
|
321
|
+
name: string
|
|
322
|
+
modifiedAt: string
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/** Content payload returned when reading a single document. */
|
|
326
|
+
export interface DocumentContentDto {
|
|
327
|
+
path: string
|
|
328
|
+
content: string
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function walkMarkdownFiles(rootAbs: string, rootRel: string, out: DocumentDto[], depth = 0): void {
|
|
332
|
+
if (depth > DOC_MAX_DEPTH) return
|
|
333
|
+
let entries: string[]
|
|
334
|
+
try {
|
|
335
|
+
entries = fs.readdirSync(rootAbs)
|
|
336
|
+
} catch {
|
|
337
|
+
return
|
|
338
|
+
}
|
|
339
|
+
for (const entry of entries) {
|
|
340
|
+
if (entry.startsWith('.') && entry !== '.ai') continue
|
|
341
|
+
const absEntry = path.join(rootAbs, entry)
|
|
342
|
+
const relEntry = `${rootRel}/${entry}`
|
|
343
|
+
let stat: ReturnType<typeof fs.statSync>
|
|
344
|
+
try {
|
|
345
|
+
stat = fs.statSync(absEntry)
|
|
346
|
+
} catch {
|
|
347
|
+
continue
|
|
348
|
+
}
|
|
349
|
+
if (stat.isDirectory()) {
|
|
350
|
+
walkMarkdownFiles(absEntry, relEntry, out, depth + 1)
|
|
351
|
+
} else if (stat.isFile() && entry.endsWith('.md')) {
|
|
352
|
+
out.push({ path: relEntry, name: entry, modifiedAt: stat.mtime.toISOString() })
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Recursively list every `.md` file under `docs/plans/`, `docs/superpowers/`,
|
|
359
|
+
* and `.ai/thoughts/` inside the given worktree. Sorted by modifiedAt desc.
|
|
360
|
+
*/
|
|
361
|
+
export function listDocumentsHandler(worktreePath: string): DocumentDto[] {
|
|
362
|
+
const documents: DocumentDto[] = []
|
|
363
|
+
for (const dir of DOCUMENT_DIRS) {
|
|
364
|
+
const absDir = path.join(worktreePath, dir)
|
|
365
|
+
if (!fs.existsSync(absDir)) continue
|
|
366
|
+
walkMarkdownFiles(absDir, dir, documents)
|
|
367
|
+
}
|
|
368
|
+
documents.sort((a, b) => new Date(b.modifiedAt).getTime() - new Date(a.modifiedAt).getTime())
|
|
369
|
+
return documents
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Read a single document. The caller-supplied path must be relative to the
|
|
374
|
+
* worktree root and live under one of the allowed DOCUMENT_DIRS; `.md` only;
|
|
375
|
+
* traversal (`..`) is rejected.
|
|
376
|
+
*/
|
|
377
|
+
export function readDocumentHandler(worktreePath: string, relPath: string): DocumentContentDto {
|
|
378
|
+
if (!relPath) throw new Error('path is required')
|
|
379
|
+
const normalized = path.normalize(relPath)
|
|
380
|
+
if (
|
|
381
|
+
normalized.includes('..') ||
|
|
382
|
+
!DOCUMENT_DIRS.some((dir) => normalized.startsWith(`${dir}/`) || normalized === dir)
|
|
383
|
+
) {
|
|
384
|
+
throw new Error(`Invalid path: must be under ${DOCUMENT_DIRS.map((d) => `${d}/`).join(', ')}`)
|
|
385
|
+
}
|
|
386
|
+
if (!normalized.endsWith('.md')) {
|
|
387
|
+
throw new Error('Only .md files can be read')
|
|
388
|
+
}
|
|
389
|
+
const abs = path.join(worktreePath, normalized)
|
|
390
|
+
if (!fs.existsSync(abs)) {
|
|
391
|
+
throw new Error(`Document not found: ${normalized}`)
|
|
392
|
+
}
|
|
393
|
+
return { path: normalized, content: fs.readFileSync(abs, 'utf-8') }
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Append a thought / decision / note to `.ai/thoughts/<YYYY-MM-DD>-<slug>.md`.
|
|
398
|
+
* Creates the directory if missing. Returns the path (worktree-relative) of
|
|
399
|
+
* the file actually written — useful for the agent to reference it in chat.
|
|
400
|
+
*/
|
|
401
|
+
export function logThoughtHandler(
|
|
402
|
+
worktreePath: string,
|
|
403
|
+
data: { title: string; content: string; tag?: string },
|
|
404
|
+
): { path: string } {
|
|
405
|
+
const title = data.title?.trim()
|
|
406
|
+
if (!title) throw new Error('title is required')
|
|
407
|
+
const content = data.content?.trim()
|
|
408
|
+
if (!content) throw new Error('content is required')
|
|
409
|
+
|
|
410
|
+
const thoughtsDir = path.join(worktreePath, '.ai', 'thoughts')
|
|
411
|
+
fs.mkdirSync(thoughtsDir, { recursive: true })
|
|
412
|
+
|
|
413
|
+
const date = new Date().toISOString().slice(0, 10)
|
|
414
|
+
const slug =
|
|
415
|
+
title
|
|
416
|
+
.toLowerCase()
|
|
417
|
+
.normalize('NFKD')
|
|
418
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
419
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
420
|
+
.replace(/^-+|-+$/g, '')
|
|
421
|
+
.slice(0, 60) || 'note'
|
|
422
|
+
const tagSuffix = data.tag ? `-${data.tag.replace(/[^a-z0-9]+/gi, '-').toLowerCase()}` : ''
|
|
423
|
+
const filename = `${date}-${slug}${tagSuffix}.md`
|
|
424
|
+
const abs = path.join(thoughtsDir, filename)
|
|
425
|
+
const relPath = `.ai/thoughts/${filename}`
|
|
426
|
+
|
|
427
|
+
const header = `# ${title}\n\n_${new Date().toISOString()}_${data.tag ? ` · tag: \`${data.tag}\`` : ''}\n\n`
|
|
428
|
+
fs.writeFileSync(abs, header + content + (content.endsWith('\n') ? '' : '\n'), 'utf-8')
|
|
429
|
+
|
|
430
|
+
return { path: relPath }
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// ── Session usage ────────────────────────────────────────────────────────────
|
|
434
|
+
|
|
435
|
+
/** Aggregated token / cost usage for a workspace. */
|
|
436
|
+
export interface SessionUsageDto {
|
|
437
|
+
workspaceTotals: { inputTokens: number; outputTokens: number; costUsd: number }
|
|
438
|
+
currentSession: {
|
|
439
|
+
sessionId: string | null
|
|
440
|
+
inputTokens: number
|
|
441
|
+
outputTokens: number
|
|
442
|
+
costUsd: number
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
interface UsagePayload {
|
|
447
|
+
kind?: string
|
|
448
|
+
inputTokens?: number
|
|
449
|
+
outputTokens?: number
|
|
450
|
+
costUsd?: number
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Aggregate `usage` events from `ws_events` to report how many tokens and
|
|
455
|
+
* dollars the workspace has consumed — both in total and for the currently
|
|
456
|
+
* running agent_session (if any). Silently skips rows whose payload is not
|
|
457
|
+
* valid JSON or not a usage event.
|
|
458
|
+
*/
|
|
459
|
+
export function getSessionUsageHandler(db: Database.Database, workspaceId: string): SessionUsageDto {
|
|
460
|
+
const runningSession = db
|
|
461
|
+
.prepare(
|
|
462
|
+
"SELECT id FROM agent_sessions WHERE workspace_id = ? AND status = 'running' ORDER BY started_at DESC LIMIT 1",
|
|
463
|
+
)
|
|
464
|
+
.get(workspaceId) as { id: string } | undefined
|
|
465
|
+
const currentSessionId = runningSession?.id ?? null
|
|
466
|
+
|
|
467
|
+
const rows = db
|
|
468
|
+
.prepare("SELECT payload, session_id FROM ws_events WHERE workspace_id = ? AND type = 'agent:event'")
|
|
469
|
+
.all(workspaceId) as Array<{ payload: string; session_id: string | null }>
|
|
470
|
+
|
|
471
|
+
const totals = { inputTokens: 0, outputTokens: 0, costUsd: 0 }
|
|
472
|
+
const current = { inputTokens: 0, outputTokens: 0, costUsd: 0 }
|
|
473
|
+
|
|
474
|
+
for (const row of rows) {
|
|
475
|
+
let parsed: UsagePayload
|
|
476
|
+
try {
|
|
477
|
+
parsed = JSON.parse(row.payload) as UsagePayload
|
|
478
|
+
} catch {
|
|
479
|
+
continue
|
|
480
|
+
}
|
|
481
|
+
if (parsed.kind !== 'usage') continue
|
|
482
|
+
const input = typeof parsed.inputTokens === 'number' ? parsed.inputTokens : 0
|
|
483
|
+
const output = typeof parsed.outputTokens === 'number' ? parsed.outputTokens : 0
|
|
484
|
+
const cost = typeof parsed.costUsd === 'number' ? parsed.costUsd : 0
|
|
485
|
+
totals.inputTokens += input
|
|
486
|
+
totals.outputTokens += output
|
|
487
|
+
totals.costUsd += cost
|
|
488
|
+
if (currentSessionId && row.session_id === currentSessionId) {
|
|
489
|
+
current.inputTokens += input
|
|
490
|
+
current.outputTokens += output
|
|
491
|
+
current.costUsd += cost
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return {
|
|
496
|
+
workspaceTotals: totals,
|
|
497
|
+
currentSession: { sessionId: currentSessionId, ...current },
|
|
498
|
+
}
|
|
499
|
+
}
|
|
@@ -9,11 +9,15 @@ import {
|
|
|
9
9
|
createTaskHandler,
|
|
10
10
|
deleteTaskHandler,
|
|
11
11
|
getDevServerStatusHandler,
|
|
12
|
+
getSessionUsageHandler,
|
|
12
13
|
getSettingsHandler,
|
|
13
14
|
getWorkspaceInfoHandler,
|
|
15
|
+
listDocumentsHandler,
|
|
14
16
|
listTasksHandler,
|
|
15
17
|
listWorkspaceImagesHandler,
|
|
18
|
+
logThoughtHandler,
|
|
16
19
|
markTaskDoneHandler,
|
|
20
|
+
readDocumentHandler,
|
|
17
21
|
updateTaskHandler,
|
|
18
22
|
} from './kobo-tasks-handlers.js'
|
|
19
23
|
|
|
@@ -90,24 +94,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
90
94
|
{
|
|
91
95
|
name: 'list_tasks',
|
|
92
96
|
description:
|
|
93
|
-
'
|
|
94
|
-
inputSchema: {
|
|
95
|
-
type: 'object',
|
|
96
|
-
properties: {},
|
|
97
|
-
required: [],
|
|
98
|
-
},
|
|
97
|
+
'CALL FIRST on any non-trivial turn to know what the user wants done and what is already completed. Returns every task and acceptance criterion for the current workspace with its id and status. Re-call periodically (before marking something done, or after the user asks for a status) to stay in sync with user-added or external updates.',
|
|
98
|
+
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
name: 'mark_task_done',
|
|
102
102
|
description:
|
|
103
|
-
'
|
|
103
|
+
'CALL AS SOON AS a task or acceptance criterion is finished AND verified (tests pass, feature works, diff committed). Do not wait for the end of the turn — the user watches progress live and marking each item as it completes is the primary signal Kōbō uses to track you.',
|
|
104
104
|
inputSchema: {
|
|
105
105
|
type: 'object',
|
|
106
106
|
properties: {
|
|
107
|
-
task_id: {
|
|
108
|
-
type: 'string',
|
|
109
|
-
description: 'The ID of the task to mark as done (obtained from list_tasks)',
|
|
110
|
-
},
|
|
107
|
+
task_id: { type: 'string', description: 'Task id from list_tasks.' },
|
|
111
108
|
},
|
|
112
109
|
required: ['task_id'],
|
|
113
110
|
},
|
|
@@ -115,14 +112,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
115
112
|
{
|
|
116
113
|
name: 'create_task',
|
|
117
114
|
description:
|
|
118
|
-
'
|
|
115
|
+
'CALL WHEN you discover follow-up work that was not in the original list and needs to stick around (e.g. "refactor this helper later", "add a test for edge case"). Appends at the end of the list. Do not use it for ephemeral internal notes — prefer log_thought for those.',
|
|
119
116
|
inputSchema: {
|
|
120
117
|
type: 'object',
|
|
121
118
|
properties: {
|
|
122
|
-
title: { type: 'string', description: '
|
|
119
|
+
title: { type: 'string', description: 'Short, imperative title (e.g. "Add retry to fetchUser").' },
|
|
123
120
|
is_acceptance_criterion: {
|
|
124
121
|
type: 'boolean',
|
|
125
|
-
description: '
|
|
122
|
+
description: 'Mark as acceptance criterion rather than a task (default: false).',
|
|
126
123
|
},
|
|
127
124
|
},
|
|
128
125
|
required: ['title'],
|
|
@@ -131,20 +128,20 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
131
128
|
{
|
|
132
129
|
name: 'update_task',
|
|
133
130
|
description:
|
|
134
|
-
'
|
|
131
|
+
'CALL WHEN you need to refine a task — rewording for clarity, flipping status to `in_progress` as you start it, or promoting a task to acceptance criterion. At least one mutable field is required.',
|
|
135
132
|
inputSchema: {
|
|
136
133
|
type: 'object',
|
|
137
134
|
properties: {
|
|
138
|
-
task_id: { type: 'string', description: '
|
|
139
|
-
title: { type: 'string', description: 'New title (optional)' },
|
|
135
|
+
task_id: { type: 'string', description: 'Task id from list_tasks.' },
|
|
136
|
+
title: { type: 'string', description: 'New title (optional).' },
|
|
140
137
|
status: {
|
|
141
138
|
type: 'string',
|
|
142
139
|
enum: ['pending', 'in_progress', 'done'],
|
|
143
|
-
description: 'New status (optional)',
|
|
140
|
+
description: 'New status (optional).',
|
|
144
141
|
},
|
|
145
142
|
is_acceptance_criterion: {
|
|
146
143
|
type: 'boolean',
|
|
147
|
-
description: 'Toggle acceptance criterion flag (optional)',
|
|
144
|
+
description: 'Toggle acceptance criterion flag (optional).',
|
|
148
145
|
},
|
|
149
146
|
},
|
|
150
147
|
required: ['task_id'],
|
|
@@ -152,66 +149,75 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
152
149
|
},
|
|
153
150
|
{
|
|
154
151
|
name: 'delete_task',
|
|
155
|
-
description:
|
|
152
|
+
description:
|
|
153
|
+
'CALL ONLY when a task was created in error or became truly irrelevant (scope change validated by user). Prefer marking done or in_progress over deleting.',
|
|
156
154
|
inputSchema: {
|
|
157
155
|
type: 'object',
|
|
158
156
|
properties: {
|
|
159
|
-
task_id: { type: 'string', description: '
|
|
157
|
+
task_id: { type: 'string', description: 'Task id from list_tasks.' },
|
|
160
158
|
},
|
|
161
159
|
required: ['task_id'],
|
|
162
160
|
},
|
|
163
161
|
},
|
|
164
162
|
{
|
|
165
|
-
name: '
|
|
163
|
+
name: 'get_workspace_info',
|
|
164
|
+
description:
|
|
165
|
+
'CALL EARLY in a session to confirm project path, working/source branch, worktree path, model, and notion link. Cheap read — useful when the user refers to "this workspace" or when you need the worktree path to locate files.',
|
|
166
|
+
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'get_git_info',
|
|
170
|
+
description:
|
|
171
|
+
'CALL BEFORE creating a PR, committing in batches, or reporting progress to the user. Returns commit count ahead of source, files changed, insertions/deletions, and existing PR URL if any.',
|
|
172
|
+
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'set_workspace_status',
|
|
166
176
|
description:
|
|
167
|
-
'
|
|
177
|
+
'CALL WHEN you believe the mission is done (`completed`), blocked beyond recovery (`error`), or explicitly idle awaiting user input (`idle`). Transitions are validated by the backend — invalid ones are rejected.',
|
|
168
178
|
inputSchema: {
|
|
169
179
|
type: 'object',
|
|
170
180
|
properties: {
|
|
171
|
-
|
|
181
|
+
status: {
|
|
172
182
|
type: 'string',
|
|
173
|
-
|
|
183
|
+
enum: ['idle', 'completed', 'error'],
|
|
184
|
+
description: 'Target status.',
|
|
174
185
|
},
|
|
175
186
|
},
|
|
176
|
-
required: [],
|
|
187
|
+
required: ['status'],
|
|
177
188
|
},
|
|
178
189
|
},
|
|
179
190
|
{
|
|
180
|
-
name: '
|
|
191
|
+
name: 'get_notion_ticket',
|
|
181
192
|
description:
|
|
182
|
-
'
|
|
183
|
-
inputSchema: {
|
|
184
|
-
type: 'object',
|
|
185
|
-
properties: {},
|
|
186
|
-
required: [],
|
|
187
|
-
},
|
|
193
|
+
'CALL when the user references "the ticket", "the Notion page", or when you need the source-of-truth text for the mission. Returns the Notion URL + locally-extracted ticket content from .ai/thoughts/.',
|
|
194
|
+
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
188
195
|
},
|
|
189
196
|
{
|
|
190
|
-
name: '
|
|
197
|
+
name: 'get_dev_server_status',
|
|
191
198
|
description:
|
|
192
|
-
'
|
|
199
|
+
'CALL BEFORE asking the user whether the app is running, or when your change is dev-server-sensitive. Returns running/stopped/starting/error + URL, port, container names.',
|
|
193
200
|
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
194
201
|
},
|
|
195
202
|
{
|
|
196
203
|
name: 'start_dev_server',
|
|
197
|
-
description: '
|
|
204
|
+
description: 'CALL WHEN the user asks you to test the running app and the dev server is stopped.',
|
|
198
205
|
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
199
206
|
},
|
|
200
207
|
{
|
|
201
208
|
name: 'stop_dev_server',
|
|
202
|
-
description:
|
|
209
|
+
description:
|
|
210
|
+
'CALL WHEN the user explicitly asks to stop the dev server, or before destructive operations that require a clean boot.',
|
|
203
211
|
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
204
212
|
},
|
|
205
213
|
{
|
|
206
214
|
name: 'get_dev_server_logs',
|
|
207
|
-
description:
|
|
215
|
+
description:
|
|
216
|
+
'CALL WHEN debugging a runtime issue the user describes as happening in the running app. Returns the last N lines of logs (default 200). Cheaper than asking the user to paste them.',
|
|
208
217
|
inputSchema: {
|
|
209
218
|
type: 'object',
|
|
210
219
|
properties: {
|
|
211
|
-
tail: {
|
|
212
|
-
type: 'number',
|
|
213
|
-
description: 'Number of lines to fetch from the end (default: 200)',
|
|
214
|
-
},
|
|
220
|
+
tail: { type: 'number', description: 'Number of lines from the end (default: 200).' },
|
|
215
221
|
},
|
|
216
222
|
required: [],
|
|
217
223
|
},
|
|
@@ -219,35 +225,90 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
219
225
|
{
|
|
220
226
|
name: 'list_workspace_images',
|
|
221
227
|
description:
|
|
222
|
-
'
|
|
228
|
+
'CALL WHEN the user mentions "the screenshot", "the attached image", or when you need to reference a previously-uploaded image. Returns uid, originalName, relativePath, createdAt for every image in .ai/images/.',
|
|
223
229
|
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
224
230
|
},
|
|
225
231
|
{
|
|
226
|
-
name: '
|
|
232
|
+
name: 'get_settings',
|
|
227
233
|
description:
|
|
228
|
-
'
|
|
234
|
+
'CALL WHEN you need to confirm configured models, PR prompt templates, git conventions, or dev-server commands before acting on them. Pass project_path to merge global + project-specific entries.',
|
|
235
|
+
inputSchema: {
|
|
236
|
+
type: 'object',
|
|
237
|
+
properties: {
|
|
238
|
+
project_path: {
|
|
239
|
+
type: 'string',
|
|
240
|
+
description: 'Project path to resolve a specific project entry (optional).',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
required: [],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
// ── Knowledge / context tools ─────────────────────────────────────────────
|
|
247
|
+
{
|
|
248
|
+
name: 'list_documents',
|
|
249
|
+
description:
|
|
250
|
+
'CALL EARLY on a new session to discover plans, specs, and thoughts previously written for this workspace. Recursively lists every .md under docs/plans/, docs/superpowers/, and .ai/thoughts/. Before writing a new plan, check if one already exists.',
|
|
229
251
|
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
230
252
|
},
|
|
231
253
|
{
|
|
232
|
-
name: '
|
|
254
|
+
name: 'read_document',
|
|
233
255
|
description:
|
|
234
|
-
'
|
|
256
|
+
'CALL AFTER list_documents when a file title looks relevant to the current task. Returns the full markdown content. Scoped to docs/plans/, docs/superpowers/, .ai/thoughts/ — reject anything else.',
|
|
235
257
|
inputSchema: {
|
|
236
258
|
type: 'object',
|
|
237
259
|
properties: {
|
|
238
|
-
|
|
260
|
+
path: {
|
|
239
261
|
type: 'string',
|
|
240
|
-
|
|
241
|
-
|
|
262
|
+
description:
|
|
263
|
+
'Worktree-relative path from list_documents (e.g. "docs/superpowers/plans/2026-04-17-foo.md").',
|
|
242
264
|
},
|
|
243
265
|
},
|
|
244
|
-
required: ['
|
|
266
|
+
required: ['path'],
|
|
245
267
|
},
|
|
246
268
|
},
|
|
247
269
|
{
|
|
248
|
-
name: '
|
|
270
|
+
name: 'log_thought',
|
|
271
|
+
description:
|
|
272
|
+
'CALL WHEN you make a decision worth remembering — architecture choice, trade-off taken, dead-end avoided, pattern discovered. Appends a dated markdown file to .ai/thoughts/. Keep entries short and focused; one decision per call. Use create_task for actionable follow-ups instead.',
|
|
273
|
+
inputSchema: {
|
|
274
|
+
type: 'object',
|
|
275
|
+
properties: {
|
|
276
|
+
title: { type: 'string', description: 'Short, descriptive title (becomes the filename slug and the # H1).' },
|
|
277
|
+
content: { type: 'string', description: 'Markdown body explaining the decision and its reasoning.' },
|
|
278
|
+
tag: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
description: 'Optional short tag appended to filename (e.g. "arch", "bug", "perf").',
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
required: ['title', 'content'],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'search_codebase',
|
|
288
|
+
description:
|
|
289
|
+
'CALL WHEN you need to recall prior chat history across workspaces — past decisions, prior user requests, an agent message you remember but can’t locate. Full-text search over user messages + agent outputs persisted in Kōbō. Use the local Grep tool for searching source code; this tool searches CONVERSATIONS.',
|
|
290
|
+
inputSchema: {
|
|
291
|
+
type: 'object',
|
|
292
|
+
properties: {
|
|
293
|
+
query: { type: 'string', description: 'Search phrase. Plain text; no regex.' },
|
|
294
|
+
include_archived: {
|
|
295
|
+
type: 'boolean',
|
|
296
|
+
description: 'Include archived workspaces in the search (default: false).',
|
|
297
|
+
},
|
|
298
|
+
scope: {
|
|
299
|
+
type: 'string',
|
|
300
|
+
enum: ['workspace', 'all'],
|
|
301
|
+
description: 'Restrict to this workspace only (default) or search across every workspace.',
|
|
302
|
+
},
|
|
303
|
+
limit: { type: 'number', description: 'Max results to return (default 30, max 100).' },
|
|
304
|
+
},
|
|
305
|
+
required: ['query'],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'get_session_usage',
|
|
249
310
|
description:
|
|
250
|
-
'
|
|
311
|
+
'CALL when you need to self-regulate on long missions — returns token/cost totals for the workspace lifetime and for the currently running agent_session. Useful before spawning heavy subagents or deep reasoning on already-expensive sessions.',
|
|
251
312
|
inputSchema: { type: 'object', properties: {}, required: [] },
|
|
252
313
|
},
|
|
253
314
|
],
|
|
@@ -379,6 +440,50 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
379
440
|
return ok(result)
|
|
380
441
|
}
|
|
381
442
|
|
|
443
|
+
if (name === 'list_documents') {
|
|
444
|
+
const info = getWorkspaceInfoHandler(db, workspaceId!)
|
|
445
|
+
return ok(listDocumentsHandler(info.worktreePath))
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (name === 'read_document') {
|
|
449
|
+
const docPath = a.path as string | undefined
|
|
450
|
+
if (!docPath) return fail('path parameter is required')
|
|
451
|
+
const info = getWorkspaceInfoHandler(db, workspaceId!)
|
|
452
|
+
return ok(readDocumentHandler(info.worktreePath, docPath))
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (name === 'log_thought') {
|
|
456
|
+
const title = a.title as string | undefined
|
|
457
|
+
const content = a.content as string | undefined
|
|
458
|
+
if (!title) return fail('title parameter is required')
|
|
459
|
+
if (!content) return fail('content parameter is required')
|
|
460
|
+
const info = getWorkspaceInfoHandler(db, workspaceId!)
|
|
461
|
+
return ok(
|
|
462
|
+
logThoughtHandler(info.worktreePath, {
|
|
463
|
+
title,
|
|
464
|
+
content,
|
|
465
|
+
tag: a.tag as string | undefined,
|
|
466
|
+
}),
|
|
467
|
+
)
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (name === 'get_session_usage') {
|
|
471
|
+
return ok(getSessionUsageHandler(db, workspaceId!))
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (name === 'search_codebase') {
|
|
475
|
+
const query = a.query as string | undefined
|
|
476
|
+
if (!query) return fail('query parameter is required')
|
|
477
|
+
const scope = (a.scope as string | undefined) ?? 'workspace'
|
|
478
|
+
const includeArchived = a.include_archived === true
|
|
479
|
+
const limit = Math.min(Math.max(1, (a.limit as number | undefined) ?? 30), 100)
|
|
480
|
+
const qs = new URLSearchParams({ q: query, limit: String(limit) })
|
|
481
|
+
if (includeArchived) qs.set('includeArchived', 'true')
|
|
482
|
+
const raw = (await backendRequest('GET', `/api/search?${qs.toString()}`)) as Array<Record<string, unknown>>
|
|
483
|
+
const results = scope === 'all' ? raw : raw.filter((r) => r.workspaceId === workspaceId)
|
|
484
|
+
return ok({ query, scope, total: results.length, results })
|
|
485
|
+
}
|
|
486
|
+
|
|
382
487
|
return fail(`Unknown tool: ${name}`)
|
|
383
488
|
} catch (err) {
|
|
384
489
|
return fail(err instanceof Error ? err.message : String(err))
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{E as e,F as t,H as n,L as r,M as i,Q as a,U as o,_t as s,bt as c,d as l,f as u,g as d,h as f,l as p,p as m,r as h,rt as g,u as _,v,yt as y}from"./runtime-core.esm-bundler-C3IgBgY5.js";import{L as b,l as x,t as S}from"./QIcon-B0-pH3Qs.js";import{t as C}from"./QBtn-CyzfM9-_.js";import{n as w}from"./vue-i18n-CeG0hR0Z.js";import{S as T,v as E,x as D}from"./index-CUI-zN26.js";import{t as O}from"./QSpinnerDots-DEiRooBD.js";import{t as k}from"./QExpansionItem-DCRks-Ra.js";import{t as ee}from"./QScrollArea-e5qTqwcb.js";import{n as A,r as j,t as M}from"./documents-CHc8t22V.js";import{t as N}from"./_plugin-vue_export-helper-r4mAJOHR.js";function te(e,t,n=!0){let r=[],i=new Map,a=new Map;for(let n=0;n<e.length;n++){let o=e[n],s=t?.[n];switch(o.kind){case`message:text`:{let e=i.get(o.messageId);if(e)e.text+=o.text,e.streaming=o.streaming;else{let e={type:`text`,messageId:o.messageId,text:o.text,streaming:o.streaming,ts:s};i.set(o.messageId,e),r.push(e)}break}case`message:end`:{let e=i.get(o.messageId);e&&(e.streaming=!1);break}case`message:thinking`:r.push({type:`thinking`,messageId:o.messageId,text:o.text,ts:s});break;case`tool:call`:{let e={type:`tool`,toolCallId:o.toolCallId,name:o.name,input:o.input,ts:s};a.set(o.toolCallId,e),r.push(e);break}case`tool:result`:{let e=a.get(o.toolCallId);e&&(e.result={output:o.output,isError:o.isError});break}case`session:started`:r.push({type:`session`,kind:`started`,detail:{engineSessionId:o.engineSessionId,model:o.model},ts:s});break;case`session:ended`:r.push({type:`session`,kind:`ended`,detail:{reason:o.reason,exitCode:o.exitCode},ts:s});break;case`session:compacted`:r.push({type:`session`,kind:`compacted`,ts:s});break;case`session:brainstorm-complete`:case`message:raw`:case`skills:discovered`:case`usage`:case`rate_limit`:case`subagent:progress`:case`error`:break;default:}}let o=null;for(let e of r)e.type===`text`&&e.streaming&&(o&&(o.streaming=!1),o=e);return o&&!n&&(o.streaming=!1),r}function ne(e,t){if(t.length===0)return e;let n=t.map(e=>({type:`user`,content:e.content,sender:e.sender,ts:e.ts})),r=[...e,...n];r.sort((e,t)=>{let n=e.ts??``,r=t.ts??``;return n===r?0:n?r?n<r?-1:1:-1:1});let i;for(let e of r)e.type===`user`&&e.sender!==`system-prompt`&&e.ts&&(!i||e.ts>i)&&(i=e.ts);if(i)for(let e of r)e.type===`text`&&e.streaming&&(!e.ts||e.ts<i)&&(e.streaming=!1);return r}function P(e){switch(e.type){case`user`:return e.sender===`system-prompt`?`system-prompt`:`user`;case`session`:return`session`;default:return`agent`}}function F(e){let t=[],n=null;for(let r of e){let e=P(r),i=e===`session`||e===`system-prompt`;!n||n.speaker!==e||i?(n={speaker:e,ts:r.ts,items:[r]},t.push(n),i&&(n=null)):n.items.push(r)}return t}var I={class:`text-caption text-grey-6`},L=v({__name:`SessionEventItem`,props:{item:{}},setup(e){let n=e,r=p(()=>{switch(n.item.kind){case`started`:return`session.started`;case`ended`:return`session.ended`;case`compacted`:return`session.compacted`;default:return`session.started`}});return(e,n)=>(t(),m(`span`,I,c(e.$t(r.value)),1))}});function R(e,t){if(t.length===0||e.length===0)return e;let n=[...t].sort((e,t)=>t.length-e.length),r=new DOMParser().parseFromString(`<div>${e}</div>`,`text/html`),i=r.body.firstChild;if(!i)return e;function a(e){if(e.nodeType===Node.TEXT_NODE){z(e,n,r);return}if(e.nodeName===`A`)return;let t=Array.from(e.childNodes);for(let e of t)a(e)}return a(i),i.innerHTML}function z(e,t,n){let r=e.textContent??``;if(!t.some(e=>r.includes(e)))return;let i=n.createDocumentFragment(),a=0;for(;a<r.length;){let e=B(r,a,t);if(!e){i.appendChild(n.createTextNode(r.slice(a)));break}e.index>a&&i.appendChild(n.createTextNode(r.slice(a,e.index)));let o=n.createElement(`a`);o.className=`document-link`,o.setAttribute(`data-document-path`,e.path),o.setAttribute(`href`,`#`),o.textContent=e.path,i.appendChild(o),a=e.index+e.path.length}e.parentNode?.replaceChild(i,e)}function B(e,t,n){let r=null;for(let i of n){let n=e.indexOf(i,t);n<0||(!r||n<r.index||n===r.index&&i.length>r.path.length)&&(r={index:n,path:i})}return r}var V=[`innerHTML`],H=N(v({__name:`TextMessageItem`,props:{item:{}},setup(e){let n=e,r=M(),i=E(),a=p(()=>{let e=i.selectedWorkspaceId;return e?r.documentsFor(e).map(e=>e.path):[]}),o=p(()=>{let e=R(A.parse(n.item.text,{async:!1,breaks:!0,gfm:!0}),a.value);return j.sanitize(e,{ADD_ATTR:[`data-document-path`]})});function s(e){let t=e.target?.closest(`.document-link`);if(!t)return;e.preventDefault();let n=t.getAttribute(`data-document-path`),a=i.selectedWorkspaceId;!n||!a||r.openDocumentByPath(a,n)}return(n,r)=>(t(),m(`div`,{class:`markdown-message`,onClick:s},[_(`div`,{innerHTML:o.value},null,8,V),e.item.streaming?(t(),l(x,{key:0,size:`xs`,class:`q-ml-xs`})):u(``,!0)]))}}),[[`__scopeId`,`data-v-0ac5a3e4`]]),U={key:0,class:`text-caption text-grey-5`,style:{"font-style":`italic`}},W=[`innerHTML`],G={key:1,style:{"white-space":`pre-wrap`}},K=N(v({__name:`ThinkingItem`,props:{item:{}},setup(e){let n=e,r=p(()=>n.item.text.trim().slice(0,100)),i=p(()=>n.item.text.trim().length>0),a=p(()=>n.item.text.trim().length>100),s=p(()=>{let e=A.parse(n.item.text,{async:!1,breaks:!0,gfm:!0});return j.sanitize(e)});return(n,d)=>i.value?(t(),m(`div`,U,[a.value?(t(),l(k,{key:0,dense:``,"dense-toggle":``,label:r.value,"header-class":`text-grey-5 text-caption`,style:{"font-style":`italic`}},{default:o(()=>[_(`div`,{class:`q-py-xs markdown-thinking`,innerHTML:s.value},null,8,W)]),_:1},8,[`label`])):(t(),m(`span`,G,c(e.item.text),1))])):u(``,!0)}}),[[`__scopeId`,`data-v-e9fb9f90`]]);function q(e,t){let n=e.split(`
|
|
2
|
-
`),r=t.split(`
|
|
3
|
-
`),i=n.length,a=r.length,o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=i-1;e>=0;e--)for(let t=a-1;t>=0;t--)n[e]===r[t]?o[e][t]=o[e+1][t+1]+1:o[e][t]=Math.max(o[e+1][t],o[e][t+1]);let s=[],c=0,l=0;for(;c<i&&l<a;)n[c]===r[l]?(s.push({type:`context`,content:n[c]}),c++,l++):o[c+1][l]>=o[c][l+1]?(s.push({type:`del`,content:n[c]}),c++):(s.push({type:`add`,content:r[l]}),l++);for(;c<i;)s.push({type:`del`,content:n[c++]});for(;l<a;)s.push({type:`add`,content:r[l++]});return s}function J(e,t){if(!t||typeof t!=`object`)return null;let n=t;if(e===`Edit`){let e=n.file_path;if(!e)return null;let t=n.old_string??``,r=n.new_string??``;return{toolName:`Edit`,filePath:e,oldString:t,newString:r,replaceAll:n.replace_all??!1,additions:r?r.split(`
|
|
4
|
-
`).length:0,deletions:t?t.split(`
|
|
5
|
-
`).length:0}}if(e===`Write`){let e=n.file_path;if(!e)return null;let t=n.content??``;return{toolName:`Write`,filePath:e,content:t,additions:t?t.split(`
|
|
6
|
-
`).length:0,deletions:0}}if(e===`Bash`){let e=(n.command??``).match(/^\s*rm\s+(?:-[a-zA-Z]*\s+)*(.+)/);if(e)return{toolName:`Bash:rm`,filePath:e[1].trim().replace(/["']/g,``),additions:0,deletions:1}}return null}function Y(e,t){if(!e||!t?.projectPath)return e;let n=X(e,`${t.projectPath}/.worktrees/${t.workingBranch}`);return n===e&&(n=X(e,t.projectPath)),n}function X(e,t){if(!t)return e;let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return e.replace(RegExp(`${n}/`,`g`),``).replace(RegExp(`${n}(?=\\s|$|["'\`])`,`g`),`.`)}var re={class:`tool-name`},ie=[`title`],ae={key:0,class:`tool-stat-add`},oe={key:1,class:`tool-stat-del`},se={class:`diff-sign`},ce={key:1,class:`tool-row tool-row-generic`},le={class:`tool-header`},ue={class:`tool-name`},de=[`title`],fe={key:0,class:`tool-output`},pe=N(v({__name:`ToolCallItem`,props:{item:{}},setup(e){let n=e,i=a(!1),o=E(),g=p(()=>J(n.item.name,n.item.input)),v=p(()=>g.value?Y(g.value.filePath,o.selectedWorkspace):``),y={Bash:`terminal`,Read:`description`,Edit:`edit`,Write:`edit_note`,MultiEdit:`edit`,Glob:`folder_open`,Grep:`manage_search`,LS:`list`,Skill:`auto_awesome`,Task:`hub`,Agent:`hub`,TodoWrite:`checklist`,TodoRead:`checklist`,ToolSearch:`search`,WebFetch:`public`,WebSearch:`travel_explore`,NotebookRead:`book`,NotebookEdit:`edit_note`,SendMessage:`send`,ExitPlanMode:`check_circle_outline`,KillShell:`stop_circle`,BashOutput:`terminal`},x=p(()=>y[n.item.name]??`build`),C=p(()=>{if(g.value)return``;let e=n.item.input,t=w(e);return t?Y(t,o.selectedWorkspace):``});function w(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;for(let e of[`file_path`,`path`,`command`,`pattern`,`query`,`url`,`skill`,`description`,`subject`,`prompt`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n}for(let e of Object.values(t))if(typeof e==`string`&&e.length>0)return e;return``}let T=p(()=>{let e=g.value;return e?e.toolName===`Edit`&&e.oldString!==void 0&&e.newString!==void 0?q(e.oldString,e.newString):e.toolName===`Write`&&e.content!==void 0?e.content.split(`
|
|
7
|
-
`).map(e=>({type:`add`,content:e})):e.toolName===`Bash:rm`?[{type:`del`,content:`File deleted`}]:null:null}),D=p(()=>{let e=n.item.result;if(!e)return``;if(typeof e.output==`string`)return e.output;try{return JSON.stringify(e.output)}catch{return String(e.output)}});function O(){i.value=!i.value}return(n,a)=>g.value?(t(),m(`div`,{key:0,class:s([`tool-row`,{"tool-row-expanded":i.value}])},[_(`div`,{class:`tool-header`,onClick:O},[d(S,{name:x.value,size:`14px`,class:`tool-icon`},null,8,[`name`]),_(`span`,re,c(g.value.toolName===`Bash:rm`?`Bash`:g.value.toolName),1),_(`span`,{class:`tool-path`,title:g.value.filePath},c(v.value),9,ie),g.value.additions>0?(t(),m(`span`,ae,`+`+c(g.value.additions),1)):u(``,!0),g.value.deletions>0?(t(),m(`span`,oe,`-`+c(g.value.deletions),1)):u(``,!0),e.item.result?.isError?(t(),l(S,{key:2,name:`error_outline`,color:`negative`,size:`xs`,class:`q-ml-xs`})):e.item.result?(t(),l(S,{key:3,name:`check`,color:`positive`,size:`xs`,class:`q-ml-xs`})):u(``,!0),d(S,{name:i.value?`expand_less`:`expand_more`,size:`xs`,class:`q-ml-auto text-grey-6`},null,8,[`name`])]),i.value&&T.value?(t(),m(`div`,{key:0,class:`tool-diff`,onClick:a[0]||=b(()=>{},[`stop`])},[(t(!0),m(h,null,r(T.value,(e,n)=>(t(),m(`div`,{key:n,class:s([`diff-line`,{"diff-del":e.type===`del`,"diff-add":e.type===`add`,"diff-context":e.type===`context`}])},[_(`span`,se,c(e.type===`del`?`-`:e.type===`add`?`+`:` `),1),f(c(e.content),1)],2))),128))])):u(``,!0)],2)):(t(),m(`div`,ce,[_(`div`,le,[d(S,{name:x.value,size:`14px`,class:`tool-icon`},null,8,[`name`]),_(`span`,ue,c(e.item.name),1),C.value?(t(),m(`span`,{key:0,class:`tool-arg`,title:w(e.item.input)||C.value},c(C.value),9,de)):u(``,!0),e.item.result?.isError?(t(),l(S,{key:1,name:`error_outline`,color:`negative`,size:`xs`,class:`q-ml-auto`})):e.item.result?(t(),l(S,{key:2,name:`check`,color:`positive`,size:`xs`,class:`q-ml-auto`})):u(``,!0)]),e.item.result&&D.value?(t(),m(`div`,fe,c(D.value),1)):u(``,!0)]))}}),[[`__scopeId`,`data-v-440d2c83`]]),me=[`innerHTML`],he={key:1,class:`markdown-message`},ge=[`innerHTML`],_e=N(v({__name:`UserMessageItem`,props:{item:{}},setup(e){let n=e,r=p(()=>n.item.sender===`system-prompt`),i=p(()=>{let e=A.parse(n.item.content,{async:!1,breaks:!0,gfm:!0});return j.sanitize(e)});return(e,n)=>r.value?(t(),l(k,{key:0,dense:``,"dense-toggle":``,label:e.$t(`chat.systemPrompt`),"header-class":`text-grey-5 text-caption`},{default:o(()=>[_(`div`,{class:`q-py-xs markdown-user-prompt`,innerHTML:i.value},null,8,me)]),_:1},8,[`label`])):(t(),m(`div`,he,[_(`div`,{innerHTML:i.value},null,8,ge)]))}}),[[`__scopeId`,`data-v-cb8cec0f`]]),ve={class:`turn-header`},ye={key:0,class:`turn-time`},be={key:1,class:`turn-actions`},xe={class:`turn-body`},Se=N(v({__name:`TurnCard`,props:{turn:{}},setup(e){let n=e,{t:i}=w(),a=p(()=>{switch(n.turn.speaker){case`user`:return{label:i(`chat.you`),accent:`#ce93d8`,badgeClass:`turn-badge-user`};case`agent`:return{label:i(`chat.agent`),accent:`#7986cb`,badgeClass:`turn-badge-agent`};case`system-prompt`:return{label:i(`chat.systemPrompt`),accent:`#757575`,badgeClass:`turn-badge-system`};case`session`:return{label:i(`chat.session`),accent:`#616161`,badgeClass:`turn-badge-session`}}}),o=p(()=>{if(!n.turn.ts)return``;let e=new Date(n.turn.ts);return Number.isNaN(e.getTime())?``:e.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}),d=p(()=>n.turn.items.filter(e=>e.type===`tool`).length);return(n,f)=>(t(),m(`div`,{class:s([`turn-card`,{"turn-card--user":e.turn.speaker===`user`}]),style:y({"--turn-accent":a.value.accent})},[_(`div`,ve,[_(`span`,{class:s([`turn-badge`,a.value.badgeClass])},c(a.value.label),3),o.value?(t(),m(`span`,ye,c(o.value),1)):u(``,!0),d.value>0?(t(),m(`span`,be,` · `+c(g(i)(`chat.nActions`,{n:d.value})),1)):u(``,!0)]),_(`div`,xe,[(t(!0),m(h,null,r(e.turn.items,(e,n)=>(t(),m(h,{key:n},[e.type===`text`?(t(),l(H,{key:0,item:e},null,8,[`item`])):e.type===`thinking`?(t(),l(K,{key:1,item:e},null,8,[`item`])):e.type===`tool`?(t(),l(pe,{key:2,item:e},null,8,[`item`])):e.type===`user`?(t(),l(_e,{key:3,item:e},null,8,[`item`])):e.type===`session`?(t(),l(L,{key:4,item:e},null,8,[`item`])):u(``,!0)],64))),128))])],6))}}),[[`__scopeId`,`data-v-8a9ce6dd`]]),Ce={key:0,class:`activity-feed-switching`},we={key:1,class:`activity-feed-wrap`},Te={key:0,class:`text-center q-py-sm text-caption text-grey-6`},Ee={class:`q-pa-md`},De={key:1,class:`q-px-md q-pb-md`},Z=60,Q=200,$=200,Oe=400,ke=200,Ae=N(v({__name:`ActivityFeed`,props:{workspaceId:{}},setup(s){let g=s,v=T(),y=D(),b=E(),S=p(()=>(b.activityFeeds[g.workspaceId]??[]).filter(e=>e.type===`text`&&typeof e.content==`string`).map(e=>({content:e.content,sender:e.meta?.sender??`user`,ts:e.timestamp,sessionId:e.sessionId}))),w=p(()=>{let e=b.workspaces.find(e=>e.id===g.workspaceId);return e?e.status===`extracting`||e.status===`brainstorming`||e.status===`executing`:!1}),A=p(()=>{let e=ne(te(v.eventsFor(g.workspaceId),v.timestampsFor(g.workspaceId),w.value),S.value);return F(y.showVerboseSystemMessages?e:e.filter(e=>e.type!==`session`))}),j=p(()=>y.showVerboseSystemMessages?v.eventsFor(g.workspaceId).filter(e=>e.kind===`message:raw`).map(e=>e.content):[]),M=a(null),N=!0,P=a(!1),I=!1,L=a(!0);function R(e){N=e.verticalSize-e.verticalPosition-e.verticalContainerSize<=Z,I&&e.verticalPosition<=Q&&!P.value&&v.hasMoreOlderFor(g.workspaceId)&&z()}async function z(){let t=g.workspaceId,n=v.oldestIdFor(t);if(!n)return;P.value=!0;let r=Date.now();try{let r=M.value,i=r?.getScroll().verticalSize??0,a=r?.getScroll().verticalPosition??0,o=fetch(`/api/workspaces/${t}/events?before=${encodeURIComponent(n)}&limit=200`),s=new Promise(e=>setTimeout(e,$)),[c]=await Promise.all([o,s]);if(!c.ok){v.prepend(t,[],[],{oldestId:n,hasMoreOlder:!1});return}let l=await c.json(),u=l.events??[],d=u.filter(e=>e.type===`agent:event`&&e.workspaceId===t),f=u.filter(e=>e.type===`user:message`&&e.workspaceId===t),p=d.map(e=>e.payload),m=d.map(e=>e.createdAt),h=d.map(e=>e.sessionId??null),g=u.length>0?u[0].id:n;v.prepend(t,p,m,{oldestId:g,hasMoreOlder:l.hasMore,sessionIds:h});for(let e of f){let n=e.payload;typeof n.content==`string`&&b.addActivityItem(t,{id:e.id,type:`text`,content:n.content,timestamp:e.createdAt,sessionId:e.sessionId??void 0,meta:{sender:n.sender??`user`}})}if(await e(),r){let e=r.getScroll().verticalSize-i,t=Math.max(a+e,Q+50);r.setScrollPosition(`vertical`,t,0)}}catch(e){console.error(`[ActivityFeed] failed to load older events:`,e)}finally{let e=Date.now()-r,t=Math.max(0,$-e);await new Promise(e=>setTimeout(e,t+Oe)),P.value=!1}}async function B(t=0){await e();let n=M.value;if(!n)return;let r=n.getScroll();n.setScrollPosition(`vertical`,r.verticalSize,t)}let V=a([]),H=a(null);function U(){let e=A.value,t=V.value,n=[];if(t.length===e.length){for(let r=0;r<e.length;r++){if(e[r].speaker!==`user`)continue;let i=t[r]?.$el;i&&n.push(i)}if(n.length>0)return n}let r=H.value?.parentElement;if(r){let e=r.querySelectorAll(`.turn-card--user`);for(let t of e)n.push(t)}return n}function W(){let e=M.value;if(!e)return null;let t=H.value;if(!t)return null;let n=e.getScroll().verticalPosition,r=t.getBoundingClientRect().top,i=null;for(let e of U()){let t=e.getBoundingClientRect().top-r;if(t<n-40)i=t;else break}return i}async function G(){let t=M.value;if(!t)return;let n=W();if(n===null)for(let t=0;t<15&&v.hasMoreOlderFor(g.workspaceId);t++){for(;P.value;)await new Promise(e=>setTimeout(e,50));if(await z(),await e(),n=W(),n!==null)break}n!==null&&t.setScrollPosition(`vertical`,Math.max(0,n-12),250)}async function K(){I=!1,await e(),await B(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{I=!0})})}let q=p(()=>v.eventsFor(g.workspaceId).length);async function J(){L.value=!0;let e=Date.now();await new Promise(e=>setTimeout(e,ke));let t=e+5e3;for(;q.value===0&&Date.now()<t;)await new Promise(e=>setTimeout(e,50));L.value=!1}n(L,async e=>{!e&&q.value>0&&await K()}),i(()=>{J(),q.value>0&&K()});let Y=!1;return n(q,async(e,t)=>{if(!Y&&e>0){Y=!0,await K();return}e>t&&N&&!P.value&&await B(180)}),n(()=>g.workspaceId,()=>{N=!0,Y=!1,I=!1,J(),q.value>0&&K()}),n(()=>b.selectedSessionId,async()=>{N=!0,I=!1,await K()}),n(p(()=>S.value.filter(e=>e.sender!==`system-prompt`).length),async(e,t)=>{e>t&&(N=!0,await B(180))}),(e,n)=>L.value?(t(),m(`div`,Ce,[d(O,{size:`40px`,color:`indigo-4`})])):(t(),m(`div`,we,[d(ee,{ref_key:`scrollRef`,ref:M,class:`activity-feed-scroll`,onScroll:R},{default:o(()=>[_(`div`,{ref_key:`contentOriginRef`,ref:H,class:`content-origin-marker`},null,512),P.value?(t(),m(`div`,Te,[d(x,{size:`sm`}),f(` `+c(e.$t(`activity.loading_older`)),1)])):u(``,!0),_(`div`,Ee,[(t(!0),m(h,null,r(A.value,(e,n)=>(t(),l(Se,{key:n,ref_for:!0,ref_key:`turnRefs`,ref:V,turn:e},null,8,[`turn`]))),128))]),j.value.length?(t(),m(`div`,De,[d(k,{label:e.$t(`activity.raw_lines`,{n:j.value.length}),dense:``},{default:o(()=>[(t(!0),m(h,null,r(j.value,(e,n)=>(t(),m(`div`,{key:n,class:`text-caption text-grey q-pa-xs`},c(e),1))),128))]),_:1},8,[`label`])])):u(``,!0)]),_:1},512),d(C,{round:``,dense:``,unelevated:``,color:`grey-9`,"text-color":`grey-3`,icon:`arrow_upward`,size:`sm`,class:`activity-feed-prev-btn`,title:e.$t(`activity.prev_user_message`),onClick:G},null,8,[`title`])]))}}),[[`__scopeId`,`data-v-51e2c6eb`]]);export{Ae as default};
|