flavor-code 1.3.23 → 1.4.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +439 -434
  2. package/README.zh-CN.md +436 -431
  3. package/dist/agent/loop.d.ts +7 -2
  4. package/dist/{app-NTEUPJKJ.js → app-SMIB6P23.js} +82 -161
  5. package/dist/{chunk-Z62P4LL7.js → chunk-BYHO2CA5.js} +10412 -8712
  6. package/dist/{chunk-RPFWB45Y.js → chunk-EXOSMO57.js} +13 -8
  7. package/dist/chunk-N5MXHJKD.js +107 -0
  8. package/dist/{chunk-7OICVL2M.js → chunk-RAYH6K2H.js} +2 -44
  9. package/dist/{chunk-VEUSROUQ.js → chunk-UO4DLWU5.js} +8 -2
  10. package/dist/{chunk-SUSLIHXO.js → chunk-XMRKRPNC.js} +179 -14253
  11. package/dist/{chunk-RQTYHUMK.js → chunk-ZJCAQXA7.js} +17 -1
  12. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-6EZHF64C.js} +2 -3
  13. package/dist/cli-main.js +75 -28
  14. package/dist/cli.js +54 -10
  15. package/dist/config/load.d.ts +2 -0
  16. package/dist/config/schema.d.ts +8 -0
  17. package/dist/context/manager.d.ts +9 -0
  18. package/dist/desktop/main.js +3035 -1237
  19. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  20. package/dist/desktop-renderer/assets/index-RNe5Gtum.js +154 -0
  21. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-DestMQ2z.js} +1 -1
  22. package/dist/desktop-renderer/index.html +2 -2
  23. package/dist/doctor.d.ts +38 -0
  24. package/dist/execution/docker.d.ts +5 -1
  25. package/dist/execution/types.d.ts +11 -0
  26. package/dist/git/service.d.ts +3 -3
  27. package/dist/git/tools.d.ts +1 -1
  28. package/dist/goal/classifier.d.ts +2 -0
  29. package/dist/goal/orchestrator.d.ts +23 -2
  30. package/dist/goal/planner.d.ts +2 -0
  31. package/dist/goal/store.d.ts +2 -0
  32. package/dist/goal/types.d.ts +14 -0
  33. package/dist/harness/journal.d.ts +2 -0
  34. package/dist/harness/local.d.ts +2 -0
  35. package/dist/init/project.d.ts +0 -6
  36. package/dist/jobs/registry.d.ts +8 -1
  37. package/dist/{load-4FWNXE6F.js → load-EW56Q2MM.js} +1 -1
  38. package/dist/loop/orchestrator.d.ts +20 -0
  39. package/dist/loop/types.d.ts +7 -0
  40. package/dist/loop/verifier.d.ts +2 -0
  41. package/dist/models/openai.d.ts +1 -1
  42. package/dist/models/structured.d.ts +7 -0
  43. package/dist/models/types.d.ts +1 -1
  44. package/dist/production.d.ts +17 -0
  45. package/dist/sdk/index.js +5 -5
  46. package/dist/session/tree.d.ts +2 -0
  47. package/dist/tools/lsp.d.ts +15 -10
  48. package/dist/tools/runtime.d.ts +2 -1
  49. package/dist/tools/search.d.ts +1 -0
  50. package/dist/tools/shell.d.ts +17 -12
  51. package/dist/tools/types.d.ts +2 -1
  52. package/dist/ui/commands.d.ts +1 -1
  53. package/dist/ui/session.d.ts +12 -0
  54. package/dist/ui/transcript.d.ts +9 -0
  55. package/dist/update/check.d.ts +20 -0
  56. package/dist/utils/abort.d.ts +20 -0
  57. package/dist/utils/execFileNoThrow.d.ts +1 -0
  58. package/dist/utils/heap.d.ts +58 -0
  59. package/dist/utils/memory-restart.d.ts +42 -3
  60. package/dist/utils/process-tree.d.ts +2 -0
  61. package/dist/utils/rotation-census.d.ts +36 -0
  62. package/dist/utils/semver.d.ts +3 -0
  63. package/dist/utils/spawn-executable.d.ts +2 -0
  64. package/package.json +3 -2
  65. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  66. package/dist/astgraph/db.mjs +0 -237
  67. package/dist/astgraph/extract.mjs +0 -239
  68. package/dist/astgraph/flavor-plugin.json +0 -25
  69. package/dist/astgraph/grammars.mjs +0 -68
  70. package/dist/astgraph/index.js +0 -301
  71. package/dist/astgraph/indexer.mjs +0 -175
  72. package/dist/astgraph/query.mjs +0 -165
  73. package/dist/astgraph/resolve.mjs +0 -93
  74. package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
  75. package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
  76. package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
  77. package/dist/astgraph/vendor/tree-sitter.js +0 -3980
  78. package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
  79. package/dist/astgraph/vendor/zod/LICENSE +0 -21
  80. package/dist/astgraph/vendor/zod/index.js +0 -4
  81. package/dist/astgraph/vendor/zod/locales/index.js +0 -1
  82. package/dist/astgraph/vendor/zod/locales/package.json +0 -7
  83. package/dist/astgraph/vendor/zod/package.json +0 -135
  84. package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
  85. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
  86. package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
  87. package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
  88. package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
  89. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
  90. package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
  91. package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
  92. package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
  93. package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
  94. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
  95. package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
  96. package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
  97. package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
  98. package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
  99. package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
  100. package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
  101. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
  102. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
  103. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
  104. package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
  105. package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
  106. package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
  107. package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
  108. package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
  109. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
  110. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
  111. package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
  112. package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
  113. package/dist/astgraph/vendor/zod/v4/index.js +0 -3
  114. package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
  115. package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
  116. package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
  117. package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
  118. package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
  119. package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
  120. package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
  121. package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
  122. package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
  123. package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
  124. package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
  125. package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
  126. package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
  127. package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
  128. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
  129. package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
  130. package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
  131. package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
  132. package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
  133. package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
  134. package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
  135. package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
  136. package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
  137. package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
  138. package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
  139. package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
  140. package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
  141. package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
  142. package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
  143. package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
  144. package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
  145. package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
  146. package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
  147. package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
  148. package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
  149. package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
  150. package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
  151. package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
  152. package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
  153. package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
  154. package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
  155. package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
  156. package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
  157. package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
  158. package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
  159. package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
  160. package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
  161. package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
  162. package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
  163. package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
  164. package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
  165. package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
  166. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
  167. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
  168. package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
  169. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
  170. package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
  171. package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
  172. package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
  173. package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
  174. package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
  175. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
  176. package/dist/astgraph/vendor/zod/v4/package.json +0 -7
  177. package/dist/chunk-CIVPKHF4.js +0 -53
  178. package/dist/chunk-OTYFL4AG.js +0 -16
  179. package/dist/desktop-renderer/assets/index-D75ozXnZ.js +0 -154
  180. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
  181. package/dist/devtools-4QTPKBKK.js +0 -2
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,r as n,t as r}from"./index-D75ozXnZ.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-RNe5Gtum.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,8 +6,8 @@
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-D75ozXnZ.js"></script>
10
- <link rel="stylesheet" crossorigin href="./assets/index-ZZsUx916.css">
9
+ <script type="module" crossorigin src="./assets/index-RNe5Gtum.js"></script>
10
+ <link rel="stylesheet" crossorigin href="./assets/index-Bk6FYhyh.css">
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
@@ -0,0 +1,38 @@
1
+ import { loadConfig } from "./config/load.js";
2
+ import { fetchLatestVersion } from "./update/check.js";
3
+ export type DoctorStatus = "pass" | "warn" | "fail";
4
+ export interface DoctorCheck {
5
+ name: string;
6
+ status: DoctorStatus;
7
+ message: string;
8
+ }
9
+ export interface DoctorReport {
10
+ version: string;
11
+ platform: NodeJS.Platform | string;
12
+ arch: string;
13
+ workspace: string;
14
+ checks: DoctorCheck[];
15
+ summary: {
16
+ passed: number;
17
+ warnings: number;
18
+ failed: number;
19
+ };
20
+ ok: boolean;
21
+ }
22
+ export interface DoctorOptions {
23
+ workspace?: string;
24
+ home?: string;
25
+ environment?: NodeJS.ProcessEnv;
26
+ platform?: NodeJS.Platform | string;
27
+ arch?: string;
28
+ nodeVersion?: string;
29
+ registryTimeoutMs?: number;
30
+ }
31
+ export interface DoctorDependencies {
32
+ loadConfig?: typeof loadConfig;
33
+ fetchLatestVersion?: typeof fetchLatestVersion;
34
+ rgPath?: string;
35
+ probeShell?: (platform: NodeJS.Platform | string, environment: NodeJS.ProcessEnv) => Promise<string | undefined>;
36
+ }
37
+ export declare function runDoctor(options?: DoctorOptions, dependencies?: DoctorDependencies): Promise<DoctorReport>;
38
+ export declare function formatDoctorReport(report: DoctorReport): string;
@@ -17,7 +17,7 @@ export interface DockerExecutionEnvironmentOptions {
17
17
  network?: boolean;
18
18
  memory?: string;
19
19
  cpus?: number;
20
- run?(invocation: DockerInvocation, signal?: AbortSignal, timeoutMs?: number): Promise<ExecutionResult>;
20
+ run?(invocation: DockerInvocation, signal?: AbortSignal, timeoutMs?: number, maxOutputBytes?: number): Promise<ExecutionResult>;
21
21
  }
22
22
  export declare function buildDockerInvocation(options: DockerInvocationOptions): DockerInvocation;
23
23
  export declare class DockerExecutionEnvironment implements ExecutionEnvironment {
@@ -27,3 +27,7 @@ export declare class DockerExecutionEnvironment implements ExecutionEnvironment
27
27
  exec(request: ExecutionRequest, signal?: AbortSignal): Promise<ExecutionResult>;
28
28
  dispose(): Promise<void>;
29
29
  }
30
+ export declare function runDockerInvocation(invocation: {
31
+ command: string;
32
+ args: string[];
33
+ }, signal?: AbortSignal, timeoutMs?: number, maxOutputBytes?: number): Promise<ExecutionResult>;
@@ -3,6 +3,12 @@ export interface ExecutionRequest {
3
3
  args: readonly string[];
4
4
  cwd: string;
5
5
  timeoutMs?: number;
6
+ maxOutputBytes?: number;
7
+ }
8
+ export interface ExecutionTruncationMetadata {
9
+ truncated: boolean;
10
+ originalBytes: number;
11
+ limitBytes: number;
6
12
  }
7
13
  export interface ExecutionResult {
8
14
  exitCode: number | null;
@@ -10,6 +16,11 @@ export interface ExecutionResult {
10
16
  stdout: string;
11
17
  stderr: string;
12
18
  terminationReason: "timeout" | "cancelled" | null;
19
+ truncated?: boolean;
20
+ truncation?: {
21
+ stdout: ExecutionTruncationMetadata;
22
+ stderr: ExecutionTruncationMetadata;
23
+ };
13
24
  }
14
25
  export interface ExecutionEnvironment {
15
26
  readonly kind: "local" | "docker";
@@ -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>;
@@ -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.ZodNumber>;
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>;
@@ -6,6 +6,8 @@ export interface ClassifierOptions {
6
6
  skepticCount: number;
7
7
  workspace: string;
8
8
  signal?: AbortSignal;
9
+ /** Safe-point hook used by long-running hosts to rotate before OOM. */
10
+ onProgress?(): void | Promise<void>;
9
11
  }
10
12
  export declare function runClassifier(evidence: EvidencePacket, plan: Plan, options: ClassifierOptions): Promise<AggregatedOutcome>;
11
13
  export declare function computeFingerprint(gaps: Gap[]): string;
@@ -7,8 +7,11 @@ export interface GoalOrchestratorOptions {
7
7
  plannerModelId: string;
8
8
  classifierModelId: string;
9
9
  skepticCount: number;
10
- maxRounds: number;
11
- maxStallStreak: number;
10
+ /** Optional finite policies for embedded/test hosts. Production leaves these unset. */
11
+ maxRounds?: number;
12
+ maxStallStreak?: number;
13
+ /** Retry delay override for deterministic tests or an embedding host. */
14
+ stageRetryDelayMs?(attempt: number): number;
12
15
  runWorker(input: {
13
16
  goal: string;
14
17
  round: number;
@@ -21,7 +24,17 @@ export interface GoalOrchestratorOptions {
21
24
  idFactory?(): string;
22
25
  persistence?: {
23
26
  save(state: GoalState): Promise<void>;
27
+ /** Present when the store can reload a goal for resume after heap rotation. */
28
+ load?(goalId: string): Promise<GoalState>;
24
29
  };
30
+ /**
31
+ * Called at every round boundary (state persisted). Production uses it to
32
+ * rotate onto a fresh heap between rounds so multi-day goals never die on
33
+ * a grown heap; the relaunched process resumes the goal from its state.
34
+ */
35
+ onRoundBoundary?(goalId: string): void | Promise<void>;
36
+ /** Also sampled inside planner/classifier streams and around host verification. */
37
+ onMemoryCheckpoint?(goalId: string): void | Promise<void>;
25
38
  verifyHost?(signal: AbortSignal): Promise<HostVerificationEvidence>;
26
39
  }
27
40
  export declare class GoalOrchestrator {
@@ -32,4 +45,12 @@ export declare class GoalOrchestrator {
32
45
  goal: string;
33
46
  signal: AbortSignal;
34
47
  }): AsyncIterable<GoalRuntimeEvent>;
48
+ /**
49
+ * Continue a goal whose process rotated onto a fresh heap. The persisted
50
+ * state decides where to pick up; an interrupted round simply runs again.
51
+ */
52
+ resume(request: {
53
+ goalId: string;
54
+ signal: AbortSignal;
55
+ }): AsyncIterable<GoalRuntimeEvent>;
35
56
  }
@@ -5,5 +5,7 @@ export interface PlannerOptions {
5
5
  modelId: string;
6
6
  objective: string;
7
7
  signal?: AbortSignal;
8
+ /** Safe-point hook used by long-running hosts to rotate before OOM. */
9
+ onProgress?(): void | Promise<void>;
8
10
  }
9
11
  export declare function runPlanner(options: PlannerOptions): Promise<Plan>;
@@ -6,4 +6,6 @@ export declare class GoalStore {
6
6
  maxBytes?: number;
7
7
  });
8
8
  save(input: GoalState): Promise<void>;
9
+ /** Reload a persisted goal so a rotated process can resume it. */
10
+ load(goalId: string): Promise<GoalState>;
9
11
  }
@@ -146,6 +146,10 @@ export declare const GoalStateSchema: z.ZodObject<{
146
146
  planPath: z.ZodNullable<z.ZodString>;
147
147
  verifyRounds: z.ZodNumber;
148
148
  workerRounds: z.ZodNumber;
149
+ pendingVerification: z.ZodOptional<z.ZodNullable<z.ZodObject<{
150
+ round: z.ZodNumber;
151
+ finalResponse: z.ZodString;
152
+ }, z.core.$strict>>>;
149
153
  lastGaps: z.ZodArray<z.ZodObject<{
150
154
  criterion: z.ZodString;
151
155
  description: z.ZodString;
@@ -179,6 +183,16 @@ export declare const GoalStateSchema: z.ZodObject<{
179
183
  }, z.core.$strict>;
180
184
  export type GoalState = z.infer<typeof GoalStateSchema>;
181
185
  export type GoalRuntimeEvent = {
186
+ type: "goal-resumed";
187
+ goalId: string;
188
+ round: number;
189
+ } | {
190
+ type: "goal-stage-retry";
191
+ stage: "planning" | "classification";
192
+ attempt: number;
193
+ reason: string;
194
+ delayMs: number;
195
+ } | {
182
196
  type: "goal-plan-created";
183
197
  plan: Plan;
184
198
  planPath: string;
@@ -83,6 +83,8 @@ export declare class HarnessJournal {
83
83
  constructor(options: HarnessJournalOptions);
84
84
  get path(): string;
85
85
  get records(): readonly HarnessJournalRecord[];
86
+ /** Retained record count for the rotation census. */
87
+ get recordCount(): number;
86
88
  admitQueue<T>(kind: "steer" | "followUp", payload: T): string;
87
89
  claimQueue(id: string): void;
88
90
  ackQueue(id: string): void;
@@ -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. */
@@ -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>;
@@ -28,6 +28,7 @@ export interface JobHandle {
28
28
  append(text: string): void;
29
29
  complete(result?: {
30
30
  exitCode?: number | null;
31
+ error?: string;
31
32
  }): void;
32
33
  fail(error: unknown): void;
33
34
  cancel(): void;
@@ -41,8 +42,14 @@ export declare class JobRegistry {
41
42
  create(input: CreateJobInput): JobHandle;
42
43
  list(owner?: string): readonly JobSnapshot[];
43
44
  read(id: string, owner: string, cursor?: number): JobReadResult;
45
+ /** Retained sizes for the rotation census. */
46
+ census(): {
47
+ jobs: number;
48
+ running: number;
49
+ windowChars: number;
50
+ };
44
51
  wait(id: string, owner: string, signal?: AbortSignal): Promise<JobSnapshot>;
45
- kill(id: string, owner: string): void;
52
+ kill(id: string, owner: string): void | Promise<void>;
46
53
  subscribe(listener: (jobs: readonly JobSnapshot[]) => void): () => void;
47
54
  dispose(): Promise<void>;
48
55
  }
@@ -7,7 +7,7 @@ import {
7
7
  setProjectMcpServerDisabled,
8
8
  setProjectProviderConfig,
9
9
  setProjectSkillDisabled
10
- } from "./chunk-RPFWB45Y.js";
10
+ } from "./chunk-EXOSMO57.js";
11
11
  import "./chunk-S32JRDZK.js";
12
12
  export {
13
13
  loadConfig,
@@ -8,6 +8,8 @@ export interface LoopPersistence {
8
8
  create(state: LoopState): Promise<void>;
9
9
  save(state: LoopState): Promise<void>;
10
10
  append(event: LoopEvent): Promise<void>;
11
+ /** Present when the store can reload a loop for resume after heap rotation. */
12
+ load?(loopId: string): Promise<LoopState>;
11
13
  }
12
14
  export type LoopConfirmation = "approved" | "rejected" | "unavailable";
13
15
  export type LoopRuntimeEvent = {
@@ -67,8 +69,18 @@ export interface LoopOrchestratorOptions {
67
69
  runVerifier(plan: VerificationPlan, workspace: string, signal: AbortSignal): Promise<LoopVerificationEvidence>;
68
70
  confirmBudget(state: LoopState, dimensions: readonly BudgetDimension[], signal: AbortSignal): Promise<LoopConfirmation>;
69
71
  fingerprint(workspace: string): Promise<string>;
72
+ /**
73
+ * Called at every cycle boundary (state persisted). Production uses it to
74
+ * rotate onto a fresh heap between cycles so multi-day loops never die on
75
+ * a grown heap; the relaunched process resumes the loop from its state.
76
+ */
77
+ onCycleBoundary?(loopId: string): void | Promise<void>;
78
+ /** Also sampled around verification and confidence checks. */
79
+ onMemoryCheckpoint?(loopId: string): void | Promise<void>;
70
80
  /** Optional hallucination guard for confidence checks and retry monitoring. */
71
81
  hallucinationGuard?: HallucinationGuard;
82
+ /** Optional safety policy for hosts that want a finite no-progress stop. */
83
+ maxNoProgressCycles?: number | undefined;
72
84
  now?(): string;
73
85
  idFactory?(): string;
74
86
  }
@@ -79,4 +91,12 @@ export declare class LoopOrchestrator {
79
91
  goal: string;
80
92
  signal: AbortSignal;
81
93
  }): AsyncIterable<LoopRuntimeEvent>;
94
+ /**
95
+ * Continue a loop whose process rotated onto a fresh heap. The persisted
96
+ * state decides where to pick up; an interrupted cycle simply runs again.
97
+ */
98
+ resume(request: {
99
+ loopId: string;
100
+ signal: AbortSignal;
101
+ }): AsyncIterable<LoopRuntimeEvent>;
82
102
  }
@@ -118,6 +118,13 @@ export declare const LoopStateSchema: z.ZodObject<{
118
118
  summary: z.ZodString;
119
119
  }, z.core.$strict>;
120
120
  }, z.core.$strict>>;
121
+ pendingCycle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
122
+ cycle: z.ZodNumber;
123
+ startedAt: z.ZodString;
124
+ inputTokens: z.ZodNumber;
125
+ outputTokens: z.ZodNumber;
126
+ workerText: z.ZodString;
127
+ }, z.core.$strict>>>;
121
128
  terminalReason: z.ZodOptional<z.ZodString>;
122
129
  }, z.core.$strict>;
123
130
  export declare const LoopEventSchema: z.ZodObject<{
@@ -9,5 +9,7 @@ export interface VerificationPlan {
9
9
  commands: VerificationCommand[];
10
10
  needsHumanReason?: string;
11
11
  }
12
+ /** Verification state is retained across dozens of rounds; keep each stream evidential, not archival. */
13
+ export declare const MAX_PERSISTED_VERIFICATION_STREAM_BYTES = 1024;
12
14
  export declare function inferVerificationPlan(workspace: string): Promise<VerificationPlan>;
13
15
  export declare function runVerificationPlan(plan: VerificationPlan, workspace: string, signal: AbortSignal, executionEnvironment?: ExecutionEnvironment): Promise<LoopVerificationEvidence>;
@@ -14,7 +14,7 @@ export interface OpenAIModelAdapterOptions {
14
14
  /** Mirror the per-request cache breakdown to stderr. Defaults to FLAVOR_DEBUG_USAGE=1. File logging to usage.jsonl is always on. */
15
15
  debugUsage?: boolean;
16
16
  /** Reasoning effort requested from the Responses API; omitted when undefined. */
17
- thinkingEffort?: "low" | "medium" | "high";
17
+ thinkingEffort?: "minimal" | "low" | "medium" | "high" | "xhigh";
18
18
  }
19
19
  export declare class OpenAIModelAdapter implements ModelAdapter {
20
20
  #private;
@@ -80,6 +80,13 @@ export declare function strictJsonSchema(schema: z.ZodType<unknown>): Record<str
80
80
  export declare function jsonSchemaFromZod(schema: z.ZodType<unknown>): Record<string, unknown>;
81
81
  /** Recursively adapts an existing JSON Schema for providers that require strict function tools. */
82
82
  export declare function strictJsonSchemaObject(schema: Record<string, unknown>): Record<string, unknown>;
83
+ /**
84
+ * Normalize a function-tool schema to the JSON Schema subset accepted by the
85
+ * OpenAI Responses API and strict OpenAI-compatible gateways. Non-strict mode
86
+ * keeps open objects, but still removes unsupported annotations and keywords
87
+ * that providers validate before the model call starts.
88
+ */
89
+ export declare function openAIJsonSchemaObject(schema: Record<string, unknown>, strict: boolean): Record<string, unknown>;
83
90
  /**
84
91
  * Extract the first JSON object or array from free-form model text (plain JSON,
85
92
  * fenced ```json blocks, or JSON embedded in prose). Returns undefined when no
@@ -55,7 +55,7 @@ export interface ModelRequest {
55
55
  tools: ModelTool[];
56
56
  signal?: AbortSignal;
57
57
  }
58
- export type ProviderErrorCode = "authentication" | "rate_limit" | "context_overflow" | "output_limit" | "model_not_found" | "network" | "cancelled" | "invalid_tool_arguments" | "structured_output_error" | "unknown";
58
+ export type ProviderErrorCode = "authentication" | "rate_limit" | "context_overflow" | "output_limit" | "model_not_found" | "network" | "cancelled" | "invalid_request" | "invalid_tool_arguments" | "structured_output_error" | "unknown";
59
59
  export interface ProviderError {
60
60
  code: ProviderErrorCode;
61
61
  message: string;
@@ -4,6 +4,9 @@ import { type McpClientFactory } from "./mcp/client.js";
4
4
  import type { PermissionProfile, PermissionRequest } from "./permissions/engine.js";
5
5
  import { type PromptEnvironment } from "./prompts/system.js";
6
6
  import type { ApprovalDecision } from "./tools/runtime.js";
7
+ import { type MemoryRestartContinuation } from "./utils/memory-restart.js";
8
+ import { type HeapReading } from "./utils/heap.js";
9
+ import { type RotationCensusHolder } from "./utils/rotation-census.js";
7
10
  import { type FileWriteProposal } from "./tools/files.js";
8
11
  import type { ToolDefinition } from "./tools/types.js";
9
12
  import { FlavorSession, type SessionOutput, type SessionServices } from "./ui/session.js";
@@ -22,6 +25,11 @@ export interface ProductionRuntimeOptions {
22
25
  home?: string;
23
26
  environment?: NodeJS.ProcessEnv;
24
27
  output(event: SessionOutput): void;
28
+ /**
29
+ * Embedder-owned restart hook. CLI callers omit it and exit with code 75;
30
+ * desktop callers dispose and recreate the runtime around the saved session.
31
+ */
32
+ onMemoryRestartRequested?(sessionId: string): void;
25
33
  onApprovalChange?(): void;
26
34
  /** Called whenever the active registerTool-managed command set changes. */
27
35
  onToolsChange?(): void;
@@ -102,4 +110,13 @@ export declare class ApprovalBridge {
102
110
  resolve(decision: ApprovalDecision): void;
103
111
  }
104
112
  export declare function createProductionRuntime(options: ProductionRuntimeOptions): Promise<ProductionRuntime>;
113
+ export interface MemoryRestartRotation {
114
+ /** Set when a /loop or /goal must be resumed by the relaunched process. */
115
+ continuation?: MemoryRestartContinuation;
116
+ /** Heap reading captured at the decision point; drives census + snapshot. */
117
+ reading?: HeapReading;
118
+ /** Retention census holders reported by the major in-memory owners. */
119
+ holders?: Record<string, RotationCensusHolder>;
120
+ }
105
121
  export declare function runGoalSession(orchestrator: GoalOrchestrator, goal: string, signal: AbortSignal): AsyncIterable<AgentEvent>;
122
+ export declare function runResumeGoalSession(orchestrator: GoalOrchestrator, goalId: string, signal: AbortSignal): AsyncIterable<AgentEvent>;
package/dist/sdk/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  FlavorRpcServer,
5
5
  TraceRecordSchema,
6
6
  TraceRecorder
7
- } from "../chunk-VEUSROUQ.js";
7
+ } from "../chunk-UO4DLWU5.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-Z62P4LL7.js";
17
- import "../chunk-CIVPKHF4.js";
18
- import "../chunk-RPFWB45Y.js";
19
- import "../chunk-RQTYHUMK.js";
16
+ } from "../chunk-BYHO2CA5.js";
17
+ import "../chunk-N5MXHJKD.js";
18
+ import "../chunk-EXOSMO57.js";
19
+ import "../chunk-ZJCAQXA7.js";
20
20
  import "../chunk-S32JRDZK.js";
21
21
 
22
22
  // src/trace/replay.ts
@@ -20,6 +20,8 @@ export declare class SessionHistory {
20
20
  private constructor();
21
21
  static open(options: SessionHistoryOptions): Promise<SessionHistory>;
22
22
  get leafId(): string | null;
23
+ /** Cheap retained-node count for the rotation census (no cloning). */
24
+ get nodeCount(): number;
23
25
  tree(): readonly SessionTreeNode[];
24
26
  append(input: {
25
27
  prompt: string;
@@ -14,10 +14,13 @@ interface LspLocation {
14
14
  }
15
15
  interface LspHover {
16
16
  contents: {
17
- kind: string;
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,14 +67,16 @@ 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;
74
77
  onStatus?: (message: string) => void;
75
78
  }
76
79
  export declare function createLspTools(workspace: string, options?: LspToolOptions): ToolDefinition<unknown>[];
80
+ /** Find the nearest language project marker without escaping the Flavor workspace. */
81
+ export declare function findLanguageServerRoot(filePath: string, workspace: string, rootFiles: readonly string[]): string | undefined;
77
82
  export {};
@@ -36,7 +36,8 @@ export interface ToolOutputOverflow {
36
36
  preview: string;
37
37
  originalChars: number;
38
38
  previewChars: number;
39
- savedTo: string;
39
+ savedTo?: string;
40
+ storageError?: string;
40
41
  }
41
42
  export declare const DEFAULT_TOOL_OUTPUT_LIMITS: Readonly<ToolOutputLimits>;
42
43
  export type ToolInputValidation = {
@@ -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<{