@codragraph/cli 2.1.1 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -9
- package/dist/cli/ai-context.js +298 -1
- package/dist/cli/analyze.js +19 -2
- package/dist/cli/index.js +33 -12
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +3 -1
- package/dist/cli/setup.js +36 -19
- package/dist/cli/status.d.ts +13 -0
- package/dist/cli/status.js +99 -0
- package/dist/cli/tool.js +73 -33
- package/dist/config/ignore-service.js +3 -0
- package/dist/core/cgdb/pool-adapter.js +130 -20
- package/dist/core/graphstore/cgdb-row-source.js +3 -2
- package/dist/core/group/bridge-db.js +42 -10
- package/dist/core/ingestion/parsing-processor.js +7 -1
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +4 -0
- package/dist/core/ingestion/workers/parse-worker.js +1 -1
- package/dist/core/ingestion/workers/worker-pool.d.ts +14 -1
- package/dist/core/ingestion/workers/worker-pool.js +33 -17
- package/dist/core/run-analyze.d.ts +20 -0
- package/dist/core/run-analyze.js +225 -1
- package/dist/core/search/bm25-index.d.ts +0 -11
- package/dist/core/search/bm25-index.js +7 -84
- package/dist/core/search/hybrid-search.js +11 -3
- package/dist/mcp/local/local-backend.d.ts +2 -0
- package/dist/mcp/local/local-backend.js +235 -18
- package/dist/mcp/resources.js +2 -2
- package/dist/server/api.d.ts +14 -2
- package/dist/server/api.js +90 -7
- package/dist/server/mcp-http.d.ts +22 -0
- package/dist/server/mcp-http.js +21 -2
- package/dist/server/web-dashboard.d.ts +28 -0
- package/dist/server/web-dashboard.js +61 -0
- package/dist/web/assets/agent-D5lb0zXz.js +1089 -0
- package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +36 -0
- package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +132 -0
- package/dist/web/assets/c4Diagram-DFAF54RM-C4Hl3J2U.js +10 -0
- package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +231 -0
- package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +1 -0
- package/dist/web/assets/chunk-7RZVMHOQ-BitYcNVR.js +338 -0
- package/dist/web/assets/chunk-AEOMTBSW-BgTIXPsY.js +1 -0
- package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +13 -0
- package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +1 -0
- package/dist/web/assets/chunk-KSICW3F5-BYzvDLNI.js +15 -0
- package/dist/web/assets/chunk-O5ABG6QK-dHwHzA6n.js +1 -0
- package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +206 -0
- package/dist/web/assets/chunk-RWUO3TPN-BgRTY0_k.js +1 -0
- package/dist/web/assets/chunk-TBF5ZNIQ-DL5stGM1.js +1 -0
- package/dist/web/assets/chunk-TU3PZOEN-RLyvLcv-.js +1 -0
- package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +1 -0
- package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +1 -0
- package/dist/web/assets/context-builder-22jU3V56.js +16 -0
- package/dist/web/assets/cose-bilkent-PNC4W37J-DVhePRYg.js +1 -0
- package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +4 -0
- package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +43 -0
- package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +24 -0
- package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +10 -0
- package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +24 -0
- package/dist/web/assets/erDiagram-GCSMX5X6-C3dhDFA8.js +85 -0
- package/dist/web/assets/flowDiagram-OTCZ4VVT-CWSFWmhr.js +162 -0
- package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +292 -0
- package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +106 -0
- package/dist/web/assets/index-BgeqpYgd.js +1415 -0
- package/dist/web/assets/index-CT0GtFLZ.css +1 -0
- package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +2 -0
- package/dist/web/assets/ishikawaDiagram-YMYX4NHK-DUoJvNP2.js +70 -0
- package/dist/web/assets/journeyDiagram-SO5T7YLQ-RMFPNNqz.js +139 -0
- package/dist/web/assets/kanban-definition-LJHFXRCJ-BzpDs1K9.js +89 -0
- package/dist/web/assets/katex-GD7MH7QM-DBQvrix-.js +261 -0
- package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +96 -0
- package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +30 -0
- package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +7 -0
- package/dist/web/assets/requirementDiagram-M5DCFWZL-DLHOVTSv.js +84 -0
- package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +10 -0
- package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +157 -0
- package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +1 -0
- package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +1 -0
- package/dist/web/assets/timeline-definition-5SPVSISX-TRSDRgPw.js +120 -0
- package/dist/web/assets/vennDiagram-IE5QUKF5-DNy7HRBM.js +34 -0
- package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +161 -0
- package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +20 -0
- package/dist/web/assets/xychartDiagram-ZHJ5623Y-Dr9r7a35.js +7 -0
- package/dist/web/codragraph-logo-512.png +0 -0
- package/dist/web/codragraph-logo.png +0 -0
- package/dist/web/favicon.png +0 -0
- package/dist/web/index.html +36 -0
- package/hooks/claude/codragraph-hook.cjs +18 -110
- package/hooks/claude/pre-tool-use.sh +6 -1
- package/package.json +3 -1
- package/scripts/build.js +62 -4
- package/scripts/patch-tree-sitter-swift.cjs +0 -1
- package/skills/codragraph-cli.md +1 -1
- package/vendor/leiden/index.cjs +272 -285
- package/vendor/leiden/utils.cjs +264 -274
- package/dist/_shared/lbug/schema-constants.d.ts +0 -16
- package/dist/_shared/lbug/schema-constants.d.ts.map +0 -1
- package/dist/_shared/lbug/schema-constants.js +0 -67
- package/dist/_shared/lbug/schema-constants.js.map +0 -1
- package/dist/core/graphstore/lbug-row-source.d.ts +0 -19
- package/dist/core/graphstore/lbug-row-source.js +0 -141
- package/dist/core/lbug/content-read.d.ts +0 -46
- package/dist/core/lbug/content-read.js +0 -64
- package/dist/core/lbug/csv-generator.d.ts +0 -29
- package/dist/core/lbug/csv-generator.js +0 -492
- package/dist/core/lbug/lbug-adapter.d.ts +0 -176
- package/dist/core/lbug/lbug-adapter.js +0 -1320
- package/dist/core/lbug/pool-adapter.d.ts +0 -93
- package/dist/core/lbug/pool-adapter.js +0 -550
- package/dist/core/lbug/schema.d.ts +0 -62
- package/dist/core/lbug/schema.js +0 -502
- package/dist/mcp/core/lbug-adapter.d.ts +0 -5
- package/dist/mcp/core/lbug-adapter.js +0 -5
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{m as o,p as te,q as W,a7 as fe,av as me,aw as be,ax as ke,as as Ee,y as J,c as U,A as _e,j as Se,ap as Ne,aq as le,ar as ce}from"./index-BgeqpYgd.js";import{o as xe}from"./chunk-KSICW3F5-BYzvDLNI.js";var Z=function(){var i=o(function(_,e,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=e);return n},"o"),g=[1,4],d=[1,13],r=[1,12],u=[1,15],p=[1,16],E=[1,20],c=[1,19],D=[6,7,8],w=[1,26],O=[1,24],v=[1,25],s=[6,7,11],T=[1,31],C=[6,7,11,24],F=[1,6,13,16,17,20,23],M=[1,35],H=[1,36],I=[1,6,7,11,13,16,17,20,23],G=[1,38],y={trace:o(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:o(function(_,e,n,a,h,t,b){var l=t.length-1;switch(h){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[l-1].id),a.addNode(t[l-2].length,t[l-1].id,t[l-1].descr,t[l-1].type,t[l]);break;case 16:a.getLogger().info("Node: ",t[l].id),a.addNode(t[l-1].length,t[l].id,t[l].descr,t[l].type);break;case 17:a.getLogger().trace("Icon: ",t[l]),a.decorateNode({icon:t[l]});break;case 18:case 23:a.decorateNode({class:t[l]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[l-1].id),a.addNode(0,t[l-1].id,t[l-1].descr,t[l-1].type,t[l]);break;case 21:a.getLogger().trace("Node: ",t[l].id),a.addNode(0,t[l].id,t[l].descr,t[l].type);break;case 22:a.decorateNode({icon:t[l]});break;case 27:a.getLogger().trace("node found ..",t[l-2]),this.$={id:t[l-1],descr:t[l-1],type:a.getType(t[l-2],t[l])};break;case 28:this.$={id:t[l],descr:t[l],type:0};break;case 29:a.getLogger().trace("node found ..",t[l-3]),this.$={id:t[l-3],descr:t[l-1],type:a.getType(t[l-2],t[l])};break;case 30:this.$=t[l-1]+t[l];break;case 31:this.$=t[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:u,17:p,18:17,19:18,20:E,23:c},i(D,[2,3]),{1:[2,2]},i(D,[2,4]),i(D,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:u,17:p,18:17,19:18,20:E,23:c},{6:d,9:22,12:11,13:r,14:14,16:u,17:p,18:17,19:18,20:E,23:c},{6:w,7:O,10:23,11:v},i(s,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:E,23:c}),i(s,[2,19]),i(s,[2,21],{15:30,24:T}),i(s,[2,22]),i(s,[2,23]),i(C,[2,25]),i(C,[2,26]),i(C,[2,28],{20:[1,32]}),{21:[1,33]},{6:w,7:O,10:34,11:v},{1:[2,7],6:d,12:21,13:r,14:14,16:u,17:p,18:17,19:18,20:E,23:c},i(F,[2,14],{7:M,11:H}),i(I,[2,8]),i(I,[2,9]),i(I,[2,10]),i(s,[2,16],{15:37,24:T}),i(s,[2,17]),i(s,[2,18]),i(s,[2,20],{24:G}),i(C,[2,31]),{21:[1,39]},{22:[1,40]},i(F,[2,13],{7:M,11:H}),i(I,[2,11]),i(I,[2,12]),i(s,[2,15],{24:G}),i(C,[2,30]),{22:[1,41]},i(C,[2,27]),i(C,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(_,e){if(e.recoverable)this.trace(_);else{var n=new Error(_);throw n.hash=e,n}},"parseError"),parse:o(function(_){var e=this,n=[0],a=[],h=[null],t=[],b=this.table,l="",j=0,ne=0,ge=0,ue=2,re=1,de=t.slice.call(arguments,1),m=Object.create(this.lexer),R={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(R.yy[q]=this.yy[q]);m.setInput(_,R.yy),R.yy.lexer=m,R.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Q=m.yylloc;t.push(Q);var pe=m.options&&m.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ye(S){n.length=n.length-2*S,h.length=h.length-S,t.length=t.length-S}o(ye,"popStack");function ae(){var S;return S=a.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=e.symbols_[S]||S),S}o(ae,"lex");for(var k,V,P,x,We,X,B={},K,A,oe,z;;){if(P=n[n.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((k===null||typeof k>"u")&&(k=ae()),x=b[P]&&b[P][k]),typeof x>"u"||!x.length||!x[0]){var Y="";z=[];for(K in b[P])this.terminals_[K]&&K>ue&&z.push("'"+this.terminals_[K]+"'");m.showPosition?Y="Parse error on line "+(j+1)+`:
|
|
2
|
+
`+m.showPosition()+`
|
|
3
|
+
Expecting `+z.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Y="Parse error on line "+(j+1)+": Unexpected "+(k==re?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Y,{text:m.match,token:this.terminals_[k]||k,line:m.yylineno,loc:Q,expected:z})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+k);switch(x[0]){case 1:n.push(k),h.push(m.yytext),t.push(m.yylloc),n.push(x[1]),k=null,V?(k=V,V=null):(ne=m.yyleng,l=m.yytext,j=m.yylineno,Q=m.yylloc,ge>0);break;case 2:if(A=this.productions_[x[1]][1],B.$=h[h.length-A],B._$={first_line:t[t.length-(A||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(A||1)].first_column,last_column:t[t.length-1].last_column},pe&&(B._$.range=[t[t.length-(A||1)].range[0],t[t.length-1].range[1]]),X=this.performAction.apply(B,[l,ne,j,R.yy,x[1],h,t].concat(de)),typeof X<"u")return X;A&&(n=n.slice(0,-1*A*2),h=h.slice(0,-1*A),t=t.slice(0,-1*A)),n.push(this.productions_[x[1]][0]),h.push(B.$),t.push(B._$),oe=b[n[n.length-2]][n[n.length-1]],n.push(oe);break;case 3:return!0}}return!0},"parse")},$=function(){var _={EOF:1,parseError:o(function(e,n){if(this.yy.parser)this.yy.parser.parseError(e,n);else throw new Error(e)},"parseError"),setInput:o(function(e,n){return this.yy=n||this.yy||{},this._input=e,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:o(function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var n=e.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),e},"input"),unput:o(function(e){var n=e.length,a=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var h=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 t=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===h.length?this.yylloc.first_column:0)+h[h.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(e){this.unput(this.match.slice(e))},"less"),pastInput:o(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var e=this.pastInput(),n=new Array(e.length+1).join("-");return e+this.upcomingInput()+`
|
|
5
|
+
`+n+"^"},"showPosition"),test_match:o(function(e,n){var a,h,t;if(this.options.backtrack_lexer&&(t={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&&(t.yylloc.range=this.yylloc.range.slice(0))),h=e[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[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 b in t)this[b]=t[b];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,n,a,h;this._more||(this.yytext="",this.match="");for(var t=this._currentRules(),b=0;b<t.length;b++)if(a=this._input.match(this.rules[t[b]]),a&&(!n||a[0].length>n[0].length)){if(n=a,h=b,this.options.backtrack_lexer){if(e=this.test_match(a,t[b]),e!==!1)return e;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(e=this.test_match(n,t[h]),e!==!1?e:!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:o(function(){var e=this.next();return e||this.lex()},"lex"),begin:o(function(e){this.conditionStack.push(e)},"begin"),popState:o(function(){var e=this.conditionStack.length-1;return e>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:o(function(e){this.begin(e)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(e,n,a,h){switch(a){case 0:return this.pushState("shapeData"),n.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:let t=/\n\s*/g;return n.yytext=n.yytext.replace(t,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace("Found comment",n.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:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return e.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace("end icon"),this.popState();break;case 16:return e.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return e.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return e.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:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return e.getLogger().trace("description:",n.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),e.getLogger().trace("node end ...",n.yytext),"NODE_DEND";case 36:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 41:return e.getLogger().trace("Long description:",n.yytext),21;case 42:return e.getLogger().trace("Long description:",n.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 _}();y.lexer=$;function N(){this.yy={}}return o(N,"Parser"),N.prototype=y,y.Parser=N,new N}();Z.parser=Z;var Le=Z,L=[],ie=[],ee=0,se={},De=o(()=>{L=[],ie=[],ee=0,se={}},"clear"),Oe=o(i=>{if(L.length===0)return null;let g=L[0].level,d=null;for(let r=L.length-1;r>=0;r--)if(L[r].level===g&&!d&&(d=L[r]),L[r].level<g)throw new Error('Items without section detected, found section ("'+L[r].label+'")');return i===(d==null?void 0:d.level)?null:d},"getSection"),he=o(function(){return ie},"getSections"),ve=o(function(){let i=[],g=[],d=he(),r=W();for(let u of d){let p={id:u.id,label:U(u.label??"",r),labelType:"markdown",isGroup:!0,ticket:u.ticket,shape:"kanbanSection",level:u.level,look:r.look};g.push(p);let E=L.filter(c=>c.parentId===u.id);for(let c of E){let D={id:c.id,parentId:u.id,label:U(c.label??"",r),labelType:"markdown",isGroup:!1,ticket:c==null?void 0:c.ticket,priority:c==null?void 0:c.priority,assigned:c==null?void 0:c.assigned,icon:c==null?void 0:c.icon,shape:"kanbanItem",level:c.level,rx:5,ry:5,cssStyles:["text-align: left"]};g.push(D)}}return{nodes:g,edges:i,other:{},config:W()}},"getData"),Ce=o((i,g,d,r,u)=>{var w,O;let p=W(),E=((w=p.mindmap)==null?void 0:w.padding)??J.mindmap.padding;switch(r){case f.ROUNDED_RECT:case f.RECT:case f.HEXAGON:E*=2}let c={id:U(g,p)||"kbn"+ee++,level:i,label:U(d,p),width:((O=p.mindmap)==null?void 0:O.maxNodeWidth)??J.mindmap.maxNodeWidth,padding:E,isGroup:!1};if(u!==void 0){let v;u.includes(`
|
|
7
|
+
`)?v=u+`
|
|
8
|
+
`:v=`{
|
|
9
|
+
`+u+`
|
|
10
|
+
}`;let s=_e(v,{schema:Se});if(s.shape&&(s.shape!==s.shape.toLowerCase()||s.shape.includes("_")))throw new Error(`No such shape: ${s.shape}. Shape names should be lowercase.`);s!=null&&s.shape&&s.shape==="kanbanItem"&&(c.shape=s==null?void 0:s.shape),s!=null&&s.label&&(c.label=s==null?void 0:s.label),s!=null&&s.icon&&(c.icon=s==null?void 0:s.icon.toString()),s!=null&&s.assigned&&(c.assigned=s==null?void 0:s.assigned.toString()),s!=null&&s.ticket&&(c.ticket=s==null?void 0:s.ticket.toString()),s!=null&&s.priority&&(c.priority=s==null?void 0:s.priority)}let D=Oe(i);D?c.parentId=D.id||"kbn"+ee++:ie.push(c),L.push(c)},"addNode"),f={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ae=o((i,g)=>{switch(te.debug("In get type",i,g),i){case"[":return f.RECT;case"(":return g===")"?f.ROUNDED_RECT:f.CLOUD;case"((":return f.CIRCLE;case")":return f.CLOUD;case"))":return f.BANG;case"{{":return f.HEXAGON;default:return f.DEFAULT}},"getType"),we=o((i,g)=>{se[i]=g},"setElementForId"),Ie=o(i=>{if(!i)return;let g=W(),d=L[L.length-1];i.icon&&(d.icon=U(i.icon,g)),i.class&&(d.cssClasses=U(i.class,g))},"decorateNode"),Te=o(i=>{switch(i){case f.DEFAULT:return"no-border";case f.RECT:return"rect";case f.ROUNDED_RECT:return"rounded-rect";case f.CIRCLE:return"circle";case f.CLOUD:return"cloud";case f.BANG:return"bang";case f.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),$e=o(()=>te,"getLogger"),Re=o(i=>se[i],"getElementById"),Pe={clear:De,addNode:Ce,getSections:he,getData:ve,nodeType:f,getType:Ae,setElementForId:we,decorateNode:Ie,type2Str:Te,getLogger:$e,getElementById:Re},Be=Pe,Ue=o(async(i,g,d,r)=>{var F,M,H,I,G;te.debug(`Rendering kanban diagram
|
|
11
|
+
`+i);let u=r.db.getData(),p=W();p.htmlLabels=!1;let E=fe(g);for(let y of u.nodes)y.domId=`${g}-${y.id}`;let c=E.append("g");c.attr("class","sections");let D=E.append("g");D.attr("class","items");let w=u.nodes.filter(y=>y.isGroup),O=0,v=10,s=[],T=25;for(let y of w){let $=((F=p==null?void 0:p.kanban)==null?void 0:F.sectionWidth)||200;O=O+1,y.x=$*O+(O-1)*v/2,y.width=$,y.y=0,y.height=$*3,y.rx=5,y.ry=5,y.cssClasses=y.cssClasses+" section-"+O;let N=await me(c,y);T=Math.max(T,(M=N==null?void 0:N.labelBBox)==null?void 0:M.height),s.push(N)}let C=0;for(let y of w){let $=s[C];C=C+1;let N=((H=p==null?void 0:p.kanban)==null?void 0:H.sectionWidth)||200,_=-N*3/2+T,e=_,n=u.nodes.filter(t=>t.parentId===y.id);for(let t of n){if(t.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");t.x=y.x,t.width=N-1.5*v;let b=(await be(D,t,{config:p})).node().getBBox();t.y=e+b.height/2,await ke(t),e=t.y+b.height/2+v/2}let a=$.cluster.select("rect"),h=Math.max(e-_+3*v,50)+(T-25);a.attr("height",h)}Ee(void 0,E,((I=p.mindmap)==null?void 0:I.padding)??J.kanban.padding,((G=p.mindmap)==null?void 0:G.useMaxWidth)??J.kanban.useMaxWidth)},"draw"),Fe={draw:Ue},Me=o(i=>{let g="";for(let r=0;r<i.THEME_COLOR_LIMIT;r++)i["lineColor"+r]=i["lineColor"+r]||i["cScaleInv"+r],Ne(i["lineColor"+r])?i["lineColor"+r]=le(i["lineColor"+r],20):i["lineColor"+r]=ce(i["lineColor"+r],20);let d=o((r,u)=>i.darkMode?ce(r,u):le(r,u),"adjuster");for(let r=0;r<i.THEME_COLOR_LIMIT;r++){let u=""+(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(i["cScale"+r],10)};
|
|
14
|
+
stroke: ${d(i["cScale"+r],10)};
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
.section-${r-1} text {
|
|
18
|
+
fill: ${i["cScaleLabel"+r]};
|
|
19
|
+
}
|
|
20
|
+
.node-icon-${r-1} {
|
|
21
|
+
font-size: 40px;
|
|
22
|
+
color: ${i["cScaleLabel"+r]};
|
|
23
|
+
}
|
|
24
|
+
.section-edge-${r-1}{
|
|
25
|
+
stroke: ${i["cScale"+r]};
|
|
26
|
+
}
|
|
27
|
+
.edge-depth-${r-1}{
|
|
28
|
+
stroke-width: ${u};
|
|
29
|
+
}
|
|
30
|
+
.section-${r-1} line {
|
|
31
|
+
stroke: ${i["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: ${i.background};
|
|
48
|
+
stroke: ${i.nodeBorder};
|
|
49
|
+
stroke-width: 1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kanban-ticket-link {
|
|
53
|
+
fill: ${i.background};
|
|
54
|
+
stroke: ${i.nodeBorder};
|
|
55
|
+
text-decoration: underline;
|
|
56
|
+
}
|
|
57
|
+
`}return g},"genSections"),He=o(i=>`
|
|
58
|
+
.edge {
|
|
59
|
+
stroke-width: 3;
|
|
60
|
+
}
|
|
61
|
+
${Me(i)}
|
|
62
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
63
|
+
fill: ${i.git0};
|
|
64
|
+
}
|
|
65
|
+
.section-root text {
|
|
66
|
+
fill: ${i.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: ${i.textColor};
|
|
79
|
+
fill: ${i.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
|
+
${xe()}
|
|
89
|
+
`,"getStyles"),Ge=He,ze={db:Be,renderer:Fe,parser:Le,styles:Ge};export{ze as diagram};
|