cogpit 3.5.0 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-runtime.js +42602 -37594
- package/dist/instance-worker.js +1189 -153
- package/dist/web/assets/AutomationsPanel-B3zT5G5K.js +1 -0
- package/dist/web/assets/{CogpitBlock-Ku77iAFz.js → CogpitBlock-d05YgSdQ.js} +12 -12
- package/dist/web/assets/CommandPaletteHost-D8fk5Qkq.js +1 -0
- package/dist/web/assets/ConfigBrowser-BRsvua8m.js +1 -0
- package/dist/web/assets/CrewPanel-C1Yq8jMT.js +1 -0
- package/dist/web/assets/HighlightedEditor-clIIwmWB.js +2 -0
- package/dist/web/assets/KeyboardShortcutsDialog-0VokzXOy.js +1 -0
- package/dist/web/assets/MissionHome-CNjhPZva.js +2 -0
- package/dist/web/assets/MobileFileChanges-iLhOAdgx.js +1 -0
- package/dist/web/assets/PluginsDialog-xM9uR8bB.js +1 -0
- package/dist/web/assets/PreviewPanel-DF4kUYpX.js +1 -0
- package/dist/web/assets/ProjectFilesPanel-D9_OzQi2.js +4 -0
- package/dist/web/assets/ProjectSwitcherModal-DMEEWm7Q.js +1 -0
- package/dist/web/assets/{TerminalOutput-4YZ5J0ny.js → TerminalOutput-CrGF3VWW.js} +3 -3
- package/dist/web/assets/ThemeSelectorModal-BLBet6sQ.js +1 -0
- package/dist/web/assets/WorkflowsPanel-DkXoYVsK.js +1 -0
- package/dist/web/assets/WorktreePanel-DvFGKfAn.js +1 -0
- package/dist/web/assets/{bash-Yzrsuije.js → bash-DgJyDXW6.js} +1 -1
- package/dist/web/assets/{c-BIGW1oBm.js → c-BG-tZi7o.js} +1 -1
- package/dist/web/assets/cpp-BzPMphJ4.js +1 -0
- package/dist/web/assets/{css-DPfMkruS.js → css-PZBBrkI0.js} +1 -1
- package/dist/web/assets/edition-ui-CvFxsVfJ.js +2 -0
- package/dist/web/assets/github-dark-BQV5ugrc.js +1 -0
- package/dist/web/assets/github-light-Rcb2q3L5.js +1 -0
- package/dist/web/assets/{go-CxLEBnE3.js → go-BBr2UQCn.js} +1 -1
- package/dist/web/assets/{html-GMplVEZG.js → html-DOf0XnR2.js} +1 -1
- package/dist/web/assets/index-BvNyEUVG.js +506 -0
- package/dist/web/assets/index-CAupRX51.js +1 -0
- package/dist/web/assets/index-D6HYPdiw.css +1 -0
- package/dist/web/assets/{index-BFA_YkUM.js → index-DueGSx7L.js} +4 -4
- package/dist/web/assets/index-DxZSG7e3.js +2 -0
- package/dist/web/assets/{java-CylS5w8V.js → java-BTDmaRNO.js} +1 -1
- package/dist/web/assets/{javascript-wDzz0qaB.js → javascript-WyGyM1wV.js} +1 -1
- package/dist/web/assets/{json-Cp-IABpG.js → json-B8JryHcM.js} +1 -1
- package/dist/web/assets/{jsx-g9-lgVsj.js → jsx-8cLv2Six.js} +1 -1
- package/dist/web/assets/{kotlin-BdnUsdx6.js → kotlin-BQy537ds.js} +1 -1
- package/dist/web/assets/{markdown-Cvjx9yec.js → markdown-DX-TNHnc.js} +1 -1
- package/dist/web/assets/{php-aq0itWAE.js → php-47JHu45N.js} +1 -1
- package/dist/web/assets/{python-B6aJPvgy.js → python-B6Ihcp-E.js} +1 -1
- package/dist/web/assets/render.worker-DW0Lo4fc.js +154 -0
- package/dist/web/assets/ruby-BrGyNOch.js +1 -0
- package/dist/web/assets/{rust-B1yitclQ.js → rust-CxuBE0J8.js} +1 -1
- package/dist/web/assets/{scss-OYdSNvt2.js → scss-DxBkwadj.js} +1 -1
- package/dist/web/assets/session-parser.worker-Dv5Kch9n.js +41 -0
- package/dist/web/assets/{sql-BLtJtn59.js → sql-BbONfI8K.js} +1 -1
- package/dist/web/assets/svelte-H3swLp47.js +1 -0
- package/dist/web/assets/{swift-D82vCrfD.js → swift-tEesUtni.js} +1 -1
- package/dist/web/assets/switch-BHG6oFbM.js +1 -0
- package/dist/web/assets/{toml-vGWfd6FD.js → toml-Ms459DBw.js} +1 -1
- package/dist/web/assets/{tsx-COt5Ahok.js → tsx-D6116Ycy.js} +1 -1
- package/dist/web/assets/{typescript-BPQ3VLAy.js → typescript-BqvgUolh.js} +1 -1
- package/dist/web/assets/vendor-markdown-BEJ8yVzA.js +29 -0
- package/dist/web/assets/{vendor-ui-DkzcTXCS.js → vendor-ui-keo4oB2X.js} +226 -191
- package/dist/web/assets/vue-CWSgrUPf.js +1 -0
- package/dist/web/assets/{xml-D2mA2LmW.js → xml-CdYS3kUe.js} +1 -1
- package/dist/web/assets/{yaml-Buea-lGh.js → yaml-Bopit2L3.js} +1 -1
- package/dist/web/index.html +4 -5
- package/package.json +1 -1
- package/dist/web/assets/CommandPaletteHost-CjZO-FyZ.js +0 -1
- package/dist/web/assets/ConfigBrowser-B6jQRpcW.js +0 -1
- package/dist/web/assets/CrewPanel-DvHboAAW.js +0 -1
- package/dist/web/assets/HighlightedEditor-5NbcDE8n.js +0 -2
- package/dist/web/assets/KeyboardShortcutsDialog-yO3h4xr-.js +0 -1
- package/dist/web/assets/MissionHome-CZpQbWs3.js +0 -2
- package/dist/web/assets/MobileFileChanges-DERAdWVc.js +0 -1
- package/dist/web/assets/PluginsDialog-DusZU8fA.js +0 -1
- package/dist/web/assets/PreviewPanel-BpCD0UAz.js +0 -1
- package/dist/web/assets/ProjectFilesPanel-CPHWyVwU.js +0 -4
- package/dist/web/assets/ProjectSwitcherModal-BmYW6es0.js +0 -1
- package/dist/web/assets/ThemeSelectorModal-CHFAl7zz.js +0 -1
- package/dist/web/assets/WorkflowsPanel-B6whBEyJ.js +0 -1
- package/dist/web/assets/WorktreePanel-ASvzuwqm.js +0 -1
- package/dist/web/assets/cpp-BRuaLJcg.js +0 -1
- package/dist/web/assets/edition-ui-DZ5m565z.js +0 -2
- package/dist/web/assets/github-dark-DHJKELXO.js +0 -1
- package/dist/web/assets/github-light-DAi9KRSo.js +0 -1
- package/dist/web/assets/index-C9bzBC6T.js +0 -2
- package/dist/web/assets/index-D262IRnL.js +0 -1
- package/dist/web/assets/index-hGMtuUNI.css +0 -1
- package/dist/web/assets/index-yM7CTfeg.js +0 -498
- package/dist/web/assets/ruby-B0Tyh1qT.js +0 -1
- package/dist/web/assets/session-parser.worker-3tFlB6dy.js +0 -31
- package/dist/web/assets/svelte-DZMnMd3x.js +0 -1
- package/dist/web/assets/switch-BBkU1zqg.js +0 -1
- package/dist/web/assets/vendor-markdown-BE1gYnO9.js +0 -37
- package/dist/web/assets/vendor-shiki-DOn6sF-i.js +0 -144
- package/dist/web/assets/vue-DVfSmUF7.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O,r as g,j as n}from"./vendor-react-gGw_S5I_.js";import{bM as W,aA as $,l as L,D as U,j as Y,aB as H,n as q,o as J}from"./index-BvNyEUVG.js";import{u as Q,de as V}from"./vendor-ui-keo4oB2X.js";import"./vendor-markdown-BEJ8yVzA.js";const I=[{id:"narrow",name:"Narrow",css:"44rem"},{id:"medium",name:"Medium",css:"56rem"},{id:"wide",name:"Wide",css:"64rem"},{id:"full",name:"Full",css:"100%"}],B="cogpit-chat-width",R="medium";function X(){try{const s=localStorage.getItem(B);if(I.some(e=>e.id===s))return s}catch{}return R}let _=typeof window>"u"?R:X();const G=new Set;function K(s){if(typeof document>"u")return;const e=I.find(t=>t.id===s)??I[1];document.documentElement.style.setProperty("--chat-width",e.css)}K(_);function Z(){return _}function ee(s){_=s;try{localStorage.setItem(B,s)}catch{}K(s),G.forEach(e=>e())}function te(s){return G.add(s),()=>G.delete(s)}function se(){const s=O.c(2),e=g.useSyncExternalStore(te,Z,ae);let t;return s[0]!==e?(t=[e,ee],s[0]=e,s[1]=t):t=s[1],t}function ae(){return R}function ce(s){const e=O.c(42),{open:t,onClose:r,currentTheme:i,onSelectTheme:k,onPreviewTheme:l}=s,[p,A]=g.useState(0),[M,P]=se();let j,w;e[0]!==i||e[1]!==t?(j=()=>{if(t){const a=W.findIndex(D=>D.id===i);A(a>=0?a:0)}},w=[t,i],e[0]=i,e[1]=t,e[2]=j,e[3]=w):(j=e[2],w=e[3]),g.useEffect(j,w);let b,N;e[4]!==l||e[5]!==t||e[6]!==p?(b=()=>{t&&l(W[p].id)},N=[p,t,l],e[4]=l,e[5]=t,e[6]=p,e[7]=b,e[8]=N):(b=e[7],N=e[8]),g.useEffect(b,N);let S,y;e[9]!==l||e[10]!==t?(S=()=>{t||l(null)},y=[t,l],e[9]=l,e[10]=t,e[11]=S,e[12]=y):(S=e[11],y=e[12]),g.useEffect(S,y);let C;e[13]!==r||e[14]!==k?(C=a=>{k(a.id),r()},e[13]=r,e[14]=k,e[15]=C):C=e[15];const z=C;let o;e[16]!==r?(o=a=>{a||r()},e[16]=r,e[17]=o):o=e[17];let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsxs(L,{className:"border-b p-4 pr-12",children:[n.jsxs(U,{className:"flex items-center gap-2 text-sm",children:[n.jsx(V,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Appearance"]}),n.jsx(Y,{children:"Preview a color theme and set the chat width."})]}),e[18]=E):E=e[18];const F=W[p];let c;e[19]!==F.id?(c=[F.id],e[19]=F.id,e[20]=c):c=e[20];let d;e[21]!==i||e[22]!==z?(d=W.map((a,D)=>n.jsxs($,{value:a.id,className:"h-auto w-full justify-start gap-3 px-3 py-2.5 text-left text-muted-foreground data-pressed:bg-accent data-pressed:text-accent-foreground",onClick:()=>z(a),onMouseEnter:()=>A(D),onFocus:()=>A(D),children:[n.jsx("div",{className:"flex gap-1",children:a.swatches.map(ne)}),n.jsx("span",{className:"flex-1 text-sm font-medium",children:a.name}),i===a.id&&n.jsx(Q,{"data-icon":"inline-end",className:"size-4 shrink-0 text-foreground"})]},a.id)),e[21]=i,e[22]=z,e[23]=d):d=e[23];let m;e[24]!==c||e[25]!==d?(m=n.jsx(H,{"aria-label":"Theme",orientation:"vertical",value:c,className:"w-full items-stretch p-1",children:d}),e[24]=c,e[25]=d,e[26]=m):m=e[26];let v;e[27]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("div",{className:"px-1 pb-2 text-xs font-medium text-muted-foreground",children:"Chat width"}),e[27]=v):v=e[27];let f;e[28]!==M?(f=[M],e[28]=M,e[29]=f):f=e[29];let u;e[30]!==P?(u=I.map(a=>n.jsx($,{value:a.id,className:"flex-1 text-xs text-muted-foreground data-pressed:bg-accent data-pressed:text-accent-foreground",onClick:()=>P(a.id),children:a.name},a.id)),e[30]=P,e[31]=u):u=e[31];let h;e[32]!==f||e[33]!==u?(h=n.jsxs("div",{className:"border-t p-3",children:[v,n.jsx(H,{"aria-label":"Chat width",value:f,className:"w-full items-stretch gap-1",children:u})]}),e[32]=f,e[33]=u,e[34]=h):h=e[34];let x;e[35]!==m||e[36]!==h?(x=n.jsxs(q,{className:"max-w-sm gap-0 overflow-hidden p-0",children:[E,m,h]}),e[35]=m,e[36]=h,e[37]=x):x=e[37];let T;return e[38]!==t||e[39]!==x||e[40]!==o?(T=n.jsx(J,{open:t,onOpenChange:o,children:x}),e[38]=t,e[39]=x,e[40]=o,e[41]=T):T=e[41],T}function ne(s,e){return n.jsx("div",{className:"size-4 rounded-full border",style:{backgroundColor:s}},e)}export{ce as ThemeSelectorModal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as X,j as s,r as T}from"./vendor-react-gGw_S5I_.js";import{c as le,q as Ee,r as mt,s as ft,t as xt,u as He,k as pe,v as Ye,w as Qe,x as je,y as Ce,z as Se,B as ne,A as Te,F as Re,e as Le,C as Fe,a as De,S as Ue,b as Be,G as Ge,H as pt,I as Xe,J as ht,K as gt,P as jt,E as ze,f as Ae,h as Pe,i as We,L as bt,M as Nt,N as wt,O as yt,Q as vt,R as kt,T as Ct,m as St,U as Tt,V as Rt}from"./index-BvNyEUVG.js";import{M as It}from"./vendor-markdown-BEJ8yVzA.js";import{c$ as Ze,aA as et,bN as tt,bR as $t,C as Ie,bK as _t,u as st,aV as lt,d0 as qe,a5 as zt,bz as At,c4 as Pt,c2 as Wt,cs as Ve,V as Ot,br as Mt}from"./vendor-ui-keo4oB2X.js";const Et=new Set(["done","error","skipped"]);function Ke(l){return Et.has(l)}function Lt(l){return l!=="completed"&&l!=="failed"&&l!=="killed"}function nt(l){switch(l){case"completed":return{label:"Completed",badge:"border-success/30 bg-success/10 text-success",dot:"bg-success"};case"failed":return{label:"Failed",badge:"border-destructive/30 bg-destructive/10 text-destructive",dot:"bg-destructive"};case"killed":return{label:"Stopped",badge:"border-warning/30 bg-warning/10 text-warning",dot:"bg-warning"};default:return{label:"Running",badge:"border-info/30 bg-info/10 text-info",dot:"bg-info"}}}function Ft(l){switch(l){case"done":return{label:"Done",badge:"border-success/30 bg-success/10 text-success",dot:"bg-success"};case"skipped":return{label:"Skipped",badge:"border-border bg-muted/30 text-muted-foreground",dot:"bg-muted-foreground"};case"error":return{label:"Error",badge:"border-destructive/30 bg-destructive/10 text-destructive",dot:"bg-destructive"};case"queued":return{label:"Queued",badge:"border-border bg-muted/30 text-muted-foreground",dot:"bg-muted-foreground"};default:return{label:"Running",badge:"border-info/30 bg-info/10 text-info",dot:"bg-info"}}}function Dt(l){const e=new Map;l.phases.forEach((r,n)=>{const o=n+1;e.set(o,{index:o,title:r.title,detail:r.detail,agents:[]})});const t=[];for(const r of l.agents){const n=e.get(r.phaseIndex);n?n.agents.push(r):t.push(r)}const a=[...e.values()];t.length>0&&a.push({index:a.length+1,title:t[0].phaseTitle||"Other",agents:t});for(const r of a)r.agents.sort((n,o)=>n.index-o.index);return a}function Ut(l){return l.total===0?0:(l.done+l.error)/l.total}const rt=["headline","oneLineSell","verdict","summary","name","lens"],Bt=new Set(["title","name"]),Jt=new Set(["headline","oneLineSell","verdict"]);function at(l){const e=l.trim();if(!e.startsWith("{")&&!e.startsWith("["))return l;try{return JSON.parse(e)}catch{return l}}function qt(l){try{return JSON.parse(`"${l}"`)}catch{return l.replace(/\\n/g," ").replace(/\\"/g,'"')}}function Vt(l){const e=at(l);if(e!==l)return $e(e);for(const t of rt){const a=l.match(new RegExp(`"${t}"\\s*:\\s*"((?:\\\\.|[^"\\\\])*)"`));if(a!=null&&a[1])return qt(a[1])}return l.replace(/^[#>*\s-]+/,"").replace(/[`*_#]/g,"").split(/\n\s*\n|\n/)[0].trim()}function $e(l){if(typeof l=="string")return Vt(l);if(typeof l=="number"||typeof l=="boolean")return String(l);if(Array.isArray(l))return l.length>0?$e(l[0]):"";if(Ee(l))for(const e of rt){const t=l[e];if(typeof t=="string"&&t.trim())return t.trim()}return""}function Je(l){if(typeof l=="string")return l;try{return JSON.stringify(l,null,2)}catch{return String(l)}}function Kt(l){const e={oneLineSell:"In one line",quickWins:"Quick wins",whatIsLost:"What is lost",whyItHurts:"Why it hurts",restingState:"Resting state",fatalFlaws:"Fatal flaws",bestIdeasRegardlessOfConcept:"Best ideas across concepts"};return e[l]?e[l]:l.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/^./,t=>t.toUpperCase())}function it(l){const e=X.c(4),{children:t}=l;let a;e[0]!==t?(a=mt(t),e[0]=t,e[1]=a):a=e[1];const r=a;let n;return e[2]!==r?(n=s.jsx(It,{components:xt,remarkPlugins:ft,children:r}),e[2]=r,e[3]=n):n=e[3],n}function ot(l){const e=X.c(7),{value:t}=l;if(typeof t=="string"){let n;return e[0]!==t?(n=s.jsx(it,{children:t}),e[0]=t,e[1]=n):n=e[1],n}if(t===null){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"text-muted-foreground",children:"None"}),e[2]=n):n=e[2],n}if(typeof t=="boolean"){const n=t?"Yes":"No";let o;return e[3]!==n?(o=s.jsx("span",{children:n}),e[3]=n,e[4]=o):o=e[4],o}const a=String(t);let r;return e[5]!==a?(r=s.jsx("span",{children:a}),e[5]=a,e[6]=r):r=e[6],r}function Oe(l){const e=X.c(21),{value:t,depth:a}=l,r=a===void 0?0:a;if(!Ee(t)&&!Array.isArray(t)){let o;return e[0]!==t?(o=s.jsx(ot,{value:t}),e[0]=t,e[1]=o):o=e[1],o}if(r>5){let o;e[2]!==t?(o=Je(t),e[2]=t,e[3]=o):o=e[3];let i;return e[4]!==o?(i=s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words rounded-lg bg-muted p-3 text-xs text-muted-foreground",children:o}),e[4]=o,e[5]=i):i=e[5],i}if(Array.isArray(t)){if(t.length===0){let d;return e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:"No items"}),e[6]=d):d=e[6],d}if(t.every(Qt)){let d;e[7]!==t?(d=t.map(Yt),e[7]=t,e[8]=d):d=e[8];let m;return e[9]!==d?(m=s.jsx("ul",{className:"flex list-disc flex-col gap-2 pl-5 marker:text-muted-foreground",children:d}),e[9]=d,e[10]=m):m=e[10],m}let i;if(e[11]!==r||e[12]!==t){let d;e[14]!==r?(d=(m,c)=>s.jsx("article",{className:"border-l pl-4",children:s.jsx(Oe,{value:m,depth:r+1})},c),e[14]=r,e[15]=d):d=e[15],i=t.map(d),e[11]=r,e[12]=t,e[13]=i}else i=e[13];let u;return e[16]!==i?(u=s.jsx("div",{className:"flex flex-col gap-3",children:i}),e[16]=i,e[17]=u):u=e[17],u}let n;if(e[18]!==r||e[19]!==t){const o=Object.entries(t),i=o.find(Ht),u=o.filter(d=>{const[m]=d;return m!==(i==null?void 0:i[0])});n=s.jsxs("div",{className:"flex flex-col gap-4",children:[i&&s.jsx("h3",{className:le("font-semibold text-foreground",r===0?"text-lg":"text-base"),children:i[1]}),u.map(d=>{const[m,c]=d;return c===void 0?null:Jt.has(m)&&typeof c=="string"?s.jsx("div",{className:"border-l-2 border-foreground/30 pl-4 text-sm font-medium leading-relaxed",children:s.jsx(it,{children:c})},m):s.jsxs("section",{className:"flex min-w-0 flex-col gap-2",children:[s.jsx("h4",{className:"text-xs font-medium text-muted-foreground",children:Kt(m)}),s.jsx("div",{className:"min-w-0 text-sm leading-relaxed",children:s.jsx(Oe,{value:c,depth:r+1})})]},m)})]}),e[18]=r,e[19]=t,e[20]=n}else n=e[20];return n}function Ht(l){const[e,t]=l;return Bt.has(e)&&typeof t=="string"&&t.trim().length>0}function Yt(l,e){return s.jsx("li",{className:"pl-1 text-sm leading-relaxed",children:s.jsx(ot,{value:l})},e)}function Qt(l){return!Ee(l)&&!Array.isArray(l)}function Me(l){const e=X.c(19),{value:t,className:a}=l;let r;e[0]!==t?(r=typeof t=="string"?at(t):t,e[0]=t,e[1]=r):r=e[1];const n=r;if(typeof n=="string"&&(n.trim().startsWith("{")||n.trim().startsWith("["))){let m;e[2]!==n?(m=$e(n),e[2]=n,e[3]=m):m=e[3];const c=m;let x;e[4]!==a?(x=le("flex flex-col gap-2",a),e[4]=a,e[5]=x):x=e[5];let f;e[6]!==c?(f=c&&s.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:c}),e[6]=c,e[7]=f):f=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only a shortened preview was saved for this response."}),e[8]=h):h=e[8];let p;return e[9]!==x||e[10]!==f?(p=s.jsxs("div",{className:x,children:[f,h]}),e[9]=x,e[10]=f,e[11]=p):p=e[11],p}let i;e[12]!==a?(i=le("min-w-0 text-sm",a),e[12]=a,e[13]=i):i=e[13];let u;e[14]!==n?(u=s.jsx(Oe,{value:n}),e[14]=n,e[15]=u):u=e[15];let d;return e[16]!==i||e[17]!==u?(d=s.jsx("div",{className:i,children:u}),e[16]=i,e[17]=u,e[18]=d):d=e[18],d}function Gt(l){return l.replace(/\[[0-9;]*m\]/g,"")}function Xt(l){return(l.includes(":")?l.slice(l.indexOf(":")+1):l).replace(/[-_]+/g," ")}function Zt(l){const e=X.c(135),{agent:t,dirName:a,sessionId:r,runId:n}=l,[o,i]=T.useState(!1),[u,d]=T.useState(!1);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={status:"idle"},e[0]=m):m=e[0];const[c,x]=T.useState(m),[f,h]=He();let p,g,j,b,C,S,y,N,v,R,P,V,I,A,w,k,$,_,W,O,z;if(e[1]!==t||e[2]!==a||e[3]!==o||e[4]!==c.status||e[5]!==c.value||e[6]!==n||e[7]!==r){v=Ft(t.state);let Ne;e[29]!==t.state?(Ne=!Ke(t.state)&&t.state!=="queued",e[29]=t.state,e[30]=Ne):Ne=e[30],N=Ne;let we;e[31]!==t.resultPreview?(we=t.resultPreview?$e(t.resultPreview):"",e[31]=t.resultPreview,e[32]=we):we=e[32];const ye=we;let ve;e[33]!==t.agentId||e[34]!==a||e[35]!==n||e[36]!==r?(ve=async()=>{x({status:"loading"});try{const he=await Re(`/api/workflow-agent-result/${encodeURIComponent(a)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}/${encodeURIComponent(t.agentId)}`);if(!he.ok){x({status:"unavailable"});return}const ut=await he.json();x({status:"loaded",value:ut.result})}catch{x({status:"unavailable"})}},e[33]=t.agentId,e[34]=a,e[35]=n,e[36]=r,e[37]=ve):ve=e[37],y=ve;let ke;e[38]!==t.state||e[39]!==y||e[40]!==c.status?(ke=he=>{i(he),he&&c.status==="idle"&&Ke(t.state)&&y()},e[38]=t.state,e[39]=y,e[40]=c.status,e[41]=ke):ke=e[41];const ct=ke;z=c.status==="loaded"?c.value:t.resultPreview,S=c.status==="unavailable",C=Ce,P=o,V=ct,b=Le,O="sm",R="motion-card motion-list-item gap-0 py-0",j=Fe,W="px-0 py-0",g=Se,k="group flex w-full items-start gap-3 rounded-lg px-3.5 py-3 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring/50",$=s.jsx("span",{className:le("mt-1.5 size-2 shrink-0 rounded-full",v.dot)});const dt=t.label;let re;e[42]!==t.label?(re=Xt(t.label),e[42]=t.label,e[43]=re):re=e[43];let ae;e[44]!==t.label||e[45]!==re?(ae=s.jsx(De,{className:"truncate capitalize",title:dt,children:re}),e[44]=t.label,e[45]=re,e[46]=ae):ae=e[46];let ie;e[47]!==t.attempt?(ie=t.attempt&&t.attempt>1&&s.jsxs(pe,{variant:"outline",className:"text-muted-foreground",children:["Attempt ",t.attempt]}),e[47]=t.attempt,e[48]=ie):ie=e[48];let oe;e[49]!==ae||e[50]!==ie?(oe=s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[ae,ie]}),e[49]=ae,e[50]=ie,e[51]=oe):oe=e[51];let ce;e[52]!==t.lastToolName||e[53]!==t.lastToolSummary||e[54]!==N||e[55]!==ye?(ce=ye?s.jsx("p",{className:"mt-1 line-clamp-2 max-w-3xl text-xs leading-relaxed text-muted-foreground",children:ye}):N&&t.lastToolName?s.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:["Working in ",t.lastToolName,t.lastToolSummary?`: ${t.lastToolSummary}`:""]}):null,e[52]=t.lastToolName,e[53]=t.lastToolSummary,e[54]=N,e[55]=ye,e[56]=ce):ce=e[56];let de;e[57]!==t.model?(de=t.model&&s.jsx("span",{children:Gt(t.model)}),e[57]=t.model,e[58]=de):de=e[58];let ue;e[59]!==t.tokens?(ue=typeof t.tokens=="number"&&t.tokens>0&&s.jsxs(_e,{icon:Ze,children:[Ye(t.tokens)," tokens"]}),e[59]=t.tokens,e[60]=ue):ue=e[60];let me;e[61]!==t.toolCalls?(me=typeof t.toolCalls=="number"&&t.toolCalls>0&&s.jsxs(_e,{icon:et,children:[t.toolCalls," tools"]}),e[61]=t.toolCalls,e[62]=me):me=e[62];let fe;e[63]!==t.durationMs?(fe=typeof t.durationMs=="number"&&s.jsx(_e,{icon:tt,children:Qe(t.durationMs)}),e[63]=t.durationMs,e[64]=fe):fe=e[64];let xe;e[65]!==de||e[66]!==ue||e[67]!==me||e[68]!==fe?(xe=s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[de,ue,me,fe]}),e[65]=de,e[66]=ue,e[67]=me,e[68]=fe,e[69]=xe):xe=e[69],e[70]!==oe||e[71]!==ce||e[72]!==xe?(_=s.jsxs("div",{className:"min-w-0 flex-1",children:[oe,ce,xe]}),e[70]=oe,e[71]=ce,e[72]=xe,e[73]=_):_=e[73],w="flex shrink-0 items-center gap-2",p=pe,I="outline",A=le("hidden sm:inline-flex",v.badge),e[1]=t,e[2]=a,e[3]=o,e[4]=c.status,e[5]=c.value,e[6]=n,e[7]=r,e[8]=p,e[9]=g,e[10]=j,e[11]=b,e[12]=C,e[13]=S,e[14]=y,e[15]=N,e[16]=v,e[17]=R,e[18]=P,e[19]=V,e[20]=I,e[21]=A,e[22]=w,e[23]=k,e[24]=$,e[25]=_,e[26]=W,e[27]=O,e[28]=z}else p=e[8],g=e[9],j=e[10],b=e[11],C=e[12],S=e[13],y=e[14],N=e[15],v=e[16],R=e[17],P=e[18],V=e[19],I=e[20],A=e[21],w=e[22],k=e[23],$=e[24],_=e[25],W=e[26],O=e[27],z=e[28];let M;e[74]!==N?(M=N&&s.jsx(je,{"data-icon":"inline-start"}),e[74]=N,e[75]=M):M=e[75];let Z;e[76]!==p||e[77]!==v.label||e[78]!==M||e[79]!==I||e[80]!==A?(Z=s.jsxs(p,{variant:I,className:A,children:[M,v.label]}),e[76]=p,e[77]=v.label,e[78]=M,e[79]=I,e[80]=A,e[81]=Z):Z=e[81];let K;e[82]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{className:"mt-0.5 size-4 text-muted-foreground transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none"}),e[82]=K):K=e[82];let E;e[83]!==Z||e[84]!==w?(E=s.jsxs("div",{className:w,children:[Z,K]}),e[83]=Z,e[84]=w,e[85]=E):E=e[85];let L;e[86]!==g||e[87]!==E||e[88]!==k||e[89]!==$||e[90]!==_?(L=s.jsxs(g,{className:k,children:[$,_,E]}),e[86]=g,e[87]=E,e[88]=k,e[89]=$,e[90]=_,e[91]=L):L=e[91];let ee;e[92]!==j||e[93]!==L||e[94]!==W?(ee=s.jsx(j,{className:W,children:L}),e[92]=j,e[93]=L,e[94]=W,e[95]=ee):ee=e[95];let H;e[96]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ue,{}),e[96]=H):H=e[96];let Y;e[97]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("h5",{className:"text-sm font-semibold text-foreground",children:"Response"}),e[97]=Y):Y=e[97];const te=c.status==="loaded"?"Complete agent response":"Saved response preview";let F;e[98]!==te?(F=s.jsxs("div",{children:[Y,s.jsx("p",{className:"text-xs text-muted-foreground",children:te})]}),e[98]=te,e[99]=F):F=e[99];let D;e[100]!==S||e[101]!==y?(D=S&&s.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>void y(),children:[s.jsx(_t,{"data-icon":"inline-start"}),"Retry"]}),e[100]=S,e[101]=y,e[102]=D):D=e[102];let U;e[103]!==f||e[104]!==h||e[105]!==z?(U=z!==void 0&&s.jsx(ne,{variant:"ghost",size:"icon-sm",onClick:()=>h(Je(z)),"aria-label":f?"Response copied":"Copy response",title:f?"Copied":"Copy response",children:f?s.jsx(st,{"data-icon":"inline-start"}):s.jsx(lt,{"data-icon":"inline-start"})}),e[103]=f,e[104]=h,e[105]=z,e[106]=U):U=e[106];let B;e[107]!==D||e[108]!==U?(B=s.jsxs("div",{className:"flex items-center gap-1",children:[D,U]}),e[107]=D,e[108]=U,e[109]=B):B=e[109];let J;e[110]!==F||e[111]!==B?(J=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[F,B]}),e[110]=F,e[111]=B,e[112]=J):J=e[112];let q;e[113]!==c.status||e[114]!==N||e[115]!==z?(q=c.status==="loading"?s.jsxs("div",{className:"flex items-center gap-2 py-5 text-sm text-muted-foreground",children:[s.jsx(je,{}),"Loading the complete response…"]}):z!==void 0?s.jsx(Me,{value:z}):s.jsx("p",{className:"text-sm text-muted-foreground",children:N?"This agent has not returned a response yet.":"No response was saved for this agent."}),e[113]=c.status,e[114]=N,e[115]=z,e[116]=q):q=e[116];let Q;e[117]!==t.promptPreview||e[118]!==u?(Q=t.promptPreview&&s.jsxs(Ce,{open:u,onOpenChange:d,children:[s.jsxs(Se,{render:s.jsx(ne,{variant:"ghost",size:"sm",className:"w-full justify-start"}),children:[s.jsx($t,{"data-icon":"inline-start"}),"Agent prompt",s.jsx(Ie,{"data-icon":"inline-end",className:le("ml-auto transition-transform",u&&"rotate-180")})]}),s.jsx(Te,{className:"pt-2",children:s.jsx("div",{className:"rounded-md border bg-muted/30 p-3 text-xs leading-relaxed text-muted-foreground",children:s.jsx(Me,{value:t.promptPreview})})})]}),e[117]=t.promptPreview,e[118]=u,e[119]=Q):Q=e[119];let G;e[120]!==J||e[121]!==q||e[122]!==Q?(G=s.jsxs(Te,{children:[H,s.jsxs(Be,{className:"flex flex-col gap-4 px-4 py-4",children:[J,q,Q]})]}),e[120]=J,e[121]=q,e[122]=Q,e[123]=G):G=e[123];let se;e[124]!==b||e[125]!==R||e[126]!==ee||e[127]!==G||e[128]!==O?(se=s.jsxs(b,{size:O,className:R,children:[ee,G]}),e[124]=b,e[125]=R,e[126]=ee,e[127]=G,e[128]=O,e[129]=se):se=e[129];let be;return e[130]!==C||e[131]!==P||e[132]!==V||e[133]!==se?(be=s.jsx(C,{open:P,onOpenChange:V,children:se}),e[130]=C,e[131]=P,e[132]=V,e[133]=se,e[134]=be):be=e[134],be}function _e(l){const e=X.c(5),{icon:t,children:a}=l;let r;e[0]!==t?(r=s.jsx(t,{className:"size-3"}),e[0]=t,e[1]=r):r=e[1];let n;return e[2]!==a||e[3]!==r?(n=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[r,a]}),e[2]=a,e[3]=r,e[4]=n):n=e[4],n}function es(l){const e=X.c(102),{detail:t,dirName:a,sessionId:r,stopping:n,confirming:o,onForceStop:i}=l;let u,d,m,c,x,f,h,p;if(e[0]!==o||e[1]!==t||e[2]!==a||e[3]!==i||e[4]!==r||e[5]!==n){const S=nt(t.status);let y;e[14]!==t.status?(y=Lt(t.status),e[14]=t.status,e[15]=y):y=e[15];const N=y,v=Dt(t),R=Ut(t.agentCounts),P=N&&t.controllable!==!1;x="flex flex-col gap-6 pb-6";const V=N&&s.jsx("span",{className:le("size-1.5 rounded-full",S.dot)});let I;e[16]!==S||e[17]!==V?(I=s.jsxs(pe,{variant:"outline",className:S.badge,children:[V,S.label]}),e[16]=S,e[17]=V,e[18]=I):I=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:"text-xs text-muted-foreground",children:"Workflow run"}),e[19]=A):A=e[19];let w;e[20]!==I?(w=s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[I,A]}),e[20]=I,e[21]=w):w=e[21];let k;e[22]!==t.workflowName?(k=s.jsx("h2",{className:"text-xl font-semibold tracking-tight text-foreground",title:t.workflowName,children:t.workflowName}),e[22]=t.workflowName,e[23]=k):k=e[23];let $;e[24]!==t.summary?($=t.summary&&s.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-relaxed text-muted-foreground",children:t.summary}),e[24]=t.summary,e[25]=$):$=e[25];let _;e[26]!==w||e[27]!==k||e[28]!==$?(_=s.jsxs("div",{className:"min-w-0",children:[w,k,$]}),e[26]=w,e[27]=k,e[28]=$,e[29]=_):_=e[29];let W;e[30]!==N||e[31]!==P||e[32]!==o||e[33]!==i||e[34]!==n?(W=N&&i&&s.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1 sm:items-end",children:[s.jsxs(ne,{variant:o?"destructive":"outline",size:"sm",disabled:!P||n,onClick:i,children:[n?s.jsx(je,{"data-icon":"inline-start"}):s.jsx(qe,{"data-icon":"inline-start"}),o?"Confirm stop":"Stop workflow"]}),!P&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"This run is not controlled by Cogpit"})]}),e[30]=N,e[31]=P,e[32]=o,e[33]=i,e[34]=n,e[35]=W):W=e[35];let O;e[36]!==_||e[37]!==W?(O=s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[_,W]}),e[36]=_,e[37]=W,e[38]=O):O=e[38];const z=`${t.agentCounts.done+t.agentCounts.error}/${t.agentCount}`;let M;e[39]!==z?(M=s.jsx(ge,{icon:At,value:z,label:"Agents finished"}),e[39]=z,e[40]=M):M=e[40];const Z=String(t.phaseCount);let K;e[41]!==Z?(K=s.jsx(ge,{icon:Pt,value:Z,label:"Phases"}),e[41]=Z,e[42]=K):K=e[42];let E;e[43]!==t.totalTokens?(E=Ye(t.totalTokens),e[43]=t.totalTokens,e[44]=E):E=e[44];let L;e[45]!==E?(L=s.jsx(ge,{icon:Ze,value:E,label:"Tokens"}),e[45]=E,e[46]=L):L=e[46];const ee=String(t.totalToolCalls);let H;e[47]!==ee?(H=s.jsx(ge,{icon:et,value:ee,label:"Tool calls"}),e[47]=ee,e[48]=H):H=e[48];let Y;e[49]!==t.durationMs?(Y=typeof t.durationMs=="number"?Qe(t.durationMs):"In progress",e[49]=t.durationMs,e[50]=Y):Y=e[50];let te;e[51]!==Y?(te=s.jsx(ge,{icon:tt,value:Y,label:"Duration",className:"col-span-2 sm:col-span-1"}),e[51]=Y,e[52]=te):te=e[52];let F;e[53]!==M||e[54]!==K||e[55]!==L||e[56]!==H||e[57]!==te?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-lg border bg-border sm:grid-cols-5",children:[M,K,L,H,te]}),e[53]=M,e[54]=K,e[55]=L,e[56]=H,e[57]=te,e[58]=F):F=e[58];let D;e[59]!==R?(D=Math.round(R*100),e[59]=R,e[60]=D):D=e[60];let U;e[61]!==D?(U=s.jsx(jt,{value:D,"aria-label":"Workflow progress",className:"flex-1"}),e[61]=D,e[62]=U):U=e[62];let B;e[63]!==R?(B=Math.round(R*100),e[63]=R,e[64]=B):B=e[64];let J;e[65]!==B?(J=s.jsxs("span",{className:"w-9 text-right text-xs tabular-nums text-muted-foreground",children:[B,"%"]}),e[65]=B,e[66]=J):J=e[66];let q;e[67]!==U||e[68]!==J?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[U,J]}),e[67]=U,e[68]=J,e[69]=q):q=e[69],e[70]!==O||e[71]!==F||e[72]!==q?(f=s.jsxs("section",{className:"flex flex-col gap-4",children:[O,F,q]}),e[70]=O,e[71]=F,e[72]=q,e[73]=f):f=e[73],e[74]!==t.error?(h=t.error&&s.jsxs(Ge,{variant:"destructive",children:[s.jsx(qe,{}),s.jsx(pt,{children:"Workflow error"}),s.jsx(Xe,{children:s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-xs",children:t.error})})]}),e[74]=t.error,e[75]=h):h=e[75],e[76]!==t.resultPreview||e[77]!==t.runId||e[78]!==a||e[79]!==r?(p=t.resultPreview&&s.jsx(ns,{preview:t.resultPreview,dirName:a,sessionId:r,runId:t.runId}),e[76]=t.resultPreview,e[77]=t.runId,e[78]=a,e[79]=r,e[80]=p):p=e[80],m="grid items-start gap-6 md:grid-cols-[180px_minmax(0,1fr)]";let Q;e[81]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx("p",{className:"px-2 pb-2 pt-1 text-xs font-medium text-muted-foreground",children:"Run outline"}),e[81]=Q):Q=e[81],c=s.jsxs("nav",{className:"sticky top-0 hidden rounded-lg border bg-popover p-2 md:block","aria-label":"Workflow phases",children:[Q,s.jsx("div",{className:"flex flex-col gap-1",children:v.map(ts)})]}),u="flex min-w-0 flex-col gap-8";let G;e[82]!==t.runId||e[83]!==a||e[84]!==r?(G=se=>s.jsx(ss,{group:se,dirName:a,sessionId:r,runId:t.runId},`${se.index}-${se.title}`),e[82]=t.runId,e[83]=a,e[84]=r,e[85]=G):G=e[85],d=v.map(G),e[0]=o,e[1]=t,e[2]=a,e[3]=i,e[4]=r,e[5]=n,e[6]=u,e[7]=d,e[8]=m,e[9]=c,e[10]=x,e[11]=f,e[12]=h,e[13]=p}else u=e[6],d=e[7],m=e[8],c=e[9],x=e[10],f=e[11],h=e[12],p=e[13];let g;e[86]!==u||e[87]!==d?(g=s.jsx("div",{className:u,children:d}),e[86]=u,e[87]=d,e[88]=g):g=e[88];let j;e[89]!==m||e[90]!==c||e[91]!==g?(j=s.jsxs("div",{className:m,children:[c,g]}),e[89]=m,e[90]=c,e[91]=g,e[92]=j):j=e[92];let b;e[93]!==t.script?(b=t.script&&s.jsx(rs,{script:t.script}),e[93]=t.script,e[94]=b):b=e[94];let C;return e[95]!==j||e[96]!==b||e[97]!==x||e[98]!==f||e[99]!==h||e[100]!==p?(C=s.jsxs("div",{className:x,children:[f,h,p,j,b]}),e[95]=j,e[96]=b,e[97]=x,e[98]=f,e[99]=h,e[100]=p,e[101]=C):C=e[101],C}function ts(l){return s.jsxs(ne,{variant:"ghost",size:"sm",type:"button",onClick:()=>{var e;return(e=document.getElementById(`workflow-phase-${l.index}`))==null?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},className:"h-auto w-full justify-start gap-2 px-2 py-2 text-left text-xs text-muted-foreground",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-md bg-muted text-xs font-medium text-foreground",children:l.index}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.title}),s.jsx("span",{className:"tabular-nums",children:l.agents.length})]},`${l.index}-${l.title}`)}function ge(l){const e=X.c(15),{icon:t,value:a,label:r,className:n}=l;let o;e[0]!==n?(o=le("flex items-center gap-2.5 bg-card px-3 py-3",n),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==t?(i=s.jsx(t,{className:"size-4 shrink-0 text-muted-foreground"}),e[2]=t,e[3]=i):i=e[3];let u;e[4]!==a?(u=s.jsx("p",{className:"truncate text-sm font-semibold tabular-nums text-foreground",children:a}),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==r?(d=s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=d):d=e[7];let m;e[8]!==u||e[9]!==d?(m=s.jsxs("div",{className:"min-w-0",children:[u,d]}),e[8]=u,e[9]=d,e[10]=m):m=e[10];let c;return e[11]!==o||e[12]!==i||e[13]!==m?(c=s.jsxs("div",{className:o,children:[i,m]}),e[11]=o,e[12]=i,e[13]=m,e[14]=c):c=e[14],c}function ss(l){const e=X.c(29),{group:t,dirName:a,sessionId:r,runId:n}=l;let o;e[0]!==t.agents?(o=t.agents.filter(ls),e[0]=t.agents,e[1]=o):o=e[1];const i=o.length,u=`workflow-phase-${t.index}`;let d;e[2]!==t.index?(d=s.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary text-xs font-semibold text-primary-foreground",children:t.index}),e[2]=t.index,e[3]=d):d=e[3];let m;e[4]!==t.title?(m=s.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),e[4]=t.title,e[5]=m):m=e[5];let c;e[6]!==i||e[7]!==t.agents.length?(c=s.jsxs("span",{className:"text-xs text-muted-foreground",children:[i,"/",t.agents.length," complete"]}),e[6]=i,e[7]=t.agents.length,e[8]=c):c=e[8];let x;e[9]!==m||e[10]!==c?(x=s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[m,c]}),e[9]=m,e[10]=c,e[11]=x):x=e[11];let f;e[12]!==t.detail?(f=t.detail&&s.jsx("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:t.detail}),e[12]=t.detail,e[13]=f):f=e[13];let h;e[14]!==x||e[15]!==f?(h=s.jsxs("div",{className:"min-w-0 flex-1",children:[x,f]}),e[14]=x,e[15]=f,e[16]=h):h=e[16];let p;e[17]!==d||e[18]!==h?(p=s.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[d,h]}),e[17]=d,e[18]=h,e[19]=p):p=e[19];let g;e[20]!==a||e[21]!==t.agents||e[22]!==n||e[23]!==r?(g=t.agents.length===0?s.jsx(ze,{className:"border py-6",children:s.jsxs(Ae,{children:[s.jsx(Pe,{children:"No agents yet"}),s.jsx(We,{children:"No agents have started this phase."})]})}):s.jsx("div",{className:"flex flex-col gap-2",children:t.agents.map(b=>s.jsx(Zt,{agent:b,dirName:a,sessionId:r,runId:n},`${n}:${b.agentId||b.index}`))}),e[20]=a,e[21]=t.agents,e[22]=n,e[23]=r,e[24]=g):g=e[24];let j;return e[25]!==g||e[26]!==u||e[27]!==p?(j=s.jsxs("section",{id:u,className:"scroll-mt-4",children:[p,g]}),e[25]=g,e[26]=u,e[27]=p,e[28]=j):j=e[28],j}function ls(l){return l.state==="done"||l.state==="skipped"}function ns({preview:l,dirName:e,sessionId:t,runId:a}){const[r,n]=T.useState(!0),[o,i]=T.useState(),[u,d]=T.useState(!1),[m,c]=T.useState(!1),[x,f]=He(),h=l.endsWith("…"),p=o??l,g=T.useCallback(async()=>{d(!0),c(!1);try{const j=await Re(`/api/workflow-result/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(a)}`);if(!j.ok){c(!0);return}const b=await j.json();i(b.result)}catch{c(!0)}finally{d(!1)}},[e,a,t]);return s.jsx(Ce,{open:r,onOpenChange:n,children:s.jsxs(Le,{className:"motion-enter gap-0 py-0",children:[s.jsxs(Fe,{className:"py-4",children:[s.jsxs(Se,{className:"group flex min-w-0 items-center gap-3 text-left outline-none",children:[s.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:s.jsx(zt,{className:"size-4"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx(De,{children:"Workflow outcome"}),s.jsx(ht,{children:"The synthesized answer from this run"})]}),s.jsx(Ie,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none"})]}),s.jsxs(gt,{className:"flex items-center gap-1",children:[h&&o===void 0&&s.jsxs(ne,{variant:"outline",size:"sm",disabled:u,onClick:()=>void g(),children:[u&&s.jsx(je,{"data-icon":"inline-start"}),m?"Retry full result":"Load full result"]}),s.jsx(ne,{variant:"ghost",size:"icon-sm",onClick:()=>f(Je(p)),"aria-label":x?"Outcome copied":"Copy outcome",title:x?"Copied":"Copy outcome",children:x?s.jsx(st,{"data-icon":"inline-start"}):s.jsx(lt,{"data-icon":"inline-start"})})]})]}),s.jsxs(Te,{children:[s.jsx(Ue,{}),s.jsx(Be,{className:"py-5",children:s.jsx(Me,{value:p})})]})]})})}function rs(l){const e=X.c(7),{script:t}=l,[a,r]=T.useState(!1);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Fe,{className:"px-0 py-0",children:s.jsxs(Se,{className:"group flex w-full items-center gap-2 px-3 py-3 text-left text-sm font-medium text-muted-foreground outline-none transition-colors hover:bg-muted/40 hover:text-foreground",children:[s.jsx(Wt,{className:"size-4"}),s.jsx(De,{children:"Orchestration script"}),s.jsx(Ie,{className:"ml-auto size-4 transition-transform group-data-panel-open:rotate-180"})]})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ue,{}),e[1]=o):o=e[1];let i;e[2]!==t?(i=s.jsxs(Le,{size:"sm",className:"gap-0 py-0",children:[n,s.jsxs(Te,{children:[o,s.jsx(Be,{className:"py-3",children:s.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-muted p-3 text-xs leading-relaxed text-muted-foreground",children:t})})]})]}),e[2]=t,e[3]=i):i=e[3];let u;return e[4]!==a||e[5]!==i?(u=s.jsx(Ce,{open:a,onOpenChange:r,children:i}),e[4]=a,e[5]=i,e[6]=u):u=e[6],u}function us({open:l,onOpenChange:e,dirName:t,sessionId:a,workflows:r,isLive:n,canStop:o,onRefetchList:i}){var A;const[u,d]=T.useState(null),[m,c]=T.useState(!1),[x,f]=T.useState(null),[h,p]=T.useState(!1),[g,j]=T.useState(!1),[b,C]=T.useState(!1),[S,y]=T.useState(null),N=T.useRef(0),v=m?null:u&&r.some(w=>w.runId===u)?u:((A=r[0])==null?void 0:A.runId)??null,R=T.useCallback(async()=>{const w=++N.current;if(!t||!a||!v){f(null);return}try{const k=await Re(`/api/workflow-detail/${encodeURIComponent(t)}/${encodeURIComponent(a)}/${encodeURIComponent(v)}`);if(!k.ok){w===N.current&&f(null);return}const $=await k.json();w===N.current&&f($)}catch{w===N.current&&f(null)}finally{w===N.current&&p(!1)}},[t,a,v]);T.useEffect(()=>{if(!v){f(null);return}f(null),p(!0),C(!1),y(null),R()},[v,R]),bt(l?t:null,l?a:null,l?v:null,()=>{R(),i()});const P=T.useCallback(async()=>{if(!b){C(!0);return}if(!(!a||!v)){j(!0),y(null);try{const k=await(await Re("/api/workflow-stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:a,runId:v})})).json().catch(()=>({}));k!=null&&k.success?y("Stop signal sent."):(k==null?void 0:k.controllable)===!1?y("This workflow runs in a session Cogpit doesn't control."):y("Couldn't stop. The session may have already exited."),R(),i()}catch{y("Stop request failed.")}finally{j(!1),C(!1)}}},[b,a,v,R,i]),V=r.length>1,I=r.find(w=>w.runId===v);return s.jsx(Nt,{open:l,onOpenChange:e,children:s.jsxs(wt,{side:"right",className:"w-full data-[side=right]:max-w-[1120px]",children:[s.jsx(yt,{className:"min-h-14 justify-center border-b py-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3 pr-9",children:[s.jsxs(vt,{className:"flex items-center gap-2",children:[s.jsx(Ve,{className:"size-4"}),"Workflows",r.length>0&&s.jsx(pe,{variant:"secondary",children:r.length}),n&&s.jsxs(pe,{variant:"outline",className:"border-info/30 text-info",children:[s.jsx(kt,{className:"size-1.5"}),"Live"]})]}),s.jsx(Ct,{className:"sr-only",children:"Inspect workflow runs, agent progress, and run controls for this session."}),s.jsx(ne,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Refresh workflows",title:"Refresh workflows",children:s.jsx(Ot,{"data-icon":"inline-start"})})]})}),s.jsx(St,{className:"h-[calc(100dvh-3.5rem)]",children:s.jsx("div",{className:"px-5 py-6 sm:px-6",children:r.length===0?s.jsx(ze,{className:"min-h-[60dvh]",children:s.jsxs(Ae,{children:[s.jsx(Tt,{variant:"icon",children:s.jsx(Ve,{})}),s.jsx(Pe,{children:"No workflows in this session"}),s.jsx(We,{children:"Phases, agents, and their responses will appear here when this session starts a workflow."})]})}):s.jsxs(s.Fragment,{children:[V&&s.jsxs("div",{className:"mb-6 flex flex-col gap-2",children:[v&&x&&s.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>c(!0),className:"w-fit px-2 text-muted-foreground",children:[s.jsx(Mt,{"data-icon":"inline-start"}),"All runs"]}),(!v||!x)&&r.map(w=>s.jsx(as,{workflow:w,active:w.runId===v,onClick:()=>{d(w.runId),c(!1)}},w.runId))]}),h&&!x?s.jsxs("div",{className:"flex min-h-[50dvh] items-center justify-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{}),"Loading workflow…"]}):x?s.jsxs(s.Fragment,{children:[S&&s.jsx(Ge,{className:"mb-4",children:s.jsx(Xe,{children:S})}),s.jsx(es,{detail:x,dirName:t??"",sessionId:a??"",stopping:g,confirming:b,onForceStop:o?P:void 0})]}):I?s.jsx(ze,{className:"min-h-[50dvh]",children:s.jsxs(Ae,{children:[s.jsx(Pe,{children:"Could not load this workflow"}),s.jsx(We,{children:"The journal may have moved or the run may no longer be available."})]})}):null]})})})]})})}function as(l){const e=X.c(45),{workflow:t,active:a,onClick:r}=l;let n,o,i,u,d,m,c;if(e[0]!==a||e[1]!==r||e[2]!==t.agentCounts.done||e[3]!==t.agentCounts.error||e[4]!==t.status){i=nt(t.status),o=t.agentCounts.done+t.agentCounts.error,n=ne,d="ghost",m=r;const N=a?"border-foreground/20 bg-accent":"bg-background hover:bg-muted/50";e[12]!==N?(c=le("h-auto w-full justify-start gap-3 whitespace-normal border px-3 py-3 text-left",N),e[12]=N,e[13]=c):c=e[13],u=le("size-2 shrink-0 rounded-full",i.dot),e[0]=a,e[1]=r,e[2]=t.agentCounts.done,e[3]=t.agentCounts.error,e[4]=t.status,e[5]=n,e[6]=o,e[7]=i,e[8]=u,e[9]=d,e[10]=m,e[11]=c}else n=e[5],o=e[6],i=e[7],u=e[8],d=e[9],m=e[10],c=e[11];let x;e[14]!==u?(x=s.jsx("span",{className:u}),e[14]=u,e[15]=x):x=e[15];let f;e[16]!==t.workflowName?(f=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.workflowName}),e[16]=t.workflowName,e[17]=f):f=e[17];let h;e[18]!==i.badge||e[19]!==i.label?(h=s.jsx(pe,{variant:"outline",className:i.badge,children:i.label}),e[18]=i.badge,e[19]=i.label,e[20]=h):h=e[20];let p;e[21]!==f||e[22]!==h?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[f,h]}),e[21]=f,e[22]=h,e[23]=p):p=e[23];let g;e[24]!==t.summary?(g=t.summary&&s.jsx("p",{className:"mt-1 line-clamp-1 text-xs text-muted-foreground",children:t.summary}),e[24]=t.summary,e[25]=g):g=e[25];let j;e[26]!==o||e[27]!==t.agentCount?(j=s.jsxs("span",{children:[o,"/",t.agentCount," agents"]}),e[26]=o,e[27]=t.agentCount,e[28]=j):j=e[28];let b;e[29]!==t.startTime?(b=t.startTime>0&&s.jsx("span",{children:Rt(new Date(t.startTime).toISOString())}),e[29]=t.startTime,e[30]=b):b=e[30];let C;e[31]!==j||e[32]!==b?(C=s.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-xs text-muted-foreground",children:[j,b]}),e[31]=j,e[32]=b,e[33]=C):C=e[33];let S;e[34]!==C||e[35]!==p||e[36]!==g?(S=s.jsxs("div",{className:"min-w-0 flex-1",children:[p,g,C]}),e[34]=C,e[35]=p,e[36]=g,e[37]=S):S=e[37];let y;return e[38]!==n||e[39]!==S||e[40]!==d||e[41]!==m||e[42]!==c||e[43]!==x?(y=s.jsxs(n,{variant:d,onClick:m,className:c,children:[x,S]}),e[38]=n,e[39]=S,e[40]=d,e[41]=m,e[42]=c,e[43]=x,e[44]=y):y=e[44],y}export{us as WorkflowsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as x,j as e}from"./vendor-react-gGw_S5I_.js";import{b7 as Y,B as h,c as E,S as Z,cO as _,E as ee,f as se,U as ne,h as ae,i as re,k as te,cP as C,V as ie,y as oe,z as le,cJ as R,cQ as ce,A as de,aa as U,a9 as F,a5 as P,a2 as he,a3 as T,a4 as $,a7 as O,a6 as I,a8 as W,F as p,a1 as d}from"./index-BvNyEUVG.js";import{a7 as b,a5 as me,V as xe,X as ue,bO as pe,bw as ge,b2 as B,A as je,c1 as fe}from"./vendor-ui-keo4oB2X.js";import"./vendor-markdown-BEJ8yVzA.js";function y(l){return l.commitsAhead>0&&(!l.branch||C(l.name,l.branch))}const ke={M:"text-warning",A:"text-success",D:"text-destructive",R:"text-info"};function Ne({worktrees:l,loading:g,dirName:r,onRefetch:j,onOpenSession:J,onClose:M}){const c=Y("hostFiles"),[H,N]=x.useState(null),[L,w]=x.useState(null),[G,u]=x.useState(!1),[a,m]=x.useState(null),[t,f]=x.useState(null),D=async s=>{if(!(!c||!r)){N(s.name);try{const n=await p(`/api/worktrees/${encodeURIComponent(r)}/${encodeURIComponent(s.name)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:s.isDirty})});if(!n.ok){const{error:i}=await n.json().catch(()=>({error:void 0}));throw new Error(i??`HTTP ${n.status}`)}j()}catch(n){d.error(`Failed to delete worktree: ${n instanceof Error?n.message:"Unknown error"}`)}finally{N(null)}}},V=s=>{if(!(!c||!r)){if(s.isDirty){m({worktree:s,reason:"dirty"});return}if(y(s)){m({worktree:s,reason:"unpushed"});return}D(s)}},q=()=>{if(!a)return;const{worktree:s,reason:n}=a;if(n==="dirty"&&y(s)){m({worktree:s,reason:"unpushed"});return}m(null),D(s)},Q=async s=>{if(!(!c||!r)){w(s.name);try{const n=await p(`/api/worktrees/${encodeURIComponent(r)}/create-pr`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({worktreeName:s.name,title:s.name.replace(/-/g," ")})});if(n.ok){const i=await n.json();i.url?window.open(i.url,"_blank","noopener,noreferrer"):d.warning("PR created but no URL was returned")}else{const i=await n.json().catch(()=>({error:"Unknown error"}));d.error(`Failed to create PR: ${i.error||"Unknown error"}`)}}catch(n){d.error(`Error creating PR: ${n instanceof Error?n.message:"Unknown error"}`)}finally{w(null)}}},X=async()=>{if(!(!c||!r)){u(!0);try{const s=await p(`/api/worktrees/${encodeURIComponent(r)}/cleanup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(s.ok){const{stale:n}=await s.json();n.length===0?d.info("No stale worktrees found"):f(n.map(i=>i.name))}}catch(s){d.error(`Cleanup failed: ${s instanceof Error?s.message:"Unknown error"}`)}finally{u(!1)}}},K=async()=>{if(!c||!r||!t)return;const s=t;f(null),u(!0);try{await p(`/api/worktrees/${encodeURIComponent(r)}/cleanup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0,names:s})}),j()}catch(n){d.error(`Cleanup failed: ${n instanceof Error?n.message:"Unknown error"}`)}finally{u(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs("aside",{"aria-label":"Worktrees",className:"flex size-full min-h-0 flex-col bg-canvas",children:[e.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 px-3",children:[e.jsx(b,{"data-icon":"inline-start","aria-hidden":"true",className:"size-4 text-muted-foreground"}),e.jsx("h2",{className:"text-sm font-medium",children:"Worktrees"}),e.jsx("div",{className:"flex-1"}),c&&e.jsx(h,{variant:"ghost",size:"icon-sm",onClick:X,disabled:G,"aria-label":"Cleanup stale worktrees",children:e.jsx(me,{"data-icon":"inline-start"})}),e.jsx(h,{variant:"ghost",size:"icon-sm",onClick:j,disabled:g,"aria-label":"Refresh worktrees",children:e.jsx(xe,{"data-icon":"inline-start",className:E(g&&"animate-spin")})}),e.jsx(h,{variant:"ghost",size:"icon-sm",onClick:M,"aria-label":"Close worktrees",children:e.jsx(ue,{"data-icon":"inline-start"})})]}),e.jsx(Z,{}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-3",children:[e.jsx(_,{dirName:r}),!r&&e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select a project to view worktrees"}),r&&l.length===0&&!g&&e.jsx(ee,{className:"border-0 py-16",children:e.jsxs(se,{children:[e.jsx(ne,{variant:"icon",children:e.jsx(b,{})}),e.jsx(ae,{children:"No worktrees"}),e.jsx(re,{children:"Create a new session with “Isolate in worktree” enabled"})]})}),l.map(s=>{var A,z,S;const n=((A=s.changedFiles)==null?void 0:A.reduce((o,v)=>o+v.additions,0))??0,i=((z=s.changedFiles)==null?void 0:z.reduce((o,v)=>o+v.deletions,0))??0,k=((S=s.changedFiles)==null?void 0:S.length)??0;return e.jsxs("div",{className:"rounded-lg border bg-card p-3 transition-colors hover:bg-accent/40",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.isDirty&&e.jsx("span",{className:"flex size-2 shrink-0 rounded-full bg-warning",title:"Uncommitted changes"}),s.commitsAhead>0&&e.jsxs(te,{variant:"outline",className:"h-5 shrink-0 px-1.5 text-xs",children:[s.commitsAhead," ahead"]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[s.linkedSessions.length>0&&e.jsx(h,{variant:"ghost",size:"icon-xs",onClick:()=>J(s.linkedSessions[0]),"aria-label":"Open session",children:e.jsx(pe,{"data-icon":"inline-start"})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",size:"icon-xs",onClick:()=>Q(s),disabled:L===s.name||s.commitsAhead===0,"aria-label":"Create PR",children:e.jsx(ge,{"data-icon":"inline-start"})}),e.jsx(h,{variant:"ghost",size:"icon-xs",onClick:()=>V(s),disabled:H===s.name,className:"text-destructive hover:bg-destructive/10 hover:text-destructive","aria-label":"Delete worktree",children:e.jsx(B,{"data-icon":"inline-start"})})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"shrink-0 font-mono",children:s.head}),e.jsx("span",{className:"truncate",children:s.headMessage})]}),(s.createdAt||!C(s.name,s.branch))&&e.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[!C(s.name,s.branch)&&e.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(b,{className:"size-3 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"truncate",children:s.branch||"detached"})]}),s.createdAt&&e.jsx("span",{className:"shrink-0",children:ie(s.createdAt)})]}),k>0&&e.jsxs(oe,{className:"mt-2",children:[e.jsxs("div",{className:"relative flex w-full items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[e.jsxs(le,{className:"group flex items-center gap-1.5 after:absolute after:inset-0",children:[e.jsx(je,{"data-icon":"inline-start",className:"size-3 transition-transform group-data-panel-open:rotate-90 motion-reduce:transition-none"}),e.jsx(fe,{"data-icon":"inline-start",className:"size-3"}),e.jsxs("span",{children:[k," file",k!==1?"s":""," changed"]})]}),e.jsx(R,{add:n,del:i,breakdown:ce(s.changedFiles),className:"relative ml-1"})]}),e.jsx(de,{children:e.jsx("div",{className:"mt-1.5 flex flex-col gap-px rounded-md bg-muted/40 p-1.5",children:s.changedFiles.map(o=>e.jsxs("div",{className:"flex items-center gap-2 px-1 py-0.5 font-mono text-xs",children:[e.jsx("span",{className:E("shrink-0 w-3 text-center",ke[o.status]??"text-muted-foreground"),children:o.status}),e.jsx("span",{className:"truncate text-foreground/80",children:o.path}),e.jsx(R,{add:o.additions,del:o.deletions,className:"ml-auto text-muted-foreground"})]},o.path))})})]})]},s.name)})]})]}),e.jsx(U,{open:a!==null,onOpenChange:s=>{s||m(null)},children:e.jsxs(F,{size:"sm",children:[e.jsxs(P,{children:[e.jsx(he,{className:"bg-destructive/10 text-destructive",children:e.jsx(B,{})}),e.jsx(T,{children:(a==null?void 0:a.reason)==="dirty"?"Delete worktree with uncommitted changes?":"Delete worktree with unpushed commits?"}),e.jsxs($,{children:[(a==null?void 0:a.reason)==="dirty"?`"${a.worktree.name}" has uncommitted changes.`:`"${a==null?void 0:a.worktree.name}" has ${a==null?void 0:a.worktree.commitsAhead} unpushed commit(s).`," "," ","Deleting it cannot be undone."]})]}),e.jsxs(O,{children:[e.jsx(I,{size:"sm",children:"Cancel"}),e.jsx(W,{variant:"destructive",size:"sm",onClick:q,children:(a==null?void 0:a.reason)==="dirty"&&y(a.worktree)?"Continue":"Delete worktree"})]})]})}),e.jsx(U,{open:t!==null,onOpenChange:s=>{s||f(null)},children:e.jsxs(F,{children:[e.jsxs(P,{children:[e.jsx(T,{children:"Remove stale worktrees?"}),e.jsxs($,{children:[t==null?void 0:t.length," stale worktree",(t==null?void 0:t.length)===1?"":"s"," will be removed: ",t==null?void 0:t.join(", "),"."]})]}),e.jsxs(O,{children:[e.jsx(I,{size:"sm",children:"Cancel"}),e.jsx(W,{variant:"destructive",size:"sm",onClick:()=>void K(),children:"Remove worktrees"})]})]})})]})}export{Ne as WorktreePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Object.freeze(JSON.parse(`{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"')}])([^\\\\t\\\\n\\\\r \\"\\\\&');->\`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|('))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*(('))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=\`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;\`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\['\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}`)),n=[e];export{n as default};
|
|
1
|
+
const e=Object.freeze(JSON.parse(`{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"')}])([^\\\\t\\\\n\\\\r \\"\\\\&');->\`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|('))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*(('))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=\`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;\`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\['\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}`));var n=[e];export{n as default};
|