flavor-code 1.4.0-beta.1 → 1.4.0-beta.3
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/agent/loop.d.ts +3 -0
- package/dist/{app-C5ZQUOKJ.js → app-H7RYDMD3.js} +6 -6
- package/dist/{chunk-FOTMP4ZS.js → chunk-3BHKW5A7.js} +1 -1
- package/dist/{chunk-ODRWR4KK.js → chunk-IQAZ42TM.js} +1 -1
- package/dist/{chunk-URUVFECH.js → chunk-KBHWS7M6.js} +4 -4
- package/dist/{chunk-6MNOZ2TX.js → chunk-NIKCPCJG.js} +559 -377
- package/dist/{chunk-3WCDZ6ZL.js → chunk-ZJCAQXA7.js} +2 -1
- package/dist/{claude-ink-LP32NSX5.js → claude-ink-ECZ6QF3P.js} +2 -2
- package/dist/cli-main.js +7 -7
- package/dist/desktop/main.js +626 -443
- package/dist/desktop-renderer/assets/{index-CqRIr-hz.js → index-CYd5JkTR.js} +2 -2
- package/dist/desktop-renderer/assets/{interactive-terminal-C4o7MNPO.js → interactive-terminal-j52Ty3QO.js} +1 -1
- package/dist/desktop-renderer/index.html +1 -1
- package/dist/git/service.d.ts +3 -3
- package/dist/git/tools.d.ts +1 -1
- package/dist/harness/local.d.ts +2 -0
- package/dist/init/project.d.ts +0 -6
- package/dist/jobs/registry.d.ts +1 -1
- package/dist/{load-V2UIYYQI.js → load-SLSL3IWR.js} +1 -1
- package/dist/sdk/index.js +4 -4
- package/dist/tools/lsp.d.ts +13 -10
- package/dist/tools/runtime.d.ts +2 -1
- package/dist/tools/search.d.ts +1 -0
- package/dist/tools/types.d.ts +1 -1
- package/dist/utils/abort.d.ts +4 -0
- package/dist/utils/execFileNoThrow.d.ts +1 -0
- package/dist/utils/process-tree.d.ts +2 -0
- package/package.json +2 -2
- package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +7 -7
- package/dist/astgraph/db.mjs +0 -237
- package/dist/astgraph/extract.mjs +0 -239
- package/dist/astgraph/flavor-plugin.json +0 -25
- package/dist/astgraph/grammars.mjs +0 -68
- package/dist/astgraph/index.js +0 -301
- package/dist/astgraph/indexer.mjs +0 -175
- package/dist/astgraph/query.mjs +0 -165
- package/dist/astgraph/resolve.mjs +0 -93
- package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter.js +0 -3980
- package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
- package/dist/astgraph/vendor/zod/LICENSE +0 -21
- package/dist/astgraph/vendor/zod/index.js +0 -4
- package/dist/astgraph/vendor/zod/locales/index.js +0 -1
- package/dist/astgraph/vendor/zod/locales/package.json +0 -7
- package/dist/astgraph/vendor/zod/package.json +0 -135
- package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
- package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
- package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
- package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
- package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
- package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
- package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
- package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
- package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
- package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
- package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
- package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
- package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
- package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
- package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
- package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
- package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
- package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
- package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
- package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
- package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
- package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
- package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
- package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
- package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
- package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
- package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
- package/dist/astgraph/vendor/zod/v4/index.js +0 -3
- package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
- package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
- package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
- package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
- package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
- package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
- package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
- package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
- package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
- package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
- package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
- package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
- package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
- package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
- package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
- package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
- package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
- package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
- package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
- package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
- package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
- package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
- package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
- package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
- package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
- package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
- package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
- package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
- package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
- package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
- package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
- package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
- package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
- package/dist/astgraph/vendor/zod/v4/package.json +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./index-CqRIr-hz.js";var i=e(n(),1),a=2,o=1,s=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue(`padding-top`)),bottom:parseInt(s.getPropertyValue(`padding-bottom`)),right:parseInt(s.getPropertyValue(`padding-right`)),left:parseInt(s.getPropertyValue(`padding-left`))},l=c.top+c.bottom,u=c.right+c.left,d=r-l,f=i-u-t;return{cols:Math.max(a,Math.floor(f/e.css.cell.width)),rows:Math.max(o,Math.floor(d/e.css.cell.height))}}},c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{for(var i=r>1?void 0:r?l(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&c(t,n,i),i},f=(e,t)=>(n,r)=>t(n,r,e),p=`Terminal input`,m={get:()=>p,set:e=>p=e},h=`Too much output to announce, navigate to rows manually to read`,g={get:()=>h,set:e=>h=e};function _(e){return e.replace(/\r?\n/g,`\r`)}function ee(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function te(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ne(e,t,n,r){e.stopPropagation(),e.clipboardData&&re(e.clipboardData.getData(`text/plain`),t,n,r)}function re(e,t,n,r){e=_(e),e=ee(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function ie(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ae(e,t,n,r,i){ie(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function v(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function oe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var se=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},y=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},ce=``,le=` `,ue=class e{constructor(){this.fg=0,this.bg=0,this.extended=new b}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},b=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},x=class e extends ue{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new b,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?v(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},de=`di$target`,fe=`di$dependencies`,S=new Map;function pe(e){return e[fe]||[]}function C(e){if(S.has(e))return S.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);me(t,e,r)};return t._id=e,S.set(e,t),t}function me(e,t,n){t[de]===t?t[fe].push({id:e,index:n}):(t[fe]=[{id:e,index:n}],t[de]=t)}var w=C(`BufferService`),he=C(`CoreMouseService`),T=C(`CoreService`),ge=C(`CharsetService`),E=C(`InstantiationService`),_e=C(`LogService`),D=C(`OptionsService`),ve=C(`OscLinkService`),ye=C(`UnicodeService`),be=C(`DecorationService`),xe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new x,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Se(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};xe=d([f(0,w),f(1,D),f(2,ve)],xe);function Se(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./index-CYd5JkTR.js";var i=e(n(),1),a=2,o=1,s=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue(`padding-top`)),bottom:parseInt(s.getPropertyValue(`padding-bottom`)),right:parseInt(s.getPropertyValue(`padding-right`)),left:parseInt(s.getPropertyValue(`padding-left`))},l=c.top+c.bottom,u=c.right+c.left,d=r-l,f=i-u-t;return{cols:Math.max(a,Math.floor(f/e.css.cell.width)),rows:Math.max(o,Math.floor(d/e.css.cell.height))}}},c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{for(var i=r>1?void 0:r?l(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&c(t,n,i),i},f=(e,t)=>(n,r)=>t(n,r,e),p=`Terminal input`,m={get:()=>p,set:e=>p=e},h=`Too much output to announce, navigate to rows manually to read`,g={get:()=>h,set:e=>h=e};function _(e){return e.replace(/\r?\n/g,`\r`)}function ee(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function te(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ne(e,t,n,r){e.stopPropagation(),e.clipboardData&&re(e.clipboardData.getData(`text/plain`),t,n,r)}function re(e,t,n,r){e=_(e),e=ee(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function ie(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ae(e,t,n,r,i){ie(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function v(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function oe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var se=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},y=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},ce=``,le=` `,ue=class e{constructor(){this.fg=0,this.bg=0,this.extended=new b}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},b=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},x=class e extends ue{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new b,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?v(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},de=`di$target`,fe=`di$dependencies`,S=new Map;function pe(e){return e[fe]||[]}function C(e){if(S.has(e))return S.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);me(t,e,r)};return t._id=e,S.set(e,t),t}function me(e,t,n){t[de]===t?t[fe].push({id:e,index:n}):(t[fe]=[{id:e,index:n}],t[de]=t)}var w=C(`BufferService`),he=C(`CoreMouseService`),T=C(`CoreService`),ge=C(`CharsetService`),E=C(`InstantiationService`),_e=C(`LogService`),D=C(`OptionsService`),ve=C(`OscLinkService`),ye=C(`UnicodeService`),be=C(`DecorationService`),xe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new x,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Se(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};xe=d([f(0,w),f(1,D),f(2,ve)],xe);function Se(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Ce=C(`CharSizeService`),we=C(`CoreBrowserService`),Te=C(`MouseService`),Ee=C(`RenderService`),De=C(`SelectionService`),Oe=C(`CharacterJoinerService`),ke=C(`ThemeService`),Ae=C(`LinkProviderService`),je=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Le.isErrorNoTelemetry(e)?new Le(e.message+`
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="color-scheme" content="light" />
|
|
7
7
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' http://127.0.0.1:* http://localhost:* http://[::1]:* ws://127.0.0.1:* ws://localhost:* ws://[::1]:*; frame-src http://127.0.0.1:* http://localhost:* http://[::1]:*" />
|
|
8
8
|
<title>Flavor Code</title>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-CYd5JkTR.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-Bk6FYhyh.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/dist/git/service.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export interface GitResult {
|
|
|
4
4
|
stderr: string;
|
|
5
5
|
code: number;
|
|
6
6
|
}
|
|
7
|
-
export declare function git(workspace: string, args: readonly string[], timeoutMs?: number): Promise<GitResult>;
|
|
8
|
-
export declare function isGitRepository(workspace: string): Promise<boolean>;
|
|
7
|
+
export declare function git(workspace: string, args: readonly string[], timeoutMs?: number, signal?: AbortSignal): Promise<GitResult>;
|
|
8
|
+
export declare function isGitRepository(workspace: string, signal?: AbortSignal): Promise<boolean>;
|
|
9
9
|
export interface GitChangeSummary {
|
|
10
10
|
branch: string;
|
|
11
11
|
head: string;
|
|
@@ -38,6 +38,6 @@ export interface GitHistoryEntry {
|
|
|
38
38
|
subject: string;
|
|
39
39
|
}
|
|
40
40
|
/** Commit history for the repository, or for one file when a path is given. */
|
|
41
|
-
export declare function fileHistory(workspace: string, path: string | undefined, limit: number): Promise<GitHistoryEntry[]>;
|
|
41
|
+
export declare function fileHistory(workspace: string, path: string | undefined, limit: number, signal?: AbortSignal): Promise<GitHistoryEntry[]>;
|
|
42
42
|
/** Short branch@sha marker used to tag session checkpoints with git state. */
|
|
43
43
|
export declare function gitMarker(workspace: string): Promise<string | undefined>;
|
package/dist/git/tools.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import type { ToolDefinition } from "../tools/types.js";
|
|
3
3
|
declare const GitHistoryInput: z.ZodObject<{
|
|
4
4
|
path: z.ZodOptional<z.ZodString>;
|
|
5
|
-
limit: z.ZodOptional<z.
|
|
5
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export type GitHistoryInput = z.infer<typeof GitHistoryInput>;
|
|
8
8
|
export declare function createGitHistoryTool(workspace: string): ToolDefinition<GitHistoryInput, string>;
|
package/dist/harness/local.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface LocalHarnessOptions {
|
|
|
21
21
|
approve?: ApprovalCallback;
|
|
22
22
|
maxIterationsMain?: number;
|
|
23
23
|
maxIterationsSubagent?: number;
|
|
24
|
+
softLimitFactor?: number;
|
|
25
|
+
extendIterations?: number;
|
|
24
26
|
hasActiveProgress?(): boolean;
|
|
25
27
|
hallucinationGuard?: HallucinationGuard;
|
|
26
28
|
/** When true, non-destructive tools skip the approval callback. Destructive tools still require confirmation. */
|
package/dist/init/project.d.ts
CHANGED
|
@@ -24,10 +24,4 @@ export interface InitResult {
|
|
|
24
24
|
facts: ProjectFacts;
|
|
25
25
|
}
|
|
26
26
|
export declare function inspectProject(cwd: string): Promise<ProjectFacts>;
|
|
27
|
-
/**
|
|
28
|
-
* Copy the astgraph plugin (runtime + vendored WASM grammars + zod) into the
|
|
29
|
-
* workspace's project plugin directory. An existing installation is never
|
|
30
|
-
* overwritten.
|
|
31
|
-
*/
|
|
32
|
-
export declare function copyAstgraphPlugin(cwd: string): Promise<void>;
|
|
33
27
|
export declare function initializeFlavor(cwd: string): Promise<InitResult>;
|
package/dist/jobs/registry.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare class JobRegistry {
|
|
|
43
43
|
list(owner?: string): readonly JobSnapshot[];
|
|
44
44
|
read(id: string, owner: string, cursor?: number): JobReadResult;
|
|
45
45
|
wait(id: string, owner: string, signal?: AbortSignal): Promise<JobSnapshot>;
|
|
46
|
-
kill(id: string, owner: string): void
|
|
46
|
+
kill(id: string, owner: string): void | Promise<void>;
|
|
47
47
|
subscribe(listener: (jobs: readonly JobSnapshot[]) => void): () => void;
|
|
48
48
|
dispose(): Promise<void>;
|
|
49
49
|
}
|
package/dist/sdk/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
FlavorRpcServer,
|
|
5
5
|
TraceRecordSchema,
|
|
6
6
|
TraceRecorder
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-3BHKW5A7.js";
|
|
8
8
|
import {
|
|
9
9
|
AgentMessageQueue,
|
|
10
10
|
DockerExecutionEnvironment,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
WorkspaceCheckpointStore,
|
|
14
14
|
buildDockerInvocation,
|
|
15
15
|
createProductionRuntime
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-NIKCPCJG.js";
|
|
17
17
|
import "../chunk-CIVPKHF4.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-KBHWS7M6.js";
|
|
19
|
+
import "../chunk-ZJCAQXA7.js";
|
|
20
20
|
import "../chunk-S32JRDZK.js";
|
|
21
21
|
|
|
22
22
|
// src/trace/replay.ts
|
package/dist/tools/lsp.d.ts
CHANGED
|
@@ -14,10 +14,13 @@ interface LspLocation {
|
|
|
14
14
|
}
|
|
15
15
|
interface LspHover {
|
|
16
16
|
contents: {
|
|
17
|
-
kind
|
|
17
|
+
kind?: string;
|
|
18
18
|
language?: string;
|
|
19
19
|
value: string;
|
|
20
|
-
} | string
|
|
20
|
+
} | string | Array<string | {
|
|
21
|
+
language: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}>;
|
|
21
24
|
range?: {
|
|
22
25
|
start: {
|
|
23
26
|
line: number;
|
|
@@ -52,10 +55,10 @@ interface LanguageServerConfig {
|
|
|
52
55
|
rootFiles: string[];
|
|
53
56
|
}
|
|
54
57
|
export interface LspManager {
|
|
55
|
-
findReferences(uri: string, line: number, character: number): Promise<LspLocation[]>;
|
|
56
|
-
hover(uri: string, line: number, character: number): Promise<LspHover | null>;
|
|
57
|
-
diagnostics(uri: string): Promise<LspDiagnostic[]>;
|
|
58
|
-
dispose(): void
|
|
58
|
+
findReferences(uri: string, line: number, character: number, signal?: AbortSignal): Promise<LspLocation[]>;
|
|
59
|
+
hover(uri: string, line: number, character: number, signal?: AbortSignal): Promise<LspHover | null>;
|
|
60
|
+
diagnostics(uri: string, signal?: AbortSignal): Promise<LspDiagnostic[]>;
|
|
61
|
+
dispose(): void | Promise<void>;
|
|
59
62
|
}
|
|
60
63
|
export declare class RealLspManager implements LspManager {
|
|
61
64
|
#private;
|
|
@@ -64,10 +67,10 @@ export declare class RealLspManager implements LspManager {
|
|
|
64
67
|
serverConfigs?: LanguageServerConfig[];
|
|
65
68
|
onStatus?: ((message: string) => void) | undefined;
|
|
66
69
|
});
|
|
67
|
-
dispose(): void
|
|
68
|
-
findReferences(uri: string, line: number, character: number): Promise<LspLocation[]>;
|
|
69
|
-
hover(uri: string, line: number, character: number): Promise<LspHover | null>;
|
|
70
|
-
diagnostics(uri: string): Promise<LspDiagnostic[]>;
|
|
70
|
+
dispose(): Promise<void>;
|
|
71
|
+
findReferences(uri: string, line: number, character: number, signal?: AbortSignal): Promise<LspLocation[]>;
|
|
72
|
+
hover(uri: string, line: number, character: number, signal?: AbortSignal): Promise<LspHover | null>;
|
|
73
|
+
diagnostics(uri: string, signal?: AbortSignal): Promise<LspDiagnostic[]>;
|
|
71
74
|
}
|
|
72
75
|
export interface LspToolOptions {
|
|
73
76
|
manager?: LspManager;
|
package/dist/tools/runtime.d.ts
CHANGED
|
@@ -36,7 +36,8 @@ export interface ToolOutputOverflow {
|
|
|
36
36
|
preview: string;
|
|
37
37
|
originalChars: number;
|
|
38
38
|
previewChars: number;
|
|
39
|
-
savedTo
|
|
39
|
+
savedTo?: string;
|
|
40
|
+
storageError?: string;
|
|
40
41
|
}
|
|
41
42
|
export declare const DEFAULT_TOOL_OUTPUT_LIMITS: Readonly<ToolOutputLimits>;
|
|
42
43
|
export type ToolInputValidation = {
|
package/dist/tools/search.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare const GlobInput: z.ZodObject<{
|
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
declare const GrepInput: z.ZodObject<{
|
|
10
10
|
pattern: z.ZodString;
|
|
11
|
+
fixedStrings: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
11
12
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
13
|
glob: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
14
|
fileType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface JobToolPresentation {
|
|
|
77
77
|
}
|
|
78
78
|
export type ToolPresentation = ChangeSetPresentation | FileChangePresentation | GenericToolPresentation | TerminalToolPresentation | WebToolPresentation | JobToolPresentation;
|
|
79
79
|
export declare function withToolPresentation<T extends object>(output: T, presentation: ToolPresentation): T;
|
|
80
|
-
export declare function getToolPresentation(output: unknown):
|
|
80
|
+
export declare function getToolPresentation(output: unknown): ToolPresentation | undefined;
|
|
81
81
|
export interface ToolDefinition<T, O = unknown> {
|
|
82
82
|
name: string;
|
|
83
83
|
description: string;
|
|
@@ -4,6 +4,7 @@ export interface ExecFileNoThrowOptions {
|
|
|
4
4
|
env?: NodeJS.ProcessEnv;
|
|
5
5
|
stdin?: "ignore" | "inherit" | "pipe";
|
|
6
6
|
input?: string;
|
|
7
|
+
signal?: AbortSignal;
|
|
7
8
|
}
|
|
8
9
|
export declare function execFileNoThrow(file: string, args: string[], options?: ExecFileNoThrowOptions): Promise<{
|
|
9
10
|
stdout: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flavor-code",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.3",
|
|
4
4
|
"author": "YachuanWzh",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "npm run build:icons && npm run build:cli && npm run build:desktop",
|
|
33
33
|
"build:icons": "node scripts/build-icons.mjs",
|
|
34
|
-
"build:cli": "tsup && tsc -p tsconfig.sdk.json
|
|
34
|
+
"build:cli": "tsup && tsc -p tsconfig.sdk.json",
|
|
35
35
|
"build:desktop": "npm run build:desktop:main && npm run build:desktop:renderer",
|
|
36
36
|
"build:desktop:main": "tsup --config tsup.desktop.config.ts",
|
|
37
37
|
"build:desktop:renderer": "vite build --config vite.desktop.config.ts",
|
|
@@ -405,7 +405,7 @@ sequenceDiagram
|
|
|
405
405
|
U->>CLI: 输入 prompt
|
|
406
406
|
CLI->>L: submit(prompt, signal)
|
|
407
407
|
|
|
408
|
-
loop 每轮迭代(最多
|
|
408
|
+
loop 每轮迭代(最多 300 轮)
|
|
409
409
|
L->>C: prepareForModelCall()
|
|
410
410
|
C->>C: 微压缩(清理旧工具输出)
|
|
411
411
|
alt 仍超阈值
|
|
@@ -560,13 +560,13 @@ FlavorConfigSchema = {
|
|
|
560
560
|
},
|
|
561
561
|
language: "zh-CN", // BCP47 语言标签
|
|
562
562
|
maxIterations: {
|
|
563
|
-
main: 10-500, // 主 Agent 迭代上限(默认
|
|
564
|
-
subagent: 10-200, // 子 Agent 迭代上限(默认
|
|
563
|
+
main: 10-500, // 主 Agent 迭代上限(默认 300)
|
|
564
|
+
subagent: 10-200, // 子 Agent 迭代上限(默认 100)
|
|
565
565
|
softLimitFactor: 0.8, // 软限制比例
|
|
566
|
-
extendBy:
|
|
566
|
+
extendBy: 50 // 扩展步数
|
|
567
567
|
},
|
|
568
568
|
loop: {
|
|
569
|
-
maxCycles:
|
|
569
|
+
maxCycles: 100, // 每次用户授权增加的 cycle 数
|
|
570
570
|
maxTokens: 500_000, // 每次用户授权增加的模型 token 数
|
|
571
571
|
isolation: "auto" // 只读用当前目录;改代码自动用 worktree
|
|
572
572
|
},
|
|
@@ -749,8 +749,8 @@ flowchart TD
|
|
|
749
749
|
maxTokens = 5,000,000
|
|
750
750
|
5,000,000 → 确认 → 10,000,000 → 确认 → 15,000,000 → ...
|
|
751
751
|
|
|
752
|
-
maxCycles =
|
|
753
|
-
|
|
752
|
+
maxCycles = 100
|
|
753
|
+
100 → 确认 → 200 → 确认 → 300 → ...
|
|
754
754
|
```
|
|
755
755
|
|
|
756
756
|
token 统计包括 worker 的所有模型调用以及上下文压缩模型调用;本地 Shell 验证命令不计 token。用户拒绝产生 `budget_exhausted`;非交互模式无法确认时产生 `needs_human`。预算批准记录维度、旧/新 checkpoint、当时累计用量和时间戳。
|
package/dist/astgraph/db.mjs
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
// astgraph graph database — SQLite-backed node/edge graph (codegraph-inspired).
|
|
2
|
-
// Uses node:sqlite with WAL mode so concurrent readers never block on a writer.
|
|
3
|
-
|
|
4
|
-
import { mkdirSync } from "node:fs";
|
|
5
|
-
import { dirname } from "node:path";
|
|
6
|
-
import { DatabaseSync } from "node:sqlite";
|
|
7
|
-
|
|
8
|
-
const SCHEMA = `
|
|
9
|
-
CREATE TABLE IF NOT EXISTS schema_versions (
|
|
10
|
-
version INTEGER PRIMARY KEY,
|
|
11
|
-
applied_at INTEGER NOT NULL,
|
|
12
|
-
description TEXT
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
CREATE TABLE IF NOT EXISTS files (
|
|
16
|
-
path TEXT PRIMARY KEY,
|
|
17
|
-
content_hash TEXT NOT NULL,
|
|
18
|
-
language TEXT NOT NULL,
|
|
19
|
-
size INTEGER NOT NULL,
|
|
20
|
-
modified_at INTEGER NOT NULL DEFAULT 0,
|
|
21
|
-
indexed_at INTEGER NOT NULL DEFAULT 0,
|
|
22
|
-
node_count INTEGER NOT NULL DEFAULT 0
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
CREATE TABLE IF NOT EXISTS nodes (
|
|
26
|
-
id TEXT PRIMARY KEY,
|
|
27
|
-
kind TEXT NOT NULL,
|
|
28
|
-
name TEXT NOT NULL,
|
|
29
|
-
qualified_name TEXT NOT NULL,
|
|
30
|
-
file_path TEXT NOT NULL,
|
|
31
|
-
language TEXT NOT NULL,
|
|
32
|
-
start_line INTEGER NOT NULL,
|
|
33
|
-
end_line INTEGER NOT NULL,
|
|
34
|
-
signature TEXT,
|
|
35
|
-
docstring TEXT,
|
|
36
|
-
is_exported INTEGER NOT NULL DEFAULT 0,
|
|
37
|
-
is_async INTEGER NOT NULL DEFAULT 0
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
CREATE TABLE IF NOT EXISTS edges (
|
|
41
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
42
|
-
source TEXT NOT NULL,
|
|
43
|
-
target TEXT NOT NULL,
|
|
44
|
-
kind TEXT NOT NULL,
|
|
45
|
-
line INTEGER,
|
|
46
|
-
col INTEGER,
|
|
47
|
-
FOREIGN KEY (source) REFERENCES nodes(id) ON DELETE CASCADE,
|
|
48
|
-
FOREIGN KEY (target) REFERENCES nodes(id) ON DELETE CASCADE
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
CREATE TABLE IF NOT EXISTS unresolved_refs (
|
|
52
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
53
|
-
from_node_id TEXT,
|
|
54
|
-
reference_name TEXT NOT NULL,
|
|
55
|
-
reference_kind TEXT NOT NULL,
|
|
56
|
-
line INTEGER NOT NULL,
|
|
57
|
-
col INTEGER NOT NULL,
|
|
58
|
-
file_path TEXT NOT NULL DEFAULT '',
|
|
59
|
-
module_specifier TEXT,
|
|
60
|
-
status TEXT NOT NULL DEFAULT 'pending',
|
|
61
|
-
FOREIGN KEY (from_node_id) REFERENCES nodes(id) ON DELETE CASCADE
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
CREATE INDEX IF NOT EXISTS idx_nodes_name ON nodes(name);
|
|
65
|
-
CREATE INDEX IF NOT EXISTS idx_nodes_lower_name ON nodes(lower(name));
|
|
66
|
-
CREATE INDEX IF NOT EXISTS idx_nodes_file_path ON nodes(file_path);
|
|
67
|
-
CREATE INDEX IF NOT EXISTS idx_nodes_kind ON nodes(kind);
|
|
68
|
-
CREATE INDEX IF NOT EXISTS idx_edges_source_kind ON edges(source, kind);
|
|
69
|
-
CREATE INDEX IF NOT EXISTS idx_edges_target_kind ON edges(target, kind);
|
|
70
|
-
CREATE UNIQUE INDEX IF NOT EXISTS idx_edges_identity
|
|
71
|
-
ON edges(source, target, kind, IFNULL(line, -1), IFNULL(col, -1));
|
|
72
|
-
CREATE INDEX IF NOT EXISTS idx_unresolved_from ON unresolved_refs(from_node_id);
|
|
73
|
-
CREATE INDEX IF NOT EXISTS idx_unresolved_name ON unresolved_refs(reference_name);
|
|
74
|
-
|
|
75
|
-
CREATE VIRTUAL TABLE IF NOT EXISTS nodes_fts USING fts5(
|
|
76
|
-
name,
|
|
77
|
-
qualified_name,
|
|
78
|
-
signature,
|
|
79
|
-
docstring,
|
|
80
|
-
content='nodes',
|
|
81
|
-
content_rowid='rowid'
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
CREATE TRIGGER IF NOT EXISTS nodes_ai AFTER INSERT ON nodes BEGIN
|
|
85
|
-
INSERT INTO nodes_fts(rowid, name, qualified_name, signature, docstring)
|
|
86
|
-
VALUES (NEW.rowid, NEW.name, NEW.qualified_name, NEW.signature, NEW.docstring);
|
|
87
|
-
END;
|
|
88
|
-
|
|
89
|
-
CREATE TRIGGER IF NOT EXISTS nodes_ad AFTER DELETE ON nodes BEGIN
|
|
90
|
-
INSERT INTO nodes_fts(nodes_fts, rowid, name, qualified_name, signature, docstring)
|
|
91
|
-
VALUES ('delete', OLD.rowid, OLD.name, OLD.qualified_name, OLD.signature, OLD.docstring);
|
|
92
|
-
END;
|
|
93
|
-
|
|
94
|
-
CREATE TRIGGER IF NOT EXISTS nodes_au AFTER UPDATE ON nodes BEGIN
|
|
95
|
-
INSERT INTO nodes_fts(nodes_fts, rowid, name, qualified_name, signature, docstring)
|
|
96
|
-
VALUES ('delete', OLD.rowid, OLD.name, OLD.qualified_name, OLD.signature, OLD.docstring);
|
|
97
|
-
INSERT INTO nodes_fts(rowid, name, qualified_name, signature, docstring)
|
|
98
|
-
VALUES (NEW.rowid, NEW.name, NEW.qualified_name, NEW.signature, NEW.docstring);
|
|
99
|
-
END;
|
|
100
|
-
|
|
101
|
-
CREATE TABLE IF NOT EXISTS project_metadata (
|
|
102
|
-
key TEXT PRIMARY KEY,
|
|
103
|
-
value TEXT NOT NULL,
|
|
104
|
-
updated_at INTEGER NOT NULL
|
|
105
|
-
);
|
|
106
|
-
`;
|
|
107
|
-
|
|
108
|
-
/** Open (creating when absent) the graph database at `path`. Returns a DatabaseSync. */
|
|
109
|
-
export function openDb(path) {
|
|
110
|
-
if (path !== ":memory:") mkdirSync(dirname(path), { recursive: true });
|
|
111
|
-
const db = new DatabaseSync(path);
|
|
112
|
-
db.exec("PRAGMA journal_mode = WAL");
|
|
113
|
-
db.exec("PRAGMA foreign_keys = ON");
|
|
114
|
-
db.exec("PRAGMA synchronous = NORMAL");
|
|
115
|
-
db.exec(SCHEMA);
|
|
116
|
-
const version = db.prepare("SELECT COUNT(*) AS count FROM schema_versions").get();
|
|
117
|
-
if (version.count === 0) {
|
|
118
|
-
db.prepare("INSERT INTO schema_versions(version, applied_at, description) VALUES (?, ?, ?)")
|
|
119
|
-
.run(1, Date.now(), "Initial astgraph schema");
|
|
120
|
-
}
|
|
121
|
-
return db;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/** Insert or replace the tracking record for one source file. */
|
|
125
|
-
export function upsertFileRecord(db, record) {
|
|
126
|
-
db.prepare(`
|
|
127
|
-
INSERT INTO files(path, content_hash, language, size, modified_at, indexed_at, node_count)
|
|
128
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
129
|
-
ON CONFLICT(path) DO UPDATE SET
|
|
130
|
-
content_hash = excluded.content_hash,
|
|
131
|
-
language = excluded.language,
|
|
132
|
-
size = excluded.size,
|
|
133
|
-
modified_at = excluded.modified_at,
|
|
134
|
-
indexed_at = excluded.indexed_at,
|
|
135
|
-
node_count = excluded.node_count
|
|
136
|
-
`).run(
|
|
137
|
-
record.path, record.contentHash, record.language, record.size,
|
|
138
|
-
record.modifiedAt ?? Date.now(), record.indexedAt ?? Date.now(), record.nodeCount ?? 0,
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** Read the tracking record for one source file, or undefined when absent. */
|
|
143
|
-
export function getFileRecord(db, path) {
|
|
144
|
-
const row = db.prepare("SELECT * FROM files WHERE path = ?").get(path);
|
|
145
|
-
if (row === undefined) return undefined;
|
|
146
|
-
return {
|
|
147
|
-
path: row.path, contentHash: row.content_hash, language: row.language,
|
|
148
|
-
size: row.size, modifiedAt: row.modified_at, indexedAt: row.indexed_at,
|
|
149
|
-
nodeCount: row.node_count,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/** Delete a file record; nodes cascade (and with them edges + refs + FTS rows). */
|
|
154
|
-
export function deleteFileRecord(db, path) {
|
|
155
|
-
db.prepare("DELETE FROM nodes WHERE file_path = ?").run(path);
|
|
156
|
-
db.prepare("DELETE FROM files WHERE path = ?").run(path);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Replace every node belonging to a file. Runs inside one transaction; the FTS
|
|
161
|
-
* triggers keep nodes_fts in sync.
|
|
162
|
-
*/
|
|
163
|
-
export function replaceNodes(db, filePath, nodes) {
|
|
164
|
-
const insert = db.prepare(`
|
|
165
|
-
INSERT OR REPLACE INTO nodes(
|
|
166
|
-
id, kind, name, qualified_name, file_path, language,
|
|
167
|
-
start_line, end_line, signature, docstring, is_exported, is_async
|
|
168
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
169
|
-
`);
|
|
170
|
-
const clear = db.prepare("DELETE FROM nodes WHERE file_path = ?");
|
|
171
|
-
db.exec("BEGIN");
|
|
172
|
-
try {
|
|
173
|
-
clear.run(filePath);
|
|
174
|
-
for (const node of nodes) {
|
|
175
|
-
insert.run(
|
|
176
|
-
node.id, node.kind, node.name, node.qualifiedName, node.filePath, node.language,
|
|
177
|
-
node.startLine, node.endLine, node.signature ?? null, node.docstring ?? null,
|
|
178
|
-
node.isExported ? 1 : 0, node.isAsync ? 1 : 0,
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
db.exec("COMMIT");
|
|
182
|
-
} catch (error) {
|
|
183
|
-
db.exec("ROLLBACK");
|
|
184
|
-
throw error;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/** Insert one edge; duplicate (source, target, kind, line, col) rows are ignored. */
|
|
189
|
-
export function insertEdge(db, edge) {
|
|
190
|
-
db.prepare(`
|
|
191
|
-
INSERT OR IGNORE INTO edges(source, target, kind, line, col) VALUES (?, ?, ?, ?, ?)
|
|
192
|
-
`).run(edge.source, edge.target, edge.kind, edge.line ?? null, edge.col ?? null);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/** Delete every edge whose source OR target belongs to a file. */
|
|
196
|
-
export function deleteEdgesForFile(db, filePath) {
|
|
197
|
-
db.prepare(`
|
|
198
|
-
DELETE FROM edges WHERE source IN (SELECT id FROM nodes WHERE file_path = ?)
|
|
199
|
-
OR target IN (SELECT id FROM nodes WHERE file_path = ?)
|
|
200
|
-
`).run(filePath, filePath);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** Insert one unresolved cross-file reference (status 'pending'). */
|
|
204
|
-
export function insertUnresolvedRef(db, ref) {
|
|
205
|
-
db.prepare(`
|
|
206
|
-
INSERT INTO unresolved_refs(from_node_id, reference_name, reference_kind, line, col, file_path, module_specifier, status)
|
|
207
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, 'pending')
|
|
208
|
-
`).run(ref.fromNodeId, ref.referenceName, ref.referenceKind, ref.line, ref.col, ref.filePath, ref.moduleSpecifier ?? null);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/** Delete every unresolved reference originating from a file. */
|
|
212
|
-
export function deleteUnresolvedRefsForFile(db, filePath) {
|
|
213
|
-
db.prepare("DELETE FROM unresolved_refs WHERE file_path = ?").run(filePath);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/** Summary counters used by /ast status. */
|
|
217
|
-
export function stats(db) {
|
|
218
|
-
const files = db.prepare("SELECT COUNT(*) AS count FROM files").get().count;
|
|
219
|
-
const nodes = db.prepare("SELECT COUNT(*) AS count FROM nodes").get().count;
|
|
220
|
-
const edges = db.prepare("SELECT COUNT(*) AS count FROM edges").get().count;
|
|
221
|
-
const unresolved = db.prepare("SELECT COUNT(*) AS count FROM unresolved_refs WHERE status = 'pending'").get().count;
|
|
222
|
-
return { files, nodes, edges, unresolved };
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/** Store a provenance metadata value. */
|
|
226
|
-
export function setMetadata(db, key, value) {
|
|
227
|
-
db.prepare(`
|
|
228
|
-
INSERT INTO project_metadata(key, value, updated_at) VALUES (?, ?, ?)
|
|
229
|
-
ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at
|
|
230
|
-
`).run(key, value, Date.now());
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/** Read a provenance metadata value, or undefined when absent. */
|
|
234
|
-
export function getMetadata(db, key) {
|
|
235
|
-
const row = db.prepare("SELECT value FROM project_metadata WHERE key = ?").get(key);
|
|
236
|
-
return row?.value;
|
|
237
|
-
}
|