@seele00/seele 0.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LEGAL.md +7 -0
  2. package/README.md +76 -0
  3. package/bin/seele-codex +58 -0
  4. package/codex/dist/app-server.js +63 -0
  5. package/codex/dist/errors.js +16 -0
  6. package/codex/dist/index.js +4 -0
  7. package/codex/dist/rpc-client.js +96 -0
  8. package/codex/dist/transports/stdio.js +81 -0
  9. package/codex/dist/types.js +1 -0
  10. package/codex/package.json +12 -0
  11. package/package.json +24 -0
  12. package/scripts/deploy/bootstrap.sh +318 -0
  13. package/scripts/deploy/npm/postinstall.mjs +10 -0
  14. package/scripts/deploy/prepare-proxy.sh +273 -0
  15. package/scripts/deploy/seele.env.example +75 -0
  16. package/scripts/deploy/start.sh +101 -0
  17. package/server/dist/auth/session.js +71 -0
  18. package/server/dist/auth/users.js +192 -0
  19. package/server/dist/codex-runtime/run-streamed-turn.js +587 -0
  20. package/server/dist/config/config.js +71 -0
  21. package/server/dist/contracts/artifact-rendering.js +14 -0
  22. package/server/dist/contracts/global-environment.js +23 -0
  23. package/server/dist/contracts/index.js +114 -0
  24. package/server/dist/contracts/managed-assets.js +13 -0
  25. package/server/dist/contracts/response-style.js +23 -0
  26. package/server/dist/contracts/task-clarification.js +13 -0
  27. package/server/dist/contracts/types.js +1 -0
  28. package/server/dist/contracts/wakeup.js +13 -0
  29. package/server/dist/contracts/workspace-boundary.js +20 -0
  30. package/server/dist/contracts/workspace-knowledge.js +48 -0
  31. package/server/dist/contracts/workspace-memory.js +32 -0
  32. package/server/dist/contracts/workspace-responsibility.js +23 -0
  33. package/server/dist/contracts/workspace-transcript.js +26 -0
  34. package/server/dist/conversations/knowledge.js +380 -0
  35. package/server/dist/conversations/store.js +2376 -0
  36. package/server/dist/doctor.js +105 -0
  37. package/server/dist/realtime/sse.js +12 -0
  38. package/server/dist/runtime-worker/client.js +405 -0
  39. package/server/dist/runtime-worker/process.js +216 -0
  40. package/server/dist/runtime-worker/protocol.js +1 -0
  41. package/server/dist/server.js +4570 -0
  42. package/server/dist/storage/sqlite.js +39 -0
  43. package/web/dist/assets/abnfDiagram-VRR7QNED-DevTexTl.js +1 -0
  44. package/web/dist/assets/arc-WlXuN6B_.js +1 -0
  45. package/web/dist/assets/architectureDiagram-ZJ3FMSHR-DJYRAqSp.js +36 -0
  46. package/web/dist/assets/bash-BELqPA7S.js +1 -0
  47. package/web/dist/assets/blockDiagram-677ZJIJ3-CsjO1oTv.js +132 -0
  48. package/web/dist/assets/c4Diagram-LMCZKHZV-DjUCYgVk.js +10 -0
  49. package/web/dist/assets/channel-DGnywxBx.js +1 -0
  50. package/web/dist/assets/chunk-2Q5K7J3B-By6S-6eo.js +1 -0
  51. package/web/dist/assets/chunk-32BRIVSS-Cl-hXbZD.js +1 -0
  52. package/web/dist/assets/chunk-5VM5RSS4--cWPnxlT.js +15 -0
  53. package/web/dist/assets/chunk-EX3LRPZG-PakDrWLX.js +231 -0
  54. package/web/dist/assets/chunk-JWPE2WC7-DMfuuvGl.js +1 -0
  55. package/web/dist/assets/chunk-MOJQB5TN-BHD_IRop.js +88 -0
  56. package/web/dist/assets/chunk-RYQCIY6F-T4jqSvsD.js +1 -0
  57. package/web/dist/assets/chunk-V7JOEXUC-C4paE6t8.js +206 -0
  58. package/web/dist/assets/chunk-VR4S4FIN-F5foapWH.js +1 -0
  59. package/web/dist/assets/chunk-XXDRQBXY-Dp4WIFPJ.js +1 -0
  60. package/web/dist/assets/classDiagram-OUVF2IWQ-DjHXtkKr.js +1 -0
  61. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DjHXtkKr.js +1 -0
  62. package/web/dist/assets/core-CGjsG6g4.js +12 -0
  63. package/web/dist/assets/cose-bilkent-JH36ORCC-DcMU2oKv.js +1 -0
  64. package/web/dist/assets/css-CLj8gQPS.js +1 -0
  65. package/web/dist/assets/cynefin-VYW2F7L2-SiDUbAfJ.js +178 -0
  66. package/web/dist/assets/cynefinDiagram-TSTJHNR4-DhkNlW7i.js +62 -0
  67. package/web/dist/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
  68. package/web/dist/assets/dagre-VKFMJZFB-Co--CY4-.js +4 -0
  69. package/web/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  70. package/web/dist/assets/diagram-FQU43EPY-BZs6G_Wi.js +3 -0
  71. package/web/dist/assets/diagram-G47NLZAW-C6SAe39v.js +24 -0
  72. package/web/dist/assets/diagram-NH7WQ7WH-D6EoRzQM.js +24 -0
  73. package/web/dist/assets/diagram-OA4YK3LP-kHe4KJ_b.js +30 -0
  74. package/web/dist/assets/diagram-WEI45ONY-BM-NnNEq.js +41 -0
  75. package/web/dist/assets/diff-D97Zzqfu.js +1 -0
  76. package/web/dist/assets/dockerfile-BcOcwvcX.js +1 -0
  77. package/web/dist/assets/ebnfDiagram-CCIWWBDH-BfwqR7DU.js +1 -0
  78. package/web/dist/assets/engine-javascript-DBd1bXLz.js +141 -0
  79. package/web/dist/assets/erDiagram-Q63AITRT-BwUkv7nL.js +85 -0
  80. package/web/dist/assets/flowDiagram-23GEKE2U-Cn0zH9bm.js +156 -0
  81. package/web/dist/assets/ganttDiagram-NO4QXBWP-BY_VLaEQ.js +292 -0
  82. package/web/dist/assets/gitGraphDiagram-IHSO6WYX-D0xpVnfm.js +106 -0
  83. package/web/dist/assets/github-light-DAi9KRSo.js +1 -0
  84. package/web/dist/assets/graph-C9eacEi8.js +1 -0
  85. package/web/dist/assets/html-pp8916En.js +1 -0
  86. package/web/dist/assets/index-Bl4JO4M7.css +1 -0
  87. package/web/dist/assets/index-D9Ao6WQl.js +111 -0
  88. package/web/dist/assets/infoDiagram-FWYZ7A6U-DnmnPGAH.js +2 -0
  89. package/web/dist/assets/init-Gi6I4Gst.js +1 -0
  90. package/web/dist/assets/ishikawaDiagram-FXEZZL3T-DTWLm3ZQ.js +70 -0
  91. package/web/dist/assets/java-CylS5w8V.js +1 -0
  92. package/web/dist/assets/javascript-wDzz0qaB.js +1 -0
  93. package/web/dist/assets/journeyDiagram-5HDEW3XC-RN13a5iK.js +139 -0
  94. package/web/dist/assets/json-Cp-IABpG.js +1 -0
  95. package/web/dist/assets/jsonc-Des-eS-w.js +1 -0
  96. package/web/dist/assets/jsx-g9-lgVsj.js +1 -0
  97. package/web/dist/assets/kanban-definition-HUTT4EX6-CvmlJTH9.js +89 -0
  98. package/web/dist/assets/katex-C5jXJg4s.js +257 -0
  99. package/web/dist/assets/layout-DEXfKzaS.js +1 -0
  100. package/web/dist/assets/linear-zHsglUI0.js +1 -0
  101. package/web/dist/assets/map-Czzmt4hB.js +1 -0
  102. package/web/dist/assets/markdown-Cvjx9yec.js +1 -0
  103. package/web/dist/assets/mermaid.core-Bfj9YagN.js +314 -0
  104. package/web/dist/assets/mindmap-definition-LN4V7U3C-CkcLeMWS.js +96 -0
  105. package/web/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  106. package/web/dist/assets/pegDiagram-2B236MQR-eturQJg0.js +1 -0
  107. package/web/dist/assets/pieDiagram-ENE6RG2P-DJmmSZSO.js +39 -0
  108. package/web/dist/assets/python-B6aJPvgy.js +1 -0
  109. package/web/dist/assets/quadrantDiagram-ABIIQ3AL-Br5y_5ZO.js +7 -0
  110. package/web/dist/assets/railroadDiagram-RFXS5EU6-DwnwvUqm.js +1 -0
  111. package/web/dist/assets/requirementDiagram-TGXJPOKE-CMMKGrPQ.js +84 -0
  112. package/web/dist/assets/sankeyDiagram-HTMAVEWB-BKP-cLrV.js +40 -0
  113. package/web/dist/assets/sequenceDiagram-DBY2YBRQ-YgkgEj_6.js +162 -0
  114. package/web/dist/assets/sizeCapture-X5ZJPWSS-nkigHDeZ.js +1 -0
  115. package/web/dist/assets/sql-CRqJ_cUM.js +1 -0
  116. package/web/dist/assets/stateDiagram-2N3HPSRC-CEoMK2Kt.js +1 -0
  117. package/web/dist/assets/stateDiagram-v2-6OUMAXLB--iEtUEGo.js +1 -0
  118. package/web/dist/assets/swimlanes-5IMT3BWC-Co9CmBP_.js +2 -0
  119. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BzapPKvi.js +8 -0
  120. package/web/dist/assets/timeline-definition-FHXFAJF6-C5njALNw.js +120 -0
  121. package/web/dist/assets/toml-vGWfd6FD.js +1 -0
  122. package/web/dist/assets/tsx-COt5Ahok.js +1 -0
  123. package/web/dist/assets/typescript-BPQ3VLAy.js +1 -0
  124. package/web/dist/assets/vennDiagram-L72KCM5P-BpvLQRHS.js +34 -0
  125. package/web/dist/assets/wardleyDiagram-EHGQE667-CWINCOno.js +78 -0
  126. package/web/dist/assets/xml-sdJ4AIDG.js +1 -0
  127. package/web/dist/assets/xychartDiagram-FW5EYKEG-xDH3ABG4.js +7 -0
  128. package/web/dist/assets/yaml-Buea-lGh.js +1 -0
  129. package/web/dist/index.html +13 -0
@@ -0,0 +1,89 @@
1
+ import{_ as c,l as te,c as W,D as fe,af as ye,ag as be,ah as me,ad as _e,B as K,i as G,Y as ke,Z as Ee,aa as Se,ab as le,ac as ce}from"./mermaid.core-Bfj9YagN.js";import{g as Ne}from"./chunk-5VM5RSS4--cWPnxlT.js";import"./index-D9Ao6WQl.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],B={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,V){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],V=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Z=m.yylloc;e.push(Z);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,q,F={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=V[R]&&V[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";Y=[];for(X in V[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Q="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Z,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,Z=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof q<"u")return q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=V[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,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:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=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),a.length-1&&(this.yylineno-=a.length-1);var u=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:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(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
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+n+"^"},"showPosition"),test_match:c(function(s,n){var a,o,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),o=s[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var e in u)this[e]=u[e];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,n,a,o;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),e=0;e<u.length;e++)if(a=this._input.match(this.rules[u[e]]),a&&(!n||a[0].length>n[0].length)){if(n=a,o=e,this.options.backtrack_lexer){if(s=this.test_match(a,u[e]),s!==!1)return s;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(s=this.test_match(n,u[o]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var n=this.next();return n||this.lex()},"lex"),begin:c(function(n){this.conditionStack.push(n)},"begin"),popState:c(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:c(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:c(function(n){this.begin(n)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(n,a,o,u){switch(o){case 0:return this.pushState("shapeData"),a.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const e=/\n\s*/g;return a.yytext=a.yytext.replace(e,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",a.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",a.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",a.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",a.yytext),21;case 42:return n.getLogger().trace("Long description:",a.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return _})();B.lexer=y;function O(){this.yy={}}return c(O,"Parser"),O.prototype=B,B.Parser=O,new O})();$.parser=$;var xe=$,D=[],ne=[],ee=0,se={},ve=c(()=>{D=[],ne=[],ee=0,se={}},"clear"),De=c(t=>{if(D.length===0)return null;const g=D[0].level;let d=null;for(let r=D.length-1;r>=0;r--)if(D[r].level===g&&!d&&(d=D[r]),D[r].level<g)throw new Error('Items without section detected, found section ("'+D[r].label+'")');return t===(d==null?void 0:d.level)?null:d},"getSection"),he=c(function(){return ne},"getSections"),Le=c(function(){const t=[],g=[],d=he(),r=W();for(const p of d){const k={id:p.id,label:G(p.label??"",r),labelType:"markdown",isGroup:!0,ticket:p.ticket,shape:"kanbanSection",level:p.level,look:r.look};g.push(k);const f=D.filter(h=>h.parentId===p.id);for(const h of f){const L={id:h.id,parentId:p.id,label:G(h.label??"",r),labelType:"markdown",isGroup:!1,ticket:h==null?void 0:h.ticket,priority:h==null?void 0:h.priority,assigned:h==null?void 0:h.assigned,icon:h==null?void 0:h.icon,shape:"kanbanItem",level:h.level,rx:5,ry:5,cssStyles:["text-align: left"]};g.push(L)}}return{nodes:g,edges:t,other:{},config:W()}},"getData"),Oe=c((t,g,d,r,p)=>{var C,w;const k=W();let f=((C=k.mindmap)==null?void 0:C.padding)??K.mindmap.padding;switch(r){case b.ROUNDED_RECT:case b.RECT:case b.HEXAGON:f*=2}const h={id:G(g,k)||"kbn"+ee++,level:t,label:G(d,k),width:((w=k.mindmap)==null?void 0:w.maxNodeWidth)??K.mindmap.maxNodeWidth,padding:f,isGroup:!1};if(p!==void 0){let N;p.includes(`
7
+ `)?N=p+`
8
+ `:N=`{
9
+ `+p+`
10
+ }`;const i=ke(N,{schema:Ee});if(i.shape&&(i.shape!==i.shape.toLowerCase()||i.shape.includes("_")))throw new Error(`No such shape: ${i.shape}. Shape names should be lowercase.`);i!=null&&i.shape&&i.shape==="kanbanItem"&&(h.shape=i==null?void 0:i.shape),i!=null&&i.label&&(h.label=i==null?void 0:i.label),i!=null&&i.icon&&(h.icon=i==null?void 0:i.icon.toString()),i!=null&&i.assigned&&(h.assigned=i==null?void 0:i.assigned.toString()),i!=null&&i.ticket&&(h.ticket=i==null?void 0:i.ticket.toString()),i!=null&&i.priority&&(h.priority=i==null?void 0:i.priority)}const L=De(t);L?h.parentId=L.id||"kbn"+ee++:ne.push(h),D.push(h)},"addNode"),b={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=c((t,g)=>{switch(te.debug("In get type",t,g),t){case"[":return b.RECT;case"(":return g===")"?b.ROUNDED_RECT:b.CLOUD;case"((":return b.CIRCLE;case")":return b.CLOUD;case"))":return b.BANG;case"{{":return b.HEXAGON;default:return b.DEFAULT}},"getType"),Ce=c((t,g)=>{se[t]=g},"setElementForId"),we=c(t=>{if(!t)return;const g=W(),d=D[D.length-1];t.icon&&(d.icon=G(t.icon,g)),t.class&&(d.cssClasses=G(t.class,g))},"decorateNode"),Ae=c(t=>{switch(t){case b.DEFAULT:return"no-border";case b.RECT:return"rect";case b.ROUNDED_RECT:return"rounded-rect";case b.CIRCLE:return"circle";case b.CLOUD:return"cloud";case b.BANG:return"bang";case b.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=c(()=>te,"getLogger"),Re=c(t=>se[t],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:b,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Be=Pe,Ve=c(async(t,g,d,r)=>{var U,j,A,H,B;te.debug(`Rendering kanban diagram
11
+ `+t);const k=r.db.getData(),f=W();f.htmlLabels=!1;const h=fe(g);for(const y of k.nodes)y.domId=`${g}-${y.id}`;const L=h.append("g");L.attr("class","sections");const C=h.append("g");C.attr("class","items");const w=k.nodes.filter(y=>y.isGroup);let N=0;const i=10,M=[];let x=25;for(const y of w){const O=((U=f==null?void 0:f.kanban)==null?void 0:U.sectionWidth)||200;N=N+1,y.x=O*N+(N-1)*i/2,y.width=O,y.y=0,y.height=O*3,y.rx=5,y.ry=5,y.cssClasses=y.cssClasses+" section-"+N;const _=await ye(L,y);x=Math.max(x,(j=_==null?void 0:_.labelBBox)==null?void 0:j.height),M.push(_)}let P=0;for(const y of w){const O=M[P];P=P+1;const _=((A=f==null?void 0:f.kanban)==null?void 0:A.sectionWidth)||200,s=-_*3/2+x;let n=s;const a=k.nodes.filter(e=>e.parentId===y.id);for(const e of a){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=y.x,e.width=_-1.5*i;const l=(await be(C,e,{config:f})).node().getBBox();e.y=n+l.height/2,await me(e),n=e.y+l.height/2+i/2}const o=O.cluster.select("rect"),u=Math.max(n-s+3*i,50)+(x-25);o.attr("height",u)}_e(void 0,h,((H=f.mindmap)==null?void 0:H.padding)??K.kanban.padding,((B=f.mindmap)==null?void 0:B.useMaxWidth)??K.kanban.useMaxWidth)},"draw"),Fe={draw:Ve},Ge=c(t=>{let g="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],Se(t["lineColor"+r])?t["lineColor"+r]=le(t["lineColor"+r],20):t["lineColor"+r]=ce(t["lineColor"+r],20);const d=c((r,p)=>t.darkMode?ce(r,p):le(r,p),"adjuster");for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const p=""+(17-3*r);g+=`
12
+ .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {
13
+ fill: ${d(t["cScale"+r],10)};
14
+ stroke: ${d(t["cScale"+r],10)};
15
+
16
+ }
17
+ .section-${r-1} text {
18
+ fill: ${t["cScaleLabel"+r]};
19
+ }
20
+ .node-icon-${r-1} {
21
+ font-size: 40px;
22
+ color: ${t["cScaleLabel"+r]};
23
+ }
24
+ .section-edge-${r-1}{
25
+ stroke: ${t["cScale"+r]};
26
+ }
27
+ .edge-depth-${r-1}{
28
+ stroke-width: ${p};
29
+ }
30
+ .section-${r-1} line {
31
+ stroke: ${t["cScaleInv"+r]} ;
32
+ stroke-width: 3;
33
+ }
34
+
35
+ .disabled, .disabled circle, .disabled text {
36
+ fill: lightgray;
37
+ }
38
+ .disabled text {
39
+ fill: #efefef;
40
+ }
41
+
42
+ .node rect,
43
+ .node circle,
44
+ .node ellipse,
45
+ .node polygon,
46
+ .node path {
47
+ fill: ${t.background};
48
+ stroke: ${t.nodeBorder};
49
+ stroke-width: 1px;
50
+ }
51
+
52
+ .kanban-ticket-link {
53
+ fill: ${t.background};
54
+ stroke: ${t.nodeBorder};
55
+ text-decoration: underline;
56
+ }
57
+ `}return g},"genSections"),Me=c(t=>`
58
+ .edge {
59
+ stroke-width: 3;
60
+ }
61
+ ${Ge(t)}
62
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
63
+ fill: ${t.git0};
64
+ }
65
+ .section-root text {
66
+ fill: ${t.gitBranchLabel0};
67
+ }
68
+ .icon-container {
69
+ height:100%;
70
+ display: flex;
71
+ justify-content: center;
72
+ align-items: center;
73
+ }
74
+ .edge {
75
+ fill: none;
76
+ }
77
+ .cluster-label, .label {
78
+ color: ${t.textColor};
79
+ fill: ${t.textColor};
80
+ }
81
+ .kanban-label {
82
+ dy: 1em;
83
+ alignment-baseline: middle;
84
+ text-anchor: middle;
85
+ dominant-baseline: middle;
86
+ text-align: center;
87
+ }
88
+ ${Ne()}
89
+ `,"getStyles"),Ue=Me,ze={db:Be,renderer:Fe,parser:xe,styles:Ue};export{ze as diagram};