codebuff-agent 2.1.83__py3-none-any.whl → 2.1.84__py3-none-any.whl
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.
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/package.json +30 -2
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/140.bbdac4ab5bfafdbc93bb.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/278.20ad96143dcfa21adf3a.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/364.bbad242c4d0e64dc0a17.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/438.13b8837d547466e12be0.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/489.c53f32292962b5084b76.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/579.00377565c7c766906443.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/587.0bb550b8dd358ff2715f.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/6d0af5258997aec7354a.ttf +0 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/747.ca74b0939ff1b4622da1.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/896.f51dec25e2d314442847.js +2 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/896.f51dec25e2d314442847.js.LICENSE.txt +16 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/8b1b23e5de4dff652fb0.ttf +0 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/920.ac01556fe16b88f42e7a.js +1 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/c16b88c670d23e83fa11.ttf +0 -0
- codebuff_agent-2.1.84.data/data/share/jupyter/labextensions/codebuff/static/remoteEntry.ecc1a282e3de1e2a4c70.js +1 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/third-party-licenses.json +55 -1
- {codebuff_agent-2.1.83.dist-info → codebuff_agent-2.1.84.dist-info}/METADATA +1 -1
- {codebuff_agent-2.1.83.dist-info → codebuff_agent-2.1.84.dist-info}/RECORD +120 -63
- codebuff_core/centri_link.py +7 -1
- codebuff_core/codebuff_config_defaults.json +3 -0
- codebuff_core/directory_policy.py +2 -0
- codebuff_core/managers/config_manager.py +8 -0
- codebuff_core/managers/remote_config.py +6 -1
- codebuff_core/services/pii_guardrail.py +98 -0
- jupyter_ext/__init__.py +7 -3
- jupyter_ext/_version.py +1 -1
- jupyter_ext/agent/agent_factory.py +7 -3
- jupyter_ext/agent/agent_framework_assets/agent_framework_api.json.gz +0 -0
- jupyter_ext/agent/agent_framework_check.py +882 -0
- jupyter_ext/agent/background_procs.py +40 -3
- jupyter_ext/agent/bg_procs_context.py +16 -5
- jupyter_ext/agent/code_lint.py +793 -0
- jupyter_ext/agent/code_lint_assets/code_lint.bundle.mjs +393 -0
- jupyter_ext/agent/code_lint_assets/tree-sitter-java_orchard.wasm +0 -0
- jupyter_ext/agent/code_lint_assets/wasm_bg.wasm +0 -0
- jupyter_ext/agent/code_lint_assets/web-tree-sitter.wasm +0 -0
- jupyter_ext/agent/codex_autofix.py +112 -20
- jupyter_ext/agent/codex_bridge.py +1004 -89
- jupyter_ext/agent/codex_hooks.py +4 -3
- jupyter_ext/agent/codex_slash.py +170 -10
- jupyter_ext/agent/codex_threads.py +13 -2
- jupyter_ext/agent/codex_transcript.py +184 -0
- jupyter_ext/agent/context_memory.py +357 -0
- jupyter_ext/agent/git_lease.py +301 -0
- jupyter_ext/agent/internal_registry.py +1 -1
- jupyter_ext/agent/istio_assets/istio_schema.json.gz +0 -0
- jupyter_ext/agent/istio_assets/istio_validate.mjs +32 -0
- jupyter_ext/agent/istio_assets/istio_validate.wasm.br +0 -0
- jupyter_ext/agent/istio_check.py +1392 -0
- jupyter_ext/agent/langchain_tools.py +99 -13
- jupyter_ext/agent/loc_check.py +416 -0
- jupyter_ext/agent/mermaid_fixer.py +67 -21
- jupyter_ext/agent/mermaid_guarantee.py +161 -16
- jupyter_ext/agent/mermaid_parse.bundle.mjs +2824 -0
- jupyter_ext/agent/mermaid_validate.py +149 -0
- jupyter_ext/agent/skills/agent_framework_development.md +66 -0
- jupyter_ext/agent/skills/deep_agents_development.md +59 -0
- jupyter_ext/agent/skills/istio_development.md +178 -0
- jupyter_ext/agent/skills/langchain_development.md +64 -0
- jupyter_ext/agent/skills/langgraph_development.md +64 -0
- jupyter_ext/agent/skills/python_code_quality.md +9 -0
- jupyter_ext/agent/skills/spring_java_development.md +8 -1
- jupyter_ext/agent/skills/terraform_development.md +57 -0
- jupyter_ext/agent/terraform_assets/terraform_schema.zip +0 -0
- jupyter_ext/agent/terraform_assets/terraform_validate.mjs +28 -0
- jupyter_ext/agent/terraform_assets/terraform_validate.wasm.br +0 -0
- jupyter_ext/agent/terraform_check.py +1112 -0
- jupyter_ext/http_handlers.py +632 -57
- jupyter_ext/labextension/package.json +30 -2
- jupyter_ext/labextension/static/140.bbdac4ab5bfafdbc93bb.js +1 -0
- jupyter_ext/labextension/static/278.20ad96143dcfa21adf3a.js +1 -0
- jupyter_ext/labextension/static/364.bbad242c4d0e64dc0a17.js +1 -0
- jupyter_ext/labextension/static/438.13b8837d547466e12be0.js +1 -0
- jupyter_ext/labextension/static/489.c53f32292962b5084b76.js +1 -0
- jupyter_ext/labextension/static/579.00377565c7c766906443.js +1 -0
- jupyter_ext/labextension/static/587.0bb550b8dd358ff2715f.js +1 -0
- jupyter_ext/labextension/static/6d0af5258997aec7354a.ttf +0 -0
- jupyter_ext/labextension/static/747.ca74b0939ff1b4622da1.js +1 -0
- jupyter_ext/labextension/static/896.f51dec25e2d314442847.js +2 -0
- jupyter_ext/labextension/static/896.f51dec25e2d314442847.js.LICENSE.txt +16 -0
- jupyter_ext/labextension/static/8b1b23e5de4dff652fb0.ttf +0 -0
- jupyter_ext/labextension/static/920.ac01556fe16b88f42e7a.js +1 -0
- jupyter_ext/labextension/static/c16b88c670d23e83fa11.ttf +0 -0
- jupyter_ext/labextension/static/remoteEntry.ecc1a282e3de1e2a4c70.js +1 -0
- jupyter_ext/labextension/static/third-party-licenses.json +55 -1
- jupyter_ext/licenses/fonts-OFL.txt +100 -0
- jupyter_ext/licenses/istio-LICENSE.txt +202 -0
- jupyter_ext/licenses/istio-THIRD-PARTY.txt +3526 -0
- jupyter_ext/licenses/istio-modules.txt +51 -0
- jupyter_ext/licenses/luaparse-LICENSE.txt +20 -0
- jupyter_ext/licenses/terraform-LICENSE.txt +365 -0
- jupyter_ext/licenses/terraform-THIRD-PARTY.txt +4981 -0
- jupyter_ext/licenses/terraform-modules.txt +50 -0
- jupyter_ext/org_theme.py +67 -0
- jupyter_ext/provider_check.py +151 -0
- jupyter_ext/team_access.py +1 -26
- codebuff_agent-2.1.83.data/data/share/jupyter/labextensions/codebuff/static/273.6988ce5a4030280e558a.js +0 -1
- codebuff_agent-2.1.83.data/data/share/jupyter/labextensions/codebuff/static/351.fad5dfccca62caa2f091.js +0 -1
- codebuff_agent-2.1.83.data/data/share/jupyter/labextensions/codebuff/static/579.ea7ea39e5b073a2e7d13.js +0 -1
- codebuff_agent-2.1.83.data/data/share/jupyter/labextensions/codebuff/static/remoteEntry.f9a4c5c9b5ae13bb8cf3.js +0 -1
- jupyter_ext/labextension/static/273.6988ce5a4030280e558a.js +0 -1
- jupyter_ext/labextension/static/351.fad5dfccca62caa2f091.js +0 -1
- jupyter_ext/labextension/static/579.ea7ea39e5b073a2e7d13.js +0 -1
- jupyter_ext/labextension/static/remoteEntry.f9a4c5c9b5ae13bb8cf3.js +0 -1
- jupyter_ext/provider_pii.py +0 -38
- jupyter_ext/tests/test_mermaid_fixer.py +0 -272
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/etc/jupyter/jupyter_server_config.d/codebuff_agent.json +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/lab/settings/overrides.d/codebuff.json +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/166.c1c3bfd74422e67dc983.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/353.d7ba8ad82538daabb3a2.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/367.f26791733c271c089c67.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/421.0be3fe73ea3402566c07.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/432.fba3fe8c6a9fc44e799d.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/432.fba3fe8c6a9fc44e799d.js.LICENSE.txt +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/439.20f2d83fe525ad987e16.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/439.20f2d83fe525ad987e16.js.LICENSE.txt +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/481.cc2dec9fa869d66f1407.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/487.0796e931d6e651482c14.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/49.d326f554b6f9ccde6580.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/58.da2a68e5f9fc30c28a98.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/58.da2a68e5f9fc30c28a98.js.LICENSE.txt +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/666.d9bfdb23f98489d0a188.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/677.358f72cbdbb0586fcb30.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/677.358f72cbdbb0586fcb30.js.LICENSE.txt +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/68.aa8fef48ef0a9da3a0b9.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/868.5cfe7e1a348ec5af1b8c.js +0 -0
- {codebuff_agent-2.1.83.data → codebuff_agent-2.1.84.data}/data/share/jupyter/labextensions/codebuff/static/style.js +0 -0
- {codebuff_agent-2.1.83.dist-info → codebuff_agent-2.1.84.dist-info}/WHEEL +0 -0
- {codebuff_agent-2.1.83.dist-info → codebuff_agent-2.1.84.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebuff",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.84",
|
|
4
4
|
"description": "Codebuff JupyterLab Extension - Thin client for Agent Server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -62,26 +62,36 @@
|
|
|
62
62
|
"lint:fix": "jlpm stylelint && jlpm eslint"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
+
"@codemirror/autocomplete": "^6.20.0",
|
|
65
66
|
"@codemirror/commands": "6.8.1",
|
|
67
|
+
"@codemirror/lint": "^6.0.0",
|
|
66
68
|
"@codemirror/state": "^6.5.2",
|
|
69
|
+
"@codemirror/view": "^6.0.0",
|
|
67
70
|
"@emotion/react": "^11.11.0",
|
|
68
71
|
"@emotion/styled": "^11.11.0",
|
|
69
72
|
"@jupyter-widgets/base": "^6.0.0",
|
|
70
73
|
"@jupyterlab/application": "^4.0.0",
|
|
71
74
|
"@jupyterlab/cells": "^4.0.0",
|
|
75
|
+
"@jupyterlab/codemirror": "^4.0.0",
|
|
72
76
|
"@jupyterlab/console": "^4.0.0",
|
|
73
77
|
"@jupyterlab/launcher": "^4.0.0",
|
|
78
|
+
"@jupyterlab/mermaid": "^4.1.0",
|
|
74
79
|
"@jupyterlab/notebook": "^4.0.0",
|
|
75
80
|
"@jupyterlab/rendermime": "^4.0.0",
|
|
76
81
|
"@jupyterlab/services": "^7.0.0",
|
|
77
82
|
"@jupyterlab/terminal": "^4.0.0",
|
|
83
|
+
"@lezer/highlight": "^1.0.0",
|
|
78
84
|
"@lezer/java": "^1.1.4",
|
|
79
85
|
"@lezer/javascript": "^1.5.5",
|
|
80
86
|
"@lezer/python": "^1.1.19",
|
|
81
87
|
"@lumino/widgets": "^2.0.0",
|
|
82
88
|
"@mui/icons-material": "^7.3.4",
|
|
83
89
|
"@mui/material": "^5.14.0",
|
|
90
|
+
"codemirror-lang-hcl": "0.2.0",
|
|
84
91
|
"diff": "^9.0.0",
|
|
92
|
+
"html-to-pdfmake": "2.5.36",
|
|
93
|
+
"marked": "^17.0.6",
|
|
94
|
+
"pdfmake": "0.3.13",
|
|
85
95
|
"react": "^18.2.0",
|
|
86
96
|
"react-dom": "^18.2.0",
|
|
87
97
|
"react-syntax-highlighter": "^16.1.1"
|
|
@@ -100,12 +110,14 @@
|
|
|
100
110
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
101
111
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
102
112
|
"@typescript-eslint/parser": "^6.0.0",
|
|
113
|
+
"d2coding": "1.3.2",
|
|
103
114
|
"eslint": "^8.45.0",
|
|
104
115
|
"eslint-config-prettier": "^8.8.0",
|
|
105
116
|
"eslint-plugin-prettier": "^5.0.0",
|
|
106
117
|
"eslint-plugin-react": "^7.33.0",
|
|
107
118
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
108
119
|
"npm-run-all": "^4.1.5",
|
|
120
|
+
"pretendard": "1.3.9",
|
|
109
121
|
"prettier": "^3.0.0",
|
|
110
122
|
"rimraf": "^5.0.1",
|
|
111
123
|
"stylelint": "^15.10.0",
|
|
@@ -132,6 +144,22 @@
|
|
|
132
144
|
"bundled": false,
|
|
133
145
|
"singleton": true
|
|
134
146
|
},
|
|
147
|
+
"@codemirror/view": {
|
|
148
|
+
"bundled": false,
|
|
149
|
+
"singleton": true
|
|
150
|
+
},
|
|
151
|
+
"@jupyterlab/codemirror": {
|
|
152
|
+
"bundled": false,
|
|
153
|
+
"singleton": true
|
|
154
|
+
},
|
|
155
|
+
"@jupyterlab/mermaid": {
|
|
156
|
+
"bundled": false,
|
|
157
|
+
"singleton": true
|
|
158
|
+
},
|
|
159
|
+
"@lezer/highlight": {
|
|
160
|
+
"bundled": false,
|
|
161
|
+
"singleton": true
|
|
162
|
+
},
|
|
135
163
|
"@jupyterlab/notebook": {
|
|
136
164
|
"bundled": false,
|
|
137
165
|
"singleton": true
|
|
@@ -146,7 +174,7 @@
|
|
|
146
174
|
}
|
|
147
175
|
},
|
|
148
176
|
"_build": {
|
|
149
|
-
"load": "static/remoteEntry.
|
|
177
|
+
"load": "static/remoteEntry.ecc1a282e3de1e2a4c70.js",
|
|
150
178
|
"extension": "./extension",
|
|
151
179
|
"style": "./style"
|
|
152
180
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcodebuff=self.webpackChunkcodebuff||[]).push([[140],{1140(e,t,i){i.r(t),i.d(t,{closeLintPanel:()=>x,diagnosticCount:()=>v,forEachDiagnostic:()=>J,forceLinting:()=>P,lintGutter:()=>W,lintKeymap:()=>T,linter:()=>L,nextDiagnostic:()=>C,openLintPanel:()=>y,previousDiagnostic:()=>S,setDiagnostics:()=>u,setDiagnosticsEffect:()=>m});var o=i(5024),n=i(195);function s(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)){var n=i[o];"string"==typeof n?e.setAttribute(o,n):null!=n&&(e[o]=n)}t++}for(;t<arguments.length;t++)l(e,arguments[t]);return e}function l(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var i=0;i<t.length;i++)l(e,t[i])}}class r{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class a{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(D).markerFilter;s&&(e=s(e,i));let l=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),r=new n.RangeSetBuilder,d=[],f=0,u=i.doc.iter(),m=0,h=i.doc.length;for(let e=0;;){let t,i,n=e==l.length?null:l[e];if(!n&&!d.length)break;if(d.length)t=f,i=d.reduce((e,t)=>Math.min(e,t.to),n&&n.from>t?n.from:1e8);else{if(t=n.from,t>h)break;i=n.to,d.push(n),e++}for(;e<l.length;){let o=l[e];if(o.from!=t||!(o.to>o.from||o.to==t)){i=Math.min(o.from,i);break}d.push(o),e++,i=Math.min(o.to,i)}i=Math.min(i,h);let s=!1;if(d.some(e=>e.from==t&&(e.to==i||i==h))&&(s=t==i,!s&&i-t<10)){let e=t-(m+u.value.length);e>0&&(u.next(e),m=t);for(let e=t;;){if(e>=i){s=!0;break}if(!u.lineBreak&&m+u.value.length>e)break;e=m+u.value.length,m+=u.value.length,u.next()}}let a=$(d);if(s)r.add(t,t,o.Decoration.widget({widget:new F(a),diagnostics:d.slice()}));else{let e=d.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");r.add(t,i,o.Decoration.mark({class:"cm-lintRange cm-lintRange-"+a+e,diagnostics:d.slice(),inclusiveEnd:d.some(e=>e.to>i)}))}if(f=i,f==h)break;for(let e=0;e<d.length;e++)d[e].to<=f&&d.splice(e--,1)}let g=r.finish();return new a(g,t,c(g))}}function c(e,t=null,i=0){let o=null;return e.between(i,1e9,(e,i,{spec:n})=>{if(!(t&&n.diagnostics.indexOf(t)<0))if(o){if(n.diagnostics.indexOf(o.diagnostic)<0)return!1;o=new r(o.from,i,o.diagnostic)}else o=new r(e,i,t||n.diagnostics[0])}),o}function d(e,t){let i=t.pos,o=t.end||i,n=e.state.facet(D).hideOn(e,i,o);if(null!=n)return n;let s=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(m))&&!e.changes.touchesRange(s.from,Math.max(s.to,o)))}function f(e,t){return e.field(p,!1)?t:t.concat(n.StateEffect.appendConfig.of(G))}function u(e,t){return{effects:f(e,[m.of(t)])}}const m=n.StateEffect.define(),h=n.StateEffect.define(),g=n.StateEffect.define(),p=n.StateField.define({create:()=>new a(o.Decoration.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let i=e.diagnostics.map(t.changes),o=null,n=e.panel;if(e.selected){let n=t.changes.mapPos(e.selected.from,1);o=c(i,e.selected.diagnostic,n)||c(i,null,n)}!i.size&&n&&t.state.facet(D).autoPanel&&(n=null),e=new a(i,n,o)}for(let i of t.effects)if(i.is(m)){let o=t.state.facet(D).autoPanel?i.value.length?B.open:null:e.panel;e=a.init(i.value,o,t.state)}else i.is(h)?e=new a(e.diagnostics,i.value?B.open:null,e.selected):i.is(g)&&(e=new a(e.diagnostics,e.panel,i.value));return e},provide:e=>[o.showPanel.from(e,e=>e.panel),o.EditorView.decorations.from(e,e=>e.diagnostics)]});function v(e){let t=e.field(p,!1);return t?t.diagnostics.size:0}const w=o.Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function b(e,t,i){let o,{diagnostics:n}=e.state.field(p),s=-1,l=-1;n.between(t-(i<0?1:0),t+(i>0?1:0),(e,n,{spec:r})=>{if(t>=e&&t<=n&&(e==n||(t>e||i>0)&&(t<n||i<0)))return o=r.diagnostics,s=e,l=n,!1});let r=e.state.facet(D).tooltipFilter;return o&&r&&(o=r(o,e.state)),o?{pos:s,end:l,above:!0,create:()=>({dom:k(e,o)})}:null}function k(e,t){return s("ul",{class:"cm-tooltip-lint"},t.map(t=>M(e,t,!1)))}const y=e=>{let t=e.state.field(p,!1);t&&t.panel||e.dispatch({effects:f(e.state,[h.of(!0)])});let i=(0,o.getPanel)(e,B.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},x=e=>{let t=e.state.field(p,!1);return!(!t||!t.panel||(e.dispatch({effects:h.of(!1)}),0))},C=e=>{let t=e.state.field(p,!1);if(!t)return!1;let i=e.state.selection.main,n=c(t.diagnostics,null,i.to+1);return!(!n&&(n=c(t.diagnostics,null,0),!n||n.from==i.from&&n.to==i.to)||(e.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),(0,o.activateHover)(e,n.from,1,{tooltip:_,until:e=>e.docChanged||e.newSelection.main.head<n.from||e.newSelection.main.head>n.to}),0))},S=e=>{var t;let{state:i}=e,n=i.field(p,!1);if(!n)return!1;let s,l,r,a,c=i.selection.main;if(n.diagnostics.between(0,i.doc.length,(e,t)=>{t<c.to&&(null==s||s<e)&&(s=e,l=t),(null==r||e>r)&&(r=e,a=t)}),null==r||null==s&&r==c.from)return!1;let d=null!=s?s:r,f=null!==(t=null!=l?l:a)&&void 0!==t?t:d;return e.dispatch({selection:{anchor:d,head:f},scrollIntoView:!0}),(0,o.activateHover)(e,d,1,{tooltip:_,until:e=>e.docChanged||e.newSelection.main.head<d||e.newSelection.main.head>f}),!0},T=[{key:"Mod-Shift-m",run:y,preventDefault:!0},{key:"F8",run:C}],R=o.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(D);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(D);t.length&&function(e,t,i){let o=[],n=-1;for(let s of e)s.then(i=>{o.push(i),clearTimeout(n),o.length==e.length?t(o):n=setTimeout(()=>t(o),200)},i)}(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(u(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{(0,o.logException)(this.view.state,e)})}}update(e){let t=e.state.facet(D);(e.docChanged||t!=e.startState.facet(D)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),D=n.Facet.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...(0,n.combineConfig)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:A,tooltipFilter:A,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,o,n)=>e(i,o,n)||t(i,o,n):e:t,autoPanel:(e,t)=>e||t})})});function A(e,t){return e?t?(i,o)=>t(e(i,o),o):e:t}function L(e,t={}){return[D.of({source:e,config:t}),R,G]}function P(e){let t=e.plugin(R);t&&t.force()}function E(e){let t=[];if(e)e:for(let{name:i}of e){for(let e=0;e<i.length;e++){let o=i[e];if(/[a-zA-Z]/.test(o)&&!t.some(e=>e.toLowerCase()==o.toLowerCase())){t.push(o);continue e}}t.push("")}return t}function M(e,t,i){var o;let n=i?E(t.actions):[];return s("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},s("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(o=t.actions)||void 0===o?void 0:o.map((i,o)=>{let l=!1,r=o=>{if(o.preventDefault(),l)return;l=!0;let n=c(e.state.field(p).diagnostics,t);n&&i.apply(e,n.from,n.to)},{name:a}=i,d=n[o]?a.indexOf(n[o]):-1,f=d<0?a:[a.slice(0,d),s("u",a.slice(d,d+1)),a.slice(d+1)];return s("button",{type:"button",class:"cm-diagnosticAction"+(i.markClass?" "+i.markClass:""),onclick:r,onmousedown:r,"aria-label":` Action: ${a}${d<0?"":` (access key "${n[o]})"`}.`},f)}),t.source&&s("div",{class:"cm-diagnosticSource"},t.source))}class F extends o.WidgetType{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return s("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class I{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=M(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class B{constructor(e){this.view=e,this.items=[],this.list=s("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)x(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],o=E(i.actions);for(let n=0;n<o.length;n++)if(o[n].toUpperCase().charCodeAt(0)==t.keyCode){let t=c(this.view.state.field(p).diagnostics,i);t&&i.actions[n].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=s("div",{class:"cm-panel-lint"},this.list,s("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>x(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(p).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(p),i=0,o=!1,n=null,s=new Set;for(e.between(0,this.view.state.doc.length,(e,l,{spec:r})=>{for(let e of r.diagnostics){if(s.has(e))continue;s.add(e);let l,r=-1;for(let t=i;t<this.items.length;t++)if(this.items[t].diagnostic==e){r=t;break}r<0?(l=new I(this.view,e),this.items.splice(i,0,l),o=!0):(l=this.items[r],r>i&&(this.items.splice(i,r-i),o=!0)),t&&l.diagnostic==t.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),n=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();0==this.items.length&&(this.items.push(new I(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),n?(this.list.setAttribute("aria-activedescendant",n.id),this.view.requestMeasure({key:this,read:()=>({sel:n.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let i=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/i:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=c(this.view.state.field(p).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:g.of(t)})}static open(e){return new B(e)}}function O(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function V(e){return O(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const H=o.EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:V("#f11")},".cm-lintRange-warning":{backgroundImage:V("orange")},".cm-lintRange-info":{backgroundImage:V("#999")},".cm-lintRange-hint":{backgroundImage:V("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function z(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function $(e){let t="hint",i=1;for(let o of e){let e=z(o.severity);e>i&&(i=e,t=o.severity)}return t}class j extends o.GutterMarker{constructor(e){super(),this.diagnostics=e,this.severity=$(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,o=e.state.facet(X).tooltipFilter;return o&&(i=o(i,e.state)),i.length&&(t.onmouseover=()=>function(e,t,i){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:U.of({pos:o.from,above:!1,clip:!1,create:()=>({dom:k(e,i),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let i=o=>{let n=t.getBoundingClientRect();if(!(o.clientX>n.left-10&&o.clientX<n.right+10&&o.clientY>n.top-10&&o.clientY<n.bottom+10)){for(let e=o.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",i),e.state.field(Y)&&e.dispatch({effects:U.of(null)})}};window.addEventListener("mousemove",i)}(e,t)}let{hoverTime:n}=e.state.facet(X),s=setTimeout(o,n);t.onmouseout=()=>{clearTimeout(s),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(s),s=setTimeout(o,n)}}(e,t,i)),t}}function N(e,t){let i=Object.create(null);for(let o of t){let t=e.lineAt(o.from);(i[t.from]||(i[t.from]=[])).push(o)}let o=[];for(let e in i)o.push(new j(i[e]).range(+e));return n.RangeSet.of(o,!0)}const K=(0,o.gutter)({class:"cm-gutter-lint",markers:e=>e.state.field(q),widgetMarker:(e,t,i)=>{let o=[];return e.state.field(q).between(i.from,i.to,(e,t,n)=>{e>i.from&&e<i.to&&o.push(...n.diagnostics)}),o.length?new j(o):null}}),q=n.StateField.define({create:()=>n.RangeSet.empty,update(e,t){e=e.map(t.changes);let i=t.state.facet(X).markerFilter;for(let o of t.effects)if(o.is(m)){let n=o.value;i&&(n=i(n||[],t.state)),e=N(t.state.doc,n.slice(0))}return e}}),U=n.StateEffect.define(),Y=n.StateField.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=d(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(U)?t.value:e,e)),provide:e=>o.showTooltip.from(e)}),Z=o.EditorView.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:O('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:O('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:O('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),_=(0,o.hoverTooltip)(b,{hideOn:d}),G=[p,o.EditorView.decorations.compute([p],e=>{let{selected:t,panel:i}=e.field(p);return t&&i&&t.from!=t.to?o.Decoration.set([w.range(t.from,t.to)]):o.Decoration.none}),_,H],X=n.Facet.define({combine:e=>(0,n.combineConfig)(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function W(e={}){return[X.of(e),q,K,Z,Y]}function J(e,t){let i=e.field(p,!1);if(i&&i.diagnostics.size){let e=[],o=[],s=-1;for(let l=n.RangeSet.iter([i.diagnostics]);;l.next()){for(let i=0;i<e.length;i++)(!l.value||l.value.spec.diagnostics.indexOf(e[i])<0)&&(t(e[i],o[i],s),e.splice(i,1),o.splice(i--,1));if(!l.value)break;for(let t of l.value.spec.diagnostics)e.indexOf(t)<0&&(e.push(t),o.push(l.from));s=l.to}}}}}]);
|