@oonacode/win32-x64 0.3.208 → 0.3.209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/oona.exe CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/oona.exe
3
- size: 112228352 bytes
4
- sha256: 06e08d926a50920d9a34ac44774210709e7cbff19d9fc4c4564537ab672b473b
3
+ size: 112235008 bytes
4
+ sha256: 25bb6661d3914a8a1b749a47620a93b34a264cff09335c4ce3ee3f3079548db2
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "oonacode",
3
- "version": "0.3.208",
3
+ "version": "0.3.209",
4
4
  "channel": "stable",
5
5
  "platform": "win32",
6
6
  "arch": "x64",
7
7
  "mode": "bun",
8
8
  "launcherRuntime": "bun 1.4.1",
9
- "commit": "7e4b31e7",
10
- "builtAt": "2026-10-04T21:16:40.8801735Z",
9
+ "commit": "3c574826",
10
+ "builtAt": "2026-10-04T22:26:39.5774904Z",
11
11
  "engine": "engine-store",
12
12
  "engineVersion": "0.3.280",
13
13
  "siteOrigin": "https://oonacode.oonak.ai",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oonacode/win32-x64",
3
- "version": "0.3.208",
3
+ "version": "0.3.209",
4
4
  "description": "OonaCode native binaries for Windows x64: oona.exe (CLI + headless host service), the pinned oonaclaude.exe engine sidecar, local web UI assets. Installed automatically as an optional dependency of `oonacode`.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://oonacode.oonak.ai",
@@ -74,7 +74,7 @@ Error generating stack: `+e.message+`
74
74
 
75
75
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ua(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:pa(t,`input`,e.processors),output:pa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function da(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return da(r.element,n);if(r.type===`set`)return da(r.valueType,n);if(r.type===`lazy`)return da(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return da(r.innerType,n);if(r.type===`intersection`)return da(r.left,n)||da(r.right,n);if(r.type===`record`||r.type===`map`)return da(r.keyType,n)||da(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:da(r.in,n)||da(r.out,n);if(r.type===`object`){for(let e in r.shape)if(da(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(da(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(da(e,n))return!0;return!!(r.rest&&da(r.rest,n))}return!1}var fa=(e,t={})=>n=>{let r=sa({...n,processors:t});return ca(e,r),la(r,e),ua(r,e)},pa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=sa({...i??{},target:a,io:t,processors:n});return ca(e,o),la(o,e),ua(o,e)},ma={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ha=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ma[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ga=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},_a=(e,t,n,r)=>{n.type=`boolean`},va=(e,t,n,r)=>{n.not={}},ya=(e,t,n,r)=>{let i=e._zod.def,a=We(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ba=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},xa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Sa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ca=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ca(a.element,t,{...r,path:[...r.path,`items`]})},wa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ca(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ca(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ta=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ca(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ea=(e,t,n,r)=>{let i=e._zod.def,a=ca(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ca(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Da=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ca(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ca(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ca(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Oa=(e,t,n,r)=>{let i=e._zod.def,a=ca(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ka=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Aa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ja=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ma=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Na=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ca(o,t,r);let s=t.seen.get(e);s.ref=o},Pa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Fa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ia=B(`ZodISODateTime`,(e,t)=>{nr.init(e,t),co.init(e,t)});function La(e){return Oi(Ia,e)}var Ra=B(`ZodISODate`,(e,t)=>{rr.init(e,t),co.init(e,t)});function za(e){return ki(Ra,e)}var Ba=B(`ZodISOTime`,(e,t)=>{ir.init(e,t),co.init(e,t)});function Va(e){return Ai(Ba,e)}var Ha=B(`ZodISODuration`,(e,t)=>{ar.init(e,t),co.init(e,t)});function Ua(e){return ji(Ha,e)}var Wa=B(`ZodError`,(e,t)=>{Dt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>At(e,t)},flatten:{value:t=>kt(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ge,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ge,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ga=jt(Wa),Ka=Mt(Wa),qa=Nt(Wa),Ja=Ft(Wa),Ya=Lt(Wa),Xa=Rt(Wa),Za=zt(Wa),Qa=Bt(Wa),$a=Vt(Wa),eo=Ht(Wa),to=Ut(Wa),no=Wt(Wa),ro=new WeakMap;function io(e,t,n){let r=Object.getPrototypeOf(e),i=ro.get(r);if(i||(i=new Set,ro.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ao=B(`ZodType`,(e,t)=>(Hn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:pa(e,`input`),output:pa(e,`output`)}}),e.toJSONSchema=fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Ga(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qa(e,t,n),e.parseAsync=async(t,n)=>Ka(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ja(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ya(e,t,n),e.decode=(t,n)=>Xa(e,t,n),e.encodeAsync=async(t,n)=>Za(e,t,n),e.decodeAsync=async(t,n)=>Qa(e,t,n),e.safeEncode=(t,n)=>$a(e,t,n),e.safeDecode=(t,n)=>eo(e,t,n),e.safeEncodeAsync=async(t,n)=>to(e,t,n),e.safeDecodeAsync=async(t,n)=>no(e,t,n),io(e,`ZodType`,{check(...e){let t=this.def;return this.clone($e(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return lt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ss(e,t))},superRefine(e,t){return this.check(Cs(e,t))},overwrite(e){return this.check(Zi(e))},optional(){return is(this)},exactOptional(){return os(this)},nullable(){return cs(this)},nullish(){return is(cs(this))},nonoptional(e){return ms(this,e)},array(){return Bo(this)},or(e){return Wo([this,e])},and(e){return Jo(this,e)},transform(e){return vs(this,ns(e))},default(e){return us(this,e)},prefault(e){return fs(this,e)},catch(e){return gs(this,e)},pipe(e){return vs(this,e)},readonly(){return bs(this)},describe(e){let t=this.clone();return ii.add(t,{description:e}),t},meta(...e){if(e.length===0)return ii.get(this);let t=this.clone();return ii.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return ii.get(e)?.description},configurable:!0}),e)),oo=B(`_ZodString`,(e,t)=>{Un.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,io(e,`_ZodString`,{regex(...e){return this.check(Gi(...e))},includes(...e){return this.check(Ji(...e))},startsWith(...e){return this.check(Yi(...e))},endsWith(...e){return this.check(Xi(...e))},min(...e){return this.check(Ui(...e))},max(...e){return this.check(Hi(...e))},length(...e){return this.check(Wi(...e))},nonempty(...e){return this.check(Ui(1,...e))},lowercase(e){return this.check(Ki(e))},uppercase(e){return this.check(qi(e))},trim(){return this.check($i())},normalize(...e){return this.check(Qi(...e))},toLowerCase(){return this.check(ea())},toUpperCase(){return this.check(ta())},slugify(){return this.check(na())}})}),so=B(`ZodString`,(e,t)=>{Un.init(e,t),oo.init(e,t),e.email=t=>e.check(oi(lo,t)),e.url=t=>e.check(fi(po,t)),e.jwt=t=>e.check(Di(Oo,t)),e.emoji=t=>e.check(pi(mo,t)),e.guid=t=>e.check(si(uo,t)),e.uuid=t=>e.check(ci(fo,t)),e.uuidv4=t=>e.check(li(fo,t)),e.uuidv6=t=>e.check(ui(fo,t)),e.uuidv7=t=>e.check(di(fo,t)),e.nanoid=t=>e.check(mi(ho,t)),e.guid=t=>e.check(si(uo,t)),e.cuid=t=>e.check(hi(go,t)),e.cuid2=t=>e.check(gi(_o,t)),e.ulid=t=>e.check(_i(vo,t)),e.base64=t=>e.check(wi(To,t)),e.base64url=t=>e.check(Ti(Eo,t)),e.xid=t=>e.check(vi(yo,t)),e.ksuid=t=>e.check(yi(bo,t)),e.ipv4=t=>e.check(bi(xo,t)),e.ipv6=t=>e.check(xi(So,t)),e.cidrv4=t=>e.check(Si(Co,t)),e.cidrv6=t=>e.check(Ci(wo,t)),e.e164=t=>e.check(Ei(Do,t)),e.datetime=t=>e.check(La(t)),e.date=t=>e.check(za(t)),e.time=t=>e.check(Va(t)),e.duration=t=>e.check(Ua(t))});function H(e){return ai(so,e)}var co=B(`ZodStringFormat`,(e,t)=>{Wn.init(e,t),oo.init(e,t)}),lo=B(`ZodEmail`,(e,t)=>{qn.init(e,t),co.init(e,t)}),uo=B(`ZodGUID`,(e,t)=>{Gn.init(e,t),co.init(e,t)}),fo=B(`ZodUUID`,(e,t)=>{Kn.init(e,t),co.init(e,t)}),po=B(`ZodURL`,(e,t)=>{Jn.init(e,t),co.init(e,t)}),mo=B(`ZodEmoji`,(e,t)=>{Yn.init(e,t),co.init(e,t)}),ho=B(`ZodNanoID`,(e,t)=>{Xn.init(e,t),co.init(e,t)}),go=B(`ZodCUID`,(e,t)=>{Zn.init(e,t),co.init(e,t)}),_o=B(`ZodCUID2`,(e,t)=>{Qn.init(e,t),co.init(e,t)}),vo=B(`ZodULID`,(e,t)=>{$n.init(e,t),co.init(e,t)}),yo=B(`ZodXID`,(e,t)=>{er.init(e,t),co.init(e,t)}),bo=B(`ZodKSUID`,(e,t)=>{tr.init(e,t),co.init(e,t)}),xo=B(`ZodIPv4`,(e,t)=>{or.init(e,t),co.init(e,t)}),So=B(`ZodIPv6`,(e,t)=>{sr.init(e,t),co.init(e,t)}),Co=B(`ZodCIDRv4`,(e,t)=>{cr.init(e,t),co.init(e,t)}),wo=B(`ZodCIDRv6`,(e,t)=>{lr.init(e,t),co.init(e,t)}),To=B(`ZodBase64`,(e,t)=>{dr.init(e,t),co.init(e,t)}),Eo=B(`ZodBase64URL`,(e,t)=>{pr.init(e,t),co.init(e,t)}),Do=B(`ZodE164`,(e,t)=>{mr.init(e,t),co.init(e,t)}),Oo=B(`ZodJWT`,(e,t)=>{gr.init(e,t),co.init(e,t)}),ko=B(`ZodNumber`,(e,t)=>{_r.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),io(e,`ZodNumber`,{gt(e,t){return this.check(zi(e,t))},gte(e,t){return this.check(Bi(e,t))},min(e,t){return this.check(Bi(e,t))},lt(e,t){return this.check(Li(e,t))},lte(e,t){return this.check(Ri(e,t))},max(e,t){return this.check(Ri(e,t))},int(e){return this.check(Mo(e))},safe(e){return this.check(Mo(e))},positive(e){return this.check(zi(0,e))},nonnegative(e){return this.check(Bi(0,e))},negative(e){return this.check(Li(0,e))},nonpositive(e){return this.check(Ri(0,e))},multipleOf(e,t){return this.check(Vi(e,t))},step(e,t){return this.check(Vi(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ao(e){return Mi(ko,e)}var jo=B(`ZodNumberFormat`,(e,t)=>{vr.init(e,t),ko.init(e,t)});function Mo(e){return Ni(jo,e)}var No=B(`ZodBoolean`,(e,t)=>{yr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r)});function Po(e){return Pi(No,e)}var Fo=B(`ZodUnknown`,(e,t)=>{br.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Io(){return Fi(Fo)}var Lo=B(`ZodNever`,(e,t)=>{xr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r)});function Ro(e){return Ii(Lo,e)}var zo=B(`ZodArray`,(e,t)=>{Cr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r),e.element=t.element,io(e,`ZodArray`,{min(e,t){return this.check(Ui(e,t))},nonempty(e){return this.check(Ui(1,e))},max(e,t){return this.check(Hi(e,t))},length(e,t){return this.check(Wi(e,t))},unwrap(){return this.element}})});function Bo(e,t){return ra(zo,e,t)}var Vo=B(`ZodObject`,(e,t)=>{Or.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r),Ze(e,`shape`,()=>t.shape),io(e,`ZodObject`,{keyof(){return Qo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Io()})},loose(){return this.clone({...this._zod.def,catchall:Io()})},strict(){return this.clone({...this._zod.def,catchall:Ro()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return mt(this,e)},safeExtend(e){return ht(this,e)},merge(e){return gt(this,e)},pick(e){return ft(this,e)},omit(e){return pt(this,e)},partial(...e){return _t(rs,this,e[0])},required(...e){return vt(ps,this,e[0])}})});function Ho(e,t){return new Vo({type:`object`,shape:e??{},...V(t)})}var Uo=B(`ZodUnion`,(e,t)=>{Ar.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ta(e,t,n,r),e.options=t.options});function Wo(e,t){return new Uo({type:`union`,options:e,...V(t)})}var Go=B(`ZodDiscriminatedUnion`,(e,t)=>{Uo.init(e,t),jr.init(e,t)});function Ko(e,t,n){return new Go({type:`union`,options:t,discriminator:e,...V(n)})}var qo=B(`ZodIntersection`,(e,t)=>{Mr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,n,r)});function Jo(e,t){return new qo({type:`intersection`,left:e,right:t})}var Yo=B(`ZodRecord`,(e,t)=>{Fr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Xo(e,t,n){return!t||!t._zod?new Yo({type:`record`,keyType:H(),valueType:e,...V(t)}):new Yo({type:`record`,keyType:e,valueType:t,...V(n)})}var Zo=B(`ZodEnum`,(e,t)=>{Ir.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Zo({...t,checks:[],...V(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Zo({...t,checks:[],...V(r),entries:i})}});function Qo(e,t){return new Zo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...V(t)})}var $o=B(`ZodLiteral`,(e,t)=>{Lr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function es(e,t){return new $o({type:`literal`,values:Array.isArray(e)?e:[e],...V(t)})}var ts=B(`ZodTransform`,(e,t)=>{Rr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ve(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Tt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Tt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ns(e){return new ts({type:`transform`,transform:e})}var rs=B(`ZodOptional`,(e,t)=>{Br.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function is(e){return new rs({type:`optional`,innerType:e})}var as=B(`ZodExactOptional`,(e,t)=>{Vr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function os(e){return new as({type:`optional`,innerType:e})}var ss=B(`ZodNullable`,(e,t)=>{Hr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cs(e){return new ss({type:`nullable`,innerType:e})}var ls=B(`ZodDefault`,(e,t)=>{Ur.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function us(e,t){return new ls({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ot(t)}})}var ds=B(`ZodPrefault`,(e,t)=>{Gr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ja(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fs(e,t){return new ds({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ot(t)}})}var ps=B(`ZodNonOptional`,(e,t)=>{Kr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ka(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ms(e,t){return new ps({type:`nonoptional`,innerType:e,...V(t)})}var hs=B(`ZodCatch`,(e,t)=>{Jr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gs(e,t){return new hs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var _s=B(`ZodPipe`,(e,t)=>{Yr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Na(e,t,n,r),e.in=t.in,e.out=t.out});function vs(e,t){return new _s({type:`pipe`,in:e,out:t})}var ys=B(`ZodReadonly`,(e,t)=>{Zr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bs(e){return new ys({type:`readonly`,innerType:e})}var xs=B(`ZodCustom`,(e,t)=>{$r.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r)});function Ss(e,t={}){return ia(xs,e,t)}function Cs(e,t){return aa(e,t)}var ws={artificial_analysis_intelligence_index:{label:`Intelligence index`,scale:`index`},artificial_analysis_coding_index:{label:`Coding index`,scale:`index`},artificial_analysis_math_index:{label:`Math index`,scale:`index`},gpqa:{label:`GPQA Diamond`,scale:`fraction`},hle:{label:`Humanity's Last Exam`,scale:`fraction`},lcr:{label:`Long-context reasoning`,scale:`fraction`},livecodebench:{label:`LiveCodeBench`,scale:`fraction`},scicode:{label:`SciCode`,scale:`fraction`},math_500:{label:`MATH-500`,scale:`fraction`},aime:{label:`AIME`,scale:`fraction`},aime_25:{label:`AIME 2025`,scale:`fraction`},ifbench:{label:`IFBench`,scale:`fraction`},mmlu_pro:{label:`MMLU Pro`,scale:`fraction`},tau2:{label:`τ²-bench (agentic)`,scale:`fraction`},tau_banking:{label:`τ-bench banking`,scale:`fraction`},terminalbench_hard:{label:`Terminal-Bench Hard`,scale:`fraction`},terminalbench_v2_1:{label:`Terminal-Bench 2.1`,scale:`fraction`}};function Ts(e){return(e.credentialVariants??[]).filter(e=>!e.operatorOnly)}function Es(e){let t=new Set(e.map(e=>e.definition.id));return e.filter(e=>!e.definition.clientGroup||e.definition.clientGroup===e.definition.id||!t.has(e.definition.clientGroup))}function Ds(e,t){return e.filter(e=>e.definition.id===t||e.definition.clientGroup===t&&e.definition.id!==t)}function Os(e){return Es(e).filter(e=>e.definition.enabled&&e.definition.credentialClass!==`none`&&e.definition.poolOnly!==!0&&w(e.definition.id)&&!E(e.definition.id))}function ks(e){if(!e)return!1;try{let t=new URL(e).hostname.toLowerCase();return t===`127.0.0.1`||t===`localhost`||t===`::1`||t===`[::1]`}catch{return!1}}function As(e,t={}){let n=e.displayName,r=t.credentialClass??e.credentialClass,i=t.baseUrl??e.baseUrl;return e.id===`oonacode`?{kind:`pool`,badge:`via OonaCode`,detail:`Runs on OonaCode's own provider accounts, through the OonaCode gateway. Priced models are billed to your account in credits; free models cost nothing on any plan.`,viaGateway:!0}:e.engine===`agy`?{kind:`subscription-direct`,badge:`agy · direct to Google`,detail:`Runs on Google’s own agy CLI on this PC, with your Google plan. Each request is recorded here and goes straight from this PC to Google — never through the OonaCode gateway, and OonaCode does not translate it.`,viaGateway:!1}:e.route===`direct`?{kind:`subscription-direct`,badge:`direct to provider`,detail:`Your ${n} subscription runs straight from this PC to the provider — it never passes through the OonaCode gateway.`,viaGateway:!1}:r===`api_key`&&e.kind!==`anthropic-passthrough`?{kind:`own-key-translated`,badge:`direct to provider`,detail:`Your ${n} key stays on this PC: OonaCode translates the request here and calls ${n} from this machine. The gateway sees neither the key nor the traffic.`,viaGateway:!1}:ks(i)?{kind:`local-server`,badge:`on this machine`,detail:`Runs against ${n} on this machine (${i}) — the request never leaves the PC.`,viaGateway:!1}:r===`api_key`&&e.kind===`anthropic-passthrough`&&e.directCapable===!0?{kind:`own-key-direct`,badge:`direct to provider`,detail:`Your ${n} key runs straight from this PC to ${n} — the OonaCode gateway is not in the path.`,viaGateway:!1}:{kind:`gateway`,badge:`via OonaCode`,detail:`Routed to ${n} through the OonaCode gateway.`,viaGateway:!0}}var js=Ko(`type`,[Ho({type:es(`oauth-device`),deviceAuthorizationUrl:H().url(),tokenUrl:H().url(),clientId:H().min(1),scopes:Bo(H().min(1)).min(1),signInLabel:H().min(1).optional(),referrer:H().min(1).optional()}),Ho({type:es(`openai-device`),deviceAuthorizationUrl:H().url(),pollUrl:H().url(),tokenUrl:H().url(),verificationUri:H().url(),redirectUri:H().url(),clientId:H().min(1),signInLabel:H().min(1).optional()})]),Ms=Ho({type:es(`google-loopback`),authorizationUrl:H().url(),tokenUrl:H().url(),redirectUri:H().url(),scopes:Bo(H().min(1)).min(1),clientIdSetting:H().min(1),clientSecretSetting:H().min(1),userinfoUrl:H().url().optional(),signInLabel:H().min(1).optional()}),Ns=Ho({id:H().min(1),displayName:H().min(1),upstreamId:H().min(1).optional(),servedBy:Bo(H().min(1)).optional(),subscriptionServedBy:Bo(H().min(1)).optional(),contextWindow:Ao().int().positive().optional(),maxOutputTokens:Ao().int().positive().optional(),supportsTools:Po().optional(),supportsThinking:Po().optional(),effortLevels:Bo(Qo(ye)).optional(),helperModel:H().min(1).optional(),supportsVision:Po().optional(),inputPricePerM:Ao().nonnegative().optional(),outputPricePerM:Ao().nonnegative().optional(),creditsPerM:Ho({input:Ao().nonnegative(),output:Ao().nonnegative(),maxInput:Ao().nonnegative().optional(),maxOutput:Ao().nonnegative().optional()}).optional(),notes:H().optional(),free:Po().optional(),aaIntelligence:Ao().optional(),aaCoding:Ao().optional(),aaOutputTps:Ao().optional(),aaTtft:Ao().optional(),aa:Ho({fetchedAt:H(),creator:H().optional(),releaseDate:H().optional(),benchmarks:Xo(H(),Ao()).optional()}).loose().optional()}).loose(),Ps=Ho({id:H().regex(/^[a-z0-9][a-z0-9-]{1,40}$/,`provider id must be lowercase kebab-case`),displayName:H().min(1),kind:Qo([`anthropic-passthrough`,`openai-compatible`,`gemini`]),route:Qo([`gateway`,`direct`]),credentialClass:Qo([`api_key`,`subscription`,`none`]),baseUrl:H().url(),messagesPath:H().startsWith(`/`).optional(),modelsPath:H().startsWith(`/`).optional(),auth:Ho({header:Qo([`x-api-key`,`authorization-bearer`,`api-key`,`none`]),extraHeaders:Xo(H(),H()).optional()}),models:Bo(Ns),defaultModel:H().min(1),modelAliases:Xo(H(),H()).optional(),helperModel:H().min(1).optional(),capabilities:Ho({streaming:Po(),tools:Po(),thinking:Po(),vision:Po(),countTokens:Po(),promptCaching:Po(),promptCacheTtlSec:Ao().int().positive().optional()}),translate:Ho({maxTokensParam:Qo([`max_tokens`,`max_completion_tokens`]).optional(),reasoningEffortFromBudget:Po().optional(),reasoningContentField:H().nullable().optional(),supportsParallelToolCalls:Po().optional(),systemRole:Qo([`system`,`developer`]).optional(),streamIncludeUsage:Po().optional(),wire:Qo([`chat`,`responses`,`gemini-code-assist`]).optional()}).optional(),passthrough:Ho({stripCacheControl:Po().optional(),cacheChain:Po().optional(),toolSchemaRequiredArray:Po().optional(),toolDescriptionRequired:Po().optional(),keepOutputConfig:Po().optional(),allowedBetas:Bo(H()).optional(),anthropicVersion:H().optional()}).optional(),userBaseUrl:Po().optional(),engineEnv:Xo(H(),H()).optional(),directCapable:Po().optional(),subscriptionLogin:js.optional(),poolOnly:Po().optional(),phase:Wo([es(1),es(2)]),enabled:Po(),docsUrl:H().url().optional(),notes:H().optional(),references:Bo(Ho({label:H().min(1),url:H().url(),kind:Qo([`docs`,`pricing`,`models`,`console`,`status`,`keys`,`signup`,`other`]).optional()})).optional(),keyFormat:H().optional(),credentialVariants:Bo(Ho({id:H().min(1),label:H().min(1),header:Qo([`x-api-key`,`authorization-bearer`,`api-key`,`none`]).optional(),extraHeaders:Xo(H(),H()).optional(),operatorOnly:Po().optional(),requiresClaudeCodeIdentity:Po().optional(),subscriptionLogin:js.optional(),loopbackLogin:Ms.optional(),claudeCodeShape:Ho({betas:H().min(1),userAgent:H().min(1),billingHeader:H().min(1),headers:Xo(H(),H()).optional()}).optional(),baseUrl:H().url().optional(),keyFormat:H().optional(),notes:H().optional()})).optional(),adminGroup:H().optional(),clientGroup:H().optional(),recordLabel:H().optional(),engine:es(`agy`).optional(),effortLevels:Bo(Qo(ye)).optional()});Ho({version:Ao().int().positive(),updatedAt:H(),providers:Bo(Ps)});function Fs(e,t){return Is(e,Gs(e,t))}function Is(e,t){return e.models.find(e=>e.id===t)?.upstreamId??t}function Ls(e){return/^claude-/i.test(e)}function Rs(e){return/^claude-.+-\d{8}$/i.test(e)?e.replace(/-\d{8}$/,``):null}function zs(e){return e.replace(/\[1m\]$/i,``)}var Bs=new Set([`opus`,`sonnet`,`haiku`,`fable`]);function Vs(e){return Bs.has(e.toLowerCase())}function Hs(e,t){let n=zs(t);if(Vs(n)||e.models.some(e=>e.id===n))return null;let r=e.modelAliases;if(!r)return null;let i=Rs(n);if(i!==null&&e.models.some(e=>e.id===i))return null;let a=r[n]??(i===null?void 0:r[i]);return a!==void 0&&e.models.some(e=>e.id===a)?a:null}function Us(e,t){return{images:e.models.find(e=>e.id===t)?.supportsVision??e.capabilities.vision,documents:Ls(t)}}function Ws(e,t,n){let r=Us(e,t),i=new Set;for(let e of n){let t=e?.type;(t===`image`||t===`document`)&&i.add(t)}let a=e.models.find(e=>e.id===t)?.displayName??t;return i.has(`image`)&&!r.images?`${a} cannot read images. Remove the image, or pick a model that can — the model details say which.`:i.has(`document`)&&!r.documents?`${a} cannot read PDF documents — only Anthropic's Claude models take a PDF. Attach it as text, or pick a Claude model.`:null}function Gs(e,t){if(!t)return e.defaultModel;if(e.models.some(e=>e.id===t))return t;let n=e.modelAliases?.[t];if(n)return n;let r=Hs(e,t);if(r)return r;let i=t.toLowerCase(),a=i.includes(`haiku`)?`haiku`:i.includes(`opus`)?`opus`:i.includes(`sonnet`)?`sonnet`:i.includes(`fable`)?`fable`:null;if(a){if(e.modelAliases?.[a])return e.modelAliases[a];let t=e.models.find(e=>e.id.toLowerCase().includes(a));if(t)return t.id}return e.defaultModel}var Ks={messages:`/v1/messages`,countTokens:`/v1/messages/count_tokens`,models:`/v1/models`,providerMessages:e=>`/p/${e}/v1/messages`,providerCountTokens:e=>`/p/${e}/v1/messages/count_tokens`,providerModels:e=>`/p/${e}/v1/models`,voiceTranslation:`/v1/oonacode/voice-translation`,health:`/api/health`,streamCheck:`/api/stream-check`,register:`/api/auth/register`,login:`/api/auth/login`,refresh:`/api/auth/refresh`,logout:`/api/auth/logout`,me:`/api/auth/me`,prelogin:`/api/auth/prelogin`,tokens:`/api/me/tokens`,token:e=>`/api/me/tokens/${e}`,tokenPurge:e=>`/api/me/tokens/${e}/purge`,tokenUsage:e=>`/api/me/tokens/${e}/usage`,providers:`/api/me/providers`,provider:e=>`/api/me/providers/${e}`,providerTest:e=>`/api/me/providers/${e}/test`,routing:`/api/me/routing`,usage:`/api/me/usage`,usageSession:e=>`/api/me/usage/sessions/${e}`,usageBreakdown:`/api/me/usage/breakdown`,devices:`/api/me/devices`,pushToken:`/api/me/push-token`,hostNotify:`/api/me/hosts/notify`,device:e=>`/api/me/devices/${e}`,hosts:`/api/me/hosts`,hostHeartbeat:`/api/me/hosts/heartbeat`,hostVaultUnlock:e=>`/api/me/hosts/${encodeURIComponent(e)}/vault-unlock`,host:e=>`/api/me/hosts/${encodeURIComponent(e)}`,vault:`/api/me/vault`,vaultEvents:`/api/me/vault/events`,registry:`/api/registry`,agentTools:`/api/agent-tools`,agentToolCalls:`/api/me/agent-tools/calls`,releasesLatest:`/api/releases/latest`,releasesHistory:`/api/releases`,team:`/api/me/team`,teamInvites:`/api/me/team/invites`,teamInvite:e=>`/api/me/team/invites/${e}`,teamInviteLookup:`/api/team/invites/lookup`,teamInviteDecline:`/api/team/invites/decline`,teamJoin:`/api/me/team/join`,teamInvitations:`/api/me/team/invitations`,teamInvitationAccept:e=>`/api/me/team/invitations/${e}/accept`,teamInvitationDecline:e=>`/api/me/team/invitations/${e}/decline`,teamMember:e=>`/api/me/team/members/${e}`,teamLeave:`/api/me/team/leave`,teamTransfer:`/api/me/team/transfer`,teamAudit:`/api/me/team/audit`,teamCheckout:`/api/me/team/checkout`,teamTopup:`/api/me/team/topup`,teamSeats:`/api/me/team/seats`,googleConfig:`/api/auth/google/config`,googleStart:`/api/auth/google/start`,googleCallback:`/api/auth/google/callback`,githubConfig:`/api/auth/github/config`,githubStart:`/api/auth/github/start`,githubCallback:`/api/auth/github/callback`,googleUnlink:`/api/me/google`,telegramConfig:`/api/auth/telegram/config`,telegramAuth:`/api/auth/telegram`,telegram:`/api/me/telegram`,telegramWebhook:`/api/webhooks/telegram`,passphraseSetup:`/api/auth/passphrase/setup`,passphraseRekey:`/api/me/passphrase/rekey`,recovery:`/api/me/recovery`,recoveryChallenge:`/api/auth/recovery/challenge`,recoveryConsume:`/api/auth/recovery/consume`,deviceApprovals:`/api/me/device-approvals`,deviceApproval:e=>`/api/me/device-approvals/${e}`,deviceApprovalApprove:e=>`/api/me/device-approvals/${e}/approve`,deviceApprovalDeny:e=>`/api/me/device-approvals/${e}/deny`,passwordResetRequest:`/api/auth/password-reset/request`,passwordResetConfirm:`/api/auth/password-reset/confirm`,vaultRekeyComplete:`/api/me/vault/rekey-complete`,vaultRekeyPending:`/api/me/vault/rekey-pending`,emailVerifySend:`/api/auth/email/verify/send`,emailVerifyConfirm:`/api/auth/email/verify/confirm`,emailVerifyWatch:`/api/auth/email/verify/watch`,twoFactor:`/api/me/2fa`,twoFactorEnroll:`/api/me/2fa/enroll`,twoFactorConfirm:`/api/me/2fa/confirm`,twoFactorDisable:`/api/me/2fa/disable`,twoFactorDisableRequest:`/api/me/2fa/disable/request`,twoFactorRecoveryCodes:`/api/me/2fa/recovery-codes`,twoFactorVerify:`/api/auth/2fa/verify`,deviceLinkStart:`/api/auth/device/start`,deviceLinkPoll:`/api/auth/device/poll`,deviceLinks:`/api/me/device-links`,deviceLink:e=>`/api/me/device-links/${e}`,deviceLinkApprove:e=>`/api/me/device-links/${e}/approve`,deviceLinkDeny:e=>`/api/me/device-links/${e}/deny`,hostLogs:`/api/me/hosts/logs`,errorReport:`/api/me/errors`,bugReports:`/api/me/bug-reports`,plans:`/api/plans`,myPlan:`/api/me/plan`,checkout:`/api/me/plan/checkout`,creditsTopup:`/api/me/credits/topup`,billing:`/api/me/billing`},qs=2048,Js=16384,Ys=8e3,Xs=5242880,Zs=12582912;new Set(`BCDFGHJKLMNPQRSTVWXZ`.split(``));var Qs=`discard-my-vault-and-history`,$s=`Anyone who can use this device can use your saved provider keys without your passphrase. Turn this off on shared or public computers. You can revoke it any time from Devices.`,ec={name:120,instructions:2e4,goal:2e3,repositories:50,repositoryUrl:500,memory:2e4,minIntervalFloor:1,minIntervalCeiling:10080},tc=`⏰ Scheduled task "`;function nc(e){if(!e.startsWith(tc))return null;let t=e.indexOf(`"
76
76
 
77
- `,18);return t<0?null:{title:e.slice(18,t),prompt:e.slice(t+3)}}Object.freeze({tengu_amber_sentinel:!0,tengu_groovy_eclipse:!0,tengu_humble_hammock:!0});function rc(e){return e===null||!Number.isFinite(e)?`neutral`:e>30?`ok`:e>10?`warn`:`danger`}var ic=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],ac=/^([01]\d|2[0-3]):[0-5]\d$/;Ho({tz:H().min(1),windows:Bo(Ho({from:H().regex(ac,`HH:MM`),to:H().regex(ac,`HH:MM`),days:Bo(Qo(ic)).optional(),kind:Qo([`peak`,`offpeak`])})),offpeakDiscount:Ao().nonnegative().max(1).optional()});var oc=[`priceInputCacheMissPeak`,`priceInputCacheMissOffpeak`,`priceInputCacheHitPeak`,`priceInputCacheHitOffpeak`,`priceCacheWritePeak`,`priceCacheWriteOffpeak`,`priceOutputPeak`,`priceOutputOffpeak`],sc=Ho({inputCacheMiss:Ao().nonnegative(),inputCacheHit:Ao().nonnegative().optional(),cacheWrite:Ao().nonnegative().optional(),output:Ao().nonnegative()});Ho({by:es(`prompt_tokens`),tiers:Bo(Ho({upToPromptTokens:Ao().int().positive().optional(),price:sc.optional(),cost:sc.optional()})).min(1),note:H().optional()}).superRefine((e,t)=>{let n=0;e.tiers.forEach((r,i)=>{!r.cost&&!r.price&&t.addIssue({code:`custom`,message:`a tier needs its cost (the provider’s rates; retail is cost × the record’s ratio)`,path:[`tiers`,i,`cost`]});let a=r.upToPromptTokens;if(a===void 0){i!==e.tiers.length-1&&t.addIssue({code:`custom`,message:`only the LAST tier may omit upToPromptTokens`,path:[`tiers`,i]});return}a<=n&&t.addIssue({code:`custom`,message:`tiers must ascend: ${a} does not exceed ${n}`,path:[`tiers`,i,`upToPromptTokens`]}),n=a})}),[...oc];var cc={realtime:`/v1/realtime`,translations:`/v1/realtime/translations`,live:`/v1/live/sessions`,speechStream:`/v1/audio/speech/stream`,transcriptionStream:`/v1/audio/transcriptions/stream`,clientSecrets:`/v1/realtime/client_secrets`,translationClientSecrets:`/v1/realtime/translations/client_secrets`};cc.realtime,cc.translations,cc.live,cc.speechStream,cc.transcriptionStream;var lc=`M0.72 12a11.28 11.28 0 1 0 22.56 0a11.28 11.28 0 1 0 -22.56 0ZM4.8 12a7.2 7.2 0 1 0 14.4 0a7.2 7.2 0 1 0 -14.4 0ZM7.44 12a4.56 4.56 0 1 0 9.12 0a4.56 4.56 0 1 0 -9.12 0Z`,uc=`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`,dc=`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,fc=`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,pc={oonacode:{hex:`#000000`,owner:`OonaCode`,d:lc,fillRule:`evenodd`},anthropic:{hex:`#D97757`,owner:`Anthropic`,d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`},"anthropic-subscription":{hex:`#D97757`,owner:`Anthropic`,d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`},openai:{hex:`#000000`,owner:`OpenAI`,d:dc},xai:{hex:`#000000`,owner:`xAI`,d:uc},deepseek:{hex:`#5786FE`,owner:`DeepSeek`,d:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`},kimi:{hex:`#000000`,owner:`Moonshot`,d:`M21.765.351C22.998.351 24 1.353 24 2.586S22.998 4.82 21.765 4.82h-1.974c-.15 0-.26-.12-.26-.26V2.586A2.237 2.237 0 0 1 21.765.35M9.41 13.388l8.447-8.377c.16-.16.07-.471-.14-.471h-4.55s-.1.02-.14.06l-9.099 9.029c-.14.14-.35.02-.35-.21V4.81c0-.15-.1-.27-.221-.27H.22c-.12 0-.22.12-.22.27v18.57c0 .15.1.27.22.27h3.137c.12 0 .22-.12.22-.27v-3.79c0-.08.03-.16.08-.21l2.826-2.796c.07-.07.16-.08.241-.03l7.546 5.551a8.9 8.9 0 0 0 4.018 1.493c.12.01.23-.11.23-.27V19.76c0-.14-.08-.25-.19-.26a5.8 5.8 0 0 1-2.355-.942l-6.533-4.73c-.14-.09-.15-.32-.03-.441`},qwen:{hex:`#6950EF`,owner:`Alibaba`,d:`M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z`},"xai-subscription":{hex:`#000000`,owner:`xAI`,d:uc},"openai-subscription":{hex:`#000000`,owner:`OpenAI`,d:dc},"google-agy":{hex:`#8E75B2`,owner:`Google`,d:fc},antigravity:{hex:`#8E75B2`,owner:`Google`,d:fc},glm:{hex:`#2D2D2D`,owner:`Z.ai`,d:`M12.606 1.806l-1.677 2.388c-0.258 0.374-0.697 0.606-1.161 0.606h-9.162V1.794C0.594 1.806 12.606 1.806 12.606 1.806zM24 1.806L9.6 22.206 0 22.206 14.4 1.806zM11.394 22.206l1.69-2.4c0.258-0.374 0.697-0.606 1.161-0.606h9.149v3.006H11.394z`},mimo:{hex:`#FF6900`,owner:`Xiaomi`,d:`M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z`}};function mc(e){return pc[e]??null}function hc(e){let t=e.replace(/\(.*?\)/g,` `).split(/[\s/_-]+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():`${t[0][0]}${t[1][0]}`.toUpperCase()}var gc=9230,_c=1024,vc=65534,yc=`127.0.0.1`;Object.freeze({enabled:!1,port:gc,inspectMain:!1}),Object.freeze({port:null,listening:!1,fromCommandLine:!1,inspectPort:null,inspectProblem:null});function bc(e){return e+1}function xc(e){return typeof e==`number`&&Number.isInteger(e)}function Sc(e){return!xc(e)||e<1024||e>65534?`The port must be a whole number from ${_c.toLocaleString(`en-US`)} to ${vc.toLocaleString(`en-US`)} (the main-process inspector takes the next one).`:null}function Cc(e){return e.port!==null||e.inspectPort!==null}function wc(e,t){let n=e.enabled?e.port:null,r=e.enabled&&e.inspectMain?bc(e.port):null;return!t.fromCommandLine&&t.port!==n||t.inspectPort!==r}function Tc(e){let t=[];return e.port!==null&&t.push(`${yc}:${e.port}`),e.inspectPort!==null&&t.push(`${yc}:${e.inspectPort}`),t.length===2?`${t[0]} (windows) and ${t[1]} (main process)`:e.inspectPort===null?t[0]??``:`${t[0]} (main process)`}var Ec=[`stable`,`dev`];function Dc(e){return typeof e==`string`&&Ec.includes(e)}function Oc(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return Dc(t)?t:null}var kc=[`win32`,`linux`,`darwin`],Ac=[`x64`,`arm64`];function jc(e,t){let n=Oc(e)??`stable`,r=[];return n!==`stable`&&r.push(`channel=${encodeURIComponent(n)}`),t&&kc.includes(t.platform)&&(r.push(`platform=${t.platform}`),t.arch&&Ac.includes(t.arch)&&r.push(`arch=${t.arch}`)),r.length>0?`${Ks.releasesLatest}?${r.join(`&`)}`:Ks.releasesLatest}function Mc(e,t){let n=Oc(t)??`stable`;return n===`stable`?e:`${e} (${n})`}var Nc=5e4,Pc=6,Fc=[`bg`,`surface`,`surface-2`,`surface-3`,`border`,`fg`,`fg-muted`,`fg-faint`,`accent`,`accent-fg`,`accent-soft`,`project`,`ok`,`ok-soft`,`warn`,`warn-soft`,`danger`,`danger-soft`,`think`,`think-soft`,`code-bg`,`user-bubble`],Ic={agentFinished:!1,permissionRequired:!0,errorOccurred:!0},Lc={autoAcceptPermissions:!1,showReasoningSummaries:!0,notifications:Ic,showAgentPicker:!0,transcriptWindowSize:500,openTabs:[],draftTabs:[],draftTitles:{},activeTab:null,editorLayout:null,remoteTabs:{},sessionPanelOpen:!1,explorerOpen:!1,sidebarWidth:288,sidebarPinned:!0,dismissedUpdateVersion:null,lastSeenReleaseNotes:null,claudeImportOffered:!1,claudeImportOffers:0,collapsedProjects:[],themeColors:{light:{},dark:{}},pinned:[],sidebarView:`recent`};function Rc(e){return Math.min(Math.max(typeof e==`number`&&Number.isFinite(e)?Math.floor(e):0,0),3)}function zc(e){return Math.min(640,Math.max(200,typeof e==`number`&&Number.isFinite(e)?Math.round(e):288))}function Bc(e){return Math.min(Nc,Math.max(100,typeof e==`number`&&Number.isFinite(e)?Math.round(e):500))}function Vc(e,t){return typeof e==`boolean`?e:t}function Hc(e){return typeof e==`string`&&e.length>0&&e.length<=64?e:null}function Uc(e,t=50){if(!Array.isArray(e))return[];let n=[];for(let r of e)if(!(typeof r!=`string`||r.length===0||r.length>200)&&!n.includes(r)&&(n.push(r),n.length>=t))break;return n}function Wc(e,t=50){if(typeof e!=`object`||!e||Array.isArray(e))return{};let n={};for(let[r,i]of Object.entries(e))if(!(r.length===0||r.length>200)&&!(typeof i!=`string`||i.length===0||i.length>200)&&(n[r]=i,Object.keys(n).length>=t))break;return n}function Gc(e){if(typeof e!=`string`)return null;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t.toLowerCase():null}function Kc(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!Fc.includes(n))continue;let e=Gc(r);e!==null&&(t[n]=e)}return t}function qc(e){let t=typeof e==`object`&&e?e:{};return{light:Kc(t.light),dark:Kc(t.dark)}}function Jc(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n.kind,r=n.id;if((e===`chat`||e===`project`)&&!(typeof r!=`string`||r.length===0||r.length>200)&&!t.some(t=>t.kind===e&&t.id===r)&&(t.push({kind:e,id:r}),t.length>=50))break}return t}function Yc(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return null;let n=e,r=new Set(t),i=new Set,a=0,o=(e,t)=>{if(t>Pc||typeof e!=`object`||!e)return null;let n=e,s=n.group;if(typeof s==`object`&&s&&!Array.isArray(s)){if(a>=8)return null;let e=s,t=[];for(let n of Array.isArray(e.tabs)?e.tabs:[])typeof n!=`string`||!r.has(n)||i.has(n)||(i.add(n),t.push(n));return t.length===0?null:(a+=1,{group:{tabs:t,active:(typeof e.active==`string`&&t.includes(e.active)?e.active:null)??t[t.length-1]}})}let c=n.split;if(c!==`row`&&c!==`column`)return null;let l=Array.isArray(n.children)?n.children:[],u=Array.isArray(n.sizes)?n.sizes:[],d=[],f=[];if(l.slice(0,8).forEach((e,n)=>{let r=o(e,t+1);if(!r)return;d.push(r);let i=u[n];f.push(typeof i==`number`&&Number.isFinite(i)&&i>0?i:0)}),d.length===0)return null;if(d.length===1)return d[0];let p=f.filter(e=>e>0),m=p.length>0?p.reduce((e,t)=>e+t,0)/p.length:1,h=f.map(e=>e>0?e:m),g=h.reduce((e,t)=>e+t,0);return{split:c,sizes:h.map(e=>e/g),children:d}},s=o(n.root,0);if(!s||a<2)return null;let c=n.focused;return{root:s,focused:typeof c==`number`&&Number.isInteger(c)&&c>=0&&c<a?c:0}}function Xc(e,t,n){return e.some(e=>e.kind===t&&e.id===n)}function Zc(e,t,n,r){return r===Xc(e,t,n)?e:r?[...e.length>=50?e.slice(e.length-50+1):e,{kind:t,id:n}]:e.filter(e=>e.kind!==t||e.id!==n)}function Qc(e){let t=typeof e==`object`&&e?e:{},n=typeof t.notifications==`object`&&t.notifications!==null?t.notifications:{},r=Uc(t.openTabs),i=Uc(t.draftTabs).filter(e=>!r.includes(e)),a={};for(let[e,n]of Object.entries(Wc(t.draftTitles)))i.includes(e)&&(a[e]=n);let o=[...r,...i],s=t.activeTab,c=typeof s==`string`&&o.includes(s)?s:o[o.length-1]??null;return{autoAcceptPermissions:Vc(t.autoAcceptPermissions,Lc.autoAcceptPermissions),showReasoningSummaries:Vc(t.showReasoningSummaries,Lc.showReasoningSummaries),notifications:{agentFinished:Vc(n.agentFinished,Ic.agentFinished),permissionRequired:Vc(n.permissionRequired,Ic.permissionRequired),errorOccurred:Vc(n.errorOccurred,Ic.errorOccurred)},showAgentPicker:Vc(t.showAgentPicker,Lc.showAgentPicker),transcriptWindowSize:Bc(t.transcriptWindowSize),openTabs:r,draftTabs:i,draftTitles:a,activeTab:c,editorLayout:Yc(t.editorLayout,o),remoteTabs:Wc(t.remoteTabs),sessionPanelOpen:Vc(t.sessionPanelOpen,Lc.sessionPanelOpen),explorerOpen:Vc(t.explorerOpen,Lc.explorerOpen),sidebarWidth:zc(t.sidebarWidth),sidebarPinned:Vc(t.sidebarPinned,Lc.sidebarPinned),dismissedUpdateVersion:Hc(t.dismissedUpdateVersion),lastSeenReleaseNotes:Hc(t.lastSeenReleaseNotes),claudeImportOffered:Vc(t.claudeImportOffered,Lc.claudeImportOffered),claudeImportOffers:Rc(t.claudeImportOffers),collapsedProjects:Uc(t.collapsedProjects),themeColors:qc(t.themeColors),pinned:Jc(t.pinned),sidebarView:t.sidebarView===`projects`?`projects`:`recent`}}new Set(Object.keys(Lc));var $c=3650,el=[{version:`0.3.208`,date:`2026-10-04`,added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`]},{version:`0.3.207`,date:`2026-10-04`,added:[`Every chat lists every provider you have connected and the OonaCode pool — Google Gemini too, whatever the chat ran on before. Switching keeps the conversation: a chat moving off Google continues with its whole history, and a chat moving onto Google gives Google’s agent the conversation so far, so it can carry on.`],fixed:[`Two messages sent a moment apart while a chat was starting no longer leave one of them stuck in the queued strip: the engine had read them together as one message, and OonaCode now recognises that.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini installs Google’s agy by itself the first time you use it — open the provider in Settings → Providers, or send a message to a Google Gemini chat — instead of waiting for you to press Install.`],fixed:[`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`,`oona doctor no longer tells you to change settings that OonaCode stopped reading.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`linux`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`darwin`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`The command line’s reinstall hint on a Mac is the one that works: curl -fsSL https://oonacode.oonak.ai/install.sh | bash.`]},{version:`0.3.205`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini now lists every model your Google plan offers through agy, not only Gemini: Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B (marked “via Google”) sit beside Gemini 3.8, 3.7 and 3.6 Flash and Gemini 3.1 Pro. They run on Google’s own agent with your Google plan, and have their own usage window.`],fixed:[]},{version:`0.3.204`,date:`2026-10-04`,platforms:[`win32`],added:[`Signing in to Google Gemini opens Google’s page for you and shows how many seconds are left: Google’s agy waits only one minute for the sign-in. Paste the code Google shows and it is sent at once.`],fixed:[`Signing in to Google Gemini finishes. The code you pasted never reached Google’s agy in the installed app (the window it types into dropped everything typed), so the sign-in waited out its minute and failed.`,`The Claude sign-in’s “paste the code” box, which used the same window, can type the code too.`]},{version:`0.3.203`,date:`2026-10-04`,platforms:[`win32`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini and press Install: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back here. OonaCode never sees your password. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only, no pictures), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total (“51 agents”) is grey, instead of the other way round.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`darwin`],added:[`OonaCode runs on macOS 12 or newer: the agent, your chats, the background service and the desktop app, installed with the same one line as on Linux — curl -fsSL https://oonacode.oonak.ai/install.sh | bash. An Intel build; Apple Silicon Macs run it through Rosetta 2. Your sign-in key is kept in your login keychain.`,`Updating is the same line again, oona update in a terminal, or the update button in the app: it closes OonaCode, puts the new version in place and opens it again. The app is not signed by Apple yet, so it cannot be downloaded from a browser and does not update itself the way it does on Windows.`],fixed:[]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`linux`],added:[],fixed:[`Your sign-in survives a restart on a PC that keeps OonaCode’s key in the login keyring (GNOME Keyring, KWallet): two of OonaCode’s keys shared one keyring entry and overwrote each other, and every start of the host wrote over the stored key — so after a restart you could find yourself signed out.`,`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode (an nvm folder, for example).`,`oona update installs from the site your OonaCode was installed from, not always from oonacode.oonak.ai.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`win32`],added:[],fixed:[`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode.`]},{version:`0.3.201`,date:`2026-10-03`,added:[`The Tools menu lists only tools that work. Desktop control, Clipboard, Screen capture and Run as administrator were demos that never ran anything, and they are gone: the agent already reads and sets your clipboard, takes screenshots and asks Windows for administrator rights through its own commands.`],fixed:[`Oonak Browser keeps working when its window is behind other windows. A browser covered by the OonaCode window used to crawl, and some clicks and scrolls gave up after 30 seconds.`,`Oonak Browser no longer clicks a hidden copy of a link, or a link inside a closed menu, when a site has both a visible and a hidden one.`,`A message you send right after a reply failed no longer stays pinned above the box as “queued” once the agent has read it.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`win32`],added:[`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`],fixed:[`Oonak Browser works on sites built from web components, Google’s own forms among them: it reads, finds, clicks and types inside them, where it used to answer “the page changed” or find nothing.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`linux`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`,`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`,`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`,`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop.`,`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name matches each word, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond, and it works inside web components, Google’s own forms among them. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`,`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed — 10 days after their last change.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`,`Chats talking to each other no longer ping-pong: a reply needs no answer, several messages from the same chat are read together in one turn, and a message card says “answer requested” until the answer has gone back, then “answered” with the time.`,`A tool you switch on while a chat is replying works for the message you send next, even mid-reply. After an update, a chat that had background tasks running shows one line saying how many stopped, instead of one card per task.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`,`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`,`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`,`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption.`]},{version:`0.3.199`,date:`2026-10-02`,platforms:[`win32`],added:[`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name is smarter too: each word is matched, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`],fixed:[`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`]},{version:`0.3.198`,date:`2026-10-01`,platforms:[`win32`],added:[`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one — the phone used to show “Ask first” for a Build chat. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`Play in Listen is never greyed out for want of a voice: it gets the text ready and names the voice to install.`]},{version:`0.3.197`,date:`2026-10-01`,platforms:[`win32`],added:[`Oonak Browser, the browser your chats use, moves to version 151 by itself at its next use: a build with no Google services (no Safe Browsing warnings, push notifications or search suggestions). The download is checked against its fingerprint before anything is unpacked, and the old version is removed once no chat’s browser still runs from it.`],fixed:[`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`]},{version:`0.3.196`,date:`2026-10-01`,platforms:[`win32`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`],fixed:[`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption: the next sync that works clears it by itself.`]},{version:`0.3.195`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`Chats talking to each other no longer ping-pong. A message asks for an answer only when the chat really needs one; a reply needs no answer and is not answered with a new message; and several messages waiting from the same chat are read together in one turn. Fewer wake-ups, fewer tokens.`,`A message card says what is true: “answer requested” until the answer has gone back, then “answered” with the time — instead of an orange “reply expected” that never went away.`]},{version:`0.3.194`,date:`2026-10-01`,platforms:[`win32`],added:[`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[]},{version:`0.3.193`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`A tool you switch on while a chat is replying works for the message you send next, even mid-reply: that message now waits for the chat to restart with the new tool instead of reaching the model without it.`,`After an update, a chat that had background tasks running shows one line — “11 background tasks stopped — they were running when OonaCode restarted this chat” — instead of one card per task. Click it to see each one.`]},{version:`0.3.192`,date:`2026-09-30`,platforms:[`win32`],added:[`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop. Other languages are translated once and kept, so hearing the same briefing again costs nothing.`],fixed:[]},{version:`0.3.191`,date:`2026-09-30`,platforms:[`win32`],added:[`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed. They are deleted by themselves 10 days after their last change; resuming or editing a paused task gives it another 10 days.`],fixed:[]},{version:`0.3.190`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`]},{version:`0.3.189`,date:`2026-09-30`,platforms:[`linux`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window; “Move to main window” brings it back. On Wayland desktops the new window opens at the usual place rather than under the pointer. Your split views and windows come back when you restart OonaCode.`,`Every language plays in Listen to a chat: each language picks the best voice on its own — OonaCode’s Armenian voices first, then your system’s voices, then eSpeak (install the espeak-ng package if your system has no voice for a language).`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.188`,date:`2026-09-30`,platforms:[`win32`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window. Drag it back onto the main window’s tabs, or choose “Move to main window”, to bring it back. Your split views and popped-out windows come back when you restart OonaCode.`],fixed:[]},{version:`0.3.187`,date:`2026-09-30`,platforms:[`win32`],added:[`Every language plays in Listen to a chat. Persian, Georgian, Ukrainian — and any language whose Windows voice is not installed — now speak with eSpeak, a free voice that comes with OonaCode (it sounds robotic, but it always works). Each language picks the best voice on its own: OonaCode’s Armenian voices first, then Windows’ own, then eSpeak.`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.186`,date:`2026-09-30`,platforms:[`linux`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`,`OonaCode brings two Armenian voices of its own, Astgh and Artsiv, and also speaks with your system’s voices through speech-dispatcher — install speech-dispatcher and espeak-ng for Persian, Russian and every other language; the Listen window names the packages for your distribution.`,`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`,`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`,`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. Pin any chat or project to the top of the list from its menu.`,`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`,`Type / at the start of a message to see the chat’s commands and skills, with what each does, in two titled sections. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing; switch one on to let the model use it by itself in that chat. Typing /name still runs any skill for one turn.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`,`Search in the Import window: find a chat by its name, its first or last message or its folder, or pick “Whole conversations” to search inside the chats themselves.`],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from, with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once.`,`The message box fits a narrow chat: its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it.`,`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Only new replies change.`,`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model, /usage, /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`,`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message.`,`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`,`Typing /model in a chat updates the chat’s model and the model picker again, and command output such as /context reads the same while it arrives and after you reopen the chat.`,`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.185`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`Listening with a Windows voice no longer stops after the first sentence when the voice fails to say it has finished.`]},{version:`0.3.184`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`],fixed:[`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`]},{version:`0.3.183`,date:`2026-09-30`,platforms:[`win32`],added:[`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`],fixed:[]},{version:`0.3.182`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from — Claude Code, the Claude app, Qwen Code, Cursor — with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once. The Import button says how many chats it will bring over.`]},{version:`0.3.181`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`The message box fits a narrow chat. In a small window, or with the side panels open, its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it, and the model and effort pickers keep their words readable.`]},{version:`0.3.180`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Other models were never affected. Only new replies change; older thoughts stay empty.`]},{version:`0.3.179`,date:`2026-09-29`,platforms:[`win32`],added:[],fixed:[`The / menu is easier to read: skills and commands in two titled sections, each with one short line — the full description shows when you point at it.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model (use the model picker), /usage (the engine’s own estimate, not your credits), /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`]},{version:`0.3.178`,date:`2026-09-29`,platforms:[`win32`],added:[`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. A dot on it tells you when something is due soon.`,`Pin any chat or project to the top of the list from its menu.`],fixed:[`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.177`,date:`2026-09-29`,platforms:[`win32`],added:[`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`],fixed:[`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message, and the picker shows Sonnet 5.5.`]},{version:`0.3.176`,date:`2026-09-29`,platforms:[`win32`],added:[`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing — about 1,400 tokens on every message until now. Switch one on to let the model use it by itself in that chat; the list shows what each one costs per message while on.`,`Typing /name still runs any skill for one turn, whether its switch is on or off.`],fixed:[`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`]},{version:`0.3.175`,date:`2026-09-29`,platforms:[`win32`],added:[`Type / at the start of a message to see the chat’s commands and skills — the Claude Code engine’s own (/compact, /context, /review, /security-review, /init and more) and the skills in your project’s .claude folder — with what each does. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`],fixed:[`Typing /model in a chat updates the chat’s model and the model picker again.`,`Command output such as /context reads the same while it arrives and after you reopen the chat.`]},{version:`0.3.174`,date:`2026-09-28`,platforms:[`win32`],added:[`Search in the Import window. Type to find a chat by its name, its first or last message, or its folder — chats folded away as already imported or deleted here show up too when they match. Or open the search options and pick “Whole conversations” to search inside the chats themselves, with a few lines of each match under the chat. It only reads Claude Code, Cursor and the Claude app’s files, never changes them.`],fixed:[`Chats Claude Code switched to another model are answered by that model for real: OonaCode’s pool now serves the model the engine falls back to, and never answers a Claude request with another company’s model.`]},{version:`0.3.173`,date:`2026-09-28`,platforms:[`linux`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`,`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`,`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`,`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`,`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`,`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`A chat can no longer be moved into your home folder or the root folder through a link. Where /home is itself a link (Fedora Silverblue, Bazzite and similar systems), the home folder passed as an ordinary folder, and the chat would have loaded your own Claude Code settings as its project.`,`Signing in to your own Claude subscription inside the app works on Ubuntu 24.04, Debian, Linux Mint, Pop!_OS and Zorin OS again. There, a part of OonaCode built for newer systems did not load, and the sign-in fell back to a command you had to paste.`,"On Ubuntu, Linux Mint, Pop!_OS, Zorin OS and similar systems, `oona` now works in every new terminal right after you install or update. The installer used to leave it off your PATH until you logged out and back in; now it adds it for new terminals itself, and `oona uninstall` takes that line out again.",`Every way of uninstalling — “oona uninstall”, or the install command with --uninstall — now takes this PC off your account: keep your chats and they stay readable on your other devices; delete them and their copies go too. It never touches your Claude Code or the Claude app, and “oona uninstall” no longer gives up when the background service is stopped.`,`The installer now says at once when a system cannot run OonaCode — one older than Ubuntu 22.04, Debian 12 or RHEL 9, or one built on musl such as Alpine — instead of installing a copy that could not start. The .deb and .rpm tell apt and dnf the same.`]},{version:`0.3.172`,date:`2026-09-28`,platforms:[`win32`],added:[`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Uninstalling from Settings → Apps now also takes this PC off your account, exactly like “oona uninstall”: keep your chats and they stay readable on your other devices; delete them and their copies go too.`,`“oona uninstall” no longer gives up when the background service is stopped.`,`The “Updating OonaCode…” window shows again on the newest Windows 11 versions (24H2 and later).`]},{version:`0.3.171`,date:`2026-09-28`,platforms:[`win32`],added:[`Oonak Browser now picks its own control port from a range no developer tool uses by default, so it can no longer take a port that Shopify CLI or a dev server wants. If a program needs a particular port kept free, or you want the browser on a specific one, just ask the chat.`],fixed:[`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`Uninstalling OonaCode from Settings → Apps now removes all of it — the app, the command line and its background service — and asks whether to keep your chats. Installing again afterwards no longer says it is already installed. Your Claude Code and Claude app are never touched.`,`“oona uninstall” works again on Windows 11.`,`A chat “about” you wrote yourself no longer shows “stale”.`]},{version:`0.3.170`,date:`2026-09-28`,platforms:[`win32`],added:[`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`]},{version:`0.3.169`,date:`2026-09-28`,platforms:[`win32`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`],fixed:[`A chat can no longer be moved into your user folder or a drive root through a link or junction that points there — its project settings would have been your own Claude Code settings.`]},{version:`0.3.167`,date:`2026-09-27`,platforms:[`win32`],added:[`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`],fixed:[]},{version:`0.3.166`,date:`2026-09-27`,platforms:[`win32`],added:[],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`]},{version:`0.3.165`,date:`2026-09-27`,platforms:[`win32`],added:[`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`Chats now use Oonak Browser, in a window you can see, for everything that needs a web browser — not Chrome, Edge or a hidden script browser — unless you name another browser. It runs without a window (headless) only when you ask for that.`],fixed:[`After an update, the background service comes back by itself. An update could leave it unable to restart, and the app then showed “OonaCode could not start its host service” even though it went on to open normally.`]},{version:`0.3.164`,date:`2026-09-27`,platforms:[`win32`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when OonaCode’s stored key cannot be opened for a moment. OonaCode used to replace the key and lose your sign-in; it now keeps the key and signs you back in by itself as soon as it opens.`]},{version:`0.3.163`,date:`2026-09-27`,platforms:[`linux`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when its security chip is slow to open OonaCode’s stored key. After a system update and reboot, the chip on some machines refuses for a while; OonaCode used to replace the key and lose your sign-in. It now keeps the key and signs you back in by itself as soon as the chip opens it.`]},{version:`0.3.162`,date:`2026-09-27`,added:[],fixed:[`A chat switched to another model knows which model it is. After a switch from Claude to DeepSeek, the model used to keep saying it was Claude — the chat history and Claude Code’s own prompt told it so.`,`Oonak Browser is offered only where it can run. An older OonaCode no longer lists a browser tool it cannot use, so the model does not spend tokens working around it — update to get the browser.`]},{version:`0.3.161`,date:`2026-09-27`,added:[`Settings → This PC → “Replace pictures older than N days”: screenshots and pasted pictures in your chat history are replaced by a short note once they are older than a year (you choose the number, or 0 to keep them). The words of every chat stay; the database stops growing with pictures. It runs by itself.`],fixed:[`The model, Build/Plan/Ask and effort pickers under the message box now look like the dropdowns they are.`,`Switches that are off are easy to see in dark mode.`,`Error messages show what went wrong in words, without raw tags or a provider’s JSON.`,`The ✕ that removes an attachment or a reply is round.`,`Pressing Stop, or an update cutting a turn, no longer files an automatic bug report.`]},{version:`0.3.160`,date:`2026-09-27`,added:[`On Windows, the agent can use a real browser. Ask it to open a site, read a page, click, fill in a form or take a screenshot, and it does it in Oonak Browser, in a window you can see. The first time, OonaCode asks once to install the browser (about 210 MB); after that it opens straight away.`,`Each chat has its own browser profile, so a site you sign in to stays signed in for that chat. Switch the browser off for a chat in its Tools menu.`],fixed:[]},{version:`0.3.159`,date:`2026-09-27`,added:[],fixed:[`A chat reopened after an update no longer says “turn complete” the instant you send a message and then answer anyway. The engine’s own note about work that stopped during the update used to be taken for the end of your turn, with the whole earlier conversation’s tokens on the line.`,`A background task that stopped because OonaCode restarted now says so in plain words, instead of “Orphaned by a previous Claude Code process exit”.`]},{version:`0.3.158`,date:`2026-09-27`,added:[`Every thought in a chat shows how many words it has, so you can tell at a glance whether there is anything to read.`],fixed:[`A thought with nothing in it — some models return only a signature for their thinking — now says “Thought · empty” and no longer opens onto a blank box.`,`A command the agent was allowed to run no longer leaves an “Allowed Bash (automatically)” line under its own card: the card already shows the command and its result. Refusals are still shown.`]},{version:`0.3.157`,date:`2026-09-27`,added:[`On Linux, OonaCode has its own signed apt and dnf repositories. Install the app with apt (Debian, Ubuntu, Mint) or dnf (Fedora, RHEL, Rocky, Alma) — the commands are on the download page — and your package manager keeps it up to date with the rest of the system.`,`Every Linux release is signed with the OonaCode release key, and the one-line installer checks that signature before it installs anything.`],fixed:[`On Linux, the menu bar is drawn in the window in the app’s own colours, and it switches between light and dark with the app instead of keeping the desktop’s theme until a restart.`,`Upgrading the .rpm no longer removes the oonacode command, and removing it no longer leaves empty folders behind.`]},{version:`0.3.156`,date:`2026-09-27`,added:[`Chats can talk to each other. Turn on “Talk to other chats” in a chat’s Tools menu, and its agent can find your other chats that have it on, read them, and ask them for help — one chat or a whole group. A chat that is closed wakes up to answer; a busy one answers when it finishes. The reply comes back to the chat that asked.`,`The Conversations window (in the sidebar) shows every conversation between your chats: who said what to whom, what each answer cost, and buttons to pause, resume, close or stop them all. Each conversation has a budget — 20 messages and 1,000,000 new tokens by default — and pauses itself when it is used up, so chats can never talk forever.`,`Hover over any tool in a chat’s Tools menu to read what it does, how it works, what it costs and how to turn it off.`],fixed:[`A chat woken in the background — by a scheduled task or another chat — shows as working in the sidebar even when it is not open in a tab.`,`A scheduled task no longer slips into a chat at the same moment you send it a message; yours always goes first.`,`A message sent from the terminal no longer waits forever when a chat’s history cannot be resumed and the restart fails. It now says why.`,`Notes OonaCode writes into a chat — a model change, a conversation paused — are still there when you reopen it.`,`When every Claude seat in the OonaCode pool is taken, a new chat now says the model is busy and to try again in a few minutes or pick another model, instead of “Something went wrong on our side”.`,`On Linux, the app tells you it is updating while it swaps itself, so there is no need to start it again.`,`On Linux, removing the .deb or .rpm leaves nothing running and nothing failing at the next login, and the one-line installer checks for free disk space before it changes anything.`]},{version:`0.3.155`,date:`2026-09-27`,added:[`OonaCode runs on Linux. One command installs the command line, the background service and the desktop app: curl -fsSL https://oonacode.oonak.ai/install.sh | bash. The AppImage, .deb and .rpm are on the download page too.`,`On Linux the app lives in the system tray as it does on Windows, follows your desktop’s light or dark theme, and gets its own entry in the applications menu.`,`Uninstalling on Linux removes the desktop app along with the rest, and asks whether to keep your chats for a future install.`],fixed:[`A window no longer stays on “Unauthorized” after the background service restarts with a new key. It reconnects by itself.`]},{version:`0.3.154`,date:`2026-09-26`,added:[],fixed:[`A chat waiting on a long job no longer loses its watcher. OonaCode used to close a chat’s engine ten minutes after the model last spoke, which stopped any Monitor or background command it had left running. The engine now stays up while such work runs, up to 12 hours.`,`A chat moved into a project, or whose project you edit, now follows the project’s instructions from its next message. It used to keep the ones it started with.`]},{version:`0.3.153`,date:`2026-09-25`,added:[],fixed:[`A very long chat no longer answers “Prompt is too long” after OonaCode restarts or updates. The engine was judging the chat’s size by a figure left over from before the restart, and now gets an accurate one.`,`If a message is ever refused as too long before the model has started on it, OonaCode sends it again by itself with a shorter history. You see your message once and then the answer, not an error.`]},{version:`0.3.152`,date:`2026-09-25`,added:[],fixed:[`Uninstalling the app from Windows’ Apps list no longer stops the command-line OonaCode on the same PC from starting after a restart.`]},{version:`0.3.151`,date:`2026-09-25`,added:[`Files the agent names in a chat are clickable. Audio and video play right in the chat with a small player, pictures open as a preview, and in the app every file can be opened in its own program or shown in its folder.`,`Uninstalling the app asks whether to keep your chats on this PC. Keeping them means a new install signs in and continues every chat.`],fixed:[`Installing and updating no longer fail with “The operation has timed out” on PCs whose network drops the newer internet addresses, nor while our server restarts for an update.`]},{version:`0.3.150`,date:`2026-09-25`,added:[],fixed:[`The fix in 0.3.149 for long, sleeping turns now really reaches the agent: the Monitor tool and the block on long waits are on for every chat.`,`A chat compacted after a long pause no longer pays to cache a conversation it is about to replace, and the agent keeps each tool call in its history exactly as it wrote it — both as Claude Code does.`]},{version:`0.3.149`,date:`2026-09-25`,added:[`The agent can watch a long job with the Monitor tool, as Claude Code does, and is woken the moment the job finishes.`],fixed:[`Long chats no longer spend their time asleep. With no way to watch a background job, the agent had been polling it with waits of four to eight minutes. One chat spent more than three and a half hours of a day sleeping, and turns ran for hours while the model worked for a fraction of that. The agent now gets the same working rules as Claude Code, and long waits are blocked.`]},{version:`0.3.148`,date:`2026-09-25`,added:[],fixed:[`A scheduled task that could not be sent — the PC had just restarted, the vault was still locked, the server was not reachable yet — waits and tries again instead of switching itself off. Pausing, editing or deleting a task while its prompt is being sent is no longer undone, and a scheduled prompt no longer lands in a chat whose engine is still starting.`,`A chat on your own DeepSeek key, or one switched with a typed “/model opus”, is no longer shown as withdrawn and locked. “/model fable” picks Claude Fable instead of the default model.`,`Moving a chat to another model no longer lowers its saved effort level to what the old model offered, and a one-off “oona --effort” is no longer saved as the chat’s level.`,`After you pick another model for a locked chat and send, the chat no longer flashes the lock again while the engine starts; if the start fails, your pick is kept.`,`Coming back from a file tab no longer jumps the chat to an old reply or reopens the search bar.`,`The hidden sidebar slides away again when the pointer leaves the window past its edge, and the keyboard no longer tabs through it while it is hidden. Clicking ⓘ in Settings opens its note instead of closing it.`,`Subagents write their prompt cache for five minutes, as Claude Code does for its subscribers; the chat itself keeps the hour. Their cache writes cost less.`]},{version:`0.3.147`,date:`2026-09-25`,added:[`A chat’s scheduled tasks sit beside its subagents: a clock badge says how many are live and when the next one runs, and opens the list — each task’s schedule, its next and last run, Pause and Delete. The tasks run on this PC.`],fixed:[`A prompt the scheduler sends into a chat reads as a “Scheduled task” line, not as your own message waiting in the queue.`,`A chat whose model is no longer offered shows that model in red and waits for you to pick another; its history stays, and the old model is not in the list any more.`,`The effort list follows the server within minutes, without restarting the app. A chat set to a level that has been switched off moves to the nearest one — ultracode becomes xhigh. Chats on your own Claude subscription have an effort picker again.`]},{version:`0.3.146`,date:`2026-09-25`,added:[`A Tools menu beside the model picker: switch OonaCode’s own tools on or off for each chat — browser, desktop and window control, clipboard, screen capture, Office documents and run-as-administrator. Each tool costs the model only a short line until it is used, and the menu shows how much. The first tools are marked Demo while they are tested with every model: a demo tool answers what it would have done, and does nothing on your PC yet.`],fixed:[]},{version:`0.3.145`,date:`2026-09-25`,added:[],fixed:[`Every request of every chat, on every model, is about 3,200 tokens smaller: the engine’s own “auto memory” instructions are gone. OonaCode starts each engine in a fresh private folder and deletes it afterwards, so the notes the model was told to keep there were thrown away when the chat went idle — the model spent tool calls writing memories it would never read. A project’s memory is OonaCode’s own and stays.`,`The engine’s claude.ai Artifact tools are switched off everywhere OonaCode runs it — the app, the terminal, VS Code, the phone, Telegram and the agent API.`]},{version:`0.3.144`,date:`2026-09-25`,added:[],fixed:[`Long chats on Claude models in the OonaCode pool keep their cache for an hour, as Claude Code does for its subscribers. A pause of more than five minutes no longer re-sends the whole conversation at the full cache-write price, which in a large chat was the most expensive part of coming back to it.`,`The session panel’s Context shows how big the conversation is now, not the total of every request the chat ever made — a long chat read “10.7M / 1.0M tokens”.`,`The message box keeps the cursor after you send, so you can go straight on typing the next message.`,`A paid chat’s background work (titles, reading web pages) no longer goes to a free model of the same vendor.`]},{version:`0.3.143`,date:`2026-09-24`,added:[`Search inside your chats: open the search in the chat list, press the sliders button and choose Whole chats. It looks through every message of every chat on this PC, and you choose whose words — yours, the model’s, or both — plus, if you like, the tools’ commands and output and the subagents’ conversations. Results show each message with the words lit; a click opens the chat with its search on them.`,`More search options, for both kinds of search: one project only, a time window (today, 7 or 30 days), match case and whole words.`],fixed:[`While you search the chat list, projects with no matching chat are hidden too.`]},{version:`0.3.142`,date:`2026-09-24`,added:[],fixed:[`A reply you sent shows as the same small chip it had in the message box — “Reply to” and the first few words — instead of the whole quoted text; the full quote appears when you rest the pointer on it, and a click jumps to the message it answers.`,`The model now knows a reply points back into the conversation: it is told the quoted lines are from the chat history, not new input, and whose words they were — its own earlier reply, your earlier message, a file, or a tool’s output.`,`When the chat list is narrow, its buttons wrap onto a second line instead of spilling out of it.`]},{version:`0.3.141`,date:`2026-09-24`,added:[`The chat list on the left can be made wider or narrower: drag its right edge (double-click it for the usual width).`,`The chat list can hide: press the pin in its header, the button at the top left, or View → Sidebar (Ctrl+B). While hidden it slides in when the pointer reaches the left edge of the window, and slides away when you leave it.`,`Search in the chat list is a single magnifier now; click it and the search box opens across the top. Escape or × clears it.`],fixed:[`Opening OonaCode right after a restart no longer leaves the OonaCode pool models out of the model list: if they cannot be read yet, OonaCode asks again by itself a few seconds later and the list fills in.`,`The Artificial Analysis scores (intelligence, coding, speed and benchmarks) show on every model in the model list again — including the models of your own Claude and SuperGrok subscriptions, which never had them.`,`A chat’s details card no longer appears on top of its right-click menu.`]},{version:`0.3.140`,date:`2026-09-24`,added:[`Reply is tidier: the message you reply to shows as a small chip above the message box with its first few words, instead of filling the box. Click the chip — or the quote in a sent reply — to jump to that message; the × removes it.`,`Right-click a project in the sidebar for its settings: Project settings… opens Projects with that project already selected. The gear beside a project’s “+” does the same, and a chat filed in a project offers it in its own menu too.`,`Link GitHub. Under a project’s Repositories (and in Settings → Providers), link your GitHub account once: the agent’s git and gh then clone, pull and push your private repositories on every PC of yours. You type a short code on github.com; the token stays in your encrypted vault and never reaches the OonaCode server. Public repositories need nothing.`],fixed:[]},{version:`0.3.139`,date:`2026-09-24`,added:[`Every setting now says what it does, and resting the pointer on the ⓘ beside it tells you where in OonaCode it applies and what it does not do.`,`Export chats… is in the File menu (and on the sidebar in a browser window) instead of in Settings.`,`With Remote access turned off on a PC, your phone, Telegram, the website and your other PCs still show it — online or not — marked “remote access off”, and opening it tells you to turn Remote access back on in OonaCode on that PC.`],fixed:[`Turning Remote access off now tells your other devices at once. Before, the PC was already unreachable from them, but they could not say why.`,`The settings of This PC save the moment you change them — nothing is lost by closing the dialog.`,`Settings that did nothing, or repeated another one, are gone: the default permission mode (each chat’s Build / Plan / Ask first picker decides), the agent-picker switch, the Git Bash path, the engine path and the extra allowed origins. The server address is shown, not edited — signing in sets it.`]},{version:`0.3.138`,date:`2026-09-24`,added:[`Projects have settings now, like the Claude app’s: a goal, the repositories the project works on, what a new chat in it starts on (model, effort and folder), a project memory the agent keeps up to date, and whether its chats may schedule work — and how often at most. All of it is in Projects, and a Claude app project you import brings its own.`,`OonaCode has a scheduler. Ask the agent to do something later or on a repeat — “check the build every morning at nine” — and it schedules it on this PC; when it is due, the prompt arrives in the chat, even if the chat had gone quiet. The Projects dialog and the chat’s info panel list what is scheduled, where you can pause, resume or delete it.`],fixed:[`Saving a project’s instructions now reaches its chats at their next message, instead of waiting until the chat happened to restart.`]},{version:`0.3.137`,date:`2026-09-24`,added:[],fixed:[`After a PC restart the app could ask for a "host token" and sign you out: two copies of the OonaCode background service started at once and fought over your session. Only one ever runs now, and the app never shows the token page — if its service is replaced it reconnects by itself.`,`The unlock screen stays put until you unlock, and says what went wrong in place — a wrong password, or a connection it is re-establishing — instead of jumping to another page.`,`A message with a picture sent while the agent was working stayed “queued”, and removing it said it was already sent. It now shows as read the moment the agent takes it, and a reopened chat shows it with its picture.`,`In the model’s questions, typing your own answer now clears the options you had picked, and picking an option clears what you typed — the answer sent is exactly the one you chose. The same on the phone, in the terminal and in Telegram.`]},{version:`0.3.136`,date:`2026-09-24`,added:[`Every model now has its own housekeeper — the small, fast model of the same maker that writes a chat’s titles and reads the web pages it fetches. On the OonaCode pool a MiMo v2.6 Pro chat uses MiMo v2.6 Flash, a Qwen chat Qwen3.8 Flash, a GLM chat GLM-5.3 Flash and a GPT-5 chat GPT-5 mini, instead of doing that work on the big model itself. A free model keeps its own, so it stays free.`],fixed:[]},{version:`0.3.135`,date:`2026-09-24`,added:[],fixed:[`Claude models on the OonaCode pool — Opus 5.5, Opus 5, Sonnet 5 and Fable 5.1 — now use their whole 1M context. A long chat no longer stops to summarise itself every ~170k tokens, and its subagents get the same window.`,`Reading a web page is quick again in a Claude chat: pages are read by Claude Haiku, as in Claude Code, instead of a helper that took about a minute a page.`,`Changing a chat’s model now moves its subagents and background helpers to the new model too; before, they stayed on the old one until the app restarted.`,`MiMo v2.5 and v2.5 Pro chats now use their full 1M context too.`]},{version:`0.3.134`,date:`2026-09-23`,added:[],fixed:[`On the Android app, the model’s questions can be answered again. They come one at a time — “Question 2 of 3” — with Back, Next and Skip, and Answer sends them to your PC. The card used to show only the first question, hide the rest below it and wait for all of them, so it could not be sent.`]},{version:`0.3.133`,date:`2026-09-23`,added:[`Bring your Claude desktop app projects across: File → Import chats from other coding agents now lists every project the Claude app has opened on this PC. Each one arrives as an OonaCode project of the same name — its goal, instructions and what Claude noted about it become the project’s instructions — with its project chat and one chat per thread filed under it, ready to carry on.`,`A Claude Code chat you moved into a Claude app project is filed under that project here too.`,`A thread you never opened in the Claude app still comes across, with its task and every reply the project chat saw; open it once in the Claude app and import again for its whole conversation.`],fixed:[`Cursor chats appear in the import list again — they had been left out since September 10.`]},{version:`0.3.132`,date:`2026-09-23`,added:[`Reply to any part of a chat: select some text (or just right-click a block), choose Reply, and it is quoted in your message box — type your answer under it. A quote from a file the agent read names the file.`,`Right-click in a chat: copy what you selected, copy a whole reply or tool output, copy a code block or a link, find the selected words in the chat, or select a block.`,`Search in a chat opens the block its match is in — a folded tool card, a thought, a finished agent’s work — and scrolls to the words themselves.`,`Search matches are now bright orange, the current one strongest, so they stand out on code too.`,`The file viewer shows pictures (PNG, JPEG, GIF, WebP, SVG and more), plays audio and video, and shows Markdown formatted, with a switch to the source.`,`Right-click a file or folder in the explorer to copy its path or delete it.`],fixed:[`Moving a chat to another folder or project while it was working could delete the folder it was working in, start two agents at once, or send your next message to the old folder.`,`The working line no longer says a chat may be stuck while it waits for your approval or answer, or right after you send a message, and it counts time correctly (no more "4m 60s").`,`A date line no longer says "Today" for yesterday’s messages when the app stays open past midnight.`,"Installing with npm (`npm i -g oonacode`) installs this version again; earlier npm releases carried an old program.",`The What’s new window could open again on the next start, showing the same update a second time.`,`An older OonaCode window or VS Code extension no longer resets settings it does not know about, such as your theme colours or which project groups you folded.`,`A new install no longer opens with a list of changes; this window now appears only after an update.`,`The notification switch for permissions now says it also covers the agent’s questions.`]},{version:`0.3.131`,date:`2026-09-23`,added:[`Claude Opus 5.5 is here — the newest Opus, and cheaper to run than Opus 5. Choose it in the model picker, from the OonaCode pool or on your own Claude subscription. It runs on the newer Claude Code engine (2.1.280) that this update brings.`,`Every block in a chat shows its time at the bottom right, in your local time — hover it for the full date — and a date line marks where each day starts.`,`A running chat tells you how long the agent has been quiet, and after five minutes that it may be stuck and what to do.`,`After every update, OonaCode now opens this window to show you what changed.`],fixed:[`A reply that streamed in live had no time on it until the chat was opened again.`,`Chats open in tabs could fail to come back after a restart if a setting changed while they were being restored.`]}];function tl(e,t){let n=e=>{let[t,...n]=e.trim().replace(/^v/,``).split(`-`);return{nums:(t??``).split(`.`).map(e=>Number.parseInt(e,10)||0),pre:n.length>0?n.join(`-`):null}},r=n(e),i=n(t);for(let e=0;e<Math.max(r.nums.length,i.nums.length);e++){let t=(r.nums[e]??0)-(i.nums[e]??0);if(t!==0)return t}return r.pre===i.pre?0:r.pre===null?1:i.pre===null?-1:nl(r.pre,i.pre)}function nl(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===i)continue;if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t),o=/^\d+$/.test(i);if(a&&o){let e=Number(t)-Number(i);if(e!==0)return e;continue}return a===o?t<i?-1:1:a?-1:1}return 0}function rl(e,t,n=el,r=null){if(!e||e===`0.0.0`)return[];let i=n.filter(t=>tl(t.version,e)<=0&&(!r||!t.platforms||t.platforms.includes(r)));return[...t===null?i.filter(t=>tl(t.version,e)===0):i.filter(e=>tl(e.version,t)>0)].sort((e,t)=>tl(t.version,e.version))}function il(e,t,n,r=el,i=null){if(!e||e===`0.0.0`)return{record:null,show:[]};let a=null;for(let e of r)(a===null||tl(e.version,a)>0)&&(a=e.version);let o=a!==null&&tl(e,a)>0?a:e;return{record:t===null||tl(o,t)>0?o:null,show:t===null&&!n?[]:rl(e,t,r,i)}}function al(e,t){if(t==null)return[...e];if(t.length===0)return[];let n=new Set(t),r=e.filter(e=>n.has(e.id));return r.length>0?r:[...e]}var ol=`:free`;function sl(e){return e.endsWith(ol)}function cl(e){return sl(e)?e.slice(0,-5):e}var ll=`the user skipped the question`,ul=`(the user skipped this question)`;function dl(e){let t=e?.questions;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e;if(typeof t.question!=`string`)continue;let r=Array.isArray(t.options)?t.options.map(e=>e&&typeof e==`object`?e:null).filter(e=>e!==null&&typeof e.label==`string`).map(e=>({label:e.label,...typeof e.description==`string`?{description:e.description}:{}})):[];n.push({question:t.question,header:typeof t.header==`string`?t.header:``,options:r,multiSelect:t.multiSelect===!0})}return n}function fl(e,t,n={},r=new Set){let i={};return e.forEach((e,a)=>{if(r.has(a)){i[e.question]=ul;return}let o=(n[a]??``).trim();i[e.question]=o||(t[a]??[]).join(`, `)}),i}function pl(e){let t=e.questions,n=t===1?`question`:`questions`,r=t===1?`the model’s question`:`the model’s questions`,i=t===1?`The model’s question was`:`The model’s questions were`;switch(e.outcome){case`answered`:{let r=e.answers?Object.values(e.answers):null,i=r?r.filter(e=>typeof e==`string`&&e!==``&&e!==`(the user skipped this question)`).length:t;return t>0&&i<t?`You answered ${i} of ${t} ${n}`:t===0?`You answered the model’s questions`:t===1?`You answered the model’s question`:`You answered ${t} ${n}`}case`skipped`:return`You skipped ${r}`;case`dismissed`:return`${i} dismissed`;case`unanswered`:return`${i} not answered — the turn ended`}}function ml(e){if(!e||typeof e!=`object`)return null;let t=e.answers;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}var hl=[`win32`,`linux`,`darwin`],gl=[`demo`,`live`],_l=[`allow`,`ask`],vl=[`string`,`number`,`integer`,`boolean`,`array`,`object`];function yl(e){let t=e/1048576;return t>=100?`${Math.round(t)} MB`:t>=1?`${t.toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function bl(e){if(e.toolName!==`InstallToolPack`)return null;let t=e.input;return!t||typeof t!=`object`||typeof t.pack!=`string`||typeof t.name!=`string`||typeof t.version!=`string`||typeof t.sizeBytes!=`number`||typeof t.path!=`string`?null:{pack:t.pack,name:t.name,version:t.version,sizeBytes:t.sizeBytes,path:t.path}}function xl(e,t){let n=t?.[e.slug];return typeof n==`boolean`?n:e.defaultOn}function Sl(e,t){return e.filter(e=>xl(e,t))}var Cl={slug:48,name:80,entryTool:40,description:2e3,promptLine:1e3,details:8e3,actionDescription:1e3,params:30,paramName:48,paramDescription:400,enumValues:40,callArgKeys:20,callError:500,callBatch:100},wl=/^[A-Za-z0-9_-]+$/;function Tl(e){return typeof e==`string`&&e.length>0&&e.length<=Cl.entryTool&&wl.test(e)}function El(e){return Math.ceil(e.length/4)}function Dl(e){return El(`${e.entryTool} ${e.description}`)+55}function Ol(e){return e.tokensPerRequest??Dl(e)+(e.promptLine?El(e.promptLine):0)}var kl=Ho({type:Qo(vl),required:Po().optional(),enum:Bo(Wo([H(),Ao()])).optional(),description:H().optional()}),Al=Ho({slug:H().min(1),description:H(),params:Xo(H(),kl),permission:Qo(_l),sort:Ao()}),jl=Ho({version:H(),url:H(),sha256:H(),sizeBytes:Ao(),exe:H(),format:es(`zip`)}),Ml=Ho({slug:H().min(1),name:H(),entryTool:H().refine(Tl,`not a valid tool name`),description:H(),promptLine:H().nullable(),details:H().nullable().optional(),status:Qo(gl),defaultOn:Po(),sort:Ao(),install:jl.nullable(),actions:Bo(Al)}).loose();Ho({platform:Qo(hl),version:H(),packs:Bo(Ml),refreshMinutes:Ao()});var Nl=[`No answer needed.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. Your final answer goes back to that chat by itself.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. It asked for no answer, so nothing goes back.`,`Last hop of this chain: you cannot message chats in this turn; put what you have in your final answer.`];[`**Let this chat work together with your other chats.**`,``,`### What it does`,`- Finds your other chats on this PC and reads their recent messages.`,`- Sends one chat, or a group of chats, a message or a task.`,`- Brings their answers back to this chat, by itself.`,``,`### How it works`,`- A chat that is asleep is woken from its saved history. A busy one gets the message when its current turn ends, never in the middle of it.`,`- The other chat does the work with its own model, folder and tools. Its answer comes back here as a new message only when this chat asked for one.`,`- Several messages from one chat that wait for a busy chat are handed over together, in one turn, with one answer.`,`- Several chats can share one conversation (a group). An answer goes only to the chat that asked, so a group cannot multiply its own messages.`,`- A chat with this switch OFF can still be messaged by a chat that has it on. It does the work, and its final answer goes back to that chat when that chat asked for one. That is all it can do: it gets none of these tools, cannot message or read other chats, and its switch stays off.`,``,`### What it costs`,`- About 650 tokens on every request while it is on, read from the prompt cache. Nothing while it is off, even in a chat that is messaged.`,`- Every message makes the chat that receives it do a turn, which spends its own tokens.`,`- Switching it on or off in a chat that already has a conversation re-writes its prompt cache once.`,``,`### Safety limits`,`- Each conversation has a budget: 20 delivered messages and 1,000,000 new tokens by default (context read back from the prompt cache is not counted). Reaching either pauses the conversation, and the chats say so.`,`- A chain stops after 3 hops (a message caused by a message caused by a message).`,`- At most 5 messages between two chats and 20 from one chat in 10 minutes, and 10 waiting for any one chat. A chat cannot message itself.`,`- A conversation with no activity for 24 hours closes by itself.`,``,`### How to stop it`,`- Turn this switch off: the chat loses these tools, and what it sent and the answers it asked for pause. It still answers a chat that messages it.`,`- Or open the Conversations window and use Pause, Close or Stop all.`,``,`### Privacy`,`- Everything stays on your PC: the messages are kept in this PC's database, never on OonaCode's server.`,`- A message never grants anything. The other chat runs with its own permissions and asks you as usual.`,``,`Only a chat with this switch on can start a conversation; a chat with it off only answers.`].join(`
77
+ `,18);return t<0?null:{title:e.slice(18,t),prompt:e.slice(t+3)}}Object.freeze({tengu_amber_sentinel:!0,tengu_groovy_eclipse:!0,tengu_humble_hammock:!0});function rc(e){return e===null||!Number.isFinite(e)?`neutral`:e>30?`ok`:e>10?`warn`:`danger`}var ic=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],ac=/^([01]\d|2[0-3]):[0-5]\d$/;Ho({tz:H().min(1),windows:Bo(Ho({from:H().regex(ac,`HH:MM`),to:H().regex(ac,`HH:MM`),days:Bo(Qo(ic)).optional(),kind:Qo([`peak`,`offpeak`])})),offpeakDiscount:Ao().nonnegative().max(1).optional()});var oc=[`priceInputCacheMissPeak`,`priceInputCacheMissOffpeak`,`priceInputCacheHitPeak`,`priceInputCacheHitOffpeak`,`priceCacheWritePeak`,`priceCacheWriteOffpeak`,`priceOutputPeak`,`priceOutputOffpeak`],sc=Ho({inputCacheMiss:Ao().nonnegative(),inputCacheHit:Ao().nonnegative().optional(),cacheWrite:Ao().nonnegative().optional(),output:Ao().nonnegative()});Ho({by:es(`prompt_tokens`),tiers:Bo(Ho({upToPromptTokens:Ao().int().positive().optional(),price:sc.optional(),cost:sc.optional()})).min(1),note:H().optional()}).superRefine((e,t)=>{let n=0;e.tiers.forEach((r,i)=>{!r.cost&&!r.price&&t.addIssue({code:`custom`,message:`a tier needs its cost (the provider’s rates; retail is cost × the record’s ratio)`,path:[`tiers`,i,`cost`]});let a=r.upToPromptTokens;if(a===void 0){i!==e.tiers.length-1&&t.addIssue({code:`custom`,message:`only the LAST tier may omit upToPromptTokens`,path:[`tiers`,i]});return}a<=n&&t.addIssue({code:`custom`,message:`tiers must ascend: ${a} does not exceed ${n}`,path:[`tiers`,i,`upToPromptTokens`]}),n=a})}),[...oc];var cc={realtime:`/v1/realtime`,translations:`/v1/realtime/translations`,live:`/v1/live/sessions`,speechStream:`/v1/audio/speech/stream`,transcriptionStream:`/v1/audio/transcriptions/stream`,clientSecrets:`/v1/realtime/client_secrets`,translationClientSecrets:`/v1/realtime/translations/client_secrets`};cc.realtime,cc.translations,cc.live,cc.speechStream,cc.transcriptionStream;var lc=`M0.72 12a11.28 11.28 0 1 0 22.56 0a11.28 11.28 0 1 0 -22.56 0ZM4.8 12a7.2 7.2 0 1 0 14.4 0a7.2 7.2 0 1 0 -14.4 0ZM7.44 12a4.56 4.56 0 1 0 9.12 0a4.56 4.56 0 1 0 -9.12 0Z`,uc=`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`,dc=`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,fc=`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,pc={oonacode:{hex:`#000000`,owner:`OonaCode`,d:lc,fillRule:`evenodd`},anthropic:{hex:`#D97757`,owner:`Anthropic`,d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`},"anthropic-subscription":{hex:`#D97757`,owner:`Anthropic`,d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`},openai:{hex:`#000000`,owner:`OpenAI`,d:dc},xai:{hex:`#000000`,owner:`xAI`,d:uc},deepseek:{hex:`#5786FE`,owner:`DeepSeek`,d:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`},kimi:{hex:`#000000`,owner:`Moonshot`,d:`M21.765.351C22.998.351 24 1.353 24 2.586S22.998 4.82 21.765 4.82h-1.974c-.15 0-.26-.12-.26-.26V2.586A2.237 2.237 0 0 1 21.765.35M9.41 13.388l8.447-8.377c.16-.16.07-.471-.14-.471h-4.55s-.1.02-.14.06l-9.099 9.029c-.14.14-.35.02-.35-.21V4.81c0-.15-.1-.27-.221-.27H.22c-.12 0-.22.12-.22.27v18.57c0 .15.1.27.22.27h3.137c.12 0 .22-.12.22-.27v-3.79c0-.08.03-.16.08-.21l2.826-2.796c.07-.07.16-.08.241-.03l7.546 5.551a8.9 8.9 0 0 0 4.018 1.493c.12.01.23-.11.23-.27V19.76c0-.14-.08-.25-.19-.26a5.8 5.8 0 0 1-2.355-.942l-6.533-4.73c-.14-.09-.15-.32-.03-.441`},qwen:{hex:`#6950EF`,owner:`Alibaba`,d:`M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z`},"xai-subscription":{hex:`#000000`,owner:`xAI`,d:uc},"openai-subscription":{hex:`#000000`,owner:`OpenAI`,d:dc},"google-agy":{hex:`#8E75B2`,owner:`Google`,d:fc},antigravity:{hex:`#8E75B2`,owner:`Google`,d:fc},glm:{hex:`#2D2D2D`,owner:`Z.ai`,d:`M12.606 1.806l-1.677 2.388c-0.258 0.374-0.697 0.606-1.161 0.606h-9.162V1.794C0.594 1.806 12.606 1.806 12.606 1.806zM24 1.806L9.6 22.206 0 22.206 14.4 1.806zM11.394 22.206l1.69-2.4c0.258-0.374 0.697-0.606 1.161-0.606h9.149v3.006H11.394z`},mimo:{hex:`#FF6900`,owner:`Xiaomi`,d:`M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z`}};function mc(e){return pc[e]??null}function hc(e){let t=e.replace(/\(.*?\)/g,` `).split(/[\s/_-]+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():`${t[0][0]}${t[1][0]}`.toUpperCase()}var gc=9230,_c=1024,vc=65534,yc=`127.0.0.1`;Object.freeze({enabled:!1,port:gc,inspectMain:!1}),Object.freeze({port:null,listening:!1,fromCommandLine:!1,inspectPort:null,inspectProblem:null});function bc(e){return e+1}function xc(e){return typeof e==`number`&&Number.isInteger(e)}function Sc(e){return!xc(e)||e<1024||e>65534?`The port must be a whole number from ${_c.toLocaleString(`en-US`)} to ${vc.toLocaleString(`en-US`)} (the main-process inspector takes the next one).`:null}function Cc(e){return e.port!==null||e.inspectPort!==null}function wc(e,t){let n=e.enabled?e.port:null,r=e.enabled&&e.inspectMain?bc(e.port):null;return!t.fromCommandLine&&t.port!==n||t.inspectPort!==r}function Tc(e){let t=[];return e.port!==null&&t.push(`${yc}:${e.port}`),e.inspectPort!==null&&t.push(`${yc}:${e.inspectPort}`),t.length===2?`${t[0]} (windows) and ${t[1]} (main process)`:e.inspectPort===null?t[0]??``:`${t[0]} (main process)`}var Ec=[`stable`,`dev`];function Dc(e){return typeof e==`string`&&Ec.includes(e)}function Oc(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return Dc(t)?t:null}var kc=[`win32`,`linux`,`darwin`],Ac=[`x64`,`arm64`];function jc(e,t){let n=Oc(e)??`stable`,r=[];return n!==`stable`&&r.push(`channel=${encodeURIComponent(n)}`),t&&kc.includes(t.platform)&&(r.push(`platform=${t.platform}`),t.arch&&Ac.includes(t.arch)&&r.push(`arch=${t.arch}`)),r.length>0?`${Ks.releasesLatest}?${r.join(`&`)}`:Ks.releasesLatest}function Mc(e,t){let n=Oc(t)??`stable`;return n===`stable`?e:`${e} (${n})`}var Nc=5e4,Pc=6,Fc=[`bg`,`surface`,`surface-2`,`surface-3`,`border`,`fg`,`fg-muted`,`fg-faint`,`accent`,`accent-fg`,`accent-soft`,`project`,`ok`,`ok-soft`,`warn`,`warn-soft`,`danger`,`danger-soft`,`think`,`think-soft`,`code-bg`,`user-bubble`],Ic={agentFinished:!1,permissionRequired:!0,errorOccurred:!0},Lc={autoAcceptPermissions:!1,showReasoningSummaries:!0,notifications:Ic,showAgentPicker:!0,transcriptWindowSize:500,openTabs:[],draftTabs:[],draftTitles:{},activeTab:null,editorLayout:null,remoteTabs:{},sessionPanelOpen:!1,explorerOpen:!1,sidebarWidth:288,sidebarPinned:!0,dismissedUpdateVersion:null,lastSeenReleaseNotes:null,claudeImportOffered:!1,claudeImportOffers:0,collapsedProjects:[],themeColors:{light:{},dark:{}},pinned:[],sidebarView:`recent`};function Rc(e){return Math.min(Math.max(typeof e==`number`&&Number.isFinite(e)?Math.floor(e):0,0),3)}function zc(e){return Math.min(640,Math.max(200,typeof e==`number`&&Number.isFinite(e)?Math.round(e):288))}function Bc(e){return Math.min(Nc,Math.max(100,typeof e==`number`&&Number.isFinite(e)?Math.round(e):500))}function Vc(e,t){return typeof e==`boolean`?e:t}function Hc(e){return typeof e==`string`&&e.length>0&&e.length<=64?e:null}function Uc(e,t=50){if(!Array.isArray(e))return[];let n=[];for(let r of e)if(!(typeof r!=`string`||r.length===0||r.length>200)&&!n.includes(r)&&(n.push(r),n.length>=t))break;return n}function Wc(e,t=50){if(typeof e!=`object`||!e||Array.isArray(e))return{};let n={};for(let[r,i]of Object.entries(e))if(!(r.length===0||r.length>200)&&!(typeof i!=`string`||i.length===0||i.length>200)&&(n[r]=i,Object.keys(n).length>=t))break;return n}function Gc(e){if(typeof e!=`string`)return null;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t.toLowerCase():null}function Kc(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!Fc.includes(n))continue;let e=Gc(r);e!==null&&(t[n]=e)}return t}function qc(e){let t=typeof e==`object`&&e?e:{};return{light:Kc(t.light),dark:Kc(t.dark)}}function Jc(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n.kind,r=n.id;if((e===`chat`||e===`project`)&&!(typeof r!=`string`||r.length===0||r.length>200)&&!t.some(t=>t.kind===e&&t.id===r)&&(t.push({kind:e,id:r}),t.length>=50))break}return t}function Yc(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return null;let n=e,r=new Set(t),i=new Set,a=0,o=(e,t)=>{if(t>Pc||typeof e!=`object`||!e)return null;let n=e,s=n.group;if(typeof s==`object`&&s&&!Array.isArray(s)){if(a>=8)return null;let e=s,t=[];for(let n of Array.isArray(e.tabs)?e.tabs:[])typeof n!=`string`||!r.has(n)||i.has(n)||(i.add(n),t.push(n));return t.length===0?null:(a+=1,{group:{tabs:t,active:(typeof e.active==`string`&&t.includes(e.active)?e.active:null)??t[t.length-1]}})}let c=n.split;if(c!==`row`&&c!==`column`)return null;let l=Array.isArray(n.children)?n.children:[],u=Array.isArray(n.sizes)?n.sizes:[],d=[],f=[];if(l.slice(0,8).forEach((e,n)=>{let r=o(e,t+1);if(!r)return;d.push(r);let i=u[n];f.push(typeof i==`number`&&Number.isFinite(i)&&i>0?i:0)}),d.length===0)return null;if(d.length===1)return d[0];let p=f.filter(e=>e>0),m=p.length>0?p.reduce((e,t)=>e+t,0)/p.length:1,h=f.map(e=>e>0?e:m),g=h.reduce((e,t)=>e+t,0);return{split:c,sizes:h.map(e=>e/g),children:d}},s=o(n.root,0);if(!s||a<2)return null;let c=n.focused;return{root:s,focused:typeof c==`number`&&Number.isInteger(c)&&c>=0&&c<a?c:0}}function Xc(e,t,n){return e.some(e=>e.kind===t&&e.id===n)}function Zc(e,t,n,r){return r===Xc(e,t,n)?e:r?[...e.length>=50?e.slice(e.length-50+1):e,{kind:t,id:n}]:e.filter(e=>e.kind!==t||e.id!==n)}function Qc(e){let t=typeof e==`object`&&e?e:{},n=typeof t.notifications==`object`&&t.notifications!==null?t.notifications:{},r=Uc(t.openTabs),i=Uc(t.draftTabs).filter(e=>!r.includes(e)),a={};for(let[e,n]of Object.entries(Wc(t.draftTitles)))i.includes(e)&&(a[e]=n);let o=[...r,...i],s=t.activeTab,c=typeof s==`string`&&o.includes(s)?s:o[o.length-1]??null;return{autoAcceptPermissions:Vc(t.autoAcceptPermissions,Lc.autoAcceptPermissions),showReasoningSummaries:Vc(t.showReasoningSummaries,Lc.showReasoningSummaries),notifications:{agentFinished:Vc(n.agentFinished,Ic.agentFinished),permissionRequired:Vc(n.permissionRequired,Ic.permissionRequired),errorOccurred:Vc(n.errorOccurred,Ic.errorOccurred)},showAgentPicker:Vc(t.showAgentPicker,Lc.showAgentPicker),transcriptWindowSize:Bc(t.transcriptWindowSize),openTabs:r,draftTabs:i,draftTitles:a,activeTab:c,editorLayout:Yc(t.editorLayout,o),remoteTabs:Wc(t.remoteTabs),sessionPanelOpen:Vc(t.sessionPanelOpen,Lc.sessionPanelOpen),explorerOpen:Vc(t.explorerOpen,Lc.explorerOpen),sidebarWidth:zc(t.sidebarWidth),sidebarPinned:Vc(t.sidebarPinned,Lc.sidebarPinned),dismissedUpdateVersion:Hc(t.dismissedUpdateVersion),lastSeenReleaseNotes:Hc(t.lastSeenReleaseNotes),claudeImportOffered:Vc(t.claudeImportOffered,Lc.claudeImportOffered),claudeImportOffers:Rc(t.claudeImportOffers),collapsedProjects:Uc(t.collapsedProjects),themeColors:qc(t.themeColors),pinned:Jc(t.pinned),sidebarView:t.sidebarView===`projects`?`projects`:`recent`}}new Set(Object.keys(Lc));var $c=3650,el=[{version:`0.3.209`,date:`2026-10-05`,platforms:[`win32`,`darwin`],added:[`Scheduled tasks say which model a run uses: always the chat’s model at the moment the task fires, named in the Scheduled tasks panel.`],fixed:[`A Google Gemini chat keeps Google’s agent running for half an hour between messages, so the next message after a pause no longer waits about four seconds for agy to start.`,`Commands run in a Google Gemini chat reach servers on your own PC (localhost) and plain http:// sites again.`]},{version:`0.3.209`,date:`2026-10-05`,platforms:[`linux`],added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`,`Scheduled tasks say which model a run uses: always the chat’s model at the moment the task fires, named in the Scheduled tasks panel.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`,`A Google Gemini chat keeps Google’s agent running for half an hour between messages, so the next message after a pause no longer waits about four seconds for agy to start.`,`Commands run in a Google Gemini chat reach servers on your own PC (localhost) and plain http:// sites again.`]},{version:`0.3.208`,date:`2026-10-04`,platforms:[`win32`,`darwin`],added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`]},{version:`0.3.207`,date:`2026-10-04`,added:[`Every chat lists every provider you have connected and the OonaCode pool — Google Gemini too, whatever the chat ran on before. Switching keeps the conversation: a chat moving off Google continues with its whole history, and a chat moving onto Google gives Google’s agent the conversation so far, so it can carry on.`],fixed:[`Two messages sent a moment apart while a chat was starting no longer leave one of them stuck in the queued strip: the engine had read them together as one message, and OonaCode now recognises that.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini installs Google’s agy by itself the first time you use it — open the provider in Settings → Providers, or send a message to a Google Gemini chat — instead of waiting for you to press Install.`],fixed:[`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`,`oona doctor no longer tells you to change settings that OonaCode stopped reading.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`linux`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`darwin`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`The command line’s reinstall hint on a Mac is the one that works: curl -fsSL https://oonacode.oonak.ai/install.sh | bash.`]},{version:`0.3.205`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini now lists every model your Google plan offers through agy, not only Gemini: Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B (marked “via Google”) sit beside Gemini 3.8, 3.7 and 3.6 Flash and Gemini 3.1 Pro. They run on Google’s own agent with your Google plan, and have their own usage window.`],fixed:[]},{version:`0.3.204`,date:`2026-10-04`,platforms:[`win32`],added:[`Signing in to Google Gemini opens Google’s page for you and shows how many seconds are left: Google’s agy waits only one minute for the sign-in. Paste the code Google shows and it is sent at once.`],fixed:[`Signing in to Google Gemini finishes. The code you pasted never reached Google’s agy in the installed app (the window it types into dropped everything typed), so the sign-in waited out its minute and failed.`,`The Claude sign-in’s “paste the code” box, which used the same window, can type the code too.`]},{version:`0.3.203`,date:`2026-10-04`,platforms:[`win32`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini and press Install: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back here. OonaCode never sees your password. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only, no pictures), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total (“51 agents”) is grey, instead of the other way round.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`darwin`],added:[`OonaCode runs on macOS 12 or newer: the agent, your chats, the background service and the desktop app, installed with the same one line as on Linux — curl -fsSL https://oonacode.oonak.ai/install.sh | bash. An Intel build; Apple Silicon Macs run it through Rosetta 2. Your sign-in key is kept in your login keychain.`,`Updating is the same line again, oona update in a terminal, or the update button in the app: it closes OonaCode, puts the new version in place and opens it again. The app is not signed by Apple yet, so it cannot be downloaded from a browser and does not update itself the way it does on Windows.`],fixed:[]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`linux`],added:[],fixed:[`Your sign-in survives a restart on a PC that keeps OonaCode’s key in the login keyring (GNOME Keyring, KWallet): two of OonaCode’s keys shared one keyring entry and overwrote each other, and every start of the host wrote over the stored key — so after a restart you could find yourself signed out.`,`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode (an nvm folder, for example).`,`oona update installs from the site your OonaCode was installed from, not always from oonacode.oonak.ai.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`win32`],added:[],fixed:[`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode.`]},{version:`0.3.201`,date:`2026-10-03`,added:[`The Tools menu lists only tools that work. Desktop control, Clipboard, Screen capture and Run as administrator were demos that never ran anything, and they are gone: the agent already reads and sets your clipboard, takes screenshots and asks Windows for administrator rights through its own commands.`],fixed:[`Oonak Browser keeps working when its window is behind other windows. A browser covered by the OonaCode window used to crawl, and some clicks and scrolls gave up after 30 seconds.`,`Oonak Browser no longer clicks a hidden copy of a link, or a link inside a closed menu, when a site has both a visible and a hidden one.`,`A message you send right after a reply failed no longer stays pinned above the box as “queued” once the agent has read it.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`win32`],added:[`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`],fixed:[`Oonak Browser works on sites built from web components, Google’s own forms among them: it reads, finds, clicks and types inside them, where it used to answer “the page changed” or find nothing.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`linux`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`,`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`,`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`,`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop.`,`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name matches each word, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond, and it works inside web components, Google’s own forms among them. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`,`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed — 10 days after their last change.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`,`Chats talking to each other no longer ping-pong: a reply needs no answer, several messages from the same chat are read together in one turn, and a message card says “answer requested” until the answer has gone back, then “answered” with the time.`,`A tool you switch on while a chat is replying works for the message you send next, even mid-reply. After an update, a chat that had background tasks running shows one line saying how many stopped, instead of one card per task.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`,`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`,`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`,`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption.`]},{version:`0.3.199`,date:`2026-10-02`,platforms:[`win32`],added:[`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name is smarter too: each word is matched, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`],fixed:[`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`]},{version:`0.3.198`,date:`2026-10-01`,platforms:[`win32`],added:[`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one — the phone used to show “Ask first” for a Build chat. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`Play in Listen is never greyed out for want of a voice: it gets the text ready and names the voice to install.`]},{version:`0.3.197`,date:`2026-10-01`,platforms:[`win32`],added:[`Oonak Browser, the browser your chats use, moves to version 151 by itself at its next use: a build with no Google services (no Safe Browsing warnings, push notifications or search suggestions). The download is checked against its fingerprint before anything is unpacked, and the old version is removed once no chat’s browser still runs from it.`],fixed:[`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`]},{version:`0.3.196`,date:`2026-10-01`,platforms:[`win32`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`],fixed:[`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption: the next sync that works clears it by itself.`]},{version:`0.3.195`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`Chats talking to each other no longer ping-pong. A message asks for an answer only when the chat really needs one; a reply needs no answer and is not answered with a new message; and several messages waiting from the same chat are read together in one turn. Fewer wake-ups, fewer tokens.`,`A message card says what is true: “answer requested” until the answer has gone back, then “answered” with the time — instead of an orange “reply expected” that never went away.`]},{version:`0.3.194`,date:`2026-10-01`,platforms:[`win32`],added:[`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[]},{version:`0.3.193`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`A tool you switch on while a chat is replying works for the message you send next, even mid-reply: that message now waits for the chat to restart with the new tool instead of reaching the model without it.`,`After an update, a chat that had background tasks running shows one line — “11 background tasks stopped — they were running when OonaCode restarted this chat” — instead of one card per task. Click it to see each one.`]},{version:`0.3.192`,date:`2026-09-30`,platforms:[`win32`],added:[`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop. Other languages are translated once and kept, so hearing the same briefing again costs nothing.`],fixed:[]},{version:`0.3.191`,date:`2026-09-30`,platforms:[`win32`],added:[`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed. They are deleted by themselves 10 days after their last change; resuming or editing a paused task gives it another 10 days.`],fixed:[]},{version:`0.3.190`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`]},{version:`0.3.189`,date:`2026-09-30`,platforms:[`linux`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window; “Move to main window” brings it back. On Wayland desktops the new window opens at the usual place rather than under the pointer. Your split views and windows come back when you restart OonaCode.`,`Every language plays in Listen to a chat: each language picks the best voice on its own — OonaCode’s Armenian voices first, then your system’s voices, then eSpeak (install the espeak-ng package if your system has no voice for a language).`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.188`,date:`2026-09-30`,platforms:[`win32`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window. Drag it back onto the main window’s tabs, or choose “Move to main window”, to bring it back. Your split views and popped-out windows come back when you restart OonaCode.`],fixed:[]},{version:`0.3.187`,date:`2026-09-30`,platforms:[`win32`],added:[`Every language plays in Listen to a chat. Persian, Georgian, Ukrainian — and any language whose Windows voice is not installed — now speak with eSpeak, a free voice that comes with OonaCode (it sounds robotic, but it always works). Each language picks the best voice on its own: OonaCode’s Armenian voices first, then Windows’ own, then eSpeak.`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.186`,date:`2026-09-30`,platforms:[`linux`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`,`OonaCode brings two Armenian voices of its own, Astgh and Artsiv, and also speaks with your system’s voices through speech-dispatcher — install speech-dispatcher and espeak-ng for Persian, Russian and every other language; the Listen window names the packages for your distribution.`,`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`,`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`,`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. Pin any chat or project to the top of the list from its menu.`,`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`,`Type / at the start of a message to see the chat’s commands and skills, with what each does, in two titled sections. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing; switch one on to let the model use it by itself in that chat. Typing /name still runs any skill for one turn.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`,`Search in the Import window: find a chat by its name, its first or last message or its folder, or pick “Whole conversations” to search inside the chats themselves.`],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from, with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once.`,`The message box fits a narrow chat: its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it.`,`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Only new replies change.`,`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model, /usage, /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`,`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message.`,`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`,`Typing /model in a chat updates the chat’s model and the model picker again, and command output such as /context reads the same while it arrives and after you reopen the chat.`,`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.185`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`Listening with a Windows voice no longer stops after the first sentence when the voice fails to say it has finished.`]},{version:`0.3.184`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`],fixed:[`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`]},{version:`0.3.183`,date:`2026-09-30`,platforms:[`win32`],added:[`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`],fixed:[]},{version:`0.3.182`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from — Claude Code, the Claude app, Qwen Code, Cursor — with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once. The Import button says how many chats it will bring over.`]},{version:`0.3.181`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`The message box fits a narrow chat. In a small window, or with the side panels open, its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it, and the model and effort pickers keep their words readable.`]},{version:`0.3.180`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Other models were never affected. Only new replies change; older thoughts stay empty.`]},{version:`0.3.179`,date:`2026-09-29`,platforms:[`win32`],added:[],fixed:[`The / menu is easier to read: skills and commands in two titled sections, each with one short line — the full description shows when you point at it.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model (use the model picker), /usage (the engine’s own estimate, not your credits), /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`]},{version:`0.3.178`,date:`2026-09-29`,platforms:[`win32`],added:[`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. A dot on it tells you when something is due soon.`,`Pin any chat or project to the top of the list from its menu.`],fixed:[`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.177`,date:`2026-09-29`,platforms:[`win32`],added:[`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`],fixed:[`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message, and the picker shows Sonnet 5.5.`]},{version:`0.3.176`,date:`2026-09-29`,platforms:[`win32`],added:[`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing — about 1,400 tokens on every message until now. Switch one on to let the model use it by itself in that chat; the list shows what each one costs per message while on.`,`Typing /name still runs any skill for one turn, whether its switch is on or off.`],fixed:[`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`]},{version:`0.3.175`,date:`2026-09-29`,platforms:[`win32`],added:[`Type / at the start of a message to see the chat’s commands and skills — the Claude Code engine’s own (/compact, /context, /review, /security-review, /init and more) and the skills in your project’s .claude folder — with what each does. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`],fixed:[`Typing /model in a chat updates the chat’s model and the model picker again.`,`Command output such as /context reads the same while it arrives and after you reopen the chat.`]},{version:`0.3.174`,date:`2026-09-28`,platforms:[`win32`],added:[`Search in the Import window. Type to find a chat by its name, its first or last message, or its folder — chats folded away as already imported or deleted here show up too when they match. Or open the search options and pick “Whole conversations” to search inside the chats themselves, with a few lines of each match under the chat. It only reads Claude Code, Cursor and the Claude app’s files, never changes them.`],fixed:[`Chats Claude Code switched to another model are answered by that model for real: OonaCode’s pool now serves the model the engine falls back to, and never answers a Claude request with another company’s model.`]},{version:`0.3.173`,date:`2026-09-28`,platforms:[`linux`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`,`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`,`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`,`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`,`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`,`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`A chat can no longer be moved into your home folder or the root folder through a link. Where /home is itself a link (Fedora Silverblue, Bazzite and similar systems), the home folder passed as an ordinary folder, and the chat would have loaded your own Claude Code settings as its project.`,`Signing in to your own Claude subscription inside the app works on Ubuntu 24.04, Debian, Linux Mint, Pop!_OS and Zorin OS again. There, a part of OonaCode built for newer systems did not load, and the sign-in fell back to a command you had to paste.`,"On Ubuntu, Linux Mint, Pop!_OS, Zorin OS and similar systems, `oona` now works in every new terminal right after you install or update. The installer used to leave it off your PATH until you logged out and back in; now it adds it for new terminals itself, and `oona uninstall` takes that line out again.",`Every way of uninstalling — “oona uninstall”, or the install command with --uninstall — now takes this PC off your account: keep your chats and they stay readable on your other devices; delete them and their copies go too. It never touches your Claude Code or the Claude app, and “oona uninstall” no longer gives up when the background service is stopped.`,`The installer now says at once when a system cannot run OonaCode — one older than Ubuntu 22.04, Debian 12 or RHEL 9, or one built on musl such as Alpine — instead of installing a copy that could not start. The .deb and .rpm tell apt and dnf the same.`]},{version:`0.3.172`,date:`2026-09-28`,platforms:[`win32`],added:[`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Uninstalling from Settings → Apps now also takes this PC off your account, exactly like “oona uninstall”: keep your chats and they stay readable on your other devices; delete them and their copies go too.`,`“oona uninstall” no longer gives up when the background service is stopped.`,`The “Updating OonaCode…” window shows again on the newest Windows 11 versions (24H2 and later).`]},{version:`0.3.171`,date:`2026-09-28`,platforms:[`win32`],added:[`Oonak Browser now picks its own control port from a range no developer tool uses by default, so it can no longer take a port that Shopify CLI or a dev server wants. If a program needs a particular port kept free, or you want the browser on a specific one, just ask the chat.`],fixed:[`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`Uninstalling OonaCode from Settings → Apps now removes all of it — the app, the command line and its background service — and asks whether to keep your chats. Installing again afterwards no longer says it is already installed. Your Claude Code and Claude app are never touched.`,`“oona uninstall” works again on Windows 11.`,`A chat “about” you wrote yourself no longer shows “stale”.`]},{version:`0.3.170`,date:`2026-09-28`,platforms:[`win32`],added:[`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`]},{version:`0.3.169`,date:`2026-09-28`,platforms:[`win32`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`],fixed:[`A chat can no longer be moved into your user folder or a drive root through a link or junction that points there — its project settings would have been your own Claude Code settings.`]},{version:`0.3.167`,date:`2026-09-27`,platforms:[`win32`],added:[`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`],fixed:[]},{version:`0.3.166`,date:`2026-09-27`,platforms:[`win32`],added:[],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`]},{version:`0.3.165`,date:`2026-09-27`,platforms:[`win32`],added:[`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`Chats now use Oonak Browser, in a window you can see, for everything that needs a web browser — not Chrome, Edge or a hidden script browser — unless you name another browser. It runs without a window (headless) only when you ask for that.`],fixed:[`After an update, the background service comes back by itself. An update could leave it unable to restart, and the app then showed “OonaCode could not start its host service” even though it went on to open normally.`]},{version:`0.3.164`,date:`2026-09-27`,platforms:[`win32`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when OonaCode’s stored key cannot be opened for a moment. OonaCode used to replace the key and lose your sign-in; it now keeps the key and signs you back in by itself as soon as it opens.`]},{version:`0.3.163`,date:`2026-09-27`,platforms:[`linux`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when its security chip is slow to open OonaCode’s stored key. After a system update and reboot, the chip on some machines refuses for a while; OonaCode used to replace the key and lose your sign-in. It now keeps the key and signs you back in by itself as soon as the chip opens it.`]},{version:`0.3.162`,date:`2026-09-27`,added:[],fixed:[`A chat switched to another model knows which model it is. After a switch from Claude to DeepSeek, the model used to keep saying it was Claude — the chat history and Claude Code’s own prompt told it so.`,`Oonak Browser is offered only where it can run. An older OonaCode no longer lists a browser tool it cannot use, so the model does not spend tokens working around it — update to get the browser.`]},{version:`0.3.161`,date:`2026-09-27`,added:[`Settings → This PC → “Replace pictures older than N days”: screenshots and pasted pictures in your chat history are replaced by a short note once they are older than a year (you choose the number, or 0 to keep them). The words of every chat stay; the database stops growing with pictures. It runs by itself.`],fixed:[`The model, Build/Plan/Ask and effort pickers under the message box now look like the dropdowns they are.`,`Switches that are off are easy to see in dark mode.`,`Error messages show what went wrong in words, without raw tags or a provider’s JSON.`,`The ✕ that removes an attachment or a reply is round.`,`Pressing Stop, or an update cutting a turn, no longer files an automatic bug report.`]},{version:`0.3.160`,date:`2026-09-27`,added:[`On Windows, the agent can use a real browser. Ask it to open a site, read a page, click, fill in a form or take a screenshot, and it does it in Oonak Browser, in a window you can see. The first time, OonaCode asks once to install the browser (about 210 MB); after that it opens straight away.`,`Each chat has its own browser profile, so a site you sign in to stays signed in for that chat. Switch the browser off for a chat in its Tools menu.`],fixed:[]},{version:`0.3.159`,date:`2026-09-27`,added:[],fixed:[`A chat reopened after an update no longer says “turn complete” the instant you send a message and then answer anyway. The engine’s own note about work that stopped during the update used to be taken for the end of your turn, with the whole earlier conversation’s tokens on the line.`,`A background task that stopped because OonaCode restarted now says so in plain words, instead of “Orphaned by a previous Claude Code process exit”.`]},{version:`0.3.158`,date:`2026-09-27`,added:[`Every thought in a chat shows how many words it has, so you can tell at a glance whether there is anything to read.`],fixed:[`A thought with nothing in it — some models return only a signature for their thinking — now says “Thought · empty” and no longer opens onto a blank box.`,`A command the agent was allowed to run no longer leaves an “Allowed Bash (automatically)” line under its own card: the card already shows the command and its result. Refusals are still shown.`]},{version:`0.3.157`,date:`2026-09-27`,added:[`On Linux, OonaCode has its own signed apt and dnf repositories. Install the app with apt (Debian, Ubuntu, Mint) or dnf (Fedora, RHEL, Rocky, Alma) — the commands are on the download page — and your package manager keeps it up to date with the rest of the system.`,`Every Linux release is signed with the OonaCode release key, and the one-line installer checks that signature before it installs anything.`],fixed:[`On Linux, the menu bar is drawn in the window in the app’s own colours, and it switches between light and dark with the app instead of keeping the desktop’s theme until a restart.`,`Upgrading the .rpm no longer removes the oonacode command, and removing it no longer leaves empty folders behind.`]},{version:`0.3.156`,date:`2026-09-27`,added:[`Chats can talk to each other. Turn on “Talk to other chats” in a chat’s Tools menu, and its agent can find your other chats that have it on, read them, and ask them for help — one chat or a whole group. A chat that is closed wakes up to answer; a busy one answers when it finishes. The reply comes back to the chat that asked.`,`The Conversations window (in the sidebar) shows every conversation between your chats: who said what to whom, what each answer cost, and buttons to pause, resume, close or stop them all. Each conversation has a budget — 20 messages and 1,000,000 new tokens by default — and pauses itself when it is used up, so chats can never talk forever.`,`Hover over any tool in a chat’s Tools menu to read what it does, how it works, what it costs and how to turn it off.`],fixed:[`A chat woken in the background — by a scheduled task or another chat — shows as working in the sidebar even when it is not open in a tab.`,`A scheduled task no longer slips into a chat at the same moment you send it a message; yours always goes first.`,`A message sent from the terminal no longer waits forever when a chat’s history cannot be resumed and the restart fails. It now says why.`,`Notes OonaCode writes into a chat — a model change, a conversation paused — are still there when you reopen it.`,`When every Claude seat in the OonaCode pool is taken, a new chat now says the model is busy and to try again in a few minutes or pick another model, instead of “Something went wrong on our side”.`,`On Linux, the app tells you it is updating while it swaps itself, so there is no need to start it again.`,`On Linux, removing the .deb or .rpm leaves nothing running and nothing failing at the next login, and the one-line installer checks for free disk space before it changes anything.`]},{version:`0.3.155`,date:`2026-09-27`,added:[`OonaCode runs on Linux. One command installs the command line, the background service and the desktop app: curl -fsSL https://oonacode.oonak.ai/install.sh | bash. The AppImage, .deb and .rpm are on the download page too.`,`On Linux the app lives in the system tray as it does on Windows, follows your desktop’s light or dark theme, and gets its own entry in the applications menu.`,`Uninstalling on Linux removes the desktop app along with the rest, and asks whether to keep your chats for a future install.`],fixed:[`A window no longer stays on “Unauthorized” after the background service restarts with a new key. It reconnects by itself.`]},{version:`0.3.154`,date:`2026-09-26`,added:[],fixed:[`A chat waiting on a long job no longer loses its watcher. OonaCode used to close a chat’s engine ten minutes after the model last spoke, which stopped any Monitor or background command it had left running. The engine now stays up while such work runs, up to 12 hours.`,`A chat moved into a project, or whose project you edit, now follows the project’s instructions from its next message. It used to keep the ones it started with.`]},{version:`0.3.153`,date:`2026-09-25`,added:[],fixed:[`A very long chat no longer answers “Prompt is too long” after OonaCode restarts or updates. The engine was judging the chat’s size by a figure left over from before the restart, and now gets an accurate one.`,`If a message is ever refused as too long before the model has started on it, OonaCode sends it again by itself with a shorter history. You see your message once and then the answer, not an error.`]},{version:`0.3.152`,date:`2026-09-25`,added:[],fixed:[`Uninstalling the app from Windows’ Apps list no longer stops the command-line OonaCode on the same PC from starting after a restart.`]},{version:`0.3.151`,date:`2026-09-25`,added:[`Files the agent names in a chat are clickable. Audio and video play right in the chat with a small player, pictures open as a preview, and in the app every file can be opened in its own program or shown in its folder.`,`Uninstalling the app asks whether to keep your chats on this PC. Keeping them means a new install signs in and continues every chat.`],fixed:[`Installing and updating no longer fail with “The operation has timed out” on PCs whose network drops the newer internet addresses, nor while our server restarts for an update.`]},{version:`0.3.150`,date:`2026-09-25`,added:[],fixed:[`The fix in 0.3.149 for long, sleeping turns now really reaches the agent: the Monitor tool and the block on long waits are on for every chat.`,`A chat compacted after a long pause no longer pays to cache a conversation it is about to replace, and the agent keeps each tool call in its history exactly as it wrote it — both as Claude Code does.`]},{version:`0.3.149`,date:`2026-09-25`,added:[`The agent can watch a long job with the Monitor tool, as Claude Code does, and is woken the moment the job finishes.`],fixed:[`Long chats no longer spend their time asleep. With no way to watch a background job, the agent had been polling it with waits of four to eight minutes. One chat spent more than three and a half hours of a day sleeping, and turns ran for hours while the model worked for a fraction of that. The agent now gets the same working rules as Claude Code, and long waits are blocked.`]},{version:`0.3.148`,date:`2026-09-25`,added:[],fixed:[`A scheduled task that could not be sent — the PC had just restarted, the vault was still locked, the server was not reachable yet — waits and tries again instead of switching itself off. Pausing, editing or deleting a task while its prompt is being sent is no longer undone, and a scheduled prompt no longer lands in a chat whose engine is still starting.`,`A chat on your own DeepSeek key, or one switched with a typed “/model opus”, is no longer shown as withdrawn and locked. “/model fable” picks Claude Fable instead of the default model.`,`Moving a chat to another model no longer lowers its saved effort level to what the old model offered, and a one-off “oona --effort” is no longer saved as the chat’s level.`,`After you pick another model for a locked chat and send, the chat no longer flashes the lock again while the engine starts; if the start fails, your pick is kept.`,`Coming back from a file tab no longer jumps the chat to an old reply or reopens the search bar.`,`The hidden sidebar slides away again when the pointer leaves the window past its edge, and the keyboard no longer tabs through it while it is hidden. Clicking ⓘ in Settings opens its note instead of closing it.`,`Subagents write their prompt cache for five minutes, as Claude Code does for its subscribers; the chat itself keeps the hour. Their cache writes cost less.`]},{version:`0.3.147`,date:`2026-09-25`,added:[`A chat’s scheduled tasks sit beside its subagents: a clock badge says how many are live and when the next one runs, and opens the list — each task’s schedule, its next and last run, Pause and Delete. The tasks run on this PC.`],fixed:[`A prompt the scheduler sends into a chat reads as a “Scheduled task” line, not as your own message waiting in the queue.`,`A chat whose model is no longer offered shows that model in red and waits for you to pick another; its history stays, and the old model is not in the list any more.`,`The effort list follows the server within minutes, without restarting the app. A chat set to a level that has been switched off moves to the nearest one — ultracode becomes xhigh. Chats on your own Claude subscription have an effort picker again.`]},{version:`0.3.146`,date:`2026-09-25`,added:[`A Tools menu beside the model picker: switch OonaCode’s own tools on or off for each chat — browser, desktop and window control, clipboard, screen capture, Office documents and run-as-administrator. Each tool costs the model only a short line until it is used, and the menu shows how much. The first tools are marked Demo while they are tested with every model: a demo tool answers what it would have done, and does nothing on your PC yet.`],fixed:[]},{version:`0.3.145`,date:`2026-09-25`,added:[],fixed:[`Every request of every chat, on every model, is about 3,200 tokens smaller: the engine’s own “auto memory” instructions are gone. OonaCode starts each engine in a fresh private folder and deletes it afterwards, so the notes the model was told to keep there were thrown away when the chat went idle — the model spent tool calls writing memories it would never read. A project’s memory is OonaCode’s own and stays.`,`The engine’s claude.ai Artifact tools are switched off everywhere OonaCode runs it — the app, the terminal, VS Code, the phone, Telegram and the agent API.`]},{version:`0.3.144`,date:`2026-09-25`,added:[],fixed:[`Long chats on Claude models in the OonaCode pool keep their cache for an hour, as Claude Code does for its subscribers. A pause of more than five minutes no longer re-sends the whole conversation at the full cache-write price, which in a large chat was the most expensive part of coming back to it.`,`The session panel’s Context shows how big the conversation is now, not the total of every request the chat ever made — a long chat read “10.7M / 1.0M tokens”.`,`The message box keeps the cursor after you send, so you can go straight on typing the next message.`,`A paid chat’s background work (titles, reading web pages) no longer goes to a free model of the same vendor.`]},{version:`0.3.143`,date:`2026-09-24`,added:[`Search inside your chats: open the search in the chat list, press the sliders button and choose Whole chats. It looks through every message of every chat on this PC, and you choose whose words — yours, the model’s, or both — plus, if you like, the tools’ commands and output and the subagents’ conversations. Results show each message with the words lit; a click opens the chat with its search on them.`,`More search options, for both kinds of search: one project only, a time window (today, 7 or 30 days), match case and whole words.`],fixed:[`While you search the chat list, projects with no matching chat are hidden too.`]},{version:`0.3.142`,date:`2026-09-24`,added:[],fixed:[`A reply you sent shows as the same small chip it had in the message box — “Reply to” and the first few words — instead of the whole quoted text; the full quote appears when you rest the pointer on it, and a click jumps to the message it answers.`,`The model now knows a reply points back into the conversation: it is told the quoted lines are from the chat history, not new input, and whose words they were — its own earlier reply, your earlier message, a file, or a tool’s output.`,`When the chat list is narrow, its buttons wrap onto a second line instead of spilling out of it.`]},{version:`0.3.141`,date:`2026-09-24`,added:[`The chat list on the left can be made wider or narrower: drag its right edge (double-click it for the usual width).`,`The chat list can hide: press the pin in its header, the button at the top left, or View → Sidebar (Ctrl+B). While hidden it slides in when the pointer reaches the left edge of the window, and slides away when you leave it.`,`Search in the chat list is a single magnifier now; click it and the search box opens across the top. Escape or × clears it.`],fixed:[`Opening OonaCode right after a restart no longer leaves the OonaCode pool models out of the model list: if they cannot be read yet, OonaCode asks again by itself a few seconds later and the list fills in.`,`The Artificial Analysis scores (intelligence, coding, speed and benchmarks) show on every model in the model list again — including the models of your own Claude and SuperGrok subscriptions, which never had them.`,`A chat’s details card no longer appears on top of its right-click menu.`]},{version:`0.3.140`,date:`2026-09-24`,added:[`Reply is tidier: the message you reply to shows as a small chip above the message box with its first few words, instead of filling the box. Click the chip — or the quote in a sent reply — to jump to that message; the × removes it.`,`Right-click a project in the sidebar for its settings: Project settings… opens Projects with that project already selected. The gear beside a project’s “+” does the same, and a chat filed in a project offers it in its own menu too.`,`Link GitHub. Under a project’s Repositories (and in Settings → Providers), link your GitHub account once: the agent’s git and gh then clone, pull and push your private repositories on every PC of yours. You type a short code on github.com; the token stays in your encrypted vault and never reaches the OonaCode server. Public repositories need nothing.`],fixed:[]},{version:`0.3.139`,date:`2026-09-24`,added:[`Every setting now says what it does, and resting the pointer on the ⓘ beside it tells you where in OonaCode it applies and what it does not do.`,`Export chats… is in the File menu (and on the sidebar in a browser window) instead of in Settings.`,`With Remote access turned off on a PC, your phone, Telegram, the website and your other PCs still show it — online or not — marked “remote access off”, and opening it tells you to turn Remote access back on in OonaCode on that PC.`],fixed:[`Turning Remote access off now tells your other devices at once. Before, the PC was already unreachable from them, but they could not say why.`,`The settings of This PC save the moment you change them — nothing is lost by closing the dialog.`,`Settings that did nothing, or repeated another one, are gone: the default permission mode (each chat’s Build / Plan / Ask first picker decides), the agent-picker switch, the Git Bash path, the engine path and the extra allowed origins. The server address is shown, not edited — signing in sets it.`]},{version:`0.3.138`,date:`2026-09-24`,added:[`Projects have settings now, like the Claude app’s: a goal, the repositories the project works on, what a new chat in it starts on (model, effort and folder), a project memory the agent keeps up to date, and whether its chats may schedule work — and how often at most. All of it is in Projects, and a Claude app project you import brings its own.`,`OonaCode has a scheduler. Ask the agent to do something later or on a repeat — “check the build every morning at nine” — and it schedules it on this PC; when it is due, the prompt arrives in the chat, even if the chat had gone quiet. The Projects dialog and the chat’s info panel list what is scheduled, where you can pause, resume or delete it.`],fixed:[`Saving a project’s instructions now reaches its chats at their next message, instead of waiting until the chat happened to restart.`]},{version:`0.3.137`,date:`2026-09-24`,added:[],fixed:[`After a PC restart the app could ask for a "host token" and sign you out: two copies of the OonaCode background service started at once and fought over your session. Only one ever runs now, and the app never shows the token page — if its service is replaced it reconnects by itself.`,`The unlock screen stays put until you unlock, and says what went wrong in place — a wrong password, or a connection it is re-establishing — instead of jumping to another page.`,`A message with a picture sent while the agent was working stayed “queued”, and removing it said it was already sent. It now shows as read the moment the agent takes it, and a reopened chat shows it with its picture.`,`In the model’s questions, typing your own answer now clears the options you had picked, and picking an option clears what you typed — the answer sent is exactly the one you chose. The same on the phone, in the terminal and in Telegram.`]},{version:`0.3.136`,date:`2026-09-24`,added:[`Every model now has its own housekeeper — the small, fast model of the same maker that writes a chat’s titles and reads the web pages it fetches. On the OonaCode pool a MiMo v2.6 Pro chat uses MiMo v2.6 Flash, a Qwen chat Qwen3.8 Flash, a GLM chat GLM-5.3 Flash and a GPT-5 chat GPT-5 mini, instead of doing that work on the big model itself. A free model keeps its own, so it stays free.`],fixed:[]},{version:`0.3.135`,date:`2026-09-24`,added:[],fixed:[`Claude models on the OonaCode pool — Opus 5.5, Opus 5, Sonnet 5 and Fable 5.1 — now use their whole 1M context. A long chat no longer stops to summarise itself every ~170k tokens, and its subagents get the same window.`,`Reading a web page is quick again in a Claude chat: pages are read by Claude Haiku, as in Claude Code, instead of a helper that took about a minute a page.`,`Changing a chat’s model now moves its subagents and background helpers to the new model too; before, they stayed on the old one until the app restarted.`,`MiMo v2.5 and v2.5 Pro chats now use their full 1M context too.`]},{version:`0.3.134`,date:`2026-09-23`,added:[],fixed:[`On the Android app, the model’s questions can be answered again. They come one at a time — “Question 2 of 3” — with Back, Next and Skip, and Answer sends them to your PC. The card used to show only the first question, hide the rest below it and wait for all of them, so it could not be sent.`]},{version:`0.3.133`,date:`2026-09-23`,added:[`Bring your Claude desktop app projects across: File → Import chats from other coding agents now lists every project the Claude app has opened on this PC. Each one arrives as an OonaCode project of the same name — its goal, instructions and what Claude noted about it become the project’s instructions — with its project chat and one chat per thread filed under it, ready to carry on.`,`A Claude Code chat you moved into a Claude app project is filed under that project here too.`,`A thread you never opened in the Claude app still comes across, with its task and every reply the project chat saw; open it once in the Claude app and import again for its whole conversation.`],fixed:[`Cursor chats appear in the import list again — they had been left out since September 10.`]},{version:`0.3.132`,date:`2026-09-23`,added:[`Reply to any part of a chat: select some text (or just right-click a block), choose Reply, and it is quoted in your message box — type your answer under it. A quote from a file the agent read names the file.`,`Right-click in a chat: copy what you selected, copy a whole reply or tool output, copy a code block or a link, find the selected words in the chat, or select a block.`,`Search in a chat opens the block its match is in — a folded tool card, a thought, a finished agent’s work — and scrolls to the words themselves.`,`Search matches are now bright orange, the current one strongest, so they stand out on code too.`,`The file viewer shows pictures (PNG, JPEG, GIF, WebP, SVG and more), plays audio and video, and shows Markdown formatted, with a switch to the source.`,`Right-click a file or folder in the explorer to copy its path or delete it.`],fixed:[`Moving a chat to another folder or project while it was working could delete the folder it was working in, start two agents at once, or send your next message to the old folder.`,`The working line no longer says a chat may be stuck while it waits for your approval or answer, or right after you send a message, and it counts time correctly (no more "4m 60s").`,`A date line no longer says "Today" for yesterday’s messages when the app stays open past midnight.`,"Installing with npm (`npm i -g oonacode`) installs this version again; earlier npm releases carried an old program.",`The What’s new window could open again on the next start, showing the same update a second time.`,`An older OonaCode window or VS Code extension no longer resets settings it does not know about, such as your theme colours or which project groups you folded.`,`A new install no longer opens with a list of changes; this window now appears only after an update.`,`The notification switch for permissions now says it also covers the agent’s questions.`]},{version:`0.3.131`,date:`2026-09-23`,added:[`Claude Opus 5.5 is here — the newest Opus, and cheaper to run than Opus 5. Choose it in the model picker, from the OonaCode pool or on your own Claude subscription. It runs on the newer Claude Code engine (2.1.280) that this update brings.`,`Every block in a chat shows its time at the bottom right, in your local time — hover it for the full date — and a date line marks where each day starts.`,`A running chat tells you how long the agent has been quiet, and after five minutes that it may be stuck and what to do.`,`After every update, OonaCode now opens this window to show you what changed.`],fixed:[`A reply that streamed in live had no time on it until the chat was opened again.`,`Chats open in tabs could fail to come back after a restart if a setting changed while they were being restored.`]}];function tl(e,t){let n=e=>{let[t,...n]=e.trim().replace(/^v/,``).split(`-`);return{nums:(t??``).split(`.`).map(e=>Number.parseInt(e,10)||0),pre:n.length>0?n.join(`-`):null}},r=n(e),i=n(t);for(let e=0;e<Math.max(r.nums.length,i.nums.length);e++){let t=(r.nums[e]??0)-(i.nums[e]??0);if(t!==0)return t}return r.pre===i.pre?0:r.pre===null?1:i.pre===null?-1:nl(r.pre,i.pre)}function nl(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===i)continue;if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t),o=/^\d+$/.test(i);if(a&&o){let e=Number(t)-Number(i);if(e!==0)return e;continue}return a===o?t<i?-1:1:a?-1:1}return 0}function rl(e,t,n=el,r=null){if(!e||e===`0.0.0`)return[];let i=n.filter(t=>tl(t.version,e)<=0&&(!r||!t.platforms||t.platforms.includes(r)));return[...t===null?i.filter(t=>tl(t.version,e)===0):i.filter(e=>tl(e.version,t)>0)].sort((e,t)=>tl(t.version,e.version))}function il(e,t,n,r=el,i=null){if(!e||e===`0.0.0`)return{record:null,show:[]};let a=null;for(let e of r)(a===null||tl(e.version,a)>0)&&(a=e.version);let o=a!==null&&tl(e,a)>0?a:e;return{record:t===null||tl(o,t)>0?o:null,show:t===null&&!n?[]:rl(e,t,r,i)}}function al(e,t){if(t==null)return[...e];if(t.length===0)return[];let n=new Set(t),r=e.filter(e=>n.has(e.id));return r.length>0?r:[...e]}var ol=`:free`;function sl(e){return e.endsWith(ol)}function cl(e){return sl(e)?e.slice(0,-5):e}var ll=`the user skipped the question`,ul=`(the user skipped this question)`;function dl(e){let t=e?.questions;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e;if(typeof t.question!=`string`)continue;let r=Array.isArray(t.options)?t.options.map(e=>e&&typeof e==`object`?e:null).filter(e=>e!==null&&typeof e.label==`string`).map(e=>({label:e.label,...typeof e.description==`string`?{description:e.description}:{}})):[];n.push({question:t.question,header:typeof t.header==`string`?t.header:``,options:r,multiSelect:t.multiSelect===!0})}return n}function fl(e,t,n={},r=new Set){let i={};return e.forEach((e,a)=>{if(r.has(a)){i[e.question]=ul;return}let o=(n[a]??``).trim();i[e.question]=o||(t[a]??[]).join(`, `)}),i}function pl(e){let t=e.questions,n=t===1?`question`:`questions`,r=t===1?`the model’s question`:`the model’s questions`,i=t===1?`The model’s question was`:`The model’s questions were`;switch(e.outcome){case`answered`:{let r=e.answers?Object.values(e.answers):null,i=r?r.filter(e=>typeof e==`string`&&e!==``&&e!==`(the user skipped this question)`).length:t;return t>0&&i<t?`You answered ${i} of ${t} ${n}`:t===0?`You answered the model’s questions`:t===1?`You answered the model’s question`:`You answered ${t} ${n}`}case`skipped`:return`You skipped ${r}`;case`dismissed`:return`${i} dismissed`;case`unanswered`:return`${i} not answered — the turn ended`}}function ml(e){if(!e||typeof e!=`object`)return null;let t=e.answers;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}var hl=[`win32`,`linux`,`darwin`],gl=[`demo`,`live`],_l=[`allow`,`ask`],vl=[`string`,`number`,`integer`,`boolean`,`array`,`object`];function yl(e){let t=e/1048576;return t>=100?`${Math.round(t)} MB`:t>=1?`${t.toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function bl(e){if(e.toolName!==`InstallToolPack`)return null;let t=e.input;return!t||typeof t!=`object`||typeof t.pack!=`string`||typeof t.name!=`string`||typeof t.version!=`string`||typeof t.sizeBytes!=`number`||typeof t.path!=`string`?null:{pack:t.pack,name:t.name,version:t.version,sizeBytes:t.sizeBytes,path:t.path}}function xl(e,t){let n=t?.[e.slug];return typeof n==`boolean`?n:e.defaultOn}function Sl(e,t){return e.filter(e=>xl(e,t))}var Cl={slug:48,name:80,entryTool:40,description:2e3,promptLine:1e3,details:8e3,actionDescription:1e3,params:30,paramName:48,paramDescription:400,enumValues:40,callArgKeys:20,callError:500,callBatch:100},wl=/^[A-Za-z0-9_-]+$/;function Tl(e){return typeof e==`string`&&e.length>0&&e.length<=Cl.entryTool&&wl.test(e)}function El(e){return Math.ceil(e.length/4)}function Dl(e){return El(`${e.entryTool} ${e.description}`)+55}function Ol(e){return e.tokensPerRequest??Dl(e)+(e.promptLine?El(e.promptLine):0)}var kl=Ho({type:Qo(vl),required:Po().optional(),enum:Bo(Wo([H(),Ao()])).optional(),description:H().optional()}),Al=Ho({slug:H().min(1),description:H(),params:Xo(H(),kl),permission:Qo(_l),sort:Ao()}),jl=Ho({version:H(),url:H(),sha256:H(),sizeBytes:Ao(),exe:H(),format:es(`zip`)}),Ml=Ho({slug:H().min(1),name:H(),entryTool:H().refine(Tl,`not a valid tool name`),description:H(),promptLine:H().nullable(),details:H().nullable().optional(),status:Qo(gl),defaultOn:Po(),sort:Ao(),install:jl.nullable(),actions:Bo(Al)}).loose();Ho({platform:Qo(hl),version:H(),packs:Bo(Ml),refreshMinutes:Ao()});var Nl=[`No answer needed.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. Your final answer goes back to that chat by itself.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. It asked for no answer, so nothing goes back.`,`Last hop of this chain: you cannot message chats in this turn; put what you have in your final answer.`];[`**Let this chat work together with your other chats.**`,``,`### What it does`,`- Finds your other chats on this PC and reads their recent messages.`,`- Sends one chat, or a group of chats, a message or a task.`,`- Brings their answers back to this chat, by itself.`,``,`### How it works`,`- A chat that is asleep is woken from its saved history. A busy one gets the message when its current turn ends, never in the middle of it.`,`- The other chat does the work with its own model, folder and tools. Its answer comes back here as a new message only when this chat asked for one.`,`- Several messages from one chat that wait for a busy chat are handed over together, in one turn, with one answer.`,`- Several chats can share one conversation (a group). An answer goes only to the chat that asked, so a group cannot multiply its own messages.`,`- A chat with this switch OFF can still be messaged by a chat that has it on. It does the work, and its final answer goes back to that chat when that chat asked for one. That is all it can do: it gets none of these tools, cannot message or read other chats, and its switch stays off.`,``,`### What it costs`,`- About 650 tokens on every request while it is on, read from the prompt cache. Nothing while it is off, even in a chat that is messaged.`,`- Every message makes the chat that receives it do a turn, which spends its own tokens.`,`- Switching it on or off in a chat that already has a conversation re-writes its prompt cache once.`,``,`### Safety limits`,`- Each conversation has a budget: 20 delivered messages and 1,000,000 new tokens by default (context read back from the prompt cache is not counted). Reaching either pauses the conversation, and the chats say so.`,`- A chain stops after 3 hops (a message caused by a message caused by a message).`,`- At most 5 messages between two chats and 20 from one chat in 10 minutes, and 10 waiting for any one chat. A chat cannot message itself.`,`- A conversation with no activity for 24 hours closes by itself.`,``,`### How to stop it`,`- Turn this switch off: the chat loses these tools, and what it sent and the answers it asked for pause. It still answers a chat that messages it.`,`- Or open the Conversations window and use Pause, Close or Stop all.`,``,`### Privacy`,`- Everything stays on your PC: the messages are kept in this PC's database, never on OonaCode's server.`,`- A message never grants anything. The other chat runs with its own permissions and asks you as usual.`,``,`Only a chat with this switch on can start a conversation; a chat with it off only answers.`].join(`
78
78
  `);var Pl={hops:3,rateWindowMs:6e5,perPair:5,perSender:20,pendingPerTarget:10,idleCloseMs:864e5,messageChars:2e4,titleChars:80,conversationTitleChars:120,recipients:10,listChats:50,readMessages:50,budgetMessagesMax:1e4,budgetTokensMax:1e9},Fl={message:`✉️ Message from chat "`,reply:`↩️ Reply from chat "`,continue:`↻ Continue the message from chat "`},Il=`⚠ `,Ll=`<local-command-stdout>`,Rl=`</local-command-stdout>`,zl=/^[A-Za-z0-9._:-]{1,128}$/;function Bl(e){let t=(e??``).replace(/["“”]/g,`'`).replace(/\s+/g,` `).trim();if(!t)return`Untitled chat`;let n=Pl.titleChars;return t.length>n?`${t.slice(0,n-1).trimEnd()}…`:t}function Vl(e){return Bl(e.title?.trim()||e.firstPrompt?.trim()||`Chat ${e.id.slice(0,8)}`)}function Hl(e,t){let n=Nl.filter(e=>t===`reply`||e!==`No answer needed.`),r=e;for(let e=!0;e;){e=!1;for(let t of n){if(r===t)return``;r.startsWith(`${t}\n\n`)&&(r=r.slice(t.length+2),e=!0)}}return r}var Ul=/^\[conv:(\S+) chat:(\S+) host:(\S+) msg:(\S+?)(?: reply-to:(\S+?))?( reply expected)?\]$/;function Wl(e){if(typeof e!=`string`)return null;let t=e;t.startsWith(Ll)&&t.endsWith(Rl)&&(t=t.slice(22,t.length-23)),t=t.replace(/\r\n/g,`
79
79
  `);let n=t.indexOf(`
80
80
  `);if(n<0)return null;let r=t.slice(0,n),i=t.slice(n+1),a=i.indexOf(`
@@ -142,7 +142,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
142
142
  `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return rk(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=eA.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function uA(){return{exit:{taskListCheckValueChecked:fA,taskListCheckValueUnchecked:fA,paragraph:pA}}}function dA(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:mA}}}function fA(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function pA(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function mA(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=eA.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function hA(){return[xO(),GO(),XO(),tA(),uA()]}function gA(e){return{extensions:[SO(),KO(e),ZO(),lA(e),dA()]}}var _A={tokenize:jA,partial:!0},vA={tokenize:MA,partial:!0},yA={tokenize:NA,partial:!0},bA={tokenize:PA,partial:!0},xA={tokenize:FA,partial:!0},SA={name:`wwwAutolink`,tokenize:kA,previous:IA},CA={name:`protocolAutolink`,tokenize:AA,previous:LA},wA={name:`emailAutolink`,tokenize:OA,previous:RA},TA={};function EA(){return{text:TA}}for(var DA=48;DA<123;)TA[DA]=wA,DA++,DA===58?DA=65:DA===91&&(DA=97);TA[43]=wA,TA[45]=wA,TA[46]=wA,TA[95]=wA,TA[72]=[wA,CA],TA[104]=[wA,CA],TA[87]=[wA,SA],TA[119]=[wA,SA];function OA(e,t,n){let r=this,i,a;return o;function o(t){return!zA(t)||!RA.call(r,r.previous)||BA(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return zA(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(xA,u,l)(t):t===45||t===95||xC(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&bC(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function kA(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!IA.call(r,r.previous)||BA(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(_A,e.attempt(vA,e.attempt(yA,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function AA(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&LA.call(r,r.previous)&&!BA(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(bC(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||CC(t)||DC(t)||AC(t)||kC(t)?n(t):e.attempt(vA,e.attempt(yA,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function jA(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function MA(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(bA,c,s)(t):t===null||DC(t)||AC(t)||t!==45&&kC(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function NA(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(bA,t,a)(o):o===null||DC(o)||AC(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function PA(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||DC(o)||AC(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||DC(e)||AC(e)?t(e):r(e)}function a(e){return bC(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):bC(t)?(e.consume(t),o):n(t)}}function FA(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return xC(e)?n(e):t(e)}}function IA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||DC(e)}function LA(e){return!bC(e)}function RA(e){return!(e===47||zA(e))}function zA(e){return e===43||e===45||e===46||e===95||xC(e)}function BA(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var VA={tokenize:YA,partial:!0};function HA(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:KA,continuation:{tokenize:qA},exit:JA}},text:{91:{name:`gfmFootnoteCall`,tokenize:GA},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:UA,resolveTo:WA}}}}function UA(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=yC(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function WA(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function GA(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||DC(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(yC(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return DC(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function KA(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||DC(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=yC(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return DC(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),NC(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function qA(e,t,n){return e.check(JC,t,e.attempt(VA,t,n))}function JA(e){e.exit(`gfmFootnoteDefinition`)}function YA(e,t,n){let r=this;return NC(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function XA(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&fC(o,o.length,0,VC(s,e.slice(r+1,n),t)),fC(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),fC(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=BC(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=BC(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ZA=class{constructor(){this.map=[]}add(e,t,n){QA(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function QA(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function $A(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ej(){return{flow:{null:{name:`table`,tokenize:tj,resolveAll:nj}}}}function tj(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):OC(t)?NC(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||DC(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,OC(t)?NC(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return OC(t)?NC(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return OC(t)?NC(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):OC(n)?NC(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||DC(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function nj(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ZA;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(ij(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=rj(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=rj(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=rj(f,t,o,i,n,d)):(o[0]=o[1],d=rj(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&ij(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=$A(t.events,n))}return e}function rj(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},aj(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=aj(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=aj(t.events,n[2]),a=aj(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},aj(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function ij(e,t,n,r,i){let a=[],o=aj(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function aj(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var oj={name:`tasklistCheck`,tokenize:cj};function sj(){return{text:{91:oj}}}function cj(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return DC(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):OC(r)?e.check({tokenize:lj},t,n)(r):n(r)}}function lj(e,t,n){return NC(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function uj(e){return hC([EA(),HA(),XA(e),ej(),sj()])}var dj={};function fj(e){let t=this,n=e||dj,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(uj(n)),a.push(hA()),o.push(gA(n))}function pj(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}function mj(e,t){return e?`${e}/${t}`:t}function hj(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function gj(e,t){return t===``||e===t||e.startsWith(`${t}/`)}function _j(e,t){return t?t===`win32`?`\\`:`/`:/^[A-Za-z]:|\\/.test(e)?`\\`:`/`}function vj(e,t){return t===`/`?e:e.replace(/\//g,`\\`)}function yj(e,t,n){let r=_j(e,n),i=r===`\\`?e.replace(/\//g,`\\`):e;return t?`${i.replace(/[\\/]+$/,``)}${r}${vj(t,r)}`:i}var bj=Object.fromEntries(Object.entries({ts:[`ts`,`mts`,`cts`],tsx:[`tsx`],js:[`js`,`mjs`,`cjs`],jsx:[`jsx`],json:[`json`,`jsonc`,`json5`,`jsonl`,`ndjson`,`webmanifest`,`geojson`],markdown:[`md`,`mdx`,`markdown`],python:[`py`,`pyi`,`pyw`],rust:[`rs`],go:[`go`],java:[`java`],kotlin:[`kt`,`kts`],groovy:[`groovy`,`gradle`],scala:[`scala`,`sbt`],csharp:[`cs`,`csx`],fsharp:[`fs`,`fsx`,`fsi`],vb:[`vb`],c:[`c`,`h`],cpp:[`cpp`,`cc`,`cxx`,`hpp`,`hh`,`hxx`,`ino`],swift:[`swift`],dart:[`dart`],php:[`php`],ruby:[`rb`,`rake`,`gemspec`,`erb`],perl:[`pl`,`pm`],lua:[`lua`],r:[`r`,`rmd`],julia:[`jl`],zig:[`zig`],elixir:[`ex`,`exs`],erlang:[`erl`,`hrl`],haskell:[`hs`],clojure:[`clj`,`cljs`,`cljc`,`edn`],ocaml:[`ml`,`mli`],solidity:[`sol`],vue:[`vue`],svelte:[`svelte`],astro:[`astro`],html:[`html`,`htm`,`xhtml`],css:[`css`],scss:[`scss`,`sass`],less:[`less`],xml:[`xml`,`svg`,`xsd`,`xsl`,`xslt`,`xaml`,`plist`,`resx`,`nuspec`],msbuild:[`csproj`,`vbproj`,`fsproj`,`vcxproj`,`props`,`targets`],yaml:[`yml`,`yaml`],toml:[`toml`],ini:[`ini`,`cfg`,`conf`,`properties`,`env`,`editorconfig`],graphql:[`graphql`,`gql`],proto:[`proto`],prisma:[`prisma`],hcl:[`tf`,`tfvars`,`hcl`],sql:[`sql`],powershell:[`ps1`,`psm1`,`psd1`],bash:[`sh`,`bash`,`zsh`,`ksh`],fish:[`fish`],batch:[`bat`,`cmd`],dockerfile:[`dockerfile`,`containerfile`],makefile:[`mk`,`mak`],cmake:[`cmake`],diff:[`diff`,`patch`],latex:[`tex`,`sty`,`cls`,`bib`],rst:[`rst`],asciidoc:[`adoc`,`asciidoc`],glsl:[`glsl`,`vert`,`frag`,`wgsl`,`hlsl`],csv:[`csv`],tsv:[`tsv`],text:[`txt`,`text`,`log`,`lock`,`out`,`nfo`]}).flatMap(([e,t])=>t.map(t=>[t,e]))),xj={dockerfile:`dockerfile`,containerfile:`dockerfile`,makefile:`makefile`,gnumakefile:`makefile`,"cmakelists.txt":`cmake`,jenkinsfile:`groovy`,gemfile:`ruby`,rakefile:`ruby`,podfile:`ruby`,vagrantfile:`ruby`,brewfile:`ruby`,procfile:`text`,license:`text`,licence:`text`,readme:`text`,changelog:`text`,authors:`text`,contributors:`text`,codeowners:`text`,notice:`text`,copying:`text`,".gitignore":`gitignore`,".gitattributes":`gitignore`,".dockerignore":`gitignore`,".npmignore":`gitignore`,".prettierignore":`gitignore`,".eslintignore":`gitignore`,".vscodeignore":`gitignore`,".gitmodules":`ini`,".editorconfig":`ini`,".npmrc":`ini`,".yarnrc":`ini`,".nvmrc":`text`,".node-version":`text`,".python-version":`text`,".tool-versions":`text`,".prettierrc":`json`,".eslintrc":`json`,".babelrc":`json`,".swcrc":`json`,".bashrc":`bash`,".bash_profile":`bash`,".zshrc":`bash`,".profile":`bash`};function Sj(e){let t=e.toLowerCase();return xj[t]||(/^\.env(\..+)?$/.test(t)?`dotenv`:/^(docker|container)file\..+$/.test(t)?`dockerfile`:null)}function Cj(e){let t=pj(e),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n+1).toLowerCase()}function wj(e){if(!e)return null;let t=Sj(pj(e));if(t)return t;let n=Cj(e);return bj[n]??(n||null)}var Tj=Object.fromEntries(Object.entries({image:{png:`image/png`,apng:`image/apng`,jpg:`image/jpeg`,jpeg:`image/jpeg`,jfif:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,ico:`image/x-icon`,cur:`image/x-icon`,svg:`image/svg+xml`,avif:`image/avif`},audio:{mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,oga:`audio/ogg`,opus:`audio/ogg`,m4a:`audio/mp4`,flac:`audio/flac`,aac:`audio/aac`,weba:`audio/webm`},video:{mp4:`video/mp4`,m4v:`video/mp4`,mov:`video/mp4`,webm:`video/webm`,ogv:`video/ogg`},pdf:{pdf:`application/pdf`}}).flatMap(([e,t])=>Object.entries(t).map(([t,n])=>[t,{kind:e,mime:n}])));function Ej(e){let t=Cj(e),n=Tj[t];return n?{kind:n.kind,mime:n.mime}:bj[t]===`markdown`?{kind:`markdown`,mime:null}:Sj(pj(e))||bj[t]?{kind:`text`,mime:null}:{kind:`unknown`,mime:null}}var Dj=(e,t,n)=>e.length>=t+n.length&&[...n].every((n,r)=>e[t+r]===n.charCodeAt(0)),Oj=(e,t)=>e.length>=t.length&&t.every((t,n)=>e[n]===t),kj=new Set([`avif`,`avis`]),Aj=new Set([`M4A `,`M4B `,`M4P `]),jj=new Set([`heic`,`heix`,`hevc`,`heim`,`heis`,`mif1`,`msf1`]);function Mj(e){let t=e=>({kind:`image`,mime:e}),n=e=>({kind:`audio`,mime:e});if(Oj(e,[137,80,78,71,13,10,26,10]))return t(`image/png`);if(Oj(e,[255,216,255]))return t(`image/jpeg`);if(Dj(e,0,`GIF87a`)||Dj(e,0,`GIF89a`))return t(`image/gif`);if(Dj(e,0,`RIFF`)&&Dj(e,8,`WEBP`))return t(`image/webp`);if(Dj(e,0,`RIFF`)&&Dj(e,8,`WAVE`))return n(`audio/wav`);if(Dj(e,0,`BM`)&&[12,40,52,56,64,108,124].includes(e[14]??-1)&&e[15]===0&&e[16]===0&&e[17]===0)return t(`image/bmp`);if(Oj(e,[0,0,1,0])&&((e[4]??0)>0||(e[5]??0)>0))return t(`image/x-icon`);if(Dj(e,0,`%PDF-`))return{kind:`pdf`,mime:`application/pdf`};if(Dj(e,0,`ID3`))return n(`audio/mpeg`);if(Dj(e,0,`OggS`))return n(`audio/ogg`);if(Dj(e,0,`fLaC`))return n(`audio/flac`);if(Oj(e,[26,69,223,163]))return{kind:`video`,mime:`video/webm`};if(Dj(e,4,`ftyp`)&&e.length>=12){let r=String.fromCharCode(...e.subarray(8,12));return kj.has(r)?t(`image/avif`):Aj.has(r)?n(`audio/mp4`):jj.has(r)?null:{kind:`video`,mime:`video/mp4`}}return null}var Nj=8192;function Pj(e){return e.subarray(0,Nj).includes(0)}function Fj(e){return e.slice(0,Nj).includes(`\0`)}function Ij(e){try{return e[0]===255&&e[1]===254?new TextDecoder(`utf-16le`).decode(e.subarray(2)):e[0]===254&&e[1]===255?new TextDecoder(`utf-16be`).decode(e.subarray(2)):Pj(e)?null:new TextDecoder(`utf-8`).decode(e)}catch{return null}}function Lj(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e[n],t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(16)}`}function Rj(e){return!Number.isFinite(e)||e<0?``:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}var zj=/^[A-Za-z]:[\\/]/,Bj=/^[\\/]{2}/,Vj=/^[A-Za-z][A-Za-z0-9+.-]*:/,Hj=/\.(?=[A-Za-z0-9]{0,9}[A-Za-z])[A-Za-z0-9]{1,10}$/,Uj=/#L\d+(?:C\d+)?(?:-L?\d+(?:C\d+)?)?$/,Wj=/(\.[A-Za-z0-9]{1,10}):\d+(?::\d+)?$/,Gj=/[*?"<>|]/;function Kj(e){return Bj.test(e)?null:zj.test(e)||e.startsWith(`/`)?`abs`:/^~[\\/]/.test(e)?`home`:Vj.test(e)?null:`rel`}function qj(e){let t=e.slice(Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))+1);return t.lastIndexOf(`.`)>0&&Hj.test(t)}function Jj(e){return/[\\/]$/.test(e)||!qj(e)}function Yj(e){return/[^\\/~]/.test(zj.test(e)?e.slice(2):e)}function Xj(e){return e.replace(Uj,``).replace(Wj,`$1`)}function Zj(e){if(!e.includes(`%`))return e;try{return decodeURIComponent(e)}catch{return e}}function Qj(e){let t=/^file:(\/\/([^/]*))?(\/.*)?$/i.exec(e.trim());if(!t)return null;let n=t[2]??``;if(n!==``&&n.toLowerCase()!==`localhost`)return null;let r=Zj(t[3]??``);return/^\/[A-Za-z]:[\\/]/.test(r)&&(r=r.slice(1)),!r||Bj.test(r)?null:r}function $j(e){let t=e.trim();if(t.startsWith(`<`)&&t.endsWith(`>`)&&(t=t.slice(1,-1).trim()),!t||t.startsWith(`#`)||t.startsWith(`?`))return null;if(/^file:/i.test(t)){let e=Qj(t);if(!e)return null;let n=Kj(e);return n?{path:Xj(e),base:n}:null}let n=Xj(Zj(t)),r=Kj(n);return r?zj.test(n)?Gj.test(n.slice(2))?null:{path:n,base:r}:!qj(n)||Gj.test(n)||r===`rel`&&/^www\./i.test(n)?null:{path:n,base:r}:null}function eM(e){let t=e.trim();if(!t||t.length>1024||/[\r\n]/.test(t))return null;let n=/^(["'])(.*)\1$/.exec(t);if(n&&(t=(n[2]??``).trim()),/^file:/i.test(t)){let e=Qj(t),n=e?Kj(e):null;return e&&n&&qj(e)?{path:e,base:n}:null}t=Xj(t);let r=Kj(t);if(!r||!qj(t))return null;let i=zj.test(t)?t.slice(2):t;return Gj.test(i)?null:r===`rel`?/\s|=/.test(t)||t.startsWith(`-`)||t.startsWith(`@`)||!/[\\/]/.test(t)&&!lp(t)?null:{path:t,base:r}:/^\s|\s$/.test(t)?null:{path:t,base:r}}function tM(e,t=!1){let n=e.trim();if(!n||n.length>1024||/[\r\n]/.test(n))return null;let r=/^(["'])(.*)\1$/.exec(n);if(r&&(n=(r[2]??``).trim()),/^file:/i.test(n)){let e=Qj(n),t=e?Kj(e):null;return e&&(t===`abs`||t===`home`)&&Jj(e)&&Yj(e)?{path:e,base:t}:null}let i=Kj(n);if(i!==`abs`&&i!==`home`||!Jj(n)||!Yj(n))return null;let a=zj.test(n);return Gj.test(a?n.slice(2):n)||i===`abs`&&!a&&(n.includes(`:`)||!t&&!/[\\/]$/.test(n))?null:{path:n,base:i}}function nM(e){let t=e.trim();return!t||t.length>255||/[\s\\/:*?"<>|=`'(),;[\]{}]/.test(t)||/^[-@.~#$%]/.test(t)?null:qj(t)?t:null}function rM(e,t){let n=e.path.includes(`\\`)?`\\`:`/`;return{path:`${e.path.replace(/[\\/]+$/,``)}${n}${t}`,base:e.base}}var iM=String.raw`[^\s\\/:*?"<>|()[\]{}\`',;]`,aM=String.raw`[^\s\\/:*?"<>|\`](?:[^\\/:*?"<>|\n\`]*[^\s\\/:*?"<>|\`])?[\\/]`,oM=String.raw`\.(?=[A-Za-z0-9]{0,9}[A-Za-z])[A-Za-z0-9]{1,10}`,sM=String.raw`(?=$|[\s.,;:!?)\]}'"»”>\`])`,cM=String.raw`(?<=^|[\s(\[{"'«“\`])`,lM=new RegExp([String.raw`\[(?<label>[^\]\n]{1,300})\]\(\s*<?(?<target>(?:[A-Za-z]:[\\/]|file:|~[\\/]|\/)[^()<>\n]*?)>?\s*\)`,String.raw`(?<=(?:📁|📂)\uFE0F?[ \t]{0,3})(?<marked>(?:[A-Za-z]:[\\/]|~[\\/]|\/)(?![\\/])(?:${aM})*${iM}*${sM})`,String.raw`(?<win>(?<![\w/\\:.-])[A-Za-z]:[\\/](?![\\/])(?:${iM}+[\\/])*${iM}*${oM}${sM})`,String.raw`(?<windir>(?<![\w/\\:.-])[A-Za-z]:[\\/](?![\\/])(?:${iM}+[\\/])*${iM}+[\\/]?${sM})`,String.raw`(?<posix>${cM}~?\/(?:${iM}+\/)*${iM}*${oM}${sM})`,String.raw`(?<homedir>${cM}~[\\/](?:${iM}+[\\/])*${iM}+[\\/]?${sM})`,String.raw`(?<rootdir>${cM}\/(?:${iM}+\/)+${sM})`,String.raw`(?<url>(?<![\w])file:\/\/\/?[^\s<>"'()[\]{}\`]+)`].join(`|`),`g`);function uM(e){if(!/[\\/]/.test(e))return[];let t=[];for(let n of e.matchAll(lM)){let e=n.groups??{},r=n.index??0,i=r+n[0].length,a=null,o,s=!1;if(e.target!==void 0)a=$j(e.target),o=e.label;else if(e.win!==void 0||e.posix!==void 0){let t=e.win??e.posix,n=Kj(t);a=n?{path:t,base:n}:null}else if(e.marked!==void 0){let t=e.marked,n=Kj(t);s=Jj(t),a=n&&n!==`rel`&&Yj(t)?{path:t,base:n}:null}else if(e.windir??e.homedir??e.rootdir){let t=e.windir??e.homedir??e.rootdir,n=Kj(t);s=!0,a=n&&n!==`rel`&&Yj(t)?{path:t,base:n}:null}else if(e.url!==void 0){let t=e.url.replace(/[.,;:!?]+$/,``);i=r+t.length;let n=Qj(t),o=n?Kj(n):null;a=n&&o&&qj(n)?{path:n,base:o}:null}a&&t.push({start:r,end:i,ref:a,...o===void 0?{}:{label:o},...s?{folder:!0}:{}})}return t}function dM(e,t){if(e.platform)return e.platform===`win32`;let n=e.cwd??e.homeDir??t;return/^[A-Za-z]:|\\/.test(n)}function fM(e,t,n){let r=[];for(let e of t.split(/[\\/]+/))e!==``&&e!==`.`&&(e===`..`?r.pop():r.push(e));return e+r.join(n)}function pM(e,t,n){let r=n?`\\`:`/`;return mM(`${e.replace(/[\\/]+$/,``)}${r}${t}`,n)}function mM(e,t){return t?zj.test(e)?fM(`${e.slice(0,2).toUpperCase()}\\`,e.slice(3),`\\`):fM(`\\`,e,`\\`):fM(`/`,e,`/`)}function hM(e,t){let n=dM(t,e.path);switch(e.base){case`abs`:return mM(e.path,n);case`home`:return t.homeDir?pM(t.homeDir,e.path.slice(2),n):null;case`rel`:return t.cwd?pM(t.cwd,e.path,n):null}}function gM(e,t){if(!t.cwd)return null;let n=dM(t,e),r=mM(t.cwd,n),i=n?`\\`:`/`,a=r.endsWith(i)?r:r+i;if(!(n?e.toLowerCase().startsWith(a.toLowerCase()):e.startsWith(a)))return null;let o=e.slice(a.length);return o?o.split(/[\\/]/).join(`/`):null}function _M(e){return lp(e)?.kind??`file`}function vM(e){let t=Ej(e).kind;return t!==`unknown`&&t!==`pdf`}function yM(e){let t=e.replace(/[\\/]+$/,``);return t.slice(Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`))+1)}var bM=`oona-file`,xM=/(?:📁|📂)\uFE0F?[ \t]*$/;function SM(e,t,n,r,i=!1){let a={filePath:e.path,fileBase:e.base,fileVariant:t};return e.base===`rel`&&r.dir&&(a.fileAltDir=r.dir.path,a.fileAltDirBase=r.dir.base),i&&(a.fileGuess=!0),{type:`oonaLocalFile`,data:{hName:bM,hProperties:a},children:n}}function CM(e,t){t.base!==`rel`&&Jj(t.path)&&(e.dir=t)}function wM(e,t){let n=eM(e);if(n)return{ref:n,guess:!1};let r=tM(e,t.marked);if(r)return{ref:r,guess:!0};let i=t.dir?nM(e):null;return i&&t.dir?{ref:rM(t.dir,i),guess:!0}:null}function TM(e,t){let n=uM(e);if(n.length===0)return null;let r=[],i=0;for(let a of n){a.start>i&&r.push({type:`text`,value:e.slice(i,a.start)});let n=e.slice(a.start,a.end);r.push(a.label===void 0?SM(a.ref,`bare`,[{type:`text`,value:n}],t,a.folder===!0):SM(a.ref,`link`,[{type:`text`,value:a.label}],t)),(a.folder||a.label!==void 0)&&CM(t,a.ref),i=a.end}return i<e.length&&r.push({type:`text`,value:e.slice(i)}),r}var EM=new Set([`link`,`linkReference`,`image`,`imageReference`,`definition`,`html`]);function DM(e,t){let n=e.children;if(!n)return;let r=null;for(let e=0;e<n.length;e++){let i=n[e],a=null;if(i.type===`link`){let e=$j(i.url??``);e&&(a=[SM(e,`link`,i.children??[],t)],CM(t,e))}else if(i.type===`inlineCode`||i.type===`code`){let e=i.value??``,n=i.type===`code`,r=n&&e.includes(`
143
143
  `)?null:wM(e,t);if(r){let i=n?`block`:`code`;a=[SM(r.ref,i,[{type:`text`,value:e}],t,r.guess)],r.guess&&CM(t,r.ref)}}else i.type===`text`?a=TM(i.value??``,t):EM.has(i.type)||DM(i,t);t.marked=i.type===`text`&&xM.test(i.value??``),a?(r??=n.slice(0,e),r.push(...a)):r&&r.push(i)}r&&(e.children=r)}function OM(){return e=>{DM(e,{dir:null,marked:!1})}}var kM=3e4,AM=25,jM=5e3,MM=(e,t)=>`${e}\n${t}`;function NM(e){if(!e||typeof e!=`object`)return!1;let{status:t,message:n}=e;return t===501||t===404&&typeof n==`string`&&n.startsWith(`no route for`)}var PM=class{#e;#t;#n;#r;#i;#a;#o=new Map;#s=new Map;#c=new Map;#l=new Set;#u=new Map;#d=null;#f=!1;constructor(e){this.#e=e.stat,this.#t=e.ttlMs??kM,this.#n=e.batchMs??AM,this.#r=Math.max(1,Math.min(e.maxPerCall??100,500)),this.#i=e.maxEntries??jM,this.#a=e.now??Date.now}get unsupported(){return this.#f}peek(e,t){return this.#o.get(MM(e,t))?.answer}watch(e,t,n){let r=t.map(t=>MM(e,t));return r.forEach((r,i)=>{let a=this.#s.get(r);a||this.#s.set(r,a=new Set),a.add(n);let o=this.#o.get(r);(!o||this.#a()-o.at>=this.#t)&&this.#p(e,t[i])}),()=>{for(let e of r){let t=this.#s.get(e);t&&(t.delete(n),t.size===0&&this.#s.delete(e))}}}invalidate(e){this.#u.set(e,(this.#u.get(e)??0)+1);let t=`${e}\n`;for(let[e,n]of this.#o)e.startsWith(t)&&(n.at=-1/0);for(let n of this.#s.keys())n.startsWith(t)&&this.#p(e,n.slice(t.length))}#p(e,t){if(this.#f||this.#l.has(MM(e,t)))return;let n=this.#c.get(e);n||this.#c.set(e,n=new Set),n.add(t),this.#d??=setTimeout(()=>this.#m(),this.#n)}#m(){this.#d=null;let e=[...this.#c];this.#c.clear();for(let[t,n]of e){let e=[...n];for(let n=0;n<e.length;n+=this.#r)this.#h(t,e.slice(n,n+this.#r))}}async#h(e,t){let n=this.#u.get(e)??0,r=t.map(t=>MM(e,t));r.forEach(e=>this.#l.add(e));let i;try{let{results:n}=await this.#e(e,t);i=t.map((e,t)=>{let r=n[t]?.path===e?n[t]:n.find(t=>t.path===e);return r?r.exists?r.kind===`dir`?`dir`:`file`:`missing`:`unchecked`})}catch(e){if(NM(e)){r.forEach(e=>this.#l.delete(e)),this.#f=!0,this.#c.clear(),this.#_([...this.#s.keys()]);return}i=t.map(()=>`unchecked`)}r.forEach(e=>this.#l.delete(e));let a=(this.#u.get(e)??0)!==n,o=a?-1/0:this.#a(),s=[];r.forEach((n,r)=>{let c=i[r],l=this.#o.get(n);this.#o.delete(n),this.#o.set(n,{answer:c,at:o}),l?.answer!==c&&s.push(n),a&&this.#s.has(n)&&this.#p(e,t[r])}),this.#g(),this.#_(s)}#g(){for(;this.#o.size>this.#i;){let e=this.#o.keys().next().value;if(e===void 0)break;this.#o.delete(e)}}#_(e){let t=new Set;for(let n of e)this.#s.get(n)?.forEach(e=>t.add(e));t.forEach(e=>e())}};function FM(e){if(e===null||e.length===0)return{state:`unchecked`};for(let t=0;t<e.length;t++){let n=e[t];if(n===`file`||n===`dir`)return{state:`found`,index:t,kind:n};if(n===void 0)return{state:`unknown`};if(n===`unchecked`)return{state:`unchecked`}}return{state:`missing`}}var IM=(0,v.createContext)({sessionId:null,cwd:null,homeDir:null,platform:null,remote:!1,grant:null,openInViewer:null,bridge:null,notify:null,stat:null});function LM(e){typeof document>`u`||document.querySelectorAll(`audio, video`).forEach(t=>{t!==e&&!t.paused&&t.pause()})}var RM=`This file is on the PC that runs this chat — open it on that PC.`;function zM({kind:e}){let t=`h-3.5 w-3.5 text-fg-faint`;switch(e){case`audio`:return(0,W.jsx)(q.Music,{className:t});case`video`:return(0,W.jsx)(q.Film,{className:t});case`image`:return(0,W.jsx)(q.Image,{className:t});case`file`:return(0,W.jsx)(q.File,{className:t});case`dir`:return(0,W.jsx)(q.Folder,{className:t})}}var BM={file:`f`,dir:`d`,missing:`m`,unchecked:`u`},VM={f:`file`,d:`dir`,m:`missing`,u:`unchecked`};function HM(e,t,n){let r=n.join(`
144
144
  `),i=(0,v.useCallback)(r=>e&&t&&n.length>0?e.watch(t,n,r):()=>{},[e,t,r]),a=()=>!e||!t||n.length===0||e.unsupported?`X`:n.map(n=>{let r=e.peek(t,n);return r===void 0?`?`:BM[r]}).join(``),o=(0,v.useSyncExternalStore)(i,a,a);return(0,v.useMemo)(()=>FM(o===`X`?null:[...o].map(e=>VM[e])),[o])}function UM({variant:e,state:t,title:n,children:r}){return e===`block`?(0,W.jsx)(`div`,{className:`my-2`,"data-testid":`local-file-plain`,"data-state":t,children:(0,W.jsx)(`div`,{className:`max-w-full break-all rounded-md border border-border bg-code-bg px-2 py-1.5 font-mono text-[12.5px]`,children:(0,W.jsx)(`code`,{children:r})})}):e===`code`?(0,W.jsx)(`code`,{"data-testid":`local-file-plain`,"data-state":t,title:n,children:r}):(0,W.jsx)(`span`,{"data-testid":`local-file-plain`,"data-state":t,title:n,children:r})}function WM({label:e,onClick:t,testId:n,children:r}){return(0,W.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"data-testid":n,onClick:e=>{e.preventDefault(),t()},className:`inline-flex items-center justify-center rounded p-0.5 text-fg-muted hover:bg-surface-3 hover:text-fg`,children:r})}function GM(e){return e instanceof hm?e.status===404&&e.message.startsWith(`no route for`)?`This PC’s OonaCode cannot play files from the chat yet — update it.`:e.code===`session_not_found`?`Send a message first — this chat is not saved yet.`:e.status===404?`Not found on this PC.`:e.message:e instanceof Error?e.message:String(e)}function KM({sessionId:e,path:t,kind:n,grant:r}){let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let n=!0;return a(null),r(e,t).then(e=>{n&&a({url:e.url})},e=>{n&&a({error:GM(e)})}),()=>{n=!1}},[e,t,r,o]),(0,v.useEffect)(()=>{if(!c||typeof window>`u`)return;let e=e=>{e.key===`Escape`&&l(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]);let u=()=>{o===0?s(1):a({error:`It could not be played here.`})},d=e=>LM(e.currentTarget);return i===null?(0,W.jsxs)(`span`,{className:`my-1 flex items-center gap-1 text-xs text-fg-muted`,"data-testid":`local-file-loading`,children:[(0,W.jsx)(q.Spinner,{className:`h-3 w-3`}),` Loading…`]}):`error`in i?(0,W.jsx)(`span`,{className:`my-1 block text-xs text-danger`,"data-testid":`local-file-error`,children:i.error}):n===`audio`?(0,W.jsx)(`audio`,{controls:!0,autoPlay:!0,preload:`metadata`,src:i.url,onPlay:d,onError:u,className:`my-1 block h-9 w-full max-w-sm`,"data-testid":`local-file-audio`}):n===`video`?(0,W.jsx)(`video`,{controls:!0,autoPlay:!0,preload:`metadata`,src:i.url,onPlay:d,onError:u,className:`my-1 block max-h-72 w-full max-w-md rounded border border-border bg-black`,"data-testid":`local-file-video`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`img`,{src:i.url,alt:yM(t),onError:u,onClick:()=>l(!0),title:`Enlarge`,className:`my-1 block max-h-40 max-w-full cursor-zoom-in rounded border border-border`,"data-testid":`local-file-image`}),c&&typeof document<`u`?(0,Ly.createPortal)((0,W.jsx)(`div`,{role:`dialog`,"aria-label":yM(t),onClick:()=>l(!1),className:`fixed inset-0 z-50 flex cursor-zoom-out items-center justify-center bg-black/70 p-6`,"data-testid":`local-file-zoom`,children:(0,W.jsx)(`img`,{src:i.url,alt:yM(t),className:`max-h-[90vh] max-w-[90vw] rounded shadow-lg`})}),document.body):null]})}var qM=(0,v.memo)(function({path:e,base:t,variant:n,altDir:r=null,altDirBase:i=null,guess:a=!1,children:o}){let s=(0,v.useContext)(IM),c=(0,v.useMemo)(()=>{let n=[],a=e=>{let t=hM(e,s);t!==null&&!n.includes(t)&&n.push(t)};return a({path:e,base:t}),t===`rel`&&r!==null&&i!==null&&a(rM({path:r,base:i},e)),n},[e,t,r,i,s.cwd,s.homeDir,s.platform]),l=HM(s.remote?null:s.stat,s.sessionId,c),[u,d]=(0,v.useState)(!1),f=l.state===`found`,p=f?c[l.index]:c[0]??null,m=f&&l.kind===`dir`?`dir`:_M(p??e),h=m===`audio`||m===`video`||m===`image`?m:null,g=l.state===`unknown`||l.state===`missing`?l.state:l.state===`unchecked`&&a?`unchecked`:null,_=!s.remote&&p!==null,y=_&&m!==`dir`?gM(p,s):null,b=y!==null&&s.openInViewer!==null&&vM(p),x=_&&!!s.bridge?.openPath,S=_&&!!s.bridge?.showItemInFolder,C=_&&h!==null&&s.grant!==null&&s.sessionId!==null,w=m===`dir`?`Open the folder`:`Open with its app`,T=()=>{!p||!s.bridge?.openPath||s.bridge.openPath(p).then(e=>{!e.ok&&e.message&&s.notify?.(e.shownInFolder?`info`:`error`,e.message)},e=>s.notify?.(`error`,GM(e)))},E=()=>{!p||!s.bridge?.showItemInFolder||s.bridge.showItemInFolder(p).then(e=>{!e.ok&&e.message&&s.notify?.(`error`,e.message)},e=>s.notify?.(`error`,GM(e)))},D=b?{run:()=>s.openInViewer(y),title:`Open in the file viewer`}:x?{run:T,title:w}:C?{run:()=>d(e=>!e),title:m===`image`?`Show here`:`Play here`}:null,O=p??e,k=s.remote?`${O}\n${RM}`:D?`${D.title}\n${O}`:O;if(g)return(0,W.jsx)(UM,{variant:n,state:g,title:n===`link`?O:void 0,children:o});let A=n===`code`||n===`block`?(0,W.jsx)(`code`,{className:n===`block`?`break-all`:void 0,children:o}):(0,W.jsx)(`span`,{className:U(`min-w-0 break-all`,n===`bare`&&`font-mono text-[0.92em]`),children:o}),j=D?(0,W.jsx)(`button`,{type:`button`,onClick:e=>{e.preventDefault(),D.run()},title:k,"data-testid":`local-file-name`,className:`min-w-0 cursor-pointer text-left text-accent underline decoration-dotted underline-offset-2 hover:decoration-solid`,children:A}):(0,W.jsx)(`span`,{title:k,"data-testid":`local-file-name`,className:`min-w-0`,children:A}),M=(0,W.jsxs)(W.Fragment,{children:[C?(0,W.jsx)(WM,{label:u?`Close the player`:m===`image`?`Show here`:`Play here`,onClick:()=>d(e=>!e),testId:`local-file-play`,children:u?(0,W.jsx)(q.X,{className:`h-3 w-3`}):m===`image`?(0,W.jsx)(q.Image,{className:`h-3 w-3`}):(0,W.jsx)(q.Play,{className:`h-3 w-3`})}):null,x?(0,W.jsx)(WM,{label:w,onClick:T,testId:`local-file-open`,children:(0,W.jsx)(q.ExternalLink,{className:`h-3 w-3`})}):null,S?(0,W.jsx)(WM,{label:m===`dir`?`Show in its folder`:`Show in folder`,onClick:E,testId:`local-file-folder`,children:(0,W.jsx)(q.Folder,{className:`h-3 w-3`})}):null,s.remote?(0,W.jsx)(`span`,{title:RM,"aria-label":RM,"data-testid":`local-file-remote`,children:(0,W.jsx)(q.Monitor,{className:`h-3 w-3 text-fg-faint`})}):null]}),ee=u&&C&&h?(0,W.jsx)(`span`,{className:`block`,"data-testid":`local-file-player`,children:(0,W.jsx)(KM,{sessionId:s.sessionId,path:p,kind:h,grant:s.grant})}):null;return n===`block`?(0,W.jsxs)(`div`,{className:`my-2`,"data-testid":`local-file`,"data-kind":m,"data-path":O,children:[(0,W.jsxs)(`div`,{className:`flex max-w-full items-center gap-1 rounded-md border border-border bg-code-bg px-2 py-1.5 font-mono text-[12.5px]`,children:[(0,W.jsx)(zM,{kind:m}),j,M]}),ee]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:U(`inline-flex max-w-full items-center gap-0.5 align-baseline`,n===`link`&&`rounded border border-border bg-surface-2 px-1 py-px`),"data-testid":`local-file`,"data-kind":m,"data-path":O,children:[n===`link`?(0,W.jsx)(zM,{kind:m}):null,j,M]}),ee]})});function JM(e){let{filePath:t,fileBase:n,fileVariant:r,fileAltDir:i,fileAltDirBase:a,fileGuess:o,children:s}=e;return!t||!n?(0,W.jsx)(W.Fragment,{children:s}):(0,W.jsx)(qM,{path:t,base:n,variant:r??`bare`,altDir:i&&a?i:null,altDirBase:i&&a?a:null,guess:o===!0,children:s})}var YM=(0,v.memo)(function({text:e}){let t=(0,v.useMemo)(()=>{let t=uM(e);if(t.length===0)return null;let n=[],r=0;for(let i of t)i.start>r&&n.push(e.slice(r,i.start)),n.push((0,W.jsx)(qM,{path:i.ref.path,base:i.ref.base,variant:i.label===void 0?`bare`:`link`,guess:i.folder===!0,children:i.label??e.slice(i.start,i.end)},i.start)),r=i.end;return r<e.length&&n.push(e.slice(r)),n},[e]);return(0,W.jsx)(W.Fragment,{children:t??e})});async function XM(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function ZM({text:e,className:t}){let[n,r]=(0,v.useState)(!1);return(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Copy to clipboard`,title:`Copy`,className:U(`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-fg-muted hover:bg-surface-3 hover:text-fg`,t),onClick:()=>{XM(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1500))})},children:[n?(0,W.jsx)(q.Check,{className:`w-3 h-3`}):(0,W.jsx)(q.Copy,{className:`w-3 h-3`}),n?`Copied`:`Copy`]})}function QM({code:e,language:t,className:n,maxHeight:r}){return(0,W.jsxs)(`div`,{className:U(`group relative my-2 overflow-hidden rounded-md border border-border bg-code-bg`,n),children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-2 py-0.5 text-[11px] text-fg-faint`,children:[(0,W.jsx)(`span`,{className:`font-mono`,children:t||`text`}),(0,W.jsx)(ZM,{text:e})]}),(0,W.jsx)(`pre`,{className:`m-0 overflow-x-auto p-3 font-mono text-[12.5px] leading-relaxed`,style:r?{maxHeight:r,overflowY:`auto`}:void 0,children:(0,W.jsx)(`code`,{children:e})})]})}function $M(e){return typeof e==`string`?e:Array.isArray(e)?e.map($M).join(``):e&&typeof e==`object`&&`props`in e?$M(e.props.children):``}function eN(e){window.oonacode?.openExternal?window.oonacode.openExternal(e):window.open(e,`_blank`,`noopener,noreferrer`)}var tN={pre({children:e}){let t=Array.isArray(e)?e[0]:e,n=t&&typeof t==`object`&&`props`in t?t.props:null,r=n?.className?.match(/language-([\w-]+)/)?.[1]??null,i=$M(n?.children??e).replace(/\n$/,``);return(0,W.jsx)(QM,{code:i,language:r})},a({href:e,children:t}){let n=e??``;return(0,W.jsx)(`a`,{href:n,onClick:e=>{/^https?:/i.test(n)&&(e.preventDefault(),eN(n))},rel:`noopener noreferrer`,target:`_blank`,children:t})}},nN=[fj],rN=[fj,OM],iN={...tN,[bM]:JM},aN=(0,v.memo)(function({text:e,className:t,localFiles:n=!1}){return(0,W.jsx)(`div`,{className:U(`md break-words`,t),children:(0,W.jsx)(cO,{remarkPlugins:n?rN:nN,components:n?iN:tN,children:e})})});function oN({pack:e,where:t}){let n=`shrink-0 rounded-sm px-1 py-px text-[10px] leading-none font-semibold tracking-wide uppercase`;return(0,W.jsxs)(W.Fragment,{children:[e.builtin?(0,W.jsx)(`span`,{"data-testid":t===`row`?`tool-pack-builtin-${e.slug}`:void 0,className:U(n,`bg-accent-soft text-accent`),children:`Built in`}):null,e.status===`demo`?(0,W.jsx)(`span`,{"data-testid":t===`row`?`tool-pack-demo-${e.slug}`:void 0,className:U(n,`bg-warn-soft text-warn`),children:`Demo`}):null,e.status===`live`&&e.install&&e.installed===!1?(0,W.jsx)(`span`,{"data-testid":t===`row`?`tool-pack-install-${e.slug}`:void 0,title:`The first time a chat uses it, OonaCode asks once to install it (${yl(e.install.sizeBytes)}).`,className:U(n,`bg-surface-2 text-fg-muted`),children:`Installs on first use`}):null]})}function sN({pack:e,row:t,panel:n,id:r,cardRef:i,onMouseEnter:a,onMouseLeave:o,onBlur:s}){let[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(()=>({width:window.innerWidth,height:window.innerHeight}));(0,v.useLayoutEffect)(()=>{let e=i.current?.offsetHeight??0;e!==c&&l(e)}),(0,v.useEffect)(()=>{let e=()=>d({width:window.innerWidth,height:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let f=kg({row:t,panel:n,height:c,viewport:u}),p=Zd(e),m=Ol(e);return(0,Ly.createPortal)((0,W.jsxs)(`div`,{ref:i,id:r,role:`tooltip`,tabIndex:-1,"data-testid":`tool-pack-card`,"data-pack":e.slug,"data-side":f.side,onMouseEnter:a,onMouseLeave:o,onBlur:s,className:`fixed z-[60] flex flex-col overflow-hidden rounded-lg border border-border bg-surface text-xs text-fg shadow-lg focus:outline-none`,style:{left:f.left,top:f.top,width:f.width,maxHeight:f.maxHeight},children:[(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-2`,children:[(0,W.jsx)(q.Tool,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,W.jsx)(oN,{pack:e,where:`card`})]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 py-2`,"data-testid":`tool-pack-card-body`,children:p?(0,W.jsx)(aN,{text:p,className:`md-compact leading-relaxed`}):(0,W.jsxs)(`div`,{"data-testid":`tool-pack-card-fallback`,className:`space-y-1.5 leading-snug`,children:[(0,W.jsx)(`p`,{className:`text-fg-muted`,children:Qd(e)}),e.status===`demo`?(0,W.jsx)(`p`,{className:`text-fg-faint`,children:$d}):null]})}),(0,W.jsxs)(`div`,{className:`shrink-0 border-t border-border px-3 py-1.5 text-[10px] text-fg-faint`,children:[`≈`,m.toLocaleString(),` tokens on every request while it is on`]})]}),document.body)}var cN=352,lN=388;function uN(e){let t=e?.getBoundingClientRect();return t?{left:t.left,top:t.top,right:t.right,bottom:t.bottom}:null}function dN({disabled:e}){let{state:t,actions:n}=G(),r=Ay(),i=jy(),a=ky(),o=Oy(),s=t.agentTools?.packs??[],[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)({up:!0,right:!1}),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=(0,v.useRef)(null),[g,_]=(0,v.useState)(null),y=(0,v.useId)(),b=(0,v.useRef)(null),x=(0,v.useRef)(null),S=(0,v.useRef)(!1),C=()=>{b.current&&clearTimeout(b.current),x.current&&clearTimeout(x.current),b.current=null,x.current=null};if((0,v.useEffect)(()=>C,[]),(0,v.useEffect)(()=>{l(!1)},[o]),(0,v.useEffect)(()=>{c||(C(),_(null))},[c]),(0,v.useEffect)(()=>{if(!c)return;let e=e=>{let t=e.target;h.current?.contains(t)||f.current&&!f.current.contains(t)&&l(!1)},t=e=>{if(e.key===`Escape`){if(e.preventDefault(),h.current){let e=h.current.dataset.pack,t=h.current.contains(document.activeElement);C(),_(null),t&&e&&(S.current=!0,Array.from(m.current?.querySelectorAll(`[data-testid^="tool-pack-info-"]`)??[]).find(t=>t.dataset.testid===`tool-pack-info-${e}`)?.focus(),S.current=!1);return}l(!1),p.current?.focus()}};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[c]),(0,v.useEffect)(()=>{c&&m.current?.querySelector(`[role="switch"]`)?.focus()},[c]),(0,v.useEffect)(()=>{if(!c)return;let e=()=>{let e=f.current?.getBoundingClientRect();if(!e)return;let t=window.innerHeight-e.bottom,n=e.top;d({up:t>=lN?!1:n>t,right:e.left+cN>window.innerWidth&&e.right>=cN})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[c]),s.length===0||!o||t.remote.tabs[o])return null;let w=i?i.toolPacks:r?.toolPacks,T=Jd(s,w),E=!i&&((a?.items.length??0)>0||(r?.entryCount??0)>0),D=(e=!0)=>{l(!1),e&&p.current?.focus()},O=(e,t,n)=>{let r=uN(t);if(!r)return;let i=uN(m.current)??r;_(t=>t&&t.slug===e&&t.via===`focus`&&n===`hover`?t:{slug:e,row:r,panel:i,via:n})},k=()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{x.current=null,_(e=>e?.via===`hover`?null:e)},200)},A=(e,t)=>{if(C(),g?.slug!==e){if(g){O(e,t,`hover`);return}b.current=setTimeout(()=>{b.current=null,O(e,t,`hover`)},300)}},j=()=>{b.current&&clearTimeout(b.current),b.current=null,g?.via===`hover`&&k()},M=(e,t)=>{S.current||(C(),O(e,t.closest(`li`),`focus`))},ee=e=>{let t=e.relatedTarget;t&&h.current?.contains(t)||t instanceof HTMLElement&&t.dataset.testid===`tool-pack-info-${g?.slug}`||_(e=>e?.via===`focus`?null:e)},N=c&&g?s.find(e=>e.slug===g.slug):void 0,P=e=>{let t=!xl(e,w);n.setSessionToolPacks(o,qd(w,e.slug,t))};return(0,W.jsxs)(`span`,{ref:f,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,ref:p,"aria-label":T.label,"aria-haspopup":`dialog`,"aria-expanded":c,title:T.title,"data-testid":`tools-picker`,"data-count":T.count,disabled:e,onClick:()=>c?D():l(!0),className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs hover:bg-fg/5 disabled:opacity-50`,T.count>0?`text-fg`:`text-fg-muted`),children:[(0,W.jsx)(q.Tool,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{children:`Tools`}),(0,W.jsxs)(`span`,{className:T.count>0?`text-accent`:`text-fg-faint`,children:[`· `,T.count]})]}),c?(0,W.jsx)(`div`,{ref:m,role:`dialog`,"aria-label":`Tools for this chat`,"data-testid":`tools-panel`,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(m.current?.querySelectorAll(`[role="switch"]:not([disabled])`)??[]);if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},className:U(`absolute z-50 w-[22rem] max-w-[calc(100vw-2rem)]`,u.up?`bottom-full mb-1`:`top-full mt-1`,u.right?`right-0`:`left-0`),children:(0,W.jsxs)(`div`,{className:`flex max-h-[24rem] flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Tool,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`OonaCode tools`}),(0,W.jsxs)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:[T.count,` of `,s.length,` on`]})]}),(0,W.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,onScroll:()=>{g&&_(null)},children:s.map(t=>(0,W.jsx)(fN,{pack:t,on:xl(t,w),disabled:e,onToggle:()=>P(t),cardOpen:N?.slug===t.slug,cardId:y,onEnter:e=>A(t.slug,e),onLeave:j,onInfoFocus:e=>M(t.slug,e),onInfoBlur:ee},t.slug))}),E?(0,W.jsx)(`div`,{className:`border-t border-border px-2.5 py-1.5 text-[11px] leading-snug text-fg-faint`,"data-testid":`tools-restart-note`,children:Xd}):null]})}):null,N&&g?(0,W.jsx)(sN,{pack:N,row:g.row,panel:g.panel,id:y,cardRef:h,onMouseEnter:()=>{x.current&&clearTimeout(x.current),x.current=null},onMouseLeave:()=>{g.via===`hover`&&k()},onBlur:ee}):null]})}function fN({pack:e,on:t,disabled:n,onToggle:r,cardOpen:i,cardId:a,onEnter:o,onLeave:s,onInfoFocus:c,onInfoBlur:l}){let u=Ol(e);return(0,W.jsxs)(`li`,{className:U(`flex items-start gap-3 px-2.5 py-2 hover:bg-surface-2`,i&&`bg-surface-2`),"data-testid":`tool-pack-${e.slug}`,onMouseEnter:e=>o(e.currentTarget),onMouseLeave:s,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`truncate text-xs font-medium text-fg`,children:e.name}),(0,W.jsx)(oN,{pack:e,where:`row`}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`About ${e.name}`,"aria-expanded":i,"aria-describedby":i?a:void 0,"data-testid":`tool-pack-info-${e.slug}`,onFocus:e=>c(e.currentTarget),onClick:e=>c(e.currentTarget),onBlur:l,className:`shrink-0 cursor-help rounded text-fg-faint hover:text-fg focus-visible:text-fg focus-visible:outline-2 focus-visible:outline-accent`,children:(0,W.jsx)(q.Info,{className:`w-3.5 h-3.5`})})]}),e.description?(0,W.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11px] leading-snug text-fg-muted`,children:e.description}):null,(0,W.jsxs)(`p`,{className:`mt-0.5 text-[10px] text-fg-faint`,children:[`≈`,u.toLocaleString(),` tokens per request`]})]}),(0,W.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":e.name,disabled:n,"data-testid":`tool-pack-switch-${e.slug}`,onClick:r,className:U(`relative mt-0.5 h-5 w-9 shrink-0 rounded-full border transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50`,t?`border-accent bg-accent`:`border-border bg-surface-2`),children:(0,W.jsx)(`span`,{className:U(`absolute top-0.5 h-3.5 w-3.5 rounded-full bg-surface transition-all`,t?`left-[1.15rem]`:`left-0.5`)})})]})}var pN=new Map;function mN(e){e===void 0?pN.clear():pN.delete(e)}function hN(e,t,n){let[,r]=(0,v.useState)(0),i=(0,v.useRef)(null),a=e===null?void 0:pN.get(e),o=a!==void 0&&Date.now()-a.at<6e4;return(0,v.useEffect)(()=>{if(!t||e===null||o||i.current===e)return;i.current=e;let a=!0;return n(e).then(t=>pN.set(e,{at:Date.now(),value:t})).catch(()=>pN.set(e,{at:Date.now(),value:null})).finally(()=>{i.current===e&&(i.current=null),a&&r(e=>e+1)}),()=>{a=!1}},[t,e,o,n]),a===void 0?{status:t?`loading`:`idle`,data:null}:a.value===`unsupported`?{status:`unsupported`,data:null}:a.value===null?{status:`error`,data:null}:{status:`ready`,data:a.value}}function gN(e){return e!==null&&pN.get(e)?.value===`unsupported`}function _N({skill:e,where:t}){return(0,W.jsx)(`span`,{"data-testid":t===`row`?`skill-source-${e.name}`:void 0,className:U(`shrink-0 rounded-sm px-1 py-px text-[10px] leading-none font-semibold tracking-wide uppercase`,e.source===`user`?`bg-accent-soft text-accent`:e.source===`project`?`bg-warn-soft text-warn`:`bg-surface-2 text-fg-muted`),children:Hp(e.source)})}function vN({skill:e,on:t,row:n,panel:r,id:i,cardRef:a,onMouseEnter:o,onMouseLeave:s,onBlur:c}){let[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(()=>({width:window.innerWidth,height:window.innerHeight}));(0,v.useLayoutEffect)(()=>{let e=a.current?.offsetHeight??0;e!==l&&u(e)}),(0,v.useEffect)(()=>{let e=()=>f({width:window.innerWidth,height:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let p=kg({row:n,panel:r,height:l,viewport:d});return(0,Ly.createPortal)((0,W.jsxs)(`div`,{ref:a,id:i,role:`tooltip`,tabIndex:-1,"data-testid":`skill-card`,"data-skill":e.name,"data-side":p.side,onMouseEnter:o,onMouseLeave:s,onBlur:c,className:`fixed z-[60] flex flex-col overflow-hidden rounded-lg border border-border bg-surface text-xs text-fg shadow-lg focus:outline-none`,style:{left:p.left,top:p.top,width:p.width,maxHeight:p.maxHeight},children:[(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-2`,children:[(0,W.jsx)(q.Skill,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-medium font-mono`,children:[`/`,e.label]}),(0,W.jsx)(_N,{skill:e,where:`card`})]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 py-2`,"data-testid":`skill-card-body`,children:(0,W.jsx)(aN,{text:Wp(e,t),className:`md-compact leading-relaxed`})}),(0,W.jsxs)(`div`,{className:`shrink-0 border-t border-border px-3 py-1.5 text-[10px] text-fg-faint`,children:[`≈`,e.tokens.toLocaleString(),` tokens on every request while it is on`]})]}),document.body)}var yN=384,bN=420;function xN(e){let t=e?.getBoundingClientRect();return t?{left:t.left,top:t.top,right:t.right,bottom:t.bottom}:null}function SN({disabled:e}){let{state:t,actions:n}=G(),r=Ay(),i=jy(),a=ky(),o=Oy(),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)({up:!0,right:!1}),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useRef)(null),[h,g]=(0,v.useState)(null),_=(0,v.useId)(),y=(0,v.useRef)(null),b=(0,v.useRef)(null),x=(0,v.useRef)(!1),S=o?!!t.remote.tabs[o]:!1,{status:C,data:w}=hN(S?null:o,s,n.listChatSkills),T=()=>{y.current&&clearTimeout(y.current),b.current&&clearTimeout(b.current),y.current=null,b.current=null};if((0,v.useEffect)(()=>T,[]),(0,v.useEffect)(()=>{c(!1)},[o]),(0,v.useEffect)(()=>{s||(T(),g(null))},[s]),(0,v.useEffect)(()=>{if(!s)return;let e=e=>{let t=e.target;m.current?.contains(t)||d.current&&!d.current.contains(t)&&c(!1)},t=e=>{if(e.key===`Escape`){if(e.preventDefault(),m.current){let e=m.current.dataset.skill,t=m.current.contains(document.activeElement);T(),g(null),t&&e&&(x.current=!0,Array.from(p.current?.querySelectorAll(`[data-skill-info]`)??[]).find(t=>t.dataset.skillInfo===e)?.focus(),x.current=!1);return}c(!1),f.current?.focus()}};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[s]),(0,v.useEffect)(()=>{!s||C!==`ready`||p.current?.querySelector(`[role="switch"]`)?.focus()},[s,C]),(0,v.useEffect)(()=>{if(!s)return;let e=()=>{let e=d.current?.getBoundingClientRect();if(!e)return;let t=window.innerHeight-e.bottom,n=e.top;u({up:t>=bN?!1:n>t,right:e.left+yN>window.innerWidth&&e.right>=yN})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[s]),!o||S||gN(o))return null;let E=(i?i.modelSkills:r?.modelSkills)??[],D=w?.skills??[],O=Lp(w?D:null,E),k=Ip(D,E),A=!i&&((a?.items.length??0)>0||(r?.entryCount??0)>0),j=(e=!0)=>{c(!1),e&&f.current?.focus()},M=(e,t,n)=>{let r=xN(t);if(!r)return;let i=xN(p.current)??r;g(t=>t&&t.name===e&&t.via===`focus`&&n===`hover`?t:{name:e,row:r,panel:i,via:n})},ee=()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,g(e=>e?.via===`hover`?null:e)},200)},N=(e,t)=>{if(T(),h?.name!==e){if(h){M(e,t,`hover`);return}y.current=setTimeout(()=>{y.current=null,M(e,t,`hover`)},300)}},P=()=>{y.current&&clearTimeout(y.current),y.current=null,h?.via===`hover`&&ee()},F=(e,t)=>{x.current||(T(),M(e,t.closest(`li`),`focus`))},I=e=>{let t=e.relatedTarget;t&&m.current?.contains(t)||t instanceof HTMLElement&&t.dataset.skillInfo===h?.name||g(e=>e?.via===`focus`?null:e)},te=s&&h?D.find(e=>e.name===h.name):void 0,ne=e=>{let t=!Fp(E,e.name);n.setSessionModelSkills(o,Pp(E,e.name,t))};return(0,W.jsxs)(`span`,{ref:d,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,ref:f,"aria-label":O.label,"aria-haspopup":`dialog`,"aria-expanded":s,title:O.title,"data-testid":`skills-picker`,"data-count":O.count,disabled:e,onClick:()=>s?j():c(!0),className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs hover:bg-fg/5 disabled:opacity-50`,O.count>0?`text-fg`:`text-fg-muted`),children:[(0,W.jsx)(q.Skill,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{children:`Skills`}),(0,W.jsxs)(`span`,{className:O.count>0?`text-accent`:`text-fg-faint`,children:[`· `,O.count]})]}),s?(0,W.jsx)(`div`,{ref:p,role:`dialog`,"aria-label":`Skills for this chat`,"data-testid":`skills-panel`,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(p.current?.querySelectorAll(`[role="switch"]:not([disabled])`)??[]);if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},className:U(`absolute z-50 w-[24rem] max-w-[calc(100vw-2rem)]`,l.up?`bottom-full mb-1`:`top-full mt-1`,l.right?`right-0`:`left-0`),children:(0,W.jsxs)(`div`,{className:`flex max-h-[26rem] flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Skill,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Skills`}),(0,W.jsxs)(`span`,{className:`normal-case tracking-normal text-fg-faint`,"data-testid":`skills-panel-count`,children:[O.count,` of `,D.length,` on`,k>0?` · ≈${k.toLocaleString()} tokens/request`:``]})]}),(0,W.jsx)(`p`,{className:`border-b border-border px-2.5 py-1.5 text-[11px] leading-snug text-fg-muted`,"data-testid":`skills-intro`,children:zp}),C===`loading`||C===`idle`?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 text-xs text-fg-muted`,role:`status`,children:[(0,W.jsx)(q.Spinner,{className:`h-3.5 w-3.5 animate-spin`}),` Reading this chat’s skills…`]}):C===`error`?(0,W.jsx)(`div`,{className:`px-2.5 py-2 text-xs text-fg-muted`,role:`status`,children:`The host could not list this chat’s skills right now — typing one still runs it.`}):D.length===0?(0,W.jsx)(`div`,{className:`px-2.5 py-2 text-xs text-fg-muted`,role:`status`,"data-testid":`skills-empty`,children:`No skill the model could use here yet.`}):(0,W.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,onScroll:()=>{h&&g(null)},children:D.map(t=>(0,W.jsx)(CN,{skill:t,on:Fp(E,t.name),disabled:e,onToggle:()=>ne(t),cardOpen:te?.name===t.name,cardId:_,onEnter:e=>N(t.name,e),onLeave:P,onInfoFocus:e=>F(t.name,e),onInfoBlur:I},t.name))}),(0,W.jsxs)(`div`,{className:`space-y-0.5 border-t border-border px-2.5 py-1.5 text-[11px] leading-snug text-fg-faint`,children:[w&&w.typeOnly>0?(0,W.jsx)(`p`,{"data-testid":`skills-type-only`,children:w.typeOnly===1?`1 more skill is in the / menu for typing only — the model is never shown it.`:`${w.typeOnly} more skills are in the / menu for typing only — the model is never shown them.`}):null,O.count===0?(0,W.jsx)(`p`,{"data-testid":`skills-tool-note`,children:Vp}):null,A?(0,W.jsx)(`p`,{"data-testid":`skills-restart-note`,children:Bp}):null]})]})}):null,te&&h?(0,W.jsx)(vN,{skill:te,on:Fp(E,te.name),row:h.row,panel:h.panel,id:_,cardRef:m,onMouseEnter:()=>{b.current&&clearTimeout(b.current),b.current=null},onMouseLeave:()=>{h.via===`hover`&&ee()},onBlur:I}):null]})}function CN({skill:e,on:t,disabled:n,onToggle:r,cardOpen:i,cardId:a,onEnter:o,onLeave:s,onInfoFocus:c,onInfoBlur:l}){let u=`${e.label}: the model may use it on its own in this chat`;return(0,W.jsxs)(`li`,{className:U(`flex items-start gap-3 px-2.5 py-2 hover:bg-surface-2`,i&&`bg-surface-2`),"data-testid":`skill-row-${e.name}`,onMouseEnter:e=>o(e.currentTarget),onMouseLeave:s,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsxs)(`span`,{className:`truncate font-mono text-xs font-medium text-fg`,children:[`/`,e.label]}),(0,W.jsx)(_N,{skill:e,where:`row`}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`About ${e.label}`,"aria-expanded":i,"aria-describedby":i?a:void 0,"data-testid":`skill-info-${e.name}`,"data-skill-info":e.name,onFocus:e=>c(e.currentTarget),onClick:e=>c(e.currentTarget),onBlur:l,className:`shrink-0 cursor-help rounded text-fg-faint hover:text-fg focus-visible:text-fg focus-visible:outline-2 focus-visible:outline-accent`,children:(0,W.jsx)(q.Info,{className:`w-3.5 h-3.5`})})]}),e.description?(0,W.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11px] leading-snug text-fg-muted`,children:e.description}):null,(0,W.jsxs)(`p`,{className:`mt-0.5 text-[10px] text-fg-faint`,"data-testid":`skill-tokens-${e.name}`,children:[`≈`,e.tokens.toLocaleString(),` tokens per request while on`,e.typeable?` · type it to use it once`:` · the model’s only — cannot be typed`]})]}),(0,W.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":u,title:`Model may use it on its own`,disabled:n,"data-testid":`skill-switch-${e.name}`,onClick:r,className:U(`relative mt-0.5 h-5 w-9 shrink-0 rounded-full border transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50`,t?`border-accent bg-accent`:`border-border bg-surface-2`),children:(0,W.jsx)(`span`,{className:U(`absolute top-0.5 h-3.5 w-3.5 rounded-full bg-surface transition-all`,t?`left-[1.15rem]`:`left-0.5`)})})]})}var wN=new Set([`Task`,`Agent`,`Workflow`]);function TN(e){let t=[],n=[];for(let r of e)(r.running?t:n).push(r);return t.concat(n)}function EN(e){return e.kind===`tool`&&wN.has(e.name)}var DN=new Set([`streaming`,`pending`,`running`]);function ON(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function kN(e){return typeof e==`string`&&e.trim()?e.trim():null}function AN(e){let t=e.result?.structured;return t&&typeof t==`object`?t:null}function jN(e){if(e.kind===`tool`&&e.startedAt!==null)return e.startedAt;if(e.timestamp){let t=Date.parse(e.timestamp);if(Number.isFinite(t))return t}return null}var MN=new Map;function NN(e,t){let n=MN.get(t);n||(n=RegExp(`<${t}>([\\s\\S]*?)</${t}>`),MN.set(t,n));let r=n.exec(e);return r?r[1].trim():null}function PN(e,t,n){for(let r of e){if(NN(r.text,`task-id`)!==t)continue;let e=NN(r.text,`tool-use-id`);if(e&&e!==n)continue;let i=NN(r.text,`usage`)??``;return{status:NN(r.text,`status`),tokens:ON(Number(NN(i,`subagent_tokens`)??NaN)),toolUses:ON(Number(NN(i,`tool_uses`)??NaN)),durationMs:ON(Number(NN(i,`duration_ms`)??NaN)),at:jN(r)}}return null}var FN={alive:!0,since:null};function IN(e,t){return e.alive?e.since===null||t===null||t<=0||t>=e.since:!1}function LN(e,t=Date.now(),n={},r=FN){let i=e.filter(EN),a=e.filter(e=>e.kind===`user`&&e.text.includes(`<task-notification>`)),o=zN(i,e,a,t,r),s=RN(e,a,new Set(o.map(e=>e.agentId)),t,n,r);return[...o,...s]}function RN(e,t,n,r,i,a){let o=[],s=new Set(n),c=new Map;for(let e of t){let t=NN(e.text,`task-id`);if(!t||n.has(t))continue;let r=NN(e.text,`usage`)??``,i=NN(e.text,`status`),a=(NN(e.text,`summary`)??``).split(`
145
- `)[0].trim(),o=jN(e)??0,s=c.get(t);s&&s.at>o||c.set(t,{at:o,view:{id:`note:${t}`,agentId:t,name:a.length>0?a.length>80?`${a.slice(0,79)}…`:a:`background task`,type:null,model:null,status:i&&i!==`completed`?`error`:`done`,running:!1,startedAt:null,endedAt:o>0?o:null,durationMs:ON(Number(NN(r,`duration_ms`)??NaN)),tokens:ON(Number(NN(r,`subagent_tokens`)??NaN)),toolCalls:ON(Number(NN(r,`tool_uses`)??NaN))??0,runs:1,nested:0,depth:0}})}for(let[e,t]of c)s.add(e),o.push(t.view);let l=new Map;for(let t of e){if(t.kind!==`permission`)continue;let e=t.request.agentId;if(!e||s.has(e))continue;let n=jN(t),r=l.get(e);r?(r.count+=1,(r.first===null||n!==null&&n<r.first)&&(r.first=n),n!==null&&(r.last===null||n>r.last)&&(r.last=n)):l.set(e,{first:n,last:n,count:1})}for(let[e,t]of l){let n=i[e],c=n?.finished===!0,l=n&&n.at>0?n.at:t.last,u=!c&&IN(a,l),d=n&&n.firstAt>0?t.first===null?n.firstAt:Math.min(t.first,n.firstAt):t.first,f=u?null:c&&n&&n.at>0?n.at:null;o.push({id:`perm:${e}`,agentId:e,name:`background agent`,type:null,model:null,status:u?`running`:c?`done`:`cancelled`,running:u,startedAt:d,endedAt:f,durationMs:d===null?null:Math.max(0,(u?r:f??l??d)-d),tokens:null,toolCalls:Math.max(t.count,n?.toolUses??0),runs:1,nested:0,depth:0}),s.add(e)}for(let[e,t]of Object.entries(i)){if(s.has(e)||l.has(e))continue;let n=!t.finished&&IN(a,t.at>0?t.at:null),i=t.firstAt>0?t.firstAt:null,c=n?null:t.finished&&t.at>0?t.at:null,u=n?r:t.at>0?t.at:i;o.push({id:`act:${e}`,agentId:e,name:`background agent`,type:null,model:null,status:n?`running`:t.finished?`done`:`cancelled`,running:n,startedAt:i,endedAt:c,durationMs:i!==null&&u!==null&&u>0?Math.max(0,u-i):null,tokens:null,toolCalls:t.toolUses,runs:1,nested:0,depth:0})}return o}function zN(e,t,n,r,i){if(e.length===0)return[];let a=new Map(e.map(e=>[e.toolUseId,e])),o=t.filter(e=>e.kind===`tool`&&e.name===`SendMessage`),s=new Map,c=new Map,l=new Map;for(let e of t){if(!e.parentToolUseId||!a.has(e.parentToolUseId))continue;if(e.kind===`assistant`){L(e.model)&&l.set(e.parentToolUseId,e.model);continue}if(e.kind!==`tool`)continue;let t=EN(e)?c:s;t.set(e.parentToolUseId,(t.get(e.parentToolUseId)??0)+1)}let u=e=>{let t=0,n=e.parentToolUseId;for(;n&&a.has(n)&&t<8;)t+=1,n=a.get(n).parentToolUseId;return t};return e.map(e=>{let t=AN(e),a=kN(e.input?.subagent_type),d=kN(e.input?.description)??kN(e.input?.name)??a??e.name,f=kN(t?.agentId)??e.toolUseId,p=t?.isAsync===!0||t?.status===`async_launched`,m={id:e.toolUseId,agentId:f,name:d,type:a,model:l.get(e.toolUseId)??null,startedAt:e.startedAt,nested:c.get(e.toolUseId)??0,depth:u(e)};if(!p){let n=DN.has(e.status)&&!e.result&&IN(i,e.startedAt),a=ON(t?.totalDurationMs)??e.durationMs??(n&&e.startedAt!==null?Math.max(0,r-e.startedAt):e.elapsedSec===null?null:e.elapsedSec*1e3);return{...m,status:n?e.status:DN.has(e.status)?`cancelled`:e.status,running:n,endedAt:n?null:e.finishedAt,durationMs:a,tokens:ON(t?.totalTokens),toolCalls:ON(t?.totalToolUseCount)??s.get(e.toolUseId)??0,runs:1}}let h=[e,...o.filter(e=>{let t=AN(e),n=kN(e.input?.to);return kN(t?.resumedAgentId)===f||n===f||n===d})],g=null,_=null,v=!1,y=!1,b=!1,x=null,S=null,C=null;for(let t of h){let a=PN(n,f,t.toolUseId),o=jN(t);if(!a){if(t!==e&&AN(t)?.success===!1||t!==e&&t.result?.isError)continue;S=o,IN(i,o)?(v=!0,x=o===null?null:Math.max(0,r-o)):(b=!0,x=null),C=null;continue}a.tokens!==null&&(g=(g??0)+a.tokens),a.toolUses!==null&&(_=(_??0)+a.toolUses),a.status&&a.status!==`completed`&&(y=!0),x=a.durationMs??(a.at!==null&&o!==null?Math.max(0,a.at-o):null),S=o,C=a.at}let w=v?`running`:y||e.status===`error`||e.status===`denied`?`error`:b?`cancelled`:`done`;return{...m,startedAt:S??e.startedAt,status:w,running:v,endedAt:v?null:C,durationMs:x,tokens:g,toolCalls:Math.max(_??0,s.get(e.toolUseId)??0),runs:h.length}})}var BN=1e3,VN=6e4;function HN(){let e=ky(),t=Ay(),n=e?.items,[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>Date.now()),s=(0,v.useRef)(null),c=e?.agentActivity,l=e?.status===`running`||e?.status===`waiting_permission`,u=e?.engineSince??null,d=e?.hasSubagentItems===!0||t?.hasSubagents===!0||Object.keys(c??{}).length>0,f=(0,v.useMemo)(()=>n&&d?LN(n,a,c??{},{alive:l,since:u}):[],[n,d,a,c,l,u]),p=f.filter(e=>e.running).length,[m,h]=(0,v.useState)(!1),g=(0,v.useMemo)(()=>m?f:f.filter(e=>e.running||e.endedAt!==null&&a-e.endedAt<VN),[f,a,m]),_=f.length-g.length;if((0,v.useEffect)(()=>{if(!r)return;let e=setInterval(()=>o(Date.now()),BN);return()=>clearInterval(e)},[r]),(0,v.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,v.useEffect)(()=>{i(!1),h(!1)},[e?.sessionId]),f.length===0)return null;let y=p>0?`${p} working`:`${f.length} ${f.length===1?`agent`:`agents`} finished`;return(0,W.jsxs)(`span`,{ref:s,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":y,title:y,"aria-haspopup":`dialog`,"aria-expanded":r,"data-testid":`subagents-badge`,onClick:()=>{o(Date.now()),i(e=>!e)},className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs text-fg-muted hover:bg-fg/5`),children:[(0,W.jsx)(q.Bot,{className:U(`w-3.5 h-3.5`,p>0&&`text-accent`)}),(0,W.jsxs)(`span`,{"data-testid":`subagents-total`,children:[f.length,` `,f.length===1?`agent`:`agents`]}),p>0?(0,W.jsxs)(`span`,{className:`text-accent`,"data-testid":`subagents-working`,children:[`· `,p,` working`]}):null,p>0?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 animate-pulse rounded-full bg-accent`,"data-testid":`subagents-running`}):null]}),r?(0,W.jsx)(`div`,{role:`dialog`,"aria-label":`Subagents of this chat`,"data-testid":`subagents-panel`,className:`absolute bottom-full left-0 z-50 mb-1 w-[24rem] max-w-[calc(100vw-2rem)]`,children:(0,W.jsxs)(`div`,{className:`max-h-[22rem] overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Bot,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Subagents`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:y})]}),(0,W.jsxs)(`ul`,{className:`max-h-[19rem] overflow-y-auto py-1`,children:[TN(g).map(e=>(0,W.jsx)(UN,{agent:e,onJump:()=>i(!1)},e.id)),g.length===0?(0,W.jsx)(`li`,{className:`px-2.5 py-2 text-xs text-fg-faint`,children:`Nothing is working now.`}):null]}),_>0||m?(0,W.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),"data-testid":`subagents-toggle-finished`,className:`w-full border-t border-border px-2.5 py-1.5 text-left text-[11px] text-fg-faint hover:bg-surface-2 hover:text-fg`,children:m?`Hide finished agents`:`${_} finished ${_===1?`agent`:`agents`} hidden — show`}):null]})}):null]})}function UN({agent:e,onJump:t}){let n=()=>{document.querySelector(`[data-testid="tool-${e.id}"]`)?.scrollIntoView({block:`center`,behavior:`smooth`}),t()},r=e.status===`error`||e.status===`denied`,i=r?`danger`:e.running?`accent`:`neutral`,a=e.running?`working`:e.status,o=!e.running;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:n,"data-testid":`subagent-${e.id}`,"data-state":e.running?`working`:r?`failed`:`done`,title:`Show this subagent's card in the chat`,className:U(`flex w-full flex-col gap-0.5 px-2.5 py-1.5 text-left hover:bg-surface-2`,o&&!r&&`opacity-60 hover:opacity-100`),style:e.depth?{paddingLeft:`${.625+e.depth*.75}rem`}:void 0,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.running?(0,W.jsx)(q.Spinner,{className:`w-3 h-3 text-accent`}):(0,W.jsx)(q.Bot,{className:`w-3 h-3 text-fg-faint`}),(0,W.jsx)(`span`,{className:U(`min-w-0 flex-1 truncate text-sm font-medium`,o?`text-fg-muted`:`text-fg`),children:e.name}),(0,W.jsx)(Z,{tone:i,children:a})]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-3 pl-5 text-[11px] text-fg-faint`,children:[e.type&&e.type!==e.name?(0,W.jsx)(`span`,{className:`font-mono`,children:e.type}):null,e.model?(0,W.jsx)(`span`,{className:`font-mono`,"data-testid":`subagent-model-${e.agentId}`,children:e.model}):null,e.runs>1?(0,W.jsxs)(`span`,{children:[`resumed ×`,e.runs-1]}):null,e.durationMs===null?null:(0,W.jsx)(`span`,{children:rg(e.durationMs)}),e.tokens===null?null:(0,W.jsxs)(`span`,{children:[ig(e.tokens),` tokens`]}),(0,W.jsxs)(`span`,{children:[e.toolCalls,` `,e.toolCalls===1?`tool call`:`tool calls`]}),e.nested>0?(0,W.jsxs)(`span`,{children:[e.nested,` `,e.nested===1?`subagent`:`subagents`]}):null]})]})})}function WN({sessionId:e,projectId:t,showChat:n=!1}){let{state:r,actions:i}=G(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=r.scheduledTasksVersion;(0,v.useEffect)(()=>{let n=!0;return i.listScheduledTasks({...e?{sessionId:e}:{},...t?{projectId:t}:{}}).then(e=>{n&&o(e)}),()=>{n=!1}},[e,t,l]);let u=e=>r.sessions.find(t=>t.id===e)?.title??`a chat`;return a===null?null:a.length===0?(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,"data-testid":`scheduled-tasks-empty`,children:`No scheduled tasks. Ask the agent to do something later or on a repeat — it uses OonaCode's scheduler, which runs on this PC even when the chat has gone quiet.`}):(0,W.jsx)(`ul`,{className:`space-y-1.5`,"data-testid":`scheduled-tasks`,children:a.map(e=>(0,W.jsxs)(`li`,{className:`rounded-md border border-border px-2.5 py-1.5 text-xs`,"data-testid":`scheduled-task-${e.id}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,title:e.prompt,children:e.title}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>void i.updateScheduledTask(e.id,{enabled:!e.enabled}),disabled:!e.enabled&&e.nextRunAt===null&&`at`in e.when,"data-testid":`scheduled-task-toggle`,children:e.enabled?`Pause`:`Resume`}),(0,W.jsx)(J,{size:`sm`,variant:s===e.id?`danger`:`ghost`,onClick:()=>{if(s!==e.id){c(e.id);return}c(null),i.deleteScheduledTask(e.id)},"data-testid":`scheduled-task-delete`,children:s===e.id?`Delete?`:`Delete`})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-fg-muted`,children:[tf(e.when),` · `,nf(e.nextRunAt,e.enabled),n?` · in “${u(e.sessionId)}”`:``,e.createdBy===`model`?` · set by the agent`:``]}),e.lastResult?(0,W.jsxs)(`div`,{className:`text-fg-faint`,"data-testid":`scheduled-task-result`,children:[`last: `,e.lastResult]}):null]},e.id))})}function GN(e,t){let n=new Date(e),r=n.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===t.toDateString()?r:`${n.toLocaleDateString(void 0,{month:`short`,day:`numeric`})} ${r}`}function KN(){let{state:e,actions:t}=G(),n=Ay()?.id??null,r=e.scheduledTasksVersion,[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(!1),c=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!n){a([]);return}let e=!0;return t.listScheduledTasks({sessionId:n}).then(t=>{e&&a(t)}).catch(()=>{e&&a([])}),()=>{e=!1}},[n,r]),(0,v.useEffect)(()=>{if(!o)return;let e=e=>{c.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[o]),(0,v.useEffect)(()=>s(!1),[n]),!n||i.length===0)return null;let l=i.filter(e=>e.enabled&&e.nextRunAt!==null),u=l.map(e=>e.nextRunAt).sort().at(0),d=l.length>0?`${l.length} scheduled${u?` · next ${GN(u,new Date)}`:``}`:`${i.length} scheduled · paused`;return(0,W.jsxs)(`span`,{ref:c,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Scheduled tasks: ${d}`,title:`Scheduled tasks of this chat — ${d}`,"aria-haspopup":`dialog`,"aria-expanded":o,"data-testid":`scheduled-badge`,onClick:()=>s(e=>!e),className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs hover:bg-fg/5`,l.length>0?`text-accent`:`text-fg-muted`),children:[(0,W.jsx)(q.Clock,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{children:d})]}),o?(0,W.jsx)(`div`,{role:`dialog`,"aria-label":`Scheduled tasks of this chat`,"data-testid":`scheduled-panel`,className:`absolute bottom-full left-0 z-50 mb-1 w-[26rem] max-w-[calc(100vw-2rem)]`,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Clock,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Scheduled tasks`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:`runs on this PC`})]}),(0,W.jsx)(`div`,{className:`max-h-[22rem] overflow-y-auto p-2`,children:(0,W.jsx)(WN,{sessionId:n})})]})}):null]})}function qN(){let{state:e,actions:t}=G(),n=Ay()?.id??null,r=n!==null&&e.remote.tabs[n]!==void 0,i=n?e.chatConversations[n]:void 0,a=e.conversationsChange,[o,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=(0,v.useRef)({sessionId:null,seq:-1}),u=(0,v.useRef)(i);if(u.current=i,(0,v.useEffect)(()=>{if(!n||r)return;let e=l.current,i=e.sessionId!==n;if(!i&&e.seq===a.seq)return;l.current={sessionId:n,seq:a.seq};let o=(u.current??[]).map(e=>e.id);!i&&!wd(a,{sessionId:n,conversationIds:o})||t.refreshChatConversations(n)},[n,r,a,t]),(0,v.useEffect)(()=>{if(!o)return;let e=e=>{c.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[o]),(0,v.useEffect)(()=>s(!1),[n]),!n||r||!i)return null;let d=Od(i,n);if(d.length===0)return null;let f=kd(d),p=d.some(e=>e.status===`active`),m=async e=>{await t.conversationAction(e.id,e.status===`active`?`pause`:`resume`)&&t.refreshChatConversations(n)},h=e=>{s(!1),t.openConversations(e??null)};return(0,W.jsxs)(`span`,{ref:c,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Conversations with other chats: ${f}`,title:`This chat's conversations with your other chats — ${f}`,"aria-haspopup":`dialog`,"aria-expanded":o,"data-testid":`conversations-badge`,onClick:()=>s(e=>!e),className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs hover:bg-fg/5`,p?`text-accent`:`text-fg-muted`),children:[(0,W.jsx)(q.Chats,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{children:f})]}),o?(0,W.jsx)(`div`,{role:`dialog`,"aria-label":`Conversations of this chat`,"data-testid":`conversations-badge-panel`,className:`absolute bottom-full left-0 z-50 mb-1 w-[26rem] max-w-[calc(100vw-2rem)]`,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Chats,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Conversations with other chats`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:`on this PC`})]}),(0,W.jsx)(`ul`,{className:`max-h-[22rem] space-y-1.5 overflow-y-auto p-2`,children:d.map(e=>(0,W.jsxs)(`li`,{className:`rounded-md border border-border px-2.5 py-1.5 text-xs`,"data-testid":`conversations-badge-item-${e.id}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:Ed(e)}),(0,W.jsx)(`span`,{title:Kd.status,children:(0,W.jsx)(Z,{tone:jd(e.status),children:Ad[e.status]})})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-fg-muted`,"data-testid":`conversations-badge-usage`,children:[e.used.messages,` of `,e.budget.messages,` messages ·`,` `,ig(e.used.tokens),` of `,ig(e.budget.tokens),` tokens`]}),e.status===`paused`&&e.pausedReason?(0,W.jsxs)(`div`,{className:`text-warn`,children:[`Paused: `,e.pausedReason]}):null,(0,W.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>void m(e),title:e.status===`active`?Kd.pause:Kd.resume,"data-testid":`conversations-badge-toggle`,children:e.status===`active`?`Pause`:`Resume`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>h(e.id),title:`See every message of this conversation, what it cost, and all its controls`,"data-testid":`conversations-badge-open`,children:`Open in Conversations`})]})]},e.id))}),(0,W.jsx)(`div`,{className:`border-t border-border px-2.5 py-1.5 text-right`,children:(0,W.jsx)(`button`,{type:`button`,className:`text-xs text-accent hover:underline`,onClick:()=>h(),"data-testid":`conversations-badge-all`,children:`All conversations on this PC`})})]})}):null]})}function JN(){let{state:e}=G(),t=Ay(),n=jy(),r=Oy(),i=r?e.pendingRouting[r]:void 0;return(0,v.useMemo)(()=>{let r=ff(e.providers,{providerId:i?.providerId??n?.providerId??t?.providerId??e.activeProviderId,model:i?.model??n?.model??t?.model??e.info?.activeModel,variantId:i?.variantId??n?.variantId??t?.variantId??null}),a=(e.providers.find(e=>e.definition.id===r.providerId)?.definition)?.models.find(e=>e.id===r.modelId)??null;return{...r,option:a}},[e.providers,e.activeProviderId,e.info?.activeModel,i?.providerId,i?.model,i?.variantId,n?.providerId,n?.model,n?.variantId,t?.providerId,t?.model,t?.variantId])}var YN=null,XN=460,ZN=8;function QN(e,t){if(typeof window>`u`)return e;let n=t?.offsetWidth??XN,r=t?.offsetHeight??200;return{left:Math.min(Math.max(ZN,e.left),Math.max(ZN,window.innerWidth-n-ZN)),top:Math.min(Math.max(ZN,e.top),Math.max(ZN,window.innerHeight-r-ZN))}}function $N(e,t,n,r){return e===t?`current`:r[e]?`skipped`:n[e]?`answered`:`open`}function eP({item:e,onDecide:t,cardRef:n,stackIndex:r=0}){let i=e.request,a=dl(i.input),{groupId:o}=Dy(),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)({}),[h,g]=(0,v.useState)(YN),_=(0,v.useRef)(null),y=a[s],b=s===a.length-1,x=e=>(l[e]??[]).length>0||(d[e]??``).trim().length>0,S={};a.forEach((e,t)=>{S[t]=x(t)});let C=new Set(Object.entries(p).filter(([,e])=>e).map(([e])=>Number(e))),w=fl(a,l,d,C),T=a.every((e,t)=>S[t]||p[t]),E=a.some((e,t)=>S[t]&&!p[t]),D=(e,t,n)=>{m(t=>t[e]?{...t,[e]:!1}:t),f(t=>t[e]?{...t,[e]:``}:t),u(r=>{let i=r[e]??[];return n?{...r,[e]:i.includes(t)?i.filter(e=>e!==t):[...i,t]}:{...r,[e]:i[0]===t?[]:[t]}})},O=(0,v.useCallback)(()=>{if(T){if(!E){t({behavior:`deny`,message:ll});return}t({behavior:`allow`,updatedInput:{...i.input,answers:w}})}},[T,E,t,i.input,w]),k=()=>{y&&(!S[s]&&!p[s]||(b?O():c(s+1)))},A=()=>{if(m(e=>({...e,[s]:!0})),u(e=>({...e,[s]:[]})),f(e=>({...e,[s]:``})),b){let e=new Set([...C,s]);if(!a.some((t,n)=>S[n]&&!e.has(n))){t({behavior:`deny`,message:ll});return}let n={...l,[s]:[]},r={...d,[s]:``};t({behavior:`allow`,updatedInput:{...i.input,answers:fl(a,n,r,e)}});return}c(s+1)},j=e=>{if(e.button!==0)return;let t=n.current;if(!t)return;let r=t.getBoundingClientRect();_.current={dx:e.clientX-r.left,dy:e.clientY-r.top},e.preventDefault();let i=e=>{let t=_.current;if(!t)return;let r=QN({left:e.clientX-t.dx,top:e.clientY-t.dy},n.current);YN=r,g(r)},a=()=>{_.current=null,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)};if((0,v.useEffect)(()=>{if(h){let e=QN(h,n.current);(e.left!==h.left||e.top!==h.top)&&g(e)}},[]),typeof document>`u`||a.length===0)return null;let M=h?{left:h.left+r*24,top:h.top+r*24}:{right:16+r*24,bottom:132+r*24};return(0,Ly.createPortal)((0,W.jsxs)(`div`,{ref:n,className:`fixed z-30 flex max-h-[70vh] w-[460px] max-w-[calc(100vw-16px)] flex-col rounded-xl border border-accent/50 bg-surface text-sm shadow-xl`,style:M,role:`group`,"aria-label":`The model has a question`,"data-permission-pending":`true`,"data-chat-group":o,"data-testid":`question-${i.requestId}`,children:[(0,W.jsxs)(`div`,{className:`flex cursor-move select-none items-center gap-2 rounded-t-xl border-b border-border bg-accent-soft/40 px-3 py-2`,onMouseDown:j,"data-testid":`question-drag-handle`,title:`Drag to move`,children:[(0,W.jsx)(q.Info,{className:`w-4 h-4 text-accent`}),(0,W.jsx)(`span`,{className:`font-semibold`,children:a.length>1?`The model has questions`:`The model has a question`}),i.agentId?(0,W.jsx)(Z,{tone:`think`,children:`subagent`}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`text-[11px] text-fg-faint`,"data-testid":`question-step`,children:[s+1,` of `,a.length]})]}),a.length>1?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1 border-b border-border px-3 py-1.5`,role:`tablist`,"data-testid":`question-tabs`,children:a.map((e,t)=>{let n=$N(t,s,S,p);return(0,W.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===s,onClick:()=>c(t),"data-testid":`question-tab`,"data-state":n,title:e.question,className:`flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px] transition `+(t===s?`border-accent bg-accent text-accent-fg`:`border-border bg-surface text-fg-muted hover:border-accent/60`),children:[n===`answered`?(0,W.jsx)(q.Check,{className:`w-3 h-3`}):null,n===`skipped`?(0,W.jsx)(`span`,{"aria-hidden":!0,children:`–`}):null,e.header||`Q${t+1}`]},t)})}):null,y?(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2.5`,"data-testid":`question-body`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[y.header?(0,W.jsx)(Z,{tone:`accent`,children:y.header}):null,(0,W.jsx)(`span`,{className:`font-medium`,children:y.question})]}),(0,W.jsx)(`div`,{className:`space-y-1`,role:y.multiSelect?`group`:`radiogroup`,"aria-label":y.multiSelect?`choose any`:`choose one`,children:y.options.map(e=>{let t=(l[s]??[]).includes(e.label);return(0,W.jsxs)(`button`,{type:`button`,role:y.multiSelect?`checkbox`:`radio`,"aria-checked":t,onClick:()=>D(s,e.label,y.multiSelect),"data-testid":`question-option`,"data-label":e.label,className:`flex w-full items-start gap-2.5 rounded-md border px-2.5 py-1.5 text-left transition `+(t?`border-accent bg-accent-soft/60`:`border-border bg-surface hover:border-accent/60`),children:[(0,W.jsx)(`span`,{"aria-hidden":!0,className:`mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center border `+(y.multiSelect?`rounded-sm `:`rounded-full `)+(t?`border-accent bg-accent text-accent-fg`:`border-fg-faint`),children:t?(0,W.jsx)(q.Check,{className:`w-2.5 h-2.5`}):null}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:`block text-sm`,children:e.label}),e.description?(0,W.jsx)(`span`,{className:`block text-[11px] leading-snug text-fg-muted`,children:e.description}):null]})]},e.label)})}),(0,W.jsx)(`input`,{className:X+` mt-2 text-xs`,value:d[s]??``,onChange:e=>{let t=e.target.value;f(e=>({...e,[s]:t})),t.trim()&&(m(e=>e[s]?{...e,[s]:!1}:e),u(e=>(e[s]??[]).length>0?{...e,[s]:[]}:e))},placeholder:y.options.length>0?`Other — type your own answer`:`Type your answer`,autoComplete:`off`,"data-testid":`question-custom`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k())}}),y.multiSelect?(0,W.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-faint`,children:`Choose any that apply.`}):null]}):null,(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-border px-3 py-2`,children:[(0,W.jsx)(J,{size:`sm`,variant:`ghost`,disabled:s===0,onClick:()=>c(s-1),"data-testid":`question-back`,children:`Back`}),(0,W.jsx)(J,{size:`sm`,onClick:A,"data-testid":`question-skip`,children:`Skip`}),(0,W.jsx)(`span`,{className:`flex-1`}),b?(0,W.jsx)(J,{size:`sm`,variant:`primary`,disabled:!T,onClick:O,"data-testid":`question-answer`,children:`Answer`}):(0,W.jsxs)(J,{size:`sm`,variant:`primary`,disabled:!S[s]&&!p[s],onClick:k,"data-testid":`question-next`,children:[`Next `,(0,W.jsx)(q.ChevronRight,{className:`w-3.5 h-3.5`})]})]})]}),document.body)}function tP({input:e,requestId:t,onDecide:n,cardRef:r}){return(0,W.jsxs)(`div`,{ref:r,className:`my-2 rounded-lg border border-accent/50 bg-accent-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Install ${e.name}`,"data-permission-pending":`true`,"data-testid":`permission-${t}`,"data-install-pack":e.pack,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Download,{className:`mt-0.5 w-4 h-4 shrink-0 text-accent`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`font-semibold`,"data-testid":`tool-install-title`,children:[`Install `,e.name,`?`]}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-fg-muted`,children:[`The agent wants to use `,e.name,`. It is downloaded once —`,` `,(0,W.jsx)(`span`,{className:`font-medium text-fg`,"data-testid":`tool-install-size`,children:yl(e.sizeBytes)}),` `,`— and after that it opens without asking, in every chat.`]}),(0,W.jsxs)(`div`,{className:`mt-1 text-xs text-fg-faint`,children:[`Installs into`,` `,(0,W.jsx)(`span`,{className:`break-all font-mono`,"data-testid":`tool-install-path`,children:e.path}),` `,`· version `,e.version]})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>n({behavior:`allow`}),"data-testid":`tool-install-allow`,"data-autofocus":!0,children:[(0,W.jsx)(q.Download,{className:`w-3.5 h-3.5`}),` Install`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n({behavior:`deny`,message:`The person chose not to install ${e.name} now.`}),"data-testid":`tool-install-deny`,children:`Not now`}),(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Esc = not now`})]})]})}var nP={downloading:`Downloading`,verifying:`Checking`,unpacking:`Unpacking`,done:`Installed`,failed:`Could not install`};function rP(e){let t=`${nP[e.phase]} ${e.name}`;return e.phase===`failed`?`${t}: ${e.error??`unknown error`}`:e.phase===`downloading`&&e.totalBytes>0?`${t} — ${yl(e.receivedBytes)} of ${yl(e.totalBytes)}`:e.phase===`unpacking`&&e.totalBytes>0?`${t} — ${Math.min(100,Math.round(e.receivedBytes/e.totalBytes*100))} %`:`${t}…`}function iP({frame:e,onDismiss:t}){let n=e.phase===`failed`,r=(e.phase===`downloading`||e.phase===`unpacking`)&&e.totalBytes>0?Math.min(100,Math.round(e.receivedBytes/e.totalBytes*100)):e.phase===`verifying`?100:null;return(0,W.jsxs)(`div`,{className:`mb-2 rounded-md border px-3 py-2 text-xs `+(n?`border-danger/40 bg-danger/10 text-danger`:`border-accent/40 bg-accent/10 text-fg`),role:`status`,"data-testid":`tool-install-progress`,"data-phase":e.phase,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:rP(e)}),n?(0,W.jsx)(`button`,{type:`button`,"aria-label":`Dismiss`,className:`shrink-0 rounded p-0.5 hover:bg-danger/20`,onClick:t,children:(0,W.jsx)(q.X,{className:`w-3 h-3`})}):null]}),r===null?null:(0,W.jsx)(`div`,{className:`mt-1 h-1 w-full overflow-hidden rounded bg-fg/10`,children:(0,W.jsx)(`div`,{className:`h-full bg-accent transition-[width] duration-200`,style:{width:`${r}%`},"data-testid":`tool-install-bar`})})]})}function aP({input:e,requestId:t,onDecide:n,cardRef:r}){return(0,W.jsxs)(`div`,{ref:r,className:`my-2 rounded-lg border border-accent/50 bg-accent-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Switch this chat's workspace`,"data-permission-pending":`true`,"data-testid":`permission-${t}`,"data-workspace-switch":`true`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Folder,{className:`mt-0.5 w-4 h-4 shrink-0 text-accent`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`font-semibold`,"data-testid":`workspace-switch-title`,children:[`Switch this chat's workspace to`,` `,(0,W.jsx)(`span`,{className:`break-all font-mono`,children:e.to}),`?`]}),(0,W.jsxs)(`div`,{className:`mt-1 text-xs text-fg-faint`,children:[`Now in`,` `,(0,W.jsx)(`span`,{className:`break-all font-mono`,"data-testid":`workspace-switch-from`,children:e.from}),e.create?` · the new folder is created on Switch`:``]}),(0,W.jsx)(`div`,{className:`mt-1 text-fg-muted`,children:`The chat moves when the agent's current turn ends. Your next message restarts the agent there, with that folder's CLAUDE.md and settings — the conversation is kept.`})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>n({behavior:`allow`}),"data-testid":`workspace-switch-allow`,"data-autofocus":!0,children:[(0,W.jsx)(q.Folder,{className:`w-3.5 h-3.5`}),` Switch`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n({behavior:`deny`}),"data-testid":`workspace-switch-deny`,children:`Not now`}),(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Esc = not now`})]})]})}var oP=(0,v.createContext)({openChat:()=>{},openConversation:()=>{},conversationTitle:()=>null,canOpenChat:()=>!1,answerState:()=>null}),sP={message:`Message from chat`,reply:`Reply from chat`,continue:`Continue: a message from chat`},cP={message:`Another chat's agent sent this chat a message. This chat works on it with its own model, folder and permissions; its final answer goes back by itself.`,reply:`The answer another chat sent back to a message this chat sent it.`,continue:`OonaCode restarted while this chat was working on a message from another chat, so it was handed over again to finish.`},lP=(0,v.memo)(function({item:e}){let t=e.chatMarker;if(!t)return null;if(t.kind===`notice`)return(0,W.jsx)(dP,{marker:t,timestamp:e.timestamp});let n=e.chatBatch??[t];return n.length===1?(0,W.jsx)(uP,{marker:t,timestamp:e.timestamp}):(0,W.jsx)(`div`,{"data-testid":`chat-message-batch`,"data-count":n.length,children:n.map(t=>(0,W.jsx)(uP,{marker:t,timestamp:e.timestamp},t.messageId))})});function uP({marker:e,timestamp:t}){let n=(0,v.useContext)(oP);if(e.kind===`notice`)return null;let r=e.kind,i=e.title||`another chat`,a=n.conversationTitle(e.conversationId),o=r===`reply`?q.Reply:r===`continue`?q.Refresh:q.Mail,s=e.chatId!==`_`&&n.canOpenChat(e.chatId,e.hostId),c=e.replyExpected?Id(n.answerState(e.messageId)):null;return(0,W.jsxs)(`div`,{className:`my-2 overflow-hidden rounded-lg border border-accent/40 bg-accent-soft/20 text-sm`,"data-testid":`chat-message-card`,"data-kind":r,"data-message-id":e.messageId,title:sg(t),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-b border-accent/20 px-3 py-1.5`,children:[(0,W.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,W.jsxs)(`span`,{className:`min-w-0 font-medium text-fg`,title:cP[r],"data-testid":`chat-message-card-title`,children:[sP[r],` "`,i,`"`]}),e.pc?(0,W.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`on `,e.pc]}):null,a?(0,W.jsx)(`span`,{title:`The conversation this message belongs to`,children:(0,W.jsx)(Z,{tone:`accent`,children:(0,W.jsx)(`span`,{"data-testid":`chat-message-card-conversation`,children:a})})}):null,c?(0,W.jsx)(`span`,{title:c.answeredAt?`${c.help}\n\nAnswered ${sg(c.answeredAt)}.`:c.help,children:(0,W.jsx)(Z,{tone:`neutral`,children:(0,W.jsxs)(`span`,{"data-testid":`chat-message-card-answer`,"data-state":c.label,children:[c.label,c.answeredAt?` ${cg(c.answeredAt)}`:``]})})}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>n.openConversation(e.conversationId),title:`See the whole conversation, what it cost, and pause or close it`,className:`rounded px-1.5 py-0.5 text-xs text-fg-muted hover:bg-surface-2 hover:text-fg`,"data-testid":`chat-message-card-conversation-link`,children:`Conversation`}),s?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n.openChat(e.chatId),title:`Open the chat "${i}" in a tab`,className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-accent hover:bg-accent-soft`,"data-testid":`chat-message-card-open`,children:[(0,W.jsx)(q.ExternalLink,{className:`h-3 w-3`}),` Open chat`]}):null]}),(0,W.jsx)(`div`,{className:`px-3 py-2`,"data-testid":`chat-message-card-body`,children:(0,W.jsx)(aN,{text:e.body})})]})}function dP({marker:e,timestamp:t}){let n=(0,v.useContext)(oP),r=e.body?`${e.headline}\n\n${e.body}`:e.headline,i=sg(t);return(0,W.jsxs)(`div`,{className:`my-2 flex items-center gap-2 rounded-md border border-warn/40 bg-warn-soft px-3 py-1.5 text-xs text-warn`,"data-testid":`chat-notice`,role:`note`,children:[(0,W.jsx)(q.Alert,{className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:i?`${r}\n\n${i}`:r,children:[e.headline,e.body?(0,W.jsxs)(`span`,{className:`opacity-80`,children:[` — `,e.body]}):null]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>n.openConversation(e.conversationId),title:`Open the conversation this is about`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs font-medium hover:bg-warn/10`,"data-testid":`chat-notice-open`,children:`Conversation`})]})}function fP({input:e,requestId:t,onDecide:n,cardRef:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(e.title),[c,l]=(0,v.useState)(e.prompt),u=o.trim()!==e.title.trim(),d=c.trim()!==e.prompt.trim(),f=o.trim().length>0&&c.trim().length>0;return(0,W.jsxs)(`div`,{ref:r,className:`my-2 rounded-lg border border-accent/50 bg-accent-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Start a new chat for this task`,"data-permission-pending":`true`,"data-testid":`permission-${t}`,"data-new-chat":`true`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Chats,{className:`mt-0.5 w-4 h-4 shrink-0 text-accent`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`font-semibold`,"data-testid":`new-chat-title`,children:[`Start a new chat `,(0,W.jsxs)(`span`,{className:`break-words`,children:[`“`,o.trim()||e.title,`”`]}),` `,`for this task?`]}),e.reason?(0,W.jsx)(`div`,{className:`mt-1 text-fg-muted`,"data-testid":`new-chat-reason`,children:e.reason}):null,(0,W.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs`,children:[(0,W.jsx)(`dt`,{className:`text-fg-faint`,children:`Folder`}),(0,W.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,"data-testid":`new-chat-folder`,children:ep(e)}),(0,W.jsx)(`dt`,{className:`text-fg-faint`,children:`Model`}),(0,W.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,"data-testid":`new-chat-model`,children:tp(e)}),e.project?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-fg-faint`,children:`Project`}),(0,W.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.project})]}):null]}),(0,W.jsx)(`div`,{className:`mt-2 text-xs text-fg-faint`,children:`Its first message — the new chat has none of this chat's history:`}),i?(0,W.jsxs)(`div`,{className:`mt-1 space-y-2`,children:[(0,W.jsxs)(`label`,{className:`block text-xs text-fg-faint`,children:[`Title`,(0,W.jsx)(`input`,{className:`${X} mt-0.5`,value:o,onChange:e=>s(e.target.value),"data-keep-escape":!0,"data-testid":`new-chat-title-input`})]}),(0,W.jsx)(`textarea`,{className:`${X} min-h-[10rem] resize-y font-mono text-xs leading-relaxed`,rows:12,value:c,onChange:e=>l(e.target.value),"aria-label":`The new chat's first message`,"data-keep-escape":!0,"data-testid":`new-chat-prompt-input`})]}):(0,W.jsx)(`div`,{className:`mt-1 max-h-24 overflow-hidden whitespace-pre-wrap break-words rounded-md border border-border bg-surface px-2.5 py-1.5 font-mono text-xs text-fg-muted`,"data-testid":`new-chat-prompt`,children:c}),(0,W.jsx)(`button`,{type:`button`,className:`mt-1 text-xs text-accent hover:underline`,onClick:()=>a(e=>!e),"data-testid":`new-chat-expand`,children:i?`Hide the message`:`Show and edit the message`})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,disabled:!f,onClick:()=>{if(!f)return;let e={...u?{title:o.trim()}:{},...d?{prompt:c.trim()}:{}};n(Object.keys(e).length>0?{behavior:`allow`,updatedInput:e}:{behavior:`allow`})},"data-testid":`new-chat-start`,"data-autofocus":!0,children:[(0,W.jsx)(q.Plus,{className:`w-3.5 h-3.5`}),` Start new chat`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n({behavior:`deny`}),"data-testid":`new-chat-deny`,children:`Not now`}),u||d?(0,W.jsx)(`span`,{"data-testid":`new-chat-edited`,children:(0,W.jsx)(Z,{tone:`accent`,children:`edited`})}):null,(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`The new chat opens in a tab and runs there · Esc = not now`})]})]})}function pP({chat:e,timestamp:t}){let n=(0,v.useContext)(oP),r=sg(t);return(0,W.jsxs)(`div`,{className:`my-2 flex items-center gap-2 rounded-md border border-accent/40 bg-accent-soft/30 px-3 py-1.5 text-xs text-fg`,"data-testid":`new-chat-note`,role:`note`,title:r||void 0,children:[(0,W.jsx)(q.Chats,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`Started a new chat “`,e.title,`” for this task — it runs there.`]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n.openChat(e.sessionId),title:`Open the chat “${e.title}” in a tab`,className:`inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 font-medium text-accent hover:bg-accent-soft`,"data-testid":`new-chat-note-open`,children:[(0,W.jsx)(q.ExternalLink,{className:`h-3 w-3`}),` Open chat`]})]})}function mP(e){return Math.max(100,Math.min(1e3,Math.round(e/100)))}function hP(e,t=600){let n=e.length-t;if(n<=0)return{head:``,tail:e};let r=!1,i=-1,a=0;for(;a<n;){let t=e.indexOf(`
145
+ `)[0].trim(),o=jN(e)??0,s=c.get(t);s&&s.at>o||c.set(t,{at:o,view:{id:`note:${t}`,agentId:t,name:a.length>0?a.length>80?`${a.slice(0,79)}…`:a:`background task`,type:null,model:null,status:i&&i!==`completed`?`error`:`done`,running:!1,startedAt:null,endedAt:o>0?o:null,durationMs:ON(Number(NN(r,`duration_ms`)??NaN)),tokens:ON(Number(NN(r,`subagent_tokens`)??NaN)),toolCalls:ON(Number(NN(r,`tool_uses`)??NaN))??0,runs:1,nested:0,depth:0}})}for(let[e,t]of c)s.add(e),o.push(t.view);let l=new Map;for(let t of e){if(t.kind!==`permission`)continue;let e=t.request.agentId;if(!e||s.has(e))continue;let n=jN(t),r=l.get(e);r?(r.count+=1,(r.first===null||n!==null&&n<r.first)&&(r.first=n),n!==null&&(r.last===null||n>r.last)&&(r.last=n)):l.set(e,{first:n,last:n,count:1})}for(let[e,t]of l){let n=i[e],c=n?.finished===!0,l=n&&n.at>0?n.at:t.last,u=!c&&IN(a,l),d=n&&n.firstAt>0?t.first===null?n.firstAt:Math.min(t.first,n.firstAt):t.first,f=u?null:c&&n&&n.at>0?n.at:null;o.push({id:`perm:${e}`,agentId:e,name:`background agent`,type:null,model:null,status:u?`running`:c?`done`:`cancelled`,running:u,startedAt:d,endedAt:f,durationMs:d===null?null:Math.max(0,(u?r:f??l??d)-d),tokens:null,toolCalls:Math.max(t.count,n?.toolUses??0),runs:1,nested:0,depth:0}),s.add(e)}for(let[e,t]of Object.entries(i)){if(s.has(e)||l.has(e))continue;let n=!t.finished&&IN(a,t.at>0?t.at:null),i=t.firstAt>0?t.firstAt:null,c=n?null:t.finished&&t.at>0?t.at:null,u=n?r:t.at>0?t.at:i;o.push({id:`act:${e}`,agentId:e,name:`background agent`,type:null,model:null,status:n?`running`:t.finished?`done`:`cancelled`,running:n,startedAt:i,endedAt:c,durationMs:i!==null&&u!==null&&u>0?Math.max(0,u-i):null,tokens:null,toolCalls:t.toolUses,runs:1,nested:0,depth:0})}return o}function zN(e,t,n,r,i){if(e.length===0)return[];let a=new Map(e.map(e=>[e.toolUseId,e])),o=t.filter(e=>e.kind===`tool`&&e.name===`SendMessage`),s=new Map,c=new Map,l=new Map;for(let e of t){if(!e.parentToolUseId||!a.has(e.parentToolUseId))continue;if(e.kind===`assistant`){L(e.model)&&l.set(e.parentToolUseId,e.model);continue}if(e.kind!==`tool`)continue;let t=EN(e)?c:s;t.set(e.parentToolUseId,(t.get(e.parentToolUseId)??0)+1)}let u=e=>{let t=0,n=e.parentToolUseId;for(;n&&a.has(n)&&t<8;)t+=1,n=a.get(n).parentToolUseId;return t};return e.map(e=>{let t=AN(e),a=kN(e.input?.subagent_type),d=kN(e.input?.description)??kN(e.input?.name)??a??e.name,f=kN(t?.agentId)??e.toolUseId,p=t?.isAsync===!0||t?.status===`async_launched`,m={id:e.toolUseId,agentId:f,name:d,type:a,model:l.get(e.toolUseId)??null,startedAt:e.startedAt,nested:c.get(e.toolUseId)??0,depth:u(e)};if(!p){let n=DN.has(e.status)&&!e.result&&IN(i,e.startedAt),a=ON(t?.totalDurationMs)??e.durationMs??(n&&e.startedAt!==null?Math.max(0,r-e.startedAt):e.elapsedSec===null?null:e.elapsedSec*1e3);return{...m,status:n?e.status:DN.has(e.status)?`cancelled`:e.status,running:n,endedAt:n?null:e.finishedAt,durationMs:a,tokens:ON(t?.totalTokens),toolCalls:ON(t?.totalToolUseCount)??s.get(e.toolUseId)??0,runs:1}}let h=[e,...o.filter(e=>{let t=AN(e),n=kN(e.input?.to);return kN(t?.resumedAgentId)===f||n===f||n===d})],g=null,_=null,v=!1,y=!1,b=!1,x=null,S=null,C=null;for(let t of h){let a=PN(n,f,t.toolUseId),o=jN(t);if(!a){if(t!==e&&AN(t)?.success===!1||t!==e&&t.result?.isError)continue;S=o,IN(i,o)?(v=!0,x=o===null?null:Math.max(0,r-o)):(b=!0,x=null),C=null;continue}a.tokens!==null&&(g=(g??0)+a.tokens),a.toolUses!==null&&(_=(_??0)+a.toolUses),a.status&&a.status!==`completed`&&(y=!0),x=a.durationMs??(a.at!==null&&o!==null?Math.max(0,a.at-o):null),S=o,C=a.at}let w=v?`running`:y||e.status===`error`||e.status===`denied`?`error`:b?`cancelled`:`done`;return{...m,startedAt:S??e.startedAt,status:w,running:v,endedAt:v?null:C,durationMs:x,tokens:g,toolCalls:Math.max(_??0,s.get(e.toolUseId)??0),runs:h.length}})}var BN=1e3,VN=6e4;function HN(){let e=ky(),t=Ay(),n=e?.items,[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>Date.now()),s=(0,v.useRef)(null),c=e?.agentActivity,l=e?.status===`running`||e?.status===`waiting_permission`,u=e?.engineSince??null,d=e?.hasSubagentItems===!0||t?.hasSubagents===!0||Object.keys(c??{}).length>0,f=(0,v.useMemo)(()=>n&&d?LN(n,a,c??{},{alive:l,since:u}):[],[n,d,a,c,l,u]),p=f.filter(e=>e.running).length,[m,h]=(0,v.useState)(!1),g=(0,v.useMemo)(()=>m?f:f.filter(e=>e.running||e.endedAt!==null&&a-e.endedAt<VN),[f,a,m]),_=f.length-g.length;if((0,v.useEffect)(()=>{if(!r)return;let e=setInterval(()=>o(Date.now()),BN);return()=>clearInterval(e)},[r]),(0,v.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,v.useEffect)(()=>{i(!1),h(!1)},[e?.sessionId]),f.length===0)return null;let y=p>0?`${p} working`:`${f.length} ${f.length===1?`agent`:`agents`} finished`;return(0,W.jsxs)(`span`,{ref:s,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":y,title:y,"aria-haspopup":`dialog`,"aria-expanded":r,"data-testid":`subagents-badge`,onClick:()=>{o(Date.now()),i(e=>!e)},className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs text-fg-muted hover:bg-fg/5`),children:[(0,W.jsx)(q.Bot,{className:U(`w-3.5 h-3.5`,p>0&&`text-accent`)}),(0,W.jsxs)(`span`,{"data-testid":`subagents-total`,children:[f.length,` `,f.length===1?`agent`:`agents`]}),p>0?(0,W.jsxs)(`span`,{className:`text-accent`,"data-testid":`subagents-working`,children:[`· `,p,` working`]}):null,p>0?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 animate-pulse rounded-full bg-accent`,"data-testid":`subagents-running`}):null]}),r?(0,W.jsx)(`div`,{role:`dialog`,"aria-label":`Subagents of this chat`,"data-testid":`subagents-panel`,className:`absolute bottom-full left-0 z-50 mb-1 w-[24rem] max-w-[calc(100vw-2rem)]`,children:(0,W.jsxs)(`div`,{className:`max-h-[22rem] overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Bot,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Subagents`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:y})]}),(0,W.jsxs)(`ul`,{className:`max-h-[19rem] overflow-y-auto py-1`,children:[TN(g).map(e=>(0,W.jsx)(UN,{agent:e,onJump:()=>i(!1)},e.id)),g.length===0?(0,W.jsx)(`li`,{className:`px-2.5 py-2 text-xs text-fg-faint`,children:`Nothing is working now.`}):null]}),_>0||m?(0,W.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),"data-testid":`subagents-toggle-finished`,className:`w-full border-t border-border px-2.5 py-1.5 text-left text-[11px] text-fg-faint hover:bg-surface-2 hover:text-fg`,children:m?`Hide finished agents`:`${_} finished ${_===1?`agent`:`agents`} hidden — show`}):null]})}):null]})}function UN({agent:e,onJump:t}){let n=()=>{document.querySelector(`[data-testid="tool-${e.id}"]`)?.scrollIntoView({block:`center`,behavior:`smooth`}),t()},r=e.status===`error`||e.status===`denied`,i=r?`danger`:e.running?`accent`:`neutral`,a=e.running?`working`:e.status,o=!e.running;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:n,"data-testid":`subagent-${e.id}`,"data-state":e.running?`working`:r?`failed`:`done`,title:`Show this subagent's card in the chat`,className:U(`flex w-full flex-col gap-0.5 px-2.5 py-1.5 text-left hover:bg-surface-2`,o&&!r&&`opacity-60 hover:opacity-100`),style:e.depth?{paddingLeft:`${.625+e.depth*.75}rem`}:void 0,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.running?(0,W.jsx)(q.Spinner,{className:`w-3 h-3 text-accent`}):(0,W.jsx)(q.Bot,{className:`w-3 h-3 text-fg-faint`}),(0,W.jsx)(`span`,{className:U(`min-w-0 flex-1 truncate text-sm font-medium`,o?`text-fg-muted`:`text-fg`),children:e.name}),(0,W.jsx)(Z,{tone:i,children:a})]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-3 pl-5 text-[11px] text-fg-faint`,children:[e.type&&e.type!==e.name?(0,W.jsx)(`span`,{className:`font-mono`,children:e.type}):null,e.model?(0,W.jsx)(`span`,{className:`font-mono`,"data-testid":`subagent-model-${e.agentId}`,children:e.model}):null,e.runs>1?(0,W.jsxs)(`span`,{children:[`resumed ×`,e.runs-1]}):null,e.durationMs===null?null:(0,W.jsx)(`span`,{children:rg(e.durationMs)}),e.tokens===null?null:(0,W.jsxs)(`span`,{children:[ig(e.tokens),` tokens`]}),(0,W.jsxs)(`span`,{children:[e.toolCalls,` `,e.toolCalls===1?`tool call`:`tool calls`]}),e.nested>0?(0,W.jsxs)(`span`,{children:[e.nested,` `,e.nested===1?`subagent`:`subagents`]}):null]})]})})}function WN({sessionId:e,projectId:t,showChat:n=!1}){let{state:r,actions:i}=G(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=r.scheduledTasksVersion;(0,v.useEffect)(()=>{let n=!0;return i.listScheduledTasks({...e?{sessionId:e}:{},...t?{projectId:t}:{}}).then(e=>{n&&o(e)}),()=>{n=!1}},[e,t,l]);let u=e=>r.sessions.find(t=>t.id===e)?.title??`a chat`;return a===null?null:a.length===0?(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,"data-testid":`scheduled-tasks-empty`,children:`No scheduled tasks. Ask the agent to do something later or on a repeat — it uses OonaCode's scheduler, which runs on this PC even when the chat has gone quiet.`}):(0,W.jsx)(`ul`,{className:`space-y-1.5`,"data-testid":`scheduled-tasks`,children:a.map(e=>(0,W.jsxs)(`li`,{className:`rounded-md border border-border px-2.5 py-1.5 text-xs`,"data-testid":`scheduled-task-${e.id}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,title:e.prompt,children:e.title}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>void i.updateScheduledTask(e.id,{enabled:!e.enabled}),disabled:!e.enabled&&e.nextRunAt===null&&`at`in e.when,"data-testid":`scheduled-task-toggle`,children:e.enabled?`Pause`:`Resume`}),(0,W.jsx)(J,{size:`sm`,variant:s===e.id?`danger`:`ghost`,onClick:()=>{if(s!==e.id){c(e.id);return}c(null),i.deleteScheduledTask(e.id)},"data-testid":`scheduled-task-delete`,children:s===e.id?`Delete?`:`Delete`})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-fg-muted`,children:[tf(e.when),` · `,nf(e.nextRunAt,e.enabled),n?` · in “${u(e.sessionId)}”`:``,e.createdBy===`model`?` · set by the agent`:``]}),e.lastResult?(0,W.jsxs)(`div`,{className:`text-fg-faint`,"data-testid":`scheduled-task-result`,children:[`last: `,e.lastResult]}):null]},e.id))})}function GN(e,t){let n=new Date(e),r=n.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===t.toDateString()?r:`${n.toLocaleDateString(void 0,{month:`short`,day:`numeric`})} ${r}`}function KN(){let{state:e,actions:t}=G(),n=Ay(),r=n?.id??null,i=e.scheduledTasksVersion,[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!r){o([]);return}let e=!0;return t.listScheduledTasks({sessionId:r}).then(t=>{e&&o(t)}).catch(()=>{e&&o([])}),()=>{e=!1}},[r,i]),(0,v.useEffect)(()=>{if(!s)return;let e=e=>{l.current?.contains(e.target)||c(!1)},t=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[s]),(0,v.useEffect)(()=>c(!1),[r]),!r||a.length===0)return null;let u=e.providers.find(e=>e.definition.id===n?.providerId),d=u?.definition.models.find(e=>e.id===n?.model)?.displayName??n?.model??null,f=a.filter(e=>e.enabled&&e.nextRunAt!==null),p=f.map(e=>e.nextRunAt).sort().at(0),m=f.length>0?`${f.length} scheduled${p?` · next ${GN(p,new Date)}`:``}`:`${a.length} scheduled · paused`;return(0,W.jsxs)(`span`,{ref:l,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Scheduled tasks: ${m}`,title:`Scheduled tasks of this chat — ${m}`,"aria-haspopup":`dialog`,"aria-expanded":s,"data-testid":`scheduled-badge`,onClick:()=>c(e=>!e),className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs hover:bg-fg/5`,f.length>0?`text-accent`:`text-fg-muted`),children:[(0,W.jsx)(q.Clock,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{children:m})]}),s?(0,W.jsx)(`div`,{role:`dialog`,"aria-label":`Scheduled tasks of this chat`,"data-testid":`scheduled-panel`,className:`absolute bottom-full left-0 z-50 mb-1 w-[26rem] max-w-[calc(100vw-2rem)]`,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Clock,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Scheduled tasks`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:`runs on this PC`})]}),d?(0,W.jsxs)(`div`,{className:`border-b border-border px-2.5 py-1 text-xs text-fg-muted`,"data-testid":`scheduled-model`,children:[`Each run uses this chat's model at that moment — now`,` `,(0,W.jsx)(`span`,{className:`text-fg`,children:d}),u?` · ${u.definition.displayName}`:``,`. Change the chat's model and the next run follows it.`]}):null,(0,W.jsx)(`div`,{className:`max-h-[22rem] overflow-y-auto p-2`,children:(0,W.jsx)(WN,{sessionId:r})})]})}):null]})}function qN(){let{state:e,actions:t}=G(),n=Ay()?.id??null,r=n!==null&&e.remote.tabs[n]!==void 0,i=n?e.chatConversations[n]:void 0,a=e.conversationsChange,[o,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=(0,v.useRef)({sessionId:null,seq:-1}),u=(0,v.useRef)(i);if(u.current=i,(0,v.useEffect)(()=>{if(!n||r)return;let e=l.current,i=e.sessionId!==n;if(!i&&e.seq===a.seq)return;l.current={sessionId:n,seq:a.seq};let o=(u.current??[]).map(e=>e.id);!i&&!wd(a,{sessionId:n,conversationIds:o})||t.refreshChatConversations(n)},[n,r,a,t]),(0,v.useEffect)(()=>{if(!o)return;let e=e=>{c.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[o]),(0,v.useEffect)(()=>s(!1),[n]),!n||r||!i)return null;let d=Od(i,n);if(d.length===0)return null;let f=kd(d),p=d.some(e=>e.status===`active`),m=async e=>{await t.conversationAction(e.id,e.status===`active`?`pause`:`resume`)&&t.refreshChatConversations(n)},h=e=>{s(!1),t.openConversations(e??null)};return(0,W.jsxs)(`span`,{ref:c,className:`relative inline-flex items-center`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Conversations with other chats: ${f}`,title:`This chat's conversations with your other chats — ${f}`,"aria-haspopup":`dialog`,"aria-expanded":o,"data-testid":`conversations-badge`,onClick:()=>s(e=>!e),className:U(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 text-xs hover:bg-fg/5`,p?`text-accent`:`text-fg-muted`),children:[(0,W.jsx)(q.Chats,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{children:f})]}),o?(0,W.jsx)(`div`,{role:`dialog`,"aria-label":`Conversations of this chat`,"data-testid":`conversations-badge-panel`,className:`absolute bottom-full left-0 z-50 mb-1 w-[26rem] max-w-[calc(100vw-2rem)]`,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:[(0,W.jsx)(q.Chats,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Conversations with other chats`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal text-fg-faint`,children:`on this PC`})]}),(0,W.jsx)(`ul`,{className:`max-h-[22rem] space-y-1.5 overflow-y-auto p-2`,children:d.map(e=>(0,W.jsxs)(`li`,{className:`rounded-md border border-border px-2.5 py-1.5 text-xs`,"data-testid":`conversations-badge-item-${e.id}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:Ed(e)}),(0,W.jsx)(`span`,{title:Kd.status,children:(0,W.jsx)(Z,{tone:jd(e.status),children:Ad[e.status]})})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-fg-muted`,"data-testid":`conversations-badge-usage`,children:[e.used.messages,` of `,e.budget.messages,` messages ·`,` `,ig(e.used.tokens),` of `,ig(e.budget.tokens),` tokens`]}),e.status===`paused`&&e.pausedReason?(0,W.jsxs)(`div`,{className:`text-warn`,children:[`Paused: `,e.pausedReason]}):null,(0,W.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>void m(e),title:e.status===`active`?Kd.pause:Kd.resume,"data-testid":`conversations-badge-toggle`,children:e.status===`active`?`Pause`:`Resume`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>h(e.id),title:`See every message of this conversation, what it cost, and all its controls`,"data-testid":`conversations-badge-open`,children:`Open in Conversations`})]})]},e.id))}),(0,W.jsx)(`div`,{className:`border-t border-border px-2.5 py-1.5 text-right`,children:(0,W.jsx)(`button`,{type:`button`,className:`text-xs text-accent hover:underline`,onClick:()=>h(),"data-testid":`conversations-badge-all`,children:`All conversations on this PC`})})]})}):null]})}function JN(){let{state:e}=G(),t=Ay(),n=jy(),r=Oy(),i=r?e.pendingRouting[r]:void 0;return(0,v.useMemo)(()=>{let r=ff(e.providers,{providerId:i?.providerId??n?.providerId??t?.providerId??e.activeProviderId,model:i?.model??n?.model??t?.model??e.info?.activeModel,variantId:i?.variantId??n?.variantId??t?.variantId??null}),a=(e.providers.find(e=>e.definition.id===r.providerId)?.definition)?.models.find(e=>e.id===r.modelId)??null;return{...r,option:a}},[e.providers,e.activeProviderId,e.info?.activeModel,i?.providerId,i?.model,i?.variantId,n?.providerId,n?.model,n?.variantId,t?.providerId,t?.model,t?.variantId])}var YN=null,XN=460,ZN=8;function QN(e,t){if(typeof window>`u`)return e;let n=t?.offsetWidth??XN,r=t?.offsetHeight??200;return{left:Math.min(Math.max(ZN,e.left),Math.max(ZN,window.innerWidth-n-ZN)),top:Math.min(Math.max(ZN,e.top),Math.max(ZN,window.innerHeight-r-ZN))}}function $N(e,t,n,r){return e===t?`current`:r[e]?`skipped`:n[e]?`answered`:`open`}function eP({item:e,onDecide:t,cardRef:n,stackIndex:r=0}){let i=e.request,a=dl(i.input),{groupId:o}=Dy(),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)({}),[h,g]=(0,v.useState)(YN),_=(0,v.useRef)(null),y=a[s],b=s===a.length-1,x=e=>(l[e]??[]).length>0||(d[e]??``).trim().length>0,S={};a.forEach((e,t)=>{S[t]=x(t)});let C=new Set(Object.entries(p).filter(([,e])=>e).map(([e])=>Number(e))),w=fl(a,l,d,C),T=a.every((e,t)=>S[t]||p[t]),E=a.some((e,t)=>S[t]&&!p[t]),D=(e,t,n)=>{m(t=>t[e]?{...t,[e]:!1}:t),f(t=>t[e]?{...t,[e]:``}:t),u(r=>{let i=r[e]??[];return n?{...r,[e]:i.includes(t)?i.filter(e=>e!==t):[...i,t]}:{...r,[e]:i[0]===t?[]:[t]}})},O=(0,v.useCallback)(()=>{if(T){if(!E){t({behavior:`deny`,message:ll});return}t({behavior:`allow`,updatedInput:{...i.input,answers:w}})}},[T,E,t,i.input,w]),k=()=>{y&&(!S[s]&&!p[s]||(b?O():c(s+1)))},A=()=>{if(m(e=>({...e,[s]:!0})),u(e=>({...e,[s]:[]})),f(e=>({...e,[s]:``})),b){let e=new Set([...C,s]);if(!a.some((t,n)=>S[n]&&!e.has(n))){t({behavior:`deny`,message:ll});return}let n={...l,[s]:[]},r={...d,[s]:``};t({behavior:`allow`,updatedInput:{...i.input,answers:fl(a,n,r,e)}});return}c(s+1)},j=e=>{if(e.button!==0)return;let t=n.current;if(!t)return;let r=t.getBoundingClientRect();_.current={dx:e.clientX-r.left,dy:e.clientY-r.top},e.preventDefault();let i=e=>{let t=_.current;if(!t)return;let r=QN({left:e.clientX-t.dx,top:e.clientY-t.dy},n.current);YN=r,g(r)},a=()=>{_.current=null,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)};if((0,v.useEffect)(()=>{if(h){let e=QN(h,n.current);(e.left!==h.left||e.top!==h.top)&&g(e)}},[]),typeof document>`u`||a.length===0)return null;let M=h?{left:h.left+r*24,top:h.top+r*24}:{right:16+r*24,bottom:132+r*24};return(0,Ly.createPortal)((0,W.jsxs)(`div`,{ref:n,className:`fixed z-30 flex max-h-[70vh] w-[460px] max-w-[calc(100vw-16px)] flex-col rounded-xl border border-accent/50 bg-surface text-sm shadow-xl`,style:M,role:`group`,"aria-label":`The model has a question`,"data-permission-pending":`true`,"data-chat-group":o,"data-testid":`question-${i.requestId}`,children:[(0,W.jsxs)(`div`,{className:`flex cursor-move select-none items-center gap-2 rounded-t-xl border-b border-border bg-accent-soft/40 px-3 py-2`,onMouseDown:j,"data-testid":`question-drag-handle`,title:`Drag to move`,children:[(0,W.jsx)(q.Info,{className:`w-4 h-4 text-accent`}),(0,W.jsx)(`span`,{className:`font-semibold`,children:a.length>1?`The model has questions`:`The model has a question`}),i.agentId?(0,W.jsx)(Z,{tone:`think`,children:`subagent`}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`text-[11px] text-fg-faint`,"data-testid":`question-step`,children:[s+1,` of `,a.length]})]}),a.length>1?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1 border-b border-border px-3 py-1.5`,role:`tablist`,"data-testid":`question-tabs`,children:a.map((e,t)=>{let n=$N(t,s,S,p);return(0,W.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===s,onClick:()=>c(t),"data-testid":`question-tab`,"data-state":n,title:e.question,className:`flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px] transition `+(t===s?`border-accent bg-accent text-accent-fg`:`border-border bg-surface text-fg-muted hover:border-accent/60`),children:[n===`answered`?(0,W.jsx)(q.Check,{className:`w-3 h-3`}):null,n===`skipped`?(0,W.jsx)(`span`,{"aria-hidden":!0,children:`–`}):null,e.header||`Q${t+1}`]},t)})}):null,y?(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2.5`,"data-testid":`question-body`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[y.header?(0,W.jsx)(Z,{tone:`accent`,children:y.header}):null,(0,W.jsx)(`span`,{className:`font-medium`,children:y.question})]}),(0,W.jsx)(`div`,{className:`space-y-1`,role:y.multiSelect?`group`:`radiogroup`,"aria-label":y.multiSelect?`choose any`:`choose one`,children:y.options.map(e=>{let t=(l[s]??[]).includes(e.label);return(0,W.jsxs)(`button`,{type:`button`,role:y.multiSelect?`checkbox`:`radio`,"aria-checked":t,onClick:()=>D(s,e.label,y.multiSelect),"data-testid":`question-option`,"data-label":e.label,className:`flex w-full items-start gap-2.5 rounded-md border px-2.5 py-1.5 text-left transition `+(t?`border-accent bg-accent-soft/60`:`border-border bg-surface hover:border-accent/60`),children:[(0,W.jsx)(`span`,{"aria-hidden":!0,className:`mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center border `+(y.multiSelect?`rounded-sm `:`rounded-full `)+(t?`border-accent bg-accent text-accent-fg`:`border-fg-faint`),children:t?(0,W.jsx)(q.Check,{className:`w-2.5 h-2.5`}):null}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:`block text-sm`,children:e.label}),e.description?(0,W.jsx)(`span`,{className:`block text-[11px] leading-snug text-fg-muted`,children:e.description}):null]})]},e.label)})}),(0,W.jsx)(`input`,{className:X+` mt-2 text-xs`,value:d[s]??``,onChange:e=>{let t=e.target.value;f(e=>({...e,[s]:t})),t.trim()&&(m(e=>e[s]?{...e,[s]:!1}:e),u(e=>(e[s]??[]).length>0?{...e,[s]:[]}:e))},placeholder:y.options.length>0?`Other — type your own answer`:`Type your answer`,autoComplete:`off`,"data-testid":`question-custom`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k())}}),y.multiSelect?(0,W.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-faint`,children:`Choose any that apply.`}):null]}):null,(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-border px-3 py-2`,children:[(0,W.jsx)(J,{size:`sm`,variant:`ghost`,disabled:s===0,onClick:()=>c(s-1),"data-testid":`question-back`,children:`Back`}),(0,W.jsx)(J,{size:`sm`,onClick:A,"data-testid":`question-skip`,children:`Skip`}),(0,W.jsx)(`span`,{className:`flex-1`}),b?(0,W.jsx)(J,{size:`sm`,variant:`primary`,disabled:!T,onClick:O,"data-testid":`question-answer`,children:`Answer`}):(0,W.jsxs)(J,{size:`sm`,variant:`primary`,disabled:!S[s]&&!p[s],onClick:k,"data-testid":`question-next`,children:[`Next `,(0,W.jsx)(q.ChevronRight,{className:`w-3.5 h-3.5`})]})]})]}),document.body)}function tP({input:e,requestId:t,onDecide:n,cardRef:r}){return(0,W.jsxs)(`div`,{ref:r,className:`my-2 rounded-lg border border-accent/50 bg-accent-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Install ${e.name}`,"data-permission-pending":`true`,"data-testid":`permission-${t}`,"data-install-pack":e.pack,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Download,{className:`mt-0.5 w-4 h-4 shrink-0 text-accent`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`font-semibold`,"data-testid":`tool-install-title`,children:[`Install `,e.name,`?`]}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-fg-muted`,children:[`The agent wants to use `,e.name,`. It is downloaded once —`,` `,(0,W.jsx)(`span`,{className:`font-medium text-fg`,"data-testid":`tool-install-size`,children:yl(e.sizeBytes)}),` `,`— and after that it opens without asking, in every chat.`]}),(0,W.jsxs)(`div`,{className:`mt-1 text-xs text-fg-faint`,children:[`Installs into`,` `,(0,W.jsx)(`span`,{className:`break-all font-mono`,"data-testid":`tool-install-path`,children:e.path}),` `,`· version `,e.version]})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>n({behavior:`allow`}),"data-testid":`tool-install-allow`,"data-autofocus":!0,children:[(0,W.jsx)(q.Download,{className:`w-3.5 h-3.5`}),` Install`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n({behavior:`deny`,message:`The person chose not to install ${e.name} now.`}),"data-testid":`tool-install-deny`,children:`Not now`}),(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Esc = not now`})]})]})}var nP={downloading:`Downloading`,verifying:`Checking`,unpacking:`Unpacking`,done:`Installed`,failed:`Could not install`};function rP(e){let t=`${nP[e.phase]} ${e.name}`;return e.phase===`failed`?`${t}: ${e.error??`unknown error`}`:e.phase===`downloading`&&e.totalBytes>0?`${t} — ${yl(e.receivedBytes)} of ${yl(e.totalBytes)}`:e.phase===`unpacking`&&e.totalBytes>0?`${t} — ${Math.min(100,Math.round(e.receivedBytes/e.totalBytes*100))} %`:`${t}…`}function iP({frame:e,onDismiss:t}){let n=e.phase===`failed`,r=(e.phase===`downloading`||e.phase===`unpacking`)&&e.totalBytes>0?Math.min(100,Math.round(e.receivedBytes/e.totalBytes*100)):e.phase===`verifying`?100:null;return(0,W.jsxs)(`div`,{className:`mb-2 rounded-md border px-3 py-2 text-xs `+(n?`border-danger/40 bg-danger/10 text-danger`:`border-accent/40 bg-accent/10 text-fg`),role:`status`,"data-testid":`tool-install-progress`,"data-phase":e.phase,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:rP(e)}),n?(0,W.jsx)(`button`,{type:`button`,"aria-label":`Dismiss`,className:`shrink-0 rounded p-0.5 hover:bg-danger/20`,onClick:t,children:(0,W.jsx)(q.X,{className:`w-3 h-3`})}):null]}),r===null?null:(0,W.jsx)(`div`,{className:`mt-1 h-1 w-full overflow-hidden rounded bg-fg/10`,children:(0,W.jsx)(`div`,{className:`h-full bg-accent transition-[width] duration-200`,style:{width:`${r}%`},"data-testid":`tool-install-bar`})})]})}function aP({input:e,requestId:t,onDecide:n,cardRef:r}){return(0,W.jsxs)(`div`,{ref:r,className:`my-2 rounded-lg border border-accent/50 bg-accent-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Switch this chat's workspace`,"data-permission-pending":`true`,"data-testid":`permission-${t}`,"data-workspace-switch":`true`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Folder,{className:`mt-0.5 w-4 h-4 shrink-0 text-accent`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`font-semibold`,"data-testid":`workspace-switch-title`,children:[`Switch this chat's workspace to`,` `,(0,W.jsx)(`span`,{className:`break-all font-mono`,children:e.to}),`?`]}),(0,W.jsxs)(`div`,{className:`mt-1 text-xs text-fg-faint`,children:[`Now in`,` `,(0,W.jsx)(`span`,{className:`break-all font-mono`,"data-testid":`workspace-switch-from`,children:e.from}),e.create?` · the new folder is created on Switch`:``]}),(0,W.jsx)(`div`,{className:`mt-1 text-fg-muted`,children:`The chat moves when the agent's current turn ends. Your next message restarts the agent there, with that folder's CLAUDE.md and settings — the conversation is kept.`})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>n({behavior:`allow`}),"data-testid":`workspace-switch-allow`,"data-autofocus":!0,children:[(0,W.jsx)(q.Folder,{className:`w-3.5 h-3.5`}),` Switch`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n({behavior:`deny`}),"data-testid":`workspace-switch-deny`,children:`Not now`}),(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Esc = not now`})]})]})}var oP=(0,v.createContext)({openChat:()=>{},openConversation:()=>{},conversationTitle:()=>null,canOpenChat:()=>!1,answerState:()=>null}),sP={message:`Message from chat`,reply:`Reply from chat`,continue:`Continue: a message from chat`},cP={message:`Another chat's agent sent this chat a message. This chat works on it with its own model, folder and permissions; its final answer goes back by itself.`,reply:`The answer another chat sent back to a message this chat sent it.`,continue:`OonaCode restarted while this chat was working on a message from another chat, so it was handed over again to finish.`},lP=(0,v.memo)(function({item:e}){let t=e.chatMarker;if(!t)return null;if(t.kind===`notice`)return(0,W.jsx)(dP,{marker:t,timestamp:e.timestamp});let n=e.chatBatch??[t];return n.length===1?(0,W.jsx)(uP,{marker:t,timestamp:e.timestamp}):(0,W.jsx)(`div`,{"data-testid":`chat-message-batch`,"data-count":n.length,children:n.map(t=>(0,W.jsx)(uP,{marker:t,timestamp:e.timestamp},t.messageId))})});function uP({marker:e,timestamp:t}){let n=(0,v.useContext)(oP);if(e.kind===`notice`)return null;let r=e.kind,i=e.title||`another chat`,a=n.conversationTitle(e.conversationId),o=r===`reply`?q.Reply:r===`continue`?q.Refresh:q.Mail,s=e.chatId!==`_`&&n.canOpenChat(e.chatId,e.hostId),c=e.replyExpected?Id(n.answerState(e.messageId)):null;return(0,W.jsxs)(`div`,{className:`my-2 overflow-hidden rounded-lg border border-accent/40 bg-accent-soft/20 text-sm`,"data-testid":`chat-message-card`,"data-kind":r,"data-message-id":e.messageId,title:sg(t),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-b border-accent/20 px-3 py-1.5`,children:[(0,W.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,W.jsxs)(`span`,{className:`min-w-0 font-medium text-fg`,title:cP[r],"data-testid":`chat-message-card-title`,children:[sP[r],` "`,i,`"`]}),e.pc?(0,W.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`on `,e.pc]}):null,a?(0,W.jsx)(`span`,{title:`The conversation this message belongs to`,children:(0,W.jsx)(Z,{tone:`accent`,children:(0,W.jsx)(`span`,{"data-testid":`chat-message-card-conversation`,children:a})})}):null,c?(0,W.jsx)(`span`,{title:c.answeredAt?`${c.help}\n\nAnswered ${sg(c.answeredAt)}.`:c.help,children:(0,W.jsx)(Z,{tone:`neutral`,children:(0,W.jsxs)(`span`,{"data-testid":`chat-message-card-answer`,"data-state":c.label,children:[c.label,c.answeredAt?` ${cg(c.answeredAt)}`:``]})})}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>n.openConversation(e.conversationId),title:`See the whole conversation, what it cost, and pause or close it`,className:`rounded px-1.5 py-0.5 text-xs text-fg-muted hover:bg-surface-2 hover:text-fg`,"data-testid":`chat-message-card-conversation-link`,children:`Conversation`}),s?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n.openChat(e.chatId),title:`Open the chat "${i}" in a tab`,className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-accent hover:bg-accent-soft`,"data-testid":`chat-message-card-open`,children:[(0,W.jsx)(q.ExternalLink,{className:`h-3 w-3`}),` Open chat`]}):null]}),(0,W.jsx)(`div`,{className:`px-3 py-2`,"data-testid":`chat-message-card-body`,children:(0,W.jsx)(aN,{text:e.body})})]})}function dP({marker:e,timestamp:t}){let n=(0,v.useContext)(oP),r=e.body?`${e.headline}\n\n${e.body}`:e.headline,i=sg(t);return(0,W.jsxs)(`div`,{className:`my-2 flex items-center gap-2 rounded-md border border-warn/40 bg-warn-soft px-3 py-1.5 text-xs text-warn`,"data-testid":`chat-notice`,role:`note`,children:[(0,W.jsx)(q.Alert,{className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:i?`${r}\n\n${i}`:r,children:[e.headline,e.body?(0,W.jsxs)(`span`,{className:`opacity-80`,children:[` — `,e.body]}):null]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>n.openConversation(e.conversationId),title:`Open the conversation this is about`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs font-medium hover:bg-warn/10`,"data-testid":`chat-notice-open`,children:`Conversation`})]})}function fP({input:e,requestId:t,onDecide:n,cardRef:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(e.title),[c,l]=(0,v.useState)(e.prompt),u=o.trim()!==e.title.trim(),d=c.trim()!==e.prompt.trim(),f=o.trim().length>0&&c.trim().length>0;return(0,W.jsxs)(`div`,{ref:r,className:`my-2 rounded-lg border border-accent/50 bg-accent-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Start a new chat for this task`,"data-permission-pending":`true`,"data-testid":`permission-${t}`,"data-new-chat":`true`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Chats,{className:`mt-0.5 w-4 h-4 shrink-0 text-accent`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`font-semibold`,"data-testid":`new-chat-title`,children:[`Start a new chat `,(0,W.jsxs)(`span`,{className:`break-words`,children:[`“`,o.trim()||e.title,`”`]}),` `,`for this task?`]}),e.reason?(0,W.jsx)(`div`,{className:`mt-1 text-fg-muted`,"data-testid":`new-chat-reason`,children:e.reason}):null,(0,W.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs`,children:[(0,W.jsx)(`dt`,{className:`text-fg-faint`,children:`Folder`}),(0,W.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,"data-testid":`new-chat-folder`,children:ep(e)}),(0,W.jsx)(`dt`,{className:`text-fg-faint`,children:`Model`}),(0,W.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,"data-testid":`new-chat-model`,children:tp(e)}),e.project?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-fg-faint`,children:`Project`}),(0,W.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.project})]}):null]}),(0,W.jsx)(`div`,{className:`mt-2 text-xs text-fg-faint`,children:`Its first message — the new chat has none of this chat's history:`}),i?(0,W.jsxs)(`div`,{className:`mt-1 space-y-2`,children:[(0,W.jsxs)(`label`,{className:`block text-xs text-fg-faint`,children:[`Title`,(0,W.jsx)(`input`,{className:`${X} mt-0.5`,value:o,onChange:e=>s(e.target.value),"data-keep-escape":!0,"data-testid":`new-chat-title-input`})]}),(0,W.jsx)(`textarea`,{className:`${X} min-h-[10rem] resize-y font-mono text-xs leading-relaxed`,rows:12,value:c,onChange:e=>l(e.target.value),"aria-label":`The new chat's first message`,"data-keep-escape":!0,"data-testid":`new-chat-prompt-input`})]}):(0,W.jsx)(`div`,{className:`mt-1 max-h-24 overflow-hidden whitespace-pre-wrap break-words rounded-md border border-border bg-surface px-2.5 py-1.5 font-mono text-xs text-fg-muted`,"data-testid":`new-chat-prompt`,children:c}),(0,W.jsx)(`button`,{type:`button`,className:`mt-1 text-xs text-accent hover:underline`,onClick:()=>a(e=>!e),"data-testid":`new-chat-expand`,children:i?`Hide the message`:`Show and edit the message`})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,disabled:!f,onClick:()=>{if(!f)return;let e={...u?{title:o.trim()}:{},...d?{prompt:c.trim()}:{}};n(Object.keys(e).length>0?{behavior:`allow`,updatedInput:e}:{behavior:`allow`})},"data-testid":`new-chat-start`,"data-autofocus":!0,children:[(0,W.jsx)(q.Plus,{className:`w-3.5 h-3.5`}),` Start new chat`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n({behavior:`deny`}),"data-testid":`new-chat-deny`,children:`Not now`}),u||d?(0,W.jsx)(`span`,{"data-testid":`new-chat-edited`,children:(0,W.jsx)(Z,{tone:`accent`,children:`edited`})}):null,(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`The new chat opens in a tab and runs there · Esc = not now`})]})]})}function pP({chat:e,timestamp:t}){let n=(0,v.useContext)(oP),r=sg(t);return(0,W.jsxs)(`div`,{className:`my-2 flex items-center gap-2 rounded-md border border-accent/40 bg-accent-soft/30 px-3 py-1.5 text-xs text-fg`,"data-testid":`new-chat-note`,role:`note`,title:r||void 0,children:[(0,W.jsx)(q.Chats,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`Started a new chat “`,e.title,`” for this task — it runs there.`]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n.openChat(e.sessionId),title:`Open the chat “${e.title}” in a tab`,className:`inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 font-medium text-accent hover:bg-accent-soft`,"data-testid":`new-chat-note-open`,children:[(0,W.jsx)(q.ExternalLink,{className:`h-3 w-3`}),` Open chat`]})]})}function mP(e){return Math.max(100,Math.min(1e3,Math.round(e/100)))}function hP(e,t=600){let n=e.length-t;if(n<=0)return{head:``,tail:e};let r=!1,i=-1,a=0;for(;a<n;){let t=e.indexOf(`
146
146
  `,a),o=t===-1?e.length:t,s=e.slice(a,o);if(/^\s{0,3}(```|~~~)/.test(s)&&(r=!r),!r&&s.trim()===``&&a>0&&o<=n&&(i=a-1),t===-1)break;a=t+1}return i<=0?{head:``,tail:e}:{head:e.slice(0,i),tail:e.slice(i)}}function gP(e,t){let[n,r]=(0,v.useState)(e),i=(0,v.useRef)(e);i.current=e;let a=mP(e.length);return(0,v.useEffect)(()=>{if(!t)return;let e=window.setInterval(()=>r(i.current),a);return()=>window.clearInterval(e)},[t,a]),t?n:e}var _P=new Set;function vP(){let e=_P,t=new Set;return{get:()=>e,set(n){if(n.size!==0||e.size!==0){e=n.size===0?_P:n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>t.delete(e)}}}var yP=(0,v.createContext)({get:()=>_P,set:()=>{},subscribe:()=>()=>{}});function bP(e){let t=(0,v.useContext)(yP),n=()=>{let n=t.get();return n.size===0?!1:typeof e==`string`?n.has(e):e.some(e=>n.has(e))};return(0,v.useSyncExternalStore)(t.subscribe,n,n)}function xP(e,t){let n=bP(e);return(0,v.useEffect)(()=>{n&&t(!0)},[n,t]),n}function SP(e){return typeof e==`string`?e:null}function CP(e,t){if(!t)return``;switch(e){case`Bash`:case`PowerShell`:return ug((SP(t.command)??``).replace(/\s+/g,` `),90);case`Read`:case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:return SP(t.file_path)??SP(t.notebook_path)??``;case`Glob`:case`Grep`:return`${SP(t.pattern)??``}${SP(t.path)?` in ${SP(t.path)}`:``}`;case`Task`:case`Agent`:return SP(t.description)??ug(SP(t.prompt)??``,80);case`WebFetch`:case`WebSearch`:return SP(t.url)??SP(t.query)??``;case`TodoWrite`:return`update todo list`;case qf:return ug(SP(t.title)??``,80);default:{let e=Object.entries(t).find(([,e])=>typeof e==`string`);return e?ug(String(e[1]).replace(/\s+/g,` `),80):``}}}var wP=(0,v.memo)(function({oldText:e,newText:t}){let n=(0,v.useMemo)(()=>e.split(`
147
147
  `),[e]),r=(0,v.useMemo)(()=>t.split(`
148
148
  `),[t]);return(0,W.jsxs)(`pre`,{className:`lazy-block m-0 max-h-72 overflow-auto rounded-md border border-border bg-code-bg p-2 font-mono text-[12.5px] leading-relaxed`,children:[n.map((e,t)=>(0,W.jsxs)(`div`,{className:`bg-danger-soft text-danger`,children:[(0,W.jsx)(`span`,{className:`select-none pr-2 text-fg-faint`,children:`-`}),e]},`o${t}`)),r.map((e,t)=>(0,W.jsxs)(`div`,{className:`bg-ok-soft text-ok`,children:[(0,W.jsx)(`span`,{className:`select-none pr-2 text-fg-faint`,children:`+`}),e]},`n${t}`))]})}),TP=wj;function EP({name:e,input:t,inputJson:n,streaming:r}){if(!t)return n?(0,W.jsx)(QM,{code:n,language:`json`,maxHeight:`14rem`}):r?(0,W.jsx)(`div`,{className:`text-xs text-fg-faint`,children:`Receiving arguments…`}):null;switch(e){case`Bash`:case`PowerShell`:{let n=SP(t.description);return(0,W.jsxs)(`div`,{children:[n?(0,W.jsx)(`div`,{className:`mb-1 text-xs text-fg-muted`,children:n}):null,(0,W.jsx)(QM,{code:SP(t.command)??dg(t),language:e===`PowerShell`?`powershell`:`bash`,maxHeight:`14rem`})]})}case`Edit`:{let e=SP(t.file_path);return(0,W.jsxs)(`div`,{className:`space-y-1`,children:[e?(0,W.jsxs)(`div`,{className:`font-mono text-xs text-fg-muted`,children:[e,t.replace_all?` (replace all)`:``]}):null,(0,W.jsx)(wP,{oldText:SP(t.old_string)??``,newText:SP(t.new_string)??``})]})}case`Write`:{let e=SP(t.file_path);return(0,W.jsxs)(`div`,{children:[e?(0,W.jsx)(`div`,{className:`mb-1 font-mono text-xs text-fg-muted`,children:e}):null,(0,W.jsx)(QM,{code:SP(t.content)??``,language:TP(e),maxHeight:`18rem`})]})}case`Read`:{let e=SP(t.file_path)??``,n=[t.offset===void 0?null:`offset ${String(t.offset)}`,t.limit===void 0?null:`limit ${String(t.limit)}`].filter(Boolean).join(`, `);return(0,W.jsxs)(`div`,{className:`font-mono text-xs text-fg-muted`,children:[e,n?` (${n})`:``]})}default:return(0,W.jsx)(QM,{code:dg(t),language:`json`,maxHeight:`14rem`})}}function DP({blocks:e}){return(0,W.jsx)(`div`,{className:`space-y-1`,children:e.map((e,t)=>{if(e.type===`image`){let n=e.source,r=n?.type===`base64`&&n.data?`data:${n.media_type??`image/png`};base64,${n.data}`:n?.url;return r?(0,W.jsx)(`img`,{src:r,alt:`tool result`,className:`max-h-64 max-w-full rounded border border-border`},t):(0,W.jsx)(`div`,{children:`[image]`},t)}let n=e.type===`text`?e.text??``:`[${e.type}]`;return(0,W.jsx)(`pre`,{className:`pre-wrap m-0 font-mono text-[12.5px] leading-relaxed`,children:n},t)})})}var OP=`Code snippet`;function kP(e){return e===`unknown`?OP:e===Uf?Wf:e===qf?Jf:e}var AP={streaming:`preparing`,pending:`needs approval`,running:`running`,done:`done`,error:`error`,denied:`denied`,skipped:`skipped`,cancelled:`cancelled`};function jP({status:e}){switch(e){case`streaming`:case`running`:return(0,W.jsx)(q.Spinner,{className:`w-3.5 h-3.5 text-accent`});case`pending`:return(0,W.jsx)(q.Shield,{className:`w-3.5 h-3.5 text-warn`});case`done`:return(0,W.jsx)(q.Check,{className:`w-3.5 h-3.5 text-ok`});case`error`:case`denied`:return(0,W.jsx)(q.X,{className:`w-3.5 h-3.5 text-danger`});case`skipped`:case`cancelled`:return(0,W.jsx)(q.X,{className:`w-3.5 h-3.5 text-fg-faint`})}}function MP(e){for(let t of e)if(t.item.kind===`permission`&&t.item.status===`pending`||t.children.length>0&&MP(t.children))return!0;return!1}var NP=(0,v.memo)(function({node:e,renderChildren:t}){let n=e.item,r=n.status===`error`||n.status===`denied`,[i,a]=(0,v.useState)(null),o=xP(n.id,a),s=MP(e.children),c=wN.has(n.name)&&(n.status===`done`||n.status===`cancelled`),l=s||o||(i??(r||n.status===`pending`||e.children.length>0&&!c)),u=(0,v.useMemo)(()=>CP(n.name,n.input),[n.name,n.input]),d=(0,v.useMemo)(()=>l?ng(n.result):``,[l,n.result]),f=n.result!==null&&!n.result.isError&&(typeof n.result.content==`string`&&/^Async agent launched/i.test(n.result.content.trimStart())||n.result.structured?.status===`async_launched`),p=n.durationMs===null?n.elapsedSec!==null&&!n.result?rg(n.elapsedSec*1e3):``:rg(n.durationMs);return(0,W.jsxs)(`div`,{"data-testid":`tool-${n.toolUseId}`,className:U(`my-1.5 overflow-hidden rounded-lg border bg-surface text-sm`,r?`border-danger/50`:n.status===`pending`?`border-warn/60`:`border-border`),children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>a(s?null:!l),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-surface-2`,children:[(0,W.jsx)(jP,{status:n.status}),(0,W.jsx)(q.Tool,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,W.jsx)(`span`,{className:`font-medium`,children:kP(n.name)}),u?(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg-muted`,children:u}):(0,W.jsx)(`span`,{className:`flex-1`}),p?(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:p}):null,(0,W.jsx)(Z,{tone:r?`danger`:n.status===`pending`?`warn`:n.status===`done`?`ok`:`neutral`,children:AP[n.status]}),(0,W.jsx)(q.Chevron,{open:l,className:`w-3.5 h-3.5 text-fg-faint`})]}),l?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border px-2.5 py-2`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[11px] uppercase tracking-wide text-fg-faint`,children:`Input`}),(0,W.jsx)(EP,{name:n.name,input:n.input,inputJson:n.inputJson,streaming:n.status===`streaming`})]}),e.children.length>0?(0,W.jsxs)(`div`,{className:`border-l-2 border-think/40 pl-2`,children:[(0,W.jsx)(`div`,{className:`mb-1 text-[11px] uppercase tracking-wide text-think`,children:`Subagent`}),t(e.children)]}):null,n.result&&f?(0,W.jsx)(`div`,{className:`text-xs text-fg-faint`,"data-testid":`tool-launch-note`,children:`Launched in the background — the chat is told when it finishes.`}):n.result?(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] uppercase tracking-wide text-fg-faint`,children:[(0,W.jsx)(`span`,{children:n.result.isError?`Error`:`Result`}),d?(0,W.jsxs)(`span`,{className:`normal-case`,children:[d.length.toLocaleString(),` chars`]}):null]}),(0,W.jsx)(`div`,{className:U(`lazy-block max-h-72 overflow-auto rounded-md border p-2`,n.result.isError?`border-danger/40 bg-danger-soft text-danger`:`border-border bg-code-bg`),children:typeof n.result.content==`string`?(0,W.jsx)(`pre`,{className:`pre-wrap m-0 font-mono text-[12.5px] leading-relaxed`,children:n.result.content.replace(/<\/?tool_use_error>/g,``).trim()||`(empty)`}):(0,W.jsx)(DP,{blocks:n.result.content})})]}):n.status===`cancelled`?(0,W.jsx)(`div`,{className:`text-xs text-fg-faint`,children:`No result (turn ended before the tool finished).`}):null]}):null]})}),PP=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(null),r=xP(e.id,n)||(t??e.streaming),i=gP(e.text,e.streaming),a=FP(i);return!e.streaming&&(e.redacted||a===0)?(0,W.jsxs)(`div`,{className:`my-1.5 flex items-center gap-2 rounded-lg border border-think/20 bg-think-soft/20 px-2.5 py-1.5 text-sm text-think/70`,"data-testid":`thought-empty`,title:e.redacted?`The provider hid this thought: only an encrypted copy came back, which the model reads and nobody else can.`:`The model thought here, but its provider sent no text for it — only a signature. There is nothing to show.`,children:[(0,W.jsx)(q.Brain,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{className:`font-medium`,children:e.redacted?`Redacted thinking`:`Thought`}),(0,W.jsx)(`span`,{className:`text-xs opacity-70`,children:e.redacted?`hidden`:`empty`})]}):(0,W.jsxs)(`div`,{className:`my-1.5 rounded-lg border border-think/30 bg-think-soft/40 text-sm`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>n(!r),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-think`,children:[e.streaming?(0,W.jsx)(q.Spinner,{className:`w-3.5 h-3.5`}):(0,W.jsx)(q.Brain,{className:`w-3.5 h-3.5`}),(0,W.jsx)(`span`,{className:`font-medium`,children:e.redacted?`Redacted thinking`:e.streaming?`Thinking…`:`Thought`}),a?(0,W.jsxs)(`span`,{className:`text-xs opacity-70`,"data-testid":`thought-words`,children:[a.toLocaleString(`en-US`),` `,a===1?`word`:`words`]}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(q.Chevron,{open:r,className:`w-3.5 h-3.5 opacity-70`})]}),r&&!e.redacted?(0,W.jsx)(`div`,{className:U(`border-t border-think/20 px-3 py-2 text-fg-muted`,e.streaming&&`caret`),children:e.streaming?(0,W.jsx)(`div`,{className:`pre-wrap`,"data-testid":`thinking-stream`,children:i}):(0,W.jsx)(aN,{text:e.text})}):null]})});function FP(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i===32||i===10||i===13||i===9?n=!1:n||(n=!0,t++)}return t}function IP(e){if(!e)return!1;if(e.tagName===`TEXTAREA`)return!0;if(e.tagName===`INPUT`){let t=(e.type||`text`).toLowerCase();return![`button`,`checkbox`,`radio`,`submit`,`reset`,`range`,`color`,`file`].includes(t)}return e.isContentEditable===!0}function LP(e){!e||typeof document>`u`||IP(document.activeElement)||e.querySelector(`[data-autofocus]`)?.focus()}function RP(e){if(!e)return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e instanceof HTMLElement&&e.isContentEditable}function zP(e,t,n){if(!e||!n||n.querySelector(`[role="dialog"][aria-modal="true"]`))return!1;let r=t instanceof Element?t:null;if(r&&r.closest(`[data-keep-escape]`))return!1;let i=BP(e);if(i!==null&&r&&r!==n.body){let e=BP(r);if(e!==null&&e!==i)return!1}if(r&&RP(r)&&!e.contains(r)&&r.closest(`[data-testid="composer"]`)===null)return!1;let a=Array.from(n.querySelectorAll(`[data-permission-pending="true"]`)).find(e=>i===null||BP(e)===i);return a===void 0||a===e}function BP(e){return e.closest(`[data-chat-group]`)?.getAttribute(`data-chat-group`)??e.closest(`[data-editor-group]`)?.getAttribute(`data-editor-group`)??null}var VP=(0,v.memo)(function({item:e,agentName:t}){let n=e.request,[r,i]=(0,v.useState)(!1),a=e.status===`allowed`,o=(0,v.useMemo)(()=>op(n.toolName,n.input,110),[n]),s=n.agentId?t??`background agent`:null;if(n.toolName===`AskUserQuestion`){let e=dl(n.input).length;return(0,W.jsxs)(`div`,{className:`my-1 flex items-center gap-2 px-1 py-0.5 text-xs text-fg-faint`,children:[a?(0,W.jsx)(q.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,W.jsx)(q.X,{className:`w-3 h-3 shrink-0`}),(0,W.jsx)(`span`,{"data-testid":`permission-${n.requestId}`,children:pl({outcome:a?`answered`:`dismissed`,questions:e})}),s?(0,W.jsx)(`span`,{title:n.agentId??void 0,className:`shrink-0`,children:(0,W.jsx)(Z,{tone:`think`,children:s})}):null]})}return(0,W.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`permission-${n.requestId}`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-surface-2`,children:[a?(0,W.jsx)(q.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,W.jsx)(q.X,{className:`w-3 h-3 shrink-0 text-danger`}),(0,W.jsxs)(`span`,{className:`shrink-0`,children:[a?`Allowed`:`Denied`,` `,n.displayName??n.toolName,e.resolvedBy===`auto`?` (automatically)`:e.resolvedBy&&e.resolvedBy!==`local`?` (by ${e.resolvedBy})`:``]}),o?(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-fg-muted`,"data-testid":`permission-summary`,children:o}):null,s?(0,W.jsx)(`span`,{title:n.agentId??void 0,className:`shrink-0`,children:(0,W.jsx)(Z,{tone:`think`,children:s})}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(q.Chevron,{open:r,className:`w-3 h-3 shrink-0`})]}),r?(0,W.jsx)(`div`,{className:`ml-5 mt-1`,children:(0,W.jsx)(EP,{name:n.toolName,input:n.input})}):null]})});function HP({items:e,agentNameOf:t}){let[n,r]=(0,v.useState)(!1),i=xP((0,v.useMemo)(()=>e.map(e=>e.id),[e]),r),{allowed:a,denied:o,tools:s,who:c}=(0,v.useMemo)(()=>{let n=e.filter(e=>e.status===`allowed`).length,r=new Map,i=new Set;for(let n of e){let e=n.request.displayName??n.request.toolName;r.set(e,(r.get(e)??0)+1),n.request.agentId&&i.add(t(n.request.agentId)??`background agent`)}return{allowed:n,denied:e.length-n,tools:[...r.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>t>1?`${e} ×${t}`:e).join(`, `),who:[...i]}},[e,t]);return(0,W.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`permission-run`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":n||i,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-surface-2`,children:[o===0?(0,W.jsx)(q.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,W.jsx)(q.X,{className:`w-3 h-3 shrink-0 text-danger`}),(0,W.jsxs)(`span`,{className:`shrink-0`,children:[a>0?`Allowed ${a}`:``,a>0&&o>0?` · `:``,o>0?`Denied ${o}`:``]}),(0,W.jsx)(`span`,{className:`min-w-0 truncate text-fg-muted`,"data-testid":`permission-run-tools`,children:s}),c.length>0?(0,W.jsx)(`span`,{className:`shrink-0`,children:(0,W.jsx)(Z,{tone:`think`,children:c.length===1?c[0]:`${c.length} agents`})}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(q.Chevron,{open:n||i,className:`w-3 h-3 shrink-0`})]}),n||i?(0,W.jsx)(`div`,{className:`ml-3`,children:e.map(e=>(0,W.jsx)(VP,{item:e,agentName:e.request.agentId?t(e.request.agentId):null},e.id))}):null]})}function UP({item:e,onDecide:t,stackIndex:n,agentName:r}){let i=e.request,[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=i.title??`Allow ${i.displayName??i.toolName}?`,u=(0,v.useRef)(t);u.current=t;let d=(0,v.useRef)(null),f=e.status===`pending`;if((0,v.useEffect)(()=>{if(f&&typeof document<`u`){let e=e=>{e.key===`Escape`&&zP(d.current,e.target,document)&&(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),u.current({behavior:`deny`}))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)}},[f]),(0,v.useEffect)(()=>{f&&LP(d.current)},[f]),e.status!==`pending`)return(0,W.jsx)(VP,{item:e,agentName:r??null});if(i.toolName===`AskUserQuestion`)return(0,W.jsx)(eP,{item:e,onDecide:t,cardRef:d,...n===void 0?{}:{stackIndex:n}});let p=bl(i);if(p)return(0,W.jsx)(tP,{input:p,requestId:i.requestId,onDecide:t,cardRef:d});let m=Zf(i);if(m)return(0,W.jsx)(fP,{input:m,requestId:i.requestId,onDecide:t,cardRef:d});let h=Gf(i);return h?(0,W.jsx)(aP,{input:h,requestId:i.requestId,onDecide:t,cardRef:d}):(0,W.jsxs)(`div`,{ref:d,className:`my-2 rounded-lg border border-warn/60 bg-warn-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Permission request`,"data-permission-pending":`true`,"data-testid":`permission-${i.requestId}`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(q.Shield,{className:`mt-0.5 w-4 h-4 text-warn`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`font-semibold`,children:l}),(0,W.jsx)(Z,{tone:`warn`,children:i.toolName}),i.agentId?(0,W.jsx)(Z,{tone:`think`,children:`subagent`}):null]}),i.description?(0,W.jsx)(`div`,{className:`mt-0.5 text-fg-muted`,children:i.description}):null,i.decisionReason?(0,W.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-faint`,children:i.decisionReason}):null,i.blockedPath?(0,W.jsxs)(`div`,{className:`mt-0.5 font-mono text-xs text-danger`,children:[`Blocked path: `,i.blockedPath]}):null]})]}),(0,W.jsx)(`div`,{className:`mt-2`,children:(0,W.jsx)(EP,{name:i.toolName,input:i.input})}),a?(0,W.jsx)(`div`,{className:`mt-2`,children:(0,W.jsx)(`input`,{className:X,placeholder:`Optional: tell the agent why (sent as the tool result)`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&t(s.trim()?{behavior:`deny`,message:s.trim()}:{behavior:`deny`})}})}):null,(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>t({behavior:`allow`}),"data-autofocus":!0,children:[(0,W.jsx)(q.Check,{className:`w-3.5 h-3.5`}),` Allow`]}),(0,W.jsx)(J,{variant:`secondary`,title:`Allow and remember this rule for the session/project`,onClick:()=>t({behavior:`allow`,remember:!0}),children:`Allow always`}),a?(0,W.jsx)(J,{variant:`secondary`,onClick:()=>t(s.trim()?{behavior:`deny`,message:s.trim()}:{behavior:`deny`}),children:`Confirm deny`}):(0,W.jsxs)(J,{variant:`ghost`,onClick:()=>o(!0),children:[(0,W.jsx)(q.X,{className:`w-3.5 h-3.5`}),` Deny`]}),(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Enter = allow · Esc = deny`})]})]})}var WP=6e4;function GP(e){return Math.ceil(Math.max(0,e)/3)*4}function KP(e,t){return t?Math.min(e.size,WP):GP(e.size)}function qP(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${Math.max(0,Math.round(e))} B`}function JP(e,t={}){let n=t.budget??6291456,r=t.isText??(()=>!1),i=Math.max(0,t.usedBytes??0),a=[],o=[],s=0;for(let t of e){let e=KP(t,r(t));if(e>n){o.push({name:t.name,reason:`too large — ${qP(t.size)} becomes ${qP(e)} once encoded (limit ${qP(n)})`});continue}if(i+e>n){o.push({name:t.name,reason:`would exceed the ${qP(n)} attachment budget — send the staged files first`});continue}i+=e,s+=e,a.push(t)}return{accepted:a,rejected:o,addedBytes:s}}var YP=3e3;function XP(e,t,n){return e?.providerId!==`oonacode`||(n?.priceUsdMonthly??0)>0?null:t?.free===!0?`free`:`pool`}function ZP(e){switch(e){case`free`:return`Waiting for a free-lane slot — free requests are paced, so the first reply can take a few seconds.`;case`pool`:return`Waiting for a slot on the OonaCode pool — the request is queued behind the provider’s rate limits.`;default:return null}}function QP(e,t,n=YP){let[r,i]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(i(!1),!e)return;let t=setTimeout(()=>i(!0),n);return()=>clearTimeout(t)},[e,t,n]),r}function $P(e){let t=Math.floor(e/6e4);if(t<60)return`${Math.max(1,t)}m`;let n=Math.floor(t/60);if(n<24)return`${n}h ${t-n*60}m`;let r=Math.floor(n/24);return`${r}d ${n-r*24}h`}function eF(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function tF(e){let{lastTurnEndedAt:t,now:n,ttlSec:r,contextTokens:i,running:a}=e;if(a||t===null||r===null||r<=0||i!==null&&i<1024)return null;let o=n-t;if(!Number.isFinite(o)||o<r*1e3)return null;let s=i===null?`the whole conversation`:`about ${eF(i)} tokens`;return`Idle ${$P(o)}. The prompt cache has likely expired, so your next message will re-cache ${s}.`}var nF=new Set([`Alt`,`AltGraph`,`Control`,`Shift`,`Meta`,`OS`,`CapsLock`]),rF=1500,iF=24;function aF(e){if(!e)return`none`;if(typeof document<`u`&&e===document.body)return`BODY`;let t=e.tagName??`?`,n=e.getAttribute?.(`data-testid`)??e.getAttribute?.(`aria-label`)??e.getAttribute?.(`role`),r=typeof e.className==`string`?e.className.split(/\s+/).filter(Boolean).slice(0,3):[];return`${t}${n?`[${n.slice(0,60)}]`:``}${r.length>0?`.${r.join(`.`)}`:``}`}function oF(e,t){let n=t.now??(()=>Date.now()),r=-1/0,i=-1/0,a=[],o=e=>{nF.has(e.key)||(r=n())},s=()=>{i=n()},c=()=>{let e=n();return a.filter(t=>e-t.t<=rF).map(e=>e.what)},l=a=>{let o=n();if(o-r>2e3||o-i<=1e3)return;let s=a.relatedTarget instanceof Element?a.relatedTarget:null,l=c();setTimeout(()=>{if(typeof document<`u`&&!document.hasFocus()||typeof document<`u`&&document.activeElement===e)return;let n=typeof document<`u`?document.activeElement:null;n&&n!==e&&n.closest?.(`[data-testid="composer"]`)||t.report({activeAfter:aF(typeof document<`u`?document.activeElement:null),relatedTarget:aF(s),boxConnected:e.isConnected,boxDisabled:e.disabled,recentlyAdded:l,sinceKeyMs:Math.round(o-r),unmounted:!1})},0)},u=null,d=t.root??(typeof document<`u`?document.body:null);return d&&typeof MutationObserver<`u`&&(u=new MutationObserver(e=>{let t=n();for(let n of e)for(let e of Array.from(n.addedNodes))e.nodeType===1&&(a.push({t,what:aF(e)}),a.length>iF&&a.shift())}),u.observe(d,{childList:!0,subtree:!0})),e.addEventListener(`keydown`,o),e.addEventListener(`blur`,l),typeof document<`u`&&document.addEventListener(`pointerdown`,s,!0),()=>{let a=n();typeof document<`u`&&document.activeElement===e&&a-r<=2e3&&a-i>1e3&&t.report({activeAfter:`unmounting`,relatedTarget:`none`,boxConnected:e.isConnected,boxDisabled:e.disabled,recentlyAdded:c(),sinceKeyMs:Math.round(a-r),unmounted:!0}),u?.disconnect(),e.removeEventListener(`keydown`,o),e.removeEventListener(`blur`,l),typeof document<`u`&&document.removeEventListener(`pointerdown`,s,!0)}}var sF=new Map;function cF(e){e===void 0?sF.clear():sF.delete(e)}function lF(e){let{text:t,chatId:n,disabled:r=!1,load:i,onPick:a}=e,o=_p(t),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[,d]=(0,v.useState)(0),f=(0,v.useRef)(null);(0,v.useEffect)(()=>{o===null&&c(!1)},[o]),(0,v.useEffect)(()=>{u(null)},[o,n]);let p=o!==null&&o.toLowerCase()===`setcustommodel`,m=o!==null&&!s&&!r&&n!==null&&!p,h=n!==null&&!r&&(m||/^\/\S+\s/.test(t)),g=n===null?void 0:sF.get(n),_=g!==void 0&&Date.now()-g.at<6e4;(0,v.useEffect)(()=>{if(!h||n===null||_||f.current===n)return;f.current=n;let e=!0;return i(n).then(e=>{sF.set(n,{at:Date.now(),commands:e===null||e===`unsupported`?null:[...Sp(e.commands)],unsupported:e===`unsupported`})}).catch(()=>{sF.set(n,{at:Date.now(),commands:null,unsupported:!1})}).finally(()=>{f.current===n&&(f.current=null),e&&d(e=>e+1)}),()=>{e=!1}},[h,n,_,i]);let y=g?.commands??null,{items:b,sections:x,best:S}=(0,v.useMemo)(()=>{if(!y||o===null)return{items:[],sections:[],best:0};let e=Cp(y,o),t=kp(e),n=[],r=0;for(let e of Ep)t[e].length!==0&&(n.push({id:e,title:Dp[e],start:r,items:t[e]}),r+=t[e].length);let i=n.flatMap(e=>e.items),a=e[0];return{items:i,sections:n,best:o.length>0&&a?Math.max(i.indexOf(a),0):0}},[y,o]),C=(0,v.useMemo)(()=>y?wp(t,y):null,[y,t]),w=g===void 0?`loading`:g.unsupported?`unsupported`:g.commands===null?`error`:`ready`,T=m&&w!==`unsupported`,E=b.length===0?0:Math.min(l??S,b.length-1),D=(0,v.useCallback)(e=>`/${e.name} `,[]),O=(0,v.useCallback)(()=>c(!0),[]);return{open:T,status:w,query:o??``,items:b,sections:x,active:E,setActive:u,inArguments:C,onKeyDown:e=>{if(!T||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`)return e.preventDefault(),c(!0),!0;if(b.length===0)return!1;if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;return u((E+t+b.length)%b.length),!0}let t=b[E];if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`&&!e.shiftKey){let n=o!==null&&(t.name.toLowerCase()===o.toLowerCase()||(t.aliases??[]).some(e=>e.toLowerCase()===o.toLowerCase()));return e.key===`Enter`&&n?!1:t.availability===`ok`?(e.preventDefault(),a(D(t)),!0):(e.preventDefault(),!0)}return!1},textFor:D,dismiss:O}}var uF=`slash-command-menu`,dF=e=>`slash-command-option-${e}`,fF=`The model may also use it on its own in this chat (switched on in the Skills menu)`,pF=`Picking or typing a skill runs it once, in this message, whatever the Skills menu says. The model is shown a skill on its own only when it is switched on in the Skills menu under the message box — then it costs its tokens on every message.`;function mF({menu:e,onPick:t,modelSkills:n=null}){let r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{(r.current?.querySelector(`#${dF(e.active)}`))?.scrollIntoView?.({block:`nearest`})},[e.active,e.items]),e.open?(0,W.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,"data-testid":`slash-menu`,children:[e.status===`loading`?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-fg-muted`,role:`status`,children:[(0,W.jsx)(q.Spinner,{className:`h-3.5 w-3.5 animate-spin`}),` Reading this chat’s commands…`]}):e.status===`error`?(0,W.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,role:`status`,children:`The host could not list this chat’s commands right now — type the command, it still runs.`}):e.items.length===0?(0,W.jsxs)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,role:`status`,"data-testid":`slash-empty`,children:[`No command or skill matches “/`,e.query,`” — Enter sends it to the model as a message.`]}):(0,W.jsx)(`ul`,{ref:r,id:uF,role:`listbox`,"aria-label":`Skills and commands`,className:`max-h-72 overflow-y-auto pb-1`,children:e.sections.map(r=>(0,W.jsx)(hF,{section:r,menu:e,onPick:t,modelSkills:n},r.id))}),(0,W.jsx)(`div`,{className:`hidden border-t border-border px-3 py-0.5 text-right text-[10px] text-fg-faint sm:block`,children:`↑↓ to move · Enter or Tab to pick · Esc to close`})]}):null}function hF({section:e,menu:t,onPick:n,modelSkills:r}){let i=`slash-section-${e.id}`,a=e=>e.modelSkill===void 0?null:(r??[]).includes(e.modelSkill),o=e.items.filter(e=>a(e)!==null),s=o.some(e=>a(e)===!0);return(0,W.jsxs)(`li`,{role:`presentation`,"data-testid":`slash-section`,"data-section":e.id,children:[(0,W.jsxs)(`div`,{id:i,className:`sticky top-0 z-10 flex items-baseline gap-2 border-b border-border bg-surface px-3 pb-0.5 pt-1.5 text-[11px]`,children:[(0,W.jsx)(`span`,{className:`font-semibold uppercase tracking-wide text-fg-muted`,"data-testid":`slash-section-title`,children:e.title}),e.id===`skills`?(0,W.jsx)(`span`,{className:`ml-auto flex min-w-0 items-center gap-1 truncate text-fg-faint`,title:pF,"data-testid":`slash-skills-note`,children:o.length===0?`Picking one runs it once`:s?(0,W.jsxs)(W.Fragment,{children:[`Picking one runs it once · `,(0,W.jsx)(q.Skill,{className:`h-3 w-3 shrink-0 text-accent`}),` `,`the model may also use it here`]}):`Picking one runs it once · the model is not shown these here`}):null]}),(0,W.jsx)(`ul`,{role:`group`,"aria-labelledby":i,children:e.items.map((r,i)=>{let o=e.start+i;return(0,W.jsx)(gF,{item:r,index:o,active:o===t.active,onHover:t.setActive,onPick:n,modelOn:a(r)},r.name)})})]})}var gF=(0,v.memo)(function({item:e,index:t,active:n,onHover:r,onPick:i,modelOn:a}){let o=e.availability!==`ok`,s=Tp(e.source),c=jp(e.description);return(0,W.jsxs)(`li`,{id:dF(t),role:`option`,"aria-selected":n,"aria-disabled":o||void 0,"data-testid":`slash-item`,"data-name":e.name,"data-model-skill":a===null?void 0:a?`on`:`off`,title:e.description||void 0,className:U(`flex cursor-pointer flex-col gap-0.5 px-3 py-1.5 text-xs`,n?`bg-accent-soft`:`hover:bg-surface-2`,o&&`cursor-default opacity-60`),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>r(t),onClick:()=>{o||i(e)},children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,W.jsxs)(`span`,{className:`shrink-0 font-mono font-medium text-fg`,children:[`/`,e.name]}),e.argumentHint?(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-fg-faint`,children:e.argumentHint}):null,(0,W.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[a===!0&&!o?(0,W.jsx)(`span`,{className:`text-accent`,title:fF,"aria-label":fF,"data-testid":`slash-model-state`,children:(0,W.jsx)(q.Skill,{className:`h-3 w-3`})}):null,s?(0,W.jsx)(`span`,{className:`rounded border border-border px-1 text-[10px] uppercase tracking-wide text-fg-muted`,children:s}):null]})]}),o?(0,W.jsxs)(`div`,{className:`text-fg-muted`,"data-testid":`slash-reason`,children:[`Not available here — `,e.reason]}):c?(0,W.jsx)(`div`,{className:`truncate text-fg-muted`,"data-testid":`slash-summary`,children:c}):null]})});function _F({item:e}){return e&&e.availability!==`ok`?(0,W.jsxs)(`div`,{className:`px-1 pt-0.5 text-[11px] text-warn`,"data-testid":`slash-hint`,children:[(0,W.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.name]}),` is not available here — `,e.reason]}):!e||!e.argumentHint&&!e.note?null:(0,W.jsxs)(`div`,{className:`px-1 pt-0.5 text-[11px] text-fg-faint`,"data-testid":`slash-hint`,children:[(0,W.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.name,` `,e.argumentHint]}),e.note?(0,W.jsxs)(`span`,{children:[` — `,e.note]}):null]})}var vF=`field-sizing-content w-auto max-w-full shrink-0 rounded-md border border-border bg-surface-2 py-0.5 pl-1.5 pr-1 text-xs text-fg hover:border-fg-faint focus:border-accent focus:outline-none disabled:opacity-50`,yF=[{value:`default`,label:`Ask (default)`},{value:`acceptEdits`,label:`Accept edits`},{value:`plan`,label:`Plan`},{value:`auto`,label:`Auto`},{value:`dontAsk`,label:`Don't ask`},{value:`bypassPermissions`,label:`Bypass permissions`}],bF=`Ask anything — build, fix, explain…`,xF=j;function SF(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>{let e=String(r.result??``);t(e.slice(e.indexOf(`,`)+1))},r.readAsDataURL(e)})}function CF(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>t(String(r.result??``)),r.readAsText(e)})}function wF(e){return e.type.startsWith(`image/`)?`image`:e.type===`application/pdf`?`document`:`text`}function TF(e){return e.map(e=>e.kind===`image`?{type:`image`,source:{type:`base64`,media_type:e.mediaType,data:e.data}}:e.kind===`document`?{type:`document`,source:{type:`base64`,media_type:e.mediaType||`application/pdf`,data:e.data}}:{type:`text`,text:`Attached file ${e.name}:\n\n\`\`\`\n${e.data}\n\`\`\``})}function EF(){let{state:e,actions:t,dispatch:n}=G(),r=Ay(),i=jy(),a=ky(),{sessionId:o,focused:s}=Dy(),c=o?e.unsent[o]:void 0,[l,u]=(0,v.useState)(()=>c?.text??``),[d,f]=(0,v.useState)(()=>[...c?.attachments??[]]),[p,m]=(0,v.useState)(()=>[...c?.replies??[]]),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(xF),[b,x]=(0,v.useState)(!1),S=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(0),T=(0,v.useRef)(!0),E=(0,v.useRef)({text:l,attachments:d,replies:p});E.current={text:l,attachments:d,replies:p},(0,v.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]);let D=(0,v.useRef)(a?.status??null);D.current=a?.status??null,(0,v.useEffect)(()=>{let e=S.current;if(e)return oF(e,{report:e=>t.reportDiagnostic(`message box lost the focus while typing`,{...e,chatStatus:D.current})})},[t]),(0,v.useEffect)(()=>{if(o)return()=>t.rememberUnsent(o,E.current)},[o,t]),(0,v.useEffect)(()=>{if(o)return z_(o,()=>E.current)},[o]),(0,v.useEffect)(()=>{c&&(u(e=>e.length===0?c.text:e),f(e=>e.length===0?[...c.attachments]:e),m(e=>e.length===0?[...c.replies??[]]:e))},[c]);let O=e.composerQuote,k=(0,v.useRef)(O?.seq??0);(0,v.useEffect)(()=>{!O||O.seq<=k.current||(k.current=O.seq,O.sessionId===o&&(m(e=>e.some(e=>e.quote===O.text)?e:[...e,{id:`reply-${O.seq}`,quote:O.text,preview:O.preview,itemId:O.itemId}]),S.current?.focus()))},[O,o]);let A=r?.effort??i?.effort??``;(0,v.useEffect)(()=>{g(A)},[o,A]);let j=a?.status===`running`||a?.status===`waiting_permission`,P=e.connection.status===`open`,F=sx(),te=cx(),ne=!o||F||te!==null,re=JN(),L=Ce(re.option),ie=(0,v.useMemo)(()=>{let e=Se(re.option);return e.length===0?[]:A&&!e.includes(A)?[...e,A]:e},[re.option,A]),R=ie.length>0,ae=(0,v.useMemo)(()=>e.providers.find(e=>e.definition.id===re.providerId)?.definition,[e.providers,re.providerId]),oe=F?`This session runs on a PC that is offline — read-only`:te?`${te} is no longer offered — pick another model to continue`:ne?`Open a chat to start`:j?`Agent is working — a message sent now is handed to it and read at its next step (Esc to stop)`:bF;(0,v.useEffect)(()=>{let e=S.current;if(!e)return;let t=()=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,240)}px`};if(t(),typeof ResizeObserver>`u`)return;let n=e.clientWidth,r=new ResizeObserver(()=>{e.clientWidth!==n&&(n=e.clientWidth,t())});return r.observe(e),()=>r.disconnect()},[l,oe]);let se=(0,v.useRef)(s);se.current=s,(0,v.useEffect)(()=>{se.current&&S.current?.focus()},[o]);let ce=I(i?.permissionMode?{permissionMode:i.permissionMode,posture:i.posture??null}:r);(0,v.useEffect)(()=>{y(L?ce:xF)},[L,ce,o]);let le=$p(re.providerId),ue=tm(re.providerId);(0,v.useEffect)(()=>{!i||!L||!le||tm(re.providerId).some(e=>e.id===ce)||t.setSessionPosture(xF,o??void 0)},[i,L,le,re.providerId,ce,o,t]);let de=(0,v.useMemo)(()=>d.reduce((e,t)=>e+t.data.length,0),[d]),fe=(0,v.useRef)(de);fe.current=de;let pe=(0,v.useCallback)(async e=>{let n=Array.from(e);if(n.length===0)return;let r=JP(n,{usedBytes:fe.current,isText:e=>wF(e)===`text`});for(let e of r.rejected)t.toast(`error`,`${e.name} was not attached: ${e.reason}`);let i=[];for(let e of r.accepted){let n=wF(e);if(n!==`text`&&ae&&re.modelId){let r=Ws(ae,re.modelId,[{type:n}]);if(r){t.toast(`error`,`${e.name||`File`} was not attached: ${r}`);continue}}try{let t=n===`text`?(await CF(e)).slice(0,WP):await SF(e);i.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||(n===`image`?`image`:`file`),mediaType:e.type||(n===`text`?`text/plain`:`application/octet-stream`),data:t,kind:n,size:e.size})}catch{t.toast(`error`,`${e.name||`File`} could not be read — nothing was attached`)}}i.length>0&&f(e=>[...e,...i])},[t,ae,re.modelId]),me=_===xF?null:ee(_),he=(0,v.useCallback)(e=>{u(e);let t=S.current;t&&(t.focus(),requestAnimationFrame(()=>t.setSelectionRange(e.length,e.length)))},[]),ge=lF({text:l,chatId:o,disabled:ne,load:t.listCommands,onPick:he}),_e=(0,v.useCallback)(()=>{let e=l.trim();if(!o||te!==null||!e&&d.length===0)return;let n=qp(e);if(n){u(``),S.current?.focus(),t.setSessionCustomModel(n,o).then(e=>{!e&&T.current&&u(e=>e.length===0?l:e)});return}let r=fv(p.map(e=>e.quote),e||`Please look at the attached file(s).`),i=yp(r,`app`);if(i){t.toast(`error`,bp(i));return}let a=d,s=p,c=TF(a),g={};h&&(g.effort=h),me&&(g.permissionMode=me,g.posture=_);let v=o;u(``),f([]),m([]),S.current?.focus(),t.sendPrompt(r,c,Object.keys(g).length>0?g:void 0,v??void 0).then(e=>{if(T.current){let e=document.activeElement;(!e||e===document.body)&&S.current?.focus()}if(!e){if(T.current){u(e=>e.length===0?l:e),f(e=>e.length===0?a:e),m(e=>e.length===0?s:e);return}t.rememberUnsent(v,{text:l,attachments:a,replies:s},!0)}})},[l,d,p,o,te,t,h,me,_]),ve=e=>{ge.onKeyDown(e)||(e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),_e()):e.key===`Escape`&&j&&(e.preventDefault(),t.interrupt(o??void 0)))},ye=e=>{let t=Array.from(e.clipboardData?.files??[]);t.length>0&&(e.preventDefault(),pe(t))},be=e=>{e.preventDefault(),w.current=0,x(!1),e.dataTransfer?.files?.length&&pe(e.dataTransfer.files)},xe=e=>{e.dataTransfer?.types?.includes(`Files`)&&(w.current+=1,x(!0))},we=()=>{w.current=Math.max(0,w.current-1),w.current===0&&x(!1)},Te=e=>{e.target.files&&pe(e.target.files),e.target.value=``},{pendingQuestions:Ee,pendingPermissions:De}=(0,v.useMemo)(()=>{let e=[],t=[];for(let n of a?.items??[])n.kind===`permission`&&n.status===`pending`&&(n.request.toolName===`AskUserQuestion`?e.push(n):t.push(n));return{pendingQuestions:e,pendingPermissions:t}},[a?.items]),Oe=XP(r,re.option,e.plan),ke=QP(a?.status===`running`,a?.items.length??0)&&Oe?ZP(Oe):null,[Ae,je]=(0,v.useState)(()=>Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>je(Date.now()),6e4);return()=>clearInterval(e)},[]);let Me=(0,v.useMemo)(()=>{if(!a||!r)return null;let t=a.items,n=null;for(let e=t.length-1;e>=0;e--)if(t[e].kind===`result`){n=t[e];break}if(!n||n.kind!==`result`){if(t.length===0)return null;let n=e.providers.find(e=>e.definition.id===re.providerId)?.definition.capabilities.promptCacheTtlSec??null,i=Date.parse(r.updatedAt);return tF({lastTurnEndedAt:Number.isFinite(i)?i:null,now:Ae,ttlSec:n,contextTokens:a.contextTokens,running:j})}let i=n.timestamp?Date.parse(n.timestamp):Date.parse(r.updatedAt),o=e.providers.find(e=>e.definition.id===re.providerId)?.definition.capabilities.promptCacheTtlSec??null;return tF({lastTurnEndedAt:Number.isFinite(i)?i:null,now:Ae,ttlSec:o,contextTokens:a.contextTokens,running:j})},[a,r,e.providers,re.providerId,Ae,j]);return(0,W.jsxs)(`div`,{className:`relative border-t border-border bg-surface px-3 py-2 sm:px-6`,onDrop:be,onDragOver:e=>e.preventDefault(),onDragEnter:xe,onDragLeave:we,"data-testid":`composer`,children:[b?(0,W.jsxs)(`div`,{className:`pointer-events-none absolute inset-1 z-10 flex items-center justify-center rounded-xl border-2 border-dashed border-accent bg-accent-soft/70 text-sm font-medium text-accent`,"data-testid":`drop-overlay`,children:[(0,W.jsx)(q.Upload,{className:`mr-2 w-4 h-4`}),` Drop files to attach`]}):null,(0,W.jsxs)(`div`,{className:`w-full`,children:[o&&e.toolInstalls[o]?(0,W.jsx)(iP,{frame:e.toolInstalls[o],onDismiss:()=>n({type:`tool_install_dismiss`,sessionId:o})}):null,De.length>0?(0,W.jsx)(`div`,{className:`mb-2 max-h-[45vh] space-y-2 overflow-y-auto`,"data-testid":`composer-pending`,children:De.map(e=>(0,W.jsx)(UP,{item:e,onDecide:n=>t.respondPermission(e.request.requestId,n,o??void 0)},e.id))}):null,Ee.map((e,n)=>(0,W.jsx)(UP,{item:e,stackIndex:n,onDecide:n=>t.respondPermission(e.request.requestId,n,o??void 0)},e.id)),Me&&!ke?(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-[11px] text-fg-muted`,"data-testid":`idle-cache-hint`,children:[(0,W.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-fg-faint`}),Me]}):null,ke?(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-[11px] text-fg-muted`,"data-testid":`pacing-hint`,"data-lane":Oe??void 0,children:[(0,W.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-warn`}),ke]}):null,!P&&o?(0,W.jsx)(`div`,{className:`mb-2 text-xs text-fg-faint`,children:e.connection.status===`unauthorized`?`The host rejected this token.`:`Not connected to the host — messages will be sent over HTTP when possible.`}):null,p.length>0?(0,W.jsx)(`div`,{className:`mb-2 flex flex-col gap-1`,"data-testid":`reply-chips`,children:p.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border-l-2 border-accent bg-accent-soft/60 py-1 pl-2 pr-1 text-xs`,"data-testid":`reply-chip`,children:[(0,W.jsx)(q.Reply,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,W.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 truncate text-left text-fg-muted hover:text-fg`,title:`Go to the message this replies to`,disabled:!e.itemId||!o,onClick:()=>{e.itemId&&o&&t.jumpToItem(o,e.itemId)},"data-testid":`reply-chip-jump`,children:[(0,W.jsx)(`span`,{className:`text-fg`,children:`Reply to `}),e.preview]}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`Remove this reply`,onClick:()=>m(t=>t.filter(t=>t.id!==e.id)),className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-muted hover:text-danger`,"data-testid":`reply-chip-remove`,children:(0,W.jsx)(q.X,{className:`h-3 w-3`})})]},e.id))}):null,d.length>0?(0,W.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-2`,"data-testid":`attachments`,children:d.map(e=>(0,W.jsxs)(`div`,{className:`relative`,children:[e.kind===`image`?(0,W.jsx)(`img`,{src:`data:${e.mediaType};base64,${e.data}`,alt:e.name,className:`h-14 w-14 rounded border border-border object-cover`}):(0,W.jsxs)(`div`,{className:`flex h-14 min-w-[7rem] max-w-[12rem] flex-col justify-center rounded border border-border bg-surface-2 px-2 text-[11px]`,children:[(0,W.jsx)(`span`,{className:`truncate font-medium`,children:ug(e.name,22)}),(0,W.jsxs)(`span`,{className:`text-fg-faint`,children:[e.kind===`document`?`PDF`:`text`,` · `,Math.ceil(e.size/1024),` KB`]})]}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,onClick:()=>f(t=>t.filter(t=>t.id!==e.id)),className:`absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-surface text-fg-muted hover:text-danger`,children:(0,W.jsx)(q.X,{className:`w-3 h-3`})})]},e.id))}):null,te?(0,W.jsxs)(`p`,{className:`px-1 text-xs text-danger`,role:`status`,"data-testid":`model-withdrawn`,children:[te,` is no longer available. Pick another model below to continue this chat — its history stays.`]}):null,(0,W.jsxs)(`div`,{className:U(`relative flex flex-col gap-1 rounded-xl border bg-bg px-2 py-1.5`,ne?`border-border opacity-60`:`border-border`),children:[(0,W.jsx)(mF,{menu:ge,onPick:e=>he(ge.textFor(e)),modelSkills:(i?i.modelSkills:r?.modelSkills)??null}),(0,W.jsx)(`textarea`,{ref:S,"aria-label":`Message`,rows:1,value:l,"aria-controls":ge.open?uF:void 0,"aria-activedescendant":ge.open&&ge.items.length>0?dF(ge.active):void 0,disabled:ne,placeholder:oe,onChange:e=>u(e.target.value),onKeyDown:ve,onPaste:ye,className:`max-h-60 min-h-[2.25rem] w-full resize-none bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-fg-faint`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1`,"data-testid":`composer-controls`,children:[(0,W.jsx)(`input`,{ref:C,type:`file`,multiple:!0,className:`hidden`,onChange:Te,"data-testid":`file-input`}),(0,W.jsx)(Y,{label:`Attach files or images`,disabled:ne,onClick:()=>C.current?.click(),children:(0,W.jsx)(q.Upload,{className:`w-4 h-4`})}),(0,W.jsx)(Ex,{disabled:!o||F}),(0,W.jsx)(dN,{disabled:ne}),(0,W.jsx)(SN,{disabled:ne}),(0,W.jsx)(HN,{}),(0,W.jsx)(KN,{}),(0,W.jsx)(qN,{}),r&&!F?(0,W.jsx)(Y,{label:`Listen to this chat — a spoken summary`,"data-testid":`listen-button`,onClick:()=>t.openVoiceSummary(r.id),children:(0,W.jsx)(q.Speaker,{className:`w-4 h-4`})}):null,L?(0,W.jsxs)(`select`,{"aria-label":`Agent`,"data-testid":`agent-picker`,className:vF,value:_,disabled:ne,title:le?nm:void 0,onChange:e=>{let n=e.target.value;M(n)&&(y(n),t.setSessionPosture(n,o??void 0))},children:[ue.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.label},e.id)),ue.some(e=>e.id===_)?null:(0,W.jsx)(`option`,{value:_,disabled:!0,children:N(_)})]}):null,L&&le?(0,W.jsx)(`span`,{className:`inline-flex`,"data-testid":`agy-posture-note`,children:(0,W.jsx)(Hy,{label:`the agent picker`,details:nm})}):null,R?(0,W.jsxs)(`select`,{"aria-label":`Effort`,className:vF,value:h,disabled:ne,onChange:e=>{let n=e.target.value;g(n),t.setSessionEffort(n||null,o??void 0)},children:[(0,W.jsx)(`option`,{value:``,children:`effort: default`}),ie.map(e=>(0,W.jsxs)(`option`,{value:e,children:[`effort: `,e]},e))]}):null,(0,W.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,"data-testid":`composer-actions`,children:[j?(0,W.jsxs)(J,{variant:`danger`,size:`sm`,onClick:()=>void t.interrupt(o??void 0),title:`Interrupt (Esc)`,"aria-label":`Interrupt`,"data-testid":`stop-button`,children:[(0,W.jsx)(q.Stop,{className:`w-3.5 h-3.5`}),` Stop`]}):null,(0,W.jsxs)(J,{variant:`primary`,size:`sm`,onMouseDown:e=>e.preventDefault(),onClick:_e,disabled:ne||!l.trim()&&d.length===0,"aria-label":j?`Queue message`:`Send`,title:j?`Queue this message — the agent reads it at its next step`:void 0,children:[(0,W.jsx)(q.Send,{className:`w-3.5 h-3.5`}),` `,j?`Queue`:`Send`]})]})]})]}),ge.open?null:(0,W.jsx)(_F,{item:ge.inArguments}),a&&a.totals.turns>0?(0,W.jsxs)(`div`,{className:`mt-1 text-right text-[11px] text-fg-faint`,children:[a.totals.turns,` turn`,a.totals.turns===1?``:`s`,` ·`,` `,r?.providerId===`oonacode`?Ql(r.poolCredits??0):tu(nu(e.providers.find(e=>e.definition.id===r?.providerId)?.definition))]}):null]})]})}function DF({name:e,state:t,behind:n,detail:r}){return(0,W.jsxs)(`div`,{"data-testid":`sync-side`,className:`min-w-0 flex-1 rounded-md border p-3 ${n?`border-warn bg-warn-soft/40`:`border-border bg-surface-2`}`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n?(0,W.jsx)(`span`,{className:`shrink-0 text-[11px] font-normal text-warn`,children:`behind`}):null]}),(0,W.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-faint`,children:t.entryCount===null?`size not read`:`${t.entryCount} ${t.entryCount===1?`entry`:`entries`}`}),(0,W.jsx)(`div`,{className:`text-[11px] text-fg-faint`,title:sg(t.lastEntryAt),children:t.lastEntryAt?`last message ${ag(t.lastEntryAt)}`:`no timestamps`}),r?(0,W.jsx)(`div`,{className:`mt-1 break-all text-[11px] text-fg-faint`,children:r}):null]})}function OF({sessionId:e,sessionTitle:t,onClose:n}){let{actions:r}=G(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=(0,v.useCallback)(async()=>{if(e){s(!0);try{a(await r.refreshSessionLink(e))}finally{s(!1)}}},[e,r]);(0,v.useEffect)(()=>{d(null),a(null),f()},[f]);let p=async()=>{if(e){l(!0);try{let t=await r.syncSessionDown(e);d(t),t&&a(t.link)}finally{l(!1)}}},m=i?.status===`ours-behind`,h=i?.status===`theirs-behind`;return(0,W.jsx)(Ky,{open:e!==null,title:`Sync with the original chat`,onClose:n,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(J,{variant:`ghost`,onClick:n,children:`Close`}),(0,W.jsx)(J,{variant:`primary`,busy:c,onClick:()=>void p(),disabled:!i?.canDownstream||o,"data-testid":`sync-down-confirm`,children:c?`Syncing…`:m?`Bring the new messages in`:`Check again`})]}),children:o&&!i?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-sm text-fg-muted`,children:[(0,W.jsx)(q.Spinner,{className:`w-4 h-4 spin`}),` Reading the original…`]}):i?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,W.jsx)(DF,{name:`OonaCode · ${t}`,state:i.ours,behind:m}),(0,W.jsx)(DF,{name:i.agentName,state:i.theirs,behind:h,detail:i.file})]}),(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,"data-testid":`sync-explanation`,children:m?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`strong`,{children:[i.agentName,` has newer messages.`]}),` Bringing them in adds them to this chat — nothing here is replaced or removed, and `,i.agentName,` is not written to.`]}):h?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`strong`,{children:`This chat is the newer one.`}),` Nothing is sent back: OonaCode never writes into your `,i.agentName,` install, so the copy over there stays as it is.`]}):(0,W.jsx)(W.Fragment,{children:`Both copies are at the same point. There is nothing to bring in.`})}),u?(0,W.jsx)(`div`,{className:`rounded-md border border-border bg-surface-2 p-3 text-sm`,"data-testid":`sync-result`,children:u.added>0?`${u.added} new ${u.added===1?`message`:`messages`} added to this chat.`:`Already up to date — nothing to bring in.`}):null]}):(0,W.jsx)(`p`,{className:`py-4 text-sm text-fg-muted`,children:`This PC no longer has the chat this one was imported from, so there is nothing to compare it with. Nothing is wrong with the chat itself — it stays exactly as it is.`})})}function kF({status:e}){return(0,W.jsx)(`span`,{className:U(`inline-block h-2 w-2 shrink-0 rounded-full`,e===`running`?`bg-accent animate-pulse`:e===`waiting_permission`?`bg-warn animate-pulse`:e===`error`?`bg-danger`:`bg-transparent`),"aria-hidden":!0})}function AF(e){return e.some(e=>e.status===`running`)?`running`:e.some(e=>e.status===`waiting_permission`)?`waiting_permission`:`idle`}function jF({sessions:e,testId:t}){let n=AF(e);if(n===`idle`)return null;let r=e.filter(e=>e.status===`running`||e.status===`waiting_permission`).length;return(0,W.jsx)(`span`,{className:`inline-flex shrink-0 items-center`,title:n===`running`?`${r} chat${r===1?``:`s`} working`:`${r} chat${r===1?``:`s`} waiting for permission`,"aria-label":`${r} active chat${r===1?``:`s`}`,"data-testid":t,children:(0,W.jsx)(kF,{status:n})})}var MF={idle:`idle`,running:`working`,waiting_permission:`waiting for permission`,error:`error`};function NF({label:e,value:t}){return t==null||t===``?null:(0,W.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,W.jsx)(`span`,{className:`shrink-0 text-fg-faint`,children:e}),(0,W.jsx)(`span`,{className:`min-w-0 truncate text-right text-fg`,title:t,children:t})]})}function PF({session:e,anchor:t}){let{state:n}=G(),r=n.providers.find(t=>t.definition.id===e.providerId)?.definition,i=r?.models.find(t=>t.id===e.model),a=e.projectId?n.vaultProjects.find(t=>t.id===e.projectId):void 0,o=I(e),s=ee(o)===e.permissionMode?N(o):yF.find(t=>t.value===e.permissionMode)?.label??e.permissionMode,c=ru(e,nu(r)),l=Math.max(8,Math.min(t.right+8,window.innerWidth-304-8)),u=Math.max(8,Math.min(t.top,window.innerHeight-360));return(0,Ly.createPortal)((0,W.jsxs)(`div`,{role:`tooltip`,"data-testid":`session-details-${e.id}`,className:`fixed z-50 max-h-[22rem] w-[19rem] overflow-y-auto rounded-lg border border-border bg-surface p-3 text-xs shadow-lg`,style:{left:l,top:u},children:[(0,W.jsx)(`div`,{className:`mb-2 truncate text-sm font-medium text-fg`,children:pg(e)}),(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(NF,{label:`Model`,value:r&&e.model?`${e.model} · ${r.displayName}`:e.model}),(0,W.jsx)(NF,{label:`Effort`,value:e.effort??`default`}),(0,W.jsx)(NF,{label:`Mode`,value:s}),(0,W.jsx)(NF,{label:`Status`,value:MF[e.status]}),(0,W.jsx)(NF,{label:`Context window`,value:i?.contextWindow?`${ig(i.contextWindow)} tokens`:null}),(0,W.jsx)(NF,{label:`Tokens`,value:`${ig(e.inputTokens)} in · ${ig(e.outputTokens)} out`}),(0,W.jsx)(NF,{label:`Cost`,value:c}),(0,W.jsx)(NF,{label:`Messages`,value:String(e.entryCount)}),(0,W.jsx)(NF,{label:`Folder`,value:e.projectDir??e.cwd}),(0,W.jsx)(NF,{label:`Project`,value:a?.name??null}),(0,W.jsx)(NF,{label:`Created`,value:sg(e.createdAt)}),(0,W.jsx)(NF,{label:`Updated`,value:sg(e.updatedAt)}),(0,W.jsx)(NF,{label:`Forked from`,value:e.forkedFrom}),(0,W.jsx)(NF,{label:`Subagents`,value:e.hasSubagents?`yes`:null}),(0,W.jsx)(NF,{label:`Engine since`,value:sg(e.engineSince)})]})]}),document.body)}function FF({link:e}){return e?.status===`ours-behind`?(0,W.jsxs)(`span`,{className:`ml-1 inline-flex shrink-0 items-center gap-0.5 rounded bg-warn-soft px-1 text-[10px] font-medium leading-4 text-warn`,title:`${e.agentName} has newer messages in this chat — right-click to bring them in`,"data-testid":`session-behind-${e.sessionId}`,"aria-label":`behind its original`,children:[(0,W.jsx)(q.ArrowDown,{className:`w-2.5 h-2.5`}),`behind`]}):null}var IF=(0,v.memo)(function({session:e,active:t,link:n,onOpen:r,onMenu:i,menuOpen:a=!1,projectName:o=null,kindIcon:s=!1,testIdPrefix:c=`session`,clock:l}){let u=pg(e),d=t=>{let n=t.currentTarget.getBoundingClientRect();i(e,{x:n.left,y:n.bottom+2},f.current)},f=(0,v.useRef)(null),p=(0,v.useRef)(null),[m,h]=(0,v.useState)(null),g=(0,v.useCallback)(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),h(null)},[]),_=(0,v.useRef)(a);return _.current=a,(0,v.useEffect)(()=>{a&&g()},[a,g]),(0,v.useEffect)(()=>{if(m===null)return;let e=e=>{ex(e.target,f.current)&&g()};return window.addEventListener(`scroll`,e,!0),()=>window.removeEventListener(`scroll`,e,!0)},[m,g]),(0,v.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]),(0,W.jsxs)(`div`,{ref:f,className:U(`group relative flex items-center rounded-md`,t?`bg-accent-soft`:`hover:bg-surface-2`),onMouseEnter:()=>{p.current!==null&&clearTimeout(p.current),!_.current&&(p.current=setTimeout(()=>{p.current=null,f.current&&!_.current&&h(f.current.getBoundingClientRect())},450))},onMouseLeave:g,onClick:g,onContextMenu:t=>{t.preventDefault(),g(),i(e,{x:t.clientX,y:t.clientY},f.current)},children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left`,"aria-current":t?`true`:void 0,"data-testid":`${c}-${e.id}`,children:[s?(0,W.jsx)(q.Chats,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}):null,s&&e.status===`idle`?null:(0,W.jsx)(kF,{status:e.status}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,W.jsx)(`span`,{className:U(`min-w-0 flex-1 truncate text-sm`,t?`text-fg font-medium`:`text-fg`),children:u})}),(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center text-[11px] text-fg-faint`,children:[o?(0,W.jsxs)(`span`,{className:`mr-1 inline-flex min-w-0 max-w-[45%] shrink-0 items-center gap-0.5 text-project`,"data-testid":`session-project-${e.id}`,title:`Filed under ${o}`,children:[(0,W.jsx)(q.Project,{className:`w-2.5 h-2.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:o}),(0,W.jsx)(`span`,{className:`text-fg-faint`,children:`·`})]}):null,(0,W.jsxs)(`span`,{className:`truncate`,children:[ag(e.updatedAt,l),e.model?` · ${e.model}`:``,` · ${lg(e.projectDir??e.cwd)}`]}),(0,W.jsx)(FF,{link:n})]})]})]}),(0,W.jsx)(Y,{label:`Chat actions`,className:`pointer-events-none absolute right-1 bg-surface/90 p-1 opacity-0 group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100`,"data-testid":`${c}-menu-${e.id}`,onClick:e=>{e.stopPropagation(),d(e)},children:(0,W.jsx)(q.More,{className:`w-3.5 h-3.5`})}),m===null?null:(0,W.jsx)(PF,{session:e,anchor:m})]})});function LF({session:e,link:t,pinned:n,actions:r,onSync:i,onRename:a,onDelete:o}){let s=[];return t?.status===`ours-behind`&&s.push({key:`sync`,label:`Sync with ${t.agentName}…`,hint:`behind`,icon:(0,W.jsx)(q.Download,{className:`w-3.5 h-3.5`}),onSelect:i,testId:`session-menu-sync`}),s.push({key:`pin`,label:n?`Unpin`:`Pin to top`,icon:(0,W.jsx)(q.Pin,{className:`w-3.5 h-3.5`}),separated:s.length>0,onSelect:()=>r.setPinned(`chat`,e.id,!n),testId:`session-menu-pin`},{key:`project`,label:`Move to Project`,icon:(0,W.jsx)(q.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openAssignProject(e.id),testId:`session-menu-project`},...e.projectId?[{key:`project-settings`,label:`Project settings…`,icon:(0,W.jsx)(q.Settings,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openProjectSettings(e.projectId),testId:`session-menu-project-settings`}]:[],{key:`folder`,label:`Change folder…`,icon:(0,W.jsx)(q.Folder,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.openDialog(`project`)},testId:`session-menu-folder`},{key:`details`,label:`Details`,icon:(0,W.jsx)(q.Info,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.savePrefs({sessionPanelOpen:!0})},testId:`session-menu-details`},{key:`listen`,label:`Listen to this chat…`,icon:(0,W.jsx)(q.Speaker,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openVoiceSummary(e.id),testId:`session-menu-listen`},{key:`files`,label:`Files`,icon:(0,W.jsx)(q.File,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.savePrefs({explorerOpen:!0})},testId:`session-menu-files`},{key:`rename`,label:`Rename…`,icon:(0,W.jsx)(q.Edit,{className:`w-3.5 h-3.5`}),onSelect:a,testId:`session-menu-rename`},{key:`fork`,label:`Fork`,icon:(0,W.jsx)(q.Fork,{className:`w-3.5 h-3.5`}),onSelect:()=>void r.forkSession(e.id),testId:`session-menu-fork`},{key:`delete`,label:`Delete`,icon:(0,W.jsx)(q.Trash,{className:`w-3.5 h-3.5`}),danger:!0,separated:!0,onSelect:o,testId:`session-menu-delete`}),s}function RF(){let{state:e,actions:t}=G(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=(0,v.useCallback)((e,t,n)=>r({session:e,at:t,el:n}),[]),d=(0,v.useCallback)(()=>r(null),[]),f=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(nx,{open:n!==null,at:n?.at??{x:0,y:0},anchorEl:n?.el??null,label:`Chat actions`,onClose:d,items:n?LF({session:n.session,link:e.sessionLinks[n.session.id]??null,pinned:Xc(e.prefs.pinned,`chat`,n.session.id),actions:t,onSync:()=>a(n.session),onRename:()=>s(n.session),onDelete:()=>l(n.session)}):[]}),(0,W.jsx)(OF,{sessionId:i?.id??null,sessionTitle:i?pg(i):``,onClose:()=>a(null)}),(0,W.jsx)(Xy,{open:c!==null,title:`Delete this chat?`,message:`It is deleted from this PC — the only place it is kept — so it is gone from every device. Your files, folder and code are not touched — only the chat is deleted.`,onConfirm:()=>{c&&t.deleteSession(c.id)},onClose:()=>l(null)}),(0,W.jsx)(Zy,{open:o!==null,title:`Rename chat`,label:`Session title`,initialValue:o?pg(o):``,onSubmit:e=>{o&&e!==pg(o)&&t.renameSession(o.id,e)},onClose:()=>s(null)})]});return{openMenu:u,menuFor:n?.session.id??null,element:f}}function zF({projectId:e,pinned:t,fold:n,actions:r}){let i=[];return e?i.push({key:`open`,label:`Open project`,icon:(0,W.jsx)(q.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openPage({kind:`project`,projectId:e}),testId:`project-menu-open`},{key:`settings`,label:`Project settings…`,icon:(0,W.jsx)(q.Settings,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openProjectSettings(e),testId:`project-menu-settings`},{key:`new-chat`,label:`New chat in this project`,icon:(0,W.jsx)(q.Plus,{className:`w-3.5 h-3.5`}),onSelect:()=>r.newTab({projectId:e}),testId:`project-menu-new-chat`},{key:`pin`,label:t?`Unpin`:`Pin to top`,icon:(0,W.jsx)(q.Pin,{className:`w-3.5 h-3.5`}),onSelect:()=>r.setPinned(`project`,e,!t),testId:`project-menu-pin`}):i.push({key:`new-project`,label:`New project…`,icon:(0,W.jsx)(q.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openNewProject(),testId:`project-menu-new-project`}),n&&i.push({key:`fold`,label:n.collapsed?`Expand`:`Collapse`,icon:(0,W.jsx)(q.Chevron,{open:n.collapsed,className:`w-3.5 h-3.5`}),separated:!0,onSelect:n.onToggle,testId:`project-menu-fold`}),i}var BF=[{value:`activity`,label:`Recent activity`},{value:`name`,label:`Name`},{value:`created`,label:`Date created`}];function VF(e){let t=e.goal?.trim()??``;return t===``?(e.instructions??``).split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``:t}function HF(e,t){let n=new Map;for(let e of t){if(!e.projectId)continue;let t=n.get(e.projectId);t?t.push(e):n.set(e.projectId,[e])}return e.map(e=>{let t=n.get(e.id)??[],r=t.reduce((e,t)=>Math.max(e,t.mtime),-1/0),i=Date.parse(e.updatedAt);return{project:e,description:VF(e),chatCount:e.sessionCount??t.length,working:t.filter(e=>e.status===`running`||e.status===`waiting_permission`).length,lastActivity:Number.isFinite(r)?r:Number.isFinite(i)?i:0}})}function UF(e,t){let n=t.trim().toLowerCase();return n===``?e.slice():e.filter(({project:e})=>[e.name,e.goal??``,e.instructions??``].some(e=>e.toLowerCase().includes(n)))}var WF=(e,t)=>e.project.name.localeCompare(t.project.name,void 0,{sensitivity:`base`});function GF(e,t){let n=e.slice();return t===`name`?n.sort(WF):t===`created`?n.sort((e,t)=>(Date.parse(t.project.createdAt)||0)-(Date.parse(e.project.createdAt)||0)||WF(e,t)):n.sort((e,t)=>t.lastActivity-e.lastActivity||WF(e,t))}function KF(){let{state:e,actions:t}=G(),n=e.scheduledTasksVersion,[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=!0;return t.listScheduledTasks({}).then(t=>{e&&i(t)}),()=>{e=!1}},[t,n,a]),{tasks:r,reload:(0,v.useCallback)(()=>o(e=>e+1),[])}}function qF(){let[e,t]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}function JF(e){return e===1?`1 chat`:`${e} chats`}function YF({card:e,pinned:t,actions:n,onDelete:r}){let i=e.chatCount;return[...zF({projectId:e.project.id,pinned:t,fold:null,actions:n}),{key:`delete`,label:`Delete project`,icon:(0,W.jsx)(q.Trash,{className:`w-3.5 h-3.5`}),danger:!0,separated:!0,disabled:i>0,...i>0?{hint:`${JF(i)} in it`}:{},onSelect:r,testId:`project-card-delete`}]}function XF(){let{state:e,actions:t}=G(),n=qF(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(`activity`),[l,u]=(0,v.useState)(null),d=(0,v.useCallback)(()=>u(null),[]),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(()=>p(null),[]),[h,g]=(0,v.useState)(null),_=(0,v.useRef)(null),y=(0,v.useMemo)(()=>HF(e.vaultProjects,e.sessions),[e.vaultProjects,e.sessions]),b=(0,v.useMemo)(()=>GF(UF(y,r),s),[y,r,s]),x=e=>t.openPage({kind:`project`,projectId:e}),S=(e,t,n)=>p({card:e,at:t,el:n});return(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`projects-page`,children:[(0,W.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl px-4 py-6 sm:px-8`,children:[(0,W.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`h1`,{className:`mr-auto text-2xl font-semibold text-fg`,children:`Projects`}),a||r!==``?(0,W.jsx)(`input`,{ref:_,autoFocus:!0,"aria-label":`Search projects`,className:U(X,`w-56`),placeholder:`Search projects`,value:r,onChange:e=>i(e.target.value),onBlur:()=>{r===``&&o(!1)},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i(``),o(!1))},"data-testid":`projects-search`}):null,(0,W.jsx)(Y,{label:`Search projects — by name, goal and instructions`,onClick:()=>{o(!0),_.current?.focus()},"data-testid":`projects-search-toggle`,children:(0,W.jsx)(q.Search,{})}),(0,W.jsx)(Y,{label:`Sort — ${BF.find(e=>e.value===s)?.label??``}`,"aria-haspopup":`menu`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();u({at:{x:t.left,y:t.bottom+2},el:e.currentTarget})},"data-testid":`projects-sort`,children:(0,W.jsx)(q.Sliders,{})}),(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>t.openNewProject(),"data-testid":`projects-new`,children:[(0,W.jsx)(q.Plus,{className:`w-3.5 h-3.5`}),`New project`]})]}),e.vaultProjects.length===0?(0,W.jsx)(Yy,{icon:(0,W.jsx)(q.Project,{className:`h-8 w-8`}),title:`No projects yet`,hint:`A project groups chats, whatever folders they run in, and gives every chat in it the same standing instructions, goal and memory. Projects live in your vault, so they follow you to every PC.`,action:(0,W.jsxs)(J,{variant:`primary`,onClick:()=>t.openNewProject(),children:[(0,W.jsx)(q.Plus,{className:`w-3.5 h-3.5`}),`New project`]})}):b.length===0?(0,W.jsxs)(`p`,{className:`py-10 text-center text-sm text-fg-muted`,"data-testid":`projects-no-match`,children:[`No project matches “`,r.trim(),`”.`]}):(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3`,"data-testid":`projects-grid`,children:b.map(t=>(0,W.jsx)(ZF,{card:t,clock:n,pinned:Xc(e.prefs.pinned,`project`,t.project.id),onOpen:x,onMenu:S},t.project.id))})]}),(0,W.jsx)(nx,{open:l!==null,at:l?.at??{x:0,y:0},anchorEl:l?.el??null,label:`Sort projects`,testId:`projects-sort-menu`,onClose:d,items:BF.map(e=>({key:e.value,label:e.label,icon:e.value===s?(0,W.jsx)(q.Check,{className:`w-3.5 h-3.5 text-accent`}):(0,W.jsx)(`span`,{className:`w-3.5`}),onSelect:()=>c(e.value),testId:`projects-sort-${e.value}`}))}),(0,W.jsx)(nx,{open:f!==null,at:f?.at??{x:0,y:0},anchorEl:f?.el??null,label:`Project actions`,testId:`project-card-menu`,onClose:m,items:f?YF({card:f.card,pinned:Xc(e.prefs.pinned,`project`,f.card.project.id),actions:t,onDelete:()=>g(f.card.project)}):[]}),(0,W.jsx)(Xy,{open:h!==null,title:h?`Delete ${h.name}?`:`Delete this project?`,message:`Its instructions, goal, memory and settings are removed from your vault, on every device. No chat is filed under it, so no chat changes.`,onConfirm:()=>{h&&t.deleteVaultProject(h.id)},onClose:()=>g(null)})]})}function ZF({card:e,clock:t,pinned:n,onOpen:r,onMenu:i}){let{project:a}=e,o=(0,v.useRef)(null);return(0,W.jsxs)(`div`,{ref:o,className:`group relative rounded-xl border border-border bg-surface transition-colors hover:border-fg-faint hover:bg-surface-2/40`,"data-testid":`project-card-${a.id}`,onContextMenu:t=>{t.preventDefault(),o.current&&i(e,{x:t.clientX,y:t.clientY},o.current)},children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex h-full min-h-[7.5rem] w-full flex-col items-start gap-1 p-4 text-left`,onClick:()=>r(a.id),"data-testid":`project-card-open-${a.id}`,children:[(0,W.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-2 pr-7`,children:[(0,W.jsx)(q.Project,{className:`w-4 h-4 shrink-0 text-project`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate text-[15px] font-medium text-fg`,children:a.name}),n?(0,W.jsx)(q.Pin,{className:`w-3 h-3 shrink-0 text-fg-faint`,title:`Pinned to the top of the session list`}):null]}),e.description?(0,W.jsx)(`span`,{className:`line-clamp-2 text-sm text-fg-muted`,"data-testid":`project-card-description`,children:e.description}):null,(0,W.jsxs)(`span`,{className:`mt-auto flex items-center gap-1.5 pt-2 text-xs text-fg-faint`,children:[e.working>0?(0,W.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-accent animate-pulse`,title:`${e.working} working now`,"aria-hidden":!0}):null,(0,W.jsxs)(`span`,{"data-testid":`project-card-meta`,children:[JF(e.chatCount),e.lastActivity>0?` · ${og(e.lastActivity,t)}`:``]})]})]}),(0,W.jsx)(Y,{label:`Actions for ${a.name}`,className:`absolute right-2 top-2 p-1 opacity-60 group-hover:opacity-100 focus:opacity-100`,onClick:t=>{let n=t.currentTarget.getBoundingClientRect();o.current&&i(e,{x:n.left,y:n.bottom+2},o.current)},"data-testid":`project-card-menu-${a.id}`,children:(0,W.jsx)(q.More,{className:`w-4 h-4`})})]})}function QF({projectId:e}){let{state:t,actions:n}=G(),r=qF(),i=RF(),a=t.vaultProjects.find(t=>t.id===e)??null,o=(0,v.useMemo)(()=>t.sessions.filter(n=>n.projectId===e&&!t.remote.tabs[n.id]).sort((e,t)=>t.mtime-e.mtime),[t.sessions,t.remote.tabs,e]),s=(0,v.useCallback)(e=>n.selectSession(e),[n]),c=()=>n.openPage({kind:`projects`});if(!a)return(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`project-page`,children:(0,W.jsx)(Yy,{icon:(0,W.jsx)(q.Project,{className:`h-8 w-8`}),title:`This project is not here`,hint:`It was deleted, or your vault has not loaded it yet.`,action:(0,W.jsx)(J,{onClick:c,"data-testid":`project-page-back`,children:`All projects`})})});let l=Xc(t.prefs.pinned,`project`,a.id),u=a.instructions.trim(),d=a.repositories??[],f=a.sessionCount??o.length;return(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`project-page`,children:[(0,W.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-6 sm:px-8`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`mb-3 inline-flex items-center gap-1 text-xs text-fg-muted hover:text-fg`,onClick:c,"data-testid":`project-page-back`,children:[(0,W.jsx)(q.Chevron,{className:`w-3 h-3 rotate-180`}),`All projects`]}),(0,W.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(q.Project,{className:`w-5 h-5 shrink-0 text-project`}),(0,W.jsx)(`h1`,{className:`mr-auto min-w-0 truncate text-2xl font-semibold text-fg`,"data-testid":`project-page-name`,children:a.name}),(0,W.jsx)(Y,{label:l?`Unpin from the session list`:`Pin to the top of the session list`,"aria-pressed":l,className:l?`text-accent`:void 0,onClick:()=>n.setPinned(`project`,a.id,!l),"data-testid":`project-page-pin`,children:(0,W.jsx)(q.Pin,{})}),(0,W.jsxs)(J,{variant:`ghost`,onClick:()=>n.openProjectSettings(a.id),"data-testid":`project-page-settings`,children:[(0,W.jsx)(q.Settings,{className:`w-3.5 h-3.5`}),`Project settings`]}),(0,W.jsxs)(J,{variant:`inverse`,onClick:()=>n.newTab({projectId:a.id}),"data-testid":`project-page-new-chat`,children:[(0,W.jsx)(q.Plus,{className:`w-3.5 h-3.5`}),`New chat in this project`]})]}),a.goal?.trim()?(0,W.jsx)(`p`,{className:`mb-4 text-sm text-fg-muted`,"data-testid":`project-page-goal`,children:a.goal.trim()}):null,(0,W.jsxs)(`section`,{className:`mb-5 rounded-xl border border-border bg-surface p-4`,children:[(0,W.jsx)(`h2`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:`Instructions`}),u?(0,W.jsx)(`div`,{className:`max-h-64 overflow-y-auto whitespace-pre-wrap break-words text-sm text-fg`,"data-testid":`project-page-instructions`,children:u}):(0,W.jsx)(`p`,{className:`text-sm text-fg-faint`,children:`None — chats here start with nothing extra.`}),d.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:`mb-1 mt-4 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:`Repositories`}),(0,W.jsx)(`ul`,{className:`space-y-0.5 text-sm`,"data-testid":`project-page-repositories`,children:d.map(e=>(0,W.jsx)(`li`,{className:`truncate font-mono text-xs text-fg-muted`,children:e},e))})]}):null]}),(0,W.jsxs)(`section`,{children:[(0,W.jsxs)(`h2`,{className:`mb-1 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:[`Chats`,(0,W.jsx)(`span`,{className:`font-normal normal-case`,"data-testid":`project-page-count`,children:f})]}),o.length===0?(0,W.jsx)(`p`,{className:`py-3 text-sm text-fg-faint`,"data-testid":`project-page-no-chats`,children:f>0?`${JF(f)} filed here are older than the list this window holds.`:`No chats in this project yet — start one with “New chat in this project”.`}):(0,W.jsx)(`div`,{className:`rounded-xl border border-border bg-surface p-1`,"data-testid":`project-page-chats`,children:o.map(e=>(0,W.jsx)(IF,{session:e,active:!1,link:t.sessionLinks[e.id]??null,menuOpen:i.menuFor===e.id,onOpen:s,onMenu:i.openMenu,clock:r,testIdPrefix:`project-chat`},e.id))}),f>0&&o.length>0&&f>o.length?(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-fg-faint`,children:[f-o.length,` older `,f-o.length===1?`chat is`:`chats are`,` `,`not in the list this window holds — search for`,` `,f-o.length===1?`it`:`them`,` in the session list.`]}):null]})]}),i.element]})}var $F=`waiting: the chat is busy`;function eI(e){return e.enabled&&typeof e.lastResult==`string`&&e.lastResult.startsWith(`waiting:`)&&e.lastResult!==$F}function tI(e,t){if(!e.enabled||!e.nextRunAt)return!1;let n=Date.parse(e.nextRunAt);return Number.isFinite(n)&&n-t<=36e5}function nI(e,t){let n=e=>e===1?`1 scheduled task`:`${e} scheduled tasks`,r=e.filter(eI).length;if(r>0)return{tone:`stuck`,count:r,text:`${n(r)} could not run — open Scheduled to see why`};let i=e.filter(e=>tI(e,t)).length;return i>0?{tone:`soon`,count:i,text:`${n(i)} due within the hour`}:null}function rI(e){return e.split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``}function iI(){let{state:e,actions:t}=G(),{tasks:n,reload:r}=KF(),i=qF(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=(0,v.useMemo)(()=>{let t=new Map(e.sessions.map(e=>[e.id,pg(e)]));for(let[n,r]of Object.entries(e.pinnedRows))t.has(n)||t.set(n,pg(r));return e=>t.get(e)??null},[e.sessions,e.pinnedRows]),u=async(e,t)=>{c(e.id);try{await t()&&r()}finally{c(null)}},d=n?.filter(e=>Pe(e)).length??0;return(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`scheduled-page`,children:(0,W.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-6 sm:px-8`,children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,W.jsx)(q.Clock,{className:`w-5 h-5 shrink-0 text-fg-muted`}),(0,W.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:`Scheduled`})]}),(0,W.jsxs)(`p`,{className:`mb-5 text-sm text-fg-muted`,children:[`What OonaCode's scheduler sends into your chats on this PC — once, or on a repeat — even when the chat has gone quiet.`,n&&n.length>0?` ${d} active${n.length>d?`, ${n.length-d} paused or done`:``}.`:``]}),n===null?null:n.length===0?(0,W.jsx)(`div`,{"data-testid":`scheduled-empty`,children:(0,W.jsx)(Yy,{icon:(0,W.jsx)(q.Clock,{className:`h-8 w-8`}),title:`Nothing scheduled`,hint:`Ask a chat to do something later or on a repeat — “remind me at 9 to check the build”, “every morning, summarise the new issues” — and its model schedules it with OonaCode’s scheduler. Every task, from every chat, shows here.`})}):(0,W.jsx)(`ul`,{className:`space-y-2`,"data-testid":`scheduled-list`,children:n.map(e=>{let n=eI(e),r=tI(e,i),c=l(e.sessionId),d=rI(e.prompt),f=Pe(e),p=Fe(e);return(0,W.jsxs)(`li`,{className:U(`rounded-xl border p-3 text-sm`,f?`bg-surface`:`bg-surface-2 opacity-60`,n?`border-warn/60`:`border-border`),"data-testid":`scheduled-row-${e.id}`,"data-active":f?`true`:`false`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,title:e.title,children:e.title}),r&&!n?(0,W.jsx)(`span`,{className:`rounded-full bg-accent-soft px-1.5 text-[11px] text-accent`,children:`due soon`}):null,e.createdBy===`model`?(0,W.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`set by the agent`}):null,(0,W.jsx)(J,{size:`sm`,variant:`ghost`,disabled:s===e.id||!e.enabled&&e.nextRunAt===null&&`at`in e.when,onClick:()=>void u(e,()=>t.updateScheduledTask(e.id,{enabled:!e.enabled})),"data-testid":`scheduled-row-toggle`,children:e.enabled?`Pause`:`Resume`}),(0,W.jsx)(J,{size:`sm`,variant:a===e.id?`danger`:`ghost`,disabled:s===e.id,onClick:()=>{if(a!==e.id){o(e.id);return}o(null),u(e,()=>t.deleteScheduledTask(e.id))},"data-testid":`scheduled-row-delete`,children:a===e.id?`Delete?`:`Delete`})]}),d?(0,W.jsxs)(`div`,{className:`mt-1 truncate text-fg-muted`,title:e.prompt,"data-testid":`scheduled-row-sends`,children:[`Sends: “`,d,`”`]}):null,(0,W.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-fg-muted`,children:[(0,W.jsx)(`span`,{"data-testid":`scheduled-row-when`,children:tf(e.when)}),(0,W.jsx)(`span`,{"data-testid":`scheduled-row-next`,children:nf(e.nextRunAt,e.enabled)}),(0,W.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:[`in`,(0,W.jsx)(`button`,{type:`button`,className:`min-w-0 truncate text-accent hover:underline`,title:`Open this chat`,onClick:()=>t.selectSession(e.sessionId),"data-testid":`scheduled-row-chat`,children:c??`a chat`})]})]}),e.lastRunAt||e.lastResult?(0,W.jsxs)(`div`,{className:U(`mt-0.5 text-xs`,n?`text-warn`:`text-fg-faint`),"data-testid":`scheduled-row-last`,children:[e.lastRunAt?(0,W.jsxs)(`span`,{title:sg(e.lastRunAt),children:[`last ran `,ag(e.lastRunAt,i)]}):(0,W.jsx)(`span`,{children:`not run yet`}),e.lastResult?` · ${e.lastResult}`:``]}):null,f?null:(0,W.jsxs)(`div`,{className:`mt-0.5 text-xs text-fg-faint`,title:`Tasks that are paused or have finished are deleted 10 days after their last change`,"data-testid":`scheduled-row-deletes`,children:[e.nextRunAt===null?`Finished`:`Paused`,p?` — deleted automatically on ${sg(p)}`:``]})]},e.id)})})]})})}var aI=(0,v.memo)(function({text:e,localFiles:t=!1}){let{head:n,tail:r}=hP(e);return(0,W.jsxs)(W.Fragment,{children:[n?(0,W.jsx)(aN,{text:n,localFiles:t}):null,(0,W.jsx)(aN,{text:r,localFiles:t})]})});function oI(e){let t=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=t.current;e&&(e.focus(),e.select())},[e.focusSeq]);let n=t=>{t.key===`Enter`||t.key===`ArrowDown`?(t.preventDefault(),e.onStep(t.key===`Enter`&&t.shiftKey?-1:1)):t.key===`ArrowUp`?(t.preventDefault(),e.onStep(-1)):t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose())},r=e.query.trim()!==``&&e.count===0;return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface px-3 py-1.5`,"data-testid":`chat-search`,role:`search`,children:[(0,W.jsx)(q.Search,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}),(0,W.jsx)(`input`,{ref:t,type:`text`,value:e.query,onChange:t=>e.onQuery(t.target.value),onKeyDown:n,placeholder:`Find in this chat`,"aria-label":`Find in this chat`,spellCheck:!1,className:U(X,`h-7 min-w-0 flex-1 py-0 text-xs`),"data-testid":`chat-search-input`}),(0,W.jsx)(`span`,{className:U(`shrink-0 tabular-nums text-xs`,r?`text-warn`:`text-fg-muted`),"data-testid":`chat-search-count`,children:e.query.trim()===``?``:je(e.index,e.count)}),(0,W.jsx)(Y,{label:`Previous match (Shift+Enter)`,onClick:()=>e.onStep(-1),disabled:e.count===0,"data-testid":`chat-search-prev`,children:(0,W.jsx)(q.ArrowDown,{className:`w-3.5 h-3.5 rotate-180`})}),(0,W.jsx)(Y,{label:`Next match (Enter)`,onClick:()=>e.onStep(1),disabled:e.count===0,"data-testid":`chat-search-next`,children:(0,W.jsx)(q.ArrowDown,{className:`w-3.5 h-3.5`})}),(0,W.jsx)(Y,{label:`Close search (Esc)`,onClick:e.onClose,"data-testid":`chat-search-close`,children:(0,W.jsx)(q.X,{className:`w-3.5 h-3.5`})})]})}var sI=`data-item-id`;function cI(e){return`[${sI}="${e.replace(/["\\]/g,`\\$&`)}"]`}var lI=`oona-search`,uI=`oona-search-current`,dI=2e3;function fI(){let e=globalThis.CSS,t=globalThis.Highlight;return!e?.highlights||typeof t!=`function`?null:{registry:e.highlights,Highlight:t}}function pI(e,t,n,r){let i=fI();if(i===null)return;let a=we(r);if(a===``||t.length===0){mI();return}let o=Ee(a),s=[],c=[],l=dI;for(let r of t){let t=e.querySelector(cI(r.id));if(!t)continue;let i=vI(t,o,l);if(l-=i.length,r.id===n?c.push(...i):s.push(...i),l<=0)break}i.registry.set(lI,new i.Highlight(...s)),i.registry.set(uI,new i.Highlight(...c))}function mI(){let e=fI();e!==null&&(e.registry.delete(lI),e.registry.delete(uI))}function hI(e,t){let n=we(t);return n===``?null:vI(e,Ee(n),1)[0]??null}function gI(e,t){let n=e.startContainer instanceof Element?e.startContainer:e.startContainer.parentElement;for(;n;){if(n instanceof HTMLElement&&_I(n)){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();n.scrollTop+=t.top-r.top-(n.clientHeight-t.height)/2}if(n===t)break;n=n.parentElement}}function _I(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`}function vI(e,t,n){let r=e.ownerDocument;if(!r||n<=0)return[];let i=[],a=r.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e=a.nextNode();e!==null;e=a.nextNode()){let a=e.data;t.lastIndex=0;for(let o of a.matchAll(t)){if(o[0].length===0)continue;let t=r.createRange();if(t.setStart(e,o.index??0),t.setEnd(e,(o.index??0)+o[0].length),i.push(t),i.length>=n)return i}}return i}function yI(e,t){switch(e.kind){case`user`:return e.text;case`assistant`:return e.text;case`thinking`:return t?e.text:``;case`tool`:return[e.name,CP(e.name,e.input)??``,bI(e.result)].filter(e=>e!==``).join(`
package/web-ui/index.html CHANGED
@@ -104,7 +104,7 @@
104
104
  }
105
105
  }
106
106
  </style>
107
- <script type="module" crossorigin src="./assets/index-BYawvRgk.js"></script>
107
+ <script type="module" crossorigin src="./assets/index-DWxQ-VCE.js"></script>
108
108
  <link rel="stylesheet" crossorigin href="./assets/index-CoITpYNf.css">
109
109
  </head>
110
110
  <body>