@oonacode/win32-x64 0.3.149 → 0.3.150
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:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 110858240 bytes
|
|
4
|
+
sha256: d60209d8250dee9657637ae802cf4094207e319380de5a996112e85156d13769
|
package/oonacode-release.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oonacode",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.150",
|
|
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": "
|
|
10
|
-
"builtAt": "2026-09-25T12:
|
|
9
|
+
"commit": "1db50d3a",
|
|
10
|
+
"builtAt": "2026-09-25T12:47:03.0972160Z",
|
|
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.
|
|
3
|
+
"version": "0.3.150",
|
|
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 na(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:aa(t,`input`,e.processors),output:aa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ra(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 ra(r.element,n);if(r.type===`set`)return ra(r.valueType,n);if(r.type===`lazy`)return ra(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 ra(r.innerType,n);if(r.type===`intersection`)return ra(r.left,n)||ra(r.right,n);if(r.type===`record`||r.type===`map`)return ra(r.keyType,n)||ra(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ra(r.in,n)||ra(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ra(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ra(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ra(e,n))return!0;return!!(r.rest&&ra(r.rest,n))}return!1}var ia=(e,t={})=>n=>{let r=$i({...n,processors:t});return ea(e,r),ta(r,e),na(r,e)},aa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$i({...i??{},target:a,io:t,processors:n});return ea(e,o),ta(o,e),na(o,e)},oa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},sa=(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=oa[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}))])}},ca=(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)},la=(e,t,n,r)=>{n.type=`boolean`},ua=(e,t,n,r)=>{n.not={}},da=(e,t,n,r)=>{let i=e._zod.def,a=Le(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},fa=(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}},pa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ma=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ha=(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=ea(a.element,t,{...r,path:[...r.path,`items`]})},ga=(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]=ea(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=ea(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},_a=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ea(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},va=(e,t,n,r)=>{let i=e._zod.def,a=ea(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ea(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]]},ya=(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=ea(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=ea(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ea(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)}},ba=(e,t,n,r)=>{let i=e._zod.def,a=ea(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`}]},xa=(e,t,n,r)=>{let i=e._zod.def;ea(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sa=(e,t,n,r)=>{let i=e._zod.def;ea(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ca=(e,t,n,r)=>{let i=e._zod.def;ea(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)))},wa=(e,t,n,r)=>{let i=e._zod.def;ea(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},Ta=(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;ea(o,t,r);let s=t.seen.get(e);s.ref=o},Ea=(e,t,n,r)=>{let i=e._zod.def;ea(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Da=(e,t,n,r)=>{let i=e._zod.def;ea(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Oa=I(`ZodISODateTime`,(e,t)=>{Yn.init(e,t),eo.init(e,t)});function ka(e){return xi(Oa,e)}var Aa=I(`ZodISODate`,(e,t)=>{Xn.init(e,t),eo.init(e,t)});function ja(e){return Si(Aa,e)}var Ma=I(`ZodISOTime`,(e,t)=>{Zn.init(e,t),eo.init(e,t)});function Na(e){return Ci(Ma,e)}var Pa=I(`ZodISODuration`,(e,t)=>{Qn.init(e,t),eo.init(e,t)});function Fa(e){return wi(Pa,e)}var Ia=I(`ZodError`,(e,t)=>{bt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ct(e,t)},flatten:{value:t=>St(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Re,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Re,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),La=wt(Ia),Ra=Tt(Ia),za=Et(Ia),Ba=Ot(Ia),Va=At(Ia),Ha=jt(Ia),Ua=Mt(Ia),Wa=Nt(Ia),Ga=Pt(Ia),Ka=Ft(Ia),qa=It(Ia),Ja=Lt(Ia),Ya=new WeakMap;function Xa(e,t,n){let r=Object.getPrototypeOf(e),i=Ya.get(r);if(i||(i=new Set,Ya.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 Za=I(`ZodType`,(e,t)=>(Fn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:aa(e,`input`),output:aa(e,`output`)}}),e.toJSONSchema=ia(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>La(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>za(e,t,n),e.parseAsync=async(t,n)=>Ra(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ba(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Va(e,t,n),e.decode=(t,n)=>Ha(e,t,n),e.encodeAsync=async(t,n)=>Ua(e,t,n),e.decodeAsync=async(t,n)=>Wa(e,t,n),e.safeEncode=(t,n)=>Ga(e,t,n),e.safeDecode=(t,n)=>Ka(e,t,n),e.safeEncodeAsync=async(t,n)=>qa(e,t,n),e.safeDecodeAsync=async(t,n)=>Ja(e,t,n),Xa(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ke(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 nt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fs(e,t))},superRefine(e,t){return this.check(ps(e,t))},overwrite(e){return this.check(Ui(e))},optional(){return Jo(this)},exactOptional(){return Xo(this)},nullable(){return Qo(this)},nullish(){return Jo(Qo(this))},nonoptional(e){return is(this,e)},array(){return jo(this)},or(e){return Po([this,e])},and(e){return Ro(this,e)},transform(e){return cs(this,Ko(e))},default(e){return es(this,e)},prefault(e){return ns(this,e)},catch(e){return os(this,e)},pipe(e){return cs(this,e)},readonly(){return us(this)},describe(e){let t=this.clone();return Zr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Zr.get(this);let t=this.clone();return Zr.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 Zr.get(e)?.description},configurable:!0}),e)),Qa=I(`_ZodString`,(e,t)=>{In.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sa(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Xa(e,`_ZodString`,{regex(...e){return this.check(Li(...e))},includes(...e){return this.check(Bi(...e))},startsWith(...e){return this.check(Vi(...e))},endsWith(...e){return this.check(Hi(...e))},min(...e){return this.check(R(...e))},max(...e){return this.check(Fi(...e))},length(...e){return this.check(Ii(...e))},nonempty(...e){return this.check(R(1,...e))},lowercase(e){return this.check(Ri(e))},uppercase(e){return this.check(zi(e))},trim(){return this.check(Gi())},normalize(...e){return this.check(Wi(...e))},toLowerCase(){return this.check(Ki())},toUpperCase(){return this.check(qi())},slugify(){return this.check(Ji())}})}),$a=I(`ZodString`,(e,t)=>{In.init(e,t),Qa.init(e,t),e.email=t=>e.check($r(to,t)),e.url=t=>e.check(ai(io,t)),e.jwt=t=>e.check(bi(yo,t)),e.emoji=t=>e.check(oi(ao,t)),e.guid=t=>e.check(ei(no,t)),e.uuid=t=>e.check(ti(ro,t)),e.uuidv4=t=>e.check(ni(ro,t)),e.uuidv6=t=>e.check(ri(ro,t)),e.uuidv7=t=>e.check(ii(ro,t)),e.nanoid=t=>e.check(si(oo,t)),e.guid=t=>e.check(ei(no,t)),e.cuid=t=>e.check(ci(so,t)),e.cuid2=t=>e.check(li(co,t)),e.ulid=t=>e.check(ui(lo,t)),e.base64=t=>e.check(_i(go,t)),e.base64url=t=>e.check(vi(_o,t)),e.xid=t=>e.check(di(uo,t)),e.ksuid=t=>e.check(fi(fo,t)),e.ipv4=t=>e.check(pi(po,t)),e.ipv6=t=>e.check(mi(B,t)),e.cidrv4=t=>e.check(hi(mo,t)),e.cidrv6=t=>e.check(gi(ho,t)),e.e164=t=>e.check(yi(vo,t)),e.datetime=t=>e.check(ka(t)),e.date=t=>e.check(ja(t)),e.time=t=>e.check(Na(t)),e.duration=t=>e.check(Fa(t))});function z(e){return Qr($a,e)}var eo=I(`ZodStringFormat`,(e,t)=>{Ln.init(e,t),Qa.init(e,t)}),to=I(`ZodEmail`,(e,t)=>{Bn.init(e,t),eo.init(e,t)}),no=I(`ZodGUID`,(e,t)=>{Rn.init(e,t),eo.init(e,t)}),ro=I(`ZodUUID`,(e,t)=>{zn.init(e,t),eo.init(e,t)}),io=I(`ZodURL`,(e,t)=>{Vn.init(e,t),eo.init(e,t)}),ao=I(`ZodEmoji`,(e,t)=>{Hn.init(e,t),eo.init(e,t)}),oo=I(`ZodNanoID`,(e,t)=>{Un.init(e,t),eo.init(e,t)}),so=I(`ZodCUID`,(e,t)=>{Wn.init(e,t),eo.init(e,t)}),co=I(`ZodCUID2`,(e,t)=>{Gn.init(e,t),eo.init(e,t)}),lo=I(`ZodULID`,(e,t)=>{Kn.init(e,t),eo.init(e,t)}),uo=I(`ZodXID`,(e,t)=>{qn.init(e,t),eo.init(e,t)}),fo=I(`ZodKSUID`,(e,t)=>{Jn.init(e,t),eo.init(e,t)}),po=I(`ZodIPv4`,(e,t)=>{$n.init(e,t),eo.init(e,t)}),B=I(`ZodIPv6`,(e,t)=>{er.init(e,t),eo.init(e,t)}),mo=I(`ZodCIDRv4`,(e,t)=>{tr.init(e,t),eo.init(e,t)}),ho=I(`ZodCIDRv6`,(e,t)=>{nr.init(e,t),eo.init(e,t)}),go=I(`ZodBase64`,(e,t)=>{ir.init(e,t),eo.init(e,t)}),_o=I(`ZodBase64URL`,(e,t)=>{or.init(e,t),eo.init(e,t)}),vo=I(`ZodE164`,(e,t)=>{sr.init(e,t),eo.init(e,t)}),yo=I(`ZodJWT`,(e,t)=>{lr.init(e,t),eo.init(e,t)}),bo=I(`ZodNumber`,(e,t)=>{ur.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r),Xa(e,`ZodNumber`,{gt(e,t){return this.check(Mi(e,t))},gte(e,t){return this.check(Ni(e,t))},min(e,t){return this.check(Ni(e,t))},lt(e,t){return this.check(Ai(e,t))},lte(e,t){return this.check(ji(e,t))},max(e,t){return this.check(ji(e,t))},int(e){return this.check(Co(e))},safe(e){return this.check(Co(e))},positive(e){return this.check(Mi(0,e))},nonnegative(e){return this.check(Ni(0,e))},negative(e){return this.check(Ai(0,e))},nonpositive(e){return this.check(ji(0,e))},multipleOf(e,t){return this.check(Pi(e,t))},step(e,t){return this.check(Pi(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 xo(e){return Ti(bo,e)}var So=I(`ZodNumberFormat`,(e,t)=>{dr.init(e,t),bo.init(e,t)});function Co(e){return Ei(So,e)}var wo=I(`ZodBoolean`,(e,t)=>{fr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r)});function To(e){return Di(wo,e)}var Eo=I(`ZodUnknown`,(e,t)=>{pr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Do(){return Oi(Eo)}var Oo=I(`ZodNever`,(e,t)=>{mr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ua(e,t,n,r)});function ko(e){return ki(Oo,e)}var Ao=I(`ZodArray`,(e,t)=>{gr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r),e.element=t.element,Xa(e,`ZodArray`,{min(e,t){return this.check(R(e,t))},nonempty(e){return this.check(R(1,e))},max(e,t){return this.check(Fi(e,t))},length(e,t){return this.check(Ii(e,t))},unwrap(){return this.element}})});function jo(e,t){return Yi(Ao,e,t)}var Mo=I(`ZodObject`,(e,t)=>{xr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),We(e,`shape`,()=>t.shape),Xa(e,`ZodObject`,{keyof(){return Ho(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Do()})},loose(){return this.clone({...this._zod.def,catchall:Do()})},strict(){return this.clone({...this._zod.def,catchall:ko()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return st(this,e)},safeExtend(e){return ct(this,e)},merge(e){return lt(this,e)},pick(e){return at(this,e)},omit(e){return ot(this,e)},partial(...e){return ut(qo,this,e[0])},required(...e){return dt(rs,this,e[0])}})});function V(e,t){return new Mo({type:`object`,shape:e??{},...L(t)})}var No=I(`ZodUnion`,(e,t)=>{Cr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r),e.options=t.options});function Po(e,t){return new No({type:`union`,options:e,...L(t)})}var Fo=I(`ZodDiscriminatedUnion`,(e,t)=>{No.init(e,t),wr.init(e,t)});function Io(e,t,n){return new Fo({type:`union`,options:t,discriminator:e,...L(n)})}var Lo=I(`ZodIntersection`,(e,t)=>{Tr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r)});function Ro(e,t){return new Lo({type:`intersection`,left:e,right:t})}var zo=I(`ZodRecord`,(e,t)=>{Or.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Bo(e,t,n){return!t||!t._zod?new zo({type:`record`,keyType:z(),valueType:e,...L(t)}):new zo({type:`record`,keyType:e,valueType:t,...L(n)})}var Vo=I(`ZodEnum`,(e,t)=>{kr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>da(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 Vo({...t,checks:[],...L(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 Vo({...t,checks:[],...L(r),entries:i})}});function Ho(e,t){return new Vo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var Uo=I(`ZodLiteral`,(e,t)=>{Ar.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fa(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 Wo(e,t){return new Uo({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}var Go=I(`ZodTransform`,(e,t)=>{jr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ma(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Pe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(vt(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(vt(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 Ko(e){return new Go({type:`transform`,transform:e})}var qo=I(`ZodOptional`,(e,t)=>{Nr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jo(e){return new qo({type:`optional`,innerType:e})}var Yo=I(`ZodExactOptional`,(e,t)=>{Pr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xo(e){return new Yo({type:`optional`,innerType:e})}var Zo=I(`ZodNullable`,(e,t)=>{Fr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qo(e){return new Zo({type:`nullable`,innerType:e})}var $o=I(`ZodDefault`,(e,t)=>{Ir.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function es(e,t){return new $o({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():$e(t)}})}var ts=I(`ZodPrefault`,(e,t)=>{Rr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ns(e,t){return new ts({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():$e(t)}})}var rs=I(`ZodNonOptional`,(e,t)=>{zr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function is(e,t){return new rs({type:`nonoptional`,innerType:e,...L(t)})}var as=I(`ZodCatch`,(e,t)=>{Vr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function os(e,t){return new as({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var ss=I(`ZodPipe`,(e,t)=>{Hr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ta(e,t,n,r),e.in=t.in,e.out=t.out});function cs(e,t){return new ss({type:`pipe`,in:e,out:t})}var ls=I(`ZodReadonly`,(e,t)=>{Wr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function us(e){return new ls({type:`readonly`,innerType:e})}var ds=I(`ZodCustom`,(e,t)=>{Kr.init(e,t),Za.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pa(e,t,n,r)});function fs(e,t={}){return Xi(ds,e,t)}function ps(e,t){return Zi(e,t)}var ms={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 hs(e){return(e.credentialVariants??[]).filter(e=>!e.operatorOnly)}function gs(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 _s(e,t){return e.filter(e=>e.definition.id===t||e.definition.clientGroup===t&&e.definition.id!==t)}function vs(e){return gs(e).filter(e=>e.definition.enabled&&e.definition.credentialClass!==`none`&&T(e.definition.id)&&!D(e.definition.id))}function ys(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 bs(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.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}:ys(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 xs=Io(`type`,[V({type:Wo(`oauth-device`),deviceAuthorizationUrl:z().url(),tokenUrl:z().url(),clientId:z().min(1),scopes:jo(z().min(1)).min(1),signInLabel:z().min(1).optional(),referrer:z().min(1).optional()}),V({type:Wo(`openai-device`),deviceAuthorizationUrl:z().url(),pollUrl:z().url(),tokenUrl:z().url(),verificationUri:z().url(),redirectUri:z().url(),clientId:z().min(1),signInLabel:z().min(1).optional()})]),Ss=V({id:z().min(1),displayName:z().min(1),upstreamId:z().min(1).optional(),servedBy:jo(z().min(1)).optional(),subscriptionServedBy:jo(z().min(1)).optional(),contextWindow:xo().int().positive().optional(),maxOutputTokens:xo().int().positive().optional(),supportsTools:To().optional(),supportsThinking:To().optional(),effortLevels:jo(Ho(he)).optional(),helperModel:z().min(1).optional(),supportsVision:To().optional(),inputPricePerM:xo().nonnegative().optional(),outputPricePerM:xo().nonnegative().optional(),notes:z().optional(),free:To().optional(),aaIntelligence:xo().optional(),aaCoding:xo().optional(),aaOutputTps:xo().optional(),aaTtft:xo().optional(),aa:V({fetchedAt:z(),creator:z().optional(),releaseDate:z().optional(),benchmarks:Bo(z(),xo()).optional()}).loose().optional()}).loose(),Cs=V({id:z().regex(/^[a-z0-9][a-z0-9-]{1,40}$/,`provider id must be lowercase kebab-case`),displayName:z().min(1),kind:Ho([`anthropic-passthrough`,`openai-compatible`,`gemini`]),route:Ho([`gateway`,`direct`]),credentialClass:Ho([`api_key`,`subscription`,`none`]),baseUrl:z().url(),messagesPath:z().startsWith(`/`).optional(),modelsPath:z().startsWith(`/`).optional(),auth:V({header:Ho([`x-api-key`,`authorization-bearer`,`api-key`,`none`]),extraHeaders:Bo(z(),z()).optional()}),models:jo(Ss),defaultModel:z().min(1),modelAliases:Bo(z(),z()).optional(),helperModel:z().min(1).optional(),capabilities:V({streaming:To(),tools:To(),thinking:To(),vision:To(),countTokens:To(),promptCaching:To(),promptCacheTtlSec:xo().int().positive().optional()}),translate:V({maxTokensParam:Ho([`max_tokens`,`max_completion_tokens`]).optional(),reasoningEffortFromBudget:To().optional(),reasoningContentField:z().nullable().optional(),supportsParallelToolCalls:To().optional(),systemRole:Ho([`system`,`developer`]).optional(),streamIncludeUsage:To().optional(),wire:Ho([`chat`,`responses`]).optional()}).optional(),passthrough:V({stripCacheControl:To().optional(),cacheChain:To().optional(),toolSchemaRequiredArray:To().optional(),toolDescriptionRequired:To().optional(),allowedBetas:jo(z()).optional(),anthropicVersion:z().optional()}).optional(),userBaseUrl:To().optional(),engineEnv:Bo(z(),z()).optional(),directCapable:To().optional(),subscriptionLogin:xs.optional(),phase:Po([Wo(1),Wo(2)]),enabled:To(),docsUrl:z().url().optional(),notes:z().optional(),references:jo(V({label:z().min(1),url:z().url(),kind:Ho([`docs`,`pricing`,`models`,`console`,`status`,`keys`,`signup`,`other`]).optional()})).optional(),keyFormat:z().optional(),credentialVariants:jo(V({id:z().min(1),label:z().min(1),header:Ho([`x-api-key`,`authorization-bearer`,`api-key`,`none`]).optional(),extraHeaders:Bo(z(),z()).optional(),operatorOnly:To().optional(),requiresClaudeCodeIdentity:To().optional(),subscriptionLogin:xs.optional(),claudeCodeShape:V({betas:z().min(1),userAgent:z().min(1),billingHeader:z().min(1),headers:Bo(z(),z()).optional()}).optional(),baseUrl:z().url().optional(),keyFormat:z().optional(),notes:z().optional()})).optional(),adminGroup:z().optional(),clientGroup:z().optional(),recordLabel:z().optional(),effortLevels:jo(Ho(he)).optional()});V({version:xo().int().positive(),updatedAt:z(),providers:jo(Cs)});function ws(e,t){return Ts(e,As(e,t))}function Ts(e,t){return e.models.find(e=>e.id===t)?.upstreamId??t}function Es(e){return/^claude-/i.test(e)}function Ds(e){return e.replace(/\[1m\]$/i,``)}function Os(e,t){return{images:e.models.find(e=>e.id===t)?.supportsVision??e.capabilities.vision,documents:Es(t)}}function ks(e,t,n){let r=Os(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 As(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=t.toLowerCase(),i=r.includes(`haiku`)?`haiku`:r.includes(`opus`)?`opus`:r.includes(`sonnet`)?`sonnet`:r.includes(`fable`)?`fable`:null;if(i){if(e.modelAliases?.[i])return e.modelAliases[i];let t=e.models.find(e=>e.id.toLowerCase().includes(i));if(t)return t.id}return e.defaultModel}var js={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`,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}`,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`,historySessions:`/api/me/history/sessions`,historySession:e=>`/api/me/history/sessions/${e}`,historyEntries:e=>`/api/me/history/sessions/${e}/entries`,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`},Ms=2048,Ns=16384,Ps=8e3,Fs=5242880,Is=12582912;new Set(`BCDFGHJKLMNPQRSTVWXZ`.split(``));var Ls=`discard-my-vault-and-history`,Rs=`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.`,zs={name:120,instructions:2e4,goal:2e3,repositories:50,repositoryUrl:500,memory:2e4,minIntervalFloor:1,minIntervalCeiling:10080},Bs=`⏰ Scheduled task "`;function Vs(e){if(!e.startsWith(Bs))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});var Hs=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],Us=/^([01]\d|2[0-3]):[0-5]\d$/;V({tz:z().min(1),windows:jo(V({from:z().regex(Us,`HH:MM`),to:z().regex(Us,`HH:MM`),days:jo(Ho(Hs)).optional(),kind:Ho([`peak`,`offpeak`])})),offpeakDiscount:xo().nonnegative().max(1).optional()});var Ws=[`priceInputCacheMissPeak`,`priceInputCacheMissOffpeak`,`priceInputCacheHitPeak`,`priceInputCacheHitOffpeak`,`priceCacheWritePeak`,`priceCacheWriteOffpeak`,`priceOutputPeak`,`priceOutputOffpeak`],Gs=V({inputCacheMiss:xo().nonnegative(),inputCacheHit:xo().nonnegative().optional(),cacheWrite:xo().nonnegative().optional(),output:xo().nonnegative()});V({by:Wo(`prompt_tokens`),tiers:jo(V({upToPromptTokens:xo().int().positive().optional(),price:Gs,cost:Gs.optional()})).min(1),note:z().optional()}).superRefine((e,t)=>{let n=0;e.tiers.forEach((r,i)=>{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})}),[...Ws];var Ks={oonacode:{hex:`#000000`,owner:`OonaCode`,d:`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`,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:`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`},xai:{hex:`#000000`,owner:`xAI`,d:`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`},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`},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 qs(e){return Ks[e]??null}function Js(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 Ys=[`stable`,`dev`];function Xs(e){return typeof e==`string`&&Ys.includes(e)}function Zs(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return Xs(t)?t:null}function Qs(e){let t=Zs(e)??`stable`;return t===`stable`?js.releasesLatest:`${js.releasesLatest}?channel=${encodeURIComponent(t)}`}function $s(e,t){let n=Zs(t)??`stable`;return n===`stable`?e:`${e} (${n})`}var ec=5e4,tc=[`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`],nc={agentFinished:!1,permissionRequired:!0,errorOccurred:!0},rc={autoAcceptPermissions:!1,showReasoningSummaries:!0,notifications:nc,showAgentPicker:!0,transcriptWindowSize:500,openTabs:[],draftTabs:[],draftTitles:{},activeTab:null,remoteTabs:{},sessionPanelOpen:!1,explorerOpen:!1,sidebarWidth:288,sidebarPinned:!0,dismissedUpdateVersion:null,lastSeenReleaseNotes:null,claudeImportOffered:!1,claudeImportOffers:0,collapsedProjects:[],themeColors:{light:{},dark:{}}};function ic(e){return Math.min(Math.max(typeof e==`number`&&Number.isFinite(e)?Math.floor(e):0,0),3)}function ac(e){return Math.min(640,Math.max(200,typeof e==`number`&&Number.isFinite(e)?Math.round(e):288))}function oc(e){return Math.min(ec,Math.max(100,typeof e==`number`&&Number.isFinite(e)?Math.round(e):500))}function sc(e,t){return typeof e==`boolean`?e:t}function cc(e){return typeof e==`string`&&e.length>0&&e.length<=64?e:null}function lc(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 uc(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 dc(e){if(typeof e!=`string`)return null;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t.toLowerCase():null}function fc(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!tc.includes(n))continue;let e=dc(r);e!==null&&(t[n]=e)}return t}function pc(e){let t=typeof e==`object`&&e?e:{};return{light:fc(t.light),dark:fc(t.dark)}}function mc(e){let t=typeof e==`object`&&e?e:{},n=typeof t.notifications==`object`&&t.notifications!==null?t.notifications:{},r=lc(t.openTabs),i=lc(t.draftTabs).filter(e=>!r.includes(e)),a={};for(let[e,n]of Object.entries(uc(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:sc(t.autoAcceptPermissions,rc.autoAcceptPermissions),showReasoningSummaries:sc(t.showReasoningSummaries,rc.showReasoningSummaries),notifications:{agentFinished:sc(n.agentFinished,nc.agentFinished),permissionRequired:sc(n.permissionRequired,nc.permissionRequired),errorOccurred:sc(n.errorOccurred,nc.errorOccurred)},showAgentPicker:sc(t.showAgentPicker,rc.showAgentPicker),transcriptWindowSize:oc(t.transcriptWindowSize),openTabs:r,draftTabs:i,draftTitles:a,activeTab:c,remoteTabs:uc(t.remoteTabs),sessionPanelOpen:sc(t.sessionPanelOpen,rc.sessionPanelOpen),explorerOpen:sc(t.explorerOpen,rc.explorerOpen),sidebarWidth:ac(t.sidebarWidth),sidebarPinned:sc(t.sidebarPinned,rc.sidebarPinned),dismissedUpdateVersion:cc(t.dismissedUpdateVersion),lastSeenReleaseNotes:cc(t.lastSeenReleaseNotes),claudeImportOffered:sc(t.claudeImportOffered,rc.claudeImportOffered),claudeImportOffers:ic(t.claudeImportOffers),collapsedProjects:lc(t.collapsedProjects),themeColors:pc(t.themeColors)}}new Set(Object.keys(rc));var hc=[{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 gc(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:_c(r.pre,i.pre)}function _c(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 vc(e,t,n=hc){if(!e||e===`0.0.0`)return[];let r=n.filter(t=>gc(t.version,e)<=0);return[...t===null?r.filter(t=>gc(t.version,e)===0):r.filter(e=>gc(e.version,t)>0)].sort((e,t)=>gc(t.version,e.version))}function yc(e,t,n,r=hc){if(!e||e===`0.0.0`)return{record:null,show:[]};let i=null;for(let e of r)(i===null||gc(e.version,i)>0)&&(i=e.version);let a=i!==null&&gc(e,i)>0?i:e;return{record:t===null||gc(a,t)>0?a:null,show:t===null&&!n?[]:vc(e,t,r)}}function bc(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 xc=`the user skipped the question`,Sc=`(the user skipped this question)`;function Cc(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 wc(e,t,n={},r=new Set){let i={};return e.forEach((e,a)=>{if(r.has(a)){i[e.question]=Sc;return}let o=(n[a]??``).trim();i[e.question]=o||(t[a]??[]).join(`, `)}),i}var Tc=[`win32`,`linux`,`darwin`],Ec=[`demo`,`live`],Dc=[`allow`,`ask`],Oc=[`string`,`number`,`integer`,`boolean`,`array`,`object`];function kc(e,t){let n=t?.[e.slug];return typeof n==`boolean`?n:e.defaultOn}function Ac(e,t){return e.filter(e=>kc(e,t))}var jc={slug:48,name:80,entryTool:40,description:2e3,promptLine:1e3,actionDescription:1e3,params:30,paramName:48,paramDescription:400,enumValues:40,callArgKeys:20,callError:500,callBatch:100},Mc=/^[A-Za-z0-9_-]+$/;function Nc(e){return typeof e==`string`&&e.length>0&&e.length<=jc.entryTool&&Mc.test(e)}function Pc(e){return Math.ceil(e.length/4)}function Fc(e){return Pc(`${e.entryTool} ${e.description}`)+55}var Ic=V({type:Ho(Oc),required:To().optional(),enum:jo(Po([z(),xo()])).optional(),description:z().optional()}),Lc=V({slug:z().min(1),description:z(),params:Bo(z(),Ic),permission:Ho(Dc),sort:xo()}),Rc=V({version:z(),url:z(),sha256:z(),sizeBytes:xo(),exe:z(),format:Wo(`zip`)}),zc=V({slug:z().min(1),name:z(),entryTool:z().refine(Nc,`not a valid tool name`),description:z(),promptLine:z().nullable(),status:Ho(Ec),defaultOn:To(),sort:xo(),install:Rc.nullable(),actions:jo(Lc)});V({platform:Ho(Tc),version:z(),packs:jo(zc),refreshMinutes:xo()});function Bc(e,t,n){return n?`${e}::${n}::${t}`:`${e}::${t}`}function Vc(e,t){return e===`oonacode`?-1:t}function Hc(e){return e.filter(e=>e.definition.enabled&&e.configured&&T(e.definition.id)&&!D(e.definition.id)&&e.definition.models.length>0).map((e,t)=>({p:e,order:Vc(e.definition.id,t)})).sort((e,t)=>e.order-t.order).map(e=>e.p)}function Uc(e){let t=hs(e.definition);if(t.length<2)return[{variantId:null,suffix:``}];let n=new Set((e.credentials??[]).map(e=>e.variantId??`payg`)),r=t.filter(e=>n.has(e.id));return r.length<2?[{variantId:null,suffix:``}]:r.map(e=>({variantId:e.id,suffix:` ${Wc(e.id,e.label)}`}))}function Wc(e,t){return e===`token-plan`?`Subscription`:e===`payg`||e===`api-key`?`API`:t}function Gc(e,t){let n=Hc(e),r=e=>{let t=e.definition.clientGroup,r=(t?n.find(e=>e.definition.id===t)?.definition:void 0)?.displayName??e.definition.displayName,i=n.filter(n=>(n.definition.clientGroup??n.definition.id)===(t??e.definition.id));return e.definition.recordLabel&&i.length>1?`${r} ${e.definition.recordLabel}`:r};return n.flatMap(n=>{let i=bc(n.definition.models,t?.[n.definition.id]),a=r(n);return Uc(n).map(t=>({providerId:n.definition.id,variantId:t.variantId,label:`${a}${t.suffix}`,route:n.definition.route,models:i.map(r=>({providerId:n.definition.id,variantId:t.variantId,modelId:r.id,label:r.displayName||r.id,value:Bc(n.definition.id,r.id,t.variantId),free:r.free===!0,details:{...r.aaIntelligence===void 0?{}:{intelligence:r.aaIntelligence},...r.aaCoding===void 0?{}:{coding:r.aaCoding},...r.aaOutputTps===void 0?{}:{outputTps:r.aaOutputTps},...r.aaTtft===void 0?{}:{ttft:r.aaTtft},...r.contextWindow===void 0?{}:{contextWindow:r.contextWindow},...r.maxOutputTokens===void 0?{}:{maxOutputTokens:r.maxOutputTokens},...r.supportsThinking===void 0?{}:{thinking:r.supportsThinking},...r.supportsVision===void 0?{}:{vision:r.supportsVision},...r.supportsTools===void 0?{}:{tools:r.supportsTools},...r.inputPricePerM===void 0?{}:{inputPricePerM:r.inputPricePerM},...r.outputPricePerM===void 0?{}:{outputPricePerM:r.outputPricePerM},...r.notes===void 0?{}:{notes:r.notes},...r.aa===void 0?{}:{aa:r.aa},...r.servedBy===void 0?{}:{providers:r.servedBy.map(t=>{let n=e.find(e=>e.definition.id===t)?.definition,i=n?.displayName??t;if(!r.subscriptionServedBy?.includes(t))return i;let a=n?.credentialVariants?.find(e=>e.id===`token-plan`)?.label;return`${i} — ${a?a.replace(/\s*\(.*\)\s*$/,``):`subscription`}`})}}}))}))}).filter(e=>e.models.length>0)}var Kc=new Set([`opus`,`sonnet`,`haiku`,`fable`]);function qc(e,t){if(!t.providerId||!t.model)return!1;let n=e.find(e=>e.definition.id===t.providerId)?.definition;if(!n||n.models.length===0)return!1;let r=Ds(t.model);if(n.models.some(e=>e.id===r||e.upstreamId===r)||n.modelAliases?.[r]!==void 0)return!1;let i=r.toLowerCase();return!Kc.has(i)||n.modelAliases?.[i]===void 0&&!n.models.some(e=>e.id.toLowerCase().includes(i))}function Jc(e,t){let n=Gc(e),r=n[0]??null,i=t.providerId??r?.providerId??null,a=t.variantId??(i?n.find(e=>e.providerId===i)?.variantId??null:r?.variantId??null);return i?t.model?{providerId:i,variantId:a,modelId:t.model}:{providerId:i,variantId:a,modelId:e.find(e=>e.definition.id===i)?.definition?.defaultModel||n.find(e=>e.providerId===i)?.models[0]?.modelId||null}:{providerId:null,variantId:a,modelId:t.model??null}}function Yc(e){if(!Number.isFinite(e))return`0 credits`;let t=Math.round(e*1e3)/1e3,n=t.toFixed(3).replace(/\.?0+$/,``);return`${n===``?`0`:n} credit${t===1?``:`s`}`}function Xc(e){return`Remote access is turned off on ${e}, so it cannot be reached from here. Turn it on in OonaCode on that PC — Settings → This PC → Remote access — then try again.`}function Zc(e){if(typeof e!=`string`)return null;let t=/^API Error\b:?\s*(?:(\d{3})(?!\d)\s*)?([\s\S]*)$/i.exec(e.trim());return t?{status:t[1]===void 0?null:Number(t[1]),message:(t[2]??``).trim()}:null}function Qc(e){return typeof e!=`string`||e===``?!1:/prompt is too long|maximum context length|context[ _-]?length[ _-]?exceeded|input token count exceeds|too many (?:input )?tokens|exceeds? the (?:maximum|model's) context/i.test(e)}var $c=`chat too long for this model`;function el(e,t){if(Qc(t))return $c;switch(e){case 400:case 422:return`invalid request`;case 401:return`sign-in needed`;case 402:return`insufficient credits`;case 403:return`not allowed`;case 404:return`model not found`;case 408:case 504:return`timed out`;case 413:return`request too large`;case 429:return`rate limited`;default:return e!==null&&e>=500&&e<=599?`provider error`:`API error`}}var tl={error_max_turns:`max turns reached`,error_max_budget_usd:`budget reached`,error_during_execution:`error during execution`,error_max_structured_output_retries:`structured output failed`,interrupted:`interrupted`,success:`error`};function nl(e){if(!e.isError)return`turn complete`;let t=Zc(e.text);if(t)return el(t.status,t.message);let n=tl[e.subtype];if(n!==void 0)return n;let r=e.subtype.replace(/_/g,` `).trim();return r===``?`error`:r}var rl={authentication_failed:`sign-in needed`,billing_error:`billing problem`,rate_limit:`rate limited`,invalid_request:`invalid request`,server_error:`provider error`};function il(e,t){if(typeof e!=`string`)return null;let n=e.trim();if(n===``)return null;if(Qc(t))return $c;let r=rl[n];if(r!==void 0)return r;if(n===`unknown`){let e=Zc(t);return e?el(e.status,e.message):Qc(t)?$c:`error`}return n.replace(/_/g,` `)}function al(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function ol(e,t){let n=typeof e==`object`&&e?e:{},r={input:al(n.input_tokens),cached:al(n.cache_read_input_tokens)+al(n.cache_creation_input_tokens),output:al(n.output_tokens)};if(r.input+r.cached+r.output>0||typeof t!=`object`||!t)return r;let i={input:0,cached:0,output:0};for(let e of Object.values(t)){if(typeof e!=`object`||!e)continue;let t=e;i.input+=al(t.inputTokens),i.cached+=al(t.cacheReadInputTokens)+al(t.cacheCreationInputTokens),i.output+=al(t.outputTokens)}return i}function sl(e,t,n=140){let r=t??{};for(let t of[`command`,`file_path`,`pattern`,`query`,`url`,`path`,`prompt`]){let i=r[t];if(typeof i==`string`&&i.trim().length>0){let t=i.replace(/\s+/g,` `).trim();return`${e}: ${t.length>n?`${t.slice(0,n)}…`:t}`}}return e}var cl={complete:`/api/v1/account/vault/rekey-complete`,revoke:`/api/v1/account/vault/rekey-revoke`,deviceUnlock:`/api/v1/account/device-unlock`};function ll(e){return e?.deviceUnlock??`off`}function ul(e){if(!e?.loggedIn)return null;let t=e;if(t.vaultStatus!==`pending_rekey`)return null;let n=t.vaultRekeyPending??null;return{pending:n,canFinishHere:t.canFinishRekey===!0,trustedDevices:n?.trustedDevices.map(e=>e.label||e.name)??[],since:n?.since??null,from:dl(n)}}function dl(e){if(!e)return null;let t=e.requestedFrom.device?.trim()||null,n=e.requestedFrom.ip?.trim()||null;return t&&n?`${t} (${n})`:t??n}function fl(e){if(!e)return`an unknown date`;let t=Date.parse(e);if(Number.isNaN(t))return`an unknown date`;try{return new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}catch{return new Date(t).toISOString()}}function pl(e){let t=e.from?` from ${e.from}`:``;return`A password reset was started on ${fl(e.since)}${t}. Your saved provider keys are still sealed under the old password.`}function ml(e){return e.trustedDevices.length===0?`No device with "keep me unlocked" is left, so nothing here holds the key from before the reset.`:`Open OonaCode on ${gl(e.trustedDevices)} to finish the reset — your saved keys are waiting there.`}var hl=`Either way, your vault Recovery Key still works: sign in on the OonaCode website from any device and finish the reset there. Discarding is the last resort — it deletes your saved provider keys, your mirrored history and that Recovery Key for good.`;function gl(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} or ${e[e.length-1]}`}function _l(e){return e.canFinishHere?`A password reset is waiting: this PC can move your vault to the new password.`:e.trustedDevices.length>0?`A password reset is waiting — your saved keys stay locked until it is finished on ${gl(e.trustedDevices)}.`:`A password reset is waiting and no PC holds the old key — finish it with your vault Recovery Key on the OonaCode website.`}var vl=class extends Error{code;status;details;constructor(e,t,n,r){super(n),this.name=`HostApiError`,this.code=e,this.status=t,this.details=r}get isUnauthorized(){return this.status===401||this.code===`unauthorized`}get isEmailNotVerified(){return this.code===`email_not_verified`}};function yl(e){if(!e)return``;let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}function bl(e){return e.trim().replace(/\/+$/,``)}function xl(e,t){let n=bl(e.baseUrl),r=t??((e,t)=>fetch(e,t));async function i(t,i,a,o={}){let s={Authorization:`Bearer ${e.token}`,Accept:o.raw||o.bytes?`*/*`:`application/json`},c={method:t,headers:s,credentials:`omit`};a!==void 0&&(s[`Content-Type`]=`application/json`,c.body=JSON.stringify(a));let l;try{l=await r(`${n}${i}`,c)}catch(e){throw new vl(`network`,0,`Cannot reach the host at ${n}: ${String(e?.message??e)}`)}if(!l.ok){let e=null,t=``;try{t=await l.text(),e=t?JSON.parse(t):null}catch{e=null}let n=e?.error?.code??(l.status===401?`unauthorized`:`internal`),r=e?.error?.message??(t||`${l.status} ${l.statusText}`);throw new vl(n,l.status,r,e?.error?.details)}if(o.bytes)return await l.arrayBuffer();if(o.raw)return await l.text();if(l.status===204)return;let u=await l.text();if(u)try{return JSON.parse(u)}catch{throw new vl(`parse`,l.status,`Host returned malformed JSON for ${t} ${i}`)}}let a=ke;return{health:()=>i(a.health,F.health),info:()=>i(a.info,F.info),listSessions:e=>i(a.listSessions,`${F.sessions}${yl(e)}`),createSession:e=>i(a.createSession,F.sessions,e),getSession:e=>i(a.getSession,F.session(e)),updateSession:(e,t)=>i(a.updateSession,F.session(e),t),deleteSession:e=>i(a.deleteSession,F.session(e)),exportSessionsArchive:async t=>{let i=await r(`${n}${F.sessionsExportArchive}`,{method:`POST`,credentials:`omit`,headers:{Authorization:`Bearer ${e.token}`,Accept:`application/zip`,"Content-Type":`application/json`},body:JSON.stringify({password:t})});if(!i.ok){let e=await i.text().catch(()=>``),t=null;try{t=e?JSON.parse(e):null}catch{t=null}throw new vl(t?.error?.code??`internal`,i.status,t?.error?.message??e??`the export failed`)}return i.blob()},listEntries:(e,t)=>i(a.listEntries,`${F.sessionEntries(e)}${yl(t)}`),listMessages:e=>i(a.listMessages,F.sessionMessages(e)),prompt:(e,t)=>i(a.prompt,F.sessionPrompt(e),{...t,stream:!1}),interrupt:e=>i(a.interrupt,F.sessionInterrupt(e),{}),cancelQueued:(e,t)=>i(a.cancelQueued,F.sessionQueued(e,t)),forkSession:(e,t)=>i(a.fork,F.sessionFork(e),t??{}),exportSession:(e,t)=>i(a.export,`${F.sessionExport(e)}${yl(t)}`,void 0,{raw:!0}),listProjects:()=>i(a.listProjects,F.projects),listVaultProjects:()=>i(a.listVaultProjects,F.vaultProjects),createVaultProject:e=>i(a.createVaultProject,F.vaultProjects,e),updateVaultProject:(e,t)=>i(a.updateVaultProject,F.vaultProject(e),t),deleteVaultProject:e=>i(a.deleteVaultProject,F.vaultProject(e)),listScheduledTasks:(e={})=>{let t=new URLSearchParams;e.sessionId&&t.set(`sessionId`,e.sessionId),e.projectId&&t.set(`projectId`,e.projectId);let n=t.toString();return i(a.listScheduledTasks,n?`${F.scheduledTasks}?${n}`:F.scheduledTasks)},createScheduledTask:e=>i(a.createScheduledTask,F.scheduledTasks,e),updateScheduledTask:(e,t)=>i(a.updateScheduledTask,F.scheduledTask(e),t),deleteScheduledTask:e=>i(a.deleteScheduledTask,F.scheduledTask(e)),getGithubLink:()=>i(a.getGithubLink,F.githubLink),searchEntries:e=>i(a.searchEntries,`${F.sessionSearch}${yl(e)}`),startGithubLink:()=>i(a.startGithubLink,F.githubLinkStart,{}),cancelGithubLink:()=>i(a.cancelGithubLink,F.githubLinkStart),unlinkGithub:()=>i(a.unlinkGithub,F.githubLink),scanClaudeSessions:()=>i(a.scanClaudeSessions,F.importClaude),importClaudeSessions:e=>i(a.importClaudeSessions,F.importClaude,e??{}),sessionLink:e=>i(a.sessionLink,F.sessionLink(e)),syncSessionDown:e=>i(a.syncSessionDown,F.sessionSyncDown(e),{}),inspectProject:e=>i(a.inspectProject,`${F.projectInspect}${yl(e)}`),attachSessionProject:(e,t)=>i(a.attachSessionProject,F.sessionProject(e),t),listAgentTools:()=>i(`GET`,F.agentTools),listProviders:()=>i(a.listProviders,F.providers),setActiveProvider:e=>i(a.setActiveProvider,F.providersActive,e),testProvider:e=>i(a.providerTest,F.providerTest(e),{}),probeCredential:(e,t)=>i(a.providerProbe,F.providerProbe(e),t),listModels:e=>i(a.listModels,`${F.models}${yl(e)}`),getSettings:()=>i(a.getSettings,F.settings),updateSettings:e=>i(a.updateSettings,F.settings,e),getAccount:()=>i(a.getAccount,F.account),login:e=>i(a.login,F.accountLogin,e),logout:()=>i(a.logout,F.accountLogout,{}),unlock:e=>i(a.unlock,F.accountUnlock,e),lock:()=>i(`POST`,F.accountLock,{reason:`user`}),plan:()=>i(`GET`,F.accountPlan),remoteUnlockHost:(e,t)=>i(`POST`,F.hostVaultUnlock(e),{password:t}),resendVerification:e=>i(a.resendVerification,F.accountResendVerification,e),startAccountLink:e=>i(a.linkStart,F.accountLinkStart,e??{}),accountLinkStatus:()=>i(a.linkStatus,F.accountLinkStatus),cancelAccountLink:()=>i(a.linkCancel,F.accountLinkCancel,{}),completeVaultRekey:e=>i(`POST`,cl.complete,e),revokeVaultRekey:e=>i(`POST`,cl.revoke,e),setDeviceUnlock:e=>i(`POST`,cl.deviceUnlock,e),listCredentials:()=>i(a.listCredentials,F.credentials),addCredential:e=>i(a.addCredential,F.credentials,e),deleteCredential:e=>i(a.deleteCredential,F.credential(e)),testCredential:e=>i(a.credentialTest,F.credentialTest(e),{}),syncNow:()=>i(a.syncNow,F.syncNow,{}),claudeSubscriptionLogin:()=>i(a.claudeLogin,F.subscriptionClaudeLogin,{}),claudeSubscriptionStatus:()=>i(a.claudeStatus,F.subscriptionClaudeStatus),claudeLoginState:()=>i(a.claudeLoginState,F.subscriptionClaudeLoginState),claudeLoginCode:e=>i(a.claudeLoginCode,F.subscriptionClaudeLoginCode,e),claudeLoginCancel:()=>i(a.claudeLoginCancel,F.subscriptionClaudeLoginCancel,{}),oauthLoginStart:e=>i(a.oauthLogin,F.subscriptionOauthLogin(e),{}),oauthLoginState:e=>i(a.oauthLoginState,F.subscriptionOauthLoginState(e)),oauthLoginCancel:e=>i(a.oauthLoginCancel,F.subscriptionOauthLoginCancel(e),{}),doctor:()=>i(a.doctor,F.doctor),listHosts:()=>i(a.listHosts,F.hosts),listHostSessions:e=>i(a.listHostSessions,F.hostSessions(e)),deleteHostSession:(e,t)=>i(a.deleteHostSession,F.hostSession(e,t),{method:`DELETE`}),updateHost:(e,t)=>i(a.updateHost,F.host(e),t),listHostSessionEntries:(e,t,n)=>i(a.listHostSessionEntries,`${F.hostSessionEntries(e,t)}${yl(n)}`),reportError:e=>i(a.errorReport,F.errorReport,e),sendBugReport:e=>i(a.bugReport,F.bugReport,e),listSessionFiles:(e,t)=>i(a.listSessionFiles,`${F.sessionFiles(e)}${yl({path:t})}`),readSessionFile:(e,t)=>i(a.readSessionFile,`${F.sessionFile(e)}${yl({path:t})}`,void 0,{raw:!0}),readSessionFileBytes:(e,t)=>i(a.readSessionFile,`${F.sessionFile(e)}${yl({path:t})}`,void 0,{bytes:!0}),deleteSessionFile:(e,t)=>i(a.deleteSessionFile,`${F.sessionFile(e)}${yl({path:t})}`)}}function Sl(e){return e instanceof vl&&(e.status===404||e.status===501)}var Cl=120;function wl(){return Cl}function Tl(e){let t=e.batchMs??120,n=e.hiddenBatchMs??1e3,r=e.isHidden??(()=>!1),i=e.now??(()=>Date.now()),a=e.setTimeout??((e,t)=>setTimeout(e,t)),o=e.clearTimeout??(e=>clearTimeout(e)),s=[],c=null,l=-1/0,u=!1,d=()=>{if(c!==null&&(o(c),c=null),s.length===0)return;let t=s;s=[],l=i(),e.deliver(t)};return{push(o){if(u)return;if(s.push(o),!e.isStreamFrame(o)){d();return}let f=r()?n:t;if(f<=0){d();return}if(c!==null)return;let p=i()-l;if(p>=f){d();return}c=a(()=>{c=null,d()},f-p)},flush:d,dispose(){u=!0,c!==null&&o(c),c=null,s=[]}}}function El(e,t,n){if((t.providerId??``)!==e.providerId||e.variantId!==void 0&&(t.variantId??null)!==(e.variantId??null)||!t.model)return!1;let r=Ds(t.model),i=Ds(e.model);if(r===i)return!0;let a=n.find(t=>t.definition.id===e.providerId)?.definition;return a!==void 0&&ws(a,i)===r}function Dl(e){return e instanceof vl&&e.code===`email_not_verified`}function Ol(e){if(!Dl(e))return null;let t={error:{code:e.code,message:e.message,details:e.details}};return k(t)?t.error.details:null}function kl(e){let t=e.trim(),n=t.indexOf(`@`);return n<=0?`***`:`${t.slice(0,1)}***${t.slice(n)}`}function Al(e,t){return e===void 0||!Number.isFinite(e)||e<=0?t:t+Math.ceil(e)*1e3}function jl(e,t){return Math.max(0,Math.ceil((e.resendAt-t)/1e3))}function Ml(e,t){if(!Dl(e))return null;let n=t.now??Date.now(),r=Ol(e),i=t.email.trim();return{email:i,displayEmail:r?.email||kl(i),verification:r?.verification??`pending`,registered:t.registered===!0,resendAt:Al(r?.resendAfterSec,n)}}function Nl(e){let t=e.registered?`Account created. `:``;return e.verification===`unverified`?`${t}Confirm your email first — no link is outstanding for ${e.displayEmail}; send a new one.`:`${t}Confirm your email first — we sent a link to ${e.displayEmail}.`}function Pl(e=null){return{sessionId:e,session:null,items:[],index:new Map,status:`idle`,activeTurnId:null,init:null,statusText:null,pendingPermissions:[],lastSeq:null,totals:{costUsd:0,inputTokens:0,cachedInputTokens:0,outputTokens:0,turns:0},turnCachedTokens:0,contextTokens:null,hydrated:!1,agentActivity:{},hasSubagentItems:!1,hasOptimisticUser:!1,lastLocalPromptId:null,lastFrameAt:null,lastLiveUuid:null,engineSince:null,subpathParents:{},seen:new Set,streams:{},nextId:1}}function Fl(e,t){let n=e.agentActivity[t.agentId],r={subpath:t.subpath,firstAt:n?Math.min(n.firstAt,t.at):t.at,at:n?Math.max(n.at,t.at):t.at,finished:t.finished,toolUses:(n?.toolUses??0)+t.toolUses};return{...e,agentActivity:{...e.agentActivity,[t.agentId]:r}}}function Il(e,t,n,r,i,a){let o=_u.exec(t)?.[2];if(!o)return e;let s=i&&Date.parse(i)||0;if(n!==`assistant`)return Fl(e,{agentId:o,subpath:t,at:s,finished:e.agentActivity[o]?.finished??!1,toolUses:0});let c=(Array.isArray(r)?r:[]).filter(e=>e.type===`tool_use`),l=c.length===0;return typeof a==`string`&&(l=a===`end_turn`||a===`stop_sequence`),c.some(e=>e.name===`StructuredOutput`)&&(l=!0),Fl(e,{agentId:o,subpath:t,at:s,finished:l,toolUses:c.length})}function Ll(e,t){switch(t.type){case`frame`:return Rl(e,t.frame,t.receivedAt);case`hydrate`:return pu(e,t.messages,t.session??null);case`entries`:return hu(e,t.entries);case`session`:return Su(e,t.session);case`local_prompt`:return wu(e,t);case`local_prompt_failed`:return Tu(e,t.requestId);case`local_permission`:return fu(e,t.requestId,t.behavior,`local`);case`local_system`:{let n={kind:`system`,id:`sys:${e.nextId}`,uuid:null,parentToolUseId:null,turnId:null,timestamp:null,subtype:t.subtype,text:t.text};return Mu({...e,nextId:e.nextId+1},n)}case`reset`:return Pl(e.sessionId)}}function Rl(e,t,n){let r=Ul(e,t,n);if(n===void 0||!Bl(t,e,r))return r;let i=r.lastFrameAt;return i!==null&&n>=i&&n-i<1e3?r:{...r,lastFrameAt:n}}function zl(e){return e===`running`||e===`waiting_permission`}function Bl(e,t,n){switch(e.type){case`agent`:return e.seq===null?e.message.type!==`system`||e.message.subtype!==`local_command`:!1;case`turn_started`:case`turn_finished`:case`prompt_delivered`:case`subagent_activity`:return!0;case`permission_request`:return n!==t;case`permission_resolved`:return!0;default:return!1}}function Vl(e){if(e.lastFrameAt!==null||!e.hydrated||!zl(e.status))return e;let t=e.engineSince??0;for(let n=e.items.length-1;n>=0;n--){let r=e.items[n].timestamp,i=r?Date.parse(r):NaN;if(Number.isFinite(i)){i>t&&(t=i);break}}for(let n of Object.values(e.agentActivity))n.at>t&&(t=n.at);return t>0?{...e,lastFrameAt:t}:e}function Hl(e,t,n){return t!==null||n===void 0||typeof e.timestamp==`string`?e:{...e,timestamp:new Date(n).toISOString()}}function Ul(e,t,n){switch(t.type){case`agent`:{if(t.seq!==null&&e.seen.has(`seq:${t.seq}`))return e;let r=Wl(e,Hl(t.message,t.seq,n),{turnId:t.turnId,receivedAt:n});return t.seq!==null&&(r=Iu(r,`seq:${t.seq}`),(r.lastSeq===null||t.seq>r.lastSeq)&&(r={...r,lastSeq:t.seq})),r}case`turn_started`:{let n=`turnstart:${t.turnId}`;if(e.seen.has(n))return e;let r=Iu(e,n);if(r={...r,activeTurnId:t.turnId,status:`running`,statusText:null,turnCachedTokens:0},t.requestId){let e=r.items.findIndex(e=>e.kind===`user`&&e.requestId===t.requestId);if(e>=0){let n={...r.items[e],turnId:t.turnId,waiting:!1};r=e<r.items.length-1?Mu(Pu(r,new Set([n.id])),n):Nu(r,e,n)}}return r}case`turn_finished`:return su(e,t.result,t.turnId);case`prompt_delivered`:return ru(e,t.text,t.deliveredAt,t.requestId);case`prompt_cancelled`:{let n=e.items.filter(e=>e.kind===`user`&&!e.failed&&(e.requestId===t.requestId||(e.waiting||e.optimistic)&&e.deliveredAt===null&&e.text===t.text));return Pu(e,new Set(n.map(e=>e.id)))}case`subagent_activity`:return Fl(e,{agentId:t.agentId,subpath:t.subpath,at:Date.parse(t.at)||Date.now(),finished:t.finished,toolUses:t.toolUses});case`permission_request`:return du(e,t.request,t.turnId,t.settled===!0);case`permission_resolved`:return fu(e,t.requestId,t.behavior,t.resolvedBy);case`session_state`:{let n=t.session;return Su((n.status===`idle`||n.status===`error`)&&e.pendingPermissions.length===0&&e.activeTurnId!==null?{...e,activeTurnId:null}:e,n)}case`error`:{if(t.code===`replay_truncated`||t.code===`replay_windowed`)return e;let r={kind:`error`,id:`err:${e.nextId}`,uuid:null,parentToolUseId:null,turnId:e.activeTurnId,timestamp:n===void 0?null:new Date(n).toISOString(),code:t.code,message:t.message,requestId:t.requestId??null};return Mu({...e,nextId:e.nextId+1},r)}default:return e}}function Wl(e,t,n){let r=typeof t.uuid==`string`?t.uuid:null,i=t.type===`stream_event`||t.type===`tool_progress`,a=r&&!i?`uuid:${r}`:null;if(i&&r!==null&&r===e.lastLiveUuid)return e;if(a&&e.seen.has(a))return t.type===`assistant`?Yl(e,t):e;let o=e;switch(t.type){case`system`:o=Gl(e,t,n);break;case`stream_event`:o=Kl(e,t,n);break;case`assistant`:o=Jl(e,t,n);break;case`user`:o=eu(e,t,n);break;case`result`:o=ou(e,t,n);break;case`tool_progress`:o=lu(e,t);break;case`auth_status`:o=uu(e,t,n);break;default:return e}return a?o=Iu(o,a):i&&r!==null&&(o={...o,lastLiveUuid:r}),o}function Gl(e,t,n){switch(t.subtype){case`init`:{let r={model:Hu(t.model),cwd:Hu(t.cwd),tools:Array.isArray(t.tools)?t.tools.filter(e=>typeof e==`string`):[],permissionMode:Hu(t.permissionMode),claudeCodeVersion:Hu(t.claude_code_version),apiKeySource:Hu(t.apiKeySource),sessionId:Hu(t.session_id),mcpServers:Array.isArray(t.mcp_servers)?t.mcp_servers:[]};return{...e,init:r,engineSince:n.receivedAt??Date.now()}}case`compact_boundary`:{let r=t.compact_metadata??{},i={kind:`compact`,id:Ru(e,`compact`,t),uuid:zu(t),parentToolUseId:Bu(t),turnId:n.turnId,timestamp:Vu(t),trigger:r.trigger===`manual`?`manual`:`auto`,preTokens:typeof r.pre_tokens==`number`?r.pre_tokens:0,postTokens:typeof r.post_tokens==`number`?r.post_tokens:null};return Mu(Lu(e),i)}case`status`:{let n=typeof t.status==`string`?t.status:null;return{...e,statusText:n}}case`task_notification`:{let r=pe({taskId:Hu(t.task_id)||null,toolUseId:Hu(t.tool_use_id)||null,status:Hu(t.status)||null,summary:Hu(t.summary)||null});if(Ou(e,r))return e;let i=zu(t),a={kind:`user`,id:i?`u:${i}`:`i${e.nextId}`,uuid:i,parentToolUseId:Bu(t),turnId:n.turnId,timestamp:Vu(t),text:r,attachments:[],requestId:null,optimistic:!1,failed:!1,waiting:!1,deliveredAt:null,compactSummary:!1,taskNotification:!0,engineNote:!1};return e.index.get(a.id)===void 0?Mu(i?e:Lu(e),a):e}case`permission_denied`:{let n=Hu(t.tool_use_id),r=Hu(t.message);return Fu(e,n,e=>{let t=e.name===`AskUserQuestion`&&r===`the user skipped the question`;return{...e,status:t?`skipped`:`denied`,result:e.result??{content:r||`Permission denied`,isError:!t,structured:null}}})}case`rewind_boundary`:{let n={kind:`system`,id:`sys:${e.nextId}`,uuid:zu(t),parentToolUseId:Bu(t),turnId:e.activeTurnId,timestamp:Vu(t),subtype:`rewind`,text:typeof t.content==`string`&&t.content.trim()?t.content.trim():`Rewound here — the conversation was taken back to this point and continued differently.`};return Mu({...e,nextId:e.nextId+1},n)}default:{let n=typeof t.content==`string`?t.content.trim():``,r=n?$l(n):null;if(!r||r.subtype===`caveat`)return e;let i={kind:`system`,id:`sys:${e.nextId}`,uuid:zu(t),parentToolUseId:Bu(t),turnId:e.activeTurnId,timestamp:Vu(t),subtype:r.subtype,text:r.text};return Mu({...e,nextId:e.nextId+1},i)}}}function Kl(e,t,n){let r=t.event;if(!r||typeof r!=`object`)return e;let i=Bu(t),a=i??``,o=e.streams[a]??{messageId:null,model:null,blocks:{},unclaimed:[]};switch(r.type){case`message_start`:{let t=r.message,n={messageId:t?.id??null,model:t?.model??null,blocks:{},unclaimed:[]},i=e;for(let e of o.unclaimed)i=ql(i,e);return{...i,streams:{...i.streams,[a]:n}}}case`content_block_start`:{let s=r.content_block,c=e,l;if(s.type===`text`)l={kind:`assistant`,id:`i${e.nextId}`,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),text:s.text??``,streaming:!0,model:o.model,messageId:o.messageId,error:null,aborted:!1},c=Lu(c);else if(s.type===`thinking`||s.type===`redacted_thinking`)l={kind:`thinking`,id:`i${e.nextId}`,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),text:s.type===`thinking`?s.thinking??``:``,streaming:!0,redacted:s.type===`redacted_thinking`},c=Lu(c);else if(s.type===`tool_use`){let c=s;if(e.index.get(c.id)!==void 0){let t={...o.blocks,[r.index]:c.id};return{...e,streams:{...e.streams,[a]:{...o,blocks:t}}}}let u=c.input&&Object.keys(c.input).length>0;l={kind:`tool`,id:c.id,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),toolUseId:c.id,name:c.name,input:u?c.input:null,inputJson:u?JSON.stringify(c.input):``,status:`streaming`,result:null,startedAt:n.receivedAt??null,finishedAt:null,durationMs:null,elapsedSec:null,permissionRequestId:null,messageId:o.messageId}}else return e;c=Mu(c,l);let u={...o.blocks,[r.index]:l.id},d=[...o.unclaimed,l.id];return{...c,streams:{...c.streams,[a]:{...o,blocks:u,unclaimed:d}}}}case`content_block_delta`:{let t=o.blocks[r.index];if(!t)return e;let n=e.index.get(t);if(n===void 0)return e;let i=e.items[n],a=r.delta;return a.type===`text_delta`&&i.kind===`assistant`?Nu(e,n,{...i,text:i.text+a.text}):a.type===`thinking_delta`&&i.kind===`thinking`?Nu(e,n,{...i,text:i.text+a.thinking}):a.type===`input_json_delta`&&i.kind===`tool`?Nu(e,n,{...i,inputJson:i.inputJson+a.partial_json}):e}case`content_block_stop`:{let t=o.blocks[r.index];return t?ql(e,t,n.receivedAt):e}case`message_delta`:case`message_stop`:case`ping`:return e;case`error`:{let a={kind:`error`,id:`err:${e.nextId}`,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),code:r.error?.type??`stream_error`,message:r.error?.message??`stream error`,requestId:null};return Mu(Lu(e),a)}default:return e}}function ql(e,t,n){let r=e.index.get(t);if(r===void 0)return e;let i=e.items[r];if(i.kind===`assistant`||i.kind===`thinking`)return i.streaming?Nu(e,r,{...i,streaming:!1}):e;if(i.kind===`tool`&&i.status===`streaming`){let t=i.input??Ku(i.inputJson);return Nu(e,r,{...i,input:t,status:`running`,startedAt:i.startedAt??n??null})}return e}function Jl(e,t,n){let r=t.message??{},i=Wu(r.content),a=Bu(t),o=a??``,s=zu(t),c=Vu(t),l=typeof t.error==`string`?t.error:null,u=t.aborted===!0,d=e;{let e=Uu(r.usage?.cache_read_input_tokens)+Uu(r.usage?.cache_creation_input_tokens),n=`usage:${r.id??``}`;if(e>0&&r.id&&!d.seen.has(n)&&(d={...Iu(d,n),turnCachedTokens:d.turnCachedTokens+e}),a===null&&t.isSidechain!==!0){let t=Uu(r.usage?.input_tokens)+e+Uu(r.usage?.output_tokens);t>0&&t!==d.contextTokens&&(d={...d,contextTokens:t})}}let f=d.streams[o];for(let e of i){let t=f?Xl(d,f,e):null;if(t){let n=d.index.get(t),i=d.items[n];d=Nu(d,n,Zl(i,e,{uuid:s,timestamp:c,model:r.model??null,messageId:r.id??null,errorText:l,aborted:u})),f={...f,unclaimed:f.unclaimed.filter(e=>e!==t)},d={...d,streams:{...d.streams,[o]:f}};continue}let i=Ql(d,e,{uuid:s,timestamp:c,parentToolUseId:a,turnId:n.turnId,model:r.model??null,messageId:r.id??null,errorText:l,aborted:u,receivedAt:n.receivedAt});i&&(d=i)}if(i.length===0&&l){let e={kind:`error`,id:`err:${d.nextId}`,uuid:s,parentToolUseId:a,turnId:n.turnId,timestamp:c,code:`assistant_error`,message:l,requestId:null};d=Mu(Lu(d),e)}return d}function Yl(e,t){let n=Bu(t)??``,r=e.streams[n];if(!r||r.unclaimed.length===0)return e;let i=t.message??{},a=new Set,o=e,s=r;for(let e of Wu(i.content)){let t=Xl(o,s,e);t&&(a.add(t),s={...s,unclaimed:s.unclaimed.filter(e=>e!==t)},o={...o,streams:{...o.streams,[n]:s}})}return Pu(e,a)}function Xl(e,t,n){for(let r of t.unclaimed){let t=e.index.get(r);if(t===void 0)continue;let i=e.items[t];if(!i.uuid&&(n.type===`text`&&i.kind===`assistant`||(n.type===`thinking`||n.type===`redacted_thinking`)&&i.kind===`thinking`||n.type===`tool_use`&&i.kind===`tool`&&i.toolUseId===n.id))return r}return null}function Zl(e,t,n){if(e.kind===`assistant`&&t.type===`text`){let r=t.text??e.text;return{...e,uuid:n.uuid,timestamp:n.timestamp??e.timestamp,text:r.length>=e.text.length?r:e.text,streaming:!1,model:n.model??e.model,messageId:n.messageId??e.messageId,error:n.errorText,aborted:n.aborted}}if(e.kind===`thinking`){let r=t.type===`thinking`?t.thinking??e.text:e.text;return{...e,uuid:n.uuid,timestamp:n.timestamp??e.timestamp,text:r||e.text,streaming:!1}}if(e.kind===`tool`&&t.type===`tool_use`){let r=t,i=r.input&&Object.keys(r.input).length>0?r.input:e.input??Ku(e.inputJson);return{...e,uuid:n.uuid,timestamp:n.timestamp??e.timestamp,name:r.name??e.name,input:i,inputJson:e.inputJson||(i?JSON.stringify(i):``),status:e.status===`streaming`?`running`:e.status,messageId:n.messageId??e.messageId}}return e}function Ql(e,t,n){let r={uuid:n.uuid,parentToolUseId:n.parentToolUseId,turnId:n.turnId,timestamp:n.timestamp};if(t.type===`text`){let i={kind:`assistant`,id:`i${e.nextId}`,...r,text:t.text??``,streaming:!1,model:n.model,messageId:n.messageId,error:n.errorText,aborted:n.aborted};return Mu(Lu(e),i)}if(t.type===`thinking`||t.type===`redacted_thinking`){let n={kind:`thinking`,id:`i${e.nextId}`,...r,text:t.type===`thinking`?t.thinking??``:``,streaming:!1,redacted:t.type===`redacted_thinking`};return Mu(Lu(e),n)}if(t.type===`tool_use`){let i=t,a=e.index.get(i.id);if(a!==void 0){let r=e.items[a];return Nu(e,a,Zl(r,t,n))}let o=i.input&&typeof i.input==`object`?i.input:null;return Mu(e,{kind:`tool`,id:i.id,...r,toolUseId:i.id,name:i.name,input:o,inputJson:o?JSON.stringify(o):``,status:`running`,result:null,startedAt:n.receivedAt??null,finishedAt:null,durationMs:null,elapsedSec:null,permissionRequestId:null,messageId:n.messageId})}return null}function $l(e){if(/^<local-command-caveat>/.test(e))return{subtype:`caveat`,text:``};let t=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/.exec(e);if(t){let e=t[2].replace(/\u001b\[[0-9;]*m/g,``).trim();return{subtype:t[1]===`stderr`?`local-command-error`:`local-command`,text:e}}let n=/<command-name>([^<]*)<\/command-name>/.exec(e);if(n&&/^<command-/.test(e)){let t=/<command-args>([^<]*)<\/command-args>/.exec(e)?.[1]?.trim()??``;return{subtype:`command`,text:`${n[1].trim()}${t?` `+t:``}`}}return null}function eu(e,t,n){let r=t.message??{},i=Bu(t),a=zu(t),o=Vu(t),s=t.isSynthetic===!0,c=e,l=[],u=[],d=!1;if(typeof r.content==`string`)l.push(r.content);else for(let e of Wu(r.content))if(e.type===`text`)l.push(e.text??``);else if(e.type===`tool_result`){d=!0;let r=e;c=iu(c,r.tool_use_id,{content:r.content??``,isError:r.is_error===!0,structured:t.tool_use_result??null},n.receivedAt)}else(e.type===`image`||e.type===`document`)&&u.push(e);let f=se(l.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});var Hs=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],Us=/^([01]\d|2[0-3]):[0-5]\d$/;V({tz:z().min(1),windows:jo(V({from:z().regex(Us,`HH:MM`),to:z().regex(Us,`HH:MM`),days:jo(Ho(Hs)).optional(),kind:Ho([`peak`,`offpeak`])})),offpeakDiscount:xo().nonnegative().max(1).optional()});var Ws=[`priceInputCacheMissPeak`,`priceInputCacheMissOffpeak`,`priceInputCacheHitPeak`,`priceInputCacheHitOffpeak`,`priceCacheWritePeak`,`priceCacheWriteOffpeak`,`priceOutputPeak`,`priceOutputOffpeak`],Gs=V({inputCacheMiss:xo().nonnegative(),inputCacheHit:xo().nonnegative().optional(),cacheWrite:xo().nonnegative().optional(),output:xo().nonnegative()});V({by:Wo(`prompt_tokens`),tiers:jo(V({upToPromptTokens:xo().int().positive().optional(),price:Gs,cost:Gs.optional()})).min(1),note:z().optional()}).superRefine((e,t)=>{let n=0;e.tiers.forEach((r,i)=>{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})}),[...Ws];var Ks={oonacode:{hex:`#000000`,owner:`OonaCode`,d:`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`,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:`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`},xai:{hex:`#000000`,owner:`xAI`,d:`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`},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`},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 qs(e){return Ks[e]??null}function Js(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 Ys=[`stable`,`dev`];function Xs(e){return typeof e==`string`&&Ys.includes(e)}function Zs(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return Xs(t)?t:null}function Qs(e){let t=Zs(e)??`stable`;return t===`stable`?js.releasesLatest:`${js.releasesLatest}?channel=${encodeURIComponent(t)}`}function $s(e,t){let n=Zs(t)??`stable`;return n===`stable`?e:`${e} (${n})`}var ec=5e4,tc=[`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`],nc={agentFinished:!1,permissionRequired:!0,errorOccurred:!0},rc={autoAcceptPermissions:!1,showReasoningSummaries:!0,notifications:nc,showAgentPicker:!0,transcriptWindowSize:500,openTabs:[],draftTabs:[],draftTitles:{},activeTab:null,remoteTabs:{},sessionPanelOpen:!1,explorerOpen:!1,sidebarWidth:288,sidebarPinned:!0,dismissedUpdateVersion:null,lastSeenReleaseNotes:null,claudeImportOffered:!1,claudeImportOffers:0,collapsedProjects:[],themeColors:{light:{},dark:{}}};function ic(e){return Math.min(Math.max(typeof e==`number`&&Number.isFinite(e)?Math.floor(e):0,0),3)}function ac(e){return Math.min(640,Math.max(200,typeof e==`number`&&Number.isFinite(e)?Math.round(e):288))}function oc(e){return Math.min(ec,Math.max(100,typeof e==`number`&&Number.isFinite(e)?Math.round(e):500))}function sc(e,t){return typeof e==`boolean`?e:t}function cc(e){return typeof e==`string`&&e.length>0&&e.length<=64?e:null}function lc(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 uc(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 dc(e){if(typeof e!=`string`)return null;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t.toLowerCase():null}function fc(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!tc.includes(n))continue;let e=dc(r);e!==null&&(t[n]=e)}return t}function pc(e){let t=typeof e==`object`&&e?e:{};return{light:fc(t.light),dark:fc(t.dark)}}function mc(e){let t=typeof e==`object`&&e?e:{},n=typeof t.notifications==`object`&&t.notifications!==null?t.notifications:{},r=lc(t.openTabs),i=lc(t.draftTabs).filter(e=>!r.includes(e)),a={};for(let[e,n]of Object.entries(uc(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:sc(t.autoAcceptPermissions,rc.autoAcceptPermissions),showReasoningSummaries:sc(t.showReasoningSummaries,rc.showReasoningSummaries),notifications:{agentFinished:sc(n.agentFinished,nc.agentFinished),permissionRequired:sc(n.permissionRequired,nc.permissionRequired),errorOccurred:sc(n.errorOccurred,nc.errorOccurred)},showAgentPicker:sc(t.showAgentPicker,rc.showAgentPicker),transcriptWindowSize:oc(t.transcriptWindowSize),openTabs:r,draftTabs:i,draftTitles:a,activeTab:c,remoteTabs:uc(t.remoteTabs),sessionPanelOpen:sc(t.sessionPanelOpen,rc.sessionPanelOpen),explorerOpen:sc(t.explorerOpen,rc.explorerOpen),sidebarWidth:ac(t.sidebarWidth),sidebarPinned:sc(t.sidebarPinned,rc.sidebarPinned),dismissedUpdateVersion:cc(t.dismissedUpdateVersion),lastSeenReleaseNotes:cc(t.lastSeenReleaseNotes),claudeImportOffered:sc(t.claudeImportOffered,rc.claudeImportOffered),claudeImportOffers:ic(t.claudeImportOffers),collapsedProjects:lc(t.collapsedProjects),themeColors:pc(t.themeColors)}}new Set(Object.keys(rc));var hc=[{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 gc(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:_c(r.pre,i.pre)}function _c(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 vc(e,t,n=hc){if(!e||e===`0.0.0`)return[];let r=n.filter(t=>gc(t.version,e)<=0);return[...t===null?r.filter(t=>gc(t.version,e)===0):r.filter(e=>gc(e.version,t)>0)].sort((e,t)=>gc(t.version,e.version))}function yc(e,t,n,r=hc){if(!e||e===`0.0.0`)return{record:null,show:[]};let i=null;for(let e of r)(i===null||gc(e.version,i)>0)&&(i=e.version);let a=i!==null&&gc(e,i)>0?i:e;return{record:t===null||gc(a,t)>0?a:null,show:t===null&&!n?[]:vc(e,t,r)}}function bc(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 xc=`the user skipped the question`,Sc=`(the user skipped this question)`;function Cc(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 wc(e,t,n={},r=new Set){let i={};return e.forEach((e,a)=>{if(r.has(a)){i[e.question]=Sc;return}let o=(n[a]??``).trim();i[e.question]=o||(t[a]??[]).join(`, `)}),i}var Tc=[`win32`,`linux`,`darwin`],Ec=[`demo`,`live`],Dc=[`allow`,`ask`],Oc=[`string`,`number`,`integer`,`boolean`,`array`,`object`];function kc(e,t){let n=t?.[e.slug];return typeof n==`boolean`?n:e.defaultOn}function Ac(e,t){return e.filter(e=>kc(e,t))}var jc={slug:48,name:80,entryTool:40,description:2e3,promptLine:1e3,actionDescription:1e3,params:30,paramName:48,paramDescription:400,enumValues:40,callArgKeys:20,callError:500,callBatch:100},Mc=/^[A-Za-z0-9_-]+$/;function Nc(e){return typeof e==`string`&&e.length>0&&e.length<=jc.entryTool&&Mc.test(e)}function Pc(e){return Math.ceil(e.length/4)}function Fc(e){return Pc(`${e.entryTool} ${e.description}`)+55}var Ic=V({type:Ho(Oc),required:To().optional(),enum:jo(Po([z(),xo()])).optional(),description:z().optional()}),Lc=V({slug:z().min(1),description:z(),params:Bo(z(),Ic),permission:Ho(Dc),sort:xo()}),Rc=V({version:z(),url:z(),sha256:z(),sizeBytes:xo(),exe:z(),format:Wo(`zip`)}),zc=V({slug:z().min(1),name:z(),entryTool:z().refine(Nc,`not a valid tool name`),description:z(),promptLine:z().nullable(),status:Ho(Ec),defaultOn:To(),sort:xo(),install:Rc.nullable(),actions:jo(Lc)});V({platform:Ho(Tc),version:z(),packs:jo(zc),refreshMinutes:xo()});function Bc(e,t,n){return n?`${e}::${n}::${t}`:`${e}::${t}`}function Vc(e,t){return e===`oonacode`?-1:t}function Hc(e){return e.filter(e=>e.definition.enabled&&e.configured&&T(e.definition.id)&&!D(e.definition.id)&&e.definition.models.length>0).map((e,t)=>({p:e,order:Vc(e.definition.id,t)})).sort((e,t)=>e.order-t.order).map(e=>e.p)}function Uc(e){let t=hs(e.definition);if(t.length<2)return[{variantId:null,suffix:``}];let n=new Set((e.credentials??[]).map(e=>e.variantId??`payg`)),r=t.filter(e=>n.has(e.id));return r.length<2?[{variantId:null,suffix:``}]:r.map(e=>({variantId:e.id,suffix:` ${Wc(e.id,e.label)}`}))}function Wc(e,t){return e===`token-plan`?`Subscription`:e===`payg`||e===`api-key`?`API`:t}function Gc(e,t){let n=Hc(e),r=e=>{let t=e.definition.clientGroup,r=(t?n.find(e=>e.definition.id===t)?.definition:void 0)?.displayName??e.definition.displayName,i=n.filter(n=>(n.definition.clientGroup??n.definition.id)===(t??e.definition.id));return e.definition.recordLabel&&i.length>1?`${r} ${e.definition.recordLabel}`:r};return n.flatMap(n=>{let i=bc(n.definition.models,t?.[n.definition.id]),a=r(n);return Uc(n).map(t=>({providerId:n.definition.id,variantId:t.variantId,label:`${a}${t.suffix}`,route:n.definition.route,models:i.map(r=>({providerId:n.definition.id,variantId:t.variantId,modelId:r.id,label:r.displayName||r.id,value:Bc(n.definition.id,r.id,t.variantId),free:r.free===!0,details:{...r.aaIntelligence===void 0?{}:{intelligence:r.aaIntelligence},...r.aaCoding===void 0?{}:{coding:r.aaCoding},...r.aaOutputTps===void 0?{}:{outputTps:r.aaOutputTps},...r.aaTtft===void 0?{}:{ttft:r.aaTtft},...r.contextWindow===void 0?{}:{contextWindow:r.contextWindow},...r.maxOutputTokens===void 0?{}:{maxOutputTokens:r.maxOutputTokens},...r.supportsThinking===void 0?{}:{thinking:r.supportsThinking},...r.supportsVision===void 0?{}:{vision:r.supportsVision},...r.supportsTools===void 0?{}:{tools:r.supportsTools},...r.inputPricePerM===void 0?{}:{inputPricePerM:r.inputPricePerM},...r.outputPricePerM===void 0?{}:{outputPricePerM:r.outputPricePerM},...r.notes===void 0?{}:{notes:r.notes},...r.aa===void 0?{}:{aa:r.aa},...r.servedBy===void 0?{}:{providers:r.servedBy.map(t=>{let n=e.find(e=>e.definition.id===t)?.definition,i=n?.displayName??t;if(!r.subscriptionServedBy?.includes(t))return i;let a=n?.credentialVariants?.find(e=>e.id===`token-plan`)?.label;return`${i} — ${a?a.replace(/\s*\(.*\)\s*$/,``):`subscription`}`})}}}))}))}).filter(e=>e.models.length>0)}var Kc=new Set([`opus`,`sonnet`,`haiku`,`fable`]);function qc(e,t){if(!t.providerId||!t.model)return!1;let n=e.find(e=>e.definition.id===t.providerId)?.definition;if(!n||n.models.length===0)return!1;let r=Ds(t.model);if(n.models.some(e=>e.id===r||e.upstreamId===r)||n.modelAliases?.[r]!==void 0)return!1;let i=r.toLowerCase();return!Kc.has(i)||n.modelAliases?.[i]===void 0&&!n.models.some(e=>e.id.toLowerCase().includes(i))}function Jc(e,t){let n=Gc(e),r=n[0]??null,i=t.providerId??r?.providerId??null,a=t.variantId??(i?n.find(e=>e.providerId===i)?.variantId??null:r?.variantId??null);return i?t.model?{providerId:i,variantId:a,modelId:t.model}:{providerId:i,variantId:a,modelId:e.find(e=>e.definition.id===i)?.definition?.defaultModel||n.find(e=>e.providerId===i)?.models[0]?.modelId||null}:{providerId:null,variantId:a,modelId:t.model??null}}function Yc(e){if(!Number.isFinite(e))return`0 credits`;let t=Math.round(e*1e3)/1e3,n=t.toFixed(3).replace(/\.?0+$/,``);return`${n===``?`0`:n} credit${t===1?``:`s`}`}function Xc(e){return`Remote access is turned off on ${e}, so it cannot be reached from here. Turn it on in OonaCode on that PC — Settings → This PC → Remote access — then try again.`}function Zc(e){if(typeof e!=`string`)return null;let t=/^API Error\b:?\s*(?:(\d{3})(?!\d)\s*)?([\s\S]*)$/i.exec(e.trim());return t?{status:t[1]===void 0?null:Number(t[1]),message:(t[2]??``).trim()}:null}function Qc(e){return typeof e!=`string`||e===``?!1:/prompt is too long|maximum context length|context[ _-]?length[ _-]?exceeded|input token count exceeds|too many (?:input )?tokens|exceeds? the (?:maximum|model's) context/i.test(e)}var $c=`chat too long for this model`;function el(e,t){if(Qc(t))return $c;switch(e){case 400:case 422:return`invalid request`;case 401:return`sign-in needed`;case 402:return`insufficient credits`;case 403:return`not allowed`;case 404:return`model not found`;case 408:case 504:return`timed out`;case 413:return`request too large`;case 429:return`rate limited`;default:return e!==null&&e>=500&&e<=599?`provider error`:`API error`}}var tl={error_max_turns:`max turns reached`,error_max_budget_usd:`budget reached`,error_during_execution:`error during execution`,error_max_structured_output_retries:`structured output failed`,interrupted:`interrupted`,success:`error`};function nl(e){if(!e.isError)return`turn complete`;let t=Zc(e.text);if(t)return el(t.status,t.message);let n=tl[e.subtype];if(n!==void 0)return n;let r=e.subtype.replace(/_/g,` `).trim();return r===``?`error`:r}var rl={authentication_failed:`sign-in needed`,billing_error:`billing problem`,rate_limit:`rate limited`,invalid_request:`invalid request`,server_error:`provider error`};function il(e,t){if(typeof e!=`string`)return null;let n=e.trim();if(n===``)return null;if(Qc(t))return $c;let r=rl[n];if(r!==void 0)return r;if(n===`unknown`){let e=Zc(t);return e?el(e.status,e.message):Qc(t)?$c:`error`}return n.replace(/_/g,` `)}function al(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function ol(e,t){let n=typeof e==`object`&&e?e:{},r={input:al(n.input_tokens),cached:al(n.cache_read_input_tokens)+al(n.cache_creation_input_tokens),output:al(n.output_tokens)};if(r.input+r.cached+r.output>0||typeof t!=`object`||!t)return r;let i={input:0,cached:0,output:0};for(let e of Object.values(t)){if(typeof e!=`object`||!e)continue;let t=e;i.input+=al(t.inputTokens),i.cached+=al(t.cacheReadInputTokens)+al(t.cacheCreationInputTokens),i.output+=al(t.outputTokens)}return i}function sl(e,t,n=140){let r=t??{};for(let t of[`command`,`file_path`,`pattern`,`query`,`url`,`path`,`prompt`]){let i=r[t];if(typeof i==`string`&&i.trim().length>0){let t=i.replace(/\s+/g,` `).trim();return`${e}: ${t.length>n?`${t.slice(0,n)}…`:t}`}}return e}var cl={complete:`/api/v1/account/vault/rekey-complete`,revoke:`/api/v1/account/vault/rekey-revoke`,deviceUnlock:`/api/v1/account/device-unlock`};function ll(e){return e?.deviceUnlock??`off`}function ul(e){if(!e?.loggedIn)return null;let t=e;if(t.vaultStatus!==`pending_rekey`)return null;let n=t.vaultRekeyPending??null;return{pending:n,canFinishHere:t.canFinishRekey===!0,trustedDevices:n?.trustedDevices.map(e=>e.label||e.name)??[],since:n?.since??null,from:dl(n)}}function dl(e){if(!e)return null;let t=e.requestedFrom.device?.trim()||null,n=e.requestedFrom.ip?.trim()||null;return t&&n?`${t} (${n})`:t??n}function fl(e){if(!e)return`an unknown date`;let t=Date.parse(e);if(Number.isNaN(t))return`an unknown date`;try{return new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}catch{return new Date(t).toISOString()}}function pl(e){let t=e.from?` from ${e.from}`:``;return`A password reset was started on ${fl(e.since)}${t}. Your saved provider keys are still sealed under the old password.`}function ml(e){return e.trustedDevices.length===0?`No device with "keep me unlocked" is left, so nothing here holds the key from before the reset.`:`Open OonaCode on ${gl(e.trustedDevices)} to finish the reset — your saved keys are waiting there.`}var hl=`Either way, your vault Recovery Key still works: sign in on the OonaCode website from any device and finish the reset there. Discarding is the last resort — it deletes your saved provider keys, your mirrored history and that Recovery Key for good.`;function gl(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} or ${e[e.length-1]}`}function _l(e){return e.canFinishHere?`A password reset is waiting: this PC can move your vault to the new password.`:e.trustedDevices.length>0?`A password reset is waiting — your saved keys stay locked until it is finished on ${gl(e.trustedDevices)}.`:`A password reset is waiting and no PC holds the old key — finish it with your vault Recovery Key on the OonaCode website.`}var vl=class extends Error{code;status;details;constructor(e,t,n,r){super(n),this.name=`HostApiError`,this.code=e,this.status=t,this.details=r}get isUnauthorized(){return this.status===401||this.code===`unauthorized`}get isEmailNotVerified(){return this.code===`email_not_verified`}};function yl(e){if(!e)return``;let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}function bl(e){return e.trim().replace(/\/+$/,``)}function xl(e,t){let n=bl(e.baseUrl),r=t??((e,t)=>fetch(e,t));async function i(t,i,a,o={}){let s={Authorization:`Bearer ${e.token}`,Accept:o.raw||o.bytes?`*/*`:`application/json`},c={method:t,headers:s,credentials:`omit`};a!==void 0&&(s[`Content-Type`]=`application/json`,c.body=JSON.stringify(a));let l;try{l=await r(`${n}${i}`,c)}catch(e){throw new vl(`network`,0,`Cannot reach the host at ${n}: ${String(e?.message??e)}`)}if(!l.ok){let e=null,t=``;try{t=await l.text(),e=t?JSON.parse(t):null}catch{e=null}let n=e?.error?.code??(l.status===401?`unauthorized`:`internal`),r=e?.error?.message??(t||`${l.status} ${l.statusText}`);throw new vl(n,l.status,r,e?.error?.details)}if(o.bytes)return await l.arrayBuffer();if(o.raw)return await l.text();if(l.status===204)return;let u=await l.text();if(u)try{return JSON.parse(u)}catch{throw new vl(`parse`,l.status,`Host returned malformed JSON for ${t} ${i}`)}}let a=ke;return{health:()=>i(a.health,F.health),info:()=>i(a.info,F.info),listSessions:e=>i(a.listSessions,`${F.sessions}${yl(e)}`),createSession:e=>i(a.createSession,F.sessions,e),getSession:e=>i(a.getSession,F.session(e)),updateSession:(e,t)=>i(a.updateSession,F.session(e),t),deleteSession:e=>i(a.deleteSession,F.session(e)),exportSessionsArchive:async t=>{let i=await r(`${n}${F.sessionsExportArchive}`,{method:`POST`,credentials:`omit`,headers:{Authorization:`Bearer ${e.token}`,Accept:`application/zip`,"Content-Type":`application/json`},body:JSON.stringify({password:t})});if(!i.ok){let e=await i.text().catch(()=>``),t=null;try{t=e?JSON.parse(e):null}catch{t=null}throw new vl(t?.error?.code??`internal`,i.status,t?.error?.message??e??`the export failed`)}return i.blob()},listEntries:(e,t)=>i(a.listEntries,`${F.sessionEntries(e)}${yl(t)}`),listMessages:e=>i(a.listMessages,F.sessionMessages(e)),prompt:(e,t)=>i(a.prompt,F.sessionPrompt(e),{...t,stream:!1}),interrupt:e=>i(a.interrupt,F.sessionInterrupt(e),{}),cancelQueued:(e,t)=>i(a.cancelQueued,F.sessionQueued(e,t)),forkSession:(e,t)=>i(a.fork,F.sessionFork(e),t??{}),exportSession:(e,t)=>i(a.export,`${F.sessionExport(e)}${yl(t)}`,void 0,{raw:!0}),listProjects:()=>i(a.listProjects,F.projects),listVaultProjects:()=>i(a.listVaultProjects,F.vaultProjects),createVaultProject:e=>i(a.createVaultProject,F.vaultProjects,e),updateVaultProject:(e,t)=>i(a.updateVaultProject,F.vaultProject(e),t),deleteVaultProject:e=>i(a.deleteVaultProject,F.vaultProject(e)),listScheduledTasks:(e={})=>{let t=new URLSearchParams;e.sessionId&&t.set(`sessionId`,e.sessionId),e.projectId&&t.set(`projectId`,e.projectId);let n=t.toString();return i(a.listScheduledTasks,n?`${F.scheduledTasks}?${n}`:F.scheduledTasks)},createScheduledTask:e=>i(a.createScheduledTask,F.scheduledTasks,e),updateScheduledTask:(e,t)=>i(a.updateScheduledTask,F.scheduledTask(e),t),deleteScheduledTask:e=>i(a.deleteScheduledTask,F.scheduledTask(e)),getGithubLink:()=>i(a.getGithubLink,F.githubLink),searchEntries:e=>i(a.searchEntries,`${F.sessionSearch}${yl(e)}`),startGithubLink:()=>i(a.startGithubLink,F.githubLinkStart,{}),cancelGithubLink:()=>i(a.cancelGithubLink,F.githubLinkStart),unlinkGithub:()=>i(a.unlinkGithub,F.githubLink),scanClaudeSessions:()=>i(a.scanClaudeSessions,F.importClaude),importClaudeSessions:e=>i(a.importClaudeSessions,F.importClaude,e??{}),sessionLink:e=>i(a.sessionLink,F.sessionLink(e)),syncSessionDown:e=>i(a.syncSessionDown,F.sessionSyncDown(e),{}),inspectProject:e=>i(a.inspectProject,`${F.projectInspect}${yl(e)}`),attachSessionProject:(e,t)=>i(a.attachSessionProject,F.sessionProject(e),t),listAgentTools:()=>i(`GET`,F.agentTools),listProviders:()=>i(a.listProviders,F.providers),setActiveProvider:e=>i(a.setActiveProvider,F.providersActive,e),testProvider:e=>i(a.providerTest,F.providerTest(e),{}),probeCredential:(e,t)=>i(a.providerProbe,F.providerProbe(e),t),listModels:e=>i(a.listModels,`${F.models}${yl(e)}`),getSettings:()=>i(a.getSettings,F.settings),updateSettings:e=>i(a.updateSettings,F.settings,e),getAccount:()=>i(a.getAccount,F.account),login:e=>i(a.login,F.accountLogin,e),logout:()=>i(a.logout,F.accountLogout,{}),unlock:e=>i(a.unlock,F.accountUnlock,e),lock:()=>i(`POST`,F.accountLock,{reason:`user`}),plan:()=>i(`GET`,F.accountPlan),remoteUnlockHost:(e,t)=>i(`POST`,F.hostVaultUnlock(e),{password:t}),resendVerification:e=>i(a.resendVerification,F.accountResendVerification,e),startAccountLink:e=>i(a.linkStart,F.accountLinkStart,e??{}),accountLinkStatus:()=>i(a.linkStatus,F.accountLinkStatus),cancelAccountLink:()=>i(a.linkCancel,F.accountLinkCancel,{}),completeVaultRekey:e=>i(`POST`,cl.complete,e),revokeVaultRekey:e=>i(`POST`,cl.revoke,e),setDeviceUnlock:e=>i(`POST`,cl.deviceUnlock,e),listCredentials:()=>i(a.listCredentials,F.credentials),addCredential:e=>i(a.addCredential,F.credentials,e),deleteCredential:e=>i(a.deleteCredential,F.credential(e)),testCredential:e=>i(a.credentialTest,F.credentialTest(e),{}),syncNow:()=>i(a.syncNow,F.syncNow,{}),claudeSubscriptionLogin:()=>i(a.claudeLogin,F.subscriptionClaudeLogin,{}),claudeSubscriptionStatus:()=>i(a.claudeStatus,F.subscriptionClaudeStatus),claudeLoginState:()=>i(a.claudeLoginState,F.subscriptionClaudeLoginState),claudeLoginCode:e=>i(a.claudeLoginCode,F.subscriptionClaudeLoginCode,e),claudeLoginCancel:()=>i(a.claudeLoginCancel,F.subscriptionClaudeLoginCancel,{}),oauthLoginStart:e=>i(a.oauthLogin,F.subscriptionOauthLogin(e),{}),oauthLoginState:e=>i(a.oauthLoginState,F.subscriptionOauthLoginState(e)),oauthLoginCancel:e=>i(a.oauthLoginCancel,F.subscriptionOauthLoginCancel(e),{}),doctor:()=>i(a.doctor,F.doctor),listHosts:()=>i(a.listHosts,F.hosts),listHostSessions:e=>i(a.listHostSessions,F.hostSessions(e)),deleteHostSession:(e,t)=>i(a.deleteHostSession,F.hostSession(e,t),{method:`DELETE`}),updateHost:(e,t)=>i(a.updateHost,F.host(e),t),listHostSessionEntries:(e,t,n)=>i(a.listHostSessionEntries,`${F.hostSessionEntries(e,t)}${yl(n)}`),reportError:e=>i(a.errorReport,F.errorReport,e),sendBugReport:e=>i(a.bugReport,F.bugReport,e),listSessionFiles:(e,t)=>i(a.listSessionFiles,`${F.sessionFiles(e)}${yl({path:t})}`),readSessionFile:(e,t)=>i(a.readSessionFile,`${F.sessionFile(e)}${yl({path:t})}`,void 0,{raw:!0}),readSessionFileBytes:(e,t)=>i(a.readSessionFile,`${F.sessionFile(e)}${yl({path:t})}`,void 0,{bytes:!0}),deleteSessionFile:(e,t)=>i(a.deleteSessionFile,`${F.sessionFile(e)}${yl({path:t})}`)}}function Sl(e){return e instanceof vl&&(e.status===404||e.status===501)}var Cl=120;function wl(){return Cl}function Tl(e){let t=e.batchMs??120,n=e.hiddenBatchMs??1e3,r=e.isHidden??(()=>!1),i=e.now??(()=>Date.now()),a=e.setTimeout??((e,t)=>setTimeout(e,t)),o=e.clearTimeout??(e=>clearTimeout(e)),s=[],c=null,l=-1/0,u=!1,d=()=>{if(c!==null&&(o(c),c=null),s.length===0)return;let t=s;s=[],l=i(),e.deliver(t)};return{push(o){if(u)return;if(s.push(o),!e.isStreamFrame(o)){d();return}let f=r()?n:t;if(f<=0){d();return}if(c!==null)return;let p=i()-l;if(p>=f){d();return}c=a(()=>{c=null,d()},f-p)},flush:d,dispose(){u=!0,c!==null&&o(c),c=null,s=[]}}}function El(e,t,n){if((t.providerId??``)!==e.providerId||e.variantId!==void 0&&(t.variantId??null)!==(e.variantId??null)||!t.model)return!1;let r=Ds(t.model),i=Ds(e.model);if(r===i)return!0;let a=n.find(t=>t.definition.id===e.providerId)?.definition;return a!==void 0&&ws(a,i)===r}function Dl(e){return e instanceof vl&&e.code===`email_not_verified`}function Ol(e){if(!Dl(e))return null;let t={error:{code:e.code,message:e.message,details:e.details}};return k(t)?t.error.details:null}function kl(e){let t=e.trim(),n=t.indexOf(`@`);return n<=0?`***`:`${t.slice(0,1)}***${t.slice(n)}`}function Al(e,t){return e===void 0||!Number.isFinite(e)||e<=0?t:t+Math.ceil(e)*1e3}function jl(e,t){return Math.max(0,Math.ceil((e.resendAt-t)/1e3))}function Ml(e,t){if(!Dl(e))return null;let n=t.now??Date.now(),r=Ol(e),i=t.email.trim();return{email:i,displayEmail:r?.email||kl(i),verification:r?.verification??`pending`,registered:t.registered===!0,resendAt:Al(r?.resendAfterSec,n)}}function Nl(e){let t=e.registered?`Account created. `:``;return e.verification===`unverified`?`${t}Confirm your email first — no link is outstanding for ${e.displayEmail}; send a new one.`:`${t}Confirm your email first — we sent a link to ${e.displayEmail}.`}function Pl(e=null){return{sessionId:e,session:null,items:[],index:new Map,status:`idle`,activeTurnId:null,init:null,statusText:null,pendingPermissions:[],lastSeq:null,totals:{costUsd:0,inputTokens:0,cachedInputTokens:0,outputTokens:0,turns:0},turnCachedTokens:0,contextTokens:null,hydrated:!1,agentActivity:{},hasSubagentItems:!1,hasOptimisticUser:!1,lastLocalPromptId:null,lastFrameAt:null,lastLiveUuid:null,engineSince:null,subpathParents:{},seen:new Set,streams:{},nextId:1}}function Fl(e,t){let n=e.agentActivity[t.agentId],r={subpath:t.subpath,firstAt:n?Math.min(n.firstAt,t.at):t.at,at:n?Math.max(n.at,t.at):t.at,finished:t.finished,toolUses:(n?.toolUses??0)+t.toolUses};return{...e,agentActivity:{...e.agentActivity,[t.agentId]:r}}}function Il(e,t,n,r,i,a){let o=_u.exec(t)?.[2];if(!o)return e;let s=i&&Date.parse(i)||0;if(n!==`assistant`)return Fl(e,{agentId:o,subpath:t,at:s,finished:e.agentActivity[o]?.finished??!1,toolUses:0});let c=(Array.isArray(r)?r:[]).filter(e=>e.type===`tool_use`),l=c.length===0;return typeof a==`string`&&(l=a===`end_turn`||a===`stop_sequence`),c.some(e=>e.name===`StructuredOutput`)&&(l=!0),Fl(e,{agentId:o,subpath:t,at:s,finished:l,toolUses:c.length})}function Ll(e,t){switch(t.type){case`frame`:return Rl(e,t.frame,t.receivedAt);case`hydrate`:return pu(e,t.messages,t.session??null);case`entries`:return hu(e,t.entries);case`session`:return Su(e,t.session);case`local_prompt`:return wu(e,t);case`local_prompt_failed`:return Tu(e,t.requestId);case`local_permission`:return fu(e,t.requestId,t.behavior,`local`);case`local_system`:{let n={kind:`system`,id:`sys:${e.nextId}`,uuid:null,parentToolUseId:null,turnId:null,timestamp:null,subtype:t.subtype,text:t.text};return Mu({...e,nextId:e.nextId+1},n)}case`reset`:return Pl(e.sessionId)}}function Rl(e,t,n){let r=Ul(e,t,n);if(n===void 0||!Bl(t,e,r))return r;let i=r.lastFrameAt;return i!==null&&n>=i&&n-i<1e3?r:{...r,lastFrameAt:n}}function zl(e){return e===`running`||e===`waiting_permission`}function Bl(e,t,n){switch(e.type){case`agent`:return e.seq===null?e.message.type!==`system`||e.message.subtype!==`local_command`:!1;case`turn_started`:case`turn_finished`:case`prompt_delivered`:case`subagent_activity`:return!0;case`permission_request`:return n!==t;case`permission_resolved`:return!0;default:return!1}}function Vl(e){if(e.lastFrameAt!==null||!e.hydrated||!zl(e.status))return e;let t=e.engineSince??0;for(let n=e.items.length-1;n>=0;n--){let r=e.items[n].timestamp,i=r?Date.parse(r):NaN;if(Number.isFinite(i)){i>t&&(t=i);break}}for(let n of Object.values(e.agentActivity))n.at>t&&(t=n.at);return t>0?{...e,lastFrameAt:t}:e}function Hl(e,t,n){return t!==null||n===void 0||typeof e.timestamp==`string`?e:{...e,timestamp:new Date(n).toISOString()}}function Ul(e,t,n){switch(t.type){case`agent`:{if(t.seq!==null&&e.seen.has(`seq:${t.seq}`))return e;let r=Wl(e,Hl(t.message,t.seq,n),{turnId:t.turnId,receivedAt:n});return t.seq!==null&&(r=Iu(r,`seq:${t.seq}`),(r.lastSeq===null||t.seq>r.lastSeq)&&(r={...r,lastSeq:t.seq})),r}case`turn_started`:{let n=`turnstart:${t.turnId}`;if(e.seen.has(n))return e;let r=Iu(e,n);if(r={...r,activeTurnId:t.turnId,status:`running`,statusText:null,turnCachedTokens:0},t.requestId){let e=r.items.findIndex(e=>e.kind===`user`&&e.requestId===t.requestId);if(e>=0){let n={...r.items[e],turnId:t.turnId,waiting:!1};r=e<r.items.length-1?Mu(Pu(r,new Set([n.id])),n):Nu(r,e,n)}}return r}case`turn_finished`:return su(e,t.result,t.turnId);case`prompt_delivered`:return ru(e,t.text,t.deliveredAt,t.requestId);case`prompt_cancelled`:{let n=e.items.filter(e=>e.kind===`user`&&!e.failed&&(e.requestId===t.requestId||(e.waiting||e.optimistic)&&e.deliveredAt===null&&e.text===t.text));return Pu(e,new Set(n.map(e=>e.id)))}case`subagent_activity`:return Fl(e,{agentId:t.agentId,subpath:t.subpath,at:Date.parse(t.at)||Date.now(),finished:t.finished,toolUses:t.toolUses});case`permission_request`:return du(e,t.request,t.turnId,t.settled===!0);case`permission_resolved`:return fu(e,t.requestId,t.behavior,t.resolvedBy);case`session_state`:{let n=t.session;return Su((n.status===`idle`||n.status===`error`)&&e.pendingPermissions.length===0&&e.activeTurnId!==null?{...e,activeTurnId:null}:e,n)}case`error`:{if(t.code===`replay_truncated`||t.code===`replay_windowed`)return e;let r={kind:`error`,id:`err:${e.nextId}`,uuid:null,parentToolUseId:null,turnId:e.activeTurnId,timestamp:n===void 0?null:new Date(n).toISOString(),code:t.code,message:t.message,requestId:t.requestId??null};return Mu({...e,nextId:e.nextId+1},r)}default:return e}}function Wl(e,t,n){let r=typeof t.uuid==`string`?t.uuid:null,i=t.type===`stream_event`||t.type===`tool_progress`,a=r&&!i?`uuid:${r}`:null;if(i&&r!==null&&r===e.lastLiveUuid)return e;if(a&&e.seen.has(a))return t.type===`assistant`?Yl(e,t):e;let o=e;switch(t.type){case`system`:o=Gl(e,t,n);break;case`stream_event`:o=Kl(e,t,n);break;case`assistant`:o=Jl(e,t,n);break;case`user`:o=eu(e,t,n);break;case`result`:o=ou(e,t,n);break;case`tool_progress`:o=lu(e,t);break;case`auth_status`:o=uu(e,t,n);break;default:return e}return a?o=Iu(o,a):i&&r!==null&&(o={...o,lastLiveUuid:r}),o}function Gl(e,t,n){switch(t.subtype){case`init`:{let r={model:Hu(t.model),cwd:Hu(t.cwd),tools:Array.isArray(t.tools)?t.tools.filter(e=>typeof e==`string`):[],permissionMode:Hu(t.permissionMode),claudeCodeVersion:Hu(t.claude_code_version),apiKeySource:Hu(t.apiKeySource),sessionId:Hu(t.session_id),mcpServers:Array.isArray(t.mcp_servers)?t.mcp_servers:[]};return{...e,init:r,engineSince:n.receivedAt??Date.now()}}case`compact_boundary`:{let r=t.compact_metadata??{},i={kind:`compact`,id:Ru(e,`compact`,t),uuid:zu(t),parentToolUseId:Bu(t),turnId:n.turnId,timestamp:Vu(t),trigger:r.trigger===`manual`?`manual`:`auto`,preTokens:typeof r.pre_tokens==`number`?r.pre_tokens:0,postTokens:typeof r.post_tokens==`number`?r.post_tokens:null};return Mu(Lu(e),i)}case`status`:{let n=typeof t.status==`string`?t.status:null;return{...e,statusText:n}}case`task_notification`:{let r=pe({taskId:Hu(t.task_id)||null,toolUseId:Hu(t.tool_use_id)||null,status:Hu(t.status)||null,summary:Hu(t.summary)||null});if(Ou(e,r))return e;let i=zu(t),a={kind:`user`,id:i?`u:${i}`:`i${e.nextId}`,uuid:i,parentToolUseId:Bu(t),turnId:n.turnId,timestamp:Vu(t),text:r,attachments:[],requestId:null,optimistic:!1,failed:!1,waiting:!1,deliveredAt:null,compactSummary:!1,taskNotification:!0,engineNote:!1};return e.index.get(a.id)===void 0?Mu(i?e:Lu(e),a):e}case`permission_denied`:{let n=Hu(t.tool_use_id),r=Hu(t.message);return Fu(e,n,e=>{let t=e.name===`AskUserQuestion`&&r===`the user skipped the question`;return{...e,status:t?`skipped`:`denied`,result:e.result??{content:r||`Permission denied`,isError:!t,structured:null}}})}case`rewind_boundary`:{let n={kind:`system`,id:`sys:${e.nextId}`,uuid:zu(t),parentToolUseId:Bu(t),turnId:e.activeTurnId,timestamp:Vu(t),subtype:`rewind`,text:typeof t.content==`string`&&t.content.trim()?t.content.trim():`Rewound here — the conversation was taken back to this point and continued differently.`};return Mu({...e,nextId:e.nextId+1},n)}default:{let n=typeof t.content==`string`?t.content.trim():``,r=n?$l(n):null;if(!r||r.subtype===`caveat`)return e;let i={kind:`system`,id:`sys:${e.nextId}`,uuid:zu(t),parentToolUseId:Bu(t),turnId:e.activeTurnId,timestamp:Vu(t),subtype:r.subtype,text:r.text};return Mu({...e,nextId:e.nextId+1},i)}}}function Kl(e,t,n){let r=t.event;if(!r||typeof r!=`object`)return e;let i=Bu(t),a=i??``,o=e.streams[a]??{messageId:null,model:null,blocks:{},unclaimed:[]};switch(r.type){case`message_start`:{let t=r.message,n={messageId:t?.id??null,model:t?.model??null,blocks:{},unclaimed:[]},i=e;for(let e of o.unclaimed)i=ql(i,e);return{...i,streams:{...i.streams,[a]:n}}}case`content_block_start`:{let s=r.content_block,c=e,l;if(s.type===`text`)l={kind:`assistant`,id:`i${e.nextId}`,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),text:s.text??``,streaming:!0,model:o.model,messageId:o.messageId,error:null,aborted:!1},c=Lu(c);else if(s.type===`thinking`||s.type===`redacted_thinking`)l={kind:`thinking`,id:`i${e.nextId}`,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),text:s.type===`thinking`?s.thinking??``:``,streaming:!0,redacted:s.type===`redacted_thinking`},c=Lu(c);else if(s.type===`tool_use`){let c=s;if(e.index.get(c.id)!==void 0){let t={...o.blocks,[r.index]:c.id};return{...e,streams:{...e.streams,[a]:{...o,blocks:t}}}}let u=c.input&&Object.keys(c.input).length>0;l={kind:`tool`,id:c.id,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),toolUseId:c.id,name:c.name,input:u?c.input:null,inputJson:u?JSON.stringify(c.input):``,status:`streaming`,result:null,startedAt:n.receivedAt??null,finishedAt:null,durationMs:null,elapsedSec:null,permissionRequestId:null,messageId:o.messageId}}else return e;c=Mu(c,l);let u={...o.blocks,[r.index]:l.id},d=[...o.unclaimed,l.id];return{...c,streams:{...c.streams,[a]:{...o,blocks:u,unclaimed:d}}}}case`content_block_delta`:{let t=o.blocks[r.index];if(!t)return e;let n=e.index.get(t);if(n===void 0)return e;let i=e.items[n],a=r.delta;return a.type===`text_delta`&&i.kind===`assistant`?Nu(e,n,{...i,text:i.text+a.text}):a.type===`thinking_delta`&&i.kind===`thinking`?Nu(e,n,{...i,text:i.text+a.thinking}):a.type===`input_json_delta`&&i.kind===`tool`?Nu(e,n,{...i,inputJson:i.inputJson+a.partial_json}):e}case`content_block_stop`:{let t=o.blocks[r.index];return t?ql(e,t,n.receivedAt):e}case`message_delta`:case`message_stop`:case`ping`:return e;case`error`:{let a={kind:`error`,id:`err:${e.nextId}`,uuid:null,parentToolUseId:i,turnId:n.turnId,timestamp:Vu(t),code:r.error?.type??`stream_error`,message:r.error?.message??`stream error`,requestId:null};return Mu(Lu(e),a)}default:return e}}function ql(e,t,n){let r=e.index.get(t);if(r===void 0)return e;let i=e.items[r];if(i.kind===`assistant`||i.kind===`thinking`)return i.streaming?Nu(e,r,{...i,streaming:!1}):e;if(i.kind===`tool`&&i.status===`streaming`){let t=i.input??Ku(i.inputJson);return Nu(e,r,{...i,input:t,status:`running`,startedAt:i.startedAt??n??null})}return e}function Jl(e,t,n){let r=t.message??{},i=Wu(r.content),a=Bu(t),o=a??``,s=zu(t),c=Vu(t),l=typeof t.error==`string`?t.error:null,u=t.aborted===!0,d=e;{let e=Uu(r.usage?.cache_read_input_tokens)+Uu(r.usage?.cache_creation_input_tokens),n=`usage:${r.id??``}`;if(e>0&&r.id&&!d.seen.has(n)&&(d={...Iu(d,n),turnCachedTokens:d.turnCachedTokens+e}),a===null&&t.isSidechain!==!0){let t=Uu(r.usage?.input_tokens)+e+Uu(r.usage?.output_tokens);t>0&&t!==d.contextTokens&&(d={...d,contextTokens:t})}}let f=d.streams[o];for(let e of i){let t=f?Xl(d,f,e):null;if(t){let n=d.index.get(t),i=d.items[n];d=Nu(d,n,Zl(i,e,{uuid:s,timestamp:c,model:r.model??null,messageId:r.id??null,errorText:l,aborted:u})),f={...f,unclaimed:f.unclaimed.filter(e=>e!==t)},d={...d,streams:{...d.streams,[o]:f}};continue}let i=Ql(d,e,{uuid:s,timestamp:c,parentToolUseId:a,turnId:n.turnId,model:r.model??null,messageId:r.id??null,errorText:l,aborted:u,receivedAt:n.receivedAt});i&&(d=i)}if(i.length===0&&l){let e={kind:`error`,id:`err:${d.nextId}`,uuid:s,parentToolUseId:a,turnId:n.turnId,timestamp:c,code:`assistant_error`,message:l,requestId:null};d=Mu(Lu(d),e)}return d}function Yl(e,t){let n=Bu(t)??``,r=e.streams[n];if(!r||r.unclaimed.length===0)return e;let i=t.message??{},a=new Set,o=e,s=r;for(let e of Wu(i.content)){let t=Xl(o,s,e);t&&(a.add(t),s={...s,unclaimed:s.unclaimed.filter(e=>e!==t)},o={...o,streams:{...o.streams,[n]:s}})}return Pu(e,a)}function Xl(e,t,n){for(let r of t.unclaimed){let t=e.index.get(r);if(t===void 0)continue;let i=e.items[t];if(!i.uuid&&(n.type===`text`&&i.kind===`assistant`||(n.type===`thinking`||n.type===`redacted_thinking`)&&i.kind===`thinking`||n.type===`tool_use`&&i.kind===`tool`&&i.toolUseId===n.id))return r}return null}function Zl(e,t,n){if(e.kind===`assistant`&&t.type===`text`){let r=t.text??e.text;return{...e,uuid:n.uuid,timestamp:n.timestamp??e.timestamp,text:r.length>=e.text.length?r:e.text,streaming:!1,model:n.model??e.model,messageId:n.messageId??e.messageId,error:n.errorText,aborted:n.aborted}}if(e.kind===`thinking`){let r=t.type===`thinking`?t.thinking??e.text:e.text;return{...e,uuid:n.uuid,timestamp:n.timestamp??e.timestamp,text:r||e.text,streaming:!1}}if(e.kind===`tool`&&t.type===`tool_use`){let r=t,i=r.input&&Object.keys(r.input).length>0?r.input:e.input??Ku(e.inputJson);return{...e,uuid:n.uuid,timestamp:n.timestamp??e.timestamp,name:r.name??e.name,input:i,inputJson:e.inputJson||(i?JSON.stringify(i):``),status:e.status===`streaming`?`running`:e.status,messageId:n.messageId??e.messageId}}return e}function Ql(e,t,n){let r={uuid:n.uuid,parentToolUseId:n.parentToolUseId,turnId:n.turnId,timestamp:n.timestamp};if(t.type===`text`){let i={kind:`assistant`,id:`i${e.nextId}`,...r,text:t.text??``,streaming:!1,model:n.model,messageId:n.messageId,error:n.errorText,aborted:n.aborted};return Mu(Lu(e),i)}if(t.type===`thinking`||t.type===`redacted_thinking`){let n={kind:`thinking`,id:`i${e.nextId}`,...r,text:t.type===`thinking`?t.thinking??``:``,streaming:!1,redacted:t.type===`redacted_thinking`};return Mu(Lu(e),n)}if(t.type===`tool_use`){let i=t,a=e.index.get(i.id);if(a!==void 0){let r=e.items[a];return Nu(e,a,Zl(r,t,n))}let o=i.input&&typeof i.input==`object`?i.input:null;return Mu(e,{kind:`tool`,id:i.id,...r,toolUseId:i.id,name:i.name,input:o,inputJson:o?JSON.stringify(o):``,status:`running`,result:null,startedAt:n.receivedAt??null,finishedAt:null,durationMs:null,elapsedSec:null,permissionRequestId:null,messageId:n.messageId})}return null}function $l(e){if(/^<local-command-caveat>/.test(e))return{subtype:`caveat`,text:``};let t=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/.exec(e);if(t){let e=t[2].replace(/\u001b\[[0-9;]*m/g,``).trim();return{subtype:t[1]===`stderr`?`local-command-error`:`local-command`,text:e}}let n=/<command-name>([^<]*)<\/command-name>/.exec(e);if(n&&/^<command-/.test(e)){let t=/<command-args>([^<]*)<\/command-args>/.exec(e)?.[1]?.trim()??``;return{subtype:`command`,text:`${n[1].trim()}${t?` `+t:``}`}}return null}function eu(e,t,n){let r=t.message??{},i=Bu(t),a=zu(t),o=Vu(t),s=t.isSynthetic===!0,c=e,l=[],u=[],d=!1;if(typeof r.content==`string`)l.push(r.content);else for(let e of Wu(r.content))if(e.type===`text`)l.push(e.text??``);else if(e.type===`tool_result`){d=!0;let r=e;c=iu(c,r.tool_use_id,{content:r.content??``,isError:r.is_error===!0,structured:t.tool_use_result??null},n.receivedAt)}else(e.type===`image`||e.type===`document`)&&u.push(e);let f=se(l.join(`
|
|
78
78
|
`)).trim();if(de(f)&&Ou(c,f))return c;let p=$l(f);if(p?.subtype===`caveat`)return c;if(p){let e={kind:`system`,id:`sys:${c.nextId}`,uuid:a,parentToolUseId:i,turnId:c.activeTurnId,timestamp:o,subtype:p.subtype,text:p.text};return Mu({...c,nextId:c.nextId+1},e)}if(f.length===0&&u.length===0||d&&f.length===0||s&&d)return c;if(i===null&&!s&&c.hasOptimisticUser){let e=c.items.findIndex(e=>e.kind===`user`&&e.optimistic&&!e.failed&&e.text===f);if(e<0&&(c={...c,hasOptimisticUser:!1}),e>=0){let t=c.items[e],r={...t,uuid:a??t.uuid,timestamp:o??t.timestamp,optimistic:!1,turnId:t.turnId??n.turnId};return t.waiting&&e<c.items.length-1?Mu(Pu(c,new Set([t.id])),{...r,waiting:!1}):Nu(c,e,r)}}let m=t.isMeta===!0||ie(f),h=t.isCompactSummary===!0||te(f)||de(f),g=Vs(f),_={kind:`user`,id:a?`u:${a}`:`i${c.nextId}`,uuid:a,parentToolUseId:i,turnId:n.turnId,timestamp:o,text:f,attachments:u,requestId:null,optimistic:!1,failed:!1,waiting:!s&&!m&&!h&&g===null&&i===null&&n.turnId!==null&&tu(c,n.turnId),deliveredAt:null,compactSummary:t.isCompactSummary===!0||te(f),taskNotification:de(f),engineNote:!te(f)&&!de(f)&&m,...g?{scheduledTask:g.title}:{}};return c.index.get(_.id)===void 0?Mu(a?c:Lu(c),_):c}function tu(e,t){if(e.status!==`running`)return!1;for(let n=e.items.length-1;n>=0;n--){let r=e.items[n];if((t===null||r.turnId===null||r.turnId===t)&&(r.kind===`assistant`||r.kind===`thinking`||r.kind===`tool`))return!0}return!1}function nu(e){let t=-1;for(let n=e.items.length-1;n>=0;n--){let r=e.items[n];if(r.kind===`user`&&r.waiting){t=n;break}}if(t<0)return e;let n=e.items.map(e=>e.kind===`user`&&e.waiting?{...e,waiting:!1}:e);return{...e,items:n}}function ru(e,t,n,r){let i=r!==void 0&&e.items.some(e=>e.kind===`user`&&!e.failed&&e.requestId===r);for(let a=e.items.length-1;a>=0;a--){let o=e.items[a];if(o.kind!==`user`||o.failed||(i?o.requestId!==r:o.text!==t))continue;if(!o.optimistic&&!o.waiting&&o.deliveredAt!==null)return e;let s={...o,optimistic:!1,waiting:!1,deliveredAt:n??o.deliveredAt??new Date().toISOString()};return o.waiting&&a<e.items.length-1?Mu(Pu(e,new Set([o.id])),s):Nu(e,a,s)}return e}function iu(e,t,n,r){let i=e.index.get(t);if(i===void 0)return Mu(e,{kind:`tool`,id:t,uuid:null,parentToolUseId:null,turnId:null,timestamp:null,toolUseId:t,name:`unknown`,input:null,inputJson:``,status:n.isError?`error`:`done`,result:n,startedAt:null,finishedAt:r??null,durationMs:null,elapsedSec:null,permissionRequestId:null,messageId:null});let a=e.items[i];if(a.result&&a.status!==`running`&&a.status!==`streaming`&&a.status!==`pending`)return e;let o=r??null,s=a.startedAt!==null&&o!==null?Math.max(0,o-a.startedAt):a.durationMs;return Nu(e,i,{...a,input:a.input??Ku(a.inputJson),result:au(a.name,n)?{...n,isError:!1}:n,status:au(a.name,n)?`skipped`:n.isError?`error`:`done`,finishedAt:o,durationMs:s})}function au(e,t){return!t.isError||e!==`AskUserQuestion`?!1:typeof t.content==`string`&&t.content.includes(`the user skipped the question`)}function ou(e,t,n){let r=ol(t.usage,t.modelUsage),i=Array.isArray(t.permission_denials)?t.permission_denials:[],a=n.turnId;return cu(e,{kind:`result`,id:a?`result:${a}`:zu(t)?`result:${zu(t)}`:`result:${e.nextId}`,uuid:zu(t),parentToolUseId:null,turnId:a,timestamp:Vu(t),subtype:typeof t.subtype==`string`?t.subtype:`success`,isError:t.is_error===!0||typeof t.result==`string`&&/^API Error\b/i.test(t.result.trim()),costUsd:Uu(t.total_cost_usd),durationMs:Uu(t.duration_ms),durationApiMs:typeof t.duration_api_ms==`number`?t.duration_api_ms:null,numTurns:Uu(t.num_turns),inputTokens:r.input,cachedInputTokens:r.cached||e.turnCachedTokens,outputTokens:r.output,text:typeof t.result==`string`?t.result:null,errors:Array.isArray(t.errors)?t.errors.map(String):[],stopReason:typeof t.stop_reason==`string`?t.stop_reason:null,structuredOutput:t.structured_output??null},new Set(i.map(e=>e.tool_use_id??``)),n.receivedAt)}function su(e,t,n){e=nu(e);let r=`result:${n}`,i=e.index.get(r),a={kind:`result`,id:r,uuid:i===void 0?null:e.items[i].uuid,parentToolUseId:null,turnId:n,timestamp:i===void 0?null:e.items[i].timestamp,subtype:t.subtype,isError:t.isError,costUsd:t.totalCostUsd,durationMs:t.durationMs,durationApiMs:i===void 0?null:e.items[i].durationApiMs,numTurns:t.numTurns,inputTokens:t.inputTokens,cachedInputTokens:t.cachedInputTokens??(i===void 0?void 0:e.items[i].cachedInputTokens)??e.turnCachedTokens,outputTokens:t.outputTokens,text:t.result,errors:t.errors??[],stopReason:t.stopReason,structuredOutput:t.structuredOutput??null};return cu(e,a,new Set,void 0)}function cu(e,t,n,r){let i=e,a=i.index.get(t.id),o=a!==void 0;i=a===void 0?Mu(Lu(i),t):Nu(i,a,t);let s=i.items.map(e=>{if((e.kind===`assistant`||e.kind===`thinking`)&&e.streaming)return{...e,streaming:!1};if(e.kind===`tool`&&e.result===null&&(e.status===`streaming`||e.status===`running`||e.status===`pending`)){let t=n.has(e.toolUseId)?`denied`:`cancelled`;return{...e,status:t,input:e.input??Ku(e.inputJson),finishedAt:r??null}}return e}),c=o?i.totals:{costUsd:i.totals.costUsd+t.costUsd,inputTokens:i.totals.inputTokens+t.inputTokens,cachedInputTokens:i.totals.cachedInputTokens+(t.cachedInputTokens??0),outputTokens:i.totals.outputTokens+t.outputTokens,turns:i.totals.turns+1};return{...i,items:s,totals:c,status:t.isError?`error`:`idle`,activeTurnId:null,statusText:null,streams:{},pendingPermissions:[]}}function lu(e,t){let n=Hu(t.tool_use_id),r=typeof t.elapsed_time_seconds==`number`?t.elapsed_time_seconds:null;return!n||r===null?e:Fu(e,n,e=>e.result?e:{...e,elapsedSec:r})}function uu(e,t,n){let r=Array.isArray(t.output)?t.output.map(String).join(`
|
|
79
79
|
`):``,i=typeof t.error==`string`?t.error:null,a=i?`Authentication error: ${i}`:t.isAuthenticating?`Authenticating…\n${r}`.trim():r;if(!a)return e;let o={kind:`system`,id:`sys:${e.nextId}`,uuid:zu(t),parentToolUseId:null,turnId:n.turnId,timestamp:Vu(t),subtype:`auth_status`,text:a};return Mu(Lu(e),o)}function du(e,t,n,r=!1){let i=`perm:${t.requestId}`;if(e.index.get(i)!==void 0)return e;let a=e.index.get(t.toolUseId),o=a===void 0?void 0:e.items[a],s=Mu(e,{kind:`permission`,id:i,uuid:null,parentToolUseId:o?.kind===`tool`?o.parentToolUseId:null,turnId:n,timestamp:t.createdAt,request:t,status:`pending`,resolvedBy:null});return s=Fu(s,t.toolUseId,e=>({...e,permissionRequestId:t.requestId,status:e.result?e.status:`pending`})),r?{...s,activeTurnId:s.activeTurnId??n}:{...s,pendingPermissions:[...s.pendingPermissions.filter(e=>e.requestId!==t.requestId),t],status:`waiting_permission`,activeTurnId:s.activeTurnId??n}}function fu(e,t,n,r){let i=`perm:${t}`,a=e.index.get(i),o=e,s=null;if(a!==void 0){let e=o.items[a];s=e.request.toolUseId,e.status===`pending`&&(o=Nu(o,a,{...e,status:n===`allow`?`allowed`:`denied`,resolvedBy:r}))}let c=o.pendingPermissions.filter(e=>e.requestId!==t);s&&(o=Fu(o,s,e=>e.result?e:{...e,status:n===`allow`?`running`:`denied`}));let l=c.length>0?`waiting_permission`:o.activeTurnId||o.status===`waiting_permission`?`running`:o.status;return{...o,pendingPermissions:c,status:l}}function pu(e,t,n){return Au(e,e=>mu(e,t,n))}function mu(e,t,n){let r=e;for(let e of t){let t=e.parentToolUseId;if(e.subpath&&(r=Il(r,e.subpath,e.role,e.content,e.timestamp)),e.subpath&&(t===null||r.index.get(t)===void 0)){let n=xu(r,e.subpath);r=n.state,t=n.parentToolUseId}let n={type:e.role===`assistant`?`assistant`:e.role===`user`?`user`:`system`,uuid:e.uuid,parent_tool_use_id:t,timestamp:e.timestamp??void 0};if(e.role===`system`){let t=typeof e.content==`string`?e.content:Gu(Wu(e.content));if(!t||r.seen.has(`uuid:${e.uuid}`))continue;let n={kind:`system`,id:`sys:${e.uuid}`,uuid:e.uuid,parentToolUseId:e.parentToolUseId,turnId:null,timestamp:e.timestamp,subtype:e.subtype===`rewind_boundary`?`rewind`:`history`,text:t};r.index.get(n.id)===void 0&&(r=Iu(Mu(r,n),`uuid:${e.uuid}`));continue}let i=e.role===`assistant`?{id:null,role:`assistant`,model:e.model,content:Wu(e.content)}:{role:`user`,content:typeof e.content==`string`?e.content:Wu(e.content)};r=Wl(r,{...n,message:i},{turnId:null,receivedAt:void 0})}return r={...r,hydrated:!0},r=n?Su(r,n):Cu(r),Vl(r)}function hu(e,t){return Au(e,e=>gu(e,t))}function gu(e,t){let n=e;for(let e of t){let t=`seq:${e.seq}`;if(n.seen.has(t))continue;let r=e.entry,i=e.type||String(r.type??``);if(i===`attachment`){let t=le(r);if(t!==null){let i={type:`user`,uuid:e.uuid??(typeof r.uuid==`string`?r.uuid:void 0),parent_tool_use_id:null,timestamp:e.timestamp??void 0,message:{role:`user`,content:t.content}};n=Wl(n,i,{turnId:null,receivedAt:void 0}),typeof t.content!=`string`&&(n=ru(n,t.text,t.timestamp))}}if(i===`queue-operation`){let e=ce(r);e&&(n=ru(n,e.text,e.deliveredAt))}if(i===`user`||i===`assistant`||i===`system`||i===`result`){let t=r.parent_tool_use_id??null;if(e.subpath){let t=r.message;n=Il(n,e.subpath,i,t?.content,e.timestamp,t?.stop_reason)}if(e.subpath&&(t===null||n.index.get(t)===void 0)){let r=xu(n,e.subpath);n=r.state,t=r.parentToolUseId}let a={...r,type:i,uuid:e.uuid??(typeof r.uuid==`string`?r.uuid:void 0),parent_tool_use_id:t,timestamp:e.timestamp??void 0};n=Wl(n,a,{turnId:null,receivedAt:void 0})}n=Iu(n,t),(n.lastSeq===null||e.seq>n.lastSeq)&&(n={...n,lastSeq:e.seq})}return Vl(Cu({...n,hydrated:!0}))}var _u=/^subagents\/(?:workflows\/([^/]+)\/)?agent-(.+?)(?:\.jsonl)?$/;function vu(e){return`subagent:${e}`}function yu(e){return`subagent:workflows/${e}`}function bu(e,t,n,r){return{kind:`tool`,id:e,uuid:null,parentToolUseId:r,turnId:null,timestamp:null,toolUseId:e,name:t,input:{description:n},inputJson:``,status:`done`,result:null,startedAt:null,finishedAt:null,durationMs:null,elapsedSec:null,permissionRequestId:null,messageId:null}}function xu(e,t){if(!t)return{state:e,parentToolUseId:null};let n=e.subpathParents[t];if(n!==void 0&&e.index.get(n)!==void 0)return{state:e,parentToolUseId:n};let r=_u.exec(t);if(!r)return{state:e,parentToolUseId:null};let i=r[1]??null,a=r[2],o=(e,n)=>({state:ku?(e.subpathParents[t]=n,e):{...e,subpathParents:{...e.subpathParents,[t]:n}},parentToolUseId:n}),s=e.index.get(a);if(s!==void 0){let t=e.items[s];if(t?.kind===`tool`)return o(e,t.toolUseId)}if(i){for(let t of e.items)if(t.kind===`tool`&&t.name===`Workflow`&&t.result!==null&&qu(t.result).includes(i))return o(e,t.toolUseId)}let c=vu(t);if(e.index.get(c)!==void 0)return o(e,c);let l=a.slice(0,8),u=e,d=null;i&&(d=yu(i),u.index.get(d)===void 0&&(u=Mu(u,bu(d,`Workflow`,`Workflow run ${i} (transcript)`,null))));let f=bu(c,`Agent`,i?`Agent ${l}`:`Agent ${l} (transcript)`,d);return o(Mu(u,f),c)}function Su(e,t){let n=e.pendingPermissions.length>0?`waiting_permission`:t.status,r=t.engineSince?Date.parse(t.engineSince):NaN,i=e.hydrated&&e.session!==null&&!zl(e.status)&&zl(n),a=Vl(Cu({...e,session:t,sessionId:t.id,status:n,engineSince:Number.isFinite(r)?r:e.engineSince,...i?{lastFrameAt:null}:{}}));if(!i)return a;let o=Date.parse(t.updatedAt);return Number.isFinite(o)&&o>(a.lastFrameAt??0)?{...a,lastFrameAt:o}:a}function Cu(e){if(e.activeTurnId!==null||e.status!==`idle`&&e.status!==`error`)return e;let t=!1,n=e.items.map(e=>(e.kind===`assistant`||e.kind===`thinking`)&&e.streaming?(t=!0,{...e,streaming:!1}):e.kind===`tool`&&e.result===null&&(e.status===`streaming`||e.status===`running`||e.status===`pending`)?(t=!0,{...e,status:`cancelled`,input:e.input??Ku(e.inputJson)}):e);return t?{...e,items:n}:e}function wu(e,t){let n=(t.attachments??[]).filter(e=>typeof e==`object`&&!!e&&typeof e.type==`string`),r={kind:`user`,id:`req:${t.requestId}`,uuid:null,parentToolUseId:null,turnId:null,timestamp:t.at??null,text:t.text,attachments:n,requestId:t.requestId,optimistic:!0,failed:!1,waiting:e.status===`running`,deliveredAt:null,compactSummary:!1,taskNotification:!1,engineNote:!1};if(e.index.get(r.id)!==void 0)return e;let i=new Set(e.items.filter(e=>e.kind===`user`&&e.failed&&e.text===t.text).map(e=>e.id)),a=!zl(e.status),o=t.at===void 0?NaN:Date.parse(t.at);return{...Mu(Pu(e,i),r),status:`running`,statusText:null,hasOptimisticUser:!0,lastLocalPromptId:r.id,...a?{lastFrameAt:Number.isFinite(o)?o:null}:{}}}function Tu(e,t){let n=e.index.get(`req:${t}`),r=e;if(n!==void 0){let t=e.items[n];t?.kind===`user`&&!t.failed&&(r=Nu(e,n,{...t,failed:!0}))}return r.activeTurnId!==null||r.status!==`running`&&r.status!==`waiting_permission`?r:{...r,status:`error`,statusText:null}}function Eu(e,t){let n=new Map,r=new Map;for(let t of e){let e={item:t,children:[]};n.set(t.id,e),t.kind===`tool`&&r.set(t.toolUseId,e)}let i=[];for(let t of e){let e=n.get(t.id),a=t.parentToolUseId?r.get(t.parentToolUseId):void 0;a&&a!==e?a.children.push(e):i.push(e)}if(!t||t.length===0)return i;let a=new Map,o=e=>{for(let t of e)a.set(t.item.id,t),t.children.length>0&&o(t.children)};o(t);let s=new Map;for(let t=e.length-1;t>=0;t--){let r=n.get(e[t].id);for(let e=0;e<r.children.length;e++){let t=s.get(r.children[e]);t&&(r.children[e]=t)}let i=a.get(r.item.id);s.set(r,i&&Du(i,r)?i:r)}let c=i.map(e=>s.get(e)??e);return c.length===t.length&&c.every((e,n)=>e===t[n])?t:c}function Du(e,t){if(e.item!==t.item||e.children.length!==t.children.length)return!1;for(let n=0;n<t.children.length;n++)if(e.children[n]!==t.children[n])return!1;return!0}function Ou(e,t){let n=me(t);if(!n.taskId)return!1;for(let t=e.items.length-1;t>=0;t--){let r=e.items[t];if(r.kind!==`user`||!r.taskNotification)continue;let i=me(r.text);if(i.taskId===n.taskId&&(i.toolUseId??null)===(n.toolUseId??null))return!0}return!1}var ku=!1;function Au(e,t){if(ku)return t(e);ku=!0;try{return t({...e,items:e.items.slice(),index:new Map(e.index),seen:new Set(e.seen),subpathParents:{...e.subpathParents}})}finally{ku=!1}}var ju=new Set([`Task`,`Agent`,`Workflow`]);function Mu(e,t){let n=e.hasSubagentItems||t.kind===`tool`&&ju.has(t.name);if(ku)return e.items.push(t),e.index.set(t.id,e.items.length-1),e.hasSubagentItems=n,e;let r=[...e.items,t];return{...e,items:r,index:new Map(e.index).set(t.id,r.length-1),...n===e.hasSubagentItems?{}:{hasSubagentItems:n}}}function Nu(e,t,n){if(ku)return e.items[t]=n,e;let r=e.items.slice();return r[t]=n,{...e,items:r}}function Pu(e,t){if(t.size===0)return e;let n=e.items.filter(e=>!t.has(e.id)),r=new Map;n.forEach((e,t)=>{r.set(e.id,t)});let i={};for(let[n,r]of Object.entries(e.streams)){let e={};for(let[n,i]of Object.entries(r.blocks))t.has(i)||(e[Number(n)]=i);i[n]={...r,blocks:e,unclaimed:r.unclaimed.filter(e=>!t.has(e))}}return{...e,items:n,index:r,streams:i}}function Fu(e,t,n){let r=e.index.get(t);if(r===void 0)return e;let i=e.items[r];if(!i||i.kind!==`tool`)return e;let a=n(i);return a===i?e:Nu(e,r,a)}function Iu(e,t){return e.seen.has(t)?e:ku?(e.seen.add(t),e):{...e,seen:new Set(e.seen).add(t)}}function Lu(e){return{...e,nextId:e.nextId+1}}function Ru(e,t,n){let r=zu(n);return r?`${t}:${r}`:`${t}:${e.nextId}`}function zu(e){return typeof e.uuid==`string`&&e.uuid?e.uuid:null}function Bu(e){return typeof e.parent_tool_use_id==`string`&&e.parent_tool_use_id?e.parent_tool_use_id:null}function Vu(e){return typeof e.timestamp==`string`?e.timestamp:null}function Hu(e){return typeof e==`string`?e:``}function Uu(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function Wu(e){return typeof e==`string`?e?[{type:`text`,text:e}]:[]:Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.type==`string`):[]}function Gu(e){return e.map(e=>e.type===`text`?e.text??``:``).filter(Boolean).join(`
|
|
80
80
|
`)}function Ku(e){let t=e.trim();if(!t)return null;try{let e=JSON.parse(t);return typeof e==`object`&&e&&!Array.isArray(e)?e:null}catch{return null}}function qu(e){return e?typeof e.content==`string`?e.content:e.content.map(e=>e.type===`text`?e.text??``:e.type===`image`?`[image]`:`[${e.type}]`).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-
|
|
107
|
+
<script type="module" crossorigin src="./assets/index-DkJLKG_p.js"></script>
|
|
108
108
|
<link rel="stylesheet" crossorigin href="./assets/index-CV8nMt98.css">
|
|
109
109
|
</head>
|
|
110
110
|
<body>
|