mycode-cli 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mycode/cli/render.py +4 -0
- mycode/core/system_prompt.py +16 -11
- mycode/server/static/assets/{EditDiff-BAqtlKnI.js → EditDiff-BCA9aTUr.js} +1 -1
- mycode/server/static/assets/{index-CY827G4K.js → index-C8gu4B-1.js} +2 -2
- mycode/server/static/index.html +1 -1
- {mycode_cli-0.3.2.dist-info → mycode_cli-0.3.4.dist-info}/METADATA +1 -1
- {mycode_cli-0.3.2.dist-info → mycode_cli-0.3.4.dist-info}/RECORD +10 -10
- {mycode_cli-0.3.2.dist-info → mycode_cli-0.3.4.dist-info}/WHEEL +0 -0
- {mycode_cli-0.3.2.dist-info → mycode_cli-0.3.4.dist-info}/entry_points.txt +0 -0
- {mycode_cli-0.3.2.dist-info → mycode_cli-0.3.4.dist-info}/licenses/LICENSE +0 -0
mycode/cli/render.py
CHANGED
|
@@ -669,7 +669,11 @@ class ReplyRenderer:
|
|
|
669
669
|
self._thinking_collapsed = True
|
|
670
670
|
|
|
671
671
|
if self._live is not None:
|
|
672
|
+
# Rich's stop() refreshes the last renderable once more before
|
|
673
|
+
# restoring the cursor. Blank it first so a final spinner frame
|
|
674
|
+
# can't get stranded in terminals that occasionally miss the clear.
|
|
672
675
|
self._live.transient = True
|
|
676
|
+
self._live.update(Text(""))
|
|
673
677
|
self._live.stop()
|
|
674
678
|
self._live = None
|
|
675
679
|
|
mycode/core/system_prompt.py
CHANGED
|
@@ -13,6 +13,7 @@ import logging
|
|
|
13
13
|
import re
|
|
14
14
|
from collections import deque
|
|
15
15
|
from dataclasses import dataclass
|
|
16
|
+
from datetime import date
|
|
16
17
|
from pathlib import Path
|
|
17
18
|
|
|
18
19
|
import yaml
|
|
@@ -35,9 +36,8 @@ You have four tools: read, write, edit, bash.
|
|
|
35
36
|
- Use bash for file operations and exploration like `ls`, `find`, `rg`, etc.
|
|
36
37
|
- Always set offset/limit when reading large files.
|
|
37
38
|
- Always read files before editing them.
|
|
38
|
-
- Use write only for new files or complete rewrites
|
|
39
|
-
- Your response should be concise and relevant
|
|
40
|
-
- When available skills match the current task, prefer them over manual alternatives. To use a skill: read its `SKILL.md`, then follow the instructions inside.\
|
|
39
|
+
- Use write only for new files or complete rewrites.
|
|
40
|
+
- Your response should be concise and relevant.\
|
|
41
41
|
"""
|
|
42
42
|
|
|
43
43
|
|
|
@@ -62,7 +62,7 @@ def build_system_prompt(cwd: str, settings: Settings | None = None) -> str:
|
|
|
62
62
|
if skills_prompt:
|
|
63
63
|
parts.append(skills_prompt)
|
|
64
64
|
|
|
65
|
-
parts.append(f"Current working directory: {resolved_cwd}")
|
|
65
|
+
parts.append(f"Current working directory: {resolved_cwd}\nCurrent date: {date.today().strftime('%Y-%m')}")
|
|
66
66
|
return "\n\n".join(parts)
|
|
67
67
|
|
|
68
68
|
|
|
@@ -108,7 +108,7 @@ def load_instructions_prompt(cwd: str, settings: Settings | None = None) -> str:
|
|
|
108
108
|
continue
|
|
109
109
|
|
|
110
110
|
if text:
|
|
111
|
-
sections.append(f"
|
|
111
|
+
sections.append(f"Instructions from: {path}\n{text}")
|
|
112
112
|
|
|
113
113
|
if not sections:
|
|
114
114
|
return ""
|
|
@@ -116,7 +116,7 @@ def load_instructions_prompt(cwd: str, settings: Settings | None = None) -> str:
|
|
|
116
116
|
return "\n".join(
|
|
117
117
|
[
|
|
118
118
|
"<workspace_instructions>",
|
|
119
|
-
"
|
|
119
|
+
"Ordered from global to project; later instructions take precedence.",
|
|
120
120
|
"",
|
|
121
121
|
"\n\n".join(sections),
|
|
122
122
|
"</workspace_instructions>",
|
|
@@ -308,12 +308,17 @@ def format_skills_for_prompt(skills: list[Skill]) -> str:
|
|
|
308
308
|
if not skills:
|
|
309
309
|
return ""
|
|
310
310
|
|
|
311
|
-
lines = [
|
|
311
|
+
lines = [
|
|
312
|
+
"When a task matches a skill's description, prefer it over manual alternatives — use the read tool to load the file at <location> and follow the instructions inside.",
|
|
313
|
+
"Relative paths inside a skill file resolve against the skill's directory (dirname of <location>).",
|
|
314
|
+
"<available_skills>",
|
|
315
|
+
]
|
|
312
316
|
for skill in skills:
|
|
313
|
-
lines.append(
|
|
314
|
-
lines.append(f"
|
|
315
|
-
lines.append(f"
|
|
316
|
-
lines.append("")
|
|
317
|
+
lines.append(" <skill>")
|
|
318
|
+
lines.append(f" <name>{skill.name}</name>")
|
|
319
|
+
lines.append(f" <description>{skill.description}</description>")
|
|
320
|
+
lines.append(f" <location>{skill.path}</location>")
|
|
321
|
+
lines.append(" </skill>")
|
|
317
322
|
lines.append("</available_skills>")
|
|
318
323
|
return "\n".join(lines)
|
|
319
324
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as N,h as D,a as _,l as O,j as y,c as q,S as A}from"./index-
|
|
1
|
+
import{r as N,h as D,a as _,l as O,j as y,c as q,S as A}from"./index-C8gu4B-1.js";class R{diff(e,n,t={}){let l;typeof t=="function"?(l=t,t={}):"callback"in t&&(l=t.callback);const o=this.castInput(e,t),i=this.castInput(n,t),a=this.removeEmpty(this.tokenize(o,t)),s=this.removeEmpty(this.tokenize(i,t));return this.diffWithOptionsObj(a,s,t,l)}diffWithOptionsObj(e,n,t,l){var o;const i=m=>{if(m=this.postProcess(m,t),l){setTimeout(function(){l(m)},0);return}else return m},a=n.length,s=e.length;let r=1,d=a+s;t.maxEditLength!=null&&(d=Math.min(d,t.maxEditLength));const h=(o=t.timeout)!==null&&o!==void 0?o:1/0,x=Date.now()+h,f=[{oldPos:-1,lastComponent:void 0}];let p=this.extractCommon(f[0],n,e,0,t);if(f[0].oldPos+1>=s&&p+1>=a)return i(this.buildValues(f[0].lastComponent,n,e));let g=-1/0,P=1/0;const T=()=>{for(let m=Math.max(g,-r);m<=Math.min(P,r);m+=2){let v;const L=f[m-1],j=f[m+1];L&&(f[m-1]=void 0);let u=!1;if(j){const k=j.oldPos-m;u=j&&0<=k&&k<a}const w=L&&L.oldPos+1<s;if(!u&&!w){f[m]=void 0;continue}if(!w||u&&L.oldPos<j.oldPos?v=this.addToPath(j,!0,!1,0,t):v=this.addToPath(L,!1,!0,1,t),p=this.extractCommon(v,n,e,m,t),v.oldPos+1>=s&&p+1>=a)return i(this.buildValues(v.lastComponent,n,e))||!0;f[m]=v,v.oldPos+1>=s&&(P=Math.min(P,m-1)),p+1>=a&&(g=Math.max(g,m+1))}r++};if(l)(function m(){setTimeout(function(){if(r>d||Date.now()>x)return l(void 0);T()||m()},0)})();else for(;r<=d&&Date.now()<=x;){const m=T();if(m)return m}}addToPath(e,n,t,l,o){const i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===n&&i.removed===t?{oldPos:e.oldPos+l,lastComponent:{count:i.count+1,added:n,removed:t,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+l,lastComponent:{count:1,added:n,removed:t,previousComponent:i}}}extractCommon(e,n,t,l,o){const i=n.length,a=t.length;let s=e.oldPos,r=s-l,d=0;for(;r+1<i&&s+1<a&&this.equals(t[s+1],n[r+1],o);)r++,s++,d++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!o.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,r}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){const l=[];let o;for(;e;)l.push(e),o=e.previousComponent,delete e.previousComponent,e=o;l.reverse();const i=l.length;let a=0,s=0,r=0;for(;a<i;a++){const d=l[a];if(d.removed)d.value=this.join(t.slice(r,r+d.count)),r+=d.count;else{if(!d.added&&this.useLongestToken){let h=n.slice(s,s+d.count);h=h.map(function(x,f){const p=t[r+f];return p.length>x.length?p:x}),d.value=this.join(h)}else d.value=this.join(n.slice(s,s+d.count));s+=d.count,d.added||(r+=d.count)}}return l}}class z extends R{constructor(){super(...arguments),this.tokenize=V}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
2
2
|
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
3
3
|
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
4
4
|
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
@@ -453,10 +453,10 @@ XID_Start XIDS`.split(/\s/).map(e=>[Oc(e),e])),II=new Map([["s",sn(383)],[sn(383
|
|
|
453
453
|
]`:`(?>\r
|
|
454
454
|
?|[
|
|
455
455
|
\v\f
\u2028\u2029])`),t));else if(f==="posix")if(!l&&(m==="graph"||m==="print")){if(r==="strict")throw new Error(`POSIX class "${m}" requires min target ES2024 or non-strict accuracy`);let g={graph:"!-~",print:" -~"}[m];d&&(g=`\0-${sn(g.codePointAt(0)-1)}${sn(g.codePointAt(2)+1)}-`),n(Ft(di(`[${g}]`),t))}else n(Ft(nm(di(qI.get(m)),d),t));else if(f==="property")bp.has(Oc(m))||(e.key="sc");else if(f==="space")n(ta(ql("space",{negate:d}),t));else if(f==="word")n(Ft(nm(di(hi),d),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:l,removeAllPrevSiblings:s,removeAllNextSiblings:u}){const{kind:c,flags:f}=e;if(c==="flags")if(!f.enable&&!f.disable)r();else{const d=Rr({flags:f});d.body[0].body=u(),l(Ft(d,t),{traverse:!0})}else if(c==="keep"){const d=n.body[0],g=n.body.length===1&&s8(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(Ve`Uses "\K" in a way that's unsupported`);const b=ja({behind:!0});b.body[0].body=s(),l(Ft(b,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(Ft(ja({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Rr();t.body[0].body.push(e.body),e.body=Ft(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,l=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const u=S8(s.body);u?(r=!0,Array.isArray(u)?n.push(...u):n.push(u)):l=!0}r&&!l&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Ve`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!tm(n)&&(n=em(n,t),e.ref=n)}},VI={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:l}=e;r||n.set(e,[...t.get(l).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:l,groupsByName:s,multiplexCapturesToLeftByRef:u,openRefs:c,reffedNodesByReferencer:f}){const d=l.get(e);if(d&&c.has(e.number)){const g=ta(s6(e.number),t);f.set(g,c.get(e.number)),n(g);return}c.set(e.number,e),u.set(e.number,[]),e.name&&ko(u,e.name,[]);const m=u.get(e.name??e.number);for(let g=0;g<m.length;g++){const b=m[g];if(d===b.node||d&&d===b.origin||e===b.origin){m.splice(g,1);break}}if(u.get(e.number).push({node:e,origin:d}),e.name&&u.get(e.name).push({node:e,origin:d}),e.name){const g=ko(s,e.name,new Map);let b=!1;if(d)b=!0;else for(const v of g.values())if(!v.hasDuplicateNameToRemove){b=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:b})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ec(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:l,ref:s}=e;if(l){let m=t;for(;(m=m.parent)&&!(m.type==="CapturingGroup"&&(m.name===s||m.number===s)););r.reffedNodesByReferencer.set(e,m);return}const u=r.subroutineRefMap.get(s),c=s===0,f=c?s6(0):x8(u,r.groupOriginByCopy,null);let d=f;if(!c){const m=w8(YI(u,b=>b.type==="Group"&&!!b.flags)),g=m?ec(r.globalFlags,m):r.globalFlags;FI(g,r.currentFlags)||(d=Rr({flags:XI(g)}),d.body[0].body.push(f))}n(Ft(d,t),{traverse:!c})}},GI={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(u=>$I(u,e));if(!s.length)n(Ft(ja({negate:!0}),t));else if(s.length>1){const u=Rr({atomic:!0,body:s.reverse().map(c=>Ua({body:[s1(c.number)]}))});n(Ft(u,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const l=u8();e.body.at(-1).body.push(l)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function b8(e){mo(e,{"*"({node:t,parent:n}){t.parent=n}})}function FI(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function $I(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=_8(n.parent);for(const l of r){if(l===n)break;if(l===e||k8(l,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function x8(e,t,n,r){const l=Array.isArray(e)?[]:{};for(const[s,u]of Object.entries(e))s==="parent"?l.parent=Array.isArray(n)?r:n:u&&typeof u=="object"?l[s]=x8(u,t,l,n):(s==="type"&&u==="CapturingGroup"&&t.set(l,t.get(e)??e),l[s]=u);return l}function s6(e){const t=f8(e);return t.isRecursive=!0,t}function YI(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function em(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function w8(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(l=>{r.enable?.[l]&&(delete n.disable[l],n.enable[l]=!0),r.disable?.[l]&&(n.disable[l]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function XI({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function _8(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function S8(e){const t=e.find(n=>n.kind==="search_start"||KI(n,{negate:!1})||!QI(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const l=S8(r.body);if(!l)return null;Array.isArray(l)?n.push(...l):n.push(l)}return n}return null}function k8(e,t){const n=_8(e)??[];for(const r of n)if(r===t||k8(r,t))return!0;return!1}function QI({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function ZI(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function KI(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&s8(e.body[0],{type:"Assertion",kind:"search_start"})}function tm(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function di(e,t){const r=o8(e,{...t,unicodePropertyMap:bp}).body;return r.length>1||r[0].body.length>1?Rr({body:r}):r[0].body[0]}function nm(e,t){return e.negate=t,e}function ta(e,t){return e.parent=t,e}function Ft(e,t){return b8(e),e.parent=t,e}function WI(e,t){const n=g8(t),r=c1(n.target,"ES2024"),l=c1(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let u=null,c=null;if(!l){const v=[e.flags.ignoreCase];mo(e,JI,{getCurrentModI:()=>v.at(-1),popModI(){v.pop()},pushModI(_){v.push(_)},setHasCasedChar(){v.at(-1)?u=!0:c=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||u)&&!c)};let d=e;const m={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!l&&u&&c),useFlagMods:l,useFlagV:r,verbose:n.verbose};function g(v){return m.lastNode=d,d=v,OI(eB[v.type],`Unexpected node type "${v.type}"`)(v,m,g)}const b={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return r||(delete b.options.force.v,b.options.disable.v=!0,b.options.unicodeSetsPlugin=null),b._captureTransfers=new Map,b._hiddenCaptures=[],m.captureMap.forEach((v,_)=>{v.hidden&&b._hiddenCaptures.push(_),v.transferTo&&ko(b._captureTransfers,v.transferTo,[]).push(_)}),b}var JI={"*":{enter({node:e},t){if(u6(e)){const n=t.getCurrentModI();t.pushModI(e.flags?ec({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){u6(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){xp(sn(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),E8(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&v8.has(e.value)&&t.setHasCasedChar()}},eB={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ve`\B`:Ve`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:l,number:s}=e,u={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(u.hidden=!0,s>c.number&&(u.transferTo=c.number)),t.captureMap.set(s,u),`(${l?`?<${l}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=sn(e),r=Il(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&xp(n)){const l=y8(n);return t.inCharClass?l.join(""):l.length>1?`[${l.join("")}]`:l[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:l,parent:s}=e;let{body:u}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Dr.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&u.some(c6)&&(u=[Dc(45),...u.filter(d=>!c6(d))]);const c=()=>`[${l?"^":""}${u.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Dr.bugNestedClassIgnoresNegation)&&!l){const m=u.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(m.length){const g=Rr(),b=g.body[0];return g.parent=s,b.parent=g,u=u.filter(v=>!m.includes(v)),e.body=u,u.length?(e.parent=b,b.body.push(e)):g.body.pop(),m.forEach(v=>{const _=Ua({body:[v]});v.parent=_,_.parent=g,g.body.push(_)}),n(g)}}t.inCharClass=!0;const d=c();return t.inCharClass=!1,d}const f=u[0];if(r==="union"&&!l&&f&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Dr.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&u.length===1&&f.type!=="CharacterClassRange"))return u.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,l={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Il(n,l),u=Il(r,l),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=E8(e);aB(f).forEach(m=>{c.add(Array.isArray(m)?`${Il(m[0],l)}-${Il(m[1],l)}`:Il(m,l))})}return`${s}-${u}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},l){if(e==="dot")return l.currentFlags.dotAll?l.appliedGlobalFlags.dotAll||l.useFlagMods?".":"[^]":Ve`[^\n]`;if(e==="digit")return t?Ve`\D`:Ve`\d`;if(e==="property"){if(l.useAppliedIgnoreCase&&l.currentFlags.ignoreCase&&v8.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ve`\P`:Ve`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Ve`\W`:Ve`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},l,s){const u=l.currentFlags;n&&(l.currentFlags=ec(u,n));const c=t.map(s).join("|"),f=!l.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!l.useFlagMods||!n)?c:`(?${lB(e,n,l.useFlagMods)}${c})`;return l.currentFlags=u,f},LookaroundAssertion({body:e,kind:t,negate:n},r,l){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(l).join("|")})`},Quantifier(e,t,n){return n(e.body)+sB(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Ve`\g<${t}&R=${r}>`}},tB=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),nB=new Set(["-","\\","]","^","["]),rB=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),o6=new Map([[9,Ve`\t`],[10,Ve`\n`],[11,Ve`\v`],[12,Ve`\f`],[13,Ve`\r`],[8232,Ve`\u2028`],[8233,Ve`\u2029`],[65279,Ve`\uFEFF`]]),iB=new RegExp("^\\p{Cased}$","u");function xp(e){return iB.test(e)}function E8(e,t){const n=!!t?.firstOnly,r=e.min.value,l=e.max.value,s=[];if(r<65&&(l===65535||l>=131071)||r===65536&&l>=131071)return s;for(let u=r;u<=l;u++){const c=sn(u);if(!xp(c))continue;const f=y8(c).filter(d=>{const m=d.codePointAt(0);return m<r||m>l});if(f.length&&(s.push(...f),n))break}return s}function Il(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(o6.has(e))return o6.get(e);if(e<32||e>126&&e<160||e>262143||t&&oB(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const l=n?r?rB:nB:tB,s=sn(e);return(l.has(s)?"\\":"")+s}function aB(e){const t=e.map(l=>l.codePointAt(0)).sort((l,s)=>l-s),n=[];let r=null;for(let l=0;l<t.length;l++)t[l+1]===t[l]+1?r??=t[l]:r===null?n.push(t[l]):(n.push([r,t[l]]),r=null);return n}function lB(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:l,disable:s}=t;r=(l?.ignoreCase?"i":"")+(l?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function sB({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function u6({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function oB(e){return e>47&&e<58}function c6({type:e,value:t}){return e==="Character"&&t===45}var uB=class f1 extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const l=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#r=s.source,s instanceof f1&&(this.#t=s.#t,this.#n=s.#n,this.#i=s.#i,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(l?"":t,n),this.#r=t,this.#t=fB(s.hiddenCaptures,s.transfers),this.#i=s.strategy,this.rawOptions=r??{}}l||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:l,...s}=this.rawOptions;this.#e=new f1(this.#r,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#i==="clip_search"&&n&&r){this.lastIndex=0;const l=this.#a(t.slice(r));return l&&(cB(l,r,t,this.hasIndices),this.lastIndex+=r),l}return this.#a(t)}#a(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let l;this.hasIndices&&(l=[...n.indices],n.indices.length=1);const s=[0];for(let u=1;u<r.length;u++){const{hidden:c,transferTo:f}=this.#t.get(u)??{};if(c?s.push(null):(s.push(n.length),n.push(r[u]),this.hasIndices&&n.indices.push(l[u])),f&&r[u]!==void 0){const d=s[f];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=r[u],this.hasIndices&&(n.indices[d]=l[u]),n.groups){this.#n||(this.#n=hB(this.source));const m=this.#n.get(f);m&&(n.groups[m]=r[u],this.hasIndices&&(n.indices.groups[m]=l[u]))}}}return n}};function cB(e,t,n,r){if(e.index+=t,e.input=n,r){const l=e.indices;for(let u=0;u<l.length;u++){const c=l[u];c&&(l[u]=[c[0]+t,c[1]+t])}const s=l.groups;s&&Object.keys(s).forEach(u=>{const c=s[u];c&&(s[u]=[c[0]+t,c[1]+t])})}}function fB(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,l]of t)for(const s of l)ko(n,s,{}).transferTo=r;return n}function hB(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,l=0,s;for(;s=t.exec(e);){const{0:u,groups:{capture:c,name:f}}=s;u==="["?r++:r?u==="]"&&r--:c&&(l++,f&&n.set(l,f))}return n}function dB(e,t){const n=mB(e,t);return n.options?new uB(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function mB(e,t){const n=g8(t),r=o8(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:bp}),l=PI(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=WI(l,n),u=MI(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),c=CI(u.pattern),f=TI(c.pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),d={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const m=f.hiddenCaptures.sort((_,E)=>_-E),g=Array.from(f.captureTransfers),b=l._strategy,v=d.pattern.length>=n.lazyCompileLength;(m.length||g.length||b||v)&&(d.options={...m.length&&{hiddenCaptures:m},...g.length&&{transfers:g},...b&&{strategy:b},...v&&{lazyCompile:v}})}return d}function A8(e,t){return dB(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function T8(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>A8(n,{target:t.target}),{createScanner(n){return new DL(n,t)},createString(n){return{content:n}}}}var pB=ip({bundledLanguages:()=>_c,bundledLanguagesAlias:()=>lp,bundledLanguagesBase:()=>ap,bundledLanguagesInfo:()=>wc,bundledThemes:()=>op,bundledThemesInfo:()=>sp,codeToHast:()=>Zb,codeToHtml:()=>Qb,codeToTokens:()=>Kb,codeToTokensBase:()=>Wb,codeToTokensWithThemes:()=>Jb,createHighlighter:()=>Mc,createJavaScriptRegexEngine:()=>T8,createOnigurumaEngine:()=>pb,defaultJavaScriptRegexConstructor:()=>A8,getLastGrammarState:()=>t8,getSingletonHighlighter:()=>e8,loadWasm:()=>cp});hb(pB,ML);let C8=null;const gB={"c#":"csharp","c++":"cpp",golang:"go",md:"markdown",plaintext:"text",py:"python",rb:"ruby",rs:"rust",sh:"bash",text:"text",ts:"typescript",yml:"yaml"},jj=Mc({themes:["dark-plus","light-plus"],langs:["javascript","typescript","python","json","bash","html","css","jsx","tsx"],engine:T8()}).then(e=>(C8=e,e));function yB(){return C8}const S0=new Map;function R8(e){const t=String(e||"").trim().toLowerCase();if(!t)return"text";const n=gB[t]||t;return Object.hasOwn(_c,n)?n:"text"}function vB(e,t){const n=R8(t);if(n==="text")return Promise.resolve("text");if(e.getLoadedLanguages().includes(n))return Promise.resolve(n);if(!S0.has(n))try{S0.set(n,Promise.resolve(e.loadLanguage(n)).then(()=>n).catch(()=>(S0.delete(n),"text")))}catch{return Promise.resolve("text")}return S0.get(n)??Promise.resolve("text")}function bB(e,t,n){try{return e.codeToHtml(t,n)}catch{return null}}const xB={themes:{dark:"dark-plus",light:"light-plus"},defaultColor:!1},rm={margin:0,padding:0,fontFamily:'"DM Mono", "JetBrains Mono", monospace',fontSize:"13px",lineHeight:"1.5",fontWeight:400};function wB({code:e,language:t}){const n=yB(),r=R8(t),s=n?.getLoadedLanguages()?.includes(r)?r:"text",[u,c]=ne.useState(s);if(ne.useEffect(()=>{if(!n)return;const d=n.getLoadedLanguages().includes(r)?r:"text";if(c(g=>g===d?g:d),d!=="text"||r==="text")return;let m=!1;return vB(n,r).then(g=>{m||g==="text"||ne.startTransition(()=>{c(b=>b===g?b:g)})}),()=>{m=!0}},[n,r]),!n)return z.jsx("pre",{style:rm,children:z.jsx("code",{children:e})});const f=bB(n,e,{lang:u,...xB});return f?z.jsx("div",{className:"shiki-wrapper",style:rm,dangerouslySetInnerHTML:{__html:f}}):z.jsx("pre",{style:rm,children:z.jsx("code",{children:e})})}const _B=/language-([a-z0-9+#-]+)/i;function SB({className:e,children:t,...n}){const[r,l]=ne.useState(!1),s=ne.useRef(null),u=_B.exec(e||""),c=u?.[1]??"",f=Array.isArray(t)?t.join(""):String(t||""),d=f.replace(/\n$/,""),m=!u&&!f.endsWith(`
|
|
456
|
-
`);ne.useEffect(()=>()=>{s.current!==null&&window.clearTimeout(s.current)},[]);const g=async()=>{try{await t7(d),l(!0),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{l(!1),s.current=null},2e3)}catch{}};return m?z.jsx("code",{className:dt("px-1.5 py-0.5 rounded bg-code font-mono text-[13px] text-accent font-medium",e),...n,children:t}):z.jsxs("div",{"data-code-block":!0,className:"group/code relative my-3 rounded-md bg-code
|
|
456
|
+
`);ne.useEffect(()=>()=>{s.current!==null&&window.clearTimeout(s.current)},[]);const g=async()=>{try{await t7(d),l(!0),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{l(!1),s.current=null},2e3)}catch{}};return m?z.jsx("code",{className:dt("px-1.5 py-0.5 rounded bg-code font-mono text-[13px] text-accent font-medium",e),...n,children:t}):z.jsxs("div",{"data-code-block":!0,className:"group/code relative my-3 rounded-md bg-code",children:[c&&z.jsx("span",{className:"absolute top-1.5 left-3 text-[11px] font-mono text-muted-foreground/50 uppercase tracking-wider select-none pointer-events-none z-10",children:c}),z.jsx("button",{type:"button","aria-label":"Copy code",onClick:g,className:dt("absolute top-1 right-1 z-10 flex items-center justify-center h-7 w-7 rounded-md transition duration-150",r?"text-emerald-400 opacity-100":"text-muted-foreground/40 max-md:opacity-60 opacity-0 group-hover/code:opacity-100 hover:text-foreground/60 hover:bg-muted/20"),title:"Copy",children:r?z.jsx(p1,{className:"h-3.5 w-3.5"}):z.jsx(B6,{className:"h-3.5 w-3.5"})}),z.jsx("div",{className:"overflow-x-auto scrollbar-subtle",children:z.jsx("div",{className:dt("px-3 pb-2.5",c?"pt-6":"pt-2"),children:z.jsx(wB,{language:c,code:d})})})]})}const kB=[yO,CO],EB=[oM],AB={pre:({children:e})=>e,code:SB,table:({children:e,...t})=>z.jsx("div",{className:"my-4 overflow-x-auto scrollbar-subtle",children:z.jsx("table",{...t,children:e})})};function TB(e){let t="",n=0,r="",l=0;for(;n<e.length;){const s=n===0||e[n-1]===`
|
|
457
457
|
`,u=e.indexOf(`
|
|
458
458
|
`,n),c=u===-1?e.length:u+1;if(s){const f=e.slice(n,c),d=/^( {0,3})(`{3,}|~{3,})/.exec(f);if(r){t+=f,d&&d[2]?.[0]===r&&d[2].length>=l&&(r="",l=0),n=c;continue}if(d){t+=f,r=d[2]?.[0]||"",l=d[2]?.length||0,n=c;continue}if(f.startsWith(" ")||f.startsWith(" ")){t+=f,n=c;continue}}if(e[n]==="`"){let f=1;for(;e[n+f]==="`";)f+=1;const d="`".repeat(f),m=e.indexOf(d,n+f);if(m!==-1){t+=e.slice(n,m+f),n=m+f;continue}}if(e[n]==="\\"&&e[n+1]==="["){const f=e.indexOf("\\]",n+2);if(f!==-1){t+=`$$${e.slice(n+2,f)}$$`,n=f+2;continue}}if(e[n]==="\\"&&e[n+1]==="("){const f=e.indexOf("\\)",n+2);if(f!==-1){const d=e.slice(n+2,f);if(!d.includes(`
|
|
459
|
-
`)){t+=`$${d}$`,n=f+2;continue}}}t+=e[n],n+=1}return t}const CB=ne.memo(function({content:t}){return z.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:z.jsx(jT,{remarkPlugins:kB,rehypePlugins:EB,components:AB,children:TB(t)})})}),RB=ne.memo(function({content:t,isStreaming:n}){const[r,l]=ne.useState(null),s=r??!!n;return t?z.jsxs("div",{className:"rounded-lg bg-secondary/20 px-3 py-2",children:[z.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 select-none cursor-pointer text-left","aria-expanded":s,onClick:()=>l(!s),children:[z.jsx("span",{className:dt("text-xs transition-colors duration-200",n?"text-accent/60 animate-thinking font-medium":"text-muted-foreground/50"),children:"Thinking"}),z.jsx(I6,{className:dt("h-3 w-3 text-muted-foreground/25 transition-transform duration-200",!s&&"-rotate-90"),"aria-hidden":"true"})]}),z.jsx("div",{className:dt("grid transition-[grid-template-rows,opacity] duration-250 ease-out",s?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:z.jsx("div",{className:"overflow-hidden",children:z.jsx("div",{className:"pt-2 text-[13px] text-muted-foreground/70 whitespace-pre-wrap italic leading-relaxed",children:t})})})]}):null});let im;function MB(){return im||(im=N(()=>import("./EditDiff-
|
|
459
|
+
`)){t+=`$${d}$`,n=f+2;continue}}}t+=e[n],n+=1}return t}const CB=ne.memo(function({content:t}){return z.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:z.jsx(jT,{remarkPlugins:kB,rehypePlugins:EB,components:AB,children:TB(t)})})}),RB=ne.memo(function({content:t,isStreaming:n}){const[r,l]=ne.useState(null),s=r??!!n;return t?z.jsxs("div",{className:"rounded-lg bg-secondary/20 px-3 py-2",children:[z.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 select-none cursor-pointer text-left","aria-expanded":s,onClick:()=>l(!s),children:[z.jsx("span",{className:dt("text-xs transition-colors duration-200",n?"text-accent/60 animate-thinking font-medium":"text-muted-foreground/50"),children:"Thinking"}),z.jsx(I6,{className:dt("h-3 w-3 text-muted-foreground/25 transition-transform duration-200",!s&&"-rotate-90"),"aria-hidden":"true"})]}),z.jsx("div",{className:dt("grid transition-[grid-template-rows,opacity] duration-250 ease-out",s?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:z.jsx("div",{className:"overflow-hidden",children:z.jsx("div",{className:"pt-2 text-[13px] text-muted-foreground/70 whitespace-pre-wrap italic leading-relaxed",children:t})})})]}):null});let im;function MB(){return im||(im=N(()=>import("./EditDiff-BCA9aTUr.js"),[])),im}const DB=ne.lazy(MB);function OB(e){const t=e;return(t.path===void 0||typeof t.path=="string")&&Array.isArray(t.edits)}function NB(e){if(!e)return null;try{const t=JSON.parse(e);if(t.status==="ok"&&Array.isArray(t.edits))return t.edits.filter(n=>typeof n?.start_line=="number")}catch{}return null}function zB({edits:e}){return z.jsx("div",{className:"rounded-md bg-code px-3 py-2 font-mono text-[13px] leading-[1.5] overflow-x-auto scrollbar-subtle whitespace-pre-wrap",children:e.map((t,n)=>z.jsxs("div",{children:[n>0&&z.jsx("div",{className:"text-center text-muted-foreground/20 select-none text-xs py-0.5",children:"···"}),t.oldText&&z.jsx("div",{className:"diff-line-removed px-1",children:t.oldText}),t.newText&&z.jsx("div",{className:"diff-line-added px-1",children:t.newText})]},n))})}const f6={read:{icon:O0,label:"read"},write:{icon:__,label:"write"},edit:{icon:D_,label:"edit"},bash:{icon:g1,label:"bash"}},LB="rounded-md px-3 py-2 font-mono text-[13px] leading-relaxed overflow-x-auto overflow-y-auto scrollbar-subtle whitespace-pre-wrap max-h-[240px]";function Ql({text:e,isError:t}){return e?z.jsx("div",{className:dt(LB,t?"bg-red-500/[0.05] text-red-400/70":"bg-code text-muted-foreground/80"),children:e}):null}function IB(e,t){if(!t)return"";switch(e){case"bash":{const n=t;return typeof n.command=="string"?n.command:""}case"read":case"write":case"edit":{const n=t;return typeof n.path=="string"?n.path:""}default:return Object.entries(t).filter(([n])=>n!=="content"&&n!=="prompt").map(([,n])=>typeof n=="object"?"…":String(n)).join(" ")}}function BB(e){if(!e)return null;const n=e.edits;if(!Array.isArray(n))return null;let r=0,l=0;for(const s of n){if(typeof s?.oldText!="string"||typeof s?.newText!="string")continue;const u=new Map;for(const f of s.oldText.split(`
|
|
460
460
|
`))u.set(f,(u.get(f)??0)+1);const c=new Map;for(const f of s.newText.split(`
|
|
461
461
|
`))c.set(f,(c.get(f)??0)+1);for(const[f,d]of u){const m=c.get(f)??0;d>m&&(l+=d-m)}for(const[f,d]of c){const m=u.get(f)??0;d>m&&(r+=d-m)}}return{added:r,removed:l}}function M8(e){if(!e)return"";const t=e,n=typeof t.offset=="number"?t.offset:null,r=typeof t.limit=="number"?t.limit:null;return n!=null&&r!=null?`:${n}-${n+r}`:n!=null?`:${n}`:r!=null?`:1-${r}`:""}function jB(e){if(!e)return"";const n=e.content;return typeof n!="string"?"":`${n.split(`
|
|
462
462
|
`).length} lines`}const qB="shrink-0 ml-1.5 text-[12px] font-mono text-muted-foreground/30";function HB({name:e,args:t}){if(e==="edit"){const r=BB(t);return!r||r.added===0&&r.removed===0?null:z.jsxs("span",{className:"shrink-0 ml-1.5 text-[12px] font-mono tabular-nums",children:[z.jsxs("span",{className:"text-emerald-500/60",children:["+",r.added]}),z.jsxs("span",{className:"text-red-400/60 ml-1",children:["−",r.removed]})]})}const n=e==="read"?M8(t):e==="write"?jB(t):"";return n?z.jsx("span",{className:qB,children:n}):null}function PB({args:e,display:t,isError:n}){const r=e,l=typeof r?.command=="string"?r.command:"";return z.jsxs("div",{className:"pt-2 space-y-2",children:[l&&z.jsxs("div",{className:"rounded-md bg-code px-3 py-2 font-mono text-[13px] leading-[1.5] overflow-x-auto scrollbar-subtle",children:[z.jsx("span",{className:"text-muted-foreground/30 select-none",children:"$ "}),z.jsx("span",{className:"text-foreground/65 whitespace-pre-wrap break-all",children:l})]}),z.jsx(Ql,{text:t,isError:n})]})}function UB({args:e,display:t,isError:n}){const r=e,l=typeof r?.path=="string"?r.path:"",s=M8(e);return z.jsxs("div",{className:"pt-2 space-y-2",children:[l&&z.jsxs("div",{className:"font-mono text-[13px] text-muted-foreground/40 truncate",children:[l,s&&z.jsx("span",{className:"text-muted-foreground/30",children:s})]}),z.jsx(Ql,{text:t,isError:n})]})}function VB({args:e,display:t,isError:n}){const r=e,l=typeof r?.path=="string"?r.path:"",s=typeof r?.content=="string"?r.content:"";return z.jsxs("div",{className:"pt-2 space-y-2",children:[l&&z.jsx("div",{className:"font-mono text-[13px] text-muted-foreground/40 truncate",children:l}),s&&!n&&z.jsx("div",{className:"rounded-md bg-code px-3 py-2 font-mono text-[13px] leading-[1.5] overflow-x-auto overflow-y-auto scrollbar-subtle whitespace-pre-wrap max-h-[240px] text-foreground/65",children:s}),n&&z.jsx(Ql,{text:t,isError:!0})]})}function GB({args:e,modelText:t,display:n,isError:r}){if(e&&OB(e)&&e.edits?.length){const l=NB(t),s=e.edits.map((u,c)=>({oldText:u.oldText,newText:u.newText,meta:l?.[c]??null}));return z.jsxs("div",{className:"pt-2 space-y-2",children:[z.jsx(ne.Suspense,{fallback:z.jsx(zB,{edits:e.edits}),children:z.jsx(DB,{path:e.path,edits:s})}),r&&z.jsx(Ql,{text:n,isError:!0})]})}return z.jsxs("div",{className:"pt-2 space-y-2",children:[e&&Object.keys(e).length>0&&z.jsx(D8,{args:e}),z.jsx(Ql,{text:n,isError:r})]})}function D8({args:e}){return z.jsx("div",{className:"rounded-md bg-code px-3 py-2 font-mono text-[13px] leading-relaxed overflow-x-auto scrollbar-subtle",children:Object.entries(e).map(([t,n])=>z.jsxs("div",{children:[z.jsxs("span",{className:"text-accent/50",children:[t,": "]}),z.jsx("span",{className:"text-foreground/65 break-all whitespace-pre-wrap",children:typeof n=="object"?JSON.stringify(n,null,2):String(n)})]},t))})}const FB=ne.memo(function({name:t,args:n,output:r,modelText:l,displayText:s,pending:u,isError:c}){const f=typeof s=="string"?s:typeof r=="string"?r:"",d=!!c||typeof l=="string"&&l.startsWith("error:"),[m,g]=ne.useState(null),b=m??d,v=u?"pending":d?"error":"success",E=(Object.hasOwn(f6,t)?f6[t]:{icon:g1}).icon,D=IB(t,n);return z.jsxs("div",{className:dt("relative rounded-lg px-3 py-2",v==="error"?"bg-red-500/[0.05]":"bg-secondary/20"),children:[v==="pending"&&z.jsx("div",{className:"absolute top-0 left-0 right-0 h-[1px] overflow-hidden rounded-t-lg",children:z.jsx("div",{className:"h-full w-1/3 bg-accent/30 animate-progress-line"})}),z.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 select-none cursor-pointer text-left","aria-expanded":b,onClick:()=>g(!b),children:[z.jsx(E,{className:dt("h-3.5 w-3.5 shrink-0 transition-colors duration-200",v==="error"?"text-red-400/80":v==="pending"?"text-accent/50":"text-foreground/60"),"aria-hidden":"true"}),z.jsx("span",{className:dt("text-[13px] font-medium shrink-0 transition-colors duration-200",v==="error"?"text-red-400/80":v==="pending"?"text-foreground/70":"text-foreground/60"),children:t}),!b&&D&&z.jsx("span",{className:"pl-1 text-[13px] text-muted-foreground/40 font-mono truncate",children:D}),!b&&z.jsx(HB,{name:t,args:n}),z.jsx("span",{className:"flex-1"}),v==="success"&&z.jsx(p1,{className:"h-3 w-3 text-emerald-500/40 shrink-0","aria-hidden":"true"}),z.jsx(I6,{className:dt("h-3 w-3 text-muted-foreground/25 transition-transform duration-200 shrink-0",!b&&"-rotate-90"),"aria-hidden":"true"})]}),z.jsx("div",{className:dt("grid transition-[grid-template-rows,opacity] duration-250 ease-out",b?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:z.jsx("div",{className:"overflow-hidden",children:t==="bash"?z.jsx(PB,{args:n,display:f,isError:d}):t==="read"?z.jsx(UB,{args:n,display:f,isError:d}):t==="write"?z.jsx(VB,{args:n,display:f,isError:d}):t==="edit"?z.jsx(GB,{args:n,modelText:l,display:f,isError:d}):z.jsxs("div",{className:"pt-2 space-y-2",children:[n&&Object.keys(n).length>0&&z.jsx(D8,{args:n}),z.jsx(Ql,{text:f,isError:d})]})})})]})});function am(e){return e.meta}class lm extends ne.Component{state={hasError:!1,resetKey:this.props.resetKey};static getDerivedStateFromProps(t,n){return t.resetKey===n.resetKey?null:{hasError:!1,resetKey:t.resetKey}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){console.error("Chat block render failed:",t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const $B=ne.memo(function({role:t,blocks:n,sourceIndex:r,synthetic:l,isStreaming:s,isLoading:u,index:c,onRewindAndSend:f}){const d=t==="user",[m,g]=ne.useState(!1),[b,v]=ne.useState(!1),[_,E]=ne.useState(""),D=ne.useRef(null),A=ne.useRef(null),C=ne.useMemo(()=>n.filter(Q=>Q?.type==="text"&&!am(Q)?.attachment),[n]),L=ne.useMemo(()=>C.map(Q=>Q.text).join(`
|
mycode/server/static/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
rel="stylesheet" />
|
|
25
25
|
<link rel="icon" type="image/svg+xml" href="/favicon_slashes.svg" />
|
|
26
26
|
<title>mycode</title>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-C8gu4B-1.js"></script>
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/index-Bi2yKki-.css">
|
|
29
29
|
</head>
|
|
30
30
|
|
|
@@ -2,7 +2,7 @@ mycode/__init__.py,sha256=Pjjy4ieSZ44e5GZIgZ0XP8juR7u3xtg3hvMq_qLo3sU,39
|
|
|
2
2
|
mycode/cli/__init__.py,sha256=NtPinpl7FtTPZ4ZrEWbY50A9aAnV0-U2PG0t9U0VKKw,30
|
|
3
3
|
mycode/cli/chat.py,sha256=b6Y2aGhck9z4W0b43IX1g9tSp6sUnfASdHeEJL-IeaU,25618
|
|
4
4
|
mycode/cli/main.py,sha256=9--KcBcV4pZnC7AYAacs8ygNojW_IKbafzJJ92kHw6Q,7706
|
|
5
|
-
mycode/cli/render.py,sha256=
|
|
5
|
+
mycode/cli/render.py,sha256=zQrt-UBQuoFUgH-wHQ0rNxCM-RH_uB-pwoc7bLsbREQ,27083
|
|
6
6
|
mycode/cli/runtime.py,sha256=xCkI3bMlYT_VeIM1ufwO9nozW37DBsqywxy8pYpLUFA,8974
|
|
7
7
|
mycode/cli/theme.py,sha256=HS3C1kSoIONrSaiSx22AWRLk1n6-T-Tn5iohCMewAg4,3455
|
|
8
8
|
mycode/core/__init__.py,sha256=0t7o7zWeo5ZdefBjKvC_4JZmft9AC35i1gfnC4tMvME,761
|
|
@@ -12,7 +12,7 @@ mycode/core/messages.py,sha256=4TxmchjaB-2S5raYqbSC9Ow1II4LmpFK2rufEb5UCOY,5301
|
|
|
12
12
|
mycode/core/models.py,sha256=djc206r8ZTSgGJHlGpicPKYvC3xfrlHs1kBYz2jMksk,3631
|
|
13
13
|
mycode/core/models_catalog.json,sha256=EHCPEyh91s2e7nIyyhFkhGm_tTf19p4V-Yw3e8GfWFU,73810
|
|
14
14
|
mycode/core/session.py,sha256=SAYw4J3KS5k_GWLPoLmaBuPfzKd3lwhJ7CGL_108jPQ,18796
|
|
15
|
-
mycode/core/system_prompt.py,sha256=
|
|
15
|
+
mycode/core/system_prompt.py,sha256=_pCx4CTXz5b_s2g0Qww7hi_209zS7sTkRBrJw9GkPR0,10550
|
|
16
16
|
mycode/core/tools.py,sha256=Jx34RxihRKW-lwGAkY6yi1mE_tzINVUM_UInLIDkF30,36313
|
|
17
17
|
mycode/core/utils.py,sha256=owQv38IWboxkF-7qcbWnkpMjK0susMRKX2QZLAznqKo,1196
|
|
18
18
|
mycode/core/providers/__init__.py,sha256=iOlKJh-U6z5SMcMzEzW6n7MGcVEUGd3E7V6bAKKpJK0,2802
|
|
@@ -31,8 +31,8 @@ mycode/server/routers/chat.py,sha256=_WvgTIuJt-3awKxg6CNzwvTAnhSDNzes93H8FR-_nI4
|
|
|
31
31
|
mycode/server/routers/sessions.py,sha256=93QGoIU1Eld1CSq8DJVmYBxGbvkQe4IrqfC8tdcLoRk,2609
|
|
32
32
|
mycode/server/routers/workspaces.py,sha256=73HUblfDgNzVtNqq_dY01sVXzR6nAZnohf35FTo4GJs,2930
|
|
33
33
|
mycode/server/static/favicon_slashes.svg,sha256=Oo3WHCISxwjLyw1IeuOp06pAdxuUX-nwDT5zVbqJlEo,480
|
|
34
|
-
mycode/server/static/index.html,sha256=
|
|
35
|
-
mycode/server/static/assets/EditDiff-
|
|
34
|
+
mycode/server/static/index.html,sha256=KsW4UO4_KQ5uac6E0NGW26PBg54eLmSxN_DcC4plPc0,1277
|
|
35
|
+
mycode/server/static/assets/EditDiff-BCA9aTUr.js,sha256=7ptZH0apmX4ZAjwLtY3rFcmuZ6KFU9cau8J8LAy1YDs,8355
|
|
36
36
|
mycode/server/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2,sha256=DN04fJWQoan5eUVgAi27WWVKfYbxh6oMgUla1C06cwg,28076
|
|
37
37
|
mycode/server/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff,sha256=MNqR6EyJP4deJSaJ-uvcWQsocRReitx_mp1NvYzgslE,33516
|
|
38
38
|
mycode/server/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf,sha256=aFNIQLz90r_7bw6N60hoTdAefwTqKBMmdXevuQbeHRM,63632
|
|
@@ -217,7 +217,7 @@ mycode/server/static/assets/hxml-Bvhsp5Yf.js,sha256=WVMLiUzYaIh0kKMw2muDZiFCRrju
|
|
|
217
217
|
mycode/server/static/assets/hy-DFXneXwc.js,sha256=It8p2LXFEZ8b0l6Zi_ezWaKdxbgm5QWXzuZ3MWecymg,2648
|
|
218
218
|
mycode/server/static/assets/imba-DGztddWO.js,sha256=c0AsrqlOVBAMlwxlJXer9JlfeTEOdSh0S0ajcicFfjU,49930
|
|
219
219
|
mycode/server/static/assets/index-Bi2yKki-.css,sha256=vrHLOdpeXddCVd7y2eEK6JvsXWkBXS1vLiwsf2XGZ7Y,65981
|
|
220
|
-
mycode/server/static/assets/index-
|
|
220
|
+
mycode/server/static/assets/index-C8gu4B-1.js,sha256=wLbeLx-KjfXAtiYxTJFb0QgCnA36CvddhBxPv6bpXZ0,932892
|
|
221
221
|
mycode/server/static/assets/ini-BEwlwnbL.js,sha256=eDDmKiqW4ixBi1oeUroVVF7OPFaENG3VD8F0pgs8Il8,1525
|
|
222
222
|
mycode/server/static/assets/java-CylS5w8V.js,sha256=K-xL5boN6j2CWGad8eaVfhuiWQoa1WxuED6owAuuun4,27219
|
|
223
223
|
mycode/server/static/assets/javascript-wDzz0qaB.js,sha256=pKVsxyx9Dx7LvrG6a_X1Mhk8jRP8PeGZEPjWTHCuxOk,174827
|
|
@@ -395,8 +395,8 @@ mycode/server/static/assets/xsl-CtQFsRM5.js,sha256=tHu7ObMZlHpXUl3BFOww6y5pe_RRv
|
|
|
395
395
|
mycode/server/static/assets/yaml-Buea-lGh.js,sha256=p6i0_BT6e6M4WY9hGFo6E-SddFCDCvNnQHrmG5Y0vt4,10506
|
|
396
396
|
mycode/server/static/assets/zenscript-DVFEvuxE.js,sha256=WKgS641xEh7jvW5RO4ogVVvsRPlo98N4vX7L_eBYZqc,3912
|
|
397
397
|
mycode/server/static/assets/zig-VOosw3JB.js,sha256=fDaSkledibeB6Rt2pN8b-6YEKHx6XixCaSWTXvCMCEE,5340
|
|
398
|
-
mycode_cli-0.3.
|
|
399
|
-
mycode_cli-0.3.
|
|
400
|
-
mycode_cli-0.3.
|
|
401
|
-
mycode_cli-0.3.
|
|
402
|
-
mycode_cli-0.3.
|
|
398
|
+
mycode_cli-0.3.4.dist-info/METADATA,sha256=pfoEociRoOTDg6oVY3RjWq5vkCk9KtK0qxvQWu3g16w,6159
|
|
399
|
+
mycode_cli-0.3.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
400
|
+
mycode_cli-0.3.4.dist-info/entry_points.txt,sha256=A8fOMAxoAEKlijcCJuKYMHebmj4FuqvCBVijNY5V-hQ,48
|
|
401
|
+
mycode_cli-0.3.4.dist-info/licenses/LICENSE,sha256=DSE6T-B9WhrWypr6H7y2kTZzoF1tef5xf7veUyImQsM,1064
|
|
402
|
+
mycode_cli-0.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|