@oonacode/linux-x64 0.3.247 → 0.3.249
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.
|
@@ -77,7 +77,7 @@ Error generating stack: `+e.message+`
|
|
|
77
77
|
|
|
78
78
|
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 ga(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:ya(t,`input`,e.processors),output:ya(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function _a(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 _a(r.element,n);if(r.type===`set`)return _a(r.valueType,n);if(r.type===`lazy`)return _a(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 _a(r.innerType,n);if(r.type===`intersection`)return _a(r.left,n)||_a(r.right,n);if(r.type===`record`||r.type===`map`)return _a(r.keyType,n)||_a(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:_a(r.in,n)||_a(r.out,n);if(r.type===`object`){for(let e in r.shape)if(_a(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(_a(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(_a(e,n))return!0;return!!(r.rest&&_a(r.rest,n))}return!1}var va=(e,t={})=>n=>{let r=pa({...n,processors:t});return ma(e,r),ha(r,e),ga(r,e)},ya=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=pa({...i??{},target:a,io:t,processors:n});return ma(e,o),ha(o,e),ga(o,e)},ba={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},xa=(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=ba[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}))])}},Sa=(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)},Ca=(e,t,n,r)=>{n.type=`boolean`},wa=(e,t,n,r)=>{n.not={}},Ta=(e,t,n,r)=>{let i=e._zod.def,a=Ye(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ea=(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}},Da=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Oa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ka=(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=ma(a.element,t,{...r,path:[...r.path,`items`]})},Aa=(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]=ma(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=ma(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ja=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ma(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ma=(e,t,n,r)=>{let i=e._zod.def,a=ma(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ma(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]]},Na=(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=ma(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=ma(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ma(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)}},Pa=(e,t,n,r)=>{let i=e._zod.def,a=ma(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`}]},Fa=(e,t,n,r)=>{let i=e._zod.def;ma(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ia=(e,t,n,r)=>{let i=e._zod.def;ma(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},La=(e,t,n,r)=>{let i=e._zod.def;ma(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)))},Ra=(e,t,n,r)=>{let i=e._zod.def;ma(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},za=(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;ma(o,t,r);let s=t.seen.get(e);s.ref=o},Ba=(e,t,n,r)=>{let i=e._zod.def;ma(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Va=(e,t,n,r)=>{let i=e._zod.def;ma(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ha=U(`ZodISODateTime`,(e,t)=>{cr.init(e,t),ho.init(e,t)});function Ua(e){return Pi(Ha,e)}var Wa=U(`ZodISODate`,(e,t)=>{lr.init(e,t),ho.init(e,t)});function Ga(e){return Fi(Wa,e)}var Ka=U(`ZodISOTime`,(e,t)=>{ur.init(e,t),ho.init(e,t)});function qa(e){return Ii(Ka,e)}var Ja=U(`ZodISODuration`,(e,t)=>{dr.init(e,t),ho.init(e,t)});function Ya(e){return Li(Ja,e)}var Xa=U(`ZodError`,(e,t)=>{Nt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>It(e,t)},flatten:{value:t=>Ft(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Xe,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Xe,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Za=Lt(Xa),Qa=Rt(Xa),$a=zt(Xa),eo=Vt(Xa),to=Ut(Xa),no=Wt(Xa),ro=Gt(Xa),io=Kt(Xa),ao=qt(Xa),oo=Jt(Xa),so=Yt(Xa),co=Xt(Xa),lo=new WeakMap;function uo(e,t,n){let r=Object.getPrototypeOf(e),i=lo.get(r);if(i||(i=new Set,lo.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 fo=U(`ZodType`,(e,t)=>(Jn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ya(e,`input`),output:ya(e,`output`)}}),e.toJSONSchema=va(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Za(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>$a(e,t,n),e.parseAsync=async(t,n)=>Qa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>eo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>to(e,t,n),e.decode=(t,n)=>no(e,t,n),e.encodeAsync=async(t,n)=>ro(e,t,n),e.decodeAsync=async(t,n)=>io(e,t,n),e.safeEncode=(t,n)=>ao(e,t,n),e.safeDecode=(t,n)=>oo(e,t,n),e.safeEncodeAsync=async(t,n)=>so(e,t,n),e.safeDecodeAsync=async(t,n)=>co(e,t,n),uo(e,`ZodType`,{check(...e){let t=this.def;return this.clone(it(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 mt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Os(e,t))},superRefine(e,t){return this.check(ks(e,t))},overwrite(e){return this.check(ra(e))},optional(){return us(this)},exactOptional(){return fs(this)},nullable(){return ms(this)},nullish(){return us(ms(this))},nonoptional(e){return bs(this,e)},array(){return Ko(this)},or(e){return Xo([this,e])},and(e){return es(this,e)},transform(e){return ws(this,cs(e))},default(e){return gs(this,e)},prefault(e){return vs(this,e)},catch(e){return Ss(this,e)},pipe(e){return ws(this,e)},readonly(){return Es(this)},describe(e){let t=this.clone();return ui.add(t,{description:e}),t},meta(...e){if(e.length===0)return ui.get(this);let t=this.clone();return ui.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 ui.get(e)?.description},configurable:!0}),e)),po=U(`_ZodString`,(e,t)=>{Yn.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,uo(e,`_ZodString`,{regex(...e){return this.check(Zi(...e))},includes(...e){return this.check(ea(...e))},startsWith(...e){return this.check(ta(...e))},endsWith(...e){return this.check(na(...e))},min(...e){return this.check(Yi(...e))},max(...e){return this.check(Ji(...e))},length(...e){return this.check(Xi(...e))},nonempty(...e){return this.check(Yi(1,...e))},lowercase(e){return this.check(Qi(e))},uppercase(e){return this.check($i(e))},trim(){return this.check(aa())},normalize(...e){return this.check(ia(...e))},toLowerCase(){return this.check(oa())},toUpperCase(){return this.check(sa())},slugify(){return this.check(ca())}})}),mo=U(`ZodString`,(e,t)=>{Yn.init(e,t),po.init(e,t),e.email=t=>e.check(fi(go,t)),e.url=t=>e.check(vi(yo,t)),e.jwt=t=>e.check(Ni(Po,t)),e.emoji=t=>e.check(yi(bo,t)),e.guid=t=>e.check(pi(_o,t)),e.uuid=t=>e.check(mi(vo,t)),e.uuidv4=t=>e.check(hi(vo,t)),e.uuidv6=t=>e.check(gi(vo,t)),e.uuidv7=t=>e.check(_i(vo,t)),e.nanoid=t=>e.check(bi(xo,t)),e.guid=t=>e.check(pi(_o,t)),e.cuid=t=>e.check(xi(So,t)),e.cuid2=t=>e.check(Si(Co,t)),e.ulid=t=>e.check(Ci(wo,t)),e.base64=t=>e.check(Ai(jo,t)),e.base64url=t=>e.check(ji(Mo,t)),e.xid=t=>e.check(wi(To,t)),e.ksuid=t=>e.check(Ti(Eo,t)),e.ipv4=t=>e.check(Ei(Do,t)),e.ipv6=t=>e.check(Di(Oo,t)),e.cidrv4=t=>e.check(Oi(ko,t)),e.cidrv6=t=>e.check(ki(Ao,t)),e.e164=t=>e.check(Mi(No,t)),e.datetime=t=>e.check(Ua(t)),e.date=t=>e.check(Ga(t)),e.time=t=>e.check(qa(t)),e.duration=t=>e.check(Ya(t))});function W(e){return di(mo,e)}var ho=U(`ZodStringFormat`,(e,t)=>{Xn.init(e,t),po.init(e,t)}),go=U(`ZodEmail`,(e,t)=>{$n.init(e,t),ho.init(e,t)}),_o=U(`ZodGUID`,(e,t)=>{Zn.init(e,t),ho.init(e,t)}),vo=U(`ZodUUID`,(e,t)=>{Qn.init(e,t),ho.init(e,t)}),yo=U(`ZodURL`,(e,t)=>{er.init(e,t),ho.init(e,t)}),bo=U(`ZodEmoji`,(e,t)=>{tr.init(e,t),ho.init(e,t)}),xo=U(`ZodNanoID`,(e,t)=>{nr.init(e,t),ho.init(e,t)}),So=U(`ZodCUID`,(e,t)=>{rr.init(e,t),ho.init(e,t)}),Co=U(`ZodCUID2`,(e,t)=>{ir.init(e,t),ho.init(e,t)}),wo=U(`ZodULID`,(e,t)=>{ar.init(e,t),ho.init(e,t)}),To=U(`ZodXID`,(e,t)=>{or.init(e,t),ho.init(e,t)}),Eo=U(`ZodKSUID`,(e,t)=>{sr.init(e,t),ho.init(e,t)}),Do=U(`ZodIPv4`,(e,t)=>{fr.init(e,t),ho.init(e,t)}),Oo=U(`ZodIPv6`,(e,t)=>{pr.init(e,t),ho.init(e,t)}),ko=U(`ZodCIDRv4`,(e,t)=>{mr.init(e,t),ho.init(e,t)}),Ao=U(`ZodCIDRv6`,(e,t)=>{hr.init(e,t),ho.init(e,t)}),jo=U(`ZodBase64`,(e,t)=>{_r.init(e,t),ho.init(e,t)}),Mo=U(`ZodBase64URL`,(e,t)=>{yr.init(e,t),ho.init(e,t)}),No=U(`ZodE164`,(e,t)=>{br.init(e,t),ho.init(e,t)}),Po=U(`ZodJWT`,(e,t)=>{Sr.init(e,t),ho.init(e,t)}),Fo=U(`ZodNumber`,(e,t)=>{Cr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),uo(e,`ZodNumber`,{gt(e,t){return this.check(Gi(e,t))},gte(e,t){return this.check(Ki(e,t))},min(e,t){return this.check(Ki(e,t))},lt(e,t){return this.check(Ui(e,t))},lte(e,t){return this.check(Wi(e,t))},max(e,t){return this.check(Wi(e,t))},int(e){return this.check(Ro(e))},safe(e){return this.check(Ro(e))},positive(e){return this.check(Gi(0,e))},nonnegative(e){return this.check(Ki(0,e))},negative(e){return this.check(Ui(0,e))},nonpositive(e){return this.check(Wi(0,e))},multipleOf(e,t){return this.check(qi(e,t))},step(e,t){return this.check(qi(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 Io(e){return Ri(Fo,e)}var Lo=U(`ZodNumberFormat`,(e,t)=>{wr.init(e,t),Fo.init(e,t)});function Ro(e){return zi(Lo,e)}var zo=U(`ZodBoolean`,(e,t)=>{Tr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r)});function Bo(e){return Bi(zo,e)}var Vo=U(`ZodUnknown`,(e,t)=>{Er.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ho(){return Vi(Vo)}var Uo=U(`ZodNever`,(e,t)=>{Dr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r)});function Wo(e){return Hi(Uo,e)}var Go=U(`ZodArray`,(e,t)=>{kr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ka(e,t,n,r),e.element=t.element,uo(e,`ZodArray`,{min(e,t){return this.check(Yi(e,t))},nonempty(e){return this.check(Yi(1,e))},max(e,t){return this.check(Ji(e,t))},length(e,t){return this.check(Xi(e,t))},unwrap(){return this.element}})});function Ko(e,t){return la(Go,e,t)}var qo=U(`ZodObject`,(e,t)=>{Pr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aa(e,t,n,r),nt(e,`shape`,()=>t.shape),uo(e,`ZodObject`,{keyof(){return is(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ho()})},loose(){return this.clone({...this._zod.def,catchall:Ho()})},strict(){return this.clone({...this._zod.def,catchall:Wo()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return bt(this,e)},safeExtend(e){return xt(this,e)},merge(e){return St(this,e)},pick(e){return vt(this,e)},omit(e){return yt(this,e)},partial(...e){return Ct(ls,this,e[0])},required(...e){return wt(ys,this,e[0])}})});function Jo(e,t){return new qo({type:`object`,shape:e??{},...ht(t)})}var Yo=U(`ZodUnion`,(e,t)=>{Ir.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ja(e,t,n,r),e.options=t.options});function Xo(e,t){return new Yo({type:`union`,options:e,...ht(t)})}var Zo=U(`ZodDiscriminatedUnion`,(e,t)=>{Yo.init(e,t),Lr.init(e,t)});function Qo(e,t,n){return new Zo({type:`union`,options:t,discriminator:e,...ht(n)})}var $o=U(`ZodIntersection`,(e,t)=>{Rr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ma(e,t,n,r)});function es(e,t){return new $o({type:`intersection`,left:e,right:t})}var ts=U(`ZodRecord`,(e,t)=>{Vr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Na(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ns(e,t,n){return!t||!t._zod?new ts({type:`record`,keyType:W(),valueType:e,...ht(t)}):new ts({type:`record`,keyType:e,valueType:t,...ht(n)})}var rs=U(`ZodEnum`,(e,t)=>{Hr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ta(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 rs({...t,checks:[],...ht(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 rs({...t,checks:[],...ht(r),entries:i})}});function is(e,t){return new rs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ht(t)})}var as=U(`ZodLiteral`,(e,t)=>{Ur.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(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 os(e,t){return new as({type:`literal`,values:Array.isArray(e)?e:[e],...ht(t)})}var ss=U(`ZodTransform`,(e,t)=>{Wr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ke(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jt(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(jt(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 cs(e){return new ss({type:`transform`,transform:e})}var ls=U(`ZodOptional`,(e,t)=>{Kr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function us(e){return new ls({type:`optional`,innerType:e})}var ds=U(`ZodExactOptional`,(e,t)=>{qr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fs(e){return new ds({type:`optional`,innerType:e})}var ps=U(`ZodNullable`,(e,t)=>{Jr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ms(e){return new ps({type:`nullable`,innerType:e})}var hs=U(`ZodDefault`,(e,t)=>{Yr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ia(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gs(e,t){return new hs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():dt(t)}})}var _s=U(`ZodPrefault`,(e,t)=>{Zr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>La(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vs(e,t){return new _s({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():dt(t)}})}var ys=U(`ZodNonOptional`,(e,t)=>{Qr.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bs(e,t){return new ys({type:`nonoptional`,innerType:e,...ht(t)})}var xs=U(`ZodCatch`,(e,t)=>{ei.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ss(e,t){return new xs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Cs=U(`ZodPipe`,(e,t)=>{ti.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),e.in=t.in,e.out=t.out});function ws(e,t){return new Cs({type:`pipe`,in:e,out:t})}var Ts=U(`ZodReadonly`,(e,t)=>{ri.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Es(e){return new Ts({type:`readonly`,innerType:e})}var Ds=U(`ZodCustom`,(e,t)=>{ai.init(e,t),fo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r)});function Os(e,t={}){return ua(Ds,e,t)}function ks(e,t){return da(e,t)}var As={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 js(e){return(e.credentialVariants??[]).filter(e=>!e.operatorOnly)}function Ms(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 Ns(e,t){return e.filter(e=>e.definition.id===t||e.definition.clientGroup===t&&e.definition.id!==t)}function Ps(e){return Ms(e).filter(e=>e.definition.enabled&&e.definition.credentialClass!==`none`&&e.definition.poolOnly!==!0&&T(e.definition.id)&&!D(e.definition.id))}function Fs(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 Is(e,t={}){let n=e.displayName,r=t.credentialClass??e.credentialClass,i=t.baseUrl??e.baseUrl;return e.id===`oonacode`?{kind:`pool`,badge:`via OonaCode`,detail:`Runs on OonaCode's own provider accounts, through the OonaCode gateway. Priced models are billed to your account in credits; free models cost nothing on any plan.`,viaGateway:!0}:e.engine===`agy`?{kind:`subscription-direct`,badge:`agy · direct to Google`,detail:`Runs on Google’s own agy CLI on this PC, with your Google plan. Each request is recorded here and goes straight from this PC to Google — never through the OonaCode gateway, and OonaCode does not translate it.`,viaGateway:!1}:e.route===`direct`?{kind:`subscription-direct`,badge:`direct to provider`,detail:`Your ${n} subscription runs straight from this PC to the provider — it never passes through the OonaCode gateway.`,viaGateway:!1}:r===`api_key`&&e.kind!==`anthropic-passthrough`?{kind:`own-key-translated`,badge:`direct to provider`,detail:`Your ${n} key stays on this PC: OonaCode translates the request here and calls ${n} from this machine. The gateway sees neither the key nor the traffic.`,viaGateway:!1}:Fs(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 Ls=Qo(`type`,[Jo({type:os(`oauth-device`),deviceAuthorizationUrl:W().url(),tokenUrl:W().url(),clientId:W().min(1),scopes:Ko(W().min(1)).min(1),signInLabel:W().min(1).optional(),referrer:W().min(1).optional()}),Jo({type:os(`openai-device`),deviceAuthorizationUrl:W().url(),pollUrl:W().url(),tokenUrl:W().url(),verificationUri:W().url(),redirectUri:W().url(),clientId:W().min(1),signInLabel:W().min(1).optional()})]),Rs=Jo({type:os(`google-loopback`),authorizationUrl:W().url(),tokenUrl:W().url(),redirectUri:W().url(),scopes:Ko(W().min(1)).min(1),clientIdSetting:W().min(1),clientSecretSetting:W().min(1),userinfoUrl:W().url().optional(),signInLabel:W().min(1).optional()}),zs=Jo({id:W().min(1),displayName:W().min(1),upstreamId:W().min(1).optional(),servedBy:Ko(W().min(1)).optional(),subscriptionServedBy:Ko(W().min(1)).optional(),contextWindow:Io().int().positive().optional(),maxOutputTokens:Io().int().positive().optional(),supportsTools:Bo().optional(),supportsThinking:Bo().optional(),effortLevels:Ko(is(xe)).optional(),defaultEffort:is(xe).optional(),helperModel:W().min(1).optional(),supportsVision:Bo().optional(),inputPricePerM:Io().nonnegative().optional(),outputPricePerM:Io().nonnegative().optional(),creditsPerM:Jo({input:Io().nonnegative(),output:Io().nonnegative(),maxInput:Io().nonnegative().optional(),maxOutput:Io().nonnegative().optional()}).optional(),notes:W().optional(),free:Bo().optional(),aaIntelligence:Io().optional(),aaCoding:Io().optional(),aaOutputTps:Io().optional(),aaTtft:Io().optional(),aa:Jo({fetchedAt:W(),creator:W().optional(),releaseDate:W().optional(),benchmarks:ns(W(),Io()).optional()}).loose().optional()}).loose(),Bs=Jo({id:W().regex(/^[a-z0-9][a-z0-9-]{1,40}$/,`provider id must be lowercase kebab-case`),displayName:W().min(1),kind:is([`anthropic-passthrough`,`openai-compatible`,`gemini`]),route:is([`gateway`,`direct`]),credentialClass:is([`api_key`,`subscription`,`none`]),baseUrl:W().url(),messagesPath:W().startsWith(`/`).optional(),modelsPath:W().startsWith(`/`).optional(),auth:Jo({header:is([`x-api-key`,`authorization-bearer`,`api-key`,`none`]),extraHeaders:ns(W(),W()).optional()}),models:Ko(zs),defaultModel:W().min(1),modelAliases:ns(W(),W()).optional(),helperModel:W().min(1).optional(),capabilities:Jo({streaming:Bo(),tools:Bo(),thinking:Bo(),vision:Bo(),countTokens:Bo(),promptCaching:Bo(),promptCacheTtlSec:Io().int().positive().optional()}),translate:Jo({maxTokensParam:is([`max_tokens`,`max_completion_tokens`]).optional(),reasoningEffortFromBudget:Bo().optional(),reasoningContentField:W().nullable().optional(),supportsParallelToolCalls:Bo().optional(),systemRole:is([`system`,`developer`]).optional(),streamIncludeUsage:Bo().optional(),wire:is([`chat`,`responses`,`gemini-code-assist`]).optional()}).optional(),passthrough:Jo({stripCacheControl:Bo().optional(),cacheChain:Bo().optional(),toolSchemaRequiredArray:Bo().optional(),toolDescriptionRequired:Bo().optional(),keepOutputConfig:Bo().optional(),allowedBetas:Ko(W()).optional(),anthropicVersion:W().optional()}).optional(),userBaseUrl:Bo().optional(),engineEnv:ns(W(),W()).optional(),directCapable:Bo().optional(),subscriptionLogin:Ls.optional(),museCliLogin:Jo({type:os(`muse-cli`),signInLabel:W().min(1).optional()}).optional(),poolOnly:Bo().optional(),contributorMode:Jo({suffix:W().min(1),summary:W().min(1)}).optional(),phase:Xo([os(1),os(2)]),enabled:Bo(),docsUrl:W().url().optional(),notes:W().optional(),references:Ko(Jo({label:W().min(1),url:W().url(),kind:is([`docs`,`pricing`,`models`,`console`,`status`,`keys`,`signup`,`other`]).optional()})).optional(),keyFormat:W().optional(),credentialVariants:Ko(Jo({id:W().min(1),label:W().min(1),header:is([`x-api-key`,`authorization-bearer`,`api-key`,`none`]).optional(),extraHeaders:ns(W(),W()).optional(),operatorOnly:Bo().optional(),requiresClaudeCodeIdentity:Bo().optional(),subscriptionLogin:Ls.optional(),loopbackLogin:Rs.optional(),agyLogin:Jo({type:os(`agy-server`),signInLabel:W().optional()}).optional(),codexLogin:Jo({type:os(`codex-server`),signInLabel:W().optional()}).optional(),museLogin:Jo({type:os(`muse-server`),signInLabel:W().optional()}).optional(),claudeCodeShape:Jo({betas:W().min(1),userAgent:W().min(1),billingHeader:W().min(1),headers:ns(W(),W()).optional()}).optional(),baseUrl:W().url().optional(),keyFormat:W().optional(),notes:W().optional()})).optional(),adminGroup:W().optional(),clientGroup:W().optional(),recordLabel:W().optional(),engine:os(`agy`).optional(),effortLevels:Ko(is(xe)).optional(),defaultEffort:is(xe).optional()});Jo({version:Io().int().positive(),updatedAt:W(),providers:Ko(Bs)});function Vs(e,t){return Hs(e,Zs(e,t))}function Hs(e,t){return e.models.find(e=>e.id===t)?.upstreamId??t}function Us(e){return/^claude-/i.test(e)}function Ws(e){return/^claude-.+-\d{8}$/i.test(e)?e.replace(/-\d{8}$/,``):null}function Gs(e){return e.replace(/\[1m\]$/i,``)}var Ks=new Set([`opus`,`sonnet`,`haiku`,`fable`]);function qs(e){return Ks.has(e.toLowerCase())}function Js(e,t){let n=Gs(t);if(qs(n)||e.models.some(e=>e.id===n))return null;let r=e.modelAliases;if(!r)return null;let i=Ws(n);if(i!==null&&e.models.some(e=>e.id===i))return null;let a=r[n]??(i===null?void 0:r[i]);return a!==void 0&&e.models.some(e=>e.id===a)?a:null}function Ys(e,t){return{images:e.models.find(e=>e.id===t)?.supportsVision??e.capabilities.vision,documents:Us(t)}}function Xs(e,t,n){let r=Ys(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.size>0&&e.engine===`agy`&&(!r.images||!r.documents)?`${a} runs on Google's agy, which takes text only — no pictures or PDFs on any agy model. Pick a model of another provider (OonaCode, Claude, …) to send it.`: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 Zs(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=Js(e,t);if(r)return r;let i=t.toLowerCase(),a=i.includes(`haiku`)?`haiku`:i.includes(`opus`)?`opus`:i.includes(`sonnet`)?`sonnet`:i.includes(`fable`)?`fable`:null;if(a){if(e.modelAliases?.[a])return e.modelAliases[a];let t=e.models.find(e=>e.id.toLowerCase().includes(a));if(t)return t.id}return e.defaultModel}var Qs={messages:`/v1/messages`,countTokens:`/v1/messages/count_tokens`,models:`/v1/models`,providerMessages:e=>`/p/${e}/v1/messages`,providerCountTokens:e=>`/p/${e}/v1/messages/count_tokens`,providerModels:e=>`/p/${e}/v1/models`,voiceTranslation:`/v1/oonacode/voice-translation`,health:`/api/health`,streamCheck:`/api/stream-check`,register:`/api/auth/register`,login:`/api/auth/login`,refresh:`/api/auth/refresh`,logout:`/api/auth/logout`,me:`/api/auth/me`,prelogin:`/api/auth/prelogin`,tokens:`/api/me/tokens`,token:e=>`/api/me/tokens/${e}`,tokenPurge:e=>`/api/me/tokens/${e}/purge`,tokenUsage:e=>`/api/me/tokens/${e}/usage`,providers:`/api/me/providers`,provider:e=>`/api/me/providers/${e}`,providerTest:e=>`/api/me/providers/${e}/test`,routing:`/api/me/routing`,usage:`/api/me/usage`,usageSession:e=>`/api/me/usage/sessions/${e}`,usageBreakdown:`/api/me/usage/breakdown`,devices:`/api/me/devices`,pushToken:`/api/me/push-token`,hostNotify:`/api/me/hosts/notify`,device:e=>`/api/me/devices/${e}`,hosts:`/api/me/hosts`,hostHeartbeat:`/api/me/hosts/heartbeat`,hostVaultUnlock:e=>`/api/me/hosts/${encodeURIComponent(e)}/vault-unlock`,host:e=>`/api/me/hosts/${encodeURIComponent(e)}`,vault:`/api/me/vault`,vaultEvents:`/api/me/vault/events`,registry:`/api/registry`,agentTools:`/api/agent-tools`,agentToolCalls:`/api/me/agent-tools/calls`,poolReleaseSession:`/api/me/pool/release-session`,poolAutoRoute:`/api/me/pool/auto-route`,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`},$s=2048,ec=16384,tc=8e3,nc=5242880,rc=12582912;new Set(`BCDFGHJKLMNPQRSTVWXZ`.split(``));var ic=`discard-my-vault-and-history`,ac=`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.`,oc={notes:100,title:80,text:1e5,totalText:1e6},sc={name:120,instructions:2e4,goal:2e3,repositories:50,repositoryUrl:500,memory:2e4,minIntervalFloor:1,minIntervalCeiling:10080},cc=`⏰ Scheduled task "`;function lc(e){if(!e.startsWith(cc))return null;let t=e.indexOf(`"
|
|
79
79
|
|
|
80
|
-
`,18);return t<0?null:{title:e.slice(18,t),prompt:e.slice(t+3)}}Object.freeze({tengu_amber_sentinel:!0,tengu_groovy_eclipse:!0,tengu_humble_hammock:!0});function uc(e){return e===null||!Number.isFinite(e)?`neutral`:e>30?`ok`:e>10?`warn`:`danger`}var dc=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],fc=/^([01]\d|2[0-3]):[0-5]\d$/;Jo({tz:W().min(1),windows:Ko(Jo({from:W().regex(fc,`HH:MM`),to:W().regex(fc,`HH:MM`),days:Ko(is(dc)).optional(),kind:is([`peak`,`offpeak`])})),offpeakDiscount:Io().nonnegative().max(1).optional()});var pc=[`priceInputCacheMissPeak`,`priceInputCacheMissOffpeak`,`priceInputCacheHitPeak`,`priceInputCacheHitOffpeak`,`priceCacheWritePeak`,`priceCacheWriteOffpeak`,`priceOutputPeak`,`priceOutputOffpeak`],mc=Jo({inputCacheMiss:Io().nonnegative(),inputCacheHit:Io().nonnegative().optional(),cacheWrite:Io().nonnegative().optional(),output:Io().nonnegative()});Jo({by:os(`prompt_tokens`),tiers:Ko(Jo({upToPromptTokens:Io().int().positive().optional(),price:mc.optional(),cost:mc.optional()})).min(1),note:W().optional()}).superRefine((e,t)=>{let n=0;e.tiers.forEach((r,i)=>{!r.cost&&!r.price&&t.addIssue({code:`custom`,message:`a tier needs its cost (the provider’s rates; retail is cost × the record’s ratio)`,path:[`tiers`,i,`cost`]});let a=r.upToPromptTokens;if(a===void 0){i!==e.tiers.length-1&&t.addIssue({code:`custom`,message:`only the LAST tier may omit upToPromptTokens`,path:[`tiers`,i]});return}a<=n&&t.addIssue({code:`custom`,message:`tiers must ascend: ${a} does not exceed ${n}`,path:[`tiers`,i,`upToPromptTokens`]}),n=a})}),[...pc];var hc={realtime:`/v1/realtime`,translations:`/v1/realtime/translations`,live:`/v1/live/sessions`,speechStream:`/v1/audio/speech/stream`,transcriptionStream:`/v1/audio/transcriptions/stream`,clientSecrets:`/v1/realtime/client_secrets`,translationClientSecrets:`/v1/realtime/translations/client_secrets`};hc.realtime,hc.translations,hc.live,hc.speechStream,hc.transcriptionStream;var gc=`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`,_c=`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`,vc=`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`,yc=`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,bc={oonacode:{hex:`#000000`,owner:`OonaCode`,d:gc,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:vc},xai:{hex:`#000000`,owner:`xAI`,d:_c},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`},qwen:{hex:`#6950EF`,owner:`Alibaba`,d:`M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z`},"xai-subscription":{hex:`#000000`,owner:`xAI`,d:_c},"openai-subscription":{hex:`#000000`,owner:`OpenAI`,d:vc},"openai-codex":{hex:`#000000`,owner:`OpenAI`,d:vc},"google-agy":{hex:`#8E75B2`,owner:`Google`,d:yc},antigravity:{hex:`#8E75B2`,owner:`Google`,d:yc},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 xc(e){return bc[e]??null}function Sc(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 Cc=9230,wc=1024,Tc=65534,Ec=`127.0.0.1`;Object.freeze({enabled:!1,port:Cc,inspectMain:!1}),Object.freeze({port:null,listening:!1,fromCommandLine:!1,inspectPort:null,inspectProblem:null});function Dc(e){return e+1}function Oc(e){return typeof e==`number`&&Number.isInteger(e)}function kc(e){return!Oc(e)||e<1024||e>65534?`The port must be a whole number from ${wc.toLocaleString(`en-US`)} to ${Tc.toLocaleString(`en-US`)} (the main-process inspector takes the next one).`:null}function Ac(e){return e.port!==null||e.inspectPort!==null}function jc(e,t){let n=e.enabled?e.port:null,r=e.enabled&&e.inspectMain?Dc(e.port):null;return!t.fromCommandLine&&t.port!==n||t.inspectPort!==r}function Mc(e){let t=[];return e.port!==null&&t.push(`${Ec}:${e.port}`),e.inspectPort!==null&&t.push(`${Ec}:${e.inspectPort}`),t.length===2?`${t[0]} (windows) and ${t[1]} (main process)`:e.inspectPort===null?t[0]??``:`${t[0]} (main process)`}var Nc=[`stable`,`dev`];function Pc(e){return typeof e==`string`&&Nc.includes(e)}function Fc(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return Pc(t)?t:null}var Ic=[`win32`,`linux`,`darwin`],Lc=[`x64`,`arm64`];function Rc(e,t){let n=Fc(e)??`stable`,r=[];return n!==`stable`&&r.push(`channel=${encodeURIComponent(n)}`),t&&Ic.includes(t.platform)&&(r.push(`platform=${t.platform}`),t.arch&&Lc.includes(t.arch)&&r.push(`arch=${t.arch}`)),r.length>0?`${Qs.releasesLatest}?${r.join(`&`)}`:Qs.releasesLatest}function zc(e,t){let n=Fc(t)??`stable`;return n===`stable`?e:`${e} (${n})`}var Bc={safeguards:`safeguards`,safety_filters:`safety filters`},Vc=[{vendor:`Alibaba (Model Studio / DashScope — Qwen, and the DeepSeek/GLM it hosts)`,seenAs:`400 {"error":{"code":"data_inspection_failed","message":"Input data may contain inappropriate content."}}`,pattern:/data[_ ]?inspection[_ ]?failed|may contain inappropriate content/i},{vendor:`Zhipu (GLM)`,seenAs:`400 {"error":{"code":"1301","message":"系统检测到输入或生成内容可能包含不安全或敏感内容…"}} (contentFilter)`,pattern:/"code"\s*:\s*"?1301"?|不安全或敏感内容|unsafe or sensitive content|contentFilter/i},{vendor:`DeepSeek`,seenAs:`400 {"error":{"message":"Content Exists Risk","type":"invalid_request_error"}}`,pattern:/content exists risk/i},{vendor:`Moonshot (Kimi)`,seenAs:`400 {"error":{"type":"content_filter","message":"The request was rejected because it was considered high risk"}}`,pattern:/"type"\s*:\s*"content_filter"|considered high risk/i},{vendor:`xAI (Grok)`,seenAs:`400 "Content violates usage guidelines. Failed check: SAFETY_CHECK_TYPE_…"`,pattern:/content violates usage guidelines|SAFETY_CHECK_TYPE_/i},{vendor:`OpenAI (and Azure-style filters)`,seenAs:`400 {"error":{"code":"content_filter" | "content_policy_violation" | "moderation_blocked"}}`,pattern:/"code"\s*:\s*"(?:content_filter|content_policy_violation|moderation_blocked)"/i},{vendor:`Google (Gemini)`,seenAs:`This request was blocked by Gemini's filters. They can occasionally trigger by mistake on safe coding, security, or biology-related queries.`,pattern:/blocked by Gemini(?:'s)? filters|Gemini(?:'s)? filters/i}],Hc=/blocked by (?:the )?(?:content[ -]safety|Gemini(?:'s)?) filters?|content safety filters?|blocked by Gemini(?:'s)? filters?/i,Uc=/blocked by Gemini(?:'s)? filters|Gemini(?:'s)? filters\.? They can occasionally trigger/i;function Wc(e){return typeof e==`string`&&Uc.test(e)}function Gc(e){return typeof e!=`string`||e===``||!/^\s*(?:Failed to authenticate\.\s*)?API Error\b/i.test(e)?null:Vc.find(t=>t.pattern.test(e))??null}function Kc(e){return typeof e==`string`&&(Wc(e)||Hc.test(e)&&/blocked/i.test(e))}var qc=`:free`;function Jc(e){return e.endsWith(qc)}function Yc(e){return Jc(e)?e.slice(0,-5):e}var Xc=`model_refusal_fallback`,Zc=`model_refusal_no_fallback`;function Qc(e){return typeof e==`string`&&e.trim()!==``?e.trim():null}function $c(e,t,n){return Qc(e[t])??Qc(e[n])}function el(e){if(typeof e!=`object`||!e)return null;let t=e,n=t.subtype,r=n===`model_refusal_fallback`?`fallback`:n===`model_refusal_no_fallback`?`no_fallback`:t.kind===`fallback`||t.kind===`no_fallback`?t.kind:null;if(!r||t.type!==void 0&&t.type!==`system`)return null;let i=t.retracted_message_uuids??t.retractedMessageUuids??t.retractedUuids;return{kind:r,scope:t.scope===`local`?`local`:`session`,originalModel:$c(t,`original_model`,`originalModel`),fallbackModel:r===`fallback`?$c(t,`fallback_model`,`fallbackModel`):null,category:$c(t,`api_refusal_category`,`apiRefusalCategory`)??Qc(t.category),explanation:$c(t,`api_refusal_explanation`,`apiRefusalExplanation`)??Qc(t.explanation),text:typeof t.content==`string`?t.content.trim():Qc(t.text)??``,retractedUuids:Array.isArray(i)?i.filter(e=>typeof e==`string`):[]}}function tl(e,t){switch(t.type){case`notice`:return t.notice.kind!==`fallback`||t.notice.scope!==`session`?e:{notice:t.notice,at:t.at,live:t.live};case`engine_start`:case`model_change`:return null}}function nl(e,t){return!e||t.alive===!1||!e.live&&t.since!==null&&e.at!==null&&e.at<t.since?null:e}function rl(e){let t=Gs(e.trim()),n=t.slice(t.lastIndexOf(`/`)+1),r=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),i=n.split(`-`);if(i[0]?.toLowerCase()!==`claude`)return t;let a=i.slice(1).filter(e=>!/^\d{6,}$/.test(e)),o=a.filter(e=>!/^\d+$/.test(e)),s=a.filter(e=>/^\d+$/.test(e));return o.length!==1||s.length===0?t:`${r(o[0])} ${s.join(`.`)}`}function il(e,t=[]){let n=Gs(e.trim()),r=null;for(let e of t)for(let t of e.definition.models){if(t.id===n||Gs(t.id)===n)return t.displayName;r===null&&(t.upstreamId===n||Yc(t.id)===n)&&(r=t.displayName)}return r??rl(n)}function al(e){return`${e} (safeguard)`}var ol=`none`,sl={mode:`auto`,model:null,perModel:{}};function cl(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0&&t.length<=200&&/^[A-Za-z0-9._:@/[\]-]+$/.test(t)?t:null}function ll(e){return Gs(e.trim()).toLowerCase()}function ul(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e:{},n=cl(t.model),r=t.mode,i=r===`off`?`off`:r===`model`&&n!==null?`model`:`auto`,a={},o=t.perModel;if(typeof o==`object`&&o&&!Array.isArray(o))for(let[e,t]of Object.entries(o)){let n=cl(e),r=t===`none`?ol:cl(t);if(n!==null&&r!==null&&ll(n)!==ll(r)&&(a[ll(n)]=r,Object.keys(a).length>=64))break}return{mode:i,model:i===`model`?n:null,perModel:a}}function dl(e){return e===w}var fl=`oona settings safeguard-fallback auto`;function pl(e,t=[]){if(!e)return`the model`;let n=ll(e);return t.find(e=>ll(e.id)===n||e.upstreamId&&ll(e.upstreamId)===n)?.displayName??rl(e)}function ml(e,t=e=>pl(e)){let n=`blocked by ${Bc[e.reason]}`;if(e.outcome===`retried`)return`${n} → retried on ${e.retriedOn?t(e.retriedOn):`another model`}`;switch(e.blocked){case`off`:return`${n} · fallback off (${fl})`;case`no_model`:return`${n} · no fallback model`;case`unavailable`:return`${n} · fallback not available here`;case`refused_again`:return`${n} · fallback refused too`;case`not_retryable`:return`${n} · not retried`;default:return n}}var hl=5e4,gl=6,_l=[`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`],vl={agentFinished:!1,permissionRequired:!0,errorOccurred:!0},yl={autoAcceptPermissions:!1,safeguardFallback:sl,showReasoningSummaries:!0,notifications:vl,showAgentPicker:!0,transcriptWindowSize:500,openTabs:[],draftTabs:[],draftTitles:{},activeTab:null,editorLayout:null,remoteTabs:{},sessionPanelOpen:!1,explorerOpen:!1,sidebarWidth:288,sessionPanelWidth:288,mediaPanelWidth:320,sidebarPinned:!0,dismissedUpdateVersion:null,lastSeenReleaseNotes:null,claudeImportOffered:!1,claudeImportOffers:0,collapsedProjects:[],themeColors:{light:{},dark:{}},pinned:[],sidebarView:`recent`};function bl(e){return Math.min(Math.max(typeof e==`number`&&Number.isFinite(e)?Math.floor(e):0,0),3)}function xl(e){return Math.min(640,Math.max(200,typeof e==`number`&&Number.isFinite(e)?Math.round(e):288))}function Sl(e,t){return Math.min(720,Math.max(240,typeof e==`number`&&Number.isFinite(e)?Math.round(e):t))}function Cl(e){return Math.min(hl,Math.max(100,typeof e==`number`&&Number.isFinite(e)?Math.round(e):500))}function wl(e,t){return typeof e==`boolean`?e:t}function Tl(e){return typeof e==`string`&&e.length>0&&e.length<=64?e:null}function El(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 Dl(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 Ol(e){if(typeof e!=`string`)return null;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t.toLowerCase():null}function kl(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!_l.includes(n))continue;let e=Ol(r);e!==null&&(t[n]=e)}return t}function Al(e){let t=typeof e==`object`&&e?e:{};return{light:kl(t.light),dark:kl(t.dark)}}function jl(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n.kind,r=n.id;if((e===`chat`||e===`project`)&&!(typeof r!=`string`||r.length===0||r.length>200)&&!t.some(t=>t.kind===e&&t.id===r)&&(t.push({kind:e,id:r}),t.length>=50))break}return t}function Ml(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return null;let n=e,r=new Set(t),i=new Set,a=0,o=(e,t)=>{if(t>gl||typeof e!=`object`||!e)return null;let n=e,s=n.group;if(typeof s==`object`&&s&&!Array.isArray(s)){if(a>=8)return null;let e=s,t=[];for(let n of Array.isArray(e.tabs)?e.tabs:[])typeof n!=`string`||!r.has(n)||i.has(n)||(i.add(n),t.push(n));return t.length===0?null:(a+=1,{group:{tabs:t,active:(typeof e.active==`string`&&t.includes(e.active)?e.active:null)??t[t.length-1]}})}let c=n.split;if(c!==`row`&&c!==`column`)return null;let l=Array.isArray(n.children)?n.children:[],u=Array.isArray(n.sizes)?n.sizes:[],d=[],f=[];if(l.slice(0,8).forEach((e,n)=>{let r=o(e,t+1);if(!r)return;d.push(r);let i=u[n];f.push(typeof i==`number`&&Number.isFinite(i)&&i>0?i:0)}),d.length===0)return null;if(d.length===1)return d[0];let p=f.filter(e=>e>0),m=p.length>0?p.reduce((e,t)=>e+t,0)/p.length:1,h=f.map(e=>e>0?e:m),g=h.reduce((e,t)=>e+t,0);return{split:c,sizes:h.map(e=>e/g),children:d}},s=o(n.root,0);if(!s||a<2)return null;let c=n.focused;return{root:s,focused:typeof c==`number`&&Number.isInteger(c)&&c>=0&&c<a?c:0}}function Nl(e,t,n){return e.some(e=>e.kind===t&&e.id===n)}function Pl(e,t,n,r){return r===Nl(e,t,n)?e:r?[...e.length>=50?e.slice(e.length-50+1):e,{kind:t,id:n}]:e.filter(e=>e.kind!==t||e.id!==n)}function Fl(e){let t=typeof e==`object`&&e?e:{},n=typeof t.notifications==`object`&&t.notifications!==null?t.notifications:{},r=El(t.openTabs),i=El(t.draftTabs).filter(e=>!r.includes(e)),a={};for(let[e,n]of Object.entries(Dl(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:wl(t.autoAcceptPermissions,yl.autoAcceptPermissions),safeguardFallback:ul(t.safeguardFallback),showReasoningSummaries:wl(t.showReasoningSummaries,yl.showReasoningSummaries),notifications:{agentFinished:wl(n.agentFinished,vl.agentFinished),permissionRequired:wl(n.permissionRequired,vl.permissionRequired),errorOccurred:wl(n.errorOccurred,vl.errorOccurred)},showAgentPicker:wl(t.showAgentPicker,yl.showAgentPicker),transcriptWindowSize:Cl(t.transcriptWindowSize),openTabs:r,draftTabs:i,draftTitles:a,activeTab:c,editorLayout:Ml(t.editorLayout,o),remoteTabs:Dl(t.remoteTabs),sessionPanelOpen:wl(t.sessionPanelOpen,yl.sessionPanelOpen),explorerOpen:wl(t.explorerOpen,yl.explorerOpen),sidebarWidth:xl(t.sidebarWidth),sessionPanelWidth:Sl(t.sessionPanelWidth,288),mediaPanelWidth:Sl(t.mediaPanelWidth,320),sidebarPinned:wl(t.sidebarPinned,yl.sidebarPinned),dismissedUpdateVersion:Tl(t.dismissedUpdateVersion),lastSeenReleaseNotes:Tl(t.lastSeenReleaseNotes),claudeImportOffered:wl(t.claudeImportOffered,yl.claudeImportOffered),claudeImportOffers:bl(t.claudeImportOffers),collapsedProjects:El(t.collapsedProjects),themeColors:Al(t.themeColors),pinned:jl(t.pinned),sidebarView:t.sidebarView===`projects`?`projects`:`recent`}}new Set(Object.keys(yl));var Il=3650,Ll=[{version:`0.3.247`,date:`2026-10-20`,added:[`On the Android app, a short tap on a message now opens a menu: Reply (quotes it above the box), Copy, Forward (opens it as a draft in another chat you pick), Share and Save text to… A long press still selects text.`,`On the Android app, a picture, video, sound or file that a reply names now opens from your PC: pictures show right in the chat, videos and sounds play in the chat, and other files open in the app you choose or are saved where you say. A file larger than 25 MB asks first.`,`This PC now hands those files to your phone over the same private link as your chats — only files that the chat itself named or that sit in its folder, one piece at a time.`],fixed:[]},{version:`0.3.246`,date:`2026-10-19`,added:[`Every chat can now make videos and spoken audio, not only pictures: ask for a short clip or a voice-over and the model makes it, saves it in the chat’s folder and plays it right in the chat. Video and Speech sit beside Images in the Tools menu, switched on by default.`,`In the Tools menu each of the three has a model choice for this chat (its default follows the model you are chatting with: a Grok chat uses Grok’s, an Alibaba chat Alibaba’s) and an “Ask me first” switch. With it on — the default for video — the model asks you for the length, resolution and shape and tells you the price in credits before anything is spent.`,`Pictures, videos and speech are paid with your OonaCode credits like any other message, whatever model or key the chat runs on, and the credits charged are shown in the answer.`,`On Apple Silicon Macs (M1 and later) Oonak Browser is now the native build: it quits with its last window, shows its own Dock icon and never asks for notification permission.`],fixed:[]},{version:`0.3.245`,date:`2026-10-19`,added:[`A picture, video or sound that a model reply named but that is not on your PC any more is now left out of the Media explorer, with a line under the list saying how many were left out and a Show button to see them.`,`A picture the model made now shows up in the chat as a small square beside its name — you no longer need the Media panel to notice it — and a click enlarges it.`,`A file the model names (a PDF, a Word or Excel document, a zip and so on) now shows its type’s icon in the chat and in the Media explorer; a file of any other type gets a plain file icon.`],fixed:[`The Media explorer no longer lists a website path such as /logo.svg or /favicon.png from a model reply as if it were a file on your PC, and a card that cannot be opened now shows the file name and date instead of only “Moved or deleted”.`]},{version:`0.3.244`,date:`2026-10-19`,added:[`When the agent enters plan mode (and when you approve its plan) the Build / Plan / Ask picker now follows it, so the picker always shows the mode the chat is really in.`],fixed:[`Four engine tools nobody uses here — ListAgents, EnterWorktree, ExitWorktree and ReportFindings — are switched off in every chat, which makes each request a little smaller.`]},{version:`0.3.243`,date:`2026-10-18`,added:[`OonaCode now asks before it quits or updates while any chat is still working — including chats whose tabs you closed — and names them, so nothing is interrupted by accident.`],fixed:[]},{version:`0.3.242`,date:`2026-10-18`,added:[`Every model can now take any attachment: a picture or PDF that the chosen model cannot read (Google’s agy, text-only Qwen or GLM models, and so on) is saved in the chat’s temporary folder and the model is given its file path instead of the message being refused.`,`The media panel can filter by All, Mine or Replies, so the pictures, videos, sounds and links that the model’s replies name are listed too, and every item has a right-click menu (View or Play, Show in chat, Show in folder, Copy path or link).`,`The “Media in this chat” and “Session info” panels can be resized by dragging their left edge; double-click the edge for the default width.`,`Web search is now in every chat, always: there is no Tools-menu switch for it any more, and chats that had it switched off search again.`],fixed:[]},{version:`0.3.241`,date:`2026-10-17`,added:[`Remote sessions in the sidebar now have a full right-click context menu and actions button (Pin to top, Move to Project, Project settings, Change folder, Details, Listen to this chat, Files, Rename, Fork and Delete) plus a details card on hover.`,`The Files explorer and file viewer now work for remote chats over the blind relay, so you can browse folders, view code, Markdown and images, copy paths and delete files on the remote PC.`,`Oonak Browser is now available for macOS chats as well as Windows and Linux.`],fixed:[`Newly created or renamed remote chats now appear immediately in the Remote section of the left sidebar, and the sidebar automatically recovers after a brief server or connection blip.`,`Opening a long remote chat with many screenshots no longer disconnects the relay for backpressure or stops loading recent messages.`]},{version:`0.3.240`,date:`2026-10-17`,added:[`Every Thought block now shows how long the model spent thinking (for example “Thought · 42 words · 12s”), both live and when a chat is reopened.`,`Remote chat tabs now show a badge naming the PC they run on, and you can rename a remote chat directly from its tab or from the Remote list in the sidebar.`,`Files attached from the Android app are uploaded into the chat’s folder on the PC that runs the chat.`],fixed:[`Subagent reports and continuation notes now fold into a single Engine note line instead of staying pinned at the bottom of the chat or replacing the pinned user question.`,`Local video and file paths in replies (including Windows paths with forward slashes, paths with spaces, and Markdown links) now reliably show their Play, View and Open in folder buttons.`,`Chats on a ChatGPT (Codex) subscription no longer fail when the model calls tools.`,`Google agy chats wait and retry automatically (5 s, 20 s, 1 min, 2 min) when Google answers with a temporary 503 Unavailable.`]},{version:`0.3.239`,date:`2026-10-16`,platforms:[`win32`],added:[`Media in every chat: the gallery button at the top right of a chat lists the photos, videos, audio, files and links you sent in it. Photos open in the viewer (← → step through them), videos and audio play in place, files open or show in their folder, and “Show in chat” jumps to the message.`],fixed:[`Google agy chats no longer flash a command window when they start. OonaCode now keeps agy up to date itself, quietly, while no agy chat is running.`,`An agy command that waits for someone to type (a password prompt, an ssh question) no longer holds the chat for hours: after 15 minutes with no output and no work, OonaCode ends that command, says so in the chat, and agy carries on.`,`The coding engine is updated (Claude Code 2.1.301): long answers are no longer cut off after three minutes of silence, a long chat no longer compacts again and again, and a tool no longer runs twice.`,`If the app’s window crashes (for example when the computer runs out of memory), it reloads by itself.`,`A chat on your own Meta Muse or ChatGPT plan that started on another provider no longer fails with “call_id must be at most 64 characters”.`,`Your other PCs keep one order in the Remote list instead of reshuffling.`,"`oona -p` with an OonaCode API key says what went wrong instead of asking you to sign in."]},{version:`0.3.239`,date:`2026-10-16`,platforms:[`darwin`],added:[`Media in every chat: the gallery button at the top right of a chat lists the photos, videos, audio, files and links you sent in it. Photos open in the viewer (← → step through them), videos and audio play in place, files open or show in their folder, and “Show in chat” jumps to the message.`],fixed:[`The coding engine is updated (Claude Code 2.1.301): long answers are no longer cut off after three minutes of silence, a long chat no longer compacts again and again, and a tool no longer runs twice.`,`If the app’s window crashes (for example when the computer runs out of memory), it reloads by itself.`,`A chat on your own Meta Muse or ChatGPT plan that started on another provider no longer fails with “call_id must be at most 64 characters”.`,`Your other PCs keep one order in the Remote list instead of reshuffling.`,`A download cut part-way during an update is resumed instead of starting over.`,"`oona -p` with an OonaCode API key says what went wrong instead of asking you to sign in."]},{version:`0.3.239`,date:`2026-10-16`,platforms:[`linux`],added:[`Media in every chat: the gallery button at the top right of a chat lists the photos, videos, audio, files and links you sent in it. Photos open in the viewer (← → step through them), videos and audio play in place, files open or show in their folder, and “Show in chat” jumps to the message.`],fixed:[`“Restart now” in Settings opens the app again instead of closing it for good.`,`The OonaCode service starts again after a quick reboot.`,`A power cut no longer empties the files that keep you signed in and unlocked.`,`A download cut part-way (weak Wi-Fi) during an install or update is resumed instead of giving up.`,`Notifications come from “OonaCode”.`,`The coding engine is updated (Claude Code 2.1.301): long answers are no longer cut off after three minutes of silence, a long chat no longer compacts again and again, and a tool no longer runs twice.`,`If the app’s window crashes (for example when the computer runs out of memory), it reloads by itself.`,`A chat on your own Meta Muse or ChatGPT plan that started on another provider no longer fails with “call_id must be at most 64 characters”.`,`Your other PCs keep one order in the Remote list instead of reshuffling.`,"`oona -p` with an OonaCode API key says what went wrong instead of asking you to sign in."]},{version:`0.3.238`,date:`2026-10-16`,added:[`Auto in the OonaCode pool: pick “Auto” and each new message runs on the pool model that suits it — how hard the task is, how big the chat is, whether a model already has the chat in its cache, speed and cost — at an effort it picks too. The model button shows which model Auto chose, like “Auto (Qwen3.8 Max)”. (It appears once OonaCode switches it on.)`,`Window control in the Tools menu: when you ask, the agent can list, hide, show, minimise, restore or focus the windows on your computer (Windows; apps on macOS; X11 and KDE on Linux).`,`The conversations popup in a chat shows when each conversation started and when it was last active.`],fixed:[`A Google agy chat that hits a temporary “service unavailable” from Google now waits a few seconds and carries on in the same conversation instead of ending the turn.`,`The agent keeps Oonak Browser’s window visible: no hidden or headless browser unless you ask for one.`]},{version:`0.3.237`,date:`2026-10-15`,platforms:[`win32`,`darwin`],added:[`When a long chat no longer fits the model, the chat shows one line saying how many earlier messages the request left out; click it for the explanation.`],fixed:[`The model picker no longer has an “All models” list, which showed the same model twice when a provider offers it both by key and by subscription. Pick a provider to see its models.`,`Google’s agy: Gemini 3.7 Flash, 3.6 Flash and 3.1 Pro are gone from the picker, because Google no longer offers them, and the picker shows only the models your own Google plan lists. A chat that was on one of them asks you to pick another model.`,`A picture or PDF attached to a chat on Google’s agy is refused with words that say agy takes text only on every one of its models, and that another provider’s model can read it.`,`A thought with no words in it (Meta Muse hides its thinking) no longer leaves an empty “Thought” card in the chat.`,`Conversations between chats read “idle” when nothing is going on.`]},{version:`0.3.237`,date:`2026-10-15`,platforms:[`linux`],added:[`The model picker is redone: your providers on the left, each with how many models it has, and the chosen provider’s models on the right, best first by independent intelligence rating. Each side has its own search. After you pick a model from another provider, its button says “next message” until your next message runs on it.`,`Every model shows its own effort levels, and the effort picker starts on the model’s default. A model with no effort levels shows no picker.`,`Meta Muse: Muse Spark 1.3 and 1.2, Wonder 1.0 and Wonder Full 1.0 — paste your Muse key in Connect or press “Sign in with Meta”.`,`ChatGPT plans: GPT-6.1 Sol, GPT-6 Sol, GPT-6 Astra and GPT-5.6 Sol when your plan lists them; chats keep their thinking across tool calls and use the effort you pick.`,`NVIDIA is back for your own NVIDIA key, with twelve hosted models that call tools. Your own SuperGrok subscription offers Grok 4.7 Fast.`,`Bring this PC into the chat: on a chat that runs on another PC, pick folders on this PC and what the chat may do there; it asks you before every change. And a Tools switch lets a chat list, read and message the chats on your other PCs.`,`Sticky notes beside the bug button, saved in your vault so they follow you to your other computers.`,`Suggest, beside Listen in every chat, proposes what to send next, and the project manager does it for several chats at once. Nothing is sent until you press Send.`,`Listen to this chat is a player with a seek bar, a speed you can change while it plays, and the spoken word highlighted.`,`A tab whose chat finished a turn you have not looked at yet wears a dot. A long chat folds old agents into one “N earlier agents” row, and every block shows its time.`,`When a long chat no longer fits the model, one line says how many earlier messages the request left out.`],fixed:[`A message sent while a chat is working, right after you picked another model, waits for the running turn and is answered by the model you picked.`,`A PC you sign in later appears in the left panel by itself.`,`A thought with no words in it no longer leaves an empty “Thought” card.`,`The Claude Code engine is updated to 2.1.296.`]},{version:`0.3.236`,date:`2026-10-14`,platforms:[`win32`,`darwin`],added:[`Every model now shows its own effort levels, and the effort picker starts on the model’s default — so you can see what level a chat really runs at. A model that has no effort levels no longer shows a picker at all.`,`A collapsed thought block now shows how the thought begins, like a command does: “Thought 42 words: First I read the file…”.`,`Meta Muse requests now match Meta’s own Muse CLI, so its thinking, tool calls, pictures and PDFs show up properly in the chat.`],fixed:[`Grok 4.5 no longer offers an “extra high” effort that xAI treats as high, and GPT-4.1 no longer shows an effort picker it cannot use.`]},{version:`0.3.235`,date:`2026-10-13`,platforms:[`win32`,`darwin`],added:[`Meta Muse: use Meta’s Muse Spark 1.3, Spark 1.2, Wonder 1.0 and Wonder Full 1.0 in your chats. Open Connect, pick Meta Muse, and either paste your Muse key or press “Sign in with Meta” — OonaCode downloads Meta’s Muse once (about 360 MB, after you agree), you confirm the code on Meta’s page, and the key is kept in your vault.`,`ChatGPT plans: GPT-6.1 Sol (500k context), GPT-6 Sol, GPT-6 Astra and GPT-5.6 Sol are available when your plan lists them, next to the models you already had.`,`Google’s agy: Gemini 4 Argon appears in the model picker when your Google plan includes it (Ultra), at Low, Medium and High.`],fixed:[]},{version:`0.3.234`,date:`2026-10-13`,platforms:[`win32`,`darwin`],added:[`Bring this PC into the chat: on a chat that runs on another PC, press the button in the chat’s toolbar, pick folders on this PC and tick Read, Create, Edit or Delete for each. The chat can then work with those files. It asks you before it creates, changes, moves or deletes anything, and the link ends when you close the tab. Both PCs need this version.`,`Chats on my other PCs: a new switch in the Tools menu lets a chat list your other PCs and their chats, read them, message them and start new chats there on the model you choose. You confirm every new chat.`,`The Tools menu now works on a chat that runs on another PC, so you can switch its tools from here.`],fixed:[`A PC you sign in after OonaCode has started now appears in the left panel by itself, without opening Settings → Devices first.`]},{version:`0.3.233`,date:`2026-10-12`,platforms:[`win32`,`darwin`],added:[`The model picker now tells you when a pick is not in use yet: after you pick a model from another provider, its button says “next message” and explains that the chat keeps running on its current model until your next message.`,`A long chat folds the agents that ran long ago into one “N earlier agents” row that says when they ran, instead of one card for each of them under your newest message.`],fixed:[`A message you send while a chat is working, right after you picked another model or provider, now waits for the running turn and is answered by the model you picked. It used to go to the model that was already running, so the chat kept answering as the old one while the picker showed the new one.`,`Every block in a chat now shows the time it happened — also the notes the app writes itself and the cards for earlier agents.`]},{version:`0.3.232`,date:`2026-10-12`,platforms:[`win32`],added:[`The model picker is redone: your providers on the left, each with how many models it has, and the chosen provider’s models on the right, best first by independent intelligence rating (unrated ones last). Each side has its own search, and the one over the providers finds a model across every provider, showing only the providers that carry it.`,`NVIDIA is back for your own NVIDIA key: twelve hosted models that call tools, among them Nemotron 3 Ultra and Super, Kimi K3, GLM-5.3, DeepSeek V4.1 Flash and Gemma 4.`],fixed:[`Models hosted as vendor/model (Kimi K3 on NVIDIA and the like) now show their intelligence rating.`]},{version:`0.3.232`,date:`2026-10-12`,platforms:[`darwin`],added:[`Sticky notes: the note button beside the bug button at the top opens your notes as tabs. Make as many as you like, name them with a double-click, and write — every change is saved by itself in your vault, so the notes follow you to your other computers. Text only.`,`Chats on your own ChatGPT plan keep their thinking across tool calls, use the effort level you pick (up to max where the model has it), and list the models your account really offers.`,`The model picker is redone: your providers on the left, each with how many models it has, and the chosen provider’s models on the right, best first by independent intelligence rating (unrated ones last). Each side has its own search, and the one over the providers finds a model across every provider, showing only the providers that carry it.`,`NVIDIA is back for your own NVIDIA key: twelve hosted models that call tools, among them Nemotron 3 Ultra and Super, Kimi K3, GLM-5.3, DeepSeek V4.1 Flash and Gemma 4.`],fixed:[`Suggest no longer starts reading the chat the moment you open it: pick how many hours to read, then press Suggest.`,`The Claude Code engine is updated to 2.1.296.`,`Models hosted as vendor/model (Kimi K3 on NVIDIA and the like) now show their intelligence rating.`]},{version:`0.3.231`,date:`2026-10-12`,platforms:[`android`],added:[`On the phone: any text in a chat can be selected and copied, and About became Session info.`],fixed:[]},{version:`0.3.230`,date:`2026-10-11`,platforms:[`win32`],added:[`Sticky notes: the note button beside the bug button at the top opens your notes as tabs. Make as many as you like, name them with a double-click, and write — every change is saved by itself in your vault, so the notes follow you to your other PCs. Text only.`,`Chats on your own ChatGPT plan keep their thinking across tool calls, use the effort level you pick (up to max where the model has it), and list the models your account really offers.`],fixed:[`Suggest no longer starts reading the chat the moment you open it: pick how many hours to read, then press Suggest.`,`A Gemini chat on your own Google plan no longer repeats, turn after turn, a command it refused earlier.`,`The Claude Code engine is updated to 2.1.296.`]},{version:`0.3.229`,date:`2026-10-11`,platforms:[`darwin`],added:[`Suggest, beside Listen in every chat: it reads the last few hours of the chat and suggests what to send it next. You edit it, put it in the message box or send it — nothing runs by itself.`,`The project manager, beside the "about" button over the chat list: tick chats, press Review, and each gets a suggestion you can edit and send with its own button.`,`A tab whose chat finished a turn you have not looked at yet wears a dot (red when the turn failed), and so does its row in the list.`,`Listen to this chat is a player: a seek bar, play and pause, ten seconds back and forward, the previous or next sentence, a speed you can change while it plays, the spoken word highlighted (click any word to play from it), and every summary listed newest first on top.`,`MCP servers: add them in Settings → MCP Servers from a directory of popular ones (PostgreSQL, Supabase, GitHub, Sentry, Slack, Notion, Linear and more) or your own, and switch each on or off per chat.`,`Connectors: Supabase, Railway and Vercel in the Tools menu — sign in once, switch one on in a chat, and the agent can look at your projects, databases, logs and deployments; read-only until you allow changes, and it asks before each one.`,`Pictures: ask any chat for an image and it makes one, saved in the chat’s folder and shown in the chat (a few credits each; Images in the Tools menu turns it off).`,`Web search for every model, from your Mac, with no key and no credits.`,`Claude Haiku 5.5 with a 1M-token window, and Grok 4.7 Fast on your own SuperGrok subscription.`,`Pasting a very long text, or a video, sound or large picture, saves it in the chat’s folder and attaches it as a file.`,`Hover a “Read …png” line in the chat and the picture shows at once.`],fixed:[`A compacted chat reopens with its whole history, not only what came after its last compaction.`,`Deleting a chat frees its OonaCode pool seat at once.`,`Large chats resume faster.`,`The chat summary (“About”) no longer fails on models that think at length.`,`A refusal by Gemini’s safety filter is retried once on another model, like the others.`,`Error notes in the chat read as plain sentences instead of codes or raw data.`,`The message navigator always shows at least four lines and no longer vanishes on the way to it.`]},{version:`0.3.228`,date:`2026-10-11`,platforms:[`win32`],added:[`Suggest, beside Listen in every chat: it reads the last few hours of the chat and suggests what to send it next. You edit it, put it in the message box or send it — nothing runs by itself.`,`The project manager, beside the "about" button over the chat list: tick chats, press Review, and each gets a suggestion you can edit and send with its own button.`,`A tab whose chat finished a turn you have not looked at yet wears a dot (red when the turn failed), and so does its row in the list.`],fixed:[]},{version:`0.3.227`,date:`2026-10-11`,platforms:[`win32`],added:[`Listen to this chat is a player: a seek bar, play and pause, ten seconds back and forward, the previous or next sentence, and a speed you can change while it plays.`,`The word being spoken is highlighted in the summary, and clicking any word plays from there.`,`Every summary the chat has is listed on top, newest first; pick one to hear it, with the languages it was already translated into.`],fixed:[]},{version:`0.3.226`,date:`2026-10-11`,platforms:[`win32`],added:[`Google Gemini (agy) chats show what agy looked at: a picture it viewed appears in the chat, and a sound or video it named plays inside the tool card.`,`Your own SuperGrok subscription offers Grok 4.7 Fast.`,`The Android app groups this PC’s chats by the project each one is filed under.`],fixed:[`Google Gemini (agy) tool steps read in words — View file, Run command, Edit — with their file or command, instead of raw arguments.`,`Your own SuperGrok sign-in presents the current Grok CLI (1.0.50), so xAI does not refuse it as outdated.`]},{version:`0.3.225`,date:`2026-10-10`,platforms:[`win32`,`linux`],added:[`Per-credential usage keys: operator credentials can now store their own console session keys (such as Xiaomi MiMo account credentials) directly in the Admin Panel to monitor individual token plan quotas and balances.`,`Google agy thinking blocks: local Google Antigravity (Gemini) sessions now extract and display model thinking blocks and rich tool arguments in chat from agy transcripts.`],fixed:[`Session info regeneration: fixed an issue where regenerating the session summary for Google Antigravity (Gemini) sessions would fail with a missing subscription token error.`,`Xiaomi MiMo cleanup: removed redundant and withdrawn mimo-v2.5 and mimo-v2.5-pro models from the registry and models catalog; replaced by mimo-v2.6-pro and mimo-v2.6-flash.`]},{version:`0.3.224`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[`Auto-save clipboard files and large pasted text: pasting text exceeding 10,000 characters or 300 lines automatically saves into your workspace .oonacode/tmp folder and attaches as a file without bloating the composer. Clipboard videos, audio, and large images are similarly saved and attached as local paths.`],fixed:[`Error display in chat: masked internal error codes, raw JSON, and provider balance exhaustion notices from the user chat bubble, displaying clean status indicators instead.`,`Google Antigravity pool plan access: included Gemini 3.8 Flash and 3.7 Flash across all active subscription plans (Standard, Pro, Team Standard, Team Premium, Free).`,`Session info panel: fixed an issue where switching between chats could leave stale child views mounted in the session info panel.`]},{version:`0.3.223`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[`MCP Servers settings & Antigravity catalog: configure stdio, sse, and http Model Context Protocol servers in File -> Settings -> MCP Servers. Choose from a rich directory of popular providers (PostgreSQL, Supabase, Redis, SQLite, MongoDB Atlas, GitHub, GitLab, Sentry, Cloudflare, Slack, Notion, Linear, PostHog, Brave Search) or add custom servers.`,`TopBar MCP badge: see your configured MCP servers count at a glance next to the Bug Report button, and click to open MCP settings directly.`,`Per-chat MCP server toggles: selectively enable or disable configured MCP servers per conversation in the composer toolbar to eliminate prompt token overhead.`],fixed:[]},{version:`0.3.222`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[],fixed:[`Chat summary "About": increased housekeeper output token headroom to prevent thinking and verbose models (e.g. Qwen, Gemini) from exceeding the token ceiling and failing with "Claude's response exceeded the 700 output token maximum".`]},{version:`0.3.221`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[`Web search for every model: all models can now search the web via keyless local DuckDuckGo search from your PC, with no extra credentials or credits needed.`,`Claude Haiku 5.5: available with 1M context, 128K output, and tiered pricing (replaces Haiku 4.5).`],fixed:[`Deleting a chat immediately frees its pool seat on the server, instead of keeping it held until the session cache window expires.`,`Session info panel headers: distinct icons for About (sparkle) and Scheduled tasks (bell) so sections no longer repeat the same info glyph.`,`Large sessions resume faster and safer with reverse-bounded transcript loading and auto-trimming to disk.`,`Gemini content safety filter blocks are now caught by safeguard fallback and retried on the fallback model.`]},{version:`0.3.220`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[],fixed:[`A chat on a Google Claude model no longer stops with “Autocompact is thrashing”. Its window was set to 100,000 tokens, so the chat compacted again right after every compaction and the engine gave up; it is now 200,000, and if the engine ever gives up this way the next message starts from a shorter history instead of repeating the same state.`]},{version:`0.3.219`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`Pictures: ask any chat for an image — “generate a realistic tiger fighting a crocodile” — and it now makes one, with any model, the way Google’s Antigravity does. The picture is saved in the chat’s folder and shown right in the chat; click it for the full viewer. It costs a few OonaCode credits per picture, you can edit a picture file from the folder too, and it can be switched off in the Tools menu (Images).`,`The Google Claude models (typed by exact id in the model picker’s Custom model row) show their real 100,000-token window in the session panel, and the chat now compacts before the limit instead of being refused and re-sent.`],fixed:[`Google-hosted Claude and Gemini chats re-used almost none of Google’s prompt cache, so big chats ate the 5-hour window in minutes. They now reuse about 98 % of the prompt, which makes them far cheaper and faster.`,`The hidden /setcustommodel command and the admin custom-model tool are gone — the model picker’s Custom model row does the same job.`]},{version:`0.3.218`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`Connectors: Supabase, Railway and Vercel in the Tools menu. Sign in once with the service’s own page, switch the connector on in a chat, and the agent can look at your projects, databases, logs and deployments. It is read-only until you turn on “Allow changes”, and then it asks you before every change; purchases, billing and secret or key readers are never offered. Each shows whether the service’s command-line tool is installed and can add the vendor’s own skills. In the terminal: oona connectors. Guide: /docs/connectors.`,`Hover a “Read …png” line in the chat and the picture shows at once; click the picture for the full viewer with zoom, like a picture you sent.`],fixed:[`A chat that was compacted no longer reopens showing only what came after its last compaction: the whole history is there again.`,`The message navigator always shows at least four lines, and its list no longer vanishes while the pointer crosses the gap to it.`]},{version:`0.3.217`,date:`2026-10-07`,platforms:[`darwin`],added:[`Pictures you attach open large: click one in the box or in a sent message for a viewer with zoom (buttons, wheel, drag, Fit and 100 %). Click a PDF or text file and it opens in its own program.`,`When a model refuses a message on safety grounds, OonaCode retries it once on another model and says so in the chat. Choose how in Settings → Safeguards: switch automatically, always switch to a model you pick, or never — with a fallback for each model. The same in the terminal: oona settings safeguard-fallback and --fallback-model. Works for Claude, Gemini and Google’s agy.`,`The terminal signs in two ways: your OonaCode account (through your browser) or an OonaCode API key. A fresh oona asks which; oona login --api-key-stdin stores a key for scripts, oona whoami says which one is in use, and oona logout removes it. The terminal manual is on the website: /docs/cli.`,`The conversations badge reads like the agents badge — “3 conversations · 1 active” — and the Conversations window lists every limit: messages, tokens, credits, depth, rates and the idle close.`,`A chat can start a new chat for you on another provider, model, effort or project — it asks you first, and a chat that was itself started by a chat cannot start more.`,`The message navigator’s list shows each message’s date and opens on your latest one; messages further back than 5,000 lines are greyed.`],fixed:[`A chat that was compacted no longer reopens showing only what came after its last compaction: the whole history is there again.`,`The message navigator always shows at least four lines, and its list no longer vanishes while the pointer crosses the gap to it. A click on it now takes you to older messages even while the chat is still replying (the page used to jump straight back).`,`oona: a wrong command or flag now exits with code 2, oona sessions list no longer breaks on multi-line titles, piping oona into head no longer prints an error, and the plain-prompt mode can send a message again.`,`One-shot terminal runs reuse the engine already on the Mac instead of downloading it every time, and a model you typed with /model that is not in the picker keeps its name after OonaCode restarts.`]},{version:`0.3.216`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`The terminal signs in two ways: your OonaCode account (through your browser) or an OonaCode API key. A fresh oona asks which; oona login --api-key-stdin stores a key for scripts and servers, oona whoami says which one is in use, and oona logout removes it. The key is sealed by the host and never written to the terminal’s config.`,`The terminal manual is on the website: /docs/cli, written from commands run on Debian and Ubuntu servers.`],fixed:[`oona: a wrong command or flag now exits with code 2, oona sessions list no longer breaks on multi-line titles, piping oona into head no longer prints an error, and the plain-prompt mode can send a message again.`,`One-shot terminal runs reuse the engine already on the PC instead of downloading it every time.`,`A model you typed with /model that is not in the picker keeps its name after OonaCode restarts.`]},{version:`0.3.215`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`Pictures you attach open large: click one in the box or in a sent message for a viewer with zoom (buttons, wheel, drag, Fit and 100 %). Click a PDF or text file and it opens in its own program.`,`When a model refuses a message on safety grounds, OonaCode retries it once on another model and says so in the chat. Choose how in Settings → Safeguards: switch automatically, always switch to a model you pick, or never — with a fallback for each model. The same in the terminal: oona settings safeguard-fallback and --fallback-model. Works for Claude, Gemini and Google’s agy.`,`The conversations badge reads like the agents badge — “3 conversations · 1 active” — and the Conversations window lists every limit: messages, tokens, credits, depth, rates and the idle close.`,`A chat can start a new chat for you on another provider, model, effort or project — it asks you first, and a chat that was itself started by a chat cannot start more.`,`The message navigator’s list shows each message’s date and opens on your latest one; messages further back than 5,000 lines are greyed.`],fixed:[`A click on the message navigator now takes you to older messages even while the chat is still replying (the page used to jump straight back).`,`The message navigator no longer touches the message times, and its lines are darker and longer.`]},{version:`0.3.214`,date:`2026-10-06`,platforms:[`darwin`],added:[`OonaCode runs natively on Apple Silicon Macs. The installer picks the Apple Silicon build by itself, and an Apple Silicon Mac that had the Intel one moves to it on its next install or update — the Intel build cannot run there on macOS 14 or older.`,`A message navigator on every chat: the small stack of lines at the middle-right of the chat is your own messages — rest on it, focus it or tap it and the list of everything you sent opens; click one and the chat scrolls straight to it.`],fixed:[`On an Apple Silicon Mac with macOS 14 or older, every chat crashed (“CPU lacks AVX support”) and Update did nothing. If yours did, run once in Terminal: curl -fsSL https://oonacode.oonak.ai/install.sh | bash`,`When an update cannot start, the app now says why and what to run instead of saying “Updating OonaCode…” while nothing happens.`,`File → Export chats… no longer freezes the window under a Save panel: the zip goes straight into Downloads and Finder shows it.`]},{version:`0.3.213`,date:`2026-10-06`,added:[`A message navigator on every chat: the small stack of lines at the middle-right of the chat is your own messages — rest on it, focus it or tap it and the list of everything you sent opens; click one and the chat scrolls straight to it. Escape closes the list.`],fixed:[],platforms:[`win32`,`linux`]},{version:`0.3.212`,date:`2026-10-06`,added:[`Headless one-shot runs without signing in: --api-key (or OONACODE_API_KEY) bills the run through the gateway on that OonaCode key — held in memory for the run only, never stored. For containers and CI.`],fixed:[`A keyed run no longer stops at the device-link screen, and no longer dies with "the OonaCode pool needs your OonaCode account": the key now also covers provider routing and the registry read on a machine that was never signed in.`],platforms:[`win32`,`linux`]},{version:`0.3.211`,date:`2026-10-06`,added:[`A message navigator on every chat: the small stack of lines at the middle-right of the chat is your own messages — rest on it and the list of everything you sent opens; click one and the chat scrolls straight to it.`,`One-shot runs without signing in: --api-key (or OONACODE_API_KEY) bills the run through the gateway on that OonaCode key — held in memory for the run only, never stored. For headless machines and containers.`],fixed:[],platforms:[`linux`]},{version:`0.3.210`,date:`2026-10-05`,added:[`Use a project folder opens on the folder the chat runs in — its project, or the workspace OonaCode made for it — instead of an empty box.`],fixed:[`Send now on one queued message no longer makes the other queued messages look sent: they stay under the chat, each with its own Send now, and get their tick when the agent reads them.`,`After you confirm the agent’s request to move a chat to another folder, the chat shows the new folder at once, not only after your next message.`]},{version:`0.3.209`,date:`2026-10-05`,platforms:[`win32`,`darwin`],added:[`Scheduled tasks say which model a run uses: always the chat’s model at the moment the task fires, named in the Scheduled tasks panel.`],fixed:[`A Google Gemini chat keeps Google’s agent running for half an hour between messages, so the next message after a pause no longer waits about four seconds for agy to start.`,`Commands run in a Google Gemini chat reach servers on your own PC (localhost) and plain http:// sites again.`]},{version:`0.3.209`,date:`2026-10-05`,platforms:[`linux`],added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`,`Scheduled tasks say which model a run uses: always the chat’s model at the moment the task fires, named in the Scheduled tasks panel.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`,`A Google Gemini chat keeps Google’s agent running for half an hour between messages, so the next message after a pause no longer waits about four seconds for agy to start.`,`Commands run in a Google Gemini chat reach servers on your own PC (localhost) and plain http:// sites again.`]},{version:`0.3.208`,date:`2026-10-04`,platforms:[`win32`,`darwin`],added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`]},{version:`0.3.207`,date:`2026-10-04`,added:[`Every chat lists every provider you have connected and the OonaCode pool — Google Gemini too, whatever the chat ran on before. Switching keeps the conversation: a chat moving off Google continues with its whole history, and a chat moving onto Google gives Google’s agent the conversation so far, so it can carry on.`],fixed:[`Two messages sent a moment apart while a chat was starting no longer leave one of them stuck in the queued strip: the engine had read them together as one message, and OonaCode now recognises that.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini installs Google’s agy by itself the first time you use it — open the provider in Settings → Providers, or send a message to a Google Gemini chat — instead of waiting for you to press Install.`],fixed:[`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`,`oona doctor no longer tells you to change settings that OonaCode stopped reading.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`linux`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`darwin`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`The command line’s reinstall hint on a Mac is the one that works: curl -fsSL https://oonacode.oonak.ai/install.sh | bash.`]},{version:`0.3.205`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini now lists every model your Google plan offers through agy, not only Gemini: Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B (marked “via Google”) sit beside Gemini 3.8, 3.7 and 3.6 Flash and Gemini 3.1 Pro. They run on Google’s own agent with your Google plan, and have their own usage window.`],fixed:[]},{version:`0.3.204`,date:`2026-10-04`,platforms:[`win32`],added:[`Signing in to Google Gemini opens Google’s page for you and shows how many seconds are left: Google’s agy waits only one minute for the sign-in. Paste the code Google shows and it is sent at once.`],fixed:[`Signing in to Google Gemini finishes. The code you pasted never reached Google’s agy in the installed app (the window it types into dropped everything typed), so the sign-in waited out its minute and failed.`,`The Claude sign-in’s “paste the code” box, which used the same window, can type the code too.`]},{version:`0.3.203`,date:`2026-10-04`,platforms:[`win32`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini and press Install: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back here. OonaCode never sees your password. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only, no pictures), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total (“51 agents”) is grey, instead of the other way round.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`darwin`],added:[`OonaCode runs on macOS 12 or newer: the agent, your chats, the background service and the desktop app, installed with the same one line as on Linux — curl -fsSL https://oonacode.oonak.ai/install.sh | bash. An Intel build; Apple Silicon Macs run it through Rosetta 2. Your sign-in key is kept in your login keychain.`,`Updating is the same line again, oona update in a terminal, or the update button in the app: it closes OonaCode, puts the new version in place and opens it again. The app is not signed by Apple yet, so it cannot be downloaded from a browser and does not update itself the way it does on Windows.`],fixed:[]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`linux`],added:[],fixed:[`Your sign-in survives a restart on a PC that keeps OonaCode’s key in the login keyring (GNOME Keyring, KWallet): two of OonaCode’s keys shared one keyring entry and overwrote each other, and every start of the host wrote over the stored key — so after a restart you could find yourself signed out.`,`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode (an nvm folder, for example).`,`oona update installs from the site your OonaCode was installed from, not always from oonacode.oonak.ai.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`win32`],added:[],fixed:[`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode.`]},{version:`0.3.201`,date:`2026-10-03`,added:[`The Tools menu lists only tools that work. Desktop control, Clipboard, Screen capture and Run as administrator were demos that never ran anything, and they are gone: the agent already reads and sets your clipboard, takes screenshots and asks Windows for administrator rights through its own commands.`],fixed:[`Oonak Browser keeps working when its window is behind other windows. A browser covered by the OonaCode window used to crawl, and some clicks and scrolls gave up after 30 seconds.`,`Oonak Browser no longer clicks a hidden copy of a link, or a link inside a closed menu, when a site has both a visible and a hidden one.`,`A message you send right after a reply failed no longer stays pinned above the box as “queued” once the agent has read it.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`win32`],added:[`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`],fixed:[`Oonak Browser works on sites built from web components, Google’s own forms among them: it reads, finds, clicks and types inside them, where it used to answer “the page changed” or find nothing.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`linux`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`,`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`,`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`,`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop.`,`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name matches each word, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond, and it works inside web components, Google’s own forms among them. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`,`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed — 10 days after their last change.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`,`Chats talking to each other no longer ping-pong: a reply needs no answer, several messages from the same chat are read together in one turn, and a message card says “answer requested” until the answer has gone back, then “answered” with the time.`,`A tool you switch on while a chat is replying works for the message you send next, even mid-reply. After an update, a chat that had background tasks running shows one line saying how many stopped, instead of one card per task.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`,`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`,`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`,`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption.`]},{version:`0.3.199`,date:`2026-10-02`,platforms:[`win32`],added:[`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name is smarter too: each word is matched, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`],fixed:[`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`]},{version:`0.3.198`,date:`2026-10-01`,platforms:[`win32`],added:[`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one — the phone used to show “Ask first” for a Build chat. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`Play in Listen is never greyed out for want of a voice: it gets the text ready and names the voice to install.`]},{version:`0.3.197`,date:`2026-10-01`,platforms:[`win32`],added:[`Oonak Browser, the browser your chats use, moves to version 151 by itself at its next use: a build with no Google services (no Safe Browsing warnings, push notifications or search suggestions). The download is checked against its fingerprint before anything is unpacked, and the old version is removed once no chat’s browser still runs from it.`],fixed:[`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`]},{version:`0.3.196`,date:`2026-10-01`,platforms:[`win32`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`],fixed:[`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption: the next sync that works clears it by itself.`]},{version:`0.3.195`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`Chats talking to each other no longer ping-pong. A message asks for an answer only when the chat really needs one; a reply needs no answer and is not answered with a new message; and several messages waiting from the same chat are read together in one turn. Fewer wake-ups, fewer tokens.`,`A message card says what is true: “answer requested” until the answer has gone back, then “answered” with the time — instead of an orange “reply expected” that never went away.`]},{version:`0.3.194`,date:`2026-10-01`,platforms:[`win32`],added:[`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[]},{version:`0.3.193`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`A tool you switch on while a chat is replying works for the message you send next, even mid-reply: that message now waits for the chat to restart with the new tool instead of reaching the model without it.`,`After an update, a chat that had background tasks running shows one line — “11 background tasks stopped — they were running when OonaCode restarted this chat” — instead of one card per task. Click it to see each one.`]},{version:`0.3.192`,date:`2026-09-30`,platforms:[`win32`],added:[`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop. Other languages are translated once and kept, so hearing the same briefing again costs nothing.`],fixed:[]},{version:`0.3.191`,date:`2026-09-30`,platforms:[`win32`],added:[`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed. They are deleted by themselves 10 days after their last change; resuming or editing a paused task gives it another 10 days.`],fixed:[]},{version:`0.3.190`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`]},{version:`0.3.189`,date:`2026-09-30`,platforms:[`linux`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window; “Move to main window” brings it back. On Wayland desktops the new window opens at the usual place rather than under the pointer. Your split views and windows come back when you restart OonaCode.`,`Every language plays in Listen to a chat: each language picks the best voice on its own — OonaCode’s Armenian voices first, then your system’s voices, then eSpeak (install the espeak-ng package if your system has no voice for a language).`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.188`,date:`2026-09-30`,platforms:[`win32`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window. Drag it back onto the main window’s tabs, or choose “Move to main window”, to bring it back. Your split views and popped-out windows come back when you restart OonaCode.`],fixed:[]},{version:`0.3.187`,date:`2026-09-30`,platforms:[`win32`],added:[`Every language plays in Listen to a chat. Persian, Georgian, Ukrainian — and any language whose Windows voice is not installed — now speak with eSpeak, a free voice that comes with OonaCode (it sounds robotic, but it always works). Each language picks the best voice on its own: OonaCode’s Armenian voices first, then Windows’ own, then eSpeak.`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.186`,date:`2026-09-30`,platforms:[`linux`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`,`OonaCode brings two Armenian voices of its own, Astgh and Artsiv, and also speaks with your system’s voices through speech-dispatcher — install speech-dispatcher and espeak-ng for Persian, Russian and every other language; the Listen window names the packages for your distribution.`,`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`,`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`,`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. Pin any chat or project to the top of the list from its menu.`,`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`,`Type / at the start of a message to see the chat’s commands and skills, with what each does, in two titled sections. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing; switch one on to let the model use it by itself in that chat. Typing /name still runs any skill for one turn.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`,`Search in the Import window: find a chat by its name, its first or last message or its folder, or pick “Whole conversations” to search inside the chats themselves.`],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from, with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once.`,`The message box fits a narrow chat: its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it.`,`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Only new replies change.`,`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model, /usage, /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`,`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message.`,`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`,`Typing /model in a chat updates the chat’s model and the model picker again, and command output such as /context reads the same while it arrives and after you reopen the chat.`,`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.185`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`Listening with a Windows voice no longer stops after the first sentence when the voice fails to say it has finished.`]},{version:`0.3.184`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`],fixed:[`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`]},{version:`0.3.183`,date:`2026-09-30`,platforms:[`win32`],added:[`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`],fixed:[]},{version:`0.3.182`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from — Claude Code, the Claude app, Qwen Code, Cursor — with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once. The Import button says how many chats it will bring over.`]},{version:`0.3.181`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`The message box fits a narrow chat. In a small window, or with the side panels open, its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it, and the model and effort pickers keep their words readable.`]},{version:`0.3.180`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Other models were never affected. Only new replies change; older thoughts stay empty.`]},{version:`0.3.179`,date:`2026-09-29`,platforms:[`win32`],added:[],fixed:[`The / menu is easier to read: skills and commands in two titled sections, each with one short line — the full description shows when you point at it.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model (use the model picker), /usage (the engine’s own estimate, not your credits), /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`]},{version:`0.3.178`,date:`2026-09-29`,platforms:[`win32`],added:[`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. A dot on it tells you when something is due soon.`,`Pin any chat or project to the top of the list from its menu.`],fixed:[`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.177`,date:`2026-09-29`,platforms:[`win32`],added:[`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`],fixed:[`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message, and the picker shows Sonnet 5.5.`]},{version:`0.3.176`,date:`2026-09-29`,platforms:[`win32`],added:[`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing — about 1,400 tokens on every message until now. Switch one on to let the model use it by itself in that chat; the list shows what each one costs per message while on.`,`Typing /name still runs any skill for one turn, whether its switch is on or off.`],fixed:[`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`]},{version:`0.3.175`,date:`2026-09-29`,platforms:[`win32`],added:[`Type / at the start of a message to see the chat’s commands and skills — the Claude Code engine’s own (/compact, /context, /review, /security-review, /init and more) and the skills in your project’s .claude folder — with what each does. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`],fixed:[`Typing /model in a chat updates the chat’s model and the model picker again.`,`Command output such as /context reads the same while it arrives and after you reopen the chat.`]},{version:`0.3.174`,date:`2026-09-28`,platforms:[`win32`],added:[`Search in the Import window. Type to find a chat by its name, its first or last message, or its folder — chats folded away as already imported or deleted here show up too when they match. Or open the search options and pick “Whole conversations” to search inside the chats themselves, with a few lines of each match under the chat. It only reads Claude Code, Cursor and the Claude app’s files, never changes them.`],fixed:[`Chats Claude Code switched to another model are answered by that model for real: OonaCode’s pool now serves the model the engine falls back to, and never answers a Claude request with another company’s model.`]},{version:`0.3.173`,date:`2026-09-28`,platforms:[`linux`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`,`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`,`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`,`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`,`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`,`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`A chat can no longer be moved into your home folder or the root folder through a link. Where /home is itself a link (Fedora Silverblue, Bazzite and similar systems), the home folder passed as an ordinary folder, and the chat would have loaded your own Claude Code settings as its project.`,`Signing in to your own Claude subscription inside the app works on Ubuntu 24.04, Debian, Linux Mint, Pop!_OS and Zorin OS again. There, a part of OonaCode built for newer systems did not load, and the sign-in fell back to a command you had to paste.`,"On Ubuntu, Linux Mint, Pop!_OS, Zorin OS and similar systems, `oona` now works in every new terminal right after you install or update. The installer used to leave it off your PATH until you logged out and back in; now it adds it for new terminals itself, and `oona uninstall` takes that line out again.",`Every way of uninstalling — “oona uninstall”, or the install command with --uninstall — now takes this PC off your account: keep your chats and they stay readable on your other devices; delete them and their copies go too. It never touches your Claude Code or the Claude app, and “oona uninstall” no longer gives up when the background service is stopped.`,`The installer now says at once when a system cannot run OonaCode — one older than Ubuntu 22.04, Debian 12 or RHEL 9, or one built on musl such as Alpine — instead of installing a copy that could not start. The .deb and .rpm tell apt and dnf the same.`]},{version:`0.3.172`,date:`2026-09-28`,platforms:[`win32`],added:[`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Uninstalling from Settings → Apps now also takes this PC off your account, exactly like “oona uninstall”: keep your chats and they stay readable on your other devices; delete them and their copies go too.`,`“oona uninstall” no longer gives up when the background service is stopped.`,`The “Updating OonaCode…” window shows again on the newest Windows 11 versions (24H2 and later).`]},{version:`0.3.171`,date:`2026-09-28`,platforms:[`win32`],added:[`Oonak Browser now picks its own control port from a range no developer tool uses by default, so it can no longer take a port that Shopify CLI or a dev server wants. If a program needs a particular port kept free, or you want the browser on a specific one, just ask the chat.`],fixed:[`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`Uninstalling OonaCode from Settings → Apps now removes all of it — the app, the command line and its background service — and asks whether to keep your chats. Installing again afterwards no longer says it is already installed. Your Claude Code and Claude app are never touched.`,`“oona uninstall” works again on Windows 11.`,`A chat “about” you wrote yourself no longer shows “stale”.`]},{version:`0.3.170`,date:`2026-09-28`,platforms:[`win32`],added:[`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`]},{version:`0.3.169`,date:`2026-09-28`,platforms:[`win32`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`],fixed:[`A chat can no longer be moved into your user folder or a drive root through a link or junction that points there — its project settings would have been your own Claude Code settings.`]},{version:`0.3.167`,date:`2026-09-27`,platforms:[`win32`],added:[`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`],fixed:[]},{version:`0.3.166`,date:`2026-09-27`,platforms:[`win32`],added:[],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`]},{version:`0.3.165`,date:`2026-09-27`,platforms:[`win32`],added:[`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`Chats now use Oonak Browser, in a window you can see, for everything that needs a web browser — not Chrome, Edge or a hidden script browser — unless you name another browser. It runs without a window (headless) only when you ask for that.`],fixed:[`After an update, the background service comes back by itself. An update could leave it unable to restart, and the app then showed “OonaCode could not start its host service” even though it went on to open normally.`]},{version:`0.3.164`,date:`2026-09-27`,platforms:[`win32`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when OonaCode’s stored key cannot be opened for a moment. OonaCode used to replace the key and lose your sign-in; it now keeps the key and signs you back in by itself as soon as it opens.`]},{version:`0.3.163`,date:`2026-09-27`,platforms:[`linux`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when its security chip is slow to open OonaCode’s stored key. After a system update and reboot, the chip on some machines refuses for a while; OonaCode used to replace the key and lose your sign-in. It now keeps the key and signs you back in by itself as soon as the chip opens it.`]},{version:`0.3.162`,date:`2026-09-27`,added:[],fixed:[`A chat switched to another model knows which model it is. After a switch from Claude to DeepSeek, the model used to keep saying it was Claude — the chat history and Claude Code’s own prompt told it so.`,`Oonak Browser is offered only where it can run. An older OonaCode no longer lists a browser tool it cannot use, so the model does not spend tokens working around it — update to get the browser.`]},{version:`0.3.161`,date:`2026-09-27`,added:[`Settings → This PC → “Replace pictures older than N days”: screenshots and pasted pictures in your chat history are replaced by a short note once they are older than a year (you choose the number, or 0 to keep them). The words of every chat stay; the database stops growing with pictures. It runs by itself.`],fixed:[`The model, Build/Plan/Ask and effort pickers under the message box now look like the dropdowns they are.`,`Switches that are off are easy to see in dark mode.`,`Error messages show what went wrong in words, without raw tags or a provider’s JSON.`,`The ✕ that removes an attachment or a reply is round.`,`Pressing Stop, or an update cutting a turn, no longer files an automatic bug report.`]},{version:`0.3.160`,date:`2026-09-27`,added:[`On Windows, the agent can use a real browser. Ask it to open a site, read a page, click, fill in a form or take a screenshot, and it does it in Oonak Browser, in a window you can see. The first time, OonaCode asks once to install the browser (about 210 MB); after that it opens straight away.`,`Each chat has its own browser profile, so a site you sign in to stays signed in for that chat. Switch the browser off for a chat in its Tools menu.`],fixed:[]},{version:`0.3.159`,date:`2026-09-27`,added:[],fixed:[`A chat reopened after an update no longer says “turn complete” the instant you send a message and then answer anyway. The engine’s own note about work that stopped during the update used to be taken for the end of your turn, with the whole earlier conversation’s tokens on the line.`,`A background task that stopped because OonaCode restarted now says so in plain words, instead of “Orphaned by a previous Claude Code process exit”.`]},{version:`0.3.158`,date:`2026-09-27`,added:[`Every thought in a chat shows how many words it has, so you can tell at a glance whether there is anything to read.`],fixed:[`A thought with nothing in it — some models return only a signature for their thinking — now says “Thought · empty” and no longer opens onto a blank box.`,`A command the agent was allowed to run no longer leaves an “Allowed Bash (automatically)” line under its own card: the card already shows the command and its result. Refusals are still shown.`]},{version:`0.3.157`,date:`2026-09-27`,added:[`On Linux, OonaCode has its own signed apt and dnf repositories. Install the app with apt (Debian, Ubuntu, Mint) or dnf (Fedora, RHEL, Rocky, Alma) — the commands are on the download page — and your package manager keeps it up to date with the rest of the system.`,`Every Linux release is signed with the OonaCode release key, and the one-line installer checks that signature before it installs anything.`],fixed:[`On Linux, the menu bar is drawn in the window in the app’s own colours, and it switches between light and dark with the app instead of keeping the desktop’s theme until a restart.`,`Upgrading the .rpm no longer removes the oonacode command, and removing it no longer leaves empty folders behind.`]},{version:`0.3.156`,date:`2026-09-27`,added:[`Chats can talk to each other. Turn on “Talk to other chats” in a chat’s Tools menu, and its agent can find your other chats that have it on, read them, and ask them for help — one chat or a whole group. A chat that is closed wakes up to answer; a busy one answers when it finishes. The reply comes back to the chat that asked.`,`The Conversations window (in the sidebar) shows every conversation between your chats: who said what to whom, what each answer cost, and buttons to pause, resume, close or stop them all. Each conversation has a budget — 20 messages and 1,000,000 new tokens by default — and pauses itself when it is used up, so chats can never talk forever.`,`Hover over any tool in a chat’s Tools menu to read what it does, how it works, what it costs and how to turn it off.`],fixed:[`A chat woken in the background — by a scheduled task or another chat — shows as working in the sidebar even when it is not open in a tab.`,`A scheduled task no longer slips into a chat at the same moment you send it a message; yours always goes first.`,`A message sent from the terminal no longer waits forever when a chat’s history cannot be resumed and the restart fails. It now says why.`,`Notes OonaCode writes into a chat — a model change, a conversation paused — are still there when you reopen it.`,`When every Claude seat in the OonaCode pool is taken, a new chat now says the model is busy and to try again in a few minutes or pick another model, instead of “Something went wrong on our side”.`,`On Linux, the app tells you it is updating while it swaps itself, so there is no need to start it again.`,`On Linux, removing the .deb or .rpm leaves nothing running and nothing failing at the next login, and the one-line installer checks for free disk space before it changes anything.`]},{version:`0.3.155`,date:`2026-09-27`,added:[`OonaCode runs on Linux. One command installs the command line, the background service and the desktop app: curl -fsSL https://oonacode.oonak.ai/install.sh | bash. The AppImage, .deb and .rpm are on the download page too.`,`On Linux the app lives in the system tray as it does on Windows, follows your desktop’s light or dark theme, and gets its own entry in the applications menu.`,`Uninstalling on Linux removes the desktop app along with the rest, and asks whether to keep your chats for a future install.`],fixed:[`A window no longer stays on “Unauthorized” after the background service restarts with a new key. It reconnects by itself.`]},{version:`0.3.154`,date:`2026-09-26`,added:[],fixed:[`A chat waiting on a long job no longer loses its watcher. OonaCode used to close a chat’s engine ten minutes after the model last spoke, which stopped any Monitor or background command it had left running. The engine now stays up while such work runs, up to 12 hours.`,`A chat moved into a project, or whose project you edit, now follows the project’s instructions from its next message. It used to keep the ones it started with.`]},{version:`0.3.153`,date:`2026-09-25`,added:[],fixed:[`A very long chat no longer answers “Prompt is too long” after OonaCode restarts or updates. The engine was judging the chat’s size by a figure left over from before the restart, and now gets an accurate one.`,`If a message is ever refused as too long before the model has started on it, OonaCode sends it again by itself with a shorter history. You see your message once and then the answer, not an error.`]},{version:`0.3.152`,date:`2026-09-25`,added:[],fixed:[`Uninstalling the app from Windows’ Apps list no longer stops the command-line OonaCode on the same PC from starting after a restart.`]},{version:`0.3.151`,date:`2026-09-25`,added:[`Files the agent names in a chat are clickable. Audio and video play right in the chat with a small player, pictures open as a preview, and in the app every file can be opened in its own program or shown in its folder.`,`Uninstalling the app asks whether to keep your chats on this PC. Keeping them means a new install signs in and continues every chat.`],fixed:[`Installing and updating no longer fail with “The operation has timed out” on PCs whose network drops the newer internet addresses, nor while our server restarts for an update.`]},{version:`0.3.150`,date:`2026-09-25`,added:[],fixed:[`The fix in 0.3.149 for long, sleeping turns now really reaches the agent: the Monitor tool and the block on long waits are on for every chat.`,`A chat compacted after a long pause no longer pays to cache a conversation it is about to replace, and the agent keeps each tool call in its history exactly as it wrote it — both as Claude Code does.`]},{version:`0.3.149`,date:`2026-09-25`,added:[`The agent can watch a long job with the Monitor tool, as Claude Code does, and is woken the moment the job finishes.`],fixed:[`Long chats no longer spend their time asleep. With no way to watch a background job, the agent had been polling it with waits of four to eight minutes. One chat spent more than three and a half hours of a day sleeping, and turns ran for hours while the model worked for a fraction of that. The agent now gets the same working rules as Claude Code, and long waits are blocked.`]},{version:`0.3.148`,date:`2026-09-25`,added:[],fixed:[`A scheduled task that could not be sent — the PC had just restarted, the vault was still locked, the server was not reachable yet — waits and tries again instead of switching itself off. Pausing, editing or deleting a task while its prompt is being sent is no longer undone, and a scheduled prompt no longer lands in a chat whose engine is still starting.`,`A chat on your own DeepSeek key, or one switched with a typed “/model opus”, is no longer shown as withdrawn and locked. “/model fable” picks Claude Fable instead of the default model.`,`Moving a chat to another model no longer lowers its saved effort level to what the old model offered, and a one-off “oona --effort” is no longer saved as the chat’s level.`,`After you pick another model for a locked chat and send, the chat no longer flashes the lock again while the engine starts; if the start fails, your pick is kept.`,`Coming back from a file tab no longer jumps the chat to an old reply or reopens the search bar.`,`The hidden sidebar slides away again when the pointer leaves the window past its edge, and the keyboard no longer tabs through it while it is hidden. Clicking ⓘ in Settings opens its note instead of closing it.`,`Subagents write their prompt cache for five minutes, as Claude Code does for its subscribers; the chat itself keeps the hour. Their cache writes cost less.`]},{version:`0.3.147`,date:`2026-09-25`,added:[`A chat’s scheduled tasks sit beside its subagents: a clock badge says how many are live and when the next one runs, and opens the list — each task’s schedule, its next and last run, Pause and Delete. The tasks run on this PC.`],fixed:[`A prompt the scheduler sends into a chat reads as a “Scheduled task” line, not as your own message waiting in the queue.`,`A chat whose model is no longer offered shows that model in red and waits for you to pick another; its history stays, and the old model is not in the list any more.`,`The effort list follows the server within minutes, without restarting the app. A chat set to a level that has been switched off moves to the nearest one — ultracode becomes xhigh. Chats on your own Claude subscription have an effort picker again.`]},{version:`0.3.146`,date:`2026-09-25`,added:[`A Tools menu beside the model picker: switch OonaCode’s own tools on or off for each chat — browser, desktop and window control, clipboard, screen capture, Office documents and run-as-administrator. Each tool costs the model only a short line until it is used, and the menu shows how much. The first tools are marked Demo while they are tested with every model: a demo tool answers what it would have done, and does nothing on your PC yet.`],fixed:[]},{version:`0.3.145`,date:`2026-09-25`,added:[],fixed:[`Every request of every chat, on every model, is about 3,200 tokens smaller: the engine’s own “auto memory” instructions are gone. OonaCode starts each engine in a fresh private folder and deletes it afterwards, so the notes the model was told to keep there were thrown away when the chat went idle — the model spent tool calls writing memories it would never read. A project’s memory is OonaCode’s own and stays.`,`The engine’s claude.ai Artifact tools are switched off everywhere OonaCode runs it — the app, the terminal, VS Code, the phone, Telegram and the agent API.`]},{version:`0.3.144`,date:`2026-09-25`,added:[],fixed:[`Long chats on Claude models in the OonaCode pool keep their cache for an hour, as Claude Code does for its subscribers. A pause of more than five minutes no longer re-sends the whole conversation at the full cache-write price, which in a large chat was the most expensive part of coming back to it.`,`The session panel’s Context shows how big the conversation is now, not the total of every request the chat ever made — a long chat read “10.7M / 1.0M tokens”.`,`The message box keeps the cursor after you send, so you can go straight on typing the next message.`,`A paid chat’s background work (titles, reading web pages) no longer goes to a free model of the same vendor.`]},{version:`0.3.143`,date:`2026-09-24`,added:[`Search inside your chats: open the search in the chat list, press the sliders button and choose Whole chats. It looks through every message of every chat on this PC, and you choose whose words — yours, the model’s, or both — plus, if you like, the tools’ commands and output and the subagents’ conversations. Results show each message with the words lit; a click opens the chat with its search on them.`,`More search options, for both kinds of search: one project only, a time window (today, 7 or 30 days), match case and whole words.`],fixed:[`While you search the chat list, projects with no matching chat are hidden too.`]},{version:`0.3.142`,date:`2026-09-24`,added:[],fixed:[`A reply you sent shows as the same small chip it had in the message box — “Reply to” and the first few words — instead of the whole quoted text; the full quote appears when you rest the pointer on it, and a click jumps to the message it answers.`,`The model now knows a reply points back into the conversation: it is told the quoted lines are from the chat history, not new input, and whose words they were — its own earlier reply, your earlier message, a file, or a tool’s output.`,`When the chat list is narrow, its buttons wrap onto a second line instead of spilling out of it.`]},{version:`0.3.141`,date:`2026-09-24`,added:[`The chat list on the left can be made wider or narrower: drag its right edge (double-click it for the usual width).`,`The chat list can hide: press the pin in its header, the button at the top left, or View → Sidebar (Ctrl+B). While hidden it slides in when the pointer reaches the left edge of the window, and slides away when you leave it.`,`Search in the chat list is a single magnifier now; click it and the search box opens across the top. Escape or × clears it.`],fixed:[`Opening OonaCode right after a restart no longer leaves the OonaCode pool models out of the model list: if they cannot be read yet, OonaCode asks again by itself a few seconds later and the list fills in.`,`The Artificial Analysis scores (intelligence, coding, speed and benchmarks) show on every model in the model list again — including the models of your own Claude and SuperGrok subscriptions, which never had them.`,`A chat’s details card no longer appears on top of its right-click menu.`]},{version:`0.3.140`,date:`2026-09-24`,added:[`Reply is tidier: the message you reply to shows as a small chip above the message box with its first few words, instead of filling the box. Click the chip — or the quote in a sent reply — to jump to that message; the × removes it.`,`Right-click a project in the sidebar for its settings: Project settings… opens Projects with that project already selected. The gear beside a project’s “+” does the same, and a chat filed in a project offers it in its own menu too.`,`Link GitHub. Under a project’s Repositories (and in Settings → Providers), link your GitHub account once: the agent’s git and gh then clone, pull and push your private repositories on every PC of yours. You type a short code on github.com; the token stays in your encrypted vault and never reaches the OonaCode server. Public repositories need nothing.`],fixed:[]},{version:`0.3.139`,date:`2026-09-24`,added:[`Every setting now says what it does, and resting the pointer on the ⓘ beside it tells you where in OonaCode it applies and what it does not do.`,`Export chats… is in the File menu (and on the sidebar in a browser window) instead of in Settings.`,`With Remote access turned off on a PC, your phone, Telegram, the website and your other PCs still show it — online or not — marked “remote access off”, and opening it tells you to turn Remote access back on in OonaCode on that PC.`],fixed:[`Turning Remote access off now tells your other devices at once. Before, the PC was already unreachable from them, but they could not say why.`,`The settings of This PC save the moment you change them — nothing is lost by closing the dialog.`,`Settings that did nothing, or repeated another one, are gone: the default permission mode (each chat’s Build / Plan / Ask first picker decides), the agent-picker switch, the Git Bash path, the engine path and the extra allowed origins. The server address is shown, not edited — signing in sets it.`]},{version:`0.3.138`,date:`2026-09-24`,added:[`Projects have settings now, like the Claude app’s: a goal, the repositories the project works on, what a new chat in it starts on (model, effort and folder), a project memory the agent keeps up to date, and whether its chats may schedule work — and how often at most. All of it is in Projects, and a Claude app project you import brings its own.`,`OonaCode has a scheduler. Ask the agent to do something later or on a repeat — “check the build every morning at nine” — and it schedules it on this PC; when it is due, the prompt arrives in the chat, even if the chat had gone quiet. The Projects dialog and the chat’s info panel list what is scheduled, where you can pause, resume or delete it.`],fixed:[`Saving a project’s instructions now reaches its chats at their next message, instead of waiting until the chat happened to restart.`]},{version:`0.3.137`,date:`2026-09-24`,added:[],fixed:[`After a PC restart the app could ask for a "host token" and sign you out: two copies of the OonaCode background service started at once and fought over your session. Only one ever runs now, and the app never shows the token page — if its service is replaced it reconnects by itself.`,`The unlock screen stays put until you unlock, and says what went wrong in place — a wrong password, or a connection it is re-establishing — instead of jumping to another page.`,`A message with a picture sent while the agent was working stayed “queued”, and removing it said it was already sent. It now shows as read the moment the agent takes it, and a reopened chat shows it with its picture.`,`In the model’s questions, typing your own answer now clears the options you had picked, and picking an option clears what you typed — the answer sent is exactly the one you chose. The same on the phone, in the terminal and in Telegram.`]},{version:`0.3.136`,date:`2026-09-24`,added:[`Every model now has its own housekeeper — the small, fast model of the same maker that writes a chat’s titles and reads the web pages it fetches. On the OonaCode pool a MiMo v2.6 Pro chat uses MiMo v2.6 Flash, a Qwen chat Qwen3.8 Flash, a GLM chat GLM-5.3 Flash and a GPT-5 chat GPT-5 mini, instead of doing that work on the big model itself. A free model keeps its own, so it stays free.`],fixed:[]},{version:`0.3.135`,date:`2026-09-24`,added:[],fixed:[`Claude models on the OonaCode pool — Opus 5.5, Opus 5, Sonnet 5 and Fable 5.1 — now use their whole 1M context. A long chat no longer stops to summarise itself every ~170k tokens, and its subagents get the same window.`,`Reading a web page is quick again in a Claude chat: pages are read by Claude Haiku, as in Claude Code, instead of a helper that took about a minute a page.`,`Changing a chat’s model now moves its subagents and background helpers to the new model too; before, they stayed on the old one until the app restarted.`,`MiMo v2.5 and v2.5 Pro chats now use their full 1M context too.`]},{version:`0.3.134`,date:`2026-09-23`,added:[],fixed:[`On the Android app, the model’s questions can be answered again. They come one at a time — “Question 2 of 3” — with Back, Next and Skip, and Answer sends them to your PC. The card used to show only the first question, hide the rest below it and wait for all of them, so it could not be sent.`]},{version:`0.3.133`,date:`2026-09-23`,added:[`Bring your Claude desktop app projects across: File → Import chats from other coding agents now lists every project the Claude app has opened on this PC. Each one arrives as an OonaCode project of the same name — its goal, instructions and what Claude noted about it become the project’s instructions — with its project chat and one chat per thread filed under it, ready to carry on.`,`A Claude Code chat you moved into a Claude app project is filed under that project here too.`,`A thread you never opened in the Claude app still comes across, with its task and every reply the project chat saw; open it once in the Claude app and import again for its whole conversation.`],fixed:[`Cursor chats appear in the import list again — they had been left out since September 10.`]},{version:`0.3.132`,date:`2026-09-23`,added:[`Reply to any part of a chat: select some text (or just right-click a block), choose Reply, and it is quoted in your message box — type your answer under it. A quote from a file the agent read names the file.`,`Right-click in a chat: copy what you selected, copy a whole reply or tool output, copy a code block or a link, find the selected words in the chat, or select a block.`,`Search in a chat opens the block its match is in — a folded tool card, a thought, a finished agent’s work — and scrolls to the words themselves.`,`Search matches are now bright orange, the current one strongest, so they stand out on code too.`,`The file viewer shows pictures (PNG, JPEG, GIF, WebP, SVG and more), plays audio and video, and shows Markdown formatted, with a switch to the source.`,`Right-click a file or folder in the explorer to copy its path or delete it.`],fixed:[`Moving a chat to another folder or project while it was working could delete the folder it was working in, start two agents at once, or send your next message to the old folder.`,`The working line no longer says a chat may be stuck while it waits for your approval or answer, or right after you send a message, and it counts time correctly (no more "4m 60s").`,`A date line no longer says "Today" for yesterday’s messages when the app stays open past midnight.`,"Installing with npm (`npm i -g oonacode`) installs this version again; earlier npm releases carried an old program.",`The What’s new window could open again on the next start, showing the same update a second time.`,`An older OonaCode window or VS Code extension no longer resets settings it does not know about, such as your theme colours or which project groups you folded.`,`A new install no longer opens with a list of changes; this window now appears only after an update.`,`The notification switch for permissions now says it also covers the agent’s questions.`]},{version:`0.3.131`,date:`2026-09-23`,added:[`Claude Opus 5.5 is here — the newest Opus, and cheaper to run than Opus 5. Choose it in the model picker, from the OonaCode pool or on your own Claude subscription. It runs on the newer Claude Code engine (2.1.280) that this update brings.`,`Every block in a chat shows its time at the bottom right, in your local time — hover it for the full date — and a date line marks where each day starts.`,`A running chat tells you how long the agent has been quiet, and after five minutes that it may be stuck and what to do.`,`After every update, OonaCode now opens this window to show you what changed.`],fixed:[`A reply that streamed in live had no time on it until the chat was opened again.`,`Chats open in tabs could fail to come back after a restart if a setting changed while they were being restored.`]}];function Rl(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:zl(r.pre,i.pre)}function zl(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 Bl(e,t,n=Ll,r=null){if(!e||e===`0.0.0`)return[];let i=n.filter(t=>Rl(t.version,e)<=0&&(!r||!t.platforms||t.platforms.includes(r)));return[...t===null?i.filter(t=>Rl(t.version,e)===0):i.filter(e=>Rl(e.version,t)>0)].sort((e,t)=>Rl(t.version,e.version))}function Vl(e,t,n,r=Ll,i=null){if(!e||e===`0.0.0`)return{record:null,show:[]};let a=null;for(let e of r)(a===null||Rl(e.version,a)>0)&&(a=e.version);let o=a!==null&&Rl(e,a)>0?a:e;return{record:t===null||Rl(o,t)>0?o:null,show:t===null&&!n?[]:Bl(e,t,r,i)}}function Hl(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 Ul=`the user skipped the question`,Wl=`(the user skipped this question)`;function Gl(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 Kl(e,t,n={},r=new Set){let i={};return e.forEach((e,a)=>{if(r.has(a)){i[e.question]=Wl;return}let o=(n[a]??``).trim();i[e.question]=o||(t[a]??[]).join(`, `)}),i}function ql(e){let t=e.questions,n=t===1?`question`:`questions`,r=t===1?`the model’s question`:`the model’s questions`,i=t===1?`The model’s question was`:`The model’s questions were`;switch(e.outcome){case`answered`:{let r=e.answers?Object.values(e.answers):null,i=r?r.filter(e=>typeof e==`string`&&e!==``&&e!==`(the user skipped this question)`).length:t;return t>0&&i<t?`You answered ${i} of ${t} ${n}`:t===0?`You answered the model’s questions`:t===1?`You answered the model’s question`:`You answered ${t} ${n}`}case`skipped`:return`You skipped ${r}`;case`dismissed`:return`${i} dismissed`;case`unanswered`:return`${i} not answered — the turn ended`}}function Jl(e){if(!e||typeof e!=`object`)return null;let t=e.answers;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}var Yl=[`oauth`,`token`];function Xl(e){switch(e){case`signed-out`:return`Not signed in`;case`connecting`:return`Waiting for your sign-in…`;case`connected`:return`Connected`;case`expired`:return`Sign-in expired`;case`error`:return`Cannot reach the service`}}var Zl=W().refine(e=>/^https:\/\/[^\s]+$/i.test(e),`must be an https address`),Ql=Jo({vendor:W().min(1).max(60),mcpUrl:Zl,readOnlyQuery:ns(W(),W()).nullable(),auth:Jo({methods:Ko(is(Yl)).min(1),scopes:Ko(W()),offlineAccess:Bo(),token:Jo({label:W(),createUrl:Zl,note:W().nullable()}).nullable()}),tools:Jo({deny:Ko(W()),allowWrites:Ko(W()),featured:Ko(W()),maxResultChars:Io().int().min(1e3).max(2e5)}),cli:Jo({command:W().regex(/^[A-Za-z0-9._-]{1,40}$/),versionArg:W().regex(/^--?[A-Za-z0-9-]{1,20}$/),install:ns(W(),W()),login:Jo({command:W(),tokenEnv:W().nullable()}),purpose:W()}).nullable(),skills:Ko(Jo({name:W().regex(/^[a-z0-9][a-z0-9_-]{0,47}$/),source:Jo({repo:W().regex(/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/),ref:W().regex(/^[0-9a-f]{40}$/,`pin a full commit, never a branch`),path:W().refine(e=>!/(^|[\\/])\.\.([\\/]|$)|^[\\/]/.test(e),`relative path`)}),license:W(),exclude:Ko(W())})),docsUrl:Zl}).loose();function $l(e){if(e.toolName!==`ConnectorChange`)return null;let t=e.input;if(!t||typeof t!=`object`||typeof t.connector!=`string`||typeof t.vendor!=`string`||typeof t.tool!=`string`)return null;let n=t.arguments!==null&&typeof t.arguments==`object`&&!Array.isArray(t.arguments)?t.arguments:{};return{connector:t.connector,vendor:t.vendor,tool:t.tool,description:typeof t.description==`string`?t.description:``,arguments:n}}function eu(e){let t=Object.keys(e.arguments).slice(0,8);return`${e.vendor}: ${e.tool}${t.length>0?` (${t.join(`, `)})`:``}`}var tu=[`win32`,`linux`,`darwin`],nu=[`demo`,`live`],ru=[`allow`,`ask`],iu=[`string`,`number`,`integer`,`boolean`,`array`,`object`];function au(e){let t=e/1048576;return t>=100?`${Math.round(t)} MB`:t>=1?`${t.toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function ou(e){if(e.toolName!==`InstallToolPack`)return null;let t=e.input;return!t||typeof t!=`object`||typeof t.pack!=`string`||typeof t.name!=`string`||typeof t.version!=`string`||typeof t.sizeBytes!=`number`||typeof t.path!=`string`?null:{pack:t.pack,name:t.name,version:t.version,sizeBytes:t.sizeBytes,path:t.path}}function su(e,t){let n=t?.[e.slug];return typeof n==`boolean`?n:e.defaultOn}function cu(e,t){return e.filter(e=>su(e,t))}var lu={slug:48,name:80,entryTool:40,description:2e3,promptLine:1e3,details:8e3,actionDescription:1e3,params:30,paramName:48,paramDescription:400,enumValues:40,callArgKeys:20,callError:500,callBatch:100},uu=/^[A-Za-z0-9_-]+$/;function du(e){return typeof e==`string`&&e.length>0&&e.length<=lu.entryTool&&uu.test(e)}function fu(e){return Math.ceil(e.length/4)}function pu(e){return fu(`${e.entryTool} ${e.description}`)+55}function mu(e){return e.tokensPerRequest??pu(e)+(e.promptLine?fu(e.promptLine):0)}var hu=Jo({type:is(iu),required:Bo().optional(),enum:Ko(Xo([W(),Io()])).optional(),description:W().optional()}),gu=Jo({slug:W().min(1),description:W(),params:ns(W(),hu),permission:is(ru),sort:Io()}),_u=Jo({version:W(),url:W(),sha256:W(),sizeBytes:Io(),exe:W(),format:os(`zip`)}),vu=Jo({slug:W().min(1),name:W(),entryTool:W().refine(du,`not a valid tool name`),description:W(),promptLine:W().nullable(),details:W().nullable().optional(),status:is(nu),defaultOn:Bo(),sort:Io(),install:_u.nullable(),actions:Ko(gu),connector:Ql.nullable().optional().catch(null)}).loose();Jo({platform:is(tu),version:W(),packs:Ko(vu),refreshMinutes:Io()});var yu=is([`stdio`,`sse`,`http`]),bu=Jo({id:W().trim().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/i,`ID must be 1-64 alphanumeric, dash, dot, or underscore characters`),name:W().trim().min(1).max(100),description:W().max(500).optional(),transport:yu,command:W().min(1).max(500).optional(),args:Ko(W()).max(100).optional(),env:ns(W(),W()).optional(),url:W().url().max(2e3).optional(),headers:ns(W(),W()).optional(),defaultOn:Bo(),enabled:Bo().optional(),catalogId:W().max(100).optional()});bu.refine(e=>e.transport===`stdio`?typeof e.command==`string`&&e.command.length>0:typeof e.url==`string`&&e.url.length>0,{message:`stdio transport requires a command; sse/http transports require a url`}),bu.partial(),ns(W().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/i),Bo()).refine(e=>Object.keys(e).length<=128,`At most 128 MCP server switches`);function xu(e,t){if(e.enabled===!1)return!1;let n=t?t[e.id]:void 0;return typeof n==`boolean`?n:e.defaultOn}function Su(e,t,n){return{...e??{},[t]:n}}var Cu=[{id:`databases`,label:`Databases`},{id:`cloud`,label:`Cloud & DevOps`},{id:`productivity`,label:`Productivity`},{id:`analytics`,label:`Analytics`},{id:`ai`,label:`AI & Reasoning`},{id:`developer`,label:`Developer Tools`}],wu=[{id:`postgres`,name:`PostgreSQL`,description:`Inspect schemas, query tables, run read operations and analyze database structures.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-postgres`,"${connectionString}"],parameters:[{key:`connectionString`,label:`Database Connection URL`,placeholder:`postgresql://user:password@localhost:5432/dbname`,type:`password`,required:!0,target:`arg`,templateIndex:2}],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/postgres`},{id:`sqlite`,name:`SQLite`,description:`Direct SQL query and schema inspection for local SQLite database files.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-sqlite`,`--db-path`,"${dbPath}"],parameters:[{key:`dbPath`,label:`SQLite File Path`,placeholder:`C:/data/app.db or /var/data/app.db`,type:`string`,required:!0,target:`arg`,templateIndex:3}],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite`},{id:`supabase`,name:`Supabase`,description:`Manage Supabase Postgres database, migrations, edge functions, and project config.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-supabase`],parameters:[{key:`SUPABASE_ACCESS_TOKEN`,label:`Personal Access Token`,type:`password`,required:!0,target:`env`},{key:`SUPABASE_PROJECT_REF`,label:`Project Reference ID`,placeholder:`abcdefghijklmnopqrst`,type:`string`,required:!0,target:`env`}],docsUrl:`https://supabase.com/docs/guides/ai/mcp`},{id:`redis`,name:`Redis`,description:`Inspect keys, data structures, and execute Redis operational commands.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-redis`,"${redisUrl}"],parameters:[{key:`redisUrl`,label:`Redis Connection URL`,placeholder:`redis://localhost:6379`,type:`string`,required:!0,target:`arg`,templateIndex:2}]},{id:`mongodb`,name:`MongoDB Atlas`,description:`Query collections, inspect schemas, and interact with MongoDB Atlas databases.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-mongodb`,"${connectionString}"],parameters:[{key:`connectionString`,label:`MongoDB Connection URI`,placeholder:`mongodb+srv://user:pass@cluster.mongodb.net/dbname`,type:`password`,required:!0,target:`arg`,templateIndex:2}]},{id:`github`,name:`GitHub`,description:`Search repositories, manage issues, pull requests, files, and branches.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-github`],parameters:[{key:`GITHUB_PERSONAL_ACCESS_TOKEN`,label:`GitHub Personal Access Token (repo scope)`,placeholder:`ghp_...`,type:`password`,required:!0,target:`env`}],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/github`},{id:`gitlab`,name:`GitLab`,description:`Access GitLab merge requests, project branches, issues, and pipelines.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-gitlab`],parameters:[{key:`GITLAB_PERSONAL_ACCESS_TOKEN`,label:`GitLab Personal Access Token`,type:`password`,required:!0,target:`env`},{key:`GITLAB_API_URL`,label:`GitLab API URL (optional for self-hosted)`,placeholder:`https://gitlab.com/api/v4`,type:`string`,required:!1,target:`env`}]},{id:`cloudflare`,name:`Cloudflare`,description:`Inspect and manage Cloudflare Workers, KV namespaces, D1 databases, and DNS records.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@cloudflare/mcp-server-cloudflare`],parameters:[{key:`CLOUDFLARE_API_TOKEN`,label:`API Token`,type:`password`,required:!0,target:`env`},{key:`CLOUDFLARE_ACCOUNT_ID`,label:`Account ID`,type:`string`,required:!0,target:`env`}]},{id:`sentry`,name:`Sentry`,description:`Retrieve real-time application errors, stack traces, and issue analytics.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-sentry`],parameters:[{key:`SENTRY_AUTH_TOKEN`,label:`Auth Token`,type:`password`,required:!0,target:`env`}]},{id:`google-drive`,name:`Google Drive`,description:`Search, read, and export documents, spreadsheets, and files from Google Drive.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-gdrive`],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/gdrive`},{id:`slack`,name:`Slack`,description:`Read conversation history, search channel messages, and post updates to Slack channels.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-slack`],parameters:[{key:`SLACK_BOT_TOKEN`,label:`Bot User OAuth Token (xoxb-...)`,type:`password`,required:!0,target:`env`},{key:`SLACK_TEAM_ID`,label:`Slack Workspace Team ID`,type:`string`,required:!0,target:`env`}]},{id:`notion`,name:`Notion`,description:`Read and update Notion workspaces, databases, pages, and blocks.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-notion`],parameters:[{key:`NOTION_API_KEY`,label:`Internal Integration Secret (secret_...)`,type:`password`,required:!0,target:`env`}]},{id:`linear`,name:`Linear`,description:`Track issues, cycles, projects, and comments in Linear.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-linear`],parameters:[{key:`LINEAR_API_KEY`,label:`Personal API Key`,type:`password`,required:!0,target:`env`}]},{id:`posthog`,name:`PostHog`,description:`Query product analytics funnels, trends, user session paths, and feature flags.`,category:`analytics`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@posthog/mcp-server-posthog`],parameters:[{key:`POSTHOG_API_KEY`,label:`Personal API Key`,type:`password`,required:!0,target:`env`},{key:`POSTHOG_PROJECT_ID`,label:`Project ID`,type:`string`,required:!0,target:`env`}]},{id:`brave-search`,name:`Brave Search`,description:`Search the live web and discover local points of interest via Brave Search API.`,category:`ai`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-brave-search`],parameters:[{key:`BRAVE_API_KEY`,label:`Brave Search API Key`,type:`password`,required:!0,target:`env`}]},{id:`memory-graph`,name:`Memory (Knowledge Graph)`,description:`Persistent knowledge-graph entity and relation memory across agent turns.`,category:`ai`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-memory`]},{id:`puppeteer`,name:`Puppeteer Headless Browser`,description:`Automate browser navigation, take page screenshots, and scrape dynamic web content.`,category:`ai`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-puppeteer`]},{id:`remote-sse`,name:`Remote SSE MCP Server`,description:`Connect to any hosted remote MCP server over Server-Sent Events (SSE).`,category:`developer`,transport:`sse`,defaultUrl:`https://`,parameters:[{key:`url`,label:`SSE Endpoint URL`,placeholder:`https://mcp.example.com/sse`,type:`string`,required:!0,target:`url`},{key:`Authorization`,label:`Authorization Header (optional, e.g. Bearer token)`,placeholder:`Bearer ...`,type:`password`,required:!1,target:`header`}]},{id:`remote-http`,name:`Remote Streamable HTTP Server`,description:`Connect to any remote MCP server using standard Streamable HTTP transport.`,category:`developer`,transport:`http`,defaultUrl:`https://`,parameters:[{key:`url`,label:`HTTP Endpoint URL`,placeholder:`https://mcp.example.com/mcp`,type:`string`,required:!0,target:`url`},{key:`Authorization`,label:`Authorization Header (optional, e.g. Bearer token)`,placeholder:`Bearer ...`,type:`password`,required:!1,target:`header`}]}],Tu=[`No answer needed.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. Your final answer goes back to that chat by itself.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. It asked for no answer, so nothing goes back.`,`Last hop of this chain: you cannot message chats in this turn; put what you have in your final answer.`];[`**Let this chat work together with your other chats.**`,``,`### What it does`,`- Finds your other chats on this PC and reads their recent messages.`,`- Sends one chat, or a group of chats, a message or a task.`,`- Brings their answers back to this chat, by itself.`,``,`### How it works`,`- A chat that is asleep is woken from its saved history. A busy one gets the message when its current turn ends, never in the middle of it.`,`- The other chat does the work with its own model, folder and tools. Its answer comes back here as a new message only when this chat asked for one.`,`- Several messages from one chat that wait for a busy chat are handed over together, in one turn, with one answer.`,`- Several chats can share one conversation (a group). An answer goes only to the chat that asked, so a group cannot multiply its own messages.`,`- A chat with this switch OFF can still be messaged by a chat that has it on. It does the work, and its final answer goes back to that chat when that chat asked for one. That is all it can do: it gets none of these tools, cannot message or read other chats, and its switch stays off.`,``,`### What it costs`,`- About 650 tokens on every request while it is on, read from the prompt cache. Nothing while it is off, even in a chat that is messaged.`,`- Every message makes the chat that receives it do a turn, which spends its own tokens.`,`- Switching it on or off in a chat that already has a conversation re-writes its prompt cache once.`,``,`### Safety limits`,`- Each conversation has a budget: 20 delivered messages and 1,000,000 new tokens by default (context read back from the prompt cache is not counted). Reaching either pauses the conversation, and the chats say so.`,`- A chain stops after 3 hops (a message caused by a message caused by a message).`,`- At most 5 messages between two chats and 20 from one chat in 10 minutes, and 10 waiting for any one chat. A chat cannot message itself.`,`- A conversation with no activity for 24 hours closes by itself.`,``,`### How to stop it`,`- Turn this switch off: the chat loses these tools, and what it sent and the answers it asked for pause. It still answers a chat that messages it.`,`- Or open the Conversations window and use Pause, Close or Stop all.`,``,`### Privacy`,`- Everything stays on your PC: the messages are kept in this PC's database, never on OonaCode's server.`,`- A message never grants anything. The other chat runs with its own permissions and asks you as usual.`,``,`Only a chat with this switch on can start a conversation; a chat with it off only answers.`].join(`
|
|
80
|
+
`,18);return t<0?null:{title:e.slice(18,t),prompt:e.slice(t+3)}}Object.freeze({tengu_amber_sentinel:!0,tengu_groovy_eclipse:!0,tengu_humble_hammock:!0});function uc(e){return e===null||!Number.isFinite(e)?`neutral`:e>30?`ok`:e>10?`warn`:`danger`}var dc=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],fc=/^([01]\d|2[0-3]):[0-5]\d$/;Jo({tz:W().min(1),windows:Ko(Jo({from:W().regex(fc,`HH:MM`),to:W().regex(fc,`HH:MM`),days:Ko(is(dc)).optional(),kind:is([`peak`,`offpeak`])})),offpeakDiscount:Io().nonnegative().max(1).optional()});var pc=[`priceInputCacheMissPeak`,`priceInputCacheMissOffpeak`,`priceInputCacheHitPeak`,`priceInputCacheHitOffpeak`,`priceCacheWritePeak`,`priceCacheWriteOffpeak`,`priceOutputPeak`,`priceOutputOffpeak`],mc=Jo({inputCacheMiss:Io().nonnegative(),inputCacheHit:Io().nonnegative().optional(),cacheWrite:Io().nonnegative().optional(),output:Io().nonnegative()});Jo({by:os(`prompt_tokens`),tiers:Ko(Jo({upToPromptTokens:Io().int().positive().optional(),price:mc.optional(),cost:mc.optional()})).min(1),note:W().optional()}).superRefine((e,t)=>{let n=0;e.tiers.forEach((r,i)=>{!r.cost&&!r.price&&t.addIssue({code:`custom`,message:`a tier needs its cost (the provider’s rates; retail is cost × the record’s ratio)`,path:[`tiers`,i,`cost`]});let a=r.upToPromptTokens;if(a===void 0){i!==e.tiers.length-1&&t.addIssue({code:`custom`,message:`only the LAST tier may omit upToPromptTokens`,path:[`tiers`,i]});return}a<=n&&t.addIssue({code:`custom`,message:`tiers must ascend: ${a} does not exceed ${n}`,path:[`tiers`,i,`upToPromptTokens`]}),n=a})}),[...pc];var hc={realtime:`/v1/realtime`,translations:`/v1/realtime/translations`,live:`/v1/live/sessions`,speechStream:`/v1/audio/speech/stream`,transcriptionStream:`/v1/audio/transcriptions/stream`,clientSecrets:`/v1/realtime/client_secrets`,translationClientSecrets:`/v1/realtime/translations/client_secrets`};hc.realtime,hc.translations,hc.live,hc.speechStream,hc.transcriptionStream;var gc=`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`,_c=`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`,vc=`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`,yc=`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,bc={oonacode:{hex:`#000000`,owner:`OonaCode`,d:gc,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:vc},xai:{hex:`#000000`,owner:`xAI`,d:_c},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`},qwen:{hex:`#6950EF`,owner:`Alibaba`,d:`M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z`},"xai-subscription":{hex:`#000000`,owner:`xAI`,d:_c},"openai-subscription":{hex:`#000000`,owner:`OpenAI`,d:vc},"openai-codex":{hex:`#000000`,owner:`OpenAI`,d:vc},"google-agy":{hex:`#8E75B2`,owner:`Google`,d:yc},antigravity:{hex:`#8E75B2`,owner:`Google`,d:yc},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 xc(e){return bc[e]??null}function Sc(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 Cc=9230,wc=1024,Tc=65534,Ec=`127.0.0.1`;Object.freeze({enabled:!1,port:Cc,inspectMain:!1}),Object.freeze({port:null,listening:!1,fromCommandLine:!1,inspectPort:null,inspectProblem:null});function Dc(e){return e+1}function Oc(e){return typeof e==`number`&&Number.isInteger(e)}function kc(e){return!Oc(e)||e<1024||e>65534?`The port must be a whole number from ${wc.toLocaleString(`en-US`)} to ${Tc.toLocaleString(`en-US`)} (the main-process inspector takes the next one).`:null}function Ac(e){return e.port!==null||e.inspectPort!==null}function jc(e,t){let n=e.enabled?e.port:null,r=e.enabled&&e.inspectMain?Dc(e.port):null;return!t.fromCommandLine&&t.port!==n||t.inspectPort!==r}function Mc(e){let t=[];return e.port!==null&&t.push(`${Ec}:${e.port}`),e.inspectPort!==null&&t.push(`${Ec}:${e.inspectPort}`),t.length===2?`${t[0]} (windows) and ${t[1]} (main process)`:e.inspectPort===null?t[0]??``:`${t[0]} (main process)`}var Nc=[`stable`,`dev`];function Pc(e){return typeof e==`string`&&Nc.includes(e)}function Fc(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return Pc(t)?t:null}var Ic=[`win32`,`linux`,`darwin`],Lc=[`x64`,`arm64`];function Rc(e,t){let n=Fc(e)??`stable`,r=[];return n!==`stable`&&r.push(`channel=${encodeURIComponent(n)}`),t&&Ic.includes(t.platform)&&(r.push(`platform=${t.platform}`),t.arch&&Lc.includes(t.arch)&&r.push(`arch=${t.arch}`)),r.length>0?`${Qs.releasesLatest}?${r.join(`&`)}`:Qs.releasesLatest}function zc(e,t){let n=Fc(t)??`stable`;return n===`stable`?e:`${e} (${n})`}var Bc={safeguards:`safeguards`,safety_filters:`safety filters`},Vc=[{vendor:`Alibaba (Model Studio / DashScope — Qwen, and the DeepSeek/GLM it hosts)`,seenAs:`400 {"error":{"code":"data_inspection_failed","message":"Input data may contain inappropriate content."}}`,pattern:/data[_ ]?inspection[_ ]?failed|may contain inappropriate content/i},{vendor:`Zhipu (GLM)`,seenAs:`400 {"error":{"code":"1301","message":"系统检测到输入或生成内容可能包含不安全或敏感内容…"}} (contentFilter)`,pattern:/"code"\s*:\s*"?1301"?|不安全或敏感内容|unsafe or sensitive content|contentFilter/i},{vendor:`DeepSeek`,seenAs:`400 {"error":{"message":"Content Exists Risk","type":"invalid_request_error"}}`,pattern:/content exists risk/i},{vendor:`Moonshot (Kimi)`,seenAs:`400 {"error":{"type":"content_filter","message":"The request was rejected because it was considered high risk"}}`,pattern:/"type"\s*:\s*"content_filter"|considered high risk/i},{vendor:`xAI (Grok)`,seenAs:`400 "Content violates usage guidelines. Failed check: SAFETY_CHECK_TYPE_…"`,pattern:/content violates usage guidelines|SAFETY_CHECK_TYPE_/i},{vendor:`OpenAI (and Azure-style filters)`,seenAs:`400 {"error":{"code":"content_filter" | "content_policy_violation" | "moderation_blocked"}}`,pattern:/"code"\s*:\s*"(?:content_filter|content_policy_violation|moderation_blocked)"/i},{vendor:`Google (Gemini)`,seenAs:`This request was blocked by Gemini's filters. They can occasionally trigger by mistake on safe coding, security, or biology-related queries.`,pattern:/blocked by Gemini(?:'s)? filters|Gemini(?:'s)? filters/i}],Hc=/blocked by (?:the )?(?:content[ -]safety|Gemini(?:'s)?) filters?|content safety filters?|blocked by Gemini(?:'s)? filters?/i,Uc=/blocked by Gemini(?:'s)? filters|Gemini(?:'s)? filters\.? They can occasionally trigger/i;function Wc(e){return typeof e==`string`&&Uc.test(e)}function Gc(e){return typeof e!=`string`||e===``||!/^\s*(?:Failed to authenticate\.\s*)?API Error\b/i.test(e)?null:Vc.find(t=>t.pattern.test(e))??null}function Kc(e){return typeof e==`string`&&(Wc(e)||Hc.test(e)&&/blocked/i.test(e))}var qc=`:free`;function Jc(e){return e.endsWith(qc)}function Yc(e){return Jc(e)?e.slice(0,-5):e}var Xc=`model_refusal_fallback`,Zc=`model_refusal_no_fallback`;function Qc(e){return typeof e==`string`&&e.trim()!==``?e.trim():null}function $c(e,t,n){return Qc(e[t])??Qc(e[n])}function el(e){if(typeof e!=`object`||!e)return null;let t=e,n=t.subtype,r=n===`model_refusal_fallback`?`fallback`:n===`model_refusal_no_fallback`?`no_fallback`:t.kind===`fallback`||t.kind===`no_fallback`?t.kind:null;if(!r||t.type!==void 0&&t.type!==`system`)return null;let i=t.retracted_message_uuids??t.retractedMessageUuids??t.retractedUuids;return{kind:r,scope:t.scope===`local`?`local`:`session`,originalModel:$c(t,`original_model`,`originalModel`),fallbackModel:r===`fallback`?$c(t,`fallback_model`,`fallbackModel`):null,category:$c(t,`api_refusal_category`,`apiRefusalCategory`)??Qc(t.category),explanation:$c(t,`api_refusal_explanation`,`apiRefusalExplanation`)??Qc(t.explanation),text:typeof t.content==`string`?t.content.trim():Qc(t.text)??``,retractedUuids:Array.isArray(i)?i.filter(e=>typeof e==`string`):[]}}function tl(e,t){switch(t.type){case`notice`:return t.notice.kind!==`fallback`||t.notice.scope!==`session`?e:{notice:t.notice,at:t.at,live:t.live};case`engine_start`:case`model_change`:return null}}function nl(e,t){return!e||t.alive===!1||!e.live&&t.since!==null&&e.at!==null&&e.at<t.since?null:e}function rl(e){let t=Gs(e.trim()),n=t.slice(t.lastIndexOf(`/`)+1),r=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),i=n.split(`-`);if(i[0]?.toLowerCase()!==`claude`)return t;let a=i.slice(1).filter(e=>!/^\d{6,}$/.test(e)),o=a.filter(e=>!/^\d+$/.test(e)),s=a.filter(e=>/^\d+$/.test(e));return o.length!==1||s.length===0?t:`${r(o[0])} ${s.join(`.`)}`}function il(e,t=[]){let n=Gs(e.trim()),r=null;for(let e of t)for(let t of e.definition.models){if(t.id===n||Gs(t.id)===n)return t.displayName;r===null&&(t.upstreamId===n||Yc(t.id)===n)&&(r=t.displayName)}return r??rl(n)}function al(e){return`${e} (safeguard)`}var ol=`none`,sl={mode:`auto`,model:null,perModel:{}};function cl(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0&&t.length<=200&&/^[A-Za-z0-9._:@/[\]-]+$/.test(t)?t:null}function ll(e){return Gs(e.trim()).toLowerCase()}function ul(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e:{},n=cl(t.model),r=t.mode,i=r===`off`?`off`:r===`model`&&n!==null?`model`:`auto`,a={},o=t.perModel;if(typeof o==`object`&&o&&!Array.isArray(o))for(let[e,t]of Object.entries(o)){let n=cl(e),r=t===`none`?ol:cl(t);if(n!==null&&r!==null&&ll(n)!==ll(r)&&(a[ll(n)]=r,Object.keys(a).length>=64))break}return{mode:i,model:i===`model`?n:null,perModel:a}}function dl(e){return e===w}var fl=`oona settings safeguard-fallback auto`;function pl(e,t=[]){if(!e)return`the model`;let n=ll(e);return t.find(e=>ll(e.id)===n||e.upstreamId&&ll(e.upstreamId)===n)?.displayName??rl(e)}function ml(e,t=e=>pl(e)){let n=`blocked by ${Bc[e.reason]}`;if(e.outcome===`retried`)return`${n} → retried on ${e.retriedOn?t(e.retriedOn):`another model`}`;switch(e.blocked){case`off`:return`${n} · fallback off (${fl})`;case`no_model`:return`${n} · no fallback model`;case`unavailable`:return`${n} · fallback not available here`;case`refused_again`:return`${n} · fallback refused too`;case`not_retryable`:return`${n} · not retried`;default:return n}}var hl=5e4,gl=6,_l=[`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`],vl={agentFinished:!1,permissionRequired:!0,errorOccurred:!0},yl={autoAcceptPermissions:!1,safeguardFallback:sl,showReasoningSummaries:!0,notifications:vl,showAgentPicker:!0,transcriptWindowSize:500,openTabs:[],draftTabs:[],draftTitles:{},activeTab:null,editorLayout:null,remoteTabs:{},sessionPanelOpen:!1,explorerOpen:!1,sidebarWidth:288,sessionPanelWidth:288,mediaPanelWidth:320,sidebarPinned:!0,dismissedUpdateVersion:null,lastSeenReleaseNotes:null,claudeImportOffered:!1,claudeImportOffers:0,collapsedProjects:[],themeColors:{light:{},dark:{}},pinned:[],sidebarView:`recent`};function bl(e){return Math.min(Math.max(typeof e==`number`&&Number.isFinite(e)?Math.floor(e):0,0),3)}function xl(e){return Math.min(640,Math.max(200,typeof e==`number`&&Number.isFinite(e)?Math.round(e):288))}function Sl(e,t){return Math.min(720,Math.max(240,typeof e==`number`&&Number.isFinite(e)?Math.round(e):t))}function Cl(e){return Math.min(hl,Math.max(100,typeof e==`number`&&Number.isFinite(e)?Math.round(e):500))}function wl(e,t){return typeof e==`boolean`?e:t}function Tl(e){return typeof e==`string`&&e.length>0&&e.length<=64?e:null}function El(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 Dl(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 Ol(e){if(typeof e!=`string`)return null;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t.toLowerCase():null}function kl(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!_l.includes(n))continue;let e=Ol(r);e!==null&&(t[n]=e)}return t}function Al(e){let t=typeof e==`object`&&e?e:{};return{light:kl(t.light),dark:kl(t.dark)}}function jl(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n.kind,r=n.id;if((e===`chat`||e===`project`)&&!(typeof r!=`string`||r.length===0||r.length>200)&&!t.some(t=>t.kind===e&&t.id===r)&&(t.push({kind:e,id:r}),t.length>=50))break}return t}function Ml(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return null;let n=e,r=new Set(t),i=new Set,a=0,o=(e,t)=>{if(t>gl||typeof e!=`object`||!e)return null;let n=e,s=n.group;if(typeof s==`object`&&s&&!Array.isArray(s)){if(a>=8)return null;let e=s,t=[];for(let n of Array.isArray(e.tabs)?e.tabs:[])typeof n!=`string`||!r.has(n)||i.has(n)||(i.add(n),t.push(n));return t.length===0?null:(a+=1,{group:{tabs:t,active:(typeof e.active==`string`&&t.includes(e.active)?e.active:null)??t[t.length-1]}})}let c=n.split;if(c!==`row`&&c!==`column`)return null;let l=Array.isArray(n.children)?n.children:[],u=Array.isArray(n.sizes)?n.sizes:[],d=[],f=[];if(l.slice(0,8).forEach((e,n)=>{let r=o(e,t+1);if(!r)return;d.push(r);let i=u[n];f.push(typeof i==`number`&&Number.isFinite(i)&&i>0?i:0)}),d.length===0)return null;if(d.length===1)return d[0];let p=f.filter(e=>e>0),m=p.length>0?p.reduce((e,t)=>e+t,0)/p.length:1,h=f.map(e=>e>0?e:m),g=h.reduce((e,t)=>e+t,0);return{split:c,sizes:h.map(e=>e/g),children:d}},s=o(n.root,0);if(!s||a<2)return null;let c=n.focused;return{root:s,focused:typeof c==`number`&&Number.isInteger(c)&&c>=0&&c<a?c:0}}function Nl(e,t,n){return e.some(e=>e.kind===t&&e.id===n)}function Pl(e,t,n,r){return r===Nl(e,t,n)?e:r?[...e.length>=50?e.slice(e.length-50+1):e,{kind:t,id:n}]:e.filter(e=>e.kind!==t||e.id!==n)}function Fl(e){let t=typeof e==`object`&&e?e:{},n=typeof t.notifications==`object`&&t.notifications!==null?t.notifications:{},r=El(t.openTabs),i=El(t.draftTabs).filter(e=>!r.includes(e)),a={};for(let[e,n]of Object.entries(Dl(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:wl(t.autoAcceptPermissions,yl.autoAcceptPermissions),safeguardFallback:ul(t.safeguardFallback),showReasoningSummaries:wl(t.showReasoningSummaries,yl.showReasoningSummaries),notifications:{agentFinished:wl(n.agentFinished,vl.agentFinished),permissionRequired:wl(n.permissionRequired,vl.permissionRequired),errorOccurred:wl(n.errorOccurred,vl.errorOccurred)},showAgentPicker:wl(t.showAgentPicker,yl.showAgentPicker),transcriptWindowSize:Cl(t.transcriptWindowSize),openTabs:r,draftTabs:i,draftTitles:a,activeTab:c,editorLayout:Ml(t.editorLayout,o),remoteTabs:Dl(t.remoteTabs),sessionPanelOpen:wl(t.sessionPanelOpen,yl.sessionPanelOpen),explorerOpen:wl(t.explorerOpen,yl.explorerOpen),sidebarWidth:xl(t.sidebarWidth),sessionPanelWidth:Sl(t.sessionPanelWidth,288),mediaPanelWidth:Sl(t.mediaPanelWidth,320),sidebarPinned:wl(t.sidebarPinned,yl.sidebarPinned),dismissedUpdateVersion:Tl(t.dismissedUpdateVersion),lastSeenReleaseNotes:Tl(t.lastSeenReleaseNotes),claudeImportOffered:wl(t.claudeImportOffered,yl.claudeImportOffered),claudeImportOffers:bl(t.claudeImportOffers),collapsedProjects:El(t.collapsedProjects),themeColors:Al(t.themeColors),pinned:jl(t.pinned),sidebarView:t.sidebarView===`projects`?`projects`:`recent`}}new Set(Object.keys(yl));var Il=3650,Ll=[{version:`0.3.249`,date:`2026-10-20`,added:[`When the model reads a picture, a video or a sound file, that step in the chat now opens by itself: you see the picture, or get a player for the video or sound, without clicking. Click the step to close it. Steps that read ordinary text files stay closed as before.`],fixed:[]},{version:`0.3.248`,date:`2026-10-20`,added:[],fixed:[`A chat on Google Gemini (through your Google plan) no longer ends a finished turn with an error. Google’s agy tool can keep repeating an old “quota reached” message at the end of a long chat even though your limit was fine and the answer arrived; OonaCode now shows the answer as done and adds a short note. A limit you really hit still shows as an error.`,`When you do reach your Google limit in a Gemini chat, OonaCode now shows Google’s own message, including when it resets, instead of a message about the OonaCode pool that did not apply to you.`]},{version:`0.3.247`,date:`2026-10-20`,added:[`On the Android app, a short tap on a message now opens a menu: Reply (quotes it above the box), Copy, Forward (opens it as a draft in another chat you pick), Share and Save text to… A long press still selects text.`,`On the Android app, a picture, video, sound or file that a reply names now opens from your PC: pictures show right in the chat, videos and sounds play in the chat, and other files open in the app you choose or are saved where you say. A file larger than 25 MB asks first.`,`This PC now hands those files to your phone over the same private link as your chats — only files that the chat itself named or that sit in its folder, one piece at a time.`],fixed:[]},{version:`0.3.246`,date:`2026-10-19`,added:[`Every chat can now make videos and spoken audio, not only pictures: ask for a short clip or a voice-over and the model makes it, saves it in the chat’s folder and plays it right in the chat. Video and Speech sit beside Images in the Tools menu, switched on by default.`,`In the Tools menu each of the three has a model choice for this chat (its default follows the model you are chatting with: a Grok chat uses Grok’s, an Alibaba chat Alibaba’s) and an “Ask me first” switch. With it on — the default for video — the model asks you for the length, resolution and shape and tells you the price in credits before anything is spent.`,`Pictures, videos and speech are paid with your OonaCode credits like any other message, whatever model or key the chat runs on, and the credits charged are shown in the answer.`,`On Apple Silicon Macs (M1 and later) Oonak Browser is now the native build: it quits with its last window, shows its own Dock icon and never asks for notification permission.`],fixed:[]},{version:`0.3.245`,date:`2026-10-19`,added:[`A picture, video or sound that a model reply named but that is not on your PC any more is now left out of the Media explorer, with a line under the list saying how many were left out and a Show button to see them.`,`A picture the model made now shows up in the chat as a small square beside its name — you no longer need the Media panel to notice it — and a click enlarges it.`,`A file the model names (a PDF, a Word or Excel document, a zip and so on) now shows its type’s icon in the chat and in the Media explorer; a file of any other type gets a plain file icon.`],fixed:[`The Media explorer no longer lists a website path such as /logo.svg or /favicon.png from a model reply as if it were a file on your PC, and a card that cannot be opened now shows the file name and date instead of only “Moved or deleted”.`]},{version:`0.3.244`,date:`2026-10-19`,added:[`When the agent enters plan mode (and when you approve its plan) the Build / Plan / Ask picker now follows it, so the picker always shows the mode the chat is really in.`],fixed:[`Four engine tools nobody uses here — ListAgents, EnterWorktree, ExitWorktree and ReportFindings — are switched off in every chat, which makes each request a little smaller.`]},{version:`0.3.243`,date:`2026-10-18`,added:[`OonaCode now asks before it quits or updates while any chat is still working — including chats whose tabs you closed — and names them, so nothing is interrupted by accident.`],fixed:[]},{version:`0.3.242`,date:`2026-10-18`,added:[`Every model can now take any attachment: a picture or PDF that the chosen model cannot read (Google’s agy, text-only Qwen or GLM models, and so on) is saved in the chat’s temporary folder and the model is given its file path instead of the message being refused.`,`The media panel can filter by All, Mine or Replies, so the pictures, videos, sounds and links that the model’s replies name are listed too, and every item has a right-click menu (View or Play, Show in chat, Show in folder, Copy path or link).`,`The “Media in this chat” and “Session info” panels can be resized by dragging their left edge; double-click the edge for the default width.`,`Web search is now in every chat, always: there is no Tools-menu switch for it any more, and chats that had it switched off search again.`],fixed:[]},{version:`0.3.241`,date:`2026-10-17`,added:[`Remote sessions in the sidebar now have a full right-click context menu and actions button (Pin to top, Move to Project, Project settings, Change folder, Details, Listen to this chat, Files, Rename, Fork and Delete) plus a details card on hover.`,`The Files explorer and file viewer now work for remote chats over the blind relay, so you can browse folders, view code, Markdown and images, copy paths and delete files on the remote PC.`,`Oonak Browser is now available for macOS chats as well as Windows and Linux.`],fixed:[`Newly created or renamed remote chats now appear immediately in the Remote section of the left sidebar, and the sidebar automatically recovers after a brief server or connection blip.`,`Opening a long remote chat with many screenshots no longer disconnects the relay for backpressure or stops loading recent messages.`]},{version:`0.3.240`,date:`2026-10-17`,added:[`Every Thought block now shows how long the model spent thinking (for example “Thought · 42 words · 12s”), both live and when a chat is reopened.`,`Remote chat tabs now show a badge naming the PC they run on, and you can rename a remote chat directly from its tab or from the Remote list in the sidebar.`,`Files attached from the Android app are uploaded into the chat’s folder on the PC that runs the chat.`],fixed:[`Subagent reports and continuation notes now fold into a single Engine note line instead of staying pinned at the bottom of the chat or replacing the pinned user question.`,`Local video and file paths in replies (including Windows paths with forward slashes, paths with spaces, and Markdown links) now reliably show their Play, View and Open in folder buttons.`,`Chats on a ChatGPT (Codex) subscription no longer fail when the model calls tools.`,`Google agy chats wait and retry automatically (5 s, 20 s, 1 min, 2 min) when Google answers with a temporary 503 Unavailable.`]},{version:`0.3.239`,date:`2026-10-16`,platforms:[`win32`],added:[`Media in every chat: the gallery button at the top right of a chat lists the photos, videos, audio, files and links you sent in it. Photos open in the viewer (← → step through them), videos and audio play in place, files open or show in their folder, and “Show in chat” jumps to the message.`],fixed:[`Google agy chats no longer flash a command window when they start. OonaCode now keeps agy up to date itself, quietly, while no agy chat is running.`,`An agy command that waits for someone to type (a password prompt, an ssh question) no longer holds the chat for hours: after 15 minutes with no output and no work, OonaCode ends that command, says so in the chat, and agy carries on.`,`The coding engine is updated (Claude Code 2.1.301): long answers are no longer cut off after three minutes of silence, a long chat no longer compacts again and again, and a tool no longer runs twice.`,`If the app’s window crashes (for example when the computer runs out of memory), it reloads by itself.`,`A chat on your own Meta Muse or ChatGPT plan that started on another provider no longer fails with “call_id must be at most 64 characters”.`,`Your other PCs keep one order in the Remote list instead of reshuffling.`,"`oona -p` with an OonaCode API key says what went wrong instead of asking you to sign in."]},{version:`0.3.239`,date:`2026-10-16`,platforms:[`darwin`],added:[`Media in every chat: the gallery button at the top right of a chat lists the photos, videos, audio, files and links you sent in it. Photos open in the viewer (← → step through them), videos and audio play in place, files open or show in their folder, and “Show in chat” jumps to the message.`],fixed:[`The coding engine is updated (Claude Code 2.1.301): long answers are no longer cut off after three minutes of silence, a long chat no longer compacts again and again, and a tool no longer runs twice.`,`If the app’s window crashes (for example when the computer runs out of memory), it reloads by itself.`,`A chat on your own Meta Muse or ChatGPT plan that started on another provider no longer fails with “call_id must be at most 64 characters”.`,`Your other PCs keep one order in the Remote list instead of reshuffling.`,`A download cut part-way during an update is resumed instead of starting over.`,"`oona -p` with an OonaCode API key says what went wrong instead of asking you to sign in."]},{version:`0.3.239`,date:`2026-10-16`,platforms:[`linux`],added:[`Media in every chat: the gallery button at the top right of a chat lists the photos, videos, audio, files and links you sent in it. Photos open in the viewer (← → step through them), videos and audio play in place, files open or show in their folder, and “Show in chat” jumps to the message.`],fixed:[`“Restart now” in Settings opens the app again instead of closing it for good.`,`The OonaCode service starts again after a quick reboot.`,`A power cut no longer empties the files that keep you signed in and unlocked.`,`A download cut part-way (weak Wi-Fi) during an install or update is resumed instead of giving up.`,`Notifications come from “OonaCode”.`,`The coding engine is updated (Claude Code 2.1.301): long answers are no longer cut off after three minutes of silence, a long chat no longer compacts again and again, and a tool no longer runs twice.`,`If the app’s window crashes (for example when the computer runs out of memory), it reloads by itself.`,`A chat on your own Meta Muse or ChatGPT plan that started on another provider no longer fails with “call_id must be at most 64 characters”.`,`Your other PCs keep one order in the Remote list instead of reshuffling.`,"`oona -p` with an OonaCode API key says what went wrong instead of asking you to sign in."]},{version:`0.3.238`,date:`2026-10-16`,added:[`Auto in the OonaCode pool: pick “Auto” and each new message runs on the pool model that suits it — how hard the task is, how big the chat is, whether a model already has the chat in its cache, speed and cost — at an effort it picks too. The model button shows which model Auto chose, like “Auto (Qwen3.8 Max)”. (It appears once OonaCode switches it on.)`,`Window control in the Tools menu: when you ask, the agent can list, hide, show, minimise, restore or focus the windows on your computer (Windows; apps on macOS; X11 and KDE on Linux).`,`The conversations popup in a chat shows when each conversation started and when it was last active.`],fixed:[`A Google agy chat that hits a temporary “service unavailable” from Google now waits a few seconds and carries on in the same conversation instead of ending the turn.`,`The agent keeps Oonak Browser’s window visible: no hidden or headless browser unless you ask for one.`]},{version:`0.3.237`,date:`2026-10-15`,platforms:[`win32`,`darwin`],added:[`When a long chat no longer fits the model, the chat shows one line saying how many earlier messages the request left out; click it for the explanation.`],fixed:[`The model picker no longer has an “All models” list, which showed the same model twice when a provider offers it both by key and by subscription. Pick a provider to see its models.`,`Google’s agy: Gemini 3.7 Flash, 3.6 Flash and 3.1 Pro are gone from the picker, because Google no longer offers them, and the picker shows only the models your own Google plan lists. A chat that was on one of them asks you to pick another model.`,`A picture or PDF attached to a chat on Google’s agy is refused with words that say agy takes text only on every one of its models, and that another provider’s model can read it.`,`A thought with no words in it (Meta Muse hides its thinking) no longer leaves an empty “Thought” card in the chat.`,`Conversations between chats read “idle” when nothing is going on.`]},{version:`0.3.237`,date:`2026-10-15`,platforms:[`linux`],added:[`The model picker is redone: your providers on the left, each with how many models it has, and the chosen provider’s models on the right, best first by independent intelligence rating. Each side has its own search. After you pick a model from another provider, its button says “next message” until your next message runs on it.`,`Every model shows its own effort levels, and the effort picker starts on the model’s default. A model with no effort levels shows no picker.`,`Meta Muse: Muse Spark 1.3 and 1.2, Wonder 1.0 and Wonder Full 1.0 — paste your Muse key in Connect or press “Sign in with Meta”.`,`ChatGPT plans: GPT-6.1 Sol, GPT-6 Sol, GPT-6 Astra and GPT-5.6 Sol when your plan lists them; chats keep their thinking across tool calls and use the effort you pick.`,`NVIDIA is back for your own NVIDIA key, with twelve hosted models that call tools. Your own SuperGrok subscription offers Grok 4.7 Fast.`,`Bring this PC into the chat: on a chat that runs on another PC, pick folders on this PC and what the chat may do there; it asks you before every change. And a Tools switch lets a chat list, read and message the chats on your other PCs.`,`Sticky notes beside the bug button, saved in your vault so they follow you to your other computers.`,`Suggest, beside Listen in every chat, proposes what to send next, and the project manager does it for several chats at once. Nothing is sent until you press Send.`,`Listen to this chat is a player with a seek bar, a speed you can change while it plays, and the spoken word highlighted.`,`A tab whose chat finished a turn you have not looked at yet wears a dot. A long chat folds old agents into one “N earlier agents” row, and every block shows its time.`,`When a long chat no longer fits the model, one line says how many earlier messages the request left out.`],fixed:[`A message sent while a chat is working, right after you picked another model, waits for the running turn and is answered by the model you picked.`,`A PC you sign in later appears in the left panel by itself.`,`A thought with no words in it no longer leaves an empty “Thought” card.`,`The Claude Code engine is updated to 2.1.296.`]},{version:`0.3.236`,date:`2026-10-14`,platforms:[`win32`,`darwin`],added:[`Every model now shows its own effort levels, and the effort picker starts on the model’s default — so you can see what level a chat really runs at. A model that has no effort levels no longer shows a picker at all.`,`A collapsed thought block now shows how the thought begins, like a command does: “Thought 42 words: First I read the file…”.`,`Meta Muse requests now match Meta’s own Muse CLI, so its thinking, tool calls, pictures and PDFs show up properly in the chat.`],fixed:[`Grok 4.5 no longer offers an “extra high” effort that xAI treats as high, and GPT-4.1 no longer shows an effort picker it cannot use.`]},{version:`0.3.235`,date:`2026-10-13`,platforms:[`win32`,`darwin`],added:[`Meta Muse: use Meta’s Muse Spark 1.3, Spark 1.2, Wonder 1.0 and Wonder Full 1.0 in your chats. Open Connect, pick Meta Muse, and either paste your Muse key or press “Sign in with Meta” — OonaCode downloads Meta’s Muse once (about 360 MB, after you agree), you confirm the code on Meta’s page, and the key is kept in your vault.`,`ChatGPT plans: GPT-6.1 Sol (500k context), GPT-6 Sol, GPT-6 Astra and GPT-5.6 Sol are available when your plan lists them, next to the models you already had.`,`Google’s agy: Gemini 4 Argon appears in the model picker when your Google plan includes it (Ultra), at Low, Medium and High.`],fixed:[]},{version:`0.3.234`,date:`2026-10-13`,platforms:[`win32`,`darwin`],added:[`Bring this PC into the chat: on a chat that runs on another PC, press the button in the chat’s toolbar, pick folders on this PC and tick Read, Create, Edit or Delete for each. The chat can then work with those files. It asks you before it creates, changes, moves or deletes anything, and the link ends when you close the tab. Both PCs need this version.`,`Chats on my other PCs: a new switch in the Tools menu lets a chat list your other PCs and their chats, read them, message them and start new chats there on the model you choose. You confirm every new chat.`,`The Tools menu now works on a chat that runs on another PC, so you can switch its tools from here.`],fixed:[`A PC you sign in after OonaCode has started now appears in the left panel by itself, without opening Settings → Devices first.`]},{version:`0.3.233`,date:`2026-10-12`,platforms:[`win32`,`darwin`],added:[`The model picker now tells you when a pick is not in use yet: after you pick a model from another provider, its button says “next message” and explains that the chat keeps running on its current model until your next message.`,`A long chat folds the agents that ran long ago into one “N earlier agents” row that says when they ran, instead of one card for each of them under your newest message.`],fixed:[`A message you send while a chat is working, right after you picked another model or provider, now waits for the running turn and is answered by the model you picked. It used to go to the model that was already running, so the chat kept answering as the old one while the picker showed the new one.`,`Every block in a chat now shows the time it happened — also the notes the app writes itself and the cards for earlier agents.`]},{version:`0.3.232`,date:`2026-10-12`,platforms:[`win32`],added:[`The model picker is redone: your providers on the left, each with how many models it has, and the chosen provider’s models on the right, best first by independent intelligence rating (unrated ones last). Each side has its own search, and the one over the providers finds a model across every provider, showing only the providers that carry it.`,`NVIDIA is back for your own NVIDIA key: twelve hosted models that call tools, among them Nemotron 3 Ultra and Super, Kimi K3, GLM-5.3, DeepSeek V4.1 Flash and Gemma 4.`],fixed:[`Models hosted as vendor/model (Kimi K3 on NVIDIA and the like) now show their intelligence rating.`]},{version:`0.3.232`,date:`2026-10-12`,platforms:[`darwin`],added:[`Sticky notes: the note button beside the bug button at the top opens your notes as tabs. Make as many as you like, name them with a double-click, and write — every change is saved by itself in your vault, so the notes follow you to your other computers. Text only.`,`Chats on your own ChatGPT plan keep their thinking across tool calls, use the effort level you pick (up to max where the model has it), and list the models your account really offers.`,`The model picker is redone: your providers on the left, each with how many models it has, and the chosen provider’s models on the right, best first by independent intelligence rating (unrated ones last). Each side has its own search, and the one over the providers finds a model across every provider, showing only the providers that carry it.`,`NVIDIA is back for your own NVIDIA key: twelve hosted models that call tools, among them Nemotron 3 Ultra and Super, Kimi K3, GLM-5.3, DeepSeek V4.1 Flash and Gemma 4.`],fixed:[`Suggest no longer starts reading the chat the moment you open it: pick how many hours to read, then press Suggest.`,`The Claude Code engine is updated to 2.1.296.`,`Models hosted as vendor/model (Kimi K3 on NVIDIA and the like) now show their intelligence rating.`]},{version:`0.3.231`,date:`2026-10-12`,platforms:[`android`],added:[`On the phone: any text in a chat can be selected and copied, and About became Session info.`],fixed:[]},{version:`0.3.230`,date:`2026-10-11`,platforms:[`win32`],added:[`Sticky notes: the note button beside the bug button at the top opens your notes as tabs. Make as many as you like, name them with a double-click, and write — every change is saved by itself in your vault, so the notes follow you to your other PCs. Text only.`,`Chats on your own ChatGPT plan keep their thinking across tool calls, use the effort level you pick (up to max where the model has it), and list the models your account really offers.`],fixed:[`Suggest no longer starts reading the chat the moment you open it: pick how many hours to read, then press Suggest.`,`A Gemini chat on your own Google plan no longer repeats, turn after turn, a command it refused earlier.`,`The Claude Code engine is updated to 2.1.296.`]},{version:`0.3.229`,date:`2026-10-11`,platforms:[`darwin`],added:[`Suggest, beside Listen in every chat: it reads the last few hours of the chat and suggests what to send it next. You edit it, put it in the message box or send it — nothing runs by itself.`,`The project manager, beside the "about" button over the chat list: tick chats, press Review, and each gets a suggestion you can edit and send with its own button.`,`A tab whose chat finished a turn you have not looked at yet wears a dot (red when the turn failed), and so does its row in the list.`,`Listen to this chat is a player: a seek bar, play and pause, ten seconds back and forward, the previous or next sentence, a speed you can change while it plays, the spoken word highlighted (click any word to play from it), and every summary listed newest first on top.`,`MCP servers: add them in Settings → MCP Servers from a directory of popular ones (PostgreSQL, Supabase, GitHub, Sentry, Slack, Notion, Linear and more) or your own, and switch each on or off per chat.`,`Connectors: Supabase, Railway and Vercel in the Tools menu — sign in once, switch one on in a chat, and the agent can look at your projects, databases, logs and deployments; read-only until you allow changes, and it asks before each one.`,`Pictures: ask any chat for an image and it makes one, saved in the chat’s folder and shown in the chat (a few credits each; Images in the Tools menu turns it off).`,`Web search for every model, from your Mac, with no key and no credits.`,`Claude Haiku 5.5 with a 1M-token window, and Grok 4.7 Fast on your own SuperGrok subscription.`,`Pasting a very long text, or a video, sound or large picture, saves it in the chat’s folder and attaches it as a file.`,`Hover a “Read …png” line in the chat and the picture shows at once.`],fixed:[`A compacted chat reopens with its whole history, not only what came after its last compaction.`,`Deleting a chat frees its OonaCode pool seat at once.`,`Large chats resume faster.`,`The chat summary (“About”) no longer fails on models that think at length.`,`A refusal by Gemini’s safety filter is retried once on another model, like the others.`,`Error notes in the chat read as plain sentences instead of codes or raw data.`,`The message navigator always shows at least four lines and no longer vanishes on the way to it.`]},{version:`0.3.228`,date:`2026-10-11`,platforms:[`win32`],added:[`Suggest, beside Listen in every chat: it reads the last few hours of the chat and suggests what to send it next. You edit it, put it in the message box or send it — nothing runs by itself.`,`The project manager, beside the "about" button over the chat list: tick chats, press Review, and each gets a suggestion you can edit and send with its own button.`,`A tab whose chat finished a turn you have not looked at yet wears a dot (red when the turn failed), and so does its row in the list.`],fixed:[]},{version:`0.3.227`,date:`2026-10-11`,platforms:[`win32`],added:[`Listen to this chat is a player: a seek bar, play and pause, ten seconds back and forward, the previous or next sentence, and a speed you can change while it plays.`,`The word being spoken is highlighted in the summary, and clicking any word plays from there.`,`Every summary the chat has is listed on top, newest first; pick one to hear it, with the languages it was already translated into.`],fixed:[]},{version:`0.3.226`,date:`2026-10-11`,platforms:[`win32`],added:[`Google Gemini (agy) chats show what agy looked at: a picture it viewed appears in the chat, and a sound or video it named plays inside the tool card.`,`Your own SuperGrok subscription offers Grok 4.7 Fast.`,`The Android app groups this PC’s chats by the project each one is filed under.`],fixed:[`Google Gemini (agy) tool steps read in words — View file, Run command, Edit — with their file or command, instead of raw arguments.`,`Your own SuperGrok sign-in presents the current Grok CLI (1.0.50), so xAI does not refuse it as outdated.`]},{version:`0.3.225`,date:`2026-10-10`,platforms:[`win32`,`linux`],added:[`Per-credential usage keys: operator credentials can now store their own console session keys (such as Xiaomi MiMo account credentials) directly in the Admin Panel to monitor individual token plan quotas and balances.`,`Google agy thinking blocks: local Google Antigravity (Gemini) sessions now extract and display model thinking blocks and rich tool arguments in chat from agy transcripts.`],fixed:[`Session info regeneration: fixed an issue where regenerating the session summary for Google Antigravity (Gemini) sessions would fail with a missing subscription token error.`,`Xiaomi MiMo cleanup: removed redundant and withdrawn mimo-v2.5 and mimo-v2.5-pro models from the registry and models catalog; replaced by mimo-v2.6-pro and mimo-v2.6-flash.`]},{version:`0.3.224`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[`Auto-save clipboard files and large pasted text: pasting text exceeding 10,000 characters or 300 lines automatically saves into your workspace .oonacode/tmp folder and attaches as a file without bloating the composer. Clipboard videos, audio, and large images are similarly saved and attached as local paths.`],fixed:[`Error display in chat: masked internal error codes, raw JSON, and provider balance exhaustion notices from the user chat bubble, displaying clean status indicators instead.`,`Google Antigravity pool plan access: included Gemini 3.8 Flash and 3.7 Flash across all active subscription plans (Standard, Pro, Team Standard, Team Premium, Free).`,`Session info panel: fixed an issue where switching between chats could leave stale child views mounted in the session info panel.`]},{version:`0.3.223`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[`MCP Servers settings & Antigravity catalog: configure stdio, sse, and http Model Context Protocol servers in File -> Settings -> MCP Servers. Choose from a rich directory of popular providers (PostgreSQL, Supabase, Redis, SQLite, MongoDB Atlas, GitHub, GitLab, Sentry, Cloudflare, Slack, Notion, Linear, PostHog, Brave Search) or add custom servers.`,`TopBar MCP badge: see your configured MCP servers count at a glance next to the Bug Report button, and click to open MCP settings directly.`,`Per-chat MCP server toggles: selectively enable or disable configured MCP servers per conversation in the composer toolbar to eliminate prompt token overhead.`],fixed:[]},{version:`0.3.222`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[],fixed:[`Chat summary "About": increased housekeeper output token headroom to prevent thinking and verbose models (e.g. Qwen, Gemini) from exceeding the token ceiling and failing with "Claude's response exceeded the 700 output token maximum".`]},{version:`0.3.221`,date:`2026-10-09`,platforms:[`win32`,`linux`],added:[`Web search for every model: all models can now search the web via keyless local DuckDuckGo search from your PC, with no extra credentials or credits needed.`,`Claude Haiku 5.5: available with 1M context, 128K output, and tiered pricing (replaces Haiku 4.5).`],fixed:[`Deleting a chat immediately frees its pool seat on the server, instead of keeping it held until the session cache window expires.`,`Session info panel headers: distinct icons for About (sparkle) and Scheduled tasks (bell) so sections no longer repeat the same info glyph.`,`Large sessions resume faster and safer with reverse-bounded transcript loading and auto-trimming to disk.`,`Gemini content safety filter blocks are now caught by safeguard fallback and retried on the fallback model.`]},{version:`0.3.220`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[],fixed:[`A chat on a Google Claude model no longer stops with “Autocompact is thrashing”. Its window was set to 100,000 tokens, so the chat compacted again right after every compaction and the engine gave up; it is now 200,000, and if the engine ever gives up this way the next message starts from a shorter history instead of repeating the same state.`]},{version:`0.3.219`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`Pictures: ask any chat for an image — “generate a realistic tiger fighting a crocodile” — and it now makes one, with any model, the way Google’s Antigravity does. The picture is saved in the chat’s folder and shown right in the chat; click it for the full viewer. It costs a few OonaCode credits per picture, you can edit a picture file from the folder too, and it can be switched off in the Tools menu (Images).`,`The Google Claude models (typed by exact id in the model picker’s Custom model row) show their real 100,000-token window in the session panel, and the chat now compacts before the limit instead of being refused and re-sent.`],fixed:[`Google-hosted Claude and Gemini chats re-used almost none of Google’s prompt cache, so big chats ate the 5-hour window in minutes. They now reuse about 98 % of the prompt, which makes them far cheaper and faster.`,`The hidden /setcustommodel command and the admin custom-model tool are gone — the model picker’s Custom model row does the same job.`]},{version:`0.3.218`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`Connectors: Supabase, Railway and Vercel in the Tools menu. Sign in once with the service’s own page, switch the connector on in a chat, and the agent can look at your projects, databases, logs and deployments. It is read-only until you turn on “Allow changes”, and then it asks you before every change; purchases, billing and secret or key readers are never offered. Each shows whether the service’s command-line tool is installed and can add the vendor’s own skills. In the terminal: oona connectors. Guide: /docs/connectors.`,`Hover a “Read …png” line in the chat and the picture shows at once; click the picture for the full viewer with zoom, like a picture you sent.`],fixed:[`A chat that was compacted no longer reopens showing only what came after its last compaction: the whole history is there again.`,`The message navigator always shows at least four lines, and its list no longer vanishes while the pointer crosses the gap to it.`]},{version:`0.3.217`,date:`2026-10-07`,platforms:[`darwin`],added:[`Pictures you attach open large: click one in the box or in a sent message for a viewer with zoom (buttons, wheel, drag, Fit and 100 %). Click a PDF or text file and it opens in its own program.`,`When a model refuses a message on safety grounds, OonaCode retries it once on another model and says so in the chat. Choose how in Settings → Safeguards: switch automatically, always switch to a model you pick, or never — with a fallback for each model. The same in the terminal: oona settings safeguard-fallback and --fallback-model. Works for Claude, Gemini and Google’s agy.`,`The terminal signs in two ways: your OonaCode account (through your browser) or an OonaCode API key. A fresh oona asks which; oona login --api-key-stdin stores a key for scripts, oona whoami says which one is in use, and oona logout removes it. The terminal manual is on the website: /docs/cli.`,`The conversations badge reads like the agents badge — “3 conversations · 1 active” — and the Conversations window lists every limit: messages, tokens, credits, depth, rates and the idle close.`,`A chat can start a new chat for you on another provider, model, effort or project — it asks you first, and a chat that was itself started by a chat cannot start more.`,`The message navigator’s list shows each message’s date and opens on your latest one; messages further back than 5,000 lines are greyed.`],fixed:[`A chat that was compacted no longer reopens showing only what came after its last compaction: the whole history is there again.`,`The message navigator always shows at least four lines, and its list no longer vanishes while the pointer crosses the gap to it. A click on it now takes you to older messages even while the chat is still replying (the page used to jump straight back).`,`oona: a wrong command or flag now exits with code 2, oona sessions list no longer breaks on multi-line titles, piping oona into head no longer prints an error, and the plain-prompt mode can send a message again.`,`One-shot terminal runs reuse the engine already on the Mac instead of downloading it every time, and a model you typed with /model that is not in the picker keeps its name after OonaCode restarts.`]},{version:`0.3.216`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`The terminal signs in two ways: your OonaCode account (through your browser) or an OonaCode API key. A fresh oona asks which; oona login --api-key-stdin stores a key for scripts and servers, oona whoami says which one is in use, and oona logout removes it. The key is sealed by the host and never written to the terminal’s config.`,`The terminal manual is on the website: /docs/cli, written from commands run on Debian and Ubuntu servers.`],fixed:[`oona: a wrong command or flag now exits with code 2, oona sessions list no longer breaks on multi-line titles, piping oona into head no longer prints an error, and the plain-prompt mode can send a message again.`,`One-shot terminal runs reuse the engine already on the PC instead of downloading it every time.`,`A model you typed with /model that is not in the picker keeps its name after OonaCode restarts.`]},{version:`0.3.215`,date:`2026-10-07`,platforms:[`win32`,`linux`],added:[`Pictures you attach open large: click one in the box or in a sent message for a viewer with zoom (buttons, wheel, drag, Fit and 100 %). Click a PDF or text file and it opens in its own program.`,`When a model refuses a message on safety grounds, OonaCode retries it once on another model and says so in the chat. Choose how in Settings → Safeguards: switch automatically, always switch to a model you pick, or never — with a fallback for each model. The same in the terminal: oona settings safeguard-fallback and --fallback-model. Works for Claude, Gemini and Google’s agy.`,`The conversations badge reads like the agents badge — “3 conversations · 1 active” — and the Conversations window lists every limit: messages, tokens, credits, depth, rates and the idle close.`,`A chat can start a new chat for you on another provider, model, effort or project — it asks you first, and a chat that was itself started by a chat cannot start more.`,`The message navigator’s list shows each message’s date and opens on your latest one; messages further back than 5,000 lines are greyed.`],fixed:[`A click on the message navigator now takes you to older messages even while the chat is still replying (the page used to jump straight back).`,`The message navigator no longer touches the message times, and its lines are darker and longer.`]},{version:`0.3.214`,date:`2026-10-06`,platforms:[`darwin`],added:[`OonaCode runs natively on Apple Silicon Macs. The installer picks the Apple Silicon build by itself, and an Apple Silicon Mac that had the Intel one moves to it on its next install or update — the Intel build cannot run there on macOS 14 or older.`,`A message navigator on every chat: the small stack of lines at the middle-right of the chat is your own messages — rest on it, focus it or tap it and the list of everything you sent opens; click one and the chat scrolls straight to it.`],fixed:[`On an Apple Silicon Mac with macOS 14 or older, every chat crashed (“CPU lacks AVX support”) and Update did nothing. If yours did, run once in Terminal: curl -fsSL https://oonacode.oonak.ai/install.sh | bash`,`When an update cannot start, the app now says why and what to run instead of saying “Updating OonaCode…” while nothing happens.`,`File → Export chats… no longer freezes the window under a Save panel: the zip goes straight into Downloads and Finder shows it.`]},{version:`0.3.213`,date:`2026-10-06`,added:[`A message navigator on every chat: the small stack of lines at the middle-right of the chat is your own messages — rest on it, focus it or tap it and the list of everything you sent opens; click one and the chat scrolls straight to it. Escape closes the list.`],fixed:[],platforms:[`win32`,`linux`]},{version:`0.3.212`,date:`2026-10-06`,added:[`Headless one-shot runs without signing in: --api-key (or OONACODE_API_KEY) bills the run through the gateway on that OonaCode key — held in memory for the run only, never stored. For containers and CI.`],fixed:[`A keyed run no longer stops at the device-link screen, and no longer dies with "the OonaCode pool needs your OonaCode account": the key now also covers provider routing and the registry read on a machine that was never signed in.`],platforms:[`win32`,`linux`]},{version:`0.3.211`,date:`2026-10-06`,added:[`A message navigator on every chat: the small stack of lines at the middle-right of the chat is your own messages — rest on it and the list of everything you sent opens; click one and the chat scrolls straight to it.`,`One-shot runs without signing in: --api-key (or OONACODE_API_KEY) bills the run through the gateway on that OonaCode key — held in memory for the run only, never stored. For headless machines and containers.`],fixed:[],platforms:[`linux`]},{version:`0.3.210`,date:`2026-10-05`,added:[`Use a project folder opens on the folder the chat runs in — its project, or the workspace OonaCode made for it — instead of an empty box.`],fixed:[`Send now on one queued message no longer makes the other queued messages look sent: they stay under the chat, each with its own Send now, and get their tick when the agent reads them.`,`After you confirm the agent’s request to move a chat to another folder, the chat shows the new folder at once, not only after your next message.`]},{version:`0.3.209`,date:`2026-10-05`,platforms:[`win32`,`darwin`],added:[`Scheduled tasks say which model a run uses: always the chat’s model at the moment the task fires, named in the Scheduled tasks panel.`],fixed:[`A Google Gemini chat keeps Google’s agent running for half an hour between messages, so the next message after a pause no longer waits about four seconds for agy to start.`,`Commands run in a Google Gemini chat reach servers on your own PC (localhost) and plain http:// sites again.`]},{version:`0.3.209`,date:`2026-10-05`,platforms:[`linux`],added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`,`Scheduled tasks say which model a run uses: always the chat’s model at the moment the task fires, named in the Scheduled tasks panel.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`,`A Google Gemini chat keeps Google’s agent running for half an hour between messages, so the next message after a pause no longer waits about four seconds for agy to start.`,`Commands run in a Google Gemini chat reach servers on your own PC (localhost) and plain http:// sites again.`]},{version:`0.3.208`,date:`2026-10-04`,platforms:[`win32`,`darwin`],added:[`Grok 4.7, xAI’s newest model, on the OonaCode pool and on your own SuperGrok subscription — and an effort picker for Grok 4.7, 4.6 and 4.5 (low, medium, high, extra high), sent the way xAI’s own Grok CLI sends it.`,`Every provider in the model picker shows its own logo — Google’s Gemini mark for Google, xAI’s for your SuperGrok, OpenAI’s for your ChatGPT plan, Z.ai’s for GLM — instead of two letters.`],fixed:[`When a subscription behind the OonaCode pool refuses or fails a request, the same request is answered at once from the provider’s API key instead of showing you the error.`,`Grok on your own SuperGrok subscription and on the OonaCode pool works again: xAI started refusing the Grok CLI identity OonaCode presented as outdated.`,`When your own subscription’s sign-in stops working, the chat now says so and asks you to sign in again, instead of a confusing “own-subscription providers run directly to the provider” error.`]},{version:`0.3.207`,date:`2026-10-04`,added:[`Every chat lists every provider you have connected and the OonaCode pool — Google Gemini too, whatever the chat ran on before. Switching keeps the conversation: a chat moving off Google continues with its whole history, and a chat moving onto Google gives Google’s agent the conversation so far, so it can carry on.`],fixed:[`Two messages sent a moment apart while a chat was starting no longer leave one of them stuck in the queued strip: the engine had read them together as one message, and OonaCode now recognises that.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini installs Google’s agy by itself the first time you use it — open the provider in Settings → Providers, or send a message to a Google Gemini chat — instead of waiting for you to press Install.`],fixed:[`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`,`oona doctor no longer tells you to change settings that OonaCode stopped reading.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`linux`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`Deleting a chat now says what really happens: a chat is kept only on the PC it runs on, so deleting it there removes it everywhere.`]},{version:`0.3.206`,date:`2026-10-04`,platforms:[`darwin`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back within the minute agy allows. OonaCode never sees your password. Every model your Google plan offers through agy is listed — Gemini 3.8, 3.7 and 3.6 Flash, Gemini 3.1 Pro, and Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B marked “via Google”. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total is grey.`,`The command line’s reinstall hint on a Mac is the one that works: curl -fsSL https://oonacode.oonak.ai/install.sh | bash.`]},{version:`0.3.205`,date:`2026-10-04`,platforms:[`win32`],added:[`Google Gemini now lists every model your Google plan offers through agy, not only Gemini: Claude Opus 5.5, Claude Sonnet 5.5 and GPT-OSS 120B (marked “via Google”) sit beside Gemini 3.8, 3.7 and 3.6 Flash and Gemini 3.1 Pro. They run on Google’s own agent with your Google plan, and have their own usage window.`],fixed:[]},{version:`0.3.204`,date:`2026-10-04`,platforms:[`win32`],added:[`Signing in to Google Gemini opens Google’s page for you and shows how many seconds are left: Google’s agy waits only one minute for the sign-in. Paste the code Google shows and it is sent at once.`],fixed:[`Signing in to Google Gemini finishes. The code you pasted never reached Google’s agy in the installed app (the window it types into dropped everything typed), so the sign-in waited out its minute and failed.`,`The Claude sign-in’s “paste the code” box, which used the same window, can type the code too.`]},{version:`0.3.203`,date:`2026-10-04`,platforms:[`win32`],added:[`Gemini on your own Google plan, through Google’s own agent. Open Settings → Providers → Google Gemini and press Install: OonaCode downloads Google’s agy for you and checks it. Then press Sign in with Google, sign in on Google’s own page and paste the one-time code back here. OonaCode never sees your password. A Google Gemini chat runs Google’s agent as it is (Build or Autonomous mode, text only, no pictures), and the chat’s info panel lists every request it made to Google.`,`Every provider in the model picker ends with a “Custom model…” row: type any model id and the chat runs it on that provider.`],fixed:[`The agents badge highlights what is happening now: “4 working” is blue and the total (“51 agents”) is grey, instead of the other way round.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`darwin`],added:[`OonaCode runs on macOS 12 or newer: the agent, your chats, the background service and the desktop app, installed with the same one line as on Linux — curl -fsSL https://oonacode.oonak.ai/install.sh | bash. An Intel build; Apple Silicon Macs run it through Rosetta 2. Your sign-in key is kept in your login keychain.`,`Updating is the same line again, oona update in a terminal, or the update button in the app: it closes OonaCode, puts the new version in place and opens it again. The app is not signed by Apple yet, so it cannot be downloaded from a browser and does not update itself the way it does on Windows.`],fixed:[]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`linux`],added:[],fixed:[`Your sign-in survives a restart on a PC that keeps OonaCode’s key in the login keyring (GNOME Keyring, KWallet): two of OonaCode’s keys shared one keyring entry and overwrote each other, and every start of the host wrote over the stored key — so after a restart you could find yourself signed out.`,`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode (an nvm folder, for example).`,`oona update installs from the site your OonaCode was installed from, not always from oonacode.oonak.ai.`]},{version:`0.3.202`,date:`2026-10-03`,platforms:[`win32`],added:[],fixed:[`OonaCode never runs a Claude Code you installed yourself as its engine, even when it sits in the same folder as the Node.js that runs OonaCode.`]},{version:`0.3.201`,date:`2026-10-03`,added:[`The Tools menu lists only tools that work. Desktop control, Clipboard, Screen capture and Run as administrator were demos that never ran anything, and they are gone: the agent already reads and sets your clipboard, takes screenshots and asks Windows for administrator rights through its own commands.`],fixed:[`Oonak Browser keeps working when its window is behind other windows. A browser covered by the OonaCode window used to crawl, and some clicks and scrolls gave up after 30 seconds.`,`Oonak Browser no longer clicks a hidden copy of a link, or a link inside a closed menu, when a site has both a visible and a hidden one.`,`A message you send right after a reply failed no longer stays pinned above the box as “queued” once the agent has read it.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`win32`],added:[`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`],fixed:[`Oonak Browser works on sites built from web components, Google’s own forms among them: it reads, finds, clicks and types inside them, where it used to answer “the page changed” or find nothing.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`]},{version:`0.3.200`,date:`2026-10-03`,platforms:[`linux`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`,`Everything OonaCode shows you is in credits, never in dollars: the model picker gives what an OonaCode pool model charges per 1M tokens in credits, and a chat’s spend, Usage, Conversations, Listen and the terminal all count credits. A chat on your own key or your own subscription says so instead of a price.`,`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`,`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop.`,`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name matches each word, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond, and it works inside web components, Google’s own forms among them. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`,`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed — 10 days after their last change.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`,`Chats talking to each other no longer ping-pong: a reply needs no answer, several messages from the same chat are read together in one turn, and a message card says “answer requested” until the answer has gone back, then “answered” with the time.`,`A tool you switch on while a chat is replying works for the message you send next, even mid-reply. After an update, a chat that had background tasks running shows one line saying how many stopped, instead of one card per task.`,`The model’s questions appear only in their own window: the chat no longer shows the question’s raw text while you answer, and afterwards keeps one line — “You answered 3 questions” — that opens to your answers.`,`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`,`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`,`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption.`]},{version:`0.3.199`,date:`2026-10-02`,platforms:[`win32`],added:[`Talk to other chats: a chat can now write to a chat whose switch is off. That chat’s switch stays off and it gets no new tools — it can only answer the chat that wrote to it. Finding a chat by name is smarter too: each word is matched, in its name, project, folder and description, and spelling like “AI-control” or “aicontrol” no longer matters.`,`Oonak Browser acts like a person: every click, keystroke and scroll is a real input event, so sites that ignore scripted clicks now respond. Typing into a drop-down picks the option, and typing into an editor adds the text at its end.`],fixed:[`A chat no longer ends up on a model nobody picked for it: a model the provider does not offer is refused instead of quietly switching the chat to the provider’s default, and Enter in the model picker no longer picks the row under the mouse pointer.`]},{version:`0.3.198`,date:`2026-10-01`,platforms:[`win32`],added:[`Listen has one button: Play. It writes a summary when the chat has none or has moved on, translates it once when you pick a new language, or just plays — saying only “Generating…” or “Translating…” while it works. A summary written in the last ten minutes is used for every language, so switching language never writes it again.`],fixed:[`A chat keeps its Build / Plan / Ask first / Autonomous choice, and every device shows the same one — the phone used to show “Ask first” for a Build chat. A chat set to “Ask first” now asks you before acting even when this PC answers prompts by itself.`,`Play in Listen is never greyed out for want of a voice: it gets the text ready and names the voice to install.`]},{version:`0.3.197`,date:`2026-10-01`,platforms:[`win32`],added:[`Oonak Browser, the browser your chats use, moves to version 151 by itself at its next use: a build with no Google services (no Safe Browsing warnings, push notifications or search suggestions). The download is checked against its fingerprint before anything is unpacked, and the old version is removed once no chat’s browser still runs from it.`],fixed:[`A model your plan does not include now says “not in your plan”, instead of “Failed to authenticate … sign-in needed”.`]},{version:`0.3.196`,date:`2026-10-01`,platforms:[`win32`],added:[`Your chats now live only on the PC that runs them. Your phone, the website and your other PCs read a chat straight from its PC, through the same encrypted connection they use to continue it — OonaCode’s server no longer keeps any copy. While a PC is off or asleep its chats cannot be read from elsewhere; the window says so and they come back when it is online. Update OonaCode on each of your PCs: another device reads a PC’s chats only once that PC runs this version.`],fixed:[`The account window no longer stays on “offline · vault event stream responded 503” after a short server interruption: the next sync that works clears it by itself.`]},{version:`0.3.195`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`Chats talking to each other no longer ping-pong. A message asks for an answer only when the chat really needs one; a reply needs no answer and is not answered with a new message; and several messages waiting from the same chat are read together in one turn. Fewer wake-ups, fewer tokens.`,`A message card says what is true: “answer requested” until the answer has gone back, then “answered” with the time — instead of an orange “reply expected” that never went away.`]},{version:`0.3.194`,date:`2026-10-01`,platforms:[`win32`],added:[`A chat can offer to move a task to a new chat. When a task deserves its own chat — a separate job, a chat that has grown long, work in another folder — the model proposes it with the first message written out; you can edit it, then Start new chat opens the new chat in a tab, sends the message and carries on there. Nothing starts without your yes.`,`Settings → Developer → Allow debugging: opens a debugging port on this PC only, so a developer can look at and drive the app while fixing a problem with you. Off by default; while it is on, every window shows a red “Debugging on” badge.`],fixed:[]},{version:`0.3.193`,date:`2026-10-01`,platforms:[`win32`],added:[],fixed:[`A tool you switch on while a chat is replying works for the message you send next, even mid-reply: that message now waits for the chat to restart with the new tool instead of reaching the model without it.`,`After an update, a chat that had background tasks running shows one line — “11 background tasks stopped — they were running when OonaCode restarted this chat” — instead of one card per task. Click it to see each one.`]},{version:`0.3.192`,date:`2026-09-30`,platforms:[`win32`],added:[`A morning briefing in View → What chats are about…: show the chats active in the last 24 hours, 3, 7, 10 or 30 days (or your own dates), tick the ones you want — or all — pick a language, a voice and a speed, and press Play. OonaCode reads each chat’s name and what it is about, one after another, with Next, Previous, Pause and Stop. Other languages are translated once and kept, so hearing the same briefing again costs nothing.`],fixed:[]},{version:`0.3.191`,date:`2026-09-30`,platforms:[`win32`],added:[`Scheduled shows at a glance what will still run: paused tasks and one-time tasks that have already run are greyed out, with the day they will be removed. They are deleted by themselves 10 days after their last change; resuming or editing a paused task gives it another 10 days.`],fixed:[]},{version:`0.3.190`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`A long message waiting in the queue no longer hides its “Send now” button: it is folded to a few lines, with Show all to read the rest.`]},{version:`0.3.189`,date:`2026-09-30`,platforms:[`linux`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window; “Move to main window” brings it back. On Wayland desktops the new window opens at the usual place rather than under the pointer. Your split views and windows come back when you restart OonaCode.`,`Every language plays in Listen to a chat: each language picks the best voice on its own — OonaCode’s Armenian voices first, then your system’s voices, then eSpeak (install the espeak-ng package if your system has no voice for a language).`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.188`,date:`2026-09-30`,platforms:[`win32`],added:[`Split views, like VS Code: drag a chat tab to the left, right, top or bottom of the chat area to open it beside the other one — a shaded area shows where it will land. Every chat on screen works on its own, with its own replies streaming and its own message box. Drag the divider to resize; Ctrl+\\ splits the current tab to the right, Ctrl+1, Ctrl+2… jump between views, and a tab’s menu has Split right, Split down and Move to other group.`,`Chats in windows of their own, like Chrome tabs: drag a tab out of the window, or choose “Move to new window” in its menu, and it opens in its own window. Drag it back onto the main window’s tabs, or choose “Move to main window”, to bring it back. Your split views and popped-out windows come back when you restart OonaCode.`],fixed:[]},{version:`0.3.187`,date:`2026-09-30`,platforms:[`win32`],added:[`Every language plays in Listen to a chat. Persian, Georgian, Ukrainian — and any language whose Windows voice is not installed — now speak with eSpeak, a free voice that comes with OonaCode (it sounds robotic, but it always works). Each language picks the best voice on its own: OonaCode’s Armenian voices first, then Windows’ own, then eSpeak.`],fixed:[`Picking another language for a summary no longer needs a new summary: Play translates the one you have, keeps the translation, shows it and plays it.`,`“Summarise now” says “Up to date — nothing to summarise” while the chat has not changed, instead of seeming to do nothing.`]},{version:`0.3.186`,date:`2026-09-30`,platforms:[`linux`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`,`OonaCode brings two Armenian voices of its own, Astgh and Artsiv, and also speaks with your system’s voices through speech-dispatcher — install speech-dispatcher and espeak-ng for Persian, Russian and every other language; the Listen window names the packages for your distribution.`,`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`,`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`,`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. Pin any chat or project to the top of the list from its menu.`,`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`,`Type / at the start of a message to see the chat’s commands and skills, with what each does, in two titled sections. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing; switch one on to let the model use it by itself in that chat. Typing /name still runs any skill for one turn.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`,`Search in the Import window: find a chat by its name, its first or last message or its folder, or pick “Whole conversations” to search inside the chats themselves.`],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from, with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once.`,`The message box fits a narrow chat: its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it.`,`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Only new replies change.`,`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model, /usage, /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`,`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message.`,`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`,`Typing /model in a chat updates the chat’s model and the model picker again, and command output such as /context reads the same while it arrives and after you reopen the chat.`,`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.185`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat from your phone: the OonaCode app’s 🔊 Listen reaches this PC’s summaries and plays them with the phone’s own voices. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`Listening with a Windows voice no longer stops after the first sentence when the voice fails to say it has finished.`]},{version:`0.3.184`,date:`2026-09-30`,platforms:[`win32`],added:[`Listen to a chat: right-click a chat → Listen to this chat…, or the speaker button beside the chat’s title. The chat’s own model writes a short spoken summary — the goal, what was done, where it stands, what is left — and OonaCode reads it aloud on this PC, in the voice and at the speed you choose. Every summary is kept with its date, so you can play it again at any time; a new one is written only when the chat has moved on. Other languages are translated once and kept with the summary.`],fixed:[`A chat’s “about” no longer starts in the middle of a sentence when the model wrote a long answer.`]},{version:`0.3.183`,date:`2026-09-30`,platforms:[`win32`],added:[`See where your credits go: Account → Usage. Pick the last 24 hours, 7, 30 or 90 days or your own dates, by hour or by day, for the coding agent or your API keys apart. A chart shows the credits over time by model or by what they were for, and the lists below give every model with its tokens and price, and every use — chat turns, a chat’s “about”, images, speech and the rest.`],fixed:[]},{version:`0.3.182`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Import chats shows every chat on this PC, grouped by the app it came from — Claude Code, the Claude app, Qwen Code, Cursor — with nothing folded away. Each row says whether it is new, already imported, moved on since, or deleted by you in OonaCode. Nothing is ticked when you open it yourself: search for a chat and tick it, or tick a whole group at once. The Import button says how many chats it will bring over.`]},{version:`0.3.181`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`The message box fits a narrow chat. In a small window, or with the side panels open, its buttons and pickers move onto a second line and the box grows to hold them — Stop and Queue no longer slip outside it, and the model and effort pickers keep their words readable.`]},{version:`0.3.180`,date:`2026-09-30`,platforms:[`win32`],added:[],fixed:[`Claude’s thoughts show their words again. Every “Thought” from Claude Opus, Sonnet and Fable came back empty — Anthropic leaves the text out unless it is asked for a summary, and now OonaCode asks. Other models were never affected. Only new replies change; older thoughts stay empty.`]},{version:`0.3.179`,date:`2026-09-29`,platforms:[`win32`],added:[],fixed:[`The / menu is easier to read: skills and commands in two titled sections, each with one short line — the full description shows when you point at it.`,`Commands that only duplicated OonaCode’s own controls or showed misleading numbers are gone from the / menu — /model (use the model picker), /usage (the engine’s own estimate, not your credits), /autocompact, /output-style, /mcp, /list-agents and /reload-skills. Typed, they say why.`,`Skills you import or remove in Settings → Skills reach your chats by themselves, at each chat’s next message.`]},{version:`0.3.178`,date:`2026-09-29`,platforms:[`win32`],added:[`The chat list is laid out like the Claude desktop app: New, Projects, Scheduled, then your pinned chats and projects, then Today and Older. The old grouping by project is one click away — the small icon beside “Today”.`,`Projects opens a page of project cards — each with its goal, its chats and when it was last used — with search, sort and New project. Click a card to see that project’s chats, instructions and settings, and to start a new chat in it.`,`Scheduled shows every scheduled task from every chat on this PC in one place, with its next run, its chat, and pause, resume and delete. A dot on it tells you when something is due soon.`,`Pin any chat or project to the top of the list from its menu.`],fixed:[`A chat row’s ⋯ button shows only when you point at the row.`]},{version:`0.3.177`,date:`2026-09-29`,platforms:[`win32`],added:[`Claude Sonnet 5.5 is in the model picker — on the OonaCode pool and on your own Claude subscription — with a 1M-token context. It costs the same as Sonnet 5 per token and usually needs fewer tokens for the same work.`],fixed:[`Claude Sonnet 5 is retired: a chat that was on it moves to Sonnet 5.5 at its next message, and the picker shows Sonnet 5.5.`]},{version:`0.3.176`,date:`2026-09-29`,platforms:[`win32`],added:[`Each chat has a Skills list beside Tools. Every skill starts off, so the model sees none of them and they cost nothing — about 1,400 tokens on every message until now. Switch one on to let the model use it by itself in that chat; the list shows what each one costs per message while on.`,`Typing /name still runs any skill for one turn, whether its switch is on or off.`],fixed:[`The engine’s built-in keyboard-shortcuts helper is turned off: it would have edited your own Claude Code settings.`]},{version:`0.3.175`,date:`2026-09-29`,platforms:[`win32`],added:[`Type / at the start of a message to see the chat’s commands and skills — the Claude Code engine’s own (/compact, /context, /review, /security-review, /init and more) and the skills in your project’s .claude folder — with what each does. Type to narrow the list, then Enter or Tab. They work with every model, not only Claude.`,`Your own skills: Settings → Skills lists the skills OonaCode gives every chat, and “Import from Claude Code…” copies the ones you choose from your Claude Code install — it only reads it, never changes it.`,`In the terminal app (oona), a command the chat’s engine knows — /context, /compact or a skill — now runs instead of answering “unknown command”.`],fixed:[`Typing /model in a chat updates the chat’s model and the model picker again.`,`Command output such as /context reads the same while it arrives and after you reopen the chat.`]},{version:`0.3.174`,date:`2026-09-28`,platforms:[`win32`],added:[`Search in the Import window. Type to find a chat by its name, its first or last message, or its folder — chats folded away as already imported or deleted here show up too when they match. Or open the search options and pick “Whole conversations” to search inside the chats themselves, with a few lines of each match under the chat. It only reads Claude Code, Cursor and the Claude app’s files, never changes them.`],fixed:[`Chats Claude Code switched to another model are answered by that model for real: OonaCode’s pool now serves the model the engine falls back to, and never answers a Claude request with another company’s model.`]},{version:`0.3.173`,date:`2026-09-28`,platforms:[`linux`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`,`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`,`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`,`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`,`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`,`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`A chat can no longer be moved into your home folder or the root folder through a link. Where /home is itself a link (Fedora Silverblue, Bazzite and similar systems), the home folder passed as an ordinary folder, and the chat would have loaded your own Claude Code settings as its project.`,`Signing in to your own Claude subscription inside the app works on Ubuntu 24.04, Debian, Linux Mint, Pop!_OS and Zorin OS again. There, a part of OonaCode built for newer systems did not load, and the sign-in fell back to a command you had to paste.`,"On Ubuntu, Linux Mint, Pop!_OS, Zorin OS and similar systems, `oona` now works in every new terminal right after you install or update. The installer used to leave it off your PATH until you logged out and back in; now it adds it for new terminals itself, and `oona uninstall` takes that line out again.",`Every way of uninstalling — “oona uninstall”, or the install command with --uninstall — now takes this PC off your account: keep your chats and they stay readable on your other devices; delete them and their copies go too. It never touches your Claude Code or the Claude app, and “oona uninstall” no longer gives up when the background service is stopped.`,`The installer now says at once when a system cannot run OonaCode — one older than Ubuntu 22.04, Debian 12 or RHEL 9, or one built on musl such as Alpine — instead of installing a copy that could not start. The .deb and .rpm tell apt and dnf the same.`]},{version:`0.3.172`,date:`2026-09-28`,platforms:[`win32`],added:[`When Anthropic’s safeguards flag a chat and Claude Code moves it to another model for the rest of the run, the model box says so in red — for example “Opus 4.8 (safeguard)” — and the chat shows a notice at the switch. Picking a model takes the chat back to it at the next message.`],fixed:[`Uninstalling from Settings → Apps now also takes this PC off your account, exactly like “oona uninstall”: keep your chats and they stay readable on your other devices; delete them and their copies go too.`,`“oona uninstall” no longer gives up when the background service is stopped.`,`The “Updating OonaCode…” window shows again on the newest Windows 11 versions (24H2 and later).`]},{version:`0.3.171`,date:`2026-09-28`,platforms:[`win32`],added:[`Oonak Browser now picks its own control port from a range no developer tool uses by default, so it can no longer take a port that Shopify CLI or a dev server wants. If a program needs a particular port kept free, or you want the browser on a specific one, just ask the chat.`],fixed:[`File and folder names in a reply get their ▶, Open and Show in folder buttons only when they really exist on this PC. A bare file name is also looked for in the folder the reply named just before it.`,`Uninstalling OonaCode from Settings → Apps now removes all of it — the app, the command line and its background service — and asks whether to keep your chats. Installing again afterwards no longer says it is already installed. Your Claude Code and Claude app are never touched.`,`“oona uninstall” works again on Windows 11.`,`A chat “about” you wrote yourself no longer shows “stale”.`]},{version:`0.3.170`,date:`2026-09-28`,platforms:[`win32`],added:[`Your phone can now do from anywhere what this PC’s window does: switch each tool on or off per chat, see and control the conversations between your chats, read, edit and regenerate each chat’s “about”, and manage scheduled tasks. It needs this update on the PC and the next OonaCode app on the phone.`],fixed:[`“Send now” stays disabled and says “Sending now…” until the agent has taken the message — it can take a few seconds while the agent stops its current step, and a second press can no longer send it twice.`,`A message sent from your phone is confirmed by this PC, and the same message is never run twice when the phone sends it again after a lost connection.`]},{version:`0.3.169`,date:`2026-09-28`,platforms:[`win32`],added:[`Every chat now has an “about”: a short note, written in the background by a cheap helper model of the chat’s own provider, saying what the chat works on. Your other chats read it — with each chat’s folder and when it was last active — when they look for the right chat to ask. See it, edit it or press Regenerate in the session info panel.`,`View → What chats are about… (and a sidebar button) lists every chat’s about and what writing them cost, with a switch to turn it off and “Generate for all chats now”. The switch and its numbers are also in Settings → This PC.`],fixed:[`A chat can no longer be moved into your user folder or a drive root through a link or junction that points there — its project settings would have been your own Claude Code settings.`]},{version:`0.3.167`,date:`2026-09-27`,platforms:[`win32`],added:[`A chat can switch its own workspace. When the work belongs in another folder — a project you name that lives elsewhere, or a new project folder — the model proposes the switch and you answer Switch or Not now. It always asks you, even with “accept automatically” on, and the chat moves when its current step ends, with the conversation kept.`],fixed:[]},{version:`0.3.166`,date:`2026-09-27`,platforms:[`win32`],added:[],fixed:[`Typing in the message box while a chat is replying is no longer interrupted. With “accept automatically” on, an approval card flashed for an instant on some tool calls and took the cursor away from the box.`,`A permission card that appears while you are typing no longer takes the keyboard, so your next Space or Enter can never press Allow by accident.`]},{version:`0.3.165`,date:`2026-09-27`,platforms:[`win32`],added:[`Right-click a chat tab → Delete (in red, under “Close all tabs”) deletes that chat after asking, just like Delete in the sidebar.`,`Chats now use Oonak Browser, in a window you can see, for everything that needs a web browser — not Chrome, Edge or a hidden script browser — unless you name another browser. It runs without a window (headless) only when you ask for that.`],fixed:[`After an update, the background service comes back by itself. An update could leave it unable to restart, and the app then showed “OonaCode could not start its host service” even though it went on to open normally.`]},{version:`0.3.164`,date:`2026-09-27`,platforms:[`win32`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when OonaCode’s stored key cannot be opened for a moment. OonaCode used to replace the key and lose your sign-in; it now keeps the key and signs you back in by itself as soon as it opens.`]},{version:`0.3.163`,date:`2026-09-27`,platforms:[`linux`],added:[`Send now: a message you typed while the agent works has a Send now button while it waits. It stops what the agent is doing right now and sends your message immediately — the step that is running is cut. On the desktop and the phone.`,`Conversations → Map: see at a glance which chats are talking to each other. Each conversation is a hub with a line to each of its chats; working chats pulse; click a hub for its history or a chat to open it.`],fixed:[`A restart no longer signs this PC out when its security chip is slow to open OonaCode’s stored key. After a system update and reboot, the chip on some machines refuses for a while; OonaCode used to replace the key and lose your sign-in. It now keeps the key and signs you back in by itself as soon as the chip opens it.`]},{version:`0.3.162`,date:`2026-09-27`,added:[],fixed:[`A chat switched to another model knows which model it is. After a switch from Claude to DeepSeek, the model used to keep saying it was Claude — the chat history and Claude Code’s own prompt told it so.`,`Oonak Browser is offered only where it can run. An older OonaCode no longer lists a browser tool it cannot use, so the model does not spend tokens working around it — update to get the browser.`]},{version:`0.3.161`,date:`2026-09-27`,added:[`Settings → This PC → “Replace pictures older than N days”: screenshots and pasted pictures in your chat history are replaced by a short note once they are older than a year (you choose the number, or 0 to keep them). The words of every chat stay; the database stops growing with pictures. It runs by itself.`],fixed:[`The model, Build/Plan/Ask and effort pickers under the message box now look like the dropdowns they are.`,`Switches that are off are easy to see in dark mode.`,`Error messages show what went wrong in words, without raw tags or a provider’s JSON.`,`The ✕ that removes an attachment or a reply is round.`,`Pressing Stop, or an update cutting a turn, no longer files an automatic bug report.`]},{version:`0.3.160`,date:`2026-09-27`,added:[`On Windows, the agent can use a real browser. Ask it to open a site, read a page, click, fill in a form or take a screenshot, and it does it in Oonak Browser, in a window you can see. The first time, OonaCode asks once to install the browser (about 210 MB); after that it opens straight away.`,`Each chat has its own browser profile, so a site you sign in to stays signed in for that chat. Switch the browser off for a chat in its Tools menu.`],fixed:[]},{version:`0.3.159`,date:`2026-09-27`,added:[],fixed:[`A chat reopened after an update no longer says “turn complete” the instant you send a message and then answer anyway. The engine’s own note about work that stopped during the update used to be taken for the end of your turn, with the whole earlier conversation’s tokens on the line.`,`A background task that stopped because OonaCode restarted now says so in plain words, instead of “Orphaned by a previous Claude Code process exit”.`]},{version:`0.3.158`,date:`2026-09-27`,added:[`Every thought in a chat shows how many words it has, so you can tell at a glance whether there is anything to read.`],fixed:[`A thought with nothing in it — some models return only a signature for their thinking — now says “Thought · empty” and no longer opens onto a blank box.`,`A command the agent was allowed to run no longer leaves an “Allowed Bash (automatically)” line under its own card: the card already shows the command and its result. Refusals are still shown.`]},{version:`0.3.157`,date:`2026-09-27`,added:[`On Linux, OonaCode has its own signed apt and dnf repositories. Install the app with apt (Debian, Ubuntu, Mint) or dnf (Fedora, RHEL, Rocky, Alma) — the commands are on the download page — and your package manager keeps it up to date with the rest of the system.`,`Every Linux release is signed with the OonaCode release key, and the one-line installer checks that signature before it installs anything.`],fixed:[`On Linux, the menu bar is drawn in the window in the app’s own colours, and it switches between light and dark with the app instead of keeping the desktop’s theme until a restart.`,`Upgrading the .rpm no longer removes the oonacode command, and removing it no longer leaves empty folders behind.`]},{version:`0.3.156`,date:`2026-09-27`,added:[`Chats can talk to each other. Turn on “Talk to other chats” in a chat’s Tools menu, and its agent can find your other chats that have it on, read them, and ask them for help — one chat or a whole group. A chat that is closed wakes up to answer; a busy one answers when it finishes. The reply comes back to the chat that asked.`,`The Conversations window (in the sidebar) shows every conversation between your chats: who said what to whom, what each answer cost, and buttons to pause, resume, close or stop them all. Each conversation has a budget — 20 messages and 1,000,000 new tokens by default — and pauses itself when it is used up, so chats can never talk forever.`,`Hover over any tool in a chat’s Tools menu to read what it does, how it works, what it costs and how to turn it off.`],fixed:[`A chat woken in the background — by a scheduled task or another chat — shows as working in the sidebar even when it is not open in a tab.`,`A scheduled task no longer slips into a chat at the same moment you send it a message; yours always goes first.`,`A message sent from the terminal no longer waits forever when a chat’s history cannot be resumed and the restart fails. It now says why.`,`Notes OonaCode writes into a chat — a model change, a conversation paused — are still there when you reopen it.`,`When every Claude seat in the OonaCode pool is taken, a new chat now says the model is busy and to try again in a few minutes or pick another model, instead of “Something went wrong on our side”.`,`On Linux, the app tells you it is updating while it swaps itself, so there is no need to start it again.`,`On Linux, removing the .deb or .rpm leaves nothing running and nothing failing at the next login, and the one-line installer checks for free disk space before it changes anything.`]},{version:`0.3.155`,date:`2026-09-27`,added:[`OonaCode runs on Linux. One command installs the command line, the background service and the desktop app: curl -fsSL https://oonacode.oonak.ai/install.sh | bash. The AppImage, .deb and .rpm are on the download page too.`,`On Linux the app lives in the system tray as it does on Windows, follows your desktop’s light or dark theme, and gets its own entry in the applications menu.`,`Uninstalling on Linux removes the desktop app along with the rest, and asks whether to keep your chats for a future install.`],fixed:[`A window no longer stays on “Unauthorized” after the background service restarts with a new key. It reconnects by itself.`]},{version:`0.3.154`,date:`2026-09-26`,added:[],fixed:[`A chat waiting on a long job no longer loses its watcher. OonaCode used to close a chat’s engine ten minutes after the model last spoke, which stopped any Monitor or background command it had left running. The engine now stays up while such work runs, up to 12 hours.`,`A chat moved into a project, or whose project you edit, now follows the project’s instructions from its next message. It used to keep the ones it started with.`]},{version:`0.3.153`,date:`2026-09-25`,added:[],fixed:[`A very long chat no longer answers “Prompt is too long” after OonaCode restarts or updates. The engine was judging the chat’s size by a figure left over from before the restart, and now gets an accurate one.`,`If a message is ever refused as too long before the model has started on it, OonaCode sends it again by itself with a shorter history. You see your message once and then the answer, not an error.`]},{version:`0.3.152`,date:`2026-09-25`,added:[],fixed:[`Uninstalling the app from Windows’ Apps list no longer stops the command-line OonaCode on the same PC from starting after a restart.`]},{version:`0.3.151`,date:`2026-09-25`,added:[`Files the agent names in a chat are clickable. Audio and video play right in the chat with a small player, pictures open as a preview, and in the app every file can be opened in its own program or shown in its folder.`,`Uninstalling the app asks whether to keep your chats on this PC. Keeping them means a new install signs in and continues every chat.`],fixed:[`Installing and updating no longer fail with “The operation has timed out” on PCs whose network drops the newer internet addresses, nor while our server restarts for an update.`]},{version:`0.3.150`,date:`2026-09-25`,added:[],fixed:[`The fix in 0.3.149 for long, sleeping turns now really reaches the agent: the Monitor tool and the block on long waits are on for every chat.`,`A chat compacted after a long pause no longer pays to cache a conversation it is about to replace, and the agent keeps each tool call in its history exactly as it wrote it — both as Claude Code does.`]},{version:`0.3.149`,date:`2026-09-25`,added:[`The agent can watch a long job with the Monitor tool, as Claude Code does, and is woken the moment the job finishes.`],fixed:[`Long chats no longer spend their time asleep. With no way to watch a background job, the agent had been polling it with waits of four to eight minutes. One chat spent more than three and a half hours of a day sleeping, and turns ran for hours while the model worked for a fraction of that. The agent now gets the same working rules as Claude Code, and long waits are blocked.`]},{version:`0.3.148`,date:`2026-09-25`,added:[],fixed:[`A scheduled task that could not be sent — the PC had just restarted, the vault was still locked, the server was not reachable yet — waits and tries again instead of switching itself off. Pausing, editing or deleting a task while its prompt is being sent is no longer undone, and a scheduled prompt no longer lands in a chat whose engine is still starting.`,`A chat on your own DeepSeek key, or one switched with a typed “/model opus”, is no longer shown as withdrawn and locked. “/model fable” picks Claude Fable instead of the default model.`,`Moving a chat to another model no longer lowers its saved effort level to what the old model offered, and a one-off “oona --effort” is no longer saved as the chat’s level.`,`After you pick another model for a locked chat and send, the chat no longer flashes the lock again while the engine starts; if the start fails, your pick is kept.`,`Coming back from a file tab no longer jumps the chat to an old reply or reopens the search bar.`,`The hidden sidebar slides away again when the pointer leaves the window past its edge, and the keyboard no longer tabs through it while it is hidden. Clicking ⓘ in Settings opens its note instead of closing it.`,`Subagents write their prompt cache for five minutes, as Claude Code does for its subscribers; the chat itself keeps the hour. Their cache writes cost less.`]},{version:`0.3.147`,date:`2026-09-25`,added:[`A chat’s scheduled tasks sit beside its subagents: a clock badge says how many are live and when the next one runs, and opens the list — each task’s schedule, its next and last run, Pause and Delete. The tasks run on this PC.`],fixed:[`A prompt the scheduler sends into a chat reads as a “Scheduled task” line, not as your own message waiting in the queue.`,`A chat whose model is no longer offered shows that model in red and waits for you to pick another; its history stays, and the old model is not in the list any more.`,`The effort list follows the server within minutes, without restarting the app. A chat set to a level that has been switched off moves to the nearest one — ultracode becomes xhigh. Chats on your own Claude subscription have an effort picker again.`]},{version:`0.3.146`,date:`2026-09-25`,added:[`A Tools menu beside the model picker: switch OonaCode’s own tools on or off for each chat — browser, desktop and window control, clipboard, screen capture, Office documents and run-as-administrator. Each tool costs the model only a short line until it is used, and the menu shows how much. The first tools are marked Demo while they are tested with every model: a demo tool answers what it would have done, and does nothing on your PC yet.`],fixed:[]},{version:`0.3.145`,date:`2026-09-25`,added:[],fixed:[`Every request of every chat, on every model, is about 3,200 tokens smaller: the engine’s own “auto memory” instructions are gone. OonaCode starts each engine in a fresh private folder and deletes it afterwards, so the notes the model was told to keep there were thrown away when the chat went idle — the model spent tool calls writing memories it would never read. A project’s memory is OonaCode’s own and stays.`,`The engine’s claude.ai Artifact tools are switched off everywhere OonaCode runs it — the app, the terminal, VS Code, the phone, Telegram and the agent API.`]},{version:`0.3.144`,date:`2026-09-25`,added:[],fixed:[`Long chats on Claude models in the OonaCode pool keep their cache for an hour, as Claude Code does for its subscribers. A pause of more than five minutes no longer re-sends the whole conversation at the full cache-write price, which in a large chat was the most expensive part of coming back to it.`,`The session panel’s Context shows how big the conversation is now, not the total of every request the chat ever made — a long chat read “10.7M / 1.0M tokens”.`,`The message box keeps the cursor after you send, so you can go straight on typing the next message.`,`A paid chat’s background work (titles, reading web pages) no longer goes to a free model of the same vendor.`]},{version:`0.3.143`,date:`2026-09-24`,added:[`Search inside your chats: open the search in the chat list, press the sliders button and choose Whole chats. It looks through every message of every chat on this PC, and you choose whose words — yours, the model’s, or both — plus, if you like, the tools’ commands and output and the subagents’ conversations. Results show each message with the words lit; a click opens the chat with its search on them.`,`More search options, for both kinds of search: one project only, a time window (today, 7 or 30 days), match case and whole words.`],fixed:[`While you search the chat list, projects with no matching chat are hidden too.`]},{version:`0.3.142`,date:`2026-09-24`,added:[],fixed:[`A reply you sent shows as the same small chip it had in the message box — “Reply to” and the first few words — instead of the whole quoted text; the full quote appears when you rest the pointer on it, and a click jumps to the message it answers.`,`The model now knows a reply points back into the conversation: it is told the quoted lines are from the chat history, not new input, and whose words they were — its own earlier reply, your earlier message, a file, or a tool’s output.`,`When the chat list is narrow, its buttons wrap onto a second line instead of spilling out of it.`]},{version:`0.3.141`,date:`2026-09-24`,added:[`The chat list on the left can be made wider or narrower: drag its right edge (double-click it for the usual width).`,`The chat list can hide: press the pin in its header, the button at the top left, or View → Sidebar (Ctrl+B). While hidden it slides in when the pointer reaches the left edge of the window, and slides away when you leave it.`,`Search in the chat list is a single magnifier now; click it and the search box opens across the top. Escape or × clears it.`],fixed:[`Opening OonaCode right after a restart no longer leaves the OonaCode pool models out of the model list: if they cannot be read yet, OonaCode asks again by itself a few seconds later and the list fills in.`,`The Artificial Analysis scores (intelligence, coding, speed and benchmarks) show on every model in the model list again — including the models of your own Claude and SuperGrok subscriptions, which never had them.`,`A chat’s details card no longer appears on top of its right-click menu.`]},{version:`0.3.140`,date:`2026-09-24`,added:[`Reply is tidier: the message you reply to shows as a small chip above the message box with its first few words, instead of filling the box. Click the chip — or the quote in a sent reply — to jump to that message; the × removes it.`,`Right-click a project in the sidebar for its settings: Project settings… opens Projects with that project already selected. The gear beside a project’s “+” does the same, and a chat filed in a project offers it in its own menu too.`,`Link GitHub. Under a project’s Repositories (and in Settings → Providers), link your GitHub account once: the agent’s git and gh then clone, pull and push your private repositories on every PC of yours. You type a short code on github.com; the token stays in your encrypted vault and never reaches the OonaCode server. Public repositories need nothing.`],fixed:[]},{version:`0.3.139`,date:`2026-09-24`,added:[`Every setting now says what it does, and resting the pointer on the ⓘ beside it tells you where in OonaCode it applies and what it does not do.`,`Export chats… is in the File menu (and on the sidebar in a browser window) instead of in Settings.`,`With Remote access turned off on a PC, your phone, Telegram, the website and your other PCs still show it — online or not — marked “remote access off”, and opening it tells you to turn Remote access back on in OonaCode on that PC.`],fixed:[`Turning Remote access off now tells your other devices at once. Before, the PC was already unreachable from them, but they could not say why.`,`The settings of This PC save the moment you change them — nothing is lost by closing the dialog.`,`Settings that did nothing, or repeated another one, are gone: the default permission mode (each chat’s Build / Plan / Ask first picker decides), the agent-picker switch, the Git Bash path, the engine path and the extra allowed origins. The server address is shown, not edited — signing in sets it.`]},{version:`0.3.138`,date:`2026-09-24`,added:[`Projects have settings now, like the Claude app’s: a goal, the repositories the project works on, what a new chat in it starts on (model, effort and folder), a project memory the agent keeps up to date, and whether its chats may schedule work — and how often at most. All of it is in Projects, and a Claude app project you import brings its own.`,`OonaCode has a scheduler. Ask the agent to do something later or on a repeat — “check the build every morning at nine” — and it schedules it on this PC; when it is due, the prompt arrives in the chat, even if the chat had gone quiet. The Projects dialog and the chat’s info panel list what is scheduled, where you can pause, resume or delete it.`],fixed:[`Saving a project’s instructions now reaches its chats at their next message, instead of waiting until the chat happened to restart.`]},{version:`0.3.137`,date:`2026-09-24`,added:[],fixed:[`After a PC restart the app could ask for a "host token" and sign you out: two copies of the OonaCode background service started at once and fought over your session. Only one ever runs now, and the app never shows the token page — if its service is replaced it reconnects by itself.`,`The unlock screen stays put until you unlock, and says what went wrong in place — a wrong password, or a connection it is re-establishing — instead of jumping to another page.`,`A message with a picture sent while the agent was working stayed “queued”, and removing it said it was already sent. It now shows as read the moment the agent takes it, and a reopened chat shows it with its picture.`,`In the model’s questions, typing your own answer now clears the options you had picked, and picking an option clears what you typed — the answer sent is exactly the one you chose. The same on the phone, in the terminal and in Telegram.`]},{version:`0.3.136`,date:`2026-09-24`,added:[`Every model now has its own housekeeper — the small, fast model of the same maker that writes a chat’s titles and reads the web pages it fetches. On the OonaCode pool a MiMo v2.6 Pro chat uses MiMo v2.6 Flash, a Qwen chat Qwen3.8 Flash, a GLM chat GLM-5.3 Flash and a GPT-5 chat GPT-5 mini, instead of doing that work on the big model itself. A free model keeps its own, so it stays free.`],fixed:[]},{version:`0.3.135`,date:`2026-09-24`,added:[],fixed:[`Claude models on the OonaCode pool — Opus 5.5, Opus 5, Sonnet 5 and Fable 5.1 — now use their whole 1M context. A long chat no longer stops to summarise itself every ~170k tokens, and its subagents get the same window.`,`Reading a web page is quick again in a Claude chat: pages are read by Claude Haiku, as in Claude Code, instead of a helper that took about a minute a page.`,`Changing a chat’s model now moves its subagents and background helpers to the new model too; before, they stayed on the old one until the app restarted.`,`MiMo v2.5 and v2.5 Pro chats now use their full 1M context too.`]},{version:`0.3.134`,date:`2026-09-23`,added:[],fixed:[`On the Android app, the model’s questions can be answered again. They come one at a time — “Question 2 of 3” — with Back, Next and Skip, and Answer sends them to your PC. The card used to show only the first question, hide the rest below it and wait for all of them, so it could not be sent.`]},{version:`0.3.133`,date:`2026-09-23`,added:[`Bring your Claude desktop app projects across: File → Import chats from other coding agents now lists every project the Claude app has opened on this PC. Each one arrives as an OonaCode project of the same name — its goal, instructions and what Claude noted about it become the project’s instructions — with its project chat and one chat per thread filed under it, ready to carry on.`,`A Claude Code chat you moved into a Claude app project is filed under that project here too.`,`A thread you never opened in the Claude app still comes across, with its task and every reply the project chat saw; open it once in the Claude app and import again for its whole conversation.`],fixed:[`Cursor chats appear in the import list again — they had been left out since September 10.`]},{version:`0.3.132`,date:`2026-09-23`,added:[`Reply to any part of a chat: select some text (or just right-click a block), choose Reply, and it is quoted in your message box — type your answer under it. A quote from a file the agent read names the file.`,`Right-click in a chat: copy what you selected, copy a whole reply or tool output, copy a code block or a link, find the selected words in the chat, or select a block.`,`Search in a chat opens the block its match is in — a folded tool card, a thought, a finished agent’s work — and scrolls to the words themselves.`,`Search matches are now bright orange, the current one strongest, so they stand out on code too.`,`The file viewer shows pictures (PNG, JPEG, GIF, WebP, SVG and more), plays audio and video, and shows Markdown formatted, with a switch to the source.`,`Right-click a file or folder in the explorer to copy its path or delete it.`],fixed:[`Moving a chat to another folder or project while it was working could delete the folder it was working in, start two agents at once, or send your next message to the old folder.`,`The working line no longer says a chat may be stuck while it waits for your approval or answer, or right after you send a message, and it counts time correctly (no more "4m 60s").`,`A date line no longer says "Today" for yesterday’s messages when the app stays open past midnight.`,"Installing with npm (`npm i -g oonacode`) installs this version again; earlier npm releases carried an old program.",`The What’s new window could open again on the next start, showing the same update a second time.`,`An older OonaCode window or VS Code extension no longer resets settings it does not know about, such as your theme colours or which project groups you folded.`,`A new install no longer opens with a list of changes; this window now appears only after an update.`,`The notification switch for permissions now says it also covers the agent’s questions.`]},{version:`0.3.131`,date:`2026-09-23`,added:[`Claude Opus 5.5 is here — the newest Opus, and cheaper to run than Opus 5. Choose it in the model picker, from the OonaCode pool or on your own Claude subscription. It runs on the newer Claude Code engine (2.1.280) that this update brings.`,`Every block in a chat shows its time at the bottom right, in your local time — hover it for the full date — and a date line marks where each day starts.`,`A running chat tells you how long the agent has been quiet, and after five minutes that it may be stuck and what to do.`,`After every update, OonaCode now opens this window to show you what changed.`],fixed:[`A reply that streamed in live had no time on it until the chat was opened again.`,`Chats open in tabs could fail to come back after a restart if a setting changed while they were being restored.`]}];function Rl(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:zl(r.pre,i.pre)}function zl(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 Bl(e,t,n=Ll,r=null){if(!e||e===`0.0.0`)return[];let i=n.filter(t=>Rl(t.version,e)<=0&&(!r||!t.platforms||t.platforms.includes(r)));return[...t===null?i.filter(t=>Rl(t.version,e)===0):i.filter(e=>Rl(e.version,t)>0)].sort((e,t)=>Rl(t.version,e.version))}function Vl(e,t,n,r=Ll,i=null){if(!e||e===`0.0.0`)return{record:null,show:[]};let a=null;for(let e of r)(a===null||Rl(e.version,a)>0)&&(a=e.version);let o=a!==null&&Rl(e,a)>0?a:e;return{record:t===null||Rl(o,t)>0?o:null,show:t===null&&!n?[]:Bl(e,t,r,i)}}function Hl(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 Ul=`the user skipped the question`,Wl=`(the user skipped this question)`;function Gl(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 Kl(e,t,n={},r=new Set){let i={};return e.forEach((e,a)=>{if(r.has(a)){i[e.question]=Wl;return}let o=(n[a]??``).trim();i[e.question]=o||(t[a]??[]).join(`, `)}),i}function ql(e){let t=e.questions,n=t===1?`question`:`questions`,r=t===1?`the model’s question`:`the model’s questions`,i=t===1?`The model’s question was`:`The model’s questions were`;switch(e.outcome){case`answered`:{let r=e.answers?Object.values(e.answers):null,i=r?r.filter(e=>typeof e==`string`&&e!==``&&e!==`(the user skipped this question)`).length:t;return t>0&&i<t?`You answered ${i} of ${t} ${n}`:t===0?`You answered the model’s questions`:t===1?`You answered the model’s question`:`You answered ${t} ${n}`}case`skipped`:return`You skipped ${r}`;case`dismissed`:return`${i} dismissed`;case`unanswered`:return`${i} not answered — the turn ended`}}function Jl(e){if(!e||typeof e!=`object`)return null;let t=e.answers;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}var Yl=[`oauth`,`token`];function Xl(e){switch(e){case`signed-out`:return`Not signed in`;case`connecting`:return`Waiting for your sign-in…`;case`connected`:return`Connected`;case`expired`:return`Sign-in expired`;case`error`:return`Cannot reach the service`}}var Zl=W().refine(e=>/^https:\/\/[^\s]+$/i.test(e),`must be an https address`),Ql=Jo({vendor:W().min(1).max(60),mcpUrl:Zl,readOnlyQuery:ns(W(),W()).nullable(),auth:Jo({methods:Ko(is(Yl)).min(1),scopes:Ko(W()),offlineAccess:Bo(),token:Jo({label:W(),createUrl:Zl,note:W().nullable()}).nullable()}),tools:Jo({deny:Ko(W()),allowWrites:Ko(W()),featured:Ko(W()),maxResultChars:Io().int().min(1e3).max(2e5)}),cli:Jo({command:W().regex(/^[A-Za-z0-9._-]{1,40}$/),versionArg:W().regex(/^--?[A-Za-z0-9-]{1,20}$/),install:ns(W(),W()),login:Jo({command:W(),tokenEnv:W().nullable()}),purpose:W()}).nullable(),skills:Ko(Jo({name:W().regex(/^[a-z0-9][a-z0-9_-]{0,47}$/),source:Jo({repo:W().regex(/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/),ref:W().regex(/^[0-9a-f]{40}$/,`pin a full commit, never a branch`),path:W().refine(e=>!/(^|[\\/])\.\.([\\/]|$)|^[\\/]/.test(e),`relative path`)}),license:W(),exclude:Ko(W())})),docsUrl:Zl}).loose();function $l(e){if(e.toolName!==`ConnectorChange`)return null;let t=e.input;if(!t||typeof t!=`object`||typeof t.connector!=`string`||typeof t.vendor!=`string`||typeof t.tool!=`string`)return null;let n=t.arguments!==null&&typeof t.arguments==`object`&&!Array.isArray(t.arguments)?t.arguments:{};return{connector:t.connector,vendor:t.vendor,tool:t.tool,description:typeof t.description==`string`?t.description:``,arguments:n}}function eu(e){let t=Object.keys(e.arguments).slice(0,8);return`${e.vendor}: ${e.tool}${t.length>0?` (${t.join(`, `)})`:``}`}var tu=[`win32`,`linux`,`darwin`],nu=[`demo`,`live`],ru=[`allow`,`ask`],iu=[`string`,`number`,`integer`,`boolean`,`array`,`object`];function au(e){let t=e/1048576;return t>=100?`${Math.round(t)} MB`:t>=1?`${t.toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function ou(e){if(e.toolName!==`InstallToolPack`)return null;let t=e.input;return!t||typeof t!=`object`||typeof t.pack!=`string`||typeof t.name!=`string`||typeof t.version!=`string`||typeof t.sizeBytes!=`number`||typeof t.path!=`string`?null:{pack:t.pack,name:t.name,version:t.version,sizeBytes:t.sizeBytes,path:t.path}}function su(e,t){let n=t?.[e.slug];return typeof n==`boolean`?n:e.defaultOn}function cu(e,t){return e.filter(e=>su(e,t))}var lu={slug:48,name:80,entryTool:40,description:2e3,promptLine:1e3,details:8e3,actionDescription:1e3,params:30,paramName:48,paramDescription:400,enumValues:40,callArgKeys:20,callError:500,callBatch:100},uu=/^[A-Za-z0-9_-]+$/;function du(e){return typeof e==`string`&&e.length>0&&e.length<=lu.entryTool&&uu.test(e)}function fu(e){return Math.ceil(e.length/4)}function pu(e){return fu(`${e.entryTool} ${e.description}`)+55}function mu(e){return e.tokensPerRequest??pu(e)+(e.promptLine?fu(e.promptLine):0)}var hu=Jo({type:is(iu),required:Bo().optional(),enum:Ko(Xo([W(),Io()])).optional(),description:W().optional()}),gu=Jo({slug:W().min(1),description:W(),params:ns(W(),hu),permission:is(ru),sort:Io()}),_u=Jo({version:W(),url:W(),sha256:W(),sizeBytes:Io(),exe:W(),format:os(`zip`)}),vu=Jo({slug:W().min(1),name:W(),entryTool:W().refine(du,`not a valid tool name`),description:W(),promptLine:W().nullable(),details:W().nullable().optional(),status:is(nu),defaultOn:Bo(),sort:Io(),install:_u.nullable(),actions:Ko(gu),connector:Ql.nullable().optional().catch(null)}).loose();Jo({platform:is(tu),version:W(),packs:Ko(vu),refreshMinutes:Io()});var yu=is([`stdio`,`sse`,`http`]),bu=Jo({id:W().trim().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/i,`ID must be 1-64 alphanumeric, dash, dot, or underscore characters`),name:W().trim().min(1).max(100),description:W().max(500).optional(),transport:yu,command:W().min(1).max(500).optional(),args:Ko(W()).max(100).optional(),env:ns(W(),W()).optional(),url:W().url().max(2e3).optional(),headers:ns(W(),W()).optional(),defaultOn:Bo(),enabled:Bo().optional(),catalogId:W().max(100).optional()});bu.refine(e=>e.transport===`stdio`?typeof e.command==`string`&&e.command.length>0:typeof e.url==`string`&&e.url.length>0,{message:`stdio transport requires a command; sse/http transports require a url`}),bu.partial(),ns(W().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/i),Bo()).refine(e=>Object.keys(e).length<=128,`At most 128 MCP server switches`);function xu(e,t){if(e.enabled===!1)return!1;let n=t?t[e.id]:void 0;return typeof n==`boolean`?n:e.defaultOn}function Su(e,t,n){return{...e??{},[t]:n}}var Cu=[{id:`databases`,label:`Databases`},{id:`cloud`,label:`Cloud & DevOps`},{id:`productivity`,label:`Productivity`},{id:`analytics`,label:`Analytics`},{id:`ai`,label:`AI & Reasoning`},{id:`developer`,label:`Developer Tools`}],wu=[{id:`postgres`,name:`PostgreSQL`,description:`Inspect schemas, query tables, run read operations and analyze database structures.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-postgres`,"${connectionString}"],parameters:[{key:`connectionString`,label:`Database Connection URL`,placeholder:`postgresql://user:password@localhost:5432/dbname`,type:`password`,required:!0,target:`arg`,templateIndex:2}],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/postgres`},{id:`sqlite`,name:`SQLite`,description:`Direct SQL query and schema inspection for local SQLite database files.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-sqlite`,`--db-path`,"${dbPath}"],parameters:[{key:`dbPath`,label:`SQLite File Path`,placeholder:`C:/data/app.db or /var/data/app.db`,type:`string`,required:!0,target:`arg`,templateIndex:3}],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite`},{id:`supabase`,name:`Supabase`,description:`Manage Supabase Postgres database, migrations, edge functions, and project config.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-supabase`],parameters:[{key:`SUPABASE_ACCESS_TOKEN`,label:`Personal Access Token`,type:`password`,required:!0,target:`env`},{key:`SUPABASE_PROJECT_REF`,label:`Project Reference ID`,placeholder:`abcdefghijklmnopqrst`,type:`string`,required:!0,target:`env`}],docsUrl:`https://supabase.com/docs/guides/ai/mcp`},{id:`redis`,name:`Redis`,description:`Inspect keys, data structures, and execute Redis operational commands.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-redis`,"${redisUrl}"],parameters:[{key:`redisUrl`,label:`Redis Connection URL`,placeholder:`redis://localhost:6379`,type:`string`,required:!0,target:`arg`,templateIndex:2}]},{id:`mongodb`,name:`MongoDB Atlas`,description:`Query collections, inspect schemas, and interact with MongoDB Atlas databases.`,category:`databases`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-mongodb`,"${connectionString}"],parameters:[{key:`connectionString`,label:`MongoDB Connection URI`,placeholder:`mongodb+srv://user:pass@cluster.mongodb.net/dbname`,type:`password`,required:!0,target:`arg`,templateIndex:2}]},{id:`github`,name:`GitHub`,description:`Search repositories, manage issues, pull requests, files, and branches.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-github`],parameters:[{key:`GITHUB_PERSONAL_ACCESS_TOKEN`,label:`GitHub Personal Access Token (repo scope)`,placeholder:`ghp_...`,type:`password`,required:!0,target:`env`}],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/github`},{id:`gitlab`,name:`GitLab`,description:`Access GitLab merge requests, project branches, issues, and pipelines.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-gitlab`],parameters:[{key:`GITLAB_PERSONAL_ACCESS_TOKEN`,label:`GitLab Personal Access Token`,type:`password`,required:!0,target:`env`},{key:`GITLAB_API_URL`,label:`GitLab API URL (optional for self-hosted)`,placeholder:`https://gitlab.com/api/v4`,type:`string`,required:!1,target:`env`}]},{id:`cloudflare`,name:`Cloudflare`,description:`Inspect and manage Cloudflare Workers, KV namespaces, D1 databases, and DNS records.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@cloudflare/mcp-server-cloudflare`],parameters:[{key:`CLOUDFLARE_API_TOKEN`,label:`API Token`,type:`password`,required:!0,target:`env`},{key:`CLOUDFLARE_ACCOUNT_ID`,label:`Account ID`,type:`string`,required:!0,target:`env`}]},{id:`sentry`,name:`Sentry`,description:`Retrieve real-time application errors, stack traces, and issue analytics.`,category:`cloud`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-sentry`],parameters:[{key:`SENTRY_AUTH_TOKEN`,label:`Auth Token`,type:`password`,required:!0,target:`env`}]},{id:`google-drive`,name:`Google Drive`,description:`Search, read, and export documents, spreadsheets, and files from Google Drive.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-gdrive`],docsUrl:`https://github.com/modelcontextprotocol/servers/tree/main/src/gdrive`},{id:`slack`,name:`Slack`,description:`Read conversation history, search channel messages, and post updates to Slack channels.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-slack`],parameters:[{key:`SLACK_BOT_TOKEN`,label:`Bot User OAuth Token (xoxb-...)`,type:`password`,required:!0,target:`env`},{key:`SLACK_TEAM_ID`,label:`Slack Workspace Team ID`,type:`string`,required:!0,target:`env`}]},{id:`notion`,name:`Notion`,description:`Read and update Notion workspaces, databases, pages, and blocks.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-notion`],parameters:[{key:`NOTION_API_KEY`,label:`Internal Integration Secret (secret_...)`,type:`password`,required:!0,target:`env`}]},{id:`linear`,name:`Linear`,description:`Track issues, cycles, projects, and comments in Linear.`,category:`productivity`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-linear`],parameters:[{key:`LINEAR_API_KEY`,label:`Personal API Key`,type:`password`,required:!0,target:`env`}]},{id:`posthog`,name:`PostHog`,description:`Query product analytics funnels, trends, user session paths, and feature flags.`,category:`analytics`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@posthog/mcp-server-posthog`],parameters:[{key:`POSTHOG_API_KEY`,label:`Personal API Key`,type:`password`,required:!0,target:`env`},{key:`POSTHOG_PROJECT_ID`,label:`Project ID`,type:`string`,required:!0,target:`env`}]},{id:`brave-search`,name:`Brave Search`,description:`Search the live web and discover local points of interest via Brave Search API.`,category:`ai`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-brave-search`],parameters:[{key:`BRAVE_API_KEY`,label:`Brave Search API Key`,type:`password`,required:!0,target:`env`}]},{id:`memory-graph`,name:`Memory (Knowledge Graph)`,description:`Persistent knowledge-graph entity and relation memory across agent turns.`,category:`ai`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-memory`]},{id:`puppeteer`,name:`Puppeteer Headless Browser`,description:`Automate browser navigation, take page screenshots, and scrape dynamic web content.`,category:`ai`,transport:`stdio`,defaultCommand:`npx`,defaultArgs:[`-y`,`@modelcontextprotocol/server-puppeteer`]},{id:`remote-sse`,name:`Remote SSE MCP Server`,description:`Connect to any hosted remote MCP server over Server-Sent Events (SSE).`,category:`developer`,transport:`sse`,defaultUrl:`https://`,parameters:[{key:`url`,label:`SSE Endpoint URL`,placeholder:`https://mcp.example.com/sse`,type:`string`,required:!0,target:`url`},{key:`Authorization`,label:`Authorization Header (optional, e.g. Bearer token)`,placeholder:`Bearer ...`,type:`password`,required:!1,target:`header`}]},{id:`remote-http`,name:`Remote Streamable HTTP Server`,description:`Connect to any remote MCP server using standard Streamable HTTP transport.`,category:`developer`,transport:`http`,defaultUrl:`https://`,parameters:[{key:`url`,label:`HTTP Endpoint URL`,placeholder:`https://mcp.example.com/mcp`,type:`string`,required:!0,target:`url`},{key:`Authorization`,label:`Authorization Header (optional, e.g. Bearer token)`,placeholder:`Bearer ...`,type:`password`,required:!1,target:`header`}]}],Tu=[`No answer needed.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. Your final answer goes back to that chat by itself.`,`"Talk to other chats" is off in this chat: this message is from another chat's agent, not the person, and you cannot message chats. It asked for no answer, so nothing goes back.`,`Last hop of this chain: you cannot message chats in this turn; put what you have in your final answer.`];[`**Let this chat work together with your other chats.**`,``,`### What it does`,`- Finds your other chats on this PC and reads their recent messages.`,`- Sends one chat, or a group of chats, a message or a task.`,`- Brings their answers back to this chat, by itself.`,``,`### How it works`,`- A chat that is asleep is woken from its saved history. A busy one gets the message when its current turn ends, never in the middle of it.`,`- The other chat does the work with its own model, folder and tools. Its answer comes back here as a new message only when this chat asked for one.`,`- Several messages from one chat that wait for a busy chat are handed over together, in one turn, with one answer.`,`- Several chats can share one conversation (a group). An answer goes only to the chat that asked, so a group cannot multiply its own messages.`,`- A chat with this switch OFF can still be messaged by a chat that has it on. It does the work, and its final answer goes back to that chat when that chat asked for one. That is all it can do: it gets none of these tools, cannot message or read other chats, and its switch stays off.`,``,`### What it costs`,`- About 650 tokens on every request while it is on, read from the prompt cache. Nothing while it is off, even in a chat that is messaged.`,`- Every message makes the chat that receives it do a turn, which spends its own tokens.`,`- Switching it on or off in a chat that already has a conversation re-writes its prompt cache once.`,``,`### Safety limits`,`- Each conversation has a budget: 20 delivered messages and 1,000,000 new tokens by default (context read back from the prompt cache is not counted). Reaching either pauses the conversation, and the chats say so.`,`- A chain stops after 3 hops (a message caused by a message caused by a message).`,`- At most 5 messages between two chats and 20 from one chat in 10 minutes, and 10 waiting for any one chat. A chat cannot message itself.`,`- A conversation with no activity for 24 hours closes by itself.`,``,`### How to stop it`,`- Turn this switch off: the chat loses these tools, and what it sent and the answers it asked for pause. It still answers a chat that messages it.`,`- Or open the Conversations window and use Pause, Close or Stop all.`,``,`### Privacy`,`- Everything stays on your PC: the messages are kept in this PC's database, never on OonaCode's server.`,`- A message never grants anything. The other chat runs with its own permissions and asks you as usual.`,``,`Only a chat with this switch on can start a conversation; a chat with it off only answers.`].join(`
|
|
81
81
|
`);var Eu={hops:3,rateWindowMs:6e5,perPair:5,perSender:20,pendingPerTarget:10,idleCloseMs:864e5,messageChars:2e4,titleChars:80,conversationTitleChars:120,recipients:10,listChats:50,readMessages:50,budgetMessagesMax:1e4,budgetTokensMax:1e9},Du={message:`✉️ Message from chat "`,reply:`↩️ Reply from chat "`,continue:`↻ Continue the message from chat "`},Ou=`⚠ `,ku=`<local-command-stdout>`,Au=`</local-command-stdout>`,ju=/^[A-Za-z0-9._:-]{1,128}$/;function Mu(e){let t=(e??``).replace(/["“”]/g,`'`).replace(/\s+/g,` `).trim();if(!t)return`Untitled chat`;let n=Eu.titleChars;return t.length>n?`${t.slice(0,n-1).trimEnd()}…`:t}function Nu(e){return Mu(e.title?.trim()||e.firstPrompt?.trim()||`Chat ${e.id.slice(0,8)}`)}function Pu(e,t){let n=Tu.filter(e=>t===`reply`||e!==`No answer needed.`),r=e;for(let e=!0;e;){e=!1;for(let t of n){if(r===t)return``;r.startsWith(`${t}\n\n`)&&(r=r.slice(t.length+2),e=!0)}}return r}var Fu=/^\[conv:(\S+) chat:(\S+) host:(\S+) msg:(\S+?)(?: reply-to:(\S+?))?( reply expected)?\]$/;function Iu(e){if(typeof e!=`string`)return null;let t=e;t.startsWith(ku)&&t.endsWith(Au)&&(t=t.slice(22,t.length-23)),t=t.replace(/\r\n/g,`
|
|
82
82
|
`);let n=t.indexOf(`
|
|
83
83
|
`);if(n<0)return null;let r=t.slice(0,n),i=t.slice(n+1),a=i.indexOf(`
|
|
@@ -156,7 +156,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
156
156
|
`,a),o=t===-1?e.length:t,s=e.slice(a,o);if(/^\s{0,3}(```|~~~)/.test(s)&&(r=!r),!r&&s.trim()===``&&a>0&&o<=n&&(i=a-1),t===-1)break;a=t+1}return i<=0?{head:``,tail:e}:{head:e.slice(0,i),tail:e.slice(i)}}function Ez(e,t){let[n,r]=(0,v.useState)(e),i=(0,v.useRef)(e);i.current=e;let a=wz(e.length);return(0,v.useEffect)(()=>{if(!t)return;let e=window.setInterval(()=>r(i.current),a);return()=>window.clearInterval(e)},[t,a]),t?n:e}var Dz=new Set;function Oz(){let e=Dz,t=new Set;return{get:()=>e,set(n){if(n.size!==0||e.size!==0){e=n.size===0?Dz:n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>t.delete(e)}}}var kz=(0,v.createContext)({get:()=>Dz,set:()=>{},subscribe:()=>()=>{}});function Az(e){let t=(0,v.useContext)(kz),n=()=>{let n=t.get();return n.size===0?!1:typeof e==`string`?n.has(e):e.some(e=>n.has(e))};return(0,v.useSyncExternalStore)(t.subscribe,n,n)}function jz(e,t){let n=Az(e);return(0,v.useEffect)(()=>{n&&t(!0)},[n,t]),n}var Mz=6e4;function Nz(e){let t=new TextEncoder().encode(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode(...t.subarray(e,e+r));return btoa(n)}function Pz(e,t){let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t})}var Fz={"image/png":`png`,"image/jpeg":`jpg`,"image/gif":`gif`,"image/webp":`webp`,"image/bmp":`bmp`,"image/svg+xml":`svg`,"application/pdf":`pdf`,"text/plain":`txt`};function Iz(e,t){let n=Fz[t.split(`;`)[0]?.trim().toLowerCase()??``];return n?`${e}.${n}`:e}function Lz(e){let t=sh(e);return t?{name:t.name,path:t.path}:null}function Rz(){if(typeof window>`u`)return null;let e=window.oonacode;return e?.pathForFile?t=>{try{return e.pathForFile?.(t)||null}catch{return null}}:null}async function zz(e,t){if(typeof window>`u`||!window.oonacode?.openPath)return t?.(`error`,`This file can only be opened in the OonaCode desktop app, on the PC it is on.`),!1;try{let n=await window.oonacode.openPath(e);return n.ok?!0:(n.message&&t?.(n.shownInFolder?`info`:`error`,n.message),!1)}catch(e){return t?.(`error`,e instanceof Error?e.message:`The file could not be opened.`),!1}}function Bz(){if(typeof window>`u`)return null;let e=window.oonacode;return e?.openData?e.openData.bind(e):null}function Vz(){return Bz()!==null}function Hz(e,t){if(typeof URL>`u`||typeof URL.createObjectURL!=`function`)return t?.(`error`,`This browser cannot open the file — it has no way to hold it.`),!1;let n;try{n=URL.createObjectURL(Pz(e.base64,e.mediaType||`application/octet-stream`))}catch{return t?.(`error`,`The file could not be read.`),!1}let r=()=>setTimeout(()=>URL.revokeObjectURL?.(n),Mz);if(e.mediaType===`application/pdf`){let e=window.open(n,`_blank`);if(e){try{e.opener=null}catch{}return r(),!0}}let i=document.createElement(`a`);return i.href=n,i.download=e.name||`attachment`,i.rel=`noopener`,i.style.display=`none`,document.body.appendChild(i),i.click(),i.remove(),r(),!0}async function Uz(e,t){let n=Bz();if(!n)return Hz(e,t);try{let r=await n({name:e.name,mediaType:e.mediaType,base64:e.base64});return r.ok?!0:(r.message&&t?.(r.shownInFolder?`info`:`error`,r.message),!1)}catch(e){return t?.(`error`,e instanceof Error?e.message:`The file could not be opened.`),!1}}var Wz=.1,Gz=1.25,Kz={fit:!0,scale:1,x:0,y:0};function qz(e){return Number.isFinite(e)?Math.min(8,Math.max(Wz,e)):1}function Jz(e,t){return e.w<=0||e.h<=0||t.w<=0||t.h<=0?1:qz(Math.min(1,t.w/e.w,t.h/e.h))}function Yz(e,t){return qz(t===1?e*Gz:e/Gz)}function Xz(e){return!Number.isFinite(e)||e===0?1:Math.exp(-Math.max(-600,Math.min(600,e))*.002)}function Zz(e){return`${Math.round(e*100)}%`}function Qz(e,t,n){let r=(e,t)=>Math.max(0,(e-t)/2),i=r(t.w*e.scale,n.w),a=r(t.h*e.scale,n.h);return{x:Math.min(i,Math.max(-i,e.x))+0,y:Math.min(a,Math.max(-a,e.y))+0}}function $z(e,t,n,r,i){let a=qz(t),o=e.scale>0?a/e.scale:1,s=Qz({scale:a,x:n.x-(n.x-e.x)*o,y:n.y-(n.y-e.y)*o},r,i);return{fit:!1,scale:a,x:s.x,y:s.y}}function eB(e,t){return Math.round(e*100)===Math.round(t*100)}function tB(e,t){return eB(e,t)?{scale:eB(t,1)?2:1}:{fit:!0}}function nB({picture:e,onClose:t,notify:n,nav:r}){return(0,K.jsx)(hC,{open:e!==null,title:e?.name||`Picture`,onClose:t,full:!0,children:e?(0,K.jsx)(rB,{picture:e,notify:n,nav:r},e.id??e.name):null})}function rB({picture:e,notify:t,nav:n}){let r=(0,v.useRef)(null),[i,a]=(0,v.useState)({w:0,h:0}),[o,s]=(0,v.useState)({w:0,h:0}),[c,l]=(0,v.useState)(Kz),[u,d]=(0,v.useState)(!1),f=Jz(i,o),p=c.fit?f:c.scale,m=c.fit?{x:0,y:0}:Qz(c,i,o),h=i.w*p>o.w+.5||i.h*p>o.h+.5,g=(0,v.useRef)({scale:p,pan:m,natural:i,box:o,fit:f});g.current={scale:p,pan:m,natural:i,box:o,fit:f},(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>s({w:e.clientWidth,h:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let _=(0,v.useCallback)((e,t)=>{let n=g.current;l($z({scale:n.scale,x:n.pan.x,y:n.pan.y},e,t,n.natural,n.box))},[]),y=(0,v.useCallback)(e=>_(Yz(g.current.scale,e),{x:0,y:0}),[_]),b=(0,v.useCallback)(()=>l(Kz),[]),x=(0,v.useCallback)(()=>_(1,{x:0,y:0}),[_]),S=(e,t)=>{let n=r.current?.getBoundingClientRect();return n?{x:e-(n.left+n.width/2),y:t-(n.top+n.height/2)}:{x:0,y:0}};(0,v.useEffect)(()=>{let e=r.current;if(!e)return;let t=t=>{t.preventDefault();let n=e.getBoundingClientRect(),r={x:t.clientX-(n.left+n.width/2),y:t.clientY-(n.top+n.height/2)},i=t.deltaMode===1?t.deltaY*16:t.deltaY;_(g.current.scale*Xz(i),r)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[_]),(0,v.useEffect)(()=>{let e=e=>{if(!(e.ctrlKey||e.metaKey||e.altKey)){if(e.key===`+`||e.key===`=`)y(1);else if(e.key===`-`||e.key===`_`)y(-1);else if(e.key===`0`)b();else if(e.key===`1`)x();else if(e.key===`ArrowLeft`&&n?.onPrev)n.onPrev();else if(e.key===`ArrowRight`&&n?.onNext)n.onNext();else return;e.preventDefault()}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[y,b,x,n]);let C=(0,v.useRef)(null),w=e=>{if(!(e.button!==0||!h)){C.current={from:{x:e.clientX,y:e.clientY},origin:{...g.current.pan}},d(!0);try{e.currentTarget.setPointerCapture?.(e.pointerId)}catch{}}},T=e=>{let t=C.current;if(!t)return;let n=g.current,r=Qz({scale:n.scale,x:t.origin.x+(e.clientX-t.from.x),y:t.origin.y+(e.clientY-t.from.y)},n.natural,n.box);l({fit:!1,scale:n.scale,x:r.x,y:r.y})},E=()=>{C.current=null,d(!1)},D=e=>{let t=g.current,n=tB(t.scale,t.fit);`fit`in n?b():_(n.scale,S(e.clientX,e.clientY))},O=Vz(),k=`data:${e.mediaType||`image/png`};base64,${e.base64}`;return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,"data-testid":`image-viewer`,children:[(0,K.jsxs)(`div`,{role:`toolbar`,"aria-label":`Picture zoom`,className:`flex flex-wrap items-center gap-1.5`,"data-testid":`viewer-toolbar`,children:[(0,K.jsx)(X,{size:`sm`,"aria-label":`Zoom out`,title:`Zoom out (-)`,"data-testid":`viewer-zoom-out`,disabled:p<=Wz+1e-9,onClick:()=>y(-1),children:`−`}),(0,K.jsx)(`span`,{className:`min-w-[3.5rem] text-center text-xs tabular-nums text-fg-muted`,"aria-live":`polite`,"data-testid":`viewer-percent`,children:Zz(p)}),(0,K.jsx)(X,{size:`sm`,"aria-label":`Zoom in`,title:`Zoom in (+)`,"data-testid":`viewer-zoom-in`,disabled:p>=8-1e-9,onClick:()=>y(1),children:`+`}),(0,K.jsx)(X,{size:`sm`,"aria-label":`Fit to window`,title:`Fit to window (0)`,"data-testid":`viewer-fit`,"aria-pressed":c.fit,onClick:b,children:`Fit`}),(0,K.jsx)(X,{size:`sm`,"aria-label":`Actual size`,title:`Actual size (1)`,"data-testid":`viewer-actual`,"aria-pressed":!c.fit&&eB(p,1),onClick:x,children:`100%`}),n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(X,{size:`sm`,"aria-label":`Previous picture`,title:`Previous picture (←)`,"data-testid":`viewer-prev`,disabled:!n.onPrev,onClick:()=>n.onPrev?.(),children:`‹`}),(0,K.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-muted`,"aria-live":`polite`,"data-testid":`viewer-position`,children:[n.index+1,` / `,n.total]}),(0,K.jsx)(X,{size:`sm`,"aria-label":`Next picture`,title:`Next picture (→)`,"data-testid":`viewer-next`,disabled:!n.onNext,onClick:()=>n.onNext?.(),children:`›`})]}):null,(0,K.jsx)(`span`,{className:`mx-1 min-w-0 flex-1 truncate text-xs text-fg-faint`,title:e.name,children:e.name}),(0,K.jsx)(X,{size:`sm`,"aria-label":O?`Open externally`:`Download`,title:O?`Open in the program your computer gives this picture`:`Download the picture`,"data-testid":`viewer-open`,onClick:()=>void Uz(e,t),children:O?`Open externally`:`Download`})]}),(0,K.jsx)(`div`,{ref:r,className:`relative min-h-0 flex-1 touch-none select-none overflow-hidden rounded-md border border-border bg-black/70`,style:{cursor:h?u?`grabbing`:`grab`:`zoom-in`},"data-testid":`viewer-canvas`,onPointerDown:w,onPointerMove:T,onPointerUp:E,onPointerCancel:E,onDoubleClick:D,children:(0,K.jsx)(`img`,{src:k,alt:e.name,draggable:!1,"data-testid":`viewer-image`,"data-scale":p.toFixed(4),onLoad:e=>a({w:e.currentTarget.naturalWidth,h:e.currentTarget.naturalHeight}),onDragStart:e=>e.preventDefault(),style:{position:`absolute`,left:`50%`,top:`50%`,maxWidth:`none`,maxHeight:`none`,...i.w>0?{width:i.w,height:i.h}:{},transform:`translate(-50%, -50%) translate(${m.x}px, ${m.y}px) scale(${p})`,transformOrigin:`center`}})}),(0,K.jsxs)(`p`,{className:`text-[11px] text-fg-faint`,children:[`Scroll to zoom · drag to move · double-click for Fit / 100% · + − 0 on the keyboard`,n?` · ← → for the previous / next picture`:``]})]})}function iB(e){if(e.type!==`image`)return null;let t=e.source;return t?.type===`base64`&&t.data?{mediaType:t.media_type||`image/png`,base64:t.data,url:null}:t?.url?{mediaType:t.media_type||`image/png`,base64:null,url:t.url}:null}function aB(e){if(!e||typeof e.content==`string`)return null;for(let t of e.content){let e=iB(t);if(e)return e}return null}function oB(e){return e.base64===null?e.url??``:`data:${e.mediaType};base64,${e.base64}`}function sB(e){return e.split(/[\\/]+/).filter(Boolean).at(-1)??e}function cB(e,t,n){let r=e===`Read`||e===`view_file`?t?.file_path??t?.AbsolutePath??t?.path:null;return typeof r==`string`&&r.trim()?sB(r.trim()):Iz(`picture`,n)}function lB(e,t){let n=e?gv(e):``,r=(/^Saved (.+?) \(\d/.exec(n)??/^Picture made by agy: (.+)$/m.exec(n))?.[1]?.trim();return r?sB(r):Iz(`picture`,t)}function uB(e){let t=e?gv(e):``,n=/^Saved (.+?) \(\d[^)]*\) in the chat folder: /.exec(t),r=n?.[1]?.trim();if(!n||!r)return null;let i=t.slice(n[0].length),a=i.indexOf(r),o;return o=a>0&&/[\\/]/.test(i[a-1])?i.slice(0,a+r.length):/^(.+?)\.(?=\s|$)/.exec(i)?.[1]??i.split(`
|
|
157
157
|
`)[0]??null,o=o?.trim()??null,!o||!(/^[A-Za-z]:[\\/]/.test(o)||o.startsWith(`/`)||o.startsWith(`\\\\`))?null:{name:sB(r),path:o}}var dB=360,fB=376,pB=398,mB=8;function hB(e,t,n){let r=Math.max(mB,Math.min(t+12,n.w-fB-mB));return n.h-e.bottom-6>=pB?{left:r,top:e.bottom+6}:e.top-6>=pB?{left:r,bottom:n.h-e.top+6}:{left:r,top:Math.max(mB,n.h-pB-mB)}}function gB({picture:e,name:t,place:n}){let r=(0,v.useMemo)(()=>oB(e),[e]);return(0,aC.createPortal)((0,K.jsxs)(`div`,{role:`tooltip`,"data-testid":`picture-preview`,className:`pointer-events-none fixed z-[60] rounded-lg border border-border bg-surface p-2 text-xs text-fg shadow-lg`,style:{left:n.left,top:n.top,bottom:n.bottom,maxWidth:fB},children:[(0,K.jsx)(`img`,{src:r,alt:t,"data-testid":`picture-preview-image`,draggable:!1,className:`block rounded object-contain`,style:{maxWidth:dB,maxHeight:dB}}),(0,K.jsx)(`div`,{className:`mt-1 truncate text-fg-muted`,"data-testid":`picture-preview-name`,title:t,children:t})]}),document.body)}function _B(){return typeof window>`u`||typeof window.matchMedia!=`function`||!window.matchMedia(`(hover: none)`).matches}var vB={};function yB(e,t){let[n,r]=(0,v.useState)(null),i=(0,v.useRef)(!1),a=e!==null&&n!==null;if((0,v.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&r(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),!e)return{handlers:vB,popup:null};let o=(e,t)=>{let n=e.getBoundingClientRect();r(hB({top:n.top,bottom:n.bottom},t??n.left+24,{w:window.innerWidth,h:window.innerHeight}))};return{handlers:{onMouseEnter:e=>{_B()&&o(e.currentTarget,e.clientX)},onMouseLeave:()=>r(null),onMouseDown:()=>{i.current=!0},onFocus:e=>{_B()&&!i.current&&o(e.currentTarget,null)},onBlur:()=>{i.current=!1,r(null)},onClick:()=>r(null)},popup:n?(0,K.jsx)(gB,{picture:e,name:t,place:n}):null}}var bB=(0,v.memo)(function({block:e,toolName:t,input:n,onOpen:r}){let i=(0,v.useMemo)(()=>iB(e),[e]),a=(0,v.useMemo)(()=>i?oB(i):``,[i]);if(!i)return(0,K.jsx)(`div`,{children:`[image]`});let o=cB(t,n,i.mediaType),s=(0,K.jsx)(`img`,{src:a,alt:`tool result`,className:`block max-h-64 max-w-full rounded border border-border`});if(i.base64===null)return s;let c=i.base64;return(0,K.jsx)(`button`,{type:`button`,"aria-label":`Open ${o} in the viewer`,title:`Open in the viewer`,"data-testid":`tool-result-picture`,onClick:()=>r({name:o,mediaType:i.mediaType,base64:c}),className:`block max-w-full cursor-zoom-in rounded p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:s})});function xB({picture:e,onClose:t}){let n=(0,v.useContext)(eL).notify??void 0;return(0,K.jsx)(nB,{picture:e,onClose:t,notify:n})}function SB(e){return typeof e==`string`?e:null}function CB(e,t){if(!t)return``;switch(e){case`Bash`:case`PowerShell`:case`run_command`:return wv((SB(t.CommandLine)??SB(t.command)??``).replace(/\s+/g,` `),90);case`Read`:case`view_file`:case`Write`:case`write_to_file`:case`Edit`:case`replace_file_content`:case`multi_replace_file_content`:case`MultiEdit`:case`NotebookEdit`:return SB(t.AbsolutePath)??SB(t.file_path)??SB(t.TargetFile)??SB(t.notebook_path)??SB(t.path)??``;case`Glob`:case`Grep`:case`grep_search`:case`find_by_name`:return`${SB(t.pattern)??SB(t.query)??``}${SB(t.path)??SB(t.dir_path)?` in ${SB(t.path)??SB(t.dir_path)}`:``}`;case`list_dir`:return SB(t.DirectoryPath)??SB(t.dir_path)??SB(t.path)??``;case`Task`:case`Agent`:return SB(t.description)??wv(SB(t.prompt)??``,80);case`WebFetch`:case`WebSearch`:return SB(t.url)??SB(t.query)??``;case`TodoWrite`:return`update todo list`;case Km:return wv(SB(t.title)??``,80);case Ru:case Bu:return wv((SB(t.prompt)??SB(t.file)??``).replace(/\s+/g,` `),60);default:{let e=Object.entries(t).find(([,e])=>typeof e==`string`);return e?wv(String(e[1]).replace(/\s+/g,` `),80):``}}}var wB=(0,v.memo)(function({oldText:e,newText:t}){let n=(0,v.useMemo)(()=>e.split(`
|
|
158
158
|
`),[e]),r=(0,v.useMemo)(()=>t.split(`
|
|
159
|
-
`),[t]);return(0,K.jsxs)(`pre`,{className:`lazy-block m-0 max-h-72 overflow-auto rounded-md border border-border bg-code-bg p-2 font-mono text-[12.5px] leading-relaxed`,children:[n.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-danger-soft text-danger`,children:[(0,K.jsx)(`span`,{className:`select-none pr-2 text-fg-faint`,children:`-`}),e]},`o${t}`)),r.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-ok-soft text-ok`,children:[(0,K.jsx)(`span`,{className:`select-none pr-2 text-fg-faint`,children:`+`}),e]},`n${t}`))]})}),TB=CF;function EB({name:e,input:t,inputJson:n,streaming:r}){if(!t)return n?(0,K.jsx)(gL,{code:n,language:`json`,maxHeight:`14rem`}):r?(0,K.jsx)(`div`,{className:`text-xs text-fg-faint`,children:`Receiving arguments…`}):null;switch(e){case`Bash`:case`PowerShell`:case`run_command`:{let n=SB(t.Description)??SB(t.description);return(0,K.jsxs)(`div`,{children:[n?(0,K.jsx)(`div`,{className:`mb-1 text-xs text-fg-muted`,children:n}):null,(0,K.jsx)(gL,{code:SB(t.CommandLine)??SB(t.command)??Tv(t),language:e===`PowerShell`?`powershell`:`bash`,maxHeight:`14rem`})]})}case`Edit`:case`replace_file_content`:case`multi_replace_file_content`:{let e=SB(t.TargetFile)??SB(t.file_path),n=SB(t.TargetContent)??SB(t.old_string)??``,r=SB(t.ReplacementContent)??SB(t.new_string)??``;return(0,K.jsxs)(`div`,{className:`space-y-1`,children:[e?(0,K.jsxs)(`div`,{className:`font-mono text-xs text-fg-muted`,children:[e,t.replace_all?` (replace all)`:``]}):null,(0,K.jsx)(wB,{oldText:n,newText:r})]})}case`Write`:case`write_to_file`:{let e=SB(t.TargetFile)??SB(t.file_path),n=SB(t.CodeContent)??SB(t.content)??``;return(0,K.jsxs)(`div`,{children:[e?(0,K.jsx)(`div`,{className:`mb-1 font-mono text-xs text-fg-muted`,children:e}):null,(0,K.jsx)(gL,{code:n,language:TB(e),maxHeight:`18rem`})]})}case`Read`:case`view_file`:{let e=SB(t.AbsolutePath)??SB(t.file_path)??SB(t.path)??``,n=[t.offset===void 0?null:`offset ${String(t.offset)}`,t.limit===void 0?null:`limit ${String(t.limit)}`,t.StartLine===void 0?null:`lines ${String(t.StartLine)}${t.EndLine===void 0?``:`-${String(t.EndLine)}`}`].filter(Boolean).join(`, `);return(0,K.jsxs)(`div`,{className:`font-mono text-xs text-fg-muted`,children:[e,n?` (${n})`:``]})}default:return(0,K.jsx)(gL,{code:Tv(t),language:`json`,maxHeight:`14rem`})}}function DB({blocks:e,toolName:t,input:n,onOpenPicture:r,hideImages:i}){return(0,K.jsx)(`div`,{className:`space-y-1`,children:e.map((e,a)=>{if(e.type===`image`&&i)return null;if(e.type===`image`)return(0,K.jsx)(bB,{block:e,toolName:t,input:n,onOpen:r},a);let o=e.type===`text`?e.text??``:`[${e.type}]`;return(0,K.jsx)(`pre`,{className:`pre-wrap m-0 font-mono text-[12.5px] leading-relaxed`,children:o},a)})})}var OB=`Code snippet`;function kB(e){return e===`unknown`?OB:e===`view_file`?`View file`:e===`write_to_file`?`Write`:e===`replace_file_content`||e===`multi_replace_file_content`?`Edit`:e===`run_command`?`Run command`:e===`grep_search`?`Grep`:e===`find_by_name`?`Find`:e===`list_dir`?`List directory`:e===Hm?Um:e===Km?qm:e===Ru?zu:e===Bu?Vu:e===Hu?Uu:e}var AB={streaming:`preparing`,pending:`needs approval`,running:`running`,done:`done`,error:`error`,denied:`denied`,skipped:`skipped`,cancelled:`cancelled`};function jB({status:e}){switch(e){case`streaming`:case`running`:return(0,K.jsx)(Y.Spinner,{className:`w-3.5 h-3.5 text-accent`});case`pending`:return(0,K.jsx)(Y.Shield,{className:`w-3.5 h-3.5 text-warn`});case`done`:return(0,K.jsx)(Y.Check,{className:`w-3.5 h-3.5 text-ok`});case`error`:case`denied`:return(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5 text-danger`});case`skipped`:case`cancelled`:return(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5 text-fg-faint`})}}function MB(e){for(let t of e)if(t.item.kind===`permission`&&t.item.status===`pending`||t.children.length>0&&MB(t.children))return!0;return!1}var NB=(0,v.memo)(function({node:e,renderChildren:t}){let n=e.item,r=n.status===`error`||n.status===`denied`,[i,a]=(0,v.useState)(null),o=jz(n.id,a),s=MB(e.children),c=JL.has(n.name)&&(n.status===`done`||n.status===`cancelled`),l=n.name===`Read`||n.name===`view_file`,u=(0,v.useMemo)(()=>{if(!l||!n.input)return null;let e=SB(n.input.AbsolutePath)??SB(n.input.file_path)??SB(n.input.path);return e&&e.trim()?e.trim():null},[l,n.input]),d=(0,v.useMemo)(()=>u?ud(u):null,[u]),f=(0,v.useContext)(eL),p=(0,v.useMemo)(()=>{if(!u)return null;if(/^[A-Za-z]:[\\/]/.test(u)||u.startsWith(`/`))return u;if(f.cwd){let e=f.platform===`win32`||f.cwd.includes(`\\`)?`\\`:`/`;return`${f.cwd.replace(/[\\/]+$/,``)}${e}${u}`}return u},[u,f.cwd,f.platform]),m=s||o||(i??(r||n.status===`pending`||e.children.length>0&&!c)),h=(0,v.useMemo)(()=>CB(n.name,n.input),[n.name,n.input]),g=(0,v.useMemo)(()=>l?aB(n.result):null,[l,n.result]),_=yB(g,cB(n.name,n.input,g?.mediaType??`image/png`)),{onClick:y,...b}=_.handlers,x=(0,v.useMemo)(()=>n.name===Ru?aB(n.result):null,[n.name,n.result]),S=(0,v.useMemo)(()=>x?oB(x):``,[x]),C=(0,v.useMemo)(()=>x?lB(n.result,x.mediaType):``,[x,n.result]),w=(0,v.useMemo)(()=>(n.name===Bu||n.name===Hu)&&n.result&&!n.result.isError?uB(n.result):null,[n.name,n.result]),[T,E]=(0,v.useState)(null),D=(0,v.useMemo)(()=>m?gv(n.result):``,[m,n.result]),O=n.result!==null&&!n.result.isError&&(typeof n.result.content==`string`&&/^Async agent launched/i.test(n.result.content.trimStart())||n.result.structured?.status===`async_launched`),k=n.durationMs===null?n.elapsedSec!==null&&!n.result?_v(n.elapsedSec*1e3):``:_v(n.durationMs);return(0,K.jsxs)(`div`,{"data-testid":`tool-${n.toolUseId}`,className:G(`my-1.5 overflow-hidden rounded-lg border bg-surface text-sm`,r?`border-danger/50`:n.status===`pending`?`border-warn/60`:`border-border`),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":m,onClick:()=>{y?.(),a(s?null:!m)},...b,className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-surface-2`,children:[(0,K.jsx)(jB,{status:n.status}),(0,K.jsx)(Y.Tool,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:kB(n.name)}),h?(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg-muted`,children:h}):(0,K.jsx)(`span`,{className:`flex-1`}),k?(0,K.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:k}):null,(0,K.jsx)(Q,{tone:r?`danger`:n.status===`pending`?`warn`:n.status===`done`?`ok`:`neutral`,children:AB[n.status]}),(0,K.jsx)(Y.Chevron,{open:m,className:`w-3.5 h-3.5 text-fg-faint`})]}),x&&!r?(0,K.jsxs)(`div`,{className:`border-t border-border px-2.5 py-2`,"data-testid":`tool-generated`,children:[x.base64===null?(0,K.jsx)(`img`,{src:S,alt:C,className:`block rounded border border-border object-contain`,style:{maxWidth:280,maxHeight:280}}):(0,K.jsx)(`button`,{type:`button`,"aria-label":`Open ${C} in the viewer`,title:`${C} — open in the viewer`,"data-testid":`tool-generated-picture`,onClick:()=>E({name:C,mediaType:x.mediaType,base64:x.base64}),className:`block cursor-zoom-in rounded p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,K.jsx)(`img`,{src:S,alt:C,draggable:!1,className:`block rounded border border-border object-contain`,style:{maxWidth:280,maxHeight:280}})}),(0,K.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-muted`,title:C,children:C})]}):null,w?(0,K.jsxs)(`div`,{className:`border-t border-border px-2.5 py-2`,"data-testid":`tool-generated-media`,children:[f.grant&&f.sessionId&&!f.remote?(0,K.jsx)(uL,{sessionId:f.sessionId,path:w.path,kind:n.name===Bu?`video`:`audio`,grant:f.grant,autoPlay:!1}):null,(0,K.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-muted`,title:w.path,children:w.name})]}):null,m?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border px-2.5 py-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[11px] uppercase tracking-wide text-fg-faint`,children:`Input`}),(0,K.jsx)(EB,{name:n.name,input:n.input,inputJson:n.inputJson,streaming:n.status===`streaming`})]}),e.children.length>0?(0,K.jsxs)(`div`,{className:`border-l-2 border-think/40 pl-2`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-[11px] uppercase tracking-wide text-think`,children:`Subagent`}),t(e.children)]}):null,n.result&&O?(0,K.jsx)(`div`,{className:`text-xs text-fg-faint`,"data-testid":`tool-launch-note`,children:`Launched in the background — the chat is told when it finishes.`}):n.result?(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] uppercase tracking-wide text-fg-faint`,children:[(0,K.jsx)(`span`,{children:n.result.isError?`Error`:`Result`}),D?(0,K.jsxs)(`span`,{className:`normal-case`,children:[D.length.toLocaleString(),` chars`]}):null]}),d&&!n.result.isError&&f.grant&&f.sessionId&&p&&(d.kind===`audio`||d.kind===`video`||d.kind===`image`&&!g)?(0,K.jsx)(`div`,{className:`mb-2`,"data-testid":`tool-inline-media`,children:(0,K.jsx)(uL,{sessionId:f.sessionId,path:p,kind:d.kind,grant:f.grant})}):null,(0,K.jsx)(`div`,{className:G(`lazy-block max-h-72 overflow-auto rounded-md border p-2`,n.result.isError?`border-danger/40 bg-danger-soft text-danger`:`border-border bg-code-bg`),children:typeof n.result.content==`string`?(0,K.jsx)(`pre`,{className:`pre-wrap m-0 font-mono text-[12.5px] leading-relaxed`,children:n.result.content.replace(/<\/?tool_use_error>/g,``).trim()||`(empty)`}):(0,K.jsx)(DB,{blocks:n.result.content,toolName:n.name,input:n.input,onOpenPicture:E,hideImages:x!==null})})]}):n.status===`cancelled`?(0,K.jsx)(`div`,{className:`text-xs text-fg-faint`,children:`No result (turn ended before the tool finished).`}):null]}):null,_.popup,T?(0,K.jsx)(xB,{picture:T,onClose:()=>E(null)}):null]})}),PB=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(null),r=jz(e.id,n)||(t??e.streaming),i=Ez(e.text,e.streaming),a=IB(i),o=(0,v.useMemo)(()=>r||e.streaming||e.redacted?``:FB(e.text),[r,e.streaming,e.redacted,e.text]);return!e.streaming&&!e.redacted&&a===0?null:!e.streaming&&e.redacted?(0,K.jsxs)(`div`,{className:`my-1.5 flex items-center gap-2 rounded-lg border border-think/20 bg-think-soft/20 px-2.5 py-1.5 text-sm text-think/70`,"data-testid":`thought-empty`,title:`The provider hid this thought: only an encrypted copy came back, which the model reads and nobody else can.`,children:[(0,K.jsx)(Y.Brain,{className:`w-3.5 h-3.5`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Redacted thinking`}),(0,K.jsx)(`span`,{className:`text-xs opacity-70`,children:`hidden`})]}):(0,K.jsxs)(`div`,{className:`my-1.5 rounded-lg border border-think/30 bg-think-soft/40 text-sm`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>n(!r),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-think`,children:[e.streaming?(0,K.jsx)(Y.Spinner,{className:`w-3.5 h-3.5`}):(0,K.jsx)(Y.Brain,{className:`w-3.5 h-3.5`}),(0,K.jsx)(`span`,{className:`font-medium`,children:e.redacted?`Redacted thinking`:e.streaming?`Thinking…`:`Thought`}),a?(0,K.jsxs)(`span`,{className:`text-xs opacity-70`,"data-testid":`thought-words`,children:[a.toLocaleString(`en-US`),` `,a===1?`word`:`words`]}):null,e.durationMs!==null&&e.durationMs!==void 0?(0,K.jsx)(`span`,{className:`text-xs tabular-nums opacity-70`,"data-testid":`thought-duration`,title:`How long the model spent on this thought`,children:_v(e.durationMs)}):null,o?(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg-muted`,"data-testid":`thought-preview`,children:[`: `,o]}):(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:r,className:`w-3.5 h-3.5 opacity-70`})]}),r&&!e.redacted?(0,K.jsx)(`div`,{className:G(`border-t border-think/20 px-3 py-2 text-fg-muted`,e.streaming&&`caret`),children:e.streaming?(0,K.jsx)(`div`,{className:`pre-wrap`,"data-testid":`thinking-stream`,children:i}):(0,K.jsx)(CL,{text:e.text})}):null]})});function FB(e){return e.slice(0,600).replace(/\*\*|__/g,``).replace(/^[\s#>*-]+/,``).replace(/\s+/g,` `).trim().slice(0,200)}function IB(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i===32||i===10||i===13||i===9?n=!1:n||(n=!0,t++)}return t}function LB(e){if(!e)return!1;if(e.tagName===`TEXTAREA`)return!0;if(e.tagName===`INPUT`){let t=(e.type||`text`).toLowerCase();return![`button`,`checkbox`,`radio`,`submit`,`reset`,`range`,`color`,`file`].includes(t)}return e.isContentEditable===!0}function RB(e){!e||typeof document>`u`||LB(document.activeElement)||e.querySelector(`[data-autofocus]`)?.focus()}function zB(e){if(!e)return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e instanceof HTMLElement&&e.isContentEditable}function BB(e,t,n){if(!e||!n||n.querySelector(`[role="dialog"][aria-modal="true"]`))return!1;let r=t instanceof Element?t:null;if(r&&r.closest(`[data-keep-escape]`))return!1;let i=VB(e);if(i!==null&&r&&r!==n.body){let e=VB(r);if(e!==null&&e!==i)return!1}if(r&&zB(r)&&!e.contains(r)&&r.closest(`[data-testid="composer"]`)===null)return!1;let a=Array.from(n.querySelectorAll(`[data-permission-pending="true"]`)).find(e=>i===null||VB(e)===i);return a===void 0||a===e}function VB(e){return e.closest(`[data-chat-group]`)?.getAttribute(`data-chat-group`)??e.closest(`[data-editor-group]`)?.getAttribute(`data-editor-group`)??null}var HB=(0,v.memo)(function({item:e,agentName:t}){let n=e.request,[r,i]=(0,v.useState)(!1),a=e.status===`allowed`,o=(0,v.useMemo)(()=>ih(n.toolName,n.input,110),[n]),s=n.agentId?t??`background agent`:null;if(n.toolName===`AskUserQuestion`){let e=Gl(n.input).length;return(0,K.jsxs)(`div`,{className:`my-1 flex items-center gap-2 px-1 py-0.5 text-xs text-fg-faint`,children:[a?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0`}),(0,K.jsx)(`span`,{"data-testid":`permission-${n.requestId}`,children:ql({outcome:a?`answered`:`dismissed`,questions:e})}),s?(0,K.jsx)(`span`,{title:n.agentId??void 0,className:`shrink-0`,children:(0,K.jsx)(Q,{tone:`think`,children:s})}):null]})}let c=mT(n);return(0,K.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`permission-${n.requestId}`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-surface-2`,children:[a?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0 text-danger`}),(0,K.jsxs)(`span`,{className:`shrink-0`,"data-testid":c?`connector-settled`:void 0,children:[c?hT(c,a):`${a?`Allowed`:`Denied`} ${n.displayName??n.toolName}`,e.resolvedBy===`auto`?` (automatically)`:e.resolvedBy&&e.resolvedBy!==`local`?` (by ${e.resolvedBy})`:``]}),o?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-fg-muted`,"data-testid":`permission-summary`,children:o}):null,s?(0,K.jsx)(`span`,{title:n.agentId??void 0,className:`shrink-0`,children:(0,K.jsx)(Q,{tone:`think`,children:s})}):null,(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:r,className:`w-3 h-3 shrink-0`})]}),r?(0,K.jsx)(`div`,{className:`ml-5 mt-1`,children:(0,K.jsx)(EB,{name:n.toolName,input:n.input})}):null]})});function UB({items:e,agentNameOf:t}){let[n,r]=(0,v.useState)(!1),i=jz((0,v.useMemo)(()=>e.map(e=>e.id),[e]),r),{allowed:a,denied:o,tools:s,who:c}=(0,v.useMemo)(()=>{let n=e.filter(e=>e.status===`allowed`).length,r=new Map,i=new Set;for(let n of e){let e=mT(n.request),a=e?`${e.tool} (${e.vendor})`:n.request.displayName??n.request.toolName;r.set(a,(r.get(a)??0)+1),n.request.agentId&&i.add(t(n.request.agentId)??`background agent`)}return{allowed:n,denied:e.length-n,tools:[...r.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>t>1?`${e} ×${t}`:e).join(`, `),who:[...i]}},[e,t]);return(0,K.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`permission-run`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":n||i,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-surface-2`,children:[o===0?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0 text-danger`}),(0,K.jsxs)(`span`,{className:`shrink-0`,children:[a>0?`Allowed ${a}`:``,a>0&&o>0?` · `:``,o>0?`Denied ${o}`:``]}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-fg-muted`,"data-testid":`permission-run-tools`,children:s}),c.length>0?(0,K.jsx)(`span`,{className:`shrink-0`,children:(0,K.jsx)(Q,{tone:`think`,children:c.length===1?c[0]:`${c.length} agents`})}):null,(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:n||i,className:`w-3 h-3 shrink-0`})]}),n||i?(0,K.jsx)(`div`,{className:`ml-3`,children:e.map(e=>(0,K.jsx)(HB,{item:e,agentName:e.request.agentId?t(e.request.agentId):null},e.id))}):null]})}function WB({item:e,onDecide:t,stackIndex:n,agentName:r}){let i=e.request,[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=i.title??`Allow ${i.displayName??i.toolName}?`,u=(0,v.useRef)(t);u.current=t;let d=(0,v.useRef)(null),f=e.status===`pending`;if((0,v.useEffect)(()=>{if(f&&typeof document<`u`){let e=e=>{e.key===`Escape`&&BB(d.current,e.target,document)&&(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),u.current({behavior:`deny`}))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)}},[f]),(0,v.useEffect)(()=>{f&&RB(d.current)},[f]),e.status!==`pending`)return(0,K.jsx)(HB,{item:e,agentName:r??null});if(i.toolName===`AskUserQuestion`)return(0,K.jsx)(cz,{item:e,onDecide:t,cardRef:d,...n===void 0?{}:{stackIndex:n}});let p=ou(i);if(p)return(0,K.jsx)(lz,{input:p,requestId:i.requestId,onDecide:t,cardRef:d});let m=mT(i);if(m)return(0,K.jsx)(pz,{input:m,requestId:i.requestId,onDecide:t,cardRef:d});let h=pd(i);if(h)return(0,K.jsx)(Cz,{input:h,requestId:i.requestId,onDecide:t,cardRef:d});let g=Xm(i);if(g)return(0,K.jsx)(xz,{input:g,requestId:i.requestId,onDecide:t,cardRef:d});let _=Wm(i);return _?(0,K.jsx)(mz,{input:_,requestId:i.requestId,onDecide:t,cardRef:d}):(0,K.jsxs)(`div`,{ref:d,className:`my-2 rounded-lg border border-warn/60 bg-warn-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Permission request`,"data-permission-pending":`true`,"data-testid":`permission-${i.requestId}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(Y.Shield,{className:`mt-0.5 w-4 h-4 text-warn`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-semibold`,children:l}),(0,K.jsx)(Q,{tone:`warn`,children:i.toolName}),i.agentId?(0,K.jsx)(Q,{tone:`think`,children:`subagent`}):null]}),i.description?(0,K.jsx)(`div`,{className:`mt-0.5 text-fg-muted`,children:i.description}):null,i.decisionReason?(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-faint`,children:i.decisionReason}):null,i.blockedPath?(0,K.jsxs)(`div`,{className:`mt-0.5 font-mono text-xs text-danger`,children:[`Blocked path: `,i.blockedPath]}):null]})]}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(EB,{name:i.toolName,input:i.input})}),a?(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(`input`,{className:Z,placeholder:`Optional: tell the agent why (sent as the tool result)`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&t(s.trim()?{behavior:`deny`,message:s.trim()}:{behavior:`deny`})}})}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(X,{variant:`inverse`,onClick:()=>t({behavior:`allow`}),"data-autofocus":!0,children:[(0,K.jsx)(Y.Check,{className:`w-3.5 h-3.5`}),` Allow`]}),(0,K.jsx)(X,{variant:`secondary`,title:`Allow and remember this rule for the session/project`,onClick:()=>t({behavior:`allow`,remember:!0}),children:`Allow always`}),a?(0,K.jsx)(X,{variant:`secondary`,onClick:()=>t(s.trim()?{behavior:`deny`,message:s.trim()}:{behavior:`deny`}),children:`Confirm deny`}):(0,K.jsxs)(X,{variant:`ghost`,onClick:()=>o(!0),children:[(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5`}),` Deny`]}),(0,K.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Enter = allow · Esc = deny`})]})]})}var GB=6e4,KB=1e4;function qB(e,t=KB,n=300){if(e.length>=t)return!0;let r=1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)===10&&(r++,r>=n))return!0;return!1}function JB(e){return Math.ceil(Math.max(0,e)/3)*4}function YB(e,t){return t?Math.min(e.size,GB):JB(e.size)}function XB(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${Math.max(0,Math.round(e))} B`}function ZB(e,t={}){let n=t.budget??6291456,r=t.isText??(()=>!1),i=Math.max(0,t.usedBytes??0),a=[],o=[],s=0;for(let t of e){let e=YB(t,r(t));if(e>n){o.push({name:t.name,reason:`too large — ${XB(t.size)} becomes ${XB(e)} once encoded (limit ${XB(n)})`});continue}if(i+e>n){o.push({name:t.name,reason:`would exceed the ${XB(n)} attachment budget — send the staged files first`});continue}i+=e,s+=e,a.push(t)}return{accepted:a,rejected:o,addedBytes:s}}var QB=3e3;function $B(e,t,n){return e?.providerId!==`oonacode`||(n?.priceUsdMonthly??0)>0?null:t?.free===!0?`free`:`pool`}function eV(e){switch(e){case`free`:return`Waiting for a free-lane slot — free requests are paced, so the first reply can take a few seconds.`;case`pool`:return`Waiting for a slot on the OonaCode pool — the request is queued behind the provider’s rate limits.`;default:return null}}function tV(e,t,n=QB){let[r,i]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(i(!1),!e)return;let t=setTimeout(()=>i(!0),n);return()=>clearTimeout(t)},[e,t,n]),r}function nV(e){let t=Math.floor(e/6e4);if(t<60)return`${Math.max(1,t)}m`;let n=Math.floor(t/60);if(n<24)return`${n}h ${t-n*60}m`;let r=Math.floor(n/24);return`${r}d ${n-r*24}h`}function rV(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function iV(e){let{lastTurnEndedAt:t,now:n,ttlSec:r,contextTokens:i,running:a}=e;if(a||t===null||r===null||r<=0||i!==null&&i<1024)return null;let o=n-t;if(!Number.isFinite(o)||o<r*1e3)return null;let s=i===null?`the whole conversation`:`about ${rV(i)} tokens`;return`Idle ${nV(o)}. The prompt cache has likely expired, so your next message will re-cache ${s}.`}var aV=new Map;function oV(e){e===void 0?aV.clear():aV.delete(e)}function sV(e){let{text:t,chatId:n,disabled:r=!1,load:i,onPick:a}=e,o=_h(t),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[,d]=(0,v.useState)(0),f=(0,v.useRef)(null);(0,v.useEffect)(()=>{o===null&&c(!1)},[o]),(0,v.useEffect)(()=>{u(null)},[o,n]);let p=o!==null&&!s&&!r&&n!==null,m=n!==null&&!r&&(p||/^\/\S+\s/.test(t)),h=n===null?void 0:aV.get(n),g=h!==void 0&&Date.now()-h.at<6e4;(0,v.useEffect)(()=>{if(!m||n===null||g||f.current===n)return;f.current=n;let e=!0;return i(n).then(e=>{aV.set(n,{at:Date.now(),commands:e===null||e===`unsupported`?null:[...Sh(e.commands)],unsupported:e===`unsupported`})}).catch(()=>{aV.set(n,{at:Date.now(),commands:null,unsupported:!1})}).finally(()=>{f.current===n&&(f.current=null),e&&d(e=>e+1)}),()=>{e=!1}},[m,n,g,i]);let _=h?.commands??null,{items:y,sections:b,best:x}=(0,v.useMemo)(()=>{if(!_||o===null)return{items:[],sections:[],best:0};let e=Ch(_,o),t=kh(e),n=[],r=0;for(let e of Eh)t[e].length!==0&&(n.push({id:e,title:Dh[e],start:r,items:t[e]}),r+=t[e].length);let i=n.flatMap(e=>e.items),a=e[0];return{items:i,sections:n,best:o.length>0&&a?Math.max(i.indexOf(a),0):0}},[_,o]),S=(0,v.useMemo)(()=>_?wh(t,_):null,[_,t]),C=h===void 0?`loading`:h.unsupported?`unsupported`:h.commands===null?`error`:`ready`,w=p&&C!==`unsupported`,T=y.length===0?0:Math.min(l??x,y.length-1),E=(0,v.useCallback)(e=>`/${e.name} `,[]),D=(0,v.useCallback)(()=>c(!0),[]);return{open:w,status:C,query:o??``,items:y,sections:b,active:T,setActive:u,inArguments:S,onKeyDown:e=>{if(!w||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`)return e.preventDefault(),c(!0),!0;if(y.length===0)return!1;if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;return u((T+t+y.length)%y.length),!0}let t=y[T];if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`&&!e.shiftKey){let n=o!==null&&(t.name.toLowerCase()===o.toLowerCase()||(t.aliases??[]).some(e=>e.toLowerCase()===o.toLowerCase()));return e.key===`Enter`&&n?!1:t.availability===`ok`?(e.preventDefault(),a(E(t)),!0):(e.preventDefault(),!0)}return!1},textFor:E,dismiss:D}}var cV=`slash-command-menu`,lV=e=>`slash-command-option-${e}`,uV=`The model may also use it on its own in this chat (switched on in the Skills menu)`,dV=`Picking or typing a skill runs it once, in this message, whatever the Skills menu says. The model is shown a skill on its own only when it is switched on in the Skills menu under the message box — then it costs its tokens on every message.`;function fV({menu:e,onPick:t,modelSkills:n=null}){let r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{(r.current?.querySelector(`#${lV(e.active)}`))?.scrollIntoView?.({block:`nearest`})},[e.active,e.items]),e.open?(0,K.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,"data-testid":`slash-menu`,children:[e.status===`loading`?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-fg-muted`,role:`status`,children:[(0,K.jsx)(Y.Spinner,{className:`h-3.5 w-3.5 animate-spin`}),` Reading this chat’s commands…`]}):e.status===`error`?(0,K.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,role:`status`,children:`The host could not list this chat’s commands right now — type the command, it still runs.`}):e.items.length===0?(0,K.jsxs)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,role:`status`,"data-testid":`slash-empty`,children:[`No command or skill matches “/`,e.query,`” — Enter sends it to the model as a message.`]}):(0,K.jsx)(`ul`,{ref:r,id:cV,role:`listbox`,"aria-label":`Skills and commands`,className:`max-h-72 overflow-y-auto pb-1`,children:e.sections.map(r=>(0,K.jsx)(pV,{section:r,menu:e,onPick:t,modelSkills:n},r.id))}),(0,K.jsx)(`div`,{className:`hidden border-t border-border px-3 py-0.5 text-right text-[10px] text-fg-faint sm:block`,children:`↑↓ to move · Enter or Tab to pick · Esc to close`})]}):null}function pV({section:e,menu:t,onPick:n,modelSkills:r}){let i=`slash-section-${e.id}`,a=e=>e.modelSkill===void 0?null:(r??[]).includes(e.modelSkill),o=e.items.filter(e=>a(e)!==null),s=o.some(e=>a(e)===!0);return(0,K.jsxs)(`li`,{role:`presentation`,"data-testid":`slash-section`,"data-section":e.id,children:[(0,K.jsxs)(`div`,{id:i,className:`sticky top-0 z-10 flex items-baseline gap-2 border-b border-border bg-surface px-3 pb-0.5 pt-1.5 text-[11px]`,children:[(0,K.jsx)(`span`,{className:`font-semibold uppercase tracking-wide text-fg-muted`,"data-testid":`slash-section-title`,children:e.title}),e.id===`skills`?(0,K.jsx)(`span`,{className:`ml-auto flex min-w-0 items-center gap-1 truncate text-fg-faint`,title:dV,"data-testid":`slash-skills-note`,children:o.length===0?`Picking one runs it once`:s?(0,K.jsxs)(K.Fragment,{children:[`Picking one runs it once · `,(0,K.jsx)(Y.Skill,{className:`h-3 w-3 shrink-0 text-accent`}),` `,`the model may also use it here`]}):`Picking one runs it once · the model is not shown these here`}):null]}),(0,K.jsx)(`ul`,{role:`group`,"aria-labelledby":i,children:e.items.map((r,i)=>{let o=e.start+i;return(0,K.jsx)(mV,{item:r,index:o,active:o===t.active,onHover:t.setActive,onPick:n,modelOn:a(r)},r.name)})})]})}var mV=(0,v.memo)(function({item:e,index:t,active:n,onHover:r,onPick:i,modelOn:a}){let o=e.availability!==`ok`,s=Th(e.source),c=jh(e.description);return(0,K.jsxs)(`li`,{id:lV(t),role:`option`,"aria-selected":n,"aria-disabled":o||void 0,"data-testid":`slash-item`,"data-name":e.name,"data-model-skill":a===null?void 0:a?`on`:`off`,title:e.description||void 0,className:G(`flex cursor-pointer flex-col gap-0.5 px-3 py-1.5 text-xs`,n?`bg-accent-soft`:`hover:bg-surface-2`,o&&`cursor-default opacity-60`),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>r(t),onClick:()=>{o||i(e)},children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,K.jsxs)(`span`,{className:`shrink-0 font-mono font-medium text-fg`,children:[`/`,e.name]}),e.argumentHint?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-fg-faint`,children:e.argumentHint}):null,(0,K.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[a===!0&&!o?(0,K.jsx)(`span`,{className:`text-accent`,title:uV,"aria-label":uV,"data-testid":`slash-model-state`,children:(0,K.jsx)(Y.Skill,{className:`h-3 w-3`})}):null,s?(0,K.jsx)(`span`,{className:`rounded border border-border px-1 text-[10px] uppercase tracking-wide text-fg-muted`,children:s}):null]})]}),o?(0,K.jsxs)(`div`,{className:`text-fg-muted`,"data-testid":`slash-reason`,children:[`Not available here — `,e.reason]}):c?(0,K.jsx)(`div`,{className:`truncate text-fg-muted`,"data-testid":`slash-summary`,children:c}):null]})});function hV({item:e}){return e&&e.availability!==`ok`?(0,K.jsxs)(`div`,{className:`px-1 pt-0.5 text-[11px] text-warn`,"data-testid":`slash-hint`,children:[(0,K.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.name]}),` is not available here — `,e.reason]}):!e||!e.argumentHint&&!e.note?null:(0,K.jsxs)(`div`,{className:`px-1 pt-0.5 text-[11px] text-fg-faint`,"data-testid":`slash-hint`,children:[(0,K.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.name,` `,e.argumentHint]}),e.note?(0,K.jsxs)(`span`,{children:[` — `,e.note]}):null]})}var gV=`field-sizing-content w-auto max-w-full shrink-0 rounded-md border border-border bg-surface-2 py-0.5 pl-1.5 pr-1 text-xs text-fg hover:border-fg-faint focus:border-accent focus:outline-none disabled:opacity-50`,_V=[{value:`default`,label:`Ask (default)`},{value:`acceptEdits`,label:`Accept edits`},{value:`plan`,label:`Plan`},{value:`auto`,label:`Auto`},{value:`dontAsk`,label:`Don't ask`},{value:`bypassPermissions`,label:`Bypass permissions`}],vV=`Ask anything — build, fix, explain…`,yV=M;function bV(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>{let e=String(r.result??``);t(e.slice(e.indexOf(`,`)+1))},r.readAsDataURL(e)})}function xV(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>t(String(r.result??``)),r.readAsText(e)})}function SV(e){if(e.type.startsWith(`image/`))return`image`;if(e.type===`application/pdf`)return`document`;if(e.type.startsWith(`text/`))return`text`;if(e.type)return`path`;let t=TF(e.name);return t.kind===`image`?`image`:t.kind===`pdf`?`document`:t.kind===`audio`||t.kind===`video`?`path`:`text`}function CV(e){return e.map(e=>e.kind===`image`?{type:`image`,source:{type:`base64`,media_type:e.mediaType,data:e.data}}:e.kind===`document`?{type:`document`,source:{type:`base64`,media_type:e.mediaType||`application/pdf`,data:e.data}}:e.kind===`path`?{type:`text`,text:oh({name:e.name,mediaType:e.mediaType||`file`,sizeText:XB(e.size),path:e.path??e.name})}:{type:`text`,text:`Attached file ${e.name}:\n\n\`\`\`\n${e.data}\n\`\`\``})}function wV(){let{state:e,actions:t,dispatch:n,api:r}=q(),i=QS(),a=$S(),o=ZS(),{sessionId:s,focused:c}=YS(),l=s?e.unsent[s]:void 0,[u,d]=(0,v.useState)(()=>l?.text??``),[f,p]=(0,v.useState)(()=>[...l?.attachments??[]]),[m,h]=(0,v.useState)(()=>[...l?.replies??[]]),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(yV),[x,S]=(0,v.useState)(!1),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(0),E=(0,v.useRef)(!0),[D,O]=(0,v.useState)(null),k=(0,v.useCallback)(e=>{if(e.kind===`path`){zz(e.path??``,t.toast);return}Uz(e.kind===`text`?{name:e.name,mediaType:`text/plain`,base64:Nz(e.data)}:{name:e.name,mediaType:e.mediaType||`application/pdf`,base64:e.data},t.toast)},[t]),A=(0,v.useRef)({text:u,attachments:f,replies:m});A.current={text:u,attachments:f,replies:m},(0,v.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]);let j=(0,v.useRef)(o?.status??null);j.current=o?.status??null,(0,v.useEffect)(()=>{let e=C.current;if(e)return $x(e,{report:e=>t.reportDiagnostic(`message box lost the focus while typing`,{...e,chatStatus:j.current})})},[t]),(0,v.useEffect)(()=>{if(s)return()=>t.rememberUnsent(s,A.current)},[s,t]),(0,v.useEffect)(()=>{if(s)return cx(s,()=>A.current)},[s]),(0,v.useEffect)(()=>{l&&(d(e=>e.length===0?l.text:e),p(e=>e.length===0?[...l.attachments]:e),h(e=>e.length===0?[...l.replies??[]]:e))},[l]);let M=e.composerQuote,F=(0,v.useRef)(M?.seq??0);(0,v.useEffect)(()=>{!M||M.seq<=F.current||(F.current=M.seq,M.sessionId===s&&(h(e=>e.some(e=>e.quote===M.text)?e:[...e,{id:`reply-${M.seq}`,quote:M.text,preview:M.preview,itemId:M.itemId}]),C.current?.focus()))},[M,s]);let I=i?.effort??a?.effort??``;(0,v.useEffect)(()=>{_(I)},[s,I]);let ne=o?.status===`running`||o?.status===`waiting_permission`,re=e.connection.status===`open`,L=Aw(),R=jw(),z=!s||L||R!==null,B=Bw(),ie=De(B.option),V=(0,v.useMemo)(()=>Te(B.option),[B.option]),ae=(0,v.useMemo)(()=>{let e=ng(B.option,B.modelId);return e.length===0?[]:I&&!e.includes(I)&&!V?[...e,I]:e},[B.option,B.modelId,I,V]),oe=g&&ae.includes(g)?g:V??g,se=B.auto!==null,ce=ae.length>0&&!se,le=(0,v.useMemo)(()=>e.providers.find(e=>e.definition.id===B.providerId)?.definition,[e.providers,B.providerId]),ue=L?`This session runs on a PC that is offline — read-only`:R?`${R} is no longer offered — pick another model to continue`:z?`Open a chat to start`:ne?`Agent is working — a message sent now is handed to it and read at its next step (Esc to stop)`:vV;(0,v.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,240)}px`};if(t(),typeof ResizeObserver>`u`)return;let n=e.clientWidth,r=new ResizeObserver(()=>{e.clientWidth!==n&&(n=e.clientWidth,t())});return r.observe(e),()=>r.disconnect()},[u,ue]);let de=(0,v.useRef)(c);de.current=c,(0,v.useEffect)(()=>{de.current&&C.current?.focus()},[s]);let fe=te(a?.permissionMode?{permissionMode:a.permissionMode,posture:a.posture??null}:i);(0,v.useEffect)(()=>{b(ie?fe:yV)},[ie,fe,s]);let pe=ig(B.providerId),me=og(B.providerId);(0,v.useEffect)(()=>{!a||!ie||!pe||og(B.providerId).some(e=>e.id===fe)||t.setSessionPosture(yV,s??void 0)},[a,ie,pe,B.providerId,fe,s,t]);let he=(0,v.useMemo)(()=>f.reduce((e,t)=>e+t.data.length,0),[f]),ge=(0,v.useRef)(he);ge.current=he;let _e=(0,v.useCallback)(async(e,n={})=>{let o=Array.from(e);if(o.length===0)return;let c=ZB(o,{usedBytes:ge.current,isText:e=>{let t=SV(e);return t===`text`||t===`path`||t===`image`&&e.size>2097152}});for(let e of c.rejected)t.toast(`error`,`${e.name} was not attached: ${e.reason}`);let l=Rz(),u=`this window cannot say where the file lives — type its full path into the message, or use the desktop app`,d=[],f=i?.cwd||(a?.projectDir??null);for(let e of c.accepted){let i=SV(e);i===`image`&&e.size>2097152&&(i=`path`);let a=!1;if((i===`image`||i===`document`)&&le&&B.modelId&&!se&&Xs(le,B.modelId,[{type:i}])&&(i=`path`,a=!0),i===`path`){let o=l?.(e)??null;if(!o&&(n.isPaste||a||i===`path`&&e.type?.startsWith(`image/`))&&r?.saveTmpFile)try{let t=await bV(e),n=await r.saveTmpFile({sessionId:s??null,cwd:f,name:e.name||`attachment`,mediaType:e.type||TF(e.name).mime||`application/octet-stream`,base64:t});n.ok&&n.path&&(o=n.path)}catch{}if(!o){t.toast(`error`,`${e.name||`File`} was not attached: ${u}`);continue}d.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||`file`,mediaType:e.type||TF(e.name).mime||`application/octet-stream`,data:``,kind:i,path:o,size:e.size});continue}try{let a=i===`text`?(await xV(e)).slice(0,GB):await bV(e);if(i===`text`&&PF(a)){let i=l?.(e)??null;if(!i&&n.isPaste&&r?.saveTmpFile)try{let t=await bV(e),n=await r.saveTmpFile({sessionId:s??null,cwd:f,name:e.name||`file.bin`,mediaType:e.type||`application/octet-stream`,base64:t});n.ok&&n.path&&(i=n.path)}catch{}i?d.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||`file`,mediaType:e.type||`application/octet-stream`,data:``,kind:`path`,path:i,size:e.size}):t.toast(`error`,`${e.name||`File`} was not attached: it is not text, and ${u}`);continue}let o=l?.(e)??null;if(!o&&i===`image`&&r?.saveTmpFile)try{let t=await r.saveTmpFile({sessionId:s??null,cwd:f,name:e.name||`image.png`,mediaType:e.type||`image/png`,base64:a});t.ok&&t.path&&(o=t.path)}catch{}d.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||(i===`image`?`image`:`file`),mediaType:e.type||(i===`text`?`text/plain`:`application/octet-stream`),data:a,kind:i,path:o??void 0,size:e.size})}catch{t.toast(`error`,`${e.name||`File`} could not be read — nothing was attached`)}}d.length>0&&p(e=>[...e,...d])},[t,r,le,B.modelId,se,a?.projectDir,i?.cwd,s]),ve=y===yV?null:N(y),ye=(0,v.useCallback)(e=>{d(e);let t=C.current;t&&(t.focus(),requestAnimationFrame(()=>t.setSelectionRange(e.length,e.length)))},[]),be=sV({text:u,chatId:s,disabled:z,load:t.listCommands,onPick:ye}),xe=(0,v.useCallback)(()=>{let e=u.trim();if(!s||R!==null||!e&&f.length===0)return;let n=ad(m.map(e=>e.quote),e||`Please look at the attached file(s).`),r=yh(n,`app`);if(r){t.toast(`error`,bh(r));return}let i=f,a=m,o=CV(i),c={};g&&!se&&(c.effort=g),ve&&(c.permissionMode=ve,c.posture=y);let l=s;d(``),p([]),h([]),C.current?.focus(),t.sendPrompt(n,o,Object.keys(c).length>0?c:void 0,l??void 0).then(e=>{if(E.current){let e=document.activeElement;(!e||e===document.body)&&C.current?.focus()}if(!e){if(E.current){d(e=>e.length===0?u:e),p(e=>e.length===0?i:e),h(e=>e.length===0?a:e);return}t.rememberUnsent(l,{text:u,attachments:i,replies:a},!0)}})},[u,f,m,s,R,t,g,se,ve,y]),Se=(0,v.useCallback)(e=>{d(e),C.current?.focus()},[]),Ce=(0,v.useCallback)(e=>{if(!s||R!==null)return Promise.resolve(!1);let n={};return g&&!se&&(n.effort=g),ve&&(n.permissionMode=ve,n.posture=y),t.sendPrompt(e,[],Object.keys(n).length>0?n:void 0,s)},[s,R,t,g,se,ve,y]),we=e=>{be.onKeyDown(e)||(e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),xe()):e.key===`Escape`&&ne&&(e.preventDefault(),t.interrupt(s??void 0)))},Ee=e=>{let n=Array.from(e.clipboardData?.files??[]);if(n.length>0){e.preventDefault(),_e(n,{isPaste:!0});return}let o=e.clipboardData?.getData(`text/plain`)??``;if(o&&qB(o)){e.preventDefault();let n=i?.cwd||(a?.projectDir??null),c=new TextEncoder().encode(o),l=Nz(o),u=r?.saveTmpFile;if(u){(async()=>{try{let e=await u({sessionId:s??null,cwd:n,name:`pasted-text.txt`,mediaType:`text/plain`,base64:l});if(e.ok&&e.path){p(t=>[...t,{id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:`pasted-text.txt`,mediaType:`text/plain`,data:``,kind:`path`,path:e.path,size:c.byteLength}]),t.toast(`info`,`Large pasted text (${XB(c.byteLength)}) saved to ${e.path} and attached by path.`);return}}catch{}d(e=>e+o)})();return}}},Oe=e=>{e.preventDefault(),T.current=0,S(!1),e.dataTransfer?.files?.length&&_e(e.dataTransfer.files)},ke=e=>{e.dataTransfer?.types?.includes(`Files`)&&(T.current+=1,S(!0))},Ae=()=>{T.current=Math.max(0,T.current-1),T.current===0&&S(!1)},je=e=>{e.target.files&&_e(e.target.files),e.target.value=``},{pendingQuestions:Me,pendingPermissions:Ne}=(0,v.useMemo)(()=>{let e=[],t=[];for(let n of o?.items??[])n.kind===`permission`&&n.status===`pending`&&(n.request.toolName===`AskUserQuestion`?e.push(n):t.push(n));return{pendingQuestions:e,pendingPermissions:t}},[o?.items]),Pe=$B(i,B.option,e.plan),Fe=tV(o?.status===`running`,o?.items.length??0)&&Pe?eV(Pe):null,[Ie,Le]=(0,v.useState)(()=>Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>Le(Date.now()),6e4);return()=>clearInterval(e)},[]);let Re=(0,v.useMemo)(()=>{if(!o||!i)return null;let t=o.items,n=null;for(let e=t.length-1;e>=0;e--)if(t[e].kind===`result`){n=t[e];break}if(!n||n.kind!==`result`){if(t.length===0)return null;let n=e.providers.find(e=>e.definition.id===B.providerId)?.definition.capabilities.promptCacheTtlSec??null,r=Date.parse(i.updatedAt);return iV({lastTurnEndedAt:Number.isFinite(r)?r:null,now:Ie,ttlSec:n,contextTokens:o.contextTokens,running:ne})}let r=n.timestamp?Date.parse(n.timestamp):Date.parse(i.updatedAt),a=e.providers.find(e=>e.definition.id===B.providerId)?.definition.capabilities.promptCacheTtlSec??null;return iV({lastTurnEndedAt:Number.isFinite(r)?r:null,now:Ie,ttlSec:a,contextTokens:o.contextTokens,running:ne})},[o,i,e.providers,B.providerId,Ie,ne]);return(0,K.jsxs)(`div`,{className:`relative border-t border-border bg-surface px-3 py-2 sm:px-6`,onDrop:Oe,onDragOver:e=>e.preventDefault(),onDragEnter:ke,onDragLeave:Ae,"data-testid":`composer`,children:[x?(0,K.jsxs)(`div`,{className:`pointer-events-none absolute inset-1 z-10 flex items-center justify-center rounded-xl border-2 border-dashed border-accent bg-accent-soft/70 text-sm font-medium text-accent`,"data-testid":`drop-overlay`,children:[(0,K.jsx)(Y.Upload,{className:`mr-2 w-4 h-4`}),` Drop files to attach`]}):null,(0,K.jsxs)(`div`,{className:`w-full`,children:[s&&e.toolInstalls[s]?(0,K.jsx)(fz,{frame:e.toolInstalls[s],onDismiss:()=>n({type:`tool_install_dismiss`,sessionId:s})}):null,(0,K.jsx)(ZR,{}),Ne.length>0?(0,K.jsx)(`div`,{className:`mb-2 max-h-[45vh] space-y-2 overflow-y-auto`,"data-testid":`composer-pending`,children:Ne.map(e=>(0,K.jsx)(WB,{item:e,onDecide:n=>t.respondPermission(e.request.requestId,n,s??void 0)},e.id))}):null,Me.map((e,n)=>(0,K.jsx)(WB,{item:e,stackIndex:n,onDecide:n=>t.respondPermission(e.request.requestId,n,s??void 0)},e.id)),Re&&!Fe?(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-[11px] text-fg-muted`,"data-testid":`idle-cache-hint`,children:[(0,K.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-fg-faint`}),Re]}):null,Fe?(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-[11px] text-fg-muted`,"data-testid":`pacing-hint`,"data-lane":Pe??void 0,children:[(0,K.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-warn`}),Fe]}):null,!re&&s?(0,K.jsx)(`div`,{className:`mb-2 text-xs text-fg-faint`,children:e.connection.status===`unauthorized`?`The host rejected this token.`:`Not connected to the host — messages will be sent over HTTP when possible.`}):null,m.length>0?(0,K.jsx)(`div`,{className:`mb-2 flex flex-col gap-1`,"data-testid":`reply-chips`,children:m.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border-l-2 border-accent bg-accent-soft/60 py-1 pl-2 pr-1 text-xs`,"data-testid":`reply-chip`,children:[(0,K.jsx)(Y.Reply,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,K.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 truncate text-left text-fg-muted hover:text-fg`,title:`Go to the message this replies to`,disabled:!e.itemId||!s,onClick:()=>{e.itemId&&s&&t.jumpToItem(s,e.itemId)},"data-testid":`reply-chip-jump`,children:[(0,K.jsx)(`span`,{className:`text-fg`,children:`Reply to `}),e.preview]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove this reply`,onClick:()=>h(t=>t.filter(t=>t.id!==e.id)),className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-muted hover:text-danger`,"data-testid":`reply-chip-remove`,children:(0,K.jsx)(Y.X,{className:`h-3 w-3`})})]},e.id))}):null,f.length>0?(0,K.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-2`,"data-testid":`attachments`,children:[f.map(e=>(0,K.jsxs)(`div`,{className:`relative`,children:[e.kind===`image`?(0,K.jsx)(`button`,{type:`button`,"aria-label":`View ${e.name}`,title:`View ${e.name}`,"data-testid":`attachment-thumb`,onClick:()=>O({name:e.name,mediaType:e.mediaType,base64:e.data}),className:`block cursor-zoom-in rounded p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,K.jsx)(`img`,{src:`data:${e.mediaType};base64,${e.data}`,alt:e.name,className:`h-14 w-14 rounded border border-border object-cover`})}):(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Open ${e.name}`,title:e.kind===`path`?`Open ${e.name} — ${e.path??``}`:`Open ${e.name} in its own program`,"data-testid":e.kind===`path`?`attachment-path`:`attachment-file`,onClick:()=>k(e),className:`flex h-14 min-w-[7rem] max-w-[12rem] flex-col justify-center rounded border border-border bg-surface-2 px-2 text-left text-[11px] hover:bg-surface-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:wv(e.name,22)}),(0,K.jsx)(`span`,{className:`text-fg-faint`,children:e.kind===`document`?`PDF · ${Math.ceil(e.size/1024)} KB`:e.kind===`path`?`${e.mediaType.startsWith(`video/`)?`video`:e.mediaType.startsWith(`audio/`)?`audio`:`file`} · ${XB(e.size)} · path`:`text · ${Math.ceil(e.size/1024)} KB`})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,onClick:()=>p(t=>t.filter(t=>t.id!==e.id)),className:`absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-surface text-fg-muted hover:text-danger`,children:(0,K.jsx)(Y.X,{className:`w-3 h-3`})})]},e.id)),(0,K.jsx)(nB,{picture:D,onClose:()=>O(null),notify:t.toast})]}):null,R?(0,K.jsxs)(`p`,{className:`px-1 text-xs text-danger`,role:`status`,"data-testid":`model-withdrawn`,children:[R,` is no longer available. Pick another model below to continue this chat — its history stays.`]}):null,(0,K.jsxs)(`div`,{className:G(`relative flex flex-col gap-1 rounded-xl border bg-bg px-2 py-1.5`,z?`border-border opacity-60`:`border-border`),children:[(0,K.jsx)(fV,{menu:be,onPick:e=>ye(be.textFor(e)),modelSkills:(a?a.modelSkills:i?.modelSkills)??null}),(0,K.jsx)(`textarea`,{ref:C,"aria-label":`Message`,rows:1,value:u,"aria-controls":be.open?cV:void 0,"aria-activedescendant":be.open&&be.items.length>0?lV(be.active):void 0,disabled:z,placeholder:ue,onChange:e=>d(e.target.value),onKeyDown:we,onPaste:Ee,className:`max-h-60 min-h-[2.25rem] w-full resize-none bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-fg-faint`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1`,"data-testid":`composer-controls`,children:[(0,K.jsx)(`input`,{ref:w,type:`file`,multiple:!0,className:`hidden`,onChange:je,"data-testid":`file-input`}),(0,K.jsx)(uC,{label:`Attach files or images`,disabled:z,onClick:()=>w.current?.click(),children:(0,K.jsx)(Y.Upload,{className:`w-4 h-4`})}),(0,K.jsx)(aT,{disabled:!s||L}),(0,K.jsx)(kL,{disabled:z}),(0,K.jsx)(IL,{disabled:z}),(0,K.jsx)(KL,{disabled:z}),(0,K.jsx)(fR,{}),(0,K.jsx)(gR,{}),(0,K.jsx)(YR,{}),(0,K.jsx)(tz,{disabled:z}),i&&!L?(0,K.jsx)(uC,{label:`Listen to this chat — a spoken summary`,"data-testid":`listen-button`,onClick:()=>t.openVoiceSummary(i.id),children:(0,K.jsx)(Y.Speaker,{className:`w-4 h-4`})}):null,i&&!L&&!e.remote.tabs[i.id]?(0,K.jsx)(nz,{sessionId:i.id,running:ne,onPutInBox:Se,onSend:Ce}):null,ie?(0,K.jsxs)(`select`,{"aria-label":`Agent`,"data-testid":`agent-picker`,className:gV,value:y,disabled:z,title:pe?sg:void 0,onChange:e=>{let n=e.target.value;ee(n)&&(b(n),t.setSessionPosture(n,s??void 0))},children:[me.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.label},e.id)),me.some(e=>e.id===y)?null:(0,K.jsx)(`option`,{value:y,disabled:!0,children:P(y)})]}):null,ie&&pe?(0,K.jsx)(`span`,{className:`inline-flex`,"data-testid":`agy-posture-note`,children:(0,K.jsx)(dC,{label:`the agent picker`,details:sg})}):null,ce?(0,K.jsxs)(`select`,{"aria-label":`Effort`,className:gV,value:oe,disabled:z,title:V?`This model's default effort is ${V}; it runs at that until you pick another`:void 0,onChange:e=>{let n=e.target.value;_(n),t.setSessionEffort(n||null,s??void 0)},children:[V?null:(0,K.jsx)(`option`,{value:``,children:`effort: default`}),ae.map(e=>(0,K.jsxs)(`option`,{value:e,children:[`effort: `,e,e===V?` (default)`:``]},e))]}):null,(0,K.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,"data-testid":`composer-actions`,children:[ne?(0,K.jsxs)(X,{variant:`danger`,size:`sm`,onClick:()=>void t.interrupt(s??void 0),title:`Interrupt (Esc)`,"aria-label":`Interrupt`,"data-testid":`stop-button`,children:[(0,K.jsx)(Y.Stop,{className:`w-3.5 h-3.5`}),` Stop`]}):null,(0,K.jsxs)(X,{variant:`primary`,size:`sm`,onMouseDown:e=>e.preventDefault(),onClick:xe,disabled:z||!u.trim()&&f.length===0,"aria-label":ne?`Queue message`:`Send`,title:ne?`Queue this message — the agent reads it at its next step`:void 0,children:[(0,K.jsx)(Y.Send,{className:`w-3.5 h-3.5`}),` `,ne?`Queue`:`Send`]})]})]})]}),be.open?null:(0,K.jsx)(hV,{item:be.inArguments}),o&&o.totals.turns>0?(0,K.jsxs)(`div`,{className:`mt-1 text-right text-[11px] text-fg-faint`,children:[o.totals.turns,` turn`,o.totals.turns===1?``:`s`,` ·`,` `,i?.providerId===`oonacode`?Sd(i.poolCredits??0):Td(Ed(e.providers.find(e=>e.definition.id===i?.providerId)?.definition))]}):null]})]})}function TV({name:e,state:t,behind:n,detail:r}){return(0,K.jsxs)(`div`,{"data-testid":`sync-side`,className:`min-w-0 flex-1 rounded-md border p-3 ${n?`border-warn bg-warn-soft/40`:`border-border bg-surface-2`}`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n?(0,K.jsx)(`span`,{className:`shrink-0 text-[11px] font-normal text-warn`,children:`behind`}):null]}),(0,K.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-faint`,children:t.entryCount===null?`size not read`:`${t.entryCount} ${t.entryCount===1?`entry`:`entries`}`}),(0,K.jsx)(`div`,{className:`text-[11px] text-fg-faint`,title:xv(t.lastEntryAt),children:t.lastEntryAt?`last message ${yv(t.lastEntryAt)}`:`no timestamps`}),r?(0,K.jsx)(`div`,{className:`mt-1 break-all text-[11px] text-fg-faint`,children:r}):null]})}function EV({sessionId:e,sessionTitle:t,onClose:n}){let{actions:r}=q(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=(0,v.useCallback)(async()=>{if(e){s(!0);try{a(await r.refreshSessionLink(e))}finally{s(!1)}}},[e,r]);(0,v.useEffect)(()=>{d(null),a(null),f()},[f]);let p=async()=>{if(e){l(!0);try{let t=await r.syncSessionDown(e);d(t),t&&a(t.link)}finally{l(!1)}}},m=i?.status===`ours-behind`,h=i?.status===`theirs-behind`;return(0,K.jsx)(hC,{open:e!==null,title:`Sync with the original chat`,onClose:n,footer:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(X,{variant:`ghost`,onClick:n,children:`Close`}),(0,K.jsx)(X,{variant:`primary`,busy:c,onClick:()=>void p(),disabled:!i?.canDownstream||o,"data-testid":`sync-down-confirm`,children:c?`Syncing…`:m?`Bring the new messages in`:`Check again`})]}),children:o&&!i?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-sm text-fg-muted`,children:[(0,K.jsx)(Y.Spinner,{className:`w-4 h-4 spin`}),` Reading the original…`]}):i?(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,K.jsx)(TV,{name:`OonaCode · ${t}`,state:i.ours,behind:m}),(0,K.jsx)(TV,{name:i.agentName,state:i.theirs,behind:h,detail:i.file})]}),(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,"data-testid":`sync-explanation`,children:m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`strong`,{children:[i.agentName,` has newer messages.`]}),` Bringing them in adds them to this chat — nothing here is replaced or removed, and `,i.agentName,` is not written to.`]}):h?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`strong`,{children:`This chat is the newer one.`}),` Nothing is sent back: OonaCode never writes into your `,i.agentName,` install, so the copy over there stays as it is.`]}):(0,K.jsx)(K.Fragment,{children:`Both copies are at the same point. There is nothing to bring in.`})}),u?(0,K.jsx)(`div`,{className:`rounded-md border border-border bg-surface-2 p-3 text-sm`,"data-testid":`sync-result`,children:u.added>0?`${u.added} new ${u.added===1?`message`:`messages`} added to this chat.`:`Already up to date — nothing to bring in.`}):null]}):(0,K.jsx)(`p`,{className:`py-4 text-sm text-fg-muted`,children:`This PC no longer has the chat this one was imported from, so there is nothing to compare it with. Nothing is wrong with the chat itself — it stays exactly as it is.`})})}function DV({mark:e,testId:t,className:n}){let r=Qb(e);return(0,K.jsx)(`span`,{role:`img`,"aria-label":r,title:r,className:G(`inline-block h-2 w-2 shrink-0 rounded-full`,e.isError?`bg-danger`:`bg-accent`,n),"data-testid":t,"data-error":e.isError?`true`:void 0})}function OV({status:e}){return(0,K.jsx)(`span`,{className:G(`inline-block h-2 w-2 shrink-0 rounded-full`,e===`running`?`bg-accent animate-pulse`:e===`waiting_permission`?`bg-warn animate-pulse`:e===`error`?`bg-danger`:`bg-transparent`),"aria-hidden":!0})}function kV(e){return e.some(e=>e.status===`running`)?`running`:e.some(e=>e.status===`waiting_permission`)?`waiting_permission`:`idle`}function AV({sessions:e,testId:t}){let n=kV(e);if(n===`idle`)return null;let r=e.filter(e=>e.status===`running`||e.status===`waiting_permission`).length;return(0,K.jsx)(`span`,{className:`inline-flex shrink-0 items-center`,title:n===`running`?`${r} chat${r===1?``:`s`} working`:`${r} chat${r===1?``:`s`} waiting for permission`,"aria-label":`${r} active chat${r===1?``:`s`}`,"data-testid":t,children:(0,K.jsx)(OV,{status:n})})}var jV={idle:`idle`,running:`working`,waiting_permission:`waiting for permission`,error:`error`};function MV({label:e,value:t}){return t==null||t===``?null:(0,K.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`shrink-0 text-fg-faint`,children:e}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-right text-fg`,title:t,children:t})]})}function NV({session:e,anchor:t}){let{state:n}=q(),r=n.providers.find(t=>t.definition.id===e.providerId)?.definition,i=r?.models.find(t=>t.id===e.model),a=e.projectId?n.vaultProjects.find(t=>t.id===e.projectId):void 0,o=e.startedBy?n.sessions.find(t=>t.id===e.startedBy):void 0,s=te(e),c=N(s)===e.permissionMode?P(s):_V.find(t=>t.value===e.permissionMode)?.label??e.permissionMode,l=Dd(e,Ed(r)),u=Math.max(8,Math.min(t.right+8,window.innerWidth-304-8)),d=Math.max(8,Math.min(t.top,window.innerHeight-360));return(0,aC.createPortal)((0,K.jsxs)(`div`,{role:`tooltip`,"data-testid":`session-details-${e.id}`,className:`fixed z-50 max-h-[22rem] w-[19rem] overflow-y-auto rounded-lg border border-border bg-surface p-3 text-xs shadow-lg`,style:{left:u,top:d},children:[(0,K.jsx)(`div`,{className:`mb-2 truncate text-sm font-medium text-fg`,children:Dv(e)}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(MV,{label:`Model`,value:r&&e.model?`${e.model} · ${r.displayName}`:e.model}),(0,K.jsx)(MV,{label:`Effort`,value:e.effort??`default`}),(0,K.jsx)(MV,{label:`Mode`,value:c}),(0,K.jsx)(MV,{label:`Status`,value:jV[e.status]}),(0,K.jsx)(MV,{label:`Context window`,value:i?.contextWindow?`${vv(i.contextWindow)} tokens`:null}),(0,K.jsx)(MV,{label:`Tokens`,value:`${vv(e.inputTokens)} in · ${vv(e.outputTokens)} out`}),(0,K.jsx)(MV,{label:`Cost`,value:l}),(0,K.jsx)(MV,{label:`Messages`,value:String(e.entryCount)}),(0,K.jsx)(MV,{label:`Folder`,value:e.projectDir??e.cwd}),(0,K.jsx)(MV,{label:`Project`,value:a?.name??null}),(0,K.jsx)(MV,{label:`Created`,value:xv(e.createdAt)}),(0,K.jsx)(MV,{label:`Updated`,value:xv(e.updatedAt)}),(0,K.jsx)(MV,{label:`Forked from`,value:e.forkedFrom}),(0,K.jsx)(MV,{label:`Started by`,value:o?Dv(o):e.startedBy}),(0,K.jsx)(MV,{label:`Temporary`,value:e.temporary?`yes — safe to delete when done`:null}),(0,K.jsx)(MV,{label:`Subagents`,value:e.hasSubagents?`yes`:null}),(0,K.jsx)(MV,{label:`Engine since`,value:xv(e.engineSince)})]})]}),document.body)}function PV({link:e}){return e?.status===`ours-behind`?(0,K.jsxs)(`span`,{className:`ml-1 inline-flex shrink-0 items-center gap-0.5 rounded bg-warn-soft px-1 text-[10px] font-medium leading-4 text-warn`,title:`${e.agentName} has newer messages in this chat — right-click to bring them in`,"data-testid":`session-behind-${e.sessionId}`,"aria-label":`behind its original`,children:[(0,K.jsx)(Y.ArrowDown,{className:`w-2.5 h-2.5`}),`behind`]}):null}function FV({session:e}){return!e.startedBy&&!e.temporary?null:(0,K.jsxs)(K.Fragment,{children:[e.startedBy?(0,K.jsx)(`span`,{className:`ml-1 shrink-0 text-fg-faint`,title:`Started by another chat — rest the pointer on the chat for its name`,"data-testid":`session-started-${e.id}`,children:`· started by a chat`}):null,e.temporary?(0,K.jsx)(`span`,{className:`ml-1 inline-flex shrink-0 items-center rounded bg-surface-2 px-1 text-[10px] font-medium leading-4 text-fg-muted`,title:`Temporary: the model marked this chat throwaway — delete it from its menu when done`,"data-testid":`session-temporary-${e.id}`,children:`temporary`}):null]})}var IV=(0,v.memo)(function({session:e,active:t,link:n,onOpen:r,onMenu:i,menuOpen:a=!1,projectName:o=null,kindIcon:s=!1,testIdPrefix:c=`session`,clock:l}){let u=Dv(e),d=t=>{let n=t.currentTarget.getBoundingClientRect();i(e,{x:n.left,y:n.bottom+2},f.current)},f=(0,v.useRef)(null),p=(0,v.useRef)(null),[m,h]=(0,v.useState)(null),g=(0,v.useCallback)(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),h(null)},[]),_=(0,v.useRef)(a);return _.current=a,(0,v.useEffect)(()=>{a&&g()},[a,g]),(0,v.useEffect)(()=>{if(m===null)return;let e=e=>{Cw(e.target,f.current)&&g()};return window.addEventListener(`scroll`,e,!0),()=>window.removeEventListener(`scroll`,e,!0)},[m,g]),(0,v.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]),(0,K.jsxs)(`div`,{ref:f,className:G(`group relative flex items-center rounded-md`,t?`bg-accent-soft`:`hover:bg-surface-2`),onMouseEnter:()=>{p.current!==null&&clearTimeout(p.current),!_.current&&(p.current=setTimeout(()=>{p.current=null,f.current&&!_.current&&h(f.current.getBoundingClientRect())},450))},onMouseLeave:g,onClick:g,onContextMenu:t=>{t.preventDefault(),g(),i(e,{x:t.clientX,y:t.clientY},f.current)},children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left`,"aria-current":t?`true`:void 0,"data-testid":`${c}-${e.id}`,children:[s?(0,K.jsx)(Y.Chats,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}):null,e.finishedUnseen&&!t&&e.status!==`running`&&e.status!==`waiting_permission`?(0,K.jsx)(DV,{mark:e.finishedUnseen,testId:`${c}-finished-${e.id}`}):s&&e.status===`idle`?null:(0,K.jsx)(OV,{status:e.status}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,K.jsx)(`span`,{className:G(`min-w-0 flex-1 truncate text-sm`,t?`text-fg font-medium`:`text-fg`),children:u})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center text-[11px] text-fg-faint`,children:[o?(0,K.jsxs)(`span`,{className:`mr-1 inline-flex min-w-0 max-w-[45%] shrink-0 items-center gap-0.5 text-project`,"data-testid":`session-project-${e.id}`,title:`Filed under ${o}`,children:[(0,K.jsx)(Y.Project,{className:`w-2.5 h-2.5 shrink-0`}),(0,K.jsx)(`span`,{className:`truncate`,children:o}),(0,K.jsx)(`span`,{className:`text-fg-faint`,children:`·`})]}):null,(0,K.jsxs)(`span`,{className:`truncate`,children:[yv(e.updatedAt,l),e.model?` · ${e.model}`:``,` · ${Cv(e.projectDir??e.cwd)}`]}),(0,K.jsx)(PV,{link:n}),(0,K.jsx)(FV,{session:e})]})]})]}),(0,K.jsx)(uC,{label:`Chat actions`,className:`pointer-events-none absolute right-1 bg-surface/90 p-1 opacity-0 group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100`,"data-testid":`${c}-menu-${e.id}`,onClick:e=>{e.stopPropagation(),d(e)},children:(0,K.jsx)(Y.More,{className:`w-3.5 h-3.5`})}),m===null?null:(0,K.jsx)(NV,{session:e,anchor:m})]})});function LV({session:e,link:t,pinned:n,actions:r,onSync:i,onRename:a,onDelete:o}){let s=[];return t?.status===`ours-behind`&&s.push({key:`sync`,label:`Sync with ${t.agentName}…`,hint:`behind`,icon:(0,K.jsx)(Y.Download,{className:`w-3.5 h-3.5`}),onSelect:i,testId:`session-menu-sync`}),s.push({key:`pin`,label:n?`Unpin`:`Pin to top`,icon:(0,K.jsx)(Y.Pin,{className:`w-3.5 h-3.5`}),separated:s.length>0,onSelect:()=>r.setPinned(`chat`,e.id,!n),testId:`session-menu-pin`},{key:`project`,label:`Move to Project`,icon:(0,K.jsx)(Y.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openAssignProject(e.id),testId:`session-menu-project`},...e.projectId?[{key:`project-settings`,label:`Project settings…`,icon:(0,K.jsx)(Y.Settings,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openProjectSettings(e.projectId),testId:`session-menu-project-settings`}]:[],{key:`folder`,label:`Change folder…`,icon:(0,K.jsx)(Y.Folder,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.openDialog(`project`)},testId:`session-menu-folder`},{key:`details`,label:`Details`,icon:(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.savePrefs({sessionPanelOpen:!0})},testId:`session-menu-details`},{key:`listen`,label:`Listen to this chat…`,icon:(0,K.jsx)(Y.Speaker,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openVoiceSummary(e.id),testId:`session-menu-listen`},{key:`files`,label:`Files`,icon:(0,K.jsx)(Y.File,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.savePrefs({explorerOpen:!0})},testId:`session-menu-files`},{key:`rename`,label:`Rename…`,icon:(0,K.jsx)(Y.Edit,{className:`w-3.5 h-3.5`}),onSelect:a,testId:`session-menu-rename`},{key:`fork`,label:`Fork`,icon:(0,K.jsx)(Y.Fork,{className:`w-3.5 h-3.5`}),onSelect:()=>void r.forkSession(e.id),testId:`session-menu-fork`},{key:`delete`,label:`Delete`,icon:(0,K.jsx)(Y.Trash,{className:`w-3.5 h-3.5`}),danger:!0,separated:!0,onSelect:o,testId:`session-menu-delete`}),s}function RV(){let{state:e,actions:t}=q(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=(0,v.useCallback)((e,t,n)=>r({session:e,at:t,el:n}),[]),d=(0,v.useCallback)(()=>r(null),[]),f=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Tw,{open:n!==null,at:n?.at??{x:0,y:0},anchorEl:n?.el??null,label:`Chat actions`,onClose:d,items:n?LV({session:n.session,link:e.sessionLinks[n.session.id]??null,pinned:Nl(e.prefs.pinned,`chat`,n.session.id),actions:t,onSync:()=>a(n.session),onRename:()=>s(n.session),onDelete:()=>l(n.session)}):[]}),(0,K.jsx)(EV,{sessionId:i?.id??null,sessionTitle:i?Dv(i):``,onClose:()=>a(null)}),(0,K.jsx)(yC,{open:c!==null,title:`Delete this chat?`,message:`It is deleted from this PC — the only place it is kept — so it is gone from every device. Your files, folder and code are not touched — only the chat is deleted.`,onConfirm:()=>{c&&t.deleteSession(c.id)},onClose:()=>l(null)}),(0,K.jsx)(bC,{open:o!==null,title:`Rename chat`,label:`Session title`,initialValue:o?Dv(o):``,onSubmit:e=>{o&&e!==Dv(o)&&t.renameSession(o.id,e)},onClose:()=>s(null)})]});return{openMenu:u,menuFor:n?.session.id??null,element:f}}function zV({projectId:e,pinned:t,fold:n,actions:r}){let i=[];return e?i.push({key:`open`,label:`Open project`,icon:(0,K.jsx)(Y.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openPage({kind:`project`,projectId:e}),testId:`project-menu-open`},{key:`settings`,label:`Project settings…`,icon:(0,K.jsx)(Y.Settings,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openProjectSettings(e),testId:`project-menu-settings`},{key:`new-chat`,label:`New chat in this project`,icon:(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),onSelect:()=>r.newTab({projectId:e}),testId:`project-menu-new-chat`},{key:`pin`,label:t?`Unpin`:`Pin to top`,icon:(0,K.jsx)(Y.Pin,{className:`w-3.5 h-3.5`}),onSelect:()=>r.setPinned(`project`,e,!t),testId:`project-menu-pin`}):i.push({key:`new-project`,label:`New project…`,icon:(0,K.jsx)(Y.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openNewProject(),testId:`project-menu-new-project`}),n&&i.push({key:`fold`,label:n.collapsed?`Expand`:`Collapse`,icon:(0,K.jsx)(Y.Chevron,{open:n.collapsed,className:`w-3.5 h-3.5`}),separated:!0,onSelect:n.onToggle,testId:`project-menu-fold`}),i}var BV=[{value:`activity`,label:`Recent activity`},{value:`name`,label:`Name`},{value:`created`,label:`Date created`}];function VV(e){let t=e.goal?.trim()??``;return t===``?(e.instructions??``).split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``:t}function HV(e,t){let n=new Map;for(let e of t){if(!e.projectId)continue;let t=n.get(e.projectId);t?t.push(e):n.set(e.projectId,[e])}return e.map(e=>{let t=n.get(e.id)??[],r=t.reduce((e,t)=>Math.max(e,t.mtime),-1/0),i=Date.parse(e.updatedAt);return{project:e,description:VV(e),chatCount:e.sessionCount??t.length,working:t.filter(e=>e.status===`running`||e.status===`waiting_permission`).length,lastActivity:Number.isFinite(r)?r:Number.isFinite(i)?i:0}})}function UV(e,t){let n=t.trim().toLowerCase();return n===``?e.slice():e.filter(({project:e})=>[e.name,e.goal??``,e.instructions??``].some(e=>e.toLowerCase().includes(n)))}var WV=(e,t)=>e.project.name.localeCompare(t.project.name,void 0,{sensitivity:`base`});function GV(e,t){let n=e.slice();return t===`name`?n.sort(WV):t===`created`?n.sort((e,t)=>(Date.parse(t.project.createdAt)||0)-(Date.parse(e.project.createdAt)||0)||WV(e,t)):n.sort((e,t)=>t.lastActivity-e.lastActivity||WV(e,t))}function KV(){let{state:e,actions:t}=q(),n=e.scheduledTasksVersion,[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=!0;return t.listScheduledTasks({}).then(t=>{e&&i(t)}),()=>{e=!1}},[t,n,a]),{tasks:r,reload:(0,v.useCallback)(()=>o(e=>e+1),[])}}function qV(){let[e,t]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}function JV(e){return e===1?`1 chat`:`${e} chats`}function YV({card:e,pinned:t,actions:n,onDelete:r}){let i=e.chatCount;return[...zV({projectId:e.project.id,pinned:t,fold:null,actions:n}),{key:`delete`,label:`Delete project`,icon:(0,K.jsx)(Y.Trash,{className:`w-3.5 h-3.5`}),danger:!0,separated:!0,disabled:i>0,...i>0?{hint:`${JV(i)} in it`}:{},onSelect:r,testId:`project-card-delete`}]}function XV(){let{state:e,actions:t}=q(),n=qV(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(`activity`),[l,u]=(0,v.useState)(null),d=(0,v.useCallback)(()=>u(null),[]),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(()=>p(null),[]),[h,g]=(0,v.useState)(null),_=(0,v.useRef)(null),y=(0,v.useMemo)(()=>HV(e.vaultProjects,e.sessions),[e.vaultProjects,e.sessions]),b=(0,v.useMemo)(()=>GV(UV(y,r),s),[y,r,s]),x=e=>t.openPage({kind:`project`,projectId:e}),S=(e,t,n)=>p({card:e,at:t,el:n});return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`projects-page`,children:[(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl px-4 py-6 sm:px-8`,children:[(0,K.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h1`,{className:`mr-auto text-2xl font-semibold text-fg`,children:`Projects`}),a||r!==``?(0,K.jsx)(`input`,{ref:_,autoFocus:!0,"aria-label":`Search projects`,className:G(Z,`w-56`),placeholder:`Search projects`,value:r,onChange:e=>i(e.target.value),onBlur:()=>{r===``&&o(!1)},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i(``),o(!1))},"data-testid":`projects-search`}):null,(0,K.jsx)(uC,{label:`Search projects — by name, goal and instructions`,onClick:()=>{o(!0),_.current?.focus()},"data-testid":`projects-search-toggle`,children:(0,K.jsx)(Y.Search,{})}),(0,K.jsx)(uC,{label:`Sort — ${BV.find(e=>e.value===s)?.label??``}`,"aria-haspopup":`menu`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();u({at:{x:t.left,y:t.bottom+2},el:e.currentTarget})},"data-testid":`projects-sort`,children:(0,K.jsx)(Y.Sliders,{})}),(0,K.jsxs)(X,{variant:`inverse`,onClick:()=>t.openNewProject(),"data-testid":`projects-new`,children:[(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),`New project`]})]}),e.vaultProjects.length===0?(0,K.jsx)(vC,{icon:(0,K.jsx)(Y.Project,{className:`h-8 w-8`}),title:`No projects yet`,hint:`A project groups chats, whatever folders they run in, and gives every chat in it the same standing instructions, goal and memory. Projects live in your vault, so they follow you to every PC.`,action:(0,K.jsxs)(X,{variant:`primary`,onClick:()=>t.openNewProject(),children:[(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),`New project`]})}):b.length===0?(0,K.jsxs)(`p`,{className:`py-10 text-center text-sm text-fg-muted`,"data-testid":`projects-no-match`,children:[`No project matches “`,r.trim(),`”.`]}):(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3`,"data-testid":`projects-grid`,children:b.map(t=>(0,K.jsx)(ZV,{card:t,clock:n,pinned:Nl(e.prefs.pinned,`project`,t.project.id),onOpen:x,onMenu:S},t.project.id))})]}),(0,K.jsx)(Tw,{open:l!==null,at:l?.at??{x:0,y:0},anchorEl:l?.el??null,label:`Sort projects`,testId:`projects-sort-menu`,onClose:d,items:BV.map(e=>({key:e.value,label:e.label,icon:e.value===s?(0,K.jsx)(Y.Check,{className:`w-3.5 h-3.5 text-accent`}):(0,K.jsx)(`span`,{className:`w-3.5`}),onSelect:()=>c(e.value),testId:`projects-sort-${e.value}`}))}),(0,K.jsx)(Tw,{open:f!==null,at:f?.at??{x:0,y:0},anchorEl:f?.el??null,label:`Project actions`,testId:`project-card-menu`,onClose:m,items:f?YV({card:f.card,pinned:Nl(e.prefs.pinned,`project`,f.card.project.id),actions:t,onDelete:()=>g(f.card.project)}):[]}),(0,K.jsx)(yC,{open:h!==null,title:h?`Delete ${h.name}?`:`Delete this project?`,message:`Its instructions, goal, memory and settings are removed from your vault, on every device. No chat is filed under it, so no chat changes.`,onConfirm:()=>{h&&t.deleteVaultProject(h.id)},onClose:()=>g(null)})]})}function ZV({card:e,clock:t,pinned:n,onOpen:r,onMenu:i}){let{project:a}=e,o=(0,v.useRef)(null);return(0,K.jsxs)(`div`,{ref:o,className:`group relative rounded-xl border border-border bg-surface transition-colors hover:border-fg-faint hover:bg-surface-2/40`,"data-testid":`project-card-${a.id}`,onContextMenu:t=>{t.preventDefault(),o.current&&i(e,{x:t.clientX,y:t.clientY},o.current)},children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex h-full min-h-[7.5rem] w-full flex-col items-start gap-1 p-4 text-left`,onClick:()=>r(a.id),"data-testid":`project-card-open-${a.id}`,children:[(0,K.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-2 pr-7`,children:[(0,K.jsx)(Y.Project,{className:`w-4 h-4 shrink-0 text-project`}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-[15px] font-medium text-fg`,children:a.name}),n?(0,K.jsx)(Y.Pin,{className:`w-3 h-3 shrink-0 text-fg-faint`,title:`Pinned to the top of the session list`}):null]}),e.description?(0,K.jsx)(`span`,{className:`line-clamp-2 text-sm text-fg-muted`,"data-testid":`project-card-description`,children:e.description}):null,(0,K.jsxs)(`span`,{className:`mt-auto flex items-center gap-1.5 pt-2 text-xs text-fg-faint`,children:[e.working>0?(0,K.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-accent animate-pulse`,title:`${e.working} working now`,"aria-hidden":!0}):null,(0,K.jsxs)(`span`,{"data-testid":`project-card-meta`,children:[JV(e.chatCount),e.lastActivity>0?` · ${bv(e.lastActivity,t)}`:``]})]})]}),(0,K.jsx)(uC,{label:`Actions for ${a.name}`,className:`absolute right-2 top-2 p-1 opacity-60 group-hover:opacity-100 focus:opacity-100`,onClick:t=>{let n=t.currentTarget.getBoundingClientRect();o.current&&i(e,{x:n.left,y:n.bottom+2},o.current)},"data-testid":`project-card-menu-${a.id}`,children:(0,K.jsx)(Y.More,{className:`w-4 h-4`})})]})}function QV({projectId:e}){let{state:t,actions:n}=q(),r=qV(),i=RV(),a=t.vaultProjects.find(t=>t.id===e)??null,o=(0,v.useMemo)(()=>t.sessions.filter(n=>n.projectId===e&&!t.remote.tabs[n.id]).sort((e,t)=>t.mtime-e.mtime),[t.sessions,t.remote.tabs,e]),s=(0,v.useCallback)(e=>n.selectSession(e),[n]),c=()=>n.openPage({kind:`projects`});if(!a)return(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`project-page`,children:(0,K.jsx)(vC,{icon:(0,K.jsx)(Y.Project,{className:`h-8 w-8`}),title:`This project is not here`,hint:`It was deleted, or your vault has not loaded it yet.`,action:(0,K.jsx)(X,{onClick:c,"data-testid":`project-page-back`,children:`All projects`})})});let l=Nl(t.prefs.pinned,`project`,a.id),u=a.instructions.trim(),d=a.repositories??[],f=a.sessionCount??o.length;return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`project-page`,children:[(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-6 sm:px-8`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`mb-3 inline-flex items-center gap-1 text-xs text-fg-muted hover:text-fg`,onClick:c,"data-testid":`project-page-back`,children:[(0,K.jsx)(Y.Chevron,{className:`w-3 h-3 rotate-180`}),`All projects`]}),(0,K.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(Y.Project,{className:`w-5 h-5 shrink-0 text-project`}),(0,K.jsx)(`h1`,{className:`mr-auto min-w-0 truncate text-2xl font-semibold text-fg`,"data-testid":`project-page-name`,children:a.name}),(0,K.jsx)(uC,{label:l?`Unpin from the session list`:`Pin to the top of the session list`,"aria-pressed":l,className:l?`text-accent`:void 0,onClick:()=>n.setPinned(`project`,a.id,!l),"data-testid":`project-page-pin`,children:(0,K.jsx)(Y.Pin,{})}),(0,K.jsxs)(X,{variant:`ghost`,onClick:()=>n.openProjectSettings(a.id),"data-testid":`project-page-settings`,children:[(0,K.jsx)(Y.Settings,{className:`w-3.5 h-3.5`}),`Project settings`]}),(0,K.jsxs)(X,{variant:`inverse`,onClick:()=>n.newTab({projectId:a.id}),"data-testid":`project-page-new-chat`,children:[(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),`New chat in this project`]})]}),a.goal?.trim()?(0,K.jsx)(`p`,{className:`mb-4 text-sm text-fg-muted`,"data-testid":`project-page-goal`,children:a.goal.trim()}):null,(0,K.jsxs)(`section`,{className:`mb-5 rounded-xl border border-border bg-surface p-4`,children:[(0,K.jsx)(`h2`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:`Instructions`}),u?(0,K.jsx)(`div`,{className:`max-h-64 overflow-y-auto whitespace-pre-wrap break-words text-sm text-fg`,"data-testid":`project-page-instructions`,children:u}):(0,K.jsx)(`p`,{className:`text-sm text-fg-faint`,children:`None — chats here start with nothing extra.`}),d.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h2`,{className:`mb-1 mt-4 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:`Repositories`}),(0,K.jsx)(`ul`,{className:`space-y-0.5 text-sm`,"data-testid":`project-page-repositories`,children:d.map(e=>(0,K.jsx)(`li`,{className:`truncate font-mono text-xs text-fg-muted`,children:e},e))})]}):null]}),(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`h2`,{className:`mb-1 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:[`Chats`,(0,K.jsx)(`span`,{className:`font-normal normal-case`,"data-testid":`project-page-count`,children:f})]}),o.length===0?(0,K.jsx)(`p`,{className:`py-3 text-sm text-fg-faint`,"data-testid":`project-page-no-chats`,children:f>0?`${JV(f)} filed here are older than the list this window holds.`:`No chats in this project yet — start one with “New chat in this project”.`}):(0,K.jsx)(`div`,{className:`rounded-xl border border-border bg-surface p-1`,"data-testid":`project-page-chats`,children:o.map(e=>(0,K.jsx)(IV,{session:e,active:!1,link:t.sessionLinks[e.id]??null,menuOpen:i.menuFor===e.id,onOpen:s,onMenu:i.openMenu,clock:r,testIdPrefix:`project-chat`},e.id))}),f>0&&o.length>0&&f>o.length?(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-fg-faint`,children:[f-o.length,` older `,f-o.length===1?`chat is`:`chats are`,` `,`not in the list this window holds — search for`,` `,f-o.length===1?`it`:`them`,` in the session list.`]}):null]})]}),i.element]})}var $V=`waiting: the chat is busy`;function eH(e){return e.enabled&&typeof e.lastResult==`string`&&e.lastResult.startsWith(`waiting:`)&&e.lastResult!==$V}function tH(e,t){if(!e.enabled||!e.nextRunAt)return!1;let n=Date.parse(e.nextRunAt);return Number.isFinite(n)&&n-t<=36e5}function nH(e,t){let n=e=>e===1?`1 scheduled task`:`${e} scheduled tasks`,r=e.filter(eH).length;if(r>0)return{tone:`stuck`,count:r,text:`${n(r)} could not run — open Scheduled to see why`};let i=e.filter(e=>tH(e,t)).length;return i>0?{tone:`soon`,count:i,text:`${n(i)} due within the hour`}:null}function rH(e){return e.split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``}function iH(){let{state:e,actions:t}=q(),{tasks:n,reload:r}=KV(),i=qV(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=(0,v.useMemo)(()=>{let t=new Map(e.sessions.map(e=>[e.id,Dv(e)]));for(let[n,r]of Object.entries(e.pinnedRows))t.has(n)||t.set(n,Dv(r));return e=>t.get(e)??null},[e.sessions,e.pinnedRows]),u=async(e,t)=>{c(e.id);try{await t()&&r()}finally{c(null)}},d=n?.filter(e=>ze(e)).length??0;return(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`scheduled-page`,children:(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-6 sm:px-8`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,K.jsx)(Y.Clock,{className:`w-5 h-5 shrink-0 text-fg-muted`}),(0,K.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:`Scheduled`})]}),(0,K.jsxs)(`p`,{className:`mb-5 text-sm text-fg-muted`,children:[`What OonaCode's scheduler sends into your chats on this PC — once, or on a repeat — even when the chat has gone quiet.`,n&&n.length>0?` ${d} active${n.length>d?`, ${n.length-d} paused or done`:``}.`:``]}),n===null?null:n.length===0?(0,K.jsx)(`div`,{"data-testid":`scheduled-empty`,children:(0,K.jsx)(vC,{icon:(0,K.jsx)(Y.Clock,{className:`h-8 w-8`}),title:`Nothing scheduled`,hint:`Ask a chat to do something later or on a repeat — “remind me at 9 to check the build”, “every morning, summarise the new issues” — and its model schedules it with OonaCode’s scheduler. Every task, from every chat, shows here.`})}):(0,K.jsx)(`ul`,{className:`space-y-2`,"data-testid":`scheduled-list`,children:n.map(e=>{let n=eH(e),r=tH(e,i),c=l(e.sessionId),d=rH(e.prompt),f=ze(e),p=Be(e);return(0,K.jsxs)(`li`,{className:G(`rounded-xl border p-3 text-sm`,f?`bg-surface`:`bg-surface-2 opacity-60`,n?`border-warn/60`:`border-border`),"data-testid":`scheduled-row-${e.id}`,"data-active":f?`true`:`false`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,title:e.title,children:e.title}),r&&!n?(0,K.jsx)(`span`,{className:`rounded-full bg-accent-soft px-1.5 text-[11px] text-accent`,children:`due soon`}):null,e.createdBy===`model`?(0,K.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`set by the agent`}):null,(0,K.jsx)(X,{size:`sm`,variant:`ghost`,disabled:s===e.id||!e.enabled&&e.nextRunAt===null&&`at`in e.when,onClick:()=>void u(e,()=>t.updateScheduledTask(e.id,{enabled:!e.enabled})),"data-testid":`scheduled-row-toggle`,children:e.enabled?`Pause`:`Resume`}),(0,K.jsx)(X,{size:`sm`,variant:a===e.id?`danger`:`ghost`,disabled:s===e.id,onClick:()=>{if(a!==e.id){o(e.id);return}o(null),u(e,()=>t.deleteScheduledTask(e.id))},"data-testid":`scheduled-row-delete`,children:a===e.id?`Delete?`:`Delete`})]}),d?(0,K.jsxs)(`div`,{className:`mt-1 truncate text-fg-muted`,title:e.prompt,"data-testid":`scheduled-row-sends`,children:[`Sends: “`,d,`”`]}):null,(0,K.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-fg-muted`,children:[(0,K.jsx)(`span`,{"data-testid":`scheduled-row-when`,children:om(e.when)}),(0,K.jsx)(`span`,{"data-testid":`scheduled-row-next`,children:sm(e.nextRunAt,e.enabled)}),(0,K.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:[`in`,(0,K.jsx)(`button`,{type:`button`,className:`min-w-0 truncate text-accent hover:underline`,title:`Open this chat`,onClick:()=>t.selectSession(e.sessionId),"data-testid":`scheduled-row-chat`,children:c??`a chat`})]})]}),e.lastRunAt||e.lastResult?(0,K.jsxs)(`div`,{className:G(`mt-0.5 text-xs`,n?`text-warn`:`text-fg-faint`),"data-testid":`scheduled-row-last`,children:[e.lastRunAt?(0,K.jsxs)(`span`,{title:xv(e.lastRunAt),children:[`last ran `,yv(e.lastRunAt,i)]}):(0,K.jsx)(`span`,{children:`not run yet`}),e.lastResult?` · ${e.lastResult}`:``]}):null,f?null:(0,K.jsxs)(`div`,{className:`mt-0.5 text-xs text-fg-faint`,title:`Tasks that are paused or have finished are deleted 10 days after their last change`,"data-testid":`scheduled-row-deletes`,children:[e.nextRunAt===null?`Finished`:`Paused`,p?` — deleted automatically on ${xv(p)}`:``]})]},e.id)})})]})})}var aH=5e3,oH=12;function sH(e){return Math.min(oH,Math.max(4,e))}var cH=(0,v.memo)(function({messages:e,onPick:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let e=i.current;n&&e&&(e.scrollTop=e.scrollHeight)},[n]),e.length<2?null:(0,K.jsxs)(`div`,{className:`absolute right-2 top-1/2 z-10 -translate-y-1/2`,"data-testid":`user-message-rail`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||r(!1)},onKeyDown:e=>{e.key===`Escape`&&r(!1)},children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Your messages in this chat`,"aria-haspopup":`true`,"aria-expanded":n,className:`flex flex-col items-end gap-1 p-1 text-fg opacity-70 hover:opacity-100 focus-visible:opacity-100`,onClick:()=>r(!0),"data-testid":`user-message-rail-handle`,children:Array.from({length:sH(e.length)},(e,t)=>(0,K.jsx)(`span`,{className:`block h-[2px] w-5 rounded-full bg-current`},t))}),n?(0,K.jsx)(`div`,{className:`absolute right-full top-1/2 -translate-y-1/2 pr-2`,"data-testid":`user-message-rail-bridge`,children:(0,K.jsx)(`div`,{ref:i,className:`max-h-[60vh] w-72 max-w-[70vw] overflow-y-auto rounded-md border border-border bg-surface p-1 shadow-md`,"data-testid":`user-message-rail-list`,children:e.map(e=>{let n=e.reachable!==!1,i=[e.at?xv(e.at):null,e.label,n?null:`Too far back to jump to (more than ${aH.toLocaleString()} lines ago).`].filter(e=>e!==null).join(`
|
|
159
|
+
`),[t]);return(0,K.jsxs)(`pre`,{className:`lazy-block m-0 max-h-72 overflow-auto rounded-md border border-border bg-code-bg p-2 font-mono text-[12.5px] leading-relaxed`,children:[n.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-danger-soft text-danger`,children:[(0,K.jsx)(`span`,{className:`select-none pr-2 text-fg-faint`,children:`-`}),e]},`o${t}`)),r.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-ok-soft text-ok`,children:[(0,K.jsx)(`span`,{className:`select-none pr-2 text-fg-faint`,children:`+`}),e]},`n${t}`))]})}),TB=CF;function EB({name:e,input:t,inputJson:n,streaming:r}){if(!t)return n?(0,K.jsx)(gL,{code:n,language:`json`,maxHeight:`14rem`}):r?(0,K.jsx)(`div`,{className:`text-xs text-fg-faint`,children:`Receiving arguments…`}):null;switch(e){case`Bash`:case`PowerShell`:case`run_command`:{let n=SB(t.Description)??SB(t.description);return(0,K.jsxs)(`div`,{children:[n?(0,K.jsx)(`div`,{className:`mb-1 text-xs text-fg-muted`,children:n}):null,(0,K.jsx)(gL,{code:SB(t.CommandLine)??SB(t.command)??Tv(t),language:e===`PowerShell`?`powershell`:`bash`,maxHeight:`14rem`})]})}case`Edit`:case`replace_file_content`:case`multi_replace_file_content`:{let e=SB(t.TargetFile)??SB(t.file_path),n=SB(t.TargetContent)??SB(t.old_string)??``,r=SB(t.ReplacementContent)??SB(t.new_string)??``;return(0,K.jsxs)(`div`,{className:`space-y-1`,children:[e?(0,K.jsxs)(`div`,{className:`font-mono text-xs text-fg-muted`,children:[e,t.replace_all?` (replace all)`:``]}):null,(0,K.jsx)(wB,{oldText:n,newText:r})]})}case`Write`:case`write_to_file`:{let e=SB(t.TargetFile)??SB(t.file_path),n=SB(t.CodeContent)??SB(t.content)??``;return(0,K.jsxs)(`div`,{children:[e?(0,K.jsx)(`div`,{className:`mb-1 font-mono text-xs text-fg-muted`,children:e}):null,(0,K.jsx)(gL,{code:n,language:TB(e),maxHeight:`18rem`})]})}case`Read`:case`view_file`:{let e=SB(t.AbsolutePath)??SB(t.file_path)??SB(t.path)??``,n=[t.offset===void 0?null:`offset ${String(t.offset)}`,t.limit===void 0?null:`limit ${String(t.limit)}`,t.StartLine===void 0?null:`lines ${String(t.StartLine)}${t.EndLine===void 0?``:`-${String(t.EndLine)}`}`].filter(Boolean).join(`, `);return(0,K.jsxs)(`div`,{className:`font-mono text-xs text-fg-muted`,children:[e,n?` (${n})`:``]})}default:return(0,K.jsx)(gL,{code:Tv(t),language:`json`,maxHeight:`14rem`})}}function DB({blocks:e,toolName:t,input:n,onOpenPicture:r,hideImages:i}){return(0,K.jsx)(`div`,{className:`space-y-1`,children:e.map((e,a)=>{if(e.type===`image`&&i)return null;if(e.type===`image`)return(0,K.jsx)(bB,{block:e,toolName:t,input:n,onOpen:r},a);let o=e.type===`text`?e.text??``:`[${e.type}]`;return(0,K.jsx)(`pre`,{className:`pre-wrap m-0 font-mono text-[12.5px] leading-relaxed`,children:o},a)})})}var OB=`Code snippet`;function kB(e){return e===`unknown`?OB:e===`view_file`?`View file`:e===`write_to_file`?`Write`:e===`replace_file_content`||e===`multi_replace_file_content`?`Edit`:e===`run_command`?`Run command`:e===`grep_search`?`Grep`:e===`find_by_name`?`Find`:e===`list_dir`?`List directory`:e===Hm?Um:e===Km?qm:e===Ru?zu:e===Bu?Vu:e===Hu?Uu:e}var AB={streaming:`preparing`,pending:`needs approval`,running:`running`,done:`done`,error:`error`,denied:`denied`,skipped:`skipped`,cancelled:`cancelled`};function jB({status:e}){switch(e){case`streaming`:case`running`:return(0,K.jsx)(Y.Spinner,{className:`w-3.5 h-3.5 text-accent`});case`pending`:return(0,K.jsx)(Y.Shield,{className:`w-3.5 h-3.5 text-warn`});case`done`:return(0,K.jsx)(Y.Check,{className:`w-3.5 h-3.5 text-ok`});case`error`:case`denied`:return(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5 text-danger`});case`skipped`:case`cancelled`:return(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5 text-fg-faint`})}}function MB(e){for(let t of e)if(t.item.kind===`permission`&&t.item.status===`pending`||t.children.length>0&&MB(t.children))return!0;return!1}var NB=(0,v.memo)(function({node:e,renderChildren:t}){let n=e.item,r=n.status===`error`||n.status===`denied`,[i,a]=(0,v.useState)(null),o=jz(n.id,a),s=MB(e.children),c=JL.has(n.name)&&(n.status===`done`||n.status===`cancelled`),l=n.name===`Read`||n.name===`view_file`,u=(0,v.useMemo)(()=>{if(!l||!n.input)return null;let e=SB(n.input.AbsolutePath)??SB(n.input.file_path)??SB(n.input.path);return e&&e.trim()?e.trim():null},[l,n.input]),d=(0,v.useMemo)(()=>u?ud(u):null,[u]),f=(0,v.useContext)(eL),p=(0,v.useMemo)(()=>{if(!u)return null;if(/^[A-Za-z]:[\\/]/.test(u)||u.startsWith(`/`))return u;if(f.cwd){let e=f.platform===`win32`||f.cwd.includes(`\\`)?`\\`:`/`;return`${f.cwd.replace(/[\\/]+$/,``)}${e}${u}`}return u},[u,f.cwd,f.platform]),m=(0,v.useMemo)(()=>l?aB(n.result):null,[l,n.result]),h=d!==null&&n.result!==null&&!n.result.isError&&!!f.grant&&!!f.sessionId&&p!==null&&(d.kind===`audio`||d.kind===`video`||d.kind===`image`&&!m),g=l&&n.result!==null&&!n.result.isError&&(m!==null||h),_=s||o||(i??(r||n.status===`pending`||g||e.children.length>0&&!c)),y=(0,v.useMemo)(()=>CB(n.name,n.input),[n.name,n.input]),b=yB(_?null:m,cB(n.name,n.input,m?.mediaType??`image/png`)),{onClick:x,...S}=b.handlers,C=(0,v.useMemo)(()=>n.name===Ru?aB(n.result):null,[n.name,n.result]),w=(0,v.useMemo)(()=>C?oB(C):``,[C]),T=(0,v.useMemo)(()=>C?lB(n.result,C.mediaType):``,[C,n.result]),E=(0,v.useMemo)(()=>(n.name===Bu||n.name===Hu)&&n.result&&!n.result.isError?uB(n.result):null,[n.name,n.result]),[D,O]=(0,v.useState)(null),k=(0,v.useMemo)(()=>_?gv(n.result):``,[_,n.result]),A=n.result!==null&&!n.result.isError&&(typeof n.result.content==`string`&&/^Async agent launched/i.test(n.result.content.trimStart())||n.result.structured?.status===`async_launched`),j=n.durationMs===null?n.elapsedSec!==null&&!n.result?_v(n.elapsedSec*1e3):``:_v(n.durationMs);return(0,K.jsxs)(`div`,{"data-testid":`tool-${n.toolUseId}`,className:G(`my-1.5 overflow-hidden rounded-lg border bg-surface text-sm`,r?`border-danger/50`:n.status===`pending`?`border-warn/60`:`border-border`),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":_,onClick:()=>{x?.(),a(s?null:!_)},...S,className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-surface-2`,children:[(0,K.jsx)(jB,{status:n.status}),(0,K.jsx)(Y.Tool,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:kB(n.name)}),y?(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg-muted`,children:y}):(0,K.jsx)(`span`,{className:`flex-1`}),j?(0,K.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:j}):null,(0,K.jsx)(Q,{tone:r?`danger`:n.status===`pending`?`warn`:n.status===`done`?`ok`:`neutral`,children:AB[n.status]}),(0,K.jsx)(Y.Chevron,{open:_,className:`w-3.5 h-3.5 text-fg-faint`})]}),C&&!r?(0,K.jsxs)(`div`,{className:`border-t border-border px-2.5 py-2`,"data-testid":`tool-generated`,children:[C.base64===null?(0,K.jsx)(`img`,{src:w,alt:T,className:`block rounded border border-border object-contain`,style:{maxWidth:280,maxHeight:280}}):(0,K.jsx)(`button`,{type:`button`,"aria-label":`Open ${T} in the viewer`,title:`${T} — open in the viewer`,"data-testid":`tool-generated-picture`,onClick:()=>O({name:T,mediaType:C.mediaType,base64:C.base64}),className:`block cursor-zoom-in rounded p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,K.jsx)(`img`,{src:w,alt:T,draggable:!1,className:`block rounded border border-border object-contain`,style:{maxWidth:280,maxHeight:280}})}),(0,K.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-muted`,title:T,children:T})]}):null,E?(0,K.jsxs)(`div`,{className:`border-t border-border px-2.5 py-2`,"data-testid":`tool-generated-media`,children:[f.grant&&f.sessionId&&!f.remote?(0,K.jsx)(uL,{sessionId:f.sessionId,path:E.path,kind:n.name===Bu?`video`:`audio`,grant:f.grant,autoPlay:!1}):null,(0,K.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-muted`,title:E.path,children:E.name})]}):null,_?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border px-2.5 py-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[11px] uppercase tracking-wide text-fg-faint`,children:`Input`}),(0,K.jsx)(EB,{name:n.name,input:n.input,inputJson:n.inputJson,streaming:n.status===`streaming`})]}),e.children.length>0?(0,K.jsxs)(`div`,{className:`border-l-2 border-think/40 pl-2`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-[11px] uppercase tracking-wide text-think`,children:`Subagent`}),t(e.children)]}):null,n.result&&A?(0,K.jsx)(`div`,{className:`text-xs text-fg-faint`,"data-testid":`tool-launch-note`,children:`Launched in the background — the chat is told when it finishes.`}):n.result?(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] uppercase tracking-wide text-fg-faint`,children:[(0,K.jsx)(`span`,{children:n.result.isError?`Error`:`Result`}),k?(0,K.jsxs)(`span`,{className:`normal-case`,children:[k.length.toLocaleString(),` chars`]}):null]}),h&&d&&f.grant&&f.sessionId&&p?(0,K.jsx)(`div`,{className:`mb-2`,"data-testid":`tool-inline-media`,children:(0,K.jsx)(uL,{sessionId:f.sessionId,path:p,kind:d.kind,grant:f.grant})}):null,(0,K.jsx)(`div`,{className:G(`lazy-block max-h-72 overflow-auto rounded-md border p-2`,n.result.isError?`border-danger/40 bg-danger-soft text-danger`:`border-border bg-code-bg`),children:typeof n.result.content==`string`?(0,K.jsx)(`pre`,{className:`pre-wrap m-0 font-mono text-[12.5px] leading-relaxed`,children:n.result.content.replace(/<\/?tool_use_error>/g,``).trim()||`(empty)`}):(0,K.jsx)(DB,{blocks:n.result.content,toolName:n.name,input:n.input,onOpenPicture:O,hideImages:C!==null})})]}):n.status===`cancelled`?(0,K.jsx)(`div`,{className:`text-xs text-fg-faint`,children:`No result (turn ended before the tool finished).`}):null]}):null,b.popup,D?(0,K.jsx)(xB,{picture:D,onClose:()=>O(null)}):null]})}),PB=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(null),r=jz(e.id,n)||(t??e.streaming),i=Ez(e.text,e.streaming),a=IB(i),o=(0,v.useMemo)(()=>r||e.streaming||e.redacted?``:FB(e.text),[r,e.streaming,e.redacted,e.text]);return!e.streaming&&!e.redacted&&a===0?null:!e.streaming&&e.redacted?(0,K.jsxs)(`div`,{className:`my-1.5 flex items-center gap-2 rounded-lg border border-think/20 bg-think-soft/20 px-2.5 py-1.5 text-sm text-think/70`,"data-testid":`thought-empty`,title:`The provider hid this thought: only an encrypted copy came back, which the model reads and nobody else can.`,children:[(0,K.jsx)(Y.Brain,{className:`w-3.5 h-3.5`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Redacted thinking`}),(0,K.jsx)(`span`,{className:`text-xs opacity-70`,children:`hidden`})]}):(0,K.jsxs)(`div`,{className:`my-1.5 rounded-lg border border-think/30 bg-think-soft/40 text-sm`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>n(!r),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-think`,children:[e.streaming?(0,K.jsx)(Y.Spinner,{className:`w-3.5 h-3.5`}):(0,K.jsx)(Y.Brain,{className:`w-3.5 h-3.5`}),(0,K.jsx)(`span`,{className:`font-medium`,children:e.redacted?`Redacted thinking`:e.streaming?`Thinking…`:`Thought`}),a?(0,K.jsxs)(`span`,{className:`text-xs opacity-70`,"data-testid":`thought-words`,children:[a.toLocaleString(`en-US`),` `,a===1?`word`:`words`]}):null,e.durationMs!==null&&e.durationMs!==void 0?(0,K.jsx)(`span`,{className:`text-xs tabular-nums opacity-70`,"data-testid":`thought-duration`,title:`How long the model spent on this thought`,children:_v(e.durationMs)}):null,o?(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg-muted`,"data-testid":`thought-preview`,children:[`: `,o]}):(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:r,className:`w-3.5 h-3.5 opacity-70`})]}),r&&!e.redacted?(0,K.jsx)(`div`,{className:G(`border-t border-think/20 px-3 py-2 text-fg-muted`,e.streaming&&`caret`),children:e.streaming?(0,K.jsx)(`div`,{className:`pre-wrap`,"data-testid":`thinking-stream`,children:i}):(0,K.jsx)(CL,{text:e.text})}):null]})});function FB(e){return e.slice(0,600).replace(/\*\*|__/g,``).replace(/^[\s#>*-]+/,``).replace(/\s+/g,` `).trim().slice(0,200)}function IB(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i===32||i===10||i===13||i===9?n=!1:n||(n=!0,t++)}return t}function LB(e){if(!e)return!1;if(e.tagName===`TEXTAREA`)return!0;if(e.tagName===`INPUT`){let t=(e.type||`text`).toLowerCase();return![`button`,`checkbox`,`radio`,`submit`,`reset`,`range`,`color`,`file`].includes(t)}return e.isContentEditable===!0}function RB(e){!e||typeof document>`u`||LB(document.activeElement)||e.querySelector(`[data-autofocus]`)?.focus()}function zB(e){if(!e)return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e instanceof HTMLElement&&e.isContentEditable}function BB(e,t,n){if(!e||!n||n.querySelector(`[role="dialog"][aria-modal="true"]`))return!1;let r=t instanceof Element?t:null;if(r&&r.closest(`[data-keep-escape]`))return!1;let i=VB(e);if(i!==null&&r&&r!==n.body){let e=VB(r);if(e!==null&&e!==i)return!1}if(r&&zB(r)&&!e.contains(r)&&r.closest(`[data-testid="composer"]`)===null)return!1;let a=Array.from(n.querySelectorAll(`[data-permission-pending="true"]`)).find(e=>i===null||VB(e)===i);return a===void 0||a===e}function VB(e){return e.closest(`[data-chat-group]`)?.getAttribute(`data-chat-group`)??e.closest(`[data-editor-group]`)?.getAttribute(`data-editor-group`)??null}var HB=(0,v.memo)(function({item:e,agentName:t}){let n=e.request,[r,i]=(0,v.useState)(!1),a=e.status===`allowed`,o=(0,v.useMemo)(()=>ih(n.toolName,n.input,110),[n]),s=n.agentId?t??`background agent`:null;if(n.toolName===`AskUserQuestion`){let e=Gl(n.input).length;return(0,K.jsxs)(`div`,{className:`my-1 flex items-center gap-2 px-1 py-0.5 text-xs text-fg-faint`,children:[a?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0`}),(0,K.jsx)(`span`,{"data-testid":`permission-${n.requestId}`,children:ql({outcome:a?`answered`:`dismissed`,questions:e})}),s?(0,K.jsx)(`span`,{title:n.agentId??void 0,className:`shrink-0`,children:(0,K.jsx)(Q,{tone:`think`,children:s})}):null]})}let c=mT(n);return(0,K.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`permission-${n.requestId}`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-surface-2`,children:[a?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0 text-danger`}),(0,K.jsxs)(`span`,{className:`shrink-0`,"data-testid":c?`connector-settled`:void 0,children:[c?hT(c,a):`${a?`Allowed`:`Denied`} ${n.displayName??n.toolName}`,e.resolvedBy===`auto`?` (automatically)`:e.resolvedBy&&e.resolvedBy!==`local`?` (by ${e.resolvedBy})`:``]}),o?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-fg-muted`,"data-testid":`permission-summary`,children:o}):null,s?(0,K.jsx)(`span`,{title:n.agentId??void 0,className:`shrink-0`,children:(0,K.jsx)(Q,{tone:`think`,children:s})}):null,(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:r,className:`w-3 h-3 shrink-0`})]}),r?(0,K.jsx)(`div`,{className:`ml-5 mt-1`,children:(0,K.jsx)(EB,{name:n.toolName,input:n.input})}):null]})});function UB({items:e,agentNameOf:t}){let[n,r]=(0,v.useState)(!1),i=jz((0,v.useMemo)(()=>e.map(e=>e.id),[e]),r),{allowed:a,denied:o,tools:s,who:c}=(0,v.useMemo)(()=>{let n=e.filter(e=>e.status===`allowed`).length,r=new Map,i=new Set;for(let n of e){let e=mT(n.request),a=e?`${e.tool} (${e.vendor})`:n.request.displayName??n.request.toolName;r.set(a,(r.get(a)??0)+1),n.request.agentId&&i.add(t(n.request.agentId)??`background agent`)}return{allowed:n,denied:e.length-n,tools:[...r.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>t>1?`${e} ×${t}`:e).join(`, `),who:[...i]}},[e,t]);return(0,K.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`permission-run`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":n||i,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-surface-2`,children:[o===0?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0 text-danger`}),(0,K.jsxs)(`span`,{className:`shrink-0`,children:[a>0?`Allowed ${a}`:``,a>0&&o>0?` · `:``,o>0?`Denied ${o}`:``]}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-fg-muted`,"data-testid":`permission-run-tools`,children:s}),c.length>0?(0,K.jsx)(`span`,{className:`shrink-0`,children:(0,K.jsx)(Q,{tone:`think`,children:c.length===1?c[0]:`${c.length} agents`})}):null,(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:n||i,className:`w-3 h-3 shrink-0`})]}),n||i?(0,K.jsx)(`div`,{className:`ml-3`,children:e.map(e=>(0,K.jsx)(HB,{item:e,agentName:e.request.agentId?t(e.request.agentId):null},e.id))}):null]})}function WB({item:e,onDecide:t,stackIndex:n,agentName:r}){let i=e.request,[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=i.title??`Allow ${i.displayName??i.toolName}?`,u=(0,v.useRef)(t);u.current=t;let d=(0,v.useRef)(null),f=e.status===`pending`;if((0,v.useEffect)(()=>{if(f&&typeof document<`u`){let e=e=>{e.key===`Escape`&&BB(d.current,e.target,document)&&(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),u.current({behavior:`deny`}))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)}},[f]),(0,v.useEffect)(()=>{f&&RB(d.current)},[f]),e.status!==`pending`)return(0,K.jsx)(HB,{item:e,agentName:r??null});if(i.toolName===`AskUserQuestion`)return(0,K.jsx)(cz,{item:e,onDecide:t,cardRef:d,...n===void 0?{}:{stackIndex:n}});let p=ou(i);if(p)return(0,K.jsx)(lz,{input:p,requestId:i.requestId,onDecide:t,cardRef:d});let m=mT(i);if(m)return(0,K.jsx)(pz,{input:m,requestId:i.requestId,onDecide:t,cardRef:d});let h=pd(i);if(h)return(0,K.jsx)(Cz,{input:h,requestId:i.requestId,onDecide:t,cardRef:d});let g=Xm(i);if(g)return(0,K.jsx)(xz,{input:g,requestId:i.requestId,onDecide:t,cardRef:d});let _=Wm(i);return _?(0,K.jsx)(mz,{input:_,requestId:i.requestId,onDecide:t,cardRef:d}):(0,K.jsxs)(`div`,{ref:d,className:`my-2 rounded-lg border border-warn/60 bg-warn-soft/40 p-3 text-sm shadow-sm`,role:`group`,"aria-label":`Permission request`,"data-permission-pending":`true`,"data-testid":`permission-${i.requestId}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(Y.Shield,{className:`mt-0.5 w-4 h-4 text-warn`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-semibold`,children:l}),(0,K.jsx)(Q,{tone:`warn`,children:i.toolName}),i.agentId?(0,K.jsx)(Q,{tone:`think`,children:`subagent`}):null]}),i.description?(0,K.jsx)(`div`,{className:`mt-0.5 text-fg-muted`,children:i.description}):null,i.decisionReason?(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-faint`,children:i.decisionReason}):null,i.blockedPath?(0,K.jsxs)(`div`,{className:`mt-0.5 font-mono text-xs text-danger`,children:[`Blocked path: `,i.blockedPath]}):null]})]}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(EB,{name:i.toolName,input:i.input})}),a?(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(`input`,{className:Z,placeholder:`Optional: tell the agent why (sent as the tool result)`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&t(s.trim()?{behavior:`deny`,message:s.trim()}:{behavior:`deny`})}})}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(X,{variant:`inverse`,onClick:()=>t({behavior:`allow`}),"data-autofocus":!0,children:[(0,K.jsx)(Y.Check,{className:`w-3.5 h-3.5`}),` Allow`]}),(0,K.jsx)(X,{variant:`secondary`,title:`Allow and remember this rule for the session/project`,onClick:()=>t({behavior:`allow`,remember:!0}),children:`Allow always`}),a?(0,K.jsx)(X,{variant:`secondary`,onClick:()=>t(s.trim()?{behavior:`deny`,message:s.trim()}:{behavior:`deny`}),children:`Confirm deny`}):(0,K.jsxs)(X,{variant:`ghost`,onClick:()=>o(!0),children:[(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5`}),` Deny`]}),(0,K.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`Enter = allow · Esc = deny`})]})]})}var GB=6e4,KB=1e4;function qB(e,t=KB,n=300){if(e.length>=t)return!0;let r=1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)===10&&(r++,r>=n))return!0;return!1}function JB(e){return Math.ceil(Math.max(0,e)/3)*4}function YB(e,t){return t?Math.min(e.size,GB):JB(e.size)}function XB(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${Math.max(0,Math.round(e))} B`}function ZB(e,t={}){let n=t.budget??6291456,r=t.isText??(()=>!1),i=Math.max(0,t.usedBytes??0),a=[],o=[],s=0;for(let t of e){let e=YB(t,r(t));if(e>n){o.push({name:t.name,reason:`too large — ${XB(t.size)} becomes ${XB(e)} once encoded (limit ${XB(n)})`});continue}if(i+e>n){o.push({name:t.name,reason:`would exceed the ${XB(n)} attachment budget — send the staged files first`});continue}i+=e,s+=e,a.push(t)}return{accepted:a,rejected:o,addedBytes:s}}var QB=3e3;function $B(e,t,n){return e?.providerId!==`oonacode`||(n?.priceUsdMonthly??0)>0?null:t?.free===!0?`free`:`pool`}function eV(e){switch(e){case`free`:return`Waiting for a free-lane slot — free requests are paced, so the first reply can take a few seconds.`;case`pool`:return`Waiting for a slot on the OonaCode pool — the request is queued behind the provider’s rate limits.`;default:return null}}function tV(e,t,n=QB){let[r,i]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(i(!1),!e)return;let t=setTimeout(()=>i(!0),n);return()=>clearTimeout(t)},[e,t,n]),r}function nV(e){let t=Math.floor(e/6e4);if(t<60)return`${Math.max(1,t)}m`;let n=Math.floor(t/60);if(n<24)return`${n}h ${t-n*60}m`;let r=Math.floor(n/24);return`${r}d ${n-r*24}h`}function rV(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function iV(e){let{lastTurnEndedAt:t,now:n,ttlSec:r,contextTokens:i,running:a}=e;if(a||t===null||r===null||r<=0||i!==null&&i<1024)return null;let o=n-t;if(!Number.isFinite(o)||o<r*1e3)return null;let s=i===null?`the whole conversation`:`about ${rV(i)} tokens`;return`Idle ${nV(o)}. The prompt cache has likely expired, so your next message will re-cache ${s}.`}var aV=new Map;function oV(e){e===void 0?aV.clear():aV.delete(e)}function sV(e){let{text:t,chatId:n,disabled:r=!1,load:i,onPick:a}=e,o=_h(t),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[,d]=(0,v.useState)(0),f=(0,v.useRef)(null);(0,v.useEffect)(()=>{o===null&&c(!1)},[o]),(0,v.useEffect)(()=>{u(null)},[o,n]);let p=o!==null&&!s&&!r&&n!==null,m=n!==null&&!r&&(p||/^\/\S+\s/.test(t)),h=n===null?void 0:aV.get(n),g=h!==void 0&&Date.now()-h.at<6e4;(0,v.useEffect)(()=>{if(!m||n===null||g||f.current===n)return;f.current=n;let e=!0;return i(n).then(e=>{aV.set(n,{at:Date.now(),commands:e===null||e===`unsupported`?null:[...Sh(e.commands)],unsupported:e===`unsupported`})}).catch(()=>{aV.set(n,{at:Date.now(),commands:null,unsupported:!1})}).finally(()=>{f.current===n&&(f.current=null),e&&d(e=>e+1)}),()=>{e=!1}},[m,n,g,i]);let _=h?.commands??null,{items:y,sections:b,best:x}=(0,v.useMemo)(()=>{if(!_||o===null)return{items:[],sections:[],best:0};let e=Ch(_,o),t=kh(e),n=[],r=0;for(let e of Eh)t[e].length!==0&&(n.push({id:e,title:Dh[e],start:r,items:t[e]}),r+=t[e].length);let i=n.flatMap(e=>e.items),a=e[0];return{items:i,sections:n,best:o.length>0&&a?Math.max(i.indexOf(a),0):0}},[_,o]),S=(0,v.useMemo)(()=>_?wh(t,_):null,[_,t]),C=h===void 0?`loading`:h.unsupported?`unsupported`:h.commands===null?`error`:`ready`,w=p&&C!==`unsupported`,T=y.length===0?0:Math.min(l??x,y.length-1),E=(0,v.useCallback)(e=>`/${e.name} `,[]),D=(0,v.useCallback)(()=>c(!0),[]);return{open:w,status:C,query:o??``,items:y,sections:b,active:T,setActive:u,inArguments:S,onKeyDown:e=>{if(!w||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`)return e.preventDefault(),c(!0),!0;if(y.length===0)return!1;if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;return u((T+t+y.length)%y.length),!0}let t=y[T];if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`&&!e.shiftKey){let n=o!==null&&(t.name.toLowerCase()===o.toLowerCase()||(t.aliases??[]).some(e=>e.toLowerCase()===o.toLowerCase()));return e.key===`Enter`&&n?!1:t.availability===`ok`?(e.preventDefault(),a(E(t)),!0):(e.preventDefault(),!0)}return!1},textFor:E,dismiss:D}}var cV=`slash-command-menu`,lV=e=>`slash-command-option-${e}`,uV=`The model may also use it on its own in this chat (switched on in the Skills menu)`,dV=`Picking or typing a skill runs it once, in this message, whatever the Skills menu says. The model is shown a skill on its own only when it is switched on in the Skills menu under the message box — then it costs its tokens on every message.`;function fV({menu:e,onPick:t,modelSkills:n=null}){let r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{(r.current?.querySelector(`#${lV(e.active)}`))?.scrollIntoView?.({block:`nearest`})},[e.active,e.items]),e.open?(0,K.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 overflow-hidden rounded-lg border border-border bg-surface shadow-lg`,"data-testid":`slash-menu`,children:[e.status===`loading`?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-fg-muted`,role:`status`,children:[(0,K.jsx)(Y.Spinner,{className:`h-3.5 w-3.5 animate-spin`}),` Reading this chat’s commands…`]}):e.status===`error`?(0,K.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,role:`status`,children:`The host could not list this chat’s commands right now — type the command, it still runs.`}):e.items.length===0?(0,K.jsxs)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,role:`status`,"data-testid":`slash-empty`,children:[`No command or skill matches “/`,e.query,`” — Enter sends it to the model as a message.`]}):(0,K.jsx)(`ul`,{ref:r,id:cV,role:`listbox`,"aria-label":`Skills and commands`,className:`max-h-72 overflow-y-auto pb-1`,children:e.sections.map(r=>(0,K.jsx)(pV,{section:r,menu:e,onPick:t,modelSkills:n},r.id))}),(0,K.jsx)(`div`,{className:`hidden border-t border-border px-3 py-0.5 text-right text-[10px] text-fg-faint sm:block`,children:`↑↓ to move · Enter or Tab to pick · Esc to close`})]}):null}function pV({section:e,menu:t,onPick:n,modelSkills:r}){let i=`slash-section-${e.id}`,a=e=>e.modelSkill===void 0?null:(r??[]).includes(e.modelSkill),o=e.items.filter(e=>a(e)!==null),s=o.some(e=>a(e)===!0);return(0,K.jsxs)(`li`,{role:`presentation`,"data-testid":`slash-section`,"data-section":e.id,children:[(0,K.jsxs)(`div`,{id:i,className:`sticky top-0 z-10 flex items-baseline gap-2 border-b border-border bg-surface px-3 pb-0.5 pt-1.5 text-[11px]`,children:[(0,K.jsx)(`span`,{className:`font-semibold uppercase tracking-wide text-fg-muted`,"data-testid":`slash-section-title`,children:e.title}),e.id===`skills`?(0,K.jsx)(`span`,{className:`ml-auto flex min-w-0 items-center gap-1 truncate text-fg-faint`,title:dV,"data-testid":`slash-skills-note`,children:o.length===0?`Picking one runs it once`:s?(0,K.jsxs)(K.Fragment,{children:[`Picking one runs it once · `,(0,K.jsx)(Y.Skill,{className:`h-3 w-3 shrink-0 text-accent`}),` `,`the model may also use it here`]}):`Picking one runs it once · the model is not shown these here`}):null]}),(0,K.jsx)(`ul`,{role:`group`,"aria-labelledby":i,children:e.items.map((r,i)=>{let o=e.start+i;return(0,K.jsx)(mV,{item:r,index:o,active:o===t.active,onHover:t.setActive,onPick:n,modelOn:a(r)},r.name)})})]})}var mV=(0,v.memo)(function({item:e,index:t,active:n,onHover:r,onPick:i,modelOn:a}){let o=e.availability!==`ok`,s=Th(e.source),c=jh(e.description);return(0,K.jsxs)(`li`,{id:lV(t),role:`option`,"aria-selected":n,"aria-disabled":o||void 0,"data-testid":`slash-item`,"data-name":e.name,"data-model-skill":a===null?void 0:a?`on`:`off`,title:e.description||void 0,className:G(`flex cursor-pointer flex-col gap-0.5 px-3 py-1.5 text-xs`,n?`bg-accent-soft`:`hover:bg-surface-2`,o&&`cursor-default opacity-60`),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>r(t),onClick:()=>{o||i(e)},children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,K.jsxs)(`span`,{className:`shrink-0 font-mono font-medium text-fg`,children:[`/`,e.name]}),e.argumentHint?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-fg-faint`,children:e.argumentHint}):null,(0,K.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[a===!0&&!o?(0,K.jsx)(`span`,{className:`text-accent`,title:uV,"aria-label":uV,"data-testid":`slash-model-state`,children:(0,K.jsx)(Y.Skill,{className:`h-3 w-3`})}):null,s?(0,K.jsx)(`span`,{className:`rounded border border-border px-1 text-[10px] uppercase tracking-wide text-fg-muted`,children:s}):null]})]}),o?(0,K.jsxs)(`div`,{className:`text-fg-muted`,"data-testid":`slash-reason`,children:[`Not available here — `,e.reason]}):c?(0,K.jsx)(`div`,{className:`truncate text-fg-muted`,"data-testid":`slash-summary`,children:c}):null]})});function hV({item:e}){return e&&e.availability!==`ok`?(0,K.jsxs)(`div`,{className:`px-1 pt-0.5 text-[11px] text-warn`,"data-testid":`slash-hint`,children:[(0,K.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.name]}),` is not available here — `,e.reason]}):!e||!e.argumentHint&&!e.note?null:(0,K.jsxs)(`div`,{className:`px-1 pt-0.5 text-[11px] text-fg-faint`,"data-testid":`slash-hint`,children:[(0,K.jsxs)(`span`,{className:`font-mono`,children:[`/`,e.name,` `,e.argumentHint]}),e.note?(0,K.jsxs)(`span`,{children:[` — `,e.note]}):null]})}var gV=`field-sizing-content w-auto max-w-full shrink-0 rounded-md border border-border bg-surface-2 py-0.5 pl-1.5 pr-1 text-xs text-fg hover:border-fg-faint focus:border-accent focus:outline-none disabled:opacity-50`,_V=[{value:`default`,label:`Ask (default)`},{value:`acceptEdits`,label:`Accept edits`},{value:`plan`,label:`Plan`},{value:`auto`,label:`Auto`},{value:`dontAsk`,label:`Don't ask`},{value:`bypassPermissions`,label:`Bypass permissions`}],vV=`Ask anything — build, fix, explain…`,yV=M;function bV(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>{let e=String(r.result??``);t(e.slice(e.indexOf(`,`)+1))},r.readAsDataURL(e)})}function xV(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>t(String(r.result??``)),r.readAsText(e)})}function SV(e){if(e.type.startsWith(`image/`))return`image`;if(e.type===`application/pdf`)return`document`;if(e.type.startsWith(`text/`))return`text`;if(e.type)return`path`;let t=TF(e.name);return t.kind===`image`?`image`:t.kind===`pdf`?`document`:t.kind===`audio`||t.kind===`video`?`path`:`text`}function CV(e){return e.map(e=>e.kind===`image`?{type:`image`,source:{type:`base64`,media_type:e.mediaType,data:e.data}}:e.kind===`document`?{type:`document`,source:{type:`base64`,media_type:e.mediaType||`application/pdf`,data:e.data}}:e.kind===`path`?{type:`text`,text:oh({name:e.name,mediaType:e.mediaType||`file`,sizeText:XB(e.size),path:e.path??e.name})}:{type:`text`,text:`Attached file ${e.name}:\n\n\`\`\`\n${e.data}\n\`\`\``})}function wV(){let{state:e,actions:t,dispatch:n,api:r}=q(),i=QS(),a=$S(),o=ZS(),{sessionId:s,focused:c}=YS(),l=s?e.unsent[s]:void 0,[u,d]=(0,v.useState)(()=>l?.text??``),[f,p]=(0,v.useState)(()=>[...l?.attachments??[]]),[m,h]=(0,v.useState)(()=>[...l?.replies??[]]),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(yV),[x,S]=(0,v.useState)(!1),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(0),E=(0,v.useRef)(!0),[D,O]=(0,v.useState)(null),k=(0,v.useCallback)(e=>{if(e.kind===`path`){zz(e.path??``,t.toast);return}Uz(e.kind===`text`?{name:e.name,mediaType:`text/plain`,base64:Nz(e.data)}:{name:e.name,mediaType:e.mediaType||`application/pdf`,base64:e.data},t.toast)},[t]),A=(0,v.useRef)({text:u,attachments:f,replies:m});A.current={text:u,attachments:f,replies:m},(0,v.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]);let j=(0,v.useRef)(o?.status??null);j.current=o?.status??null,(0,v.useEffect)(()=>{let e=C.current;if(e)return $x(e,{report:e=>t.reportDiagnostic(`message box lost the focus while typing`,{...e,chatStatus:j.current})})},[t]),(0,v.useEffect)(()=>{if(s)return()=>t.rememberUnsent(s,A.current)},[s,t]),(0,v.useEffect)(()=>{if(s)return cx(s,()=>A.current)},[s]),(0,v.useEffect)(()=>{l&&(d(e=>e.length===0?l.text:e),p(e=>e.length===0?[...l.attachments]:e),h(e=>e.length===0?[...l.replies??[]]:e))},[l]);let M=e.composerQuote,F=(0,v.useRef)(M?.seq??0);(0,v.useEffect)(()=>{!M||M.seq<=F.current||(F.current=M.seq,M.sessionId===s&&(h(e=>e.some(e=>e.quote===M.text)?e:[...e,{id:`reply-${M.seq}`,quote:M.text,preview:M.preview,itemId:M.itemId}]),C.current?.focus()))},[M,s]);let I=i?.effort??a?.effort??``;(0,v.useEffect)(()=>{_(I)},[s,I]);let ne=o?.status===`running`||o?.status===`waiting_permission`,re=e.connection.status===`open`,L=Aw(),R=jw(),z=!s||L||R!==null,B=Bw(),ie=De(B.option),V=(0,v.useMemo)(()=>Te(B.option),[B.option]),ae=(0,v.useMemo)(()=>{let e=ng(B.option,B.modelId);return e.length===0?[]:I&&!e.includes(I)&&!V?[...e,I]:e},[B.option,B.modelId,I,V]),oe=g&&ae.includes(g)?g:V??g,se=B.auto!==null,ce=ae.length>0&&!se,le=(0,v.useMemo)(()=>e.providers.find(e=>e.definition.id===B.providerId)?.definition,[e.providers,B.providerId]),ue=L?`This session runs on a PC that is offline — read-only`:R?`${R} is no longer offered — pick another model to continue`:z?`Open a chat to start`:ne?`Agent is working — a message sent now is handed to it and read at its next step (Esc to stop)`:vV;(0,v.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,240)}px`};if(t(),typeof ResizeObserver>`u`)return;let n=e.clientWidth,r=new ResizeObserver(()=>{e.clientWidth!==n&&(n=e.clientWidth,t())});return r.observe(e),()=>r.disconnect()},[u,ue]);let de=(0,v.useRef)(c);de.current=c,(0,v.useEffect)(()=>{de.current&&C.current?.focus()},[s]);let fe=te(a?.permissionMode?{permissionMode:a.permissionMode,posture:a.posture??null}:i);(0,v.useEffect)(()=>{b(ie?fe:yV)},[ie,fe,s]);let pe=ig(B.providerId),me=og(B.providerId);(0,v.useEffect)(()=>{!a||!ie||!pe||og(B.providerId).some(e=>e.id===fe)||t.setSessionPosture(yV,s??void 0)},[a,ie,pe,B.providerId,fe,s,t]);let he=(0,v.useMemo)(()=>f.reduce((e,t)=>e+t.data.length,0),[f]),ge=(0,v.useRef)(he);ge.current=he;let _e=(0,v.useCallback)(async(e,n={})=>{let o=Array.from(e);if(o.length===0)return;let c=ZB(o,{usedBytes:ge.current,isText:e=>{let t=SV(e);return t===`text`||t===`path`||t===`image`&&e.size>2097152}});for(let e of c.rejected)t.toast(`error`,`${e.name} was not attached: ${e.reason}`);let l=Rz(),u=`this window cannot say where the file lives — type its full path into the message, or use the desktop app`,d=[],f=i?.cwd||(a?.projectDir??null);for(let e of c.accepted){let i=SV(e);i===`image`&&e.size>2097152&&(i=`path`);let a=!1;if((i===`image`||i===`document`)&&le&&B.modelId&&!se&&Xs(le,B.modelId,[{type:i}])&&(i=`path`,a=!0),i===`path`){let o=l?.(e)??null;if(!o&&(n.isPaste||a||i===`path`&&e.type?.startsWith(`image/`))&&r?.saveTmpFile)try{let t=await bV(e),n=await r.saveTmpFile({sessionId:s??null,cwd:f,name:e.name||`attachment`,mediaType:e.type||TF(e.name).mime||`application/octet-stream`,base64:t});n.ok&&n.path&&(o=n.path)}catch{}if(!o){t.toast(`error`,`${e.name||`File`} was not attached: ${u}`);continue}d.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||`file`,mediaType:e.type||TF(e.name).mime||`application/octet-stream`,data:``,kind:i,path:o,size:e.size});continue}try{let a=i===`text`?(await xV(e)).slice(0,GB):await bV(e);if(i===`text`&&PF(a)){let i=l?.(e)??null;if(!i&&n.isPaste&&r?.saveTmpFile)try{let t=await bV(e),n=await r.saveTmpFile({sessionId:s??null,cwd:f,name:e.name||`file.bin`,mediaType:e.type||`application/octet-stream`,base64:t});n.ok&&n.path&&(i=n.path)}catch{}i?d.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||`file`,mediaType:e.type||`application/octet-stream`,data:``,kind:`path`,path:i,size:e.size}):t.toast(`error`,`${e.name||`File`} was not attached: it is not text, and ${u}`);continue}let o=l?.(e)??null;if(!o&&i===`image`&&r?.saveTmpFile)try{let t=await r.saveTmpFile({sessionId:s??null,cwd:f,name:e.name||`image.png`,mediaType:e.type||`image/png`,base64:a});t.ok&&t.path&&(o=t.path)}catch{}d.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:e.name||(i===`image`?`image`:`file`),mediaType:e.type||(i===`text`?`text/plain`:`application/octet-stream`),data:a,kind:i,path:o??void 0,size:e.size})}catch{t.toast(`error`,`${e.name||`File`} could not be read — nothing was attached`)}}d.length>0&&p(e=>[...e,...d])},[t,r,le,B.modelId,se,a?.projectDir,i?.cwd,s]),ve=y===yV?null:N(y),ye=(0,v.useCallback)(e=>{d(e);let t=C.current;t&&(t.focus(),requestAnimationFrame(()=>t.setSelectionRange(e.length,e.length)))},[]),be=sV({text:u,chatId:s,disabled:z,load:t.listCommands,onPick:ye}),xe=(0,v.useCallback)(()=>{let e=u.trim();if(!s||R!==null||!e&&f.length===0)return;let n=ad(m.map(e=>e.quote),e||`Please look at the attached file(s).`),r=yh(n,`app`);if(r){t.toast(`error`,bh(r));return}let i=f,a=m,o=CV(i),c={};g&&!se&&(c.effort=g),ve&&(c.permissionMode=ve,c.posture=y);let l=s;d(``),p([]),h([]),C.current?.focus(),t.sendPrompt(n,o,Object.keys(c).length>0?c:void 0,l??void 0).then(e=>{if(E.current){let e=document.activeElement;(!e||e===document.body)&&C.current?.focus()}if(!e){if(E.current){d(e=>e.length===0?u:e),p(e=>e.length===0?i:e),h(e=>e.length===0?a:e);return}t.rememberUnsent(l,{text:u,attachments:i,replies:a},!0)}})},[u,f,m,s,R,t,g,se,ve,y]),Se=(0,v.useCallback)(e=>{d(e),C.current?.focus()},[]),Ce=(0,v.useCallback)(e=>{if(!s||R!==null)return Promise.resolve(!1);let n={};return g&&!se&&(n.effort=g),ve&&(n.permissionMode=ve,n.posture=y),t.sendPrompt(e,[],Object.keys(n).length>0?n:void 0,s)},[s,R,t,g,se,ve,y]),we=e=>{be.onKeyDown(e)||(e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),xe()):e.key===`Escape`&&ne&&(e.preventDefault(),t.interrupt(s??void 0)))},Ee=e=>{let n=Array.from(e.clipboardData?.files??[]);if(n.length>0){e.preventDefault(),_e(n,{isPaste:!0});return}let o=e.clipboardData?.getData(`text/plain`)??``;if(o&&qB(o)){e.preventDefault();let n=i?.cwd||(a?.projectDir??null),c=new TextEncoder().encode(o),l=Nz(o),u=r?.saveTmpFile;if(u){(async()=>{try{let e=await u({sessionId:s??null,cwd:n,name:`pasted-text.txt`,mediaType:`text/plain`,base64:l});if(e.ok&&e.path){p(t=>[...t,{id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:`pasted-text.txt`,mediaType:`text/plain`,data:``,kind:`path`,path:e.path,size:c.byteLength}]),t.toast(`info`,`Large pasted text (${XB(c.byteLength)}) saved to ${e.path} and attached by path.`);return}}catch{}d(e=>e+o)})();return}}},Oe=e=>{e.preventDefault(),T.current=0,S(!1),e.dataTransfer?.files?.length&&_e(e.dataTransfer.files)},ke=e=>{e.dataTransfer?.types?.includes(`Files`)&&(T.current+=1,S(!0))},Ae=()=>{T.current=Math.max(0,T.current-1),T.current===0&&S(!1)},je=e=>{e.target.files&&_e(e.target.files),e.target.value=``},{pendingQuestions:Me,pendingPermissions:Ne}=(0,v.useMemo)(()=>{let e=[],t=[];for(let n of o?.items??[])n.kind===`permission`&&n.status===`pending`&&(n.request.toolName===`AskUserQuestion`?e.push(n):t.push(n));return{pendingQuestions:e,pendingPermissions:t}},[o?.items]),Pe=$B(i,B.option,e.plan),Fe=tV(o?.status===`running`,o?.items.length??0)&&Pe?eV(Pe):null,[Ie,Le]=(0,v.useState)(()=>Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>Le(Date.now()),6e4);return()=>clearInterval(e)},[]);let Re=(0,v.useMemo)(()=>{if(!o||!i)return null;let t=o.items,n=null;for(let e=t.length-1;e>=0;e--)if(t[e].kind===`result`){n=t[e];break}if(!n||n.kind!==`result`){if(t.length===0)return null;let n=e.providers.find(e=>e.definition.id===B.providerId)?.definition.capabilities.promptCacheTtlSec??null,r=Date.parse(i.updatedAt);return iV({lastTurnEndedAt:Number.isFinite(r)?r:null,now:Ie,ttlSec:n,contextTokens:o.contextTokens,running:ne})}let r=n.timestamp?Date.parse(n.timestamp):Date.parse(i.updatedAt),a=e.providers.find(e=>e.definition.id===B.providerId)?.definition.capabilities.promptCacheTtlSec??null;return iV({lastTurnEndedAt:Number.isFinite(r)?r:null,now:Ie,ttlSec:a,contextTokens:o.contextTokens,running:ne})},[o,i,e.providers,B.providerId,Ie,ne]);return(0,K.jsxs)(`div`,{className:`relative border-t border-border bg-surface px-3 py-2 sm:px-6`,onDrop:Oe,onDragOver:e=>e.preventDefault(),onDragEnter:ke,onDragLeave:Ae,"data-testid":`composer`,children:[x?(0,K.jsxs)(`div`,{className:`pointer-events-none absolute inset-1 z-10 flex items-center justify-center rounded-xl border-2 border-dashed border-accent bg-accent-soft/70 text-sm font-medium text-accent`,"data-testid":`drop-overlay`,children:[(0,K.jsx)(Y.Upload,{className:`mr-2 w-4 h-4`}),` Drop files to attach`]}):null,(0,K.jsxs)(`div`,{className:`w-full`,children:[s&&e.toolInstalls[s]?(0,K.jsx)(fz,{frame:e.toolInstalls[s],onDismiss:()=>n({type:`tool_install_dismiss`,sessionId:s})}):null,(0,K.jsx)(ZR,{}),Ne.length>0?(0,K.jsx)(`div`,{className:`mb-2 max-h-[45vh] space-y-2 overflow-y-auto`,"data-testid":`composer-pending`,children:Ne.map(e=>(0,K.jsx)(WB,{item:e,onDecide:n=>t.respondPermission(e.request.requestId,n,s??void 0)},e.id))}):null,Me.map((e,n)=>(0,K.jsx)(WB,{item:e,stackIndex:n,onDecide:n=>t.respondPermission(e.request.requestId,n,s??void 0)},e.id)),Re&&!Fe?(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-[11px] text-fg-muted`,"data-testid":`idle-cache-hint`,children:[(0,K.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-fg-faint`}),Re]}):null,Fe?(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-[11px] text-fg-muted`,"data-testid":`pacing-hint`,"data-lane":Pe??void 0,children:[(0,K.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-warn`}),Fe]}):null,!re&&s?(0,K.jsx)(`div`,{className:`mb-2 text-xs text-fg-faint`,children:e.connection.status===`unauthorized`?`The host rejected this token.`:`Not connected to the host — messages will be sent over HTTP when possible.`}):null,m.length>0?(0,K.jsx)(`div`,{className:`mb-2 flex flex-col gap-1`,"data-testid":`reply-chips`,children:m.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border-l-2 border-accent bg-accent-soft/60 py-1 pl-2 pr-1 text-xs`,"data-testid":`reply-chip`,children:[(0,K.jsx)(Y.Reply,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,K.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 truncate text-left text-fg-muted hover:text-fg`,title:`Go to the message this replies to`,disabled:!e.itemId||!s,onClick:()=>{e.itemId&&s&&t.jumpToItem(s,e.itemId)},"data-testid":`reply-chip-jump`,children:[(0,K.jsx)(`span`,{className:`text-fg`,children:`Reply to `}),e.preview]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove this reply`,onClick:()=>h(t=>t.filter(t=>t.id!==e.id)),className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-muted hover:text-danger`,"data-testid":`reply-chip-remove`,children:(0,K.jsx)(Y.X,{className:`h-3 w-3`})})]},e.id))}):null,f.length>0?(0,K.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-2`,"data-testid":`attachments`,children:[f.map(e=>(0,K.jsxs)(`div`,{className:`relative`,children:[e.kind===`image`?(0,K.jsx)(`button`,{type:`button`,"aria-label":`View ${e.name}`,title:`View ${e.name}`,"data-testid":`attachment-thumb`,onClick:()=>O({name:e.name,mediaType:e.mediaType,base64:e.data}),className:`block cursor-zoom-in rounded p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,K.jsx)(`img`,{src:`data:${e.mediaType};base64,${e.data}`,alt:e.name,className:`h-14 w-14 rounded border border-border object-cover`})}):(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Open ${e.name}`,title:e.kind===`path`?`Open ${e.name} — ${e.path??``}`:`Open ${e.name} in its own program`,"data-testid":e.kind===`path`?`attachment-path`:`attachment-file`,onClick:()=>k(e),className:`flex h-14 min-w-[7rem] max-w-[12rem] flex-col justify-center rounded border border-border bg-surface-2 px-2 text-left text-[11px] hover:bg-surface-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:wv(e.name,22)}),(0,K.jsx)(`span`,{className:`text-fg-faint`,children:e.kind===`document`?`PDF · ${Math.ceil(e.size/1024)} KB`:e.kind===`path`?`${e.mediaType.startsWith(`video/`)?`video`:e.mediaType.startsWith(`audio/`)?`audio`:`file`} · ${XB(e.size)} · path`:`text · ${Math.ceil(e.size/1024)} KB`})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,onClick:()=>p(t=>t.filter(t=>t.id!==e.id)),className:`absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-surface text-fg-muted hover:text-danger`,children:(0,K.jsx)(Y.X,{className:`w-3 h-3`})})]},e.id)),(0,K.jsx)(nB,{picture:D,onClose:()=>O(null),notify:t.toast})]}):null,R?(0,K.jsxs)(`p`,{className:`px-1 text-xs text-danger`,role:`status`,"data-testid":`model-withdrawn`,children:[R,` is no longer available. Pick another model below to continue this chat — its history stays.`]}):null,(0,K.jsxs)(`div`,{className:G(`relative flex flex-col gap-1 rounded-xl border bg-bg px-2 py-1.5`,z?`border-border opacity-60`:`border-border`),children:[(0,K.jsx)(fV,{menu:be,onPick:e=>ye(be.textFor(e)),modelSkills:(a?a.modelSkills:i?.modelSkills)??null}),(0,K.jsx)(`textarea`,{ref:C,"aria-label":`Message`,rows:1,value:u,"aria-controls":be.open?cV:void 0,"aria-activedescendant":be.open&&be.items.length>0?lV(be.active):void 0,disabled:z,placeholder:ue,onChange:e=>d(e.target.value),onKeyDown:we,onPaste:Ee,className:`max-h-60 min-h-[2.25rem] w-full resize-none bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-fg-faint`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1`,"data-testid":`composer-controls`,children:[(0,K.jsx)(`input`,{ref:w,type:`file`,multiple:!0,className:`hidden`,onChange:je,"data-testid":`file-input`}),(0,K.jsx)(uC,{label:`Attach files or images`,disabled:z,onClick:()=>w.current?.click(),children:(0,K.jsx)(Y.Upload,{className:`w-4 h-4`})}),(0,K.jsx)(aT,{disabled:!s||L}),(0,K.jsx)(kL,{disabled:z}),(0,K.jsx)(IL,{disabled:z}),(0,K.jsx)(KL,{disabled:z}),(0,K.jsx)(fR,{}),(0,K.jsx)(gR,{}),(0,K.jsx)(YR,{}),(0,K.jsx)(tz,{disabled:z}),i&&!L?(0,K.jsx)(uC,{label:`Listen to this chat — a spoken summary`,"data-testid":`listen-button`,onClick:()=>t.openVoiceSummary(i.id),children:(0,K.jsx)(Y.Speaker,{className:`w-4 h-4`})}):null,i&&!L&&!e.remote.tabs[i.id]?(0,K.jsx)(nz,{sessionId:i.id,running:ne,onPutInBox:Se,onSend:Ce}):null,ie?(0,K.jsxs)(`select`,{"aria-label":`Agent`,"data-testid":`agent-picker`,className:gV,value:y,disabled:z,title:pe?sg:void 0,onChange:e=>{let n=e.target.value;ee(n)&&(b(n),t.setSessionPosture(n,s??void 0))},children:[me.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.label},e.id)),me.some(e=>e.id===y)?null:(0,K.jsx)(`option`,{value:y,disabled:!0,children:P(y)})]}):null,ie&&pe?(0,K.jsx)(`span`,{className:`inline-flex`,"data-testid":`agy-posture-note`,children:(0,K.jsx)(dC,{label:`the agent picker`,details:sg})}):null,ce?(0,K.jsxs)(`select`,{"aria-label":`Effort`,className:gV,value:oe,disabled:z,title:V?`This model's default effort is ${V}; it runs at that until you pick another`:void 0,onChange:e=>{let n=e.target.value;_(n),t.setSessionEffort(n||null,s??void 0)},children:[V?null:(0,K.jsx)(`option`,{value:``,children:`effort: default`}),ae.map(e=>(0,K.jsxs)(`option`,{value:e,children:[`effort: `,e,e===V?` (default)`:``]},e))]}):null,(0,K.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,"data-testid":`composer-actions`,children:[ne?(0,K.jsxs)(X,{variant:`danger`,size:`sm`,onClick:()=>void t.interrupt(s??void 0),title:`Interrupt (Esc)`,"aria-label":`Interrupt`,"data-testid":`stop-button`,children:[(0,K.jsx)(Y.Stop,{className:`w-3.5 h-3.5`}),` Stop`]}):null,(0,K.jsxs)(X,{variant:`primary`,size:`sm`,onMouseDown:e=>e.preventDefault(),onClick:xe,disabled:z||!u.trim()&&f.length===0,"aria-label":ne?`Queue message`:`Send`,title:ne?`Queue this message — the agent reads it at its next step`:void 0,children:[(0,K.jsx)(Y.Send,{className:`w-3.5 h-3.5`}),` `,ne?`Queue`:`Send`]})]})]})]}),be.open?null:(0,K.jsx)(hV,{item:be.inArguments}),o&&o.totals.turns>0?(0,K.jsxs)(`div`,{className:`mt-1 text-right text-[11px] text-fg-faint`,children:[o.totals.turns,` turn`,o.totals.turns===1?``:`s`,` ·`,` `,i?.providerId===`oonacode`?Sd(i.poolCredits??0):Td(Ed(e.providers.find(e=>e.definition.id===i?.providerId)?.definition))]}):null]})]})}function TV({name:e,state:t,behind:n,detail:r}){return(0,K.jsxs)(`div`,{"data-testid":`sync-side`,className:`min-w-0 flex-1 rounded-md border p-3 ${n?`border-warn bg-warn-soft/40`:`border-border bg-surface-2`}`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n?(0,K.jsx)(`span`,{className:`shrink-0 text-[11px] font-normal text-warn`,children:`behind`}):null]}),(0,K.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-faint`,children:t.entryCount===null?`size not read`:`${t.entryCount} ${t.entryCount===1?`entry`:`entries`}`}),(0,K.jsx)(`div`,{className:`text-[11px] text-fg-faint`,title:xv(t.lastEntryAt),children:t.lastEntryAt?`last message ${yv(t.lastEntryAt)}`:`no timestamps`}),r?(0,K.jsx)(`div`,{className:`mt-1 break-all text-[11px] text-fg-faint`,children:r}):null]})}function EV({sessionId:e,sessionTitle:t,onClose:n}){let{actions:r}=q(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=(0,v.useCallback)(async()=>{if(e){s(!0);try{a(await r.refreshSessionLink(e))}finally{s(!1)}}},[e,r]);(0,v.useEffect)(()=>{d(null),a(null),f()},[f]);let p=async()=>{if(e){l(!0);try{let t=await r.syncSessionDown(e);d(t),t&&a(t.link)}finally{l(!1)}}},m=i?.status===`ours-behind`,h=i?.status===`theirs-behind`;return(0,K.jsx)(hC,{open:e!==null,title:`Sync with the original chat`,onClose:n,footer:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(X,{variant:`ghost`,onClick:n,children:`Close`}),(0,K.jsx)(X,{variant:`primary`,busy:c,onClick:()=>void p(),disabled:!i?.canDownstream||o,"data-testid":`sync-down-confirm`,children:c?`Syncing…`:m?`Bring the new messages in`:`Check again`})]}),children:o&&!i?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-sm text-fg-muted`,children:[(0,K.jsx)(Y.Spinner,{className:`w-4 h-4 spin`}),` Reading the original…`]}):i?(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,K.jsx)(TV,{name:`OonaCode · ${t}`,state:i.ours,behind:m}),(0,K.jsx)(TV,{name:i.agentName,state:i.theirs,behind:h,detail:i.file})]}),(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,"data-testid":`sync-explanation`,children:m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`strong`,{children:[i.agentName,` has newer messages.`]}),` Bringing them in adds them to this chat — nothing here is replaced or removed, and `,i.agentName,` is not written to.`]}):h?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`strong`,{children:`This chat is the newer one.`}),` Nothing is sent back: OonaCode never writes into your `,i.agentName,` install, so the copy over there stays as it is.`]}):(0,K.jsx)(K.Fragment,{children:`Both copies are at the same point. There is nothing to bring in.`})}),u?(0,K.jsx)(`div`,{className:`rounded-md border border-border bg-surface-2 p-3 text-sm`,"data-testid":`sync-result`,children:u.added>0?`${u.added} new ${u.added===1?`message`:`messages`} added to this chat.`:`Already up to date — nothing to bring in.`}):null]}):(0,K.jsx)(`p`,{className:`py-4 text-sm text-fg-muted`,children:`This PC no longer has the chat this one was imported from, so there is nothing to compare it with. Nothing is wrong with the chat itself — it stays exactly as it is.`})})}function DV({mark:e,testId:t,className:n}){let r=Qb(e);return(0,K.jsx)(`span`,{role:`img`,"aria-label":r,title:r,className:G(`inline-block h-2 w-2 shrink-0 rounded-full`,e.isError?`bg-danger`:`bg-accent`,n),"data-testid":t,"data-error":e.isError?`true`:void 0})}function OV({status:e}){return(0,K.jsx)(`span`,{className:G(`inline-block h-2 w-2 shrink-0 rounded-full`,e===`running`?`bg-accent animate-pulse`:e===`waiting_permission`?`bg-warn animate-pulse`:e===`error`?`bg-danger`:`bg-transparent`),"aria-hidden":!0})}function kV(e){return e.some(e=>e.status===`running`)?`running`:e.some(e=>e.status===`waiting_permission`)?`waiting_permission`:`idle`}function AV({sessions:e,testId:t}){let n=kV(e);if(n===`idle`)return null;let r=e.filter(e=>e.status===`running`||e.status===`waiting_permission`).length;return(0,K.jsx)(`span`,{className:`inline-flex shrink-0 items-center`,title:n===`running`?`${r} chat${r===1?``:`s`} working`:`${r} chat${r===1?``:`s`} waiting for permission`,"aria-label":`${r} active chat${r===1?``:`s`}`,"data-testid":t,children:(0,K.jsx)(OV,{status:n})})}var jV={idle:`idle`,running:`working`,waiting_permission:`waiting for permission`,error:`error`};function MV({label:e,value:t}){return t==null||t===``?null:(0,K.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`shrink-0 text-fg-faint`,children:e}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-right text-fg`,title:t,children:t})]})}function NV({session:e,anchor:t}){let{state:n}=q(),r=n.providers.find(t=>t.definition.id===e.providerId)?.definition,i=r?.models.find(t=>t.id===e.model),a=e.projectId?n.vaultProjects.find(t=>t.id===e.projectId):void 0,o=e.startedBy?n.sessions.find(t=>t.id===e.startedBy):void 0,s=te(e),c=N(s)===e.permissionMode?P(s):_V.find(t=>t.value===e.permissionMode)?.label??e.permissionMode,l=Dd(e,Ed(r)),u=Math.max(8,Math.min(t.right+8,window.innerWidth-304-8)),d=Math.max(8,Math.min(t.top,window.innerHeight-360));return(0,aC.createPortal)((0,K.jsxs)(`div`,{role:`tooltip`,"data-testid":`session-details-${e.id}`,className:`fixed z-50 max-h-[22rem] w-[19rem] overflow-y-auto rounded-lg border border-border bg-surface p-3 text-xs shadow-lg`,style:{left:u,top:d},children:[(0,K.jsx)(`div`,{className:`mb-2 truncate text-sm font-medium text-fg`,children:Dv(e)}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(MV,{label:`Model`,value:r&&e.model?`${e.model} · ${r.displayName}`:e.model}),(0,K.jsx)(MV,{label:`Effort`,value:e.effort??`default`}),(0,K.jsx)(MV,{label:`Mode`,value:c}),(0,K.jsx)(MV,{label:`Status`,value:jV[e.status]}),(0,K.jsx)(MV,{label:`Context window`,value:i?.contextWindow?`${vv(i.contextWindow)} tokens`:null}),(0,K.jsx)(MV,{label:`Tokens`,value:`${vv(e.inputTokens)} in · ${vv(e.outputTokens)} out`}),(0,K.jsx)(MV,{label:`Cost`,value:l}),(0,K.jsx)(MV,{label:`Messages`,value:String(e.entryCount)}),(0,K.jsx)(MV,{label:`Folder`,value:e.projectDir??e.cwd}),(0,K.jsx)(MV,{label:`Project`,value:a?.name??null}),(0,K.jsx)(MV,{label:`Created`,value:xv(e.createdAt)}),(0,K.jsx)(MV,{label:`Updated`,value:xv(e.updatedAt)}),(0,K.jsx)(MV,{label:`Forked from`,value:e.forkedFrom}),(0,K.jsx)(MV,{label:`Started by`,value:o?Dv(o):e.startedBy}),(0,K.jsx)(MV,{label:`Temporary`,value:e.temporary?`yes — safe to delete when done`:null}),(0,K.jsx)(MV,{label:`Subagents`,value:e.hasSubagents?`yes`:null}),(0,K.jsx)(MV,{label:`Engine since`,value:xv(e.engineSince)})]})]}),document.body)}function PV({link:e}){return e?.status===`ours-behind`?(0,K.jsxs)(`span`,{className:`ml-1 inline-flex shrink-0 items-center gap-0.5 rounded bg-warn-soft px-1 text-[10px] font-medium leading-4 text-warn`,title:`${e.agentName} has newer messages in this chat — right-click to bring them in`,"data-testid":`session-behind-${e.sessionId}`,"aria-label":`behind its original`,children:[(0,K.jsx)(Y.ArrowDown,{className:`w-2.5 h-2.5`}),`behind`]}):null}function FV({session:e}){return!e.startedBy&&!e.temporary?null:(0,K.jsxs)(K.Fragment,{children:[e.startedBy?(0,K.jsx)(`span`,{className:`ml-1 shrink-0 text-fg-faint`,title:`Started by another chat — rest the pointer on the chat for its name`,"data-testid":`session-started-${e.id}`,children:`· started by a chat`}):null,e.temporary?(0,K.jsx)(`span`,{className:`ml-1 inline-flex shrink-0 items-center rounded bg-surface-2 px-1 text-[10px] font-medium leading-4 text-fg-muted`,title:`Temporary: the model marked this chat throwaway — delete it from its menu when done`,"data-testid":`session-temporary-${e.id}`,children:`temporary`}):null]})}var IV=(0,v.memo)(function({session:e,active:t,link:n,onOpen:r,onMenu:i,menuOpen:a=!1,projectName:o=null,kindIcon:s=!1,testIdPrefix:c=`session`,clock:l}){let u=Dv(e),d=t=>{let n=t.currentTarget.getBoundingClientRect();i(e,{x:n.left,y:n.bottom+2},f.current)},f=(0,v.useRef)(null),p=(0,v.useRef)(null),[m,h]=(0,v.useState)(null),g=(0,v.useCallback)(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),h(null)},[]),_=(0,v.useRef)(a);return _.current=a,(0,v.useEffect)(()=>{a&&g()},[a,g]),(0,v.useEffect)(()=>{if(m===null)return;let e=e=>{Cw(e.target,f.current)&&g()};return window.addEventListener(`scroll`,e,!0),()=>window.removeEventListener(`scroll`,e,!0)},[m,g]),(0,v.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]),(0,K.jsxs)(`div`,{ref:f,className:G(`group relative flex items-center rounded-md`,t?`bg-accent-soft`:`hover:bg-surface-2`),onMouseEnter:()=>{p.current!==null&&clearTimeout(p.current),!_.current&&(p.current=setTimeout(()=>{p.current=null,f.current&&!_.current&&h(f.current.getBoundingClientRect())},450))},onMouseLeave:g,onClick:g,onContextMenu:t=>{t.preventDefault(),g(),i(e,{x:t.clientX,y:t.clientY},f.current)},children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left`,"aria-current":t?`true`:void 0,"data-testid":`${c}-${e.id}`,children:[s?(0,K.jsx)(Y.Chats,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}):null,e.finishedUnseen&&!t&&e.status!==`running`&&e.status!==`waiting_permission`?(0,K.jsx)(DV,{mark:e.finishedUnseen,testId:`${c}-finished-${e.id}`}):s&&e.status===`idle`?null:(0,K.jsx)(OV,{status:e.status}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,K.jsx)(`span`,{className:G(`min-w-0 flex-1 truncate text-sm`,t?`text-fg font-medium`:`text-fg`),children:u})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center text-[11px] text-fg-faint`,children:[o?(0,K.jsxs)(`span`,{className:`mr-1 inline-flex min-w-0 max-w-[45%] shrink-0 items-center gap-0.5 text-project`,"data-testid":`session-project-${e.id}`,title:`Filed under ${o}`,children:[(0,K.jsx)(Y.Project,{className:`w-2.5 h-2.5 shrink-0`}),(0,K.jsx)(`span`,{className:`truncate`,children:o}),(0,K.jsx)(`span`,{className:`text-fg-faint`,children:`·`})]}):null,(0,K.jsxs)(`span`,{className:`truncate`,children:[yv(e.updatedAt,l),e.model?` · ${e.model}`:``,` · ${Cv(e.projectDir??e.cwd)}`]}),(0,K.jsx)(PV,{link:n}),(0,K.jsx)(FV,{session:e})]})]})]}),(0,K.jsx)(uC,{label:`Chat actions`,className:`pointer-events-none absolute right-1 bg-surface/90 p-1 opacity-0 group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100`,"data-testid":`${c}-menu-${e.id}`,onClick:e=>{e.stopPropagation(),d(e)},children:(0,K.jsx)(Y.More,{className:`w-3.5 h-3.5`})}),m===null?null:(0,K.jsx)(NV,{session:e,anchor:m})]})});function LV({session:e,link:t,pinned:n,actions:r,onSync:i,onRename:a,onDelete:o}){let s=[];return t?.status===`ours-behind`&&s.push({key:`sync`,label:`Sync with ${t.agentName}…`,hint:`behind`,icon:(0,K.jsx)(Y.Download,{className:`w-3.5 h-3.5`}),onSelect:i,testId:`session-menu-sync`}),s.push({key:`pin`,label:n?`Unpin`:`Pin to top`,icon:(0,K.jsx)(Y.Pin,{className:`w-3.5 h-3.5`}),separated:s.length>0,onSelect:()=>r.setPinned(`chat`,e.id,!n),testId:`session-menu-pin`},{key:`project`,label:`Move to Project`,icon:(0,K.jsx)(Y.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openAssignProject(e.id),testId:`session-menu-project`},...e.projectId?[{key:`project-settings`,label:`Project settings…`,icon:(0,K.jsx)(Y.Settings,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openProjectSettings(e.projectId),testId:`session-menu-project-settings`}]:[],{key:`folder`,label:`Change folder…`,icon:(0,K.jsx)(Y.Folder,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.openDialog(`project`)},testId:`session-menu-folder`},{key:`details`,label:`Details`,icon:(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.savePrefs({sessionPanelOpen:!0})},testId:`session-menu-details`},{key:`listen`,label:`Listen to this chat…`,icon:(0,K.jsx)(Y.Speaker,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openVoiceSummary(e.id),testId:`session-menu-listen`},{key:`files`,label:`Files`,icon:(0,K.jsx)(Y.File,{className:`w-3.5 h-3.5`}),onSelect:()=>{r.selectSession(e.id),r.savePrefs({explorerOpen:!0})},testId:`session-menu-files`},{key:`rename`,label:`Rename…`,icon:(0,K.jsx)(Y.Edit,{className:`w-3.5 h-3.5`}),onSelect:a,testId:`session-menu-rename`},{key:`fork`,label:`Fork`,icon:(0,K.jsx)(Y.Fork,{className:`w-3.5 h-3.5`}),onSelect:()=>void r.forkSession(e.id),testId:`session-menu-fork`},{key:`delete`,label:`Delete`,icon:(0,K.jsx)(Y.Trash,{className:`w-3.5 h-3.5`}),danger:!0,separated:!0,onSelect:o,testId:`session-menu-delete`}),s}function RV(){let{state:e,actions:t}=q(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=(0,v.useCallback)((e,t,n)=>r({session:e,at:t,el:n}),[]),d=(0,v.useCallback)(()=>r(null),[]),f=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Tw,{open:n!==null,at:n?.at??{x:0,y:0},anchorEl:n?.el??null,label:`Chat actions`,onClose:d,items:n?LV({session:n.session,link:e.sessionLinks[n.session.id]??null,pinned:Nl(e.prefs.pinned,`chat`,n.session.id),actions:t,onSync:()=>a(n.session),onRename:()=>s(n.session),onDelete:()=>l(n.session)}):[]}),(0,K.jsx)(EV,{sessionId:i?.id??null,sessionTitle:i?Dv(i):``,onClose:()=>a(null)}),(0,K.jsx)(yC,{open:c!==null,title:`Delete this chat?`,message:`It is deleted from this PC — the only place it is kept — so it is gone from every device. Your files, folder and code are not touched — only the chat is deleted.`,onConfirm:()=>{c&&t.deleteSession(c.id)},onClose:()=>l(null)}),(0,K.jsx)(bC,{open:o!==null,title:`Rename chat`,label:`Session title`,initialValue:o?Dv(o):``,onSubmit:e=>{o&&e!==Dv(o)&&t.renameSession(o.id,e)},onClose:()=>s(null)})]});return{openMenu:u,menuFor:n?.session.id??null,element:f}}function zV({projectId:e,pinned:t,fold:n,actions:r}){let i=[];return e?i.push({key:`open`,label:`Open project`,icon:(0,K.jsx)(Y.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openPage({kind:`project`,projectId:e}),testId:`project-menu-open`},{key:`settings`,label:`Project settings…`,icon:(0,K.jsx)(Y.Settings,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openProjectSettings(e),testId:`project-menu-settings`},{key:`new-chat`,label:`New chat in this project`,icon:(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),onSelect:()=>r.newTab({projectId:e}),testId:`project-menu-new-chat`},{key:`pin`,label:t?`Unpin`:`Pin to top`,icon:(0,K.jsx)(Y.Pin,{className:`w-3.5 h-3.5`}),onSelect:()=>r.setPinned(`project`,e,!t),testId:`project-menu-pin`}):i.push({key:`new-project`,label:`New project…`,icon:(0,K.jsx)(Y.Project,{className:`w-3.5 h-3.5`}),onSelect:()=>r.openNewProject(),testId:`project-menu-new-project`}),n&&i.push({key:`fold`,label:n.collapsed?`Expand`:`Collapse`,icon:(0,K.jsx)(Y.Chevron,{open:n.collapsed,className:`w-3.5 h-3.5`}),separated:!0,onSelect:n.onToggle,testId:`project-menu-fold`}),i}var BV=[{value:`activity`,label:`Recent activity`},{value:`name`,label:`Name`},{value:`created`,label:`Date created`}];function VV(e){let t=e.goal?.trim()??``;return t===``?(e.instructions??``).split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``:t}function HV(e,t){let n=new Map;for(let e of t){if(!e.projectId)continue;let t=n.get(e.projectId);t?t.push(e):n.set(e.projectId,[e])}return e.map(e=>{let t=n.get(e.id)??[],r=t.reduce((e,t)=>Math.max(e,t.mtime),-1/0),i=Date.parse(e.updatedAt);return{project:e,description:VV(e),chatCount:e.sessionCount??t.length,working:t.filter(e=>e.status===`running`||e.status===`waiting_permission`).length,lastActivity:Number.isFinite(r)?r:Number.isFinite(i)?i:0}})}function UV(e,t){let n=t.trim().toLowerCase();return n===``?e.slice():e.filter(({project:e})=>[e.name,e.goal??``,e.instructions??``].some(e=>e.toLowerCase().includes(n)))}var WV=(e,t)=>e.project.name.localeCompare(t.project.name,void 0,{sensitivity:`base`});function GV(e,t){let n=e.slice();return t===`name`?n.sort(WV):t===`created`?n.sort((e,t)=>(Date.parse(t.project.createdAt)||0)-(Date.parse(e.project.createdAt)||0)||WV(e,t)):n.sort((e,t)=>t.lastActivity-e.lastActivity||WV(e,t))}function KV(){let{state:e,actions:t}=q(),n=e.scheduledTasksVersion,[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=!0;return t.listScheduledTasks({}).then(t=>{e&&i(t)}),()=>{e=!1}},[t,n,a]),{tasks:r,reload:(0,v.useCallback)(()=>o(e=>e+1),[])}}function qV(){let[e,t]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}function JV(e){return e===1?`1 chat`:`${e} chats`}function YV({card:e,pinned:t,actions:n,onDelete:r}){let i=e.chatCount;return[...zV({projectId:e.project.id,pinned:t,fold:null,actions:n}),{key:`delete`,label:`Delete project`,icon:(0,K.jsx)(Y.Trash,{className:`w-3.5 h-3.5`}),danger:!0,separated:!0,disabled:i>0,...i>0?{hint:`${JV(i)} in it`}:{},onSelect:r,testId:`project-card-delete`}]}function XV(){let{state:e,actions:t}=q(),n=qV(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(`activity`),[l,u]=(0,v.useState)(null),d=(0,v.useCallback)(()=>u(null),[]),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(()=>p(null),[]),[h,g]=(0,v.useState)(null),_=(0,v.useRef)(null),y=(0,v.useMemo)(()=>HV(e.vaultProjects,e.sessions),[e.vaultProjects,e.sessions]),b=(0,v.useMemo)(()=>GV(UV(y,r),s),[y,r,s]),x=e=>t.openPage({kind:`project`,projectId:e}),S=(e,t,n)=>p({card:e,at:t,el:n});return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`projects-page`,children:[(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl px-4 py-6 sm:px-8`,children:[(0,K.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h1`,{className:`mr-auto text-2xl font-semibold text-fg`,children:`Projects`}),a||r!==``?(0,K.jsx)(`input`,{ref:_,autoFocus:!0,"aria-label":`Search projects`,className:G(Z,`w-56`),placeholder:`Search projects`,value:r,onChange:e=>i(e.target.value),onBlur:()=>{r===``&&o(!1)},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i(``),o(!1))},"data-testid":`projects-search`}):null,(0,K.jsx)(uC,{label:`Search projects — by name, goal and instructions`,onClick:()=>{o(!0),_.current?.focus()},"data-testid":`projects-search-toggle`,children:(0,K.jsx)(Y.Search,{})}),(0,K.jsx)(uC,{label:`Sort — ${BV.find(e=>e.value===s)?.label??``}`,"aria-haspopup":`menu`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();u({at:{x:t.left,y:t.bottom+2},el:e.currentTarget})},"data-testid":`projects-sort`,children:(0,K.jsx)(Y.Sliders,{})}),(0,K.jsxs)(X,{variant:`inverse`,onClick:()=>t.openNewProject(),"data-testid":`projects-new`,children:[(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),`New project`]})]}),e.vaultProjects.length===0?(0,K.jsx)(vC,{icon:(0,K.jsx)(Y.Project,{className:`h-8 w-8`}),title:`No projects yet`,hint:`A project groups chats, whatever folders they run in, and gives every chat in it the same standing instructions, goal and memory. Projects live in your vault, so they follow you to every PC.`,action:(0,K.jsxs)(X,{variant:`primary`,onClick:()=>t.openNewProject(),children:[(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),`New project`]})}):b.length===0?(0,K.jsxs)(`p`,{className:`py-10 text-center text-sm text-fg-muted`,"data-testid":`projects-no-match`,children:[`No project matches “`,r.trim(),`”.`]}):(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3`,"data-testid":`projects-grid`,children:b.map(t=>(0,K.jsx)(ZV,{card:t,clock:n,pinned:Nl(e.prefs.pinned,`project`,t.project.id),onOpen:x,onMenu:S},t.project.id))})]}),(0,K.jsx)(Tw,{open:l!==null,at:l?.at??{x:0,y:0},anchorEl:l?.el??null,label:`Sort projects`,testId:`projects-sort-menu`,onClose:d,items:BV.map(e=>({key:e.value,label:e.label,icon:e.value===s?(0,K.jsx)(Y.Check,{className:`w-3.5 h-3.5 text-accent`}):(0,K.jsx)(`span`,{className:`w-3.5`}),onSelect:()=>c(e.value),testId:`projects-sort-${e.value}`}))}),(0,K.jsx)(Tw,{open:f!==null,at:f?.at??{x:0,y:0},anchorEl:f?.el??null,label:`Project actions`,testId:`project-card-menu`,onClose:m,items:f?YV({card:f.card,pinned:Nl(e.prefs.pinned,`project`,f.card.project.id),actions:t,onDelete:()=>g(f.card.project)}):[]}),(0,K.jsx)(yC,{open:h!==null,title:h?`Delete ${h.name}?`:`Delete this project?`,message:`Its instructions, goal, memory and settings are removed from your vault, on every device. No chat is filed under it, so no chat changes.`,onConfirm:()=>{h&&t.deleteVaultProject(h.id)},onClose:()=>g(null)})]})}function ZV({card:e,clock:t,pinned:n,onOpen:r,onMenu:i}){let{project:a}=e,o=(0,v.useRef)(null);return(0,K.jsxs)(`div`,{ref:o,className:`group relative rounded-xl border border-border bg-surface transition-colors hover:border-fg-faint hover:bg-surface-2/40`,"data-testid":`project-card-${a.id}`,onContextMenu:t=>{t.preventDefault(),o.current&&i(e,{x:t.clientX,y:t.clientY},o.current)},children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex h-full min-h-[7.5rem] w-full flex-col items-start gap-1 p-4 text-left`,onClick:()=>r(a.id),"data-testid":`project-card-open-${a.id}`,children:[(0,K.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-2 pr-7`,children:[(0,K.jsx)(Y.Project,{className:`w-4 h-4 shrink-0 text-project`}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-[15px] font-medium text-fg`,children:a.name}),n?(0,K.jsx)(Y.Pin,{className:`w-3 h-3 shrink-0 text-fg-faint`,title:`Pinned to the top of the session list`}):null]}),e.description?(0,K.jsx)(`span`,{className:`line-clamp-2 text-sm text-fg-muted`,"data-testid":`project-card-description`,children:e.description}):null,(0,K.jsxs)(`span`,{className:`mt-auto flex items-center gap-1.5 pt-2 text-xs text-fg-faint`,children:[e.working>0?(0,K.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-accent animate-pulse`,title:`${e.working} working now`,"aria-hidden":!0}):null,(0,K.jsxs)(`span`,{"data-testid":`project-card-meta`,children:[JV(e.chatCount),e.lastActivity>0?` · ${bv(e.lastActivity,t)}`:``]})]})]}),(0,K.jsx)(uC,{label:`Actions for ${a.name}`,className:`absolute right-2 top-2 p-1 opacity-60 group-hover:opacity-100 focus:opacity-100`,onClick:t=>{let n=t.currentTarget.getBoundingClientRect();o.current&&i(e,{x:n.left,y:n.bottom+2},o.current)},"data-testid":`project-card-menu-${a.id}`,children:(0,K.jsx)(Y.More,{className:`w-4 h-4`})})]})}function QV({projectId:e}){let{state:t,actions:n}=q(),r=qV(),i=RV(),a=t.vaultProjects.find(t=>t.id===e)??null,o=(0,v.useMemo)(()=>t.sessions.filter(n=>n.projectId===e&&!t.remote.tabs[n.id]).sort((e,t)=>t.mtime-e.mtime),[t.sessions,t.remote.tabs,e]),s=(0,v.useCallback)(e=>n.selectSession(e),[n]),c=()=>n.openPage({kind:`projects`});if(!a)return(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`project-page`,children:(0,K.jsx)(vC,{icon:(0,K.jsx)(Y.Project,{className:`h-8 w-8`}),title:`This project is not here`,hint:`It was deleted, or your vault has not loaded it yet.`,action:(0,K.jsx)(X,{onClick:c,"data-testid":`project-page-back`,children:`All projects`})})});let l=Nl(t.prefs.pinned,`project`,a.id),u=a.instructions.trim(),d=a.repositories??[],f=a.sessionCount??o.length;return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`project-page`,children:[(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-6 sm:px-8`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`mb-3 inline-flex items-center gap-1 text-xs text-fg-muted hover:text-fg`,onClick:c,"data-testid":`project-page-back`,children:[(0,K.jsx)(Y.Chevron,{className:`w-3 h-3 rotate-180`}),`All projects`]}),(0,K.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(Y.Project,{className:`w-5 h-5 shrink-0 text-project`}),(0,K.jsx)(`h1`,{className:`mr-auto min-w-0 truncate text-2xl font-semibold text-fg`,"data-testid":`project-page-name`,children:a.name}),(0,K.jsx)(uC,{label:l?`Unpin from the session list`:`Pin to the top of the session list`,"aria-pressed":l,className:l?`text-accent`:void 0,onClick:()=>n.setPinned(`project`,a.id,!l),"data-testid":`project-page-pin`,children:(0,K.jsx)(Y.Pin,{})}),(0,K.jsxs)(X,{variant:`ghost`,onClick:()=>n.openProjectSettings(a.id),"data-testid":`project-page-settings`,children:[(0,K.jsx)(Y.Settings,{className:`w-3.5 h-3.5`}),`Project settings`]}),(0,K.jsxs)(X,{variant:`inverse`,onClick:()=>n.newTab({projectId:a.id}),"data-testid":`project-page-new-chat`,children:[(0,K.jsx)(Y.Plus,{className:`w-3.5 h-3.5`}),`New chat in this project`]})]}),a.goal?.trim()?(0,K.jsx)(`p`,{className:`mb-4 text-sm text-fg-muted`,"data-testid":`project-page-goal`,children:a.goal.trim()}):null,(0,K.jsxs)(`section`,{className:`mb-5 rounded-xl border border-border bg-surface p-4`,children:[(0,K.jsx)(`h2`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:`Instructions`}),u?(0,K.jsx)(`div`,{className:`max-h-64 overflow-y-auto whitespace-pre-wrap break-words text-sm text-fg`,"data-testid":`project-page-instructions`,children:u}):(0,K.jsx)(`p`,{className:`text-sm text-fg-faint`,children:`None — chats here start with nothing extra.`}),d.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h2`,{className:`mb-1 mt-4 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:`Repositories`}),(0,K.jsx)(`ul`,{className:`space-y-0.5 text-sm`,"data-testid":`project-page-repositories`,children:d.map(e=>(0,K.jsx)(`li`,{className:`truncate font-mono text-xs text-fg-muted`,children:e},e))})]}):null]}),(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`h2`,{className:`mb-1 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-fg-faint`,children:[`Chats`,(0,K.jsx)(`span`,{className:`font-normal normal-case`,"data-testid":`project-page-count`,children:f})]}),o.length===0?(0,K.jsx)(`p`,{className:`py-3 text-sm text-fg-faint`,"data-testid":`project-page-no-chats`,children:f>0?`${JV(f)} filed here are older than the list this window holds.`:`No chats in this project yet — start one with “New chat in this project”.`}):(0,K.jsx)(`div`,{className:`rounded-xl border border-border bg-surface p-1`,"data-testid":`project-page-chats`,children:o.map(e=>(0,K.jsx)(IV,{session:e,active:!1,link:t.sessionLinks[e.id]??null,menuOpen:i.menuFor===e.id,onOpen:s,onMenu:i.openMenu,clock:r,testIdPrefix:`project-chat`},e.id))}),f>0&&o.length>0&&f>o.length?(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-fg-faint`,children:[f-o.length,` older `,f-o.length===1?`chat is`:`chats are`,` `,`not in the list this window holds — search for`,` `,f-o.length===1?`it`:`them`,` in the session list.`]}):null]})]}),i.element]})}var $V=`waiting: the chat is busy`;function eH(e){return e.enabled&&typeof e.lastResult==`string`&&e.lastResult.startsWith(`waiting:`)&&e.lastResult!==$V}function tH(e,t){if(!e.enabled||!e.nextRunAt)return!1;let n=Date.parse(e.nextRunAt);return Number.isFinite(n)&&n-t<=36e5}function nH(e,t){let n=e=>e===1?`1 scheduled task`:`${e} scheduled tasks`,r=e.filter(eH).length;if(r>0)return{tone:`stuck`,count:r,text:`${n(r)} could not run — open Scheduled to see why`};let i=e.filter(e=>tH(e,t)).length;return i>0?{tone:`soon`,count:i,text:`${n(i)} due within the hour`}:null}function rH(e){return e.split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``}function iH(){let{state:e,actions:t}=q(),{tasks:n,reload:r}=KV(),i=qV(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=(0,v.useMemo)(()=>{let t=new Map(e.sessions.map(e=>[e.id,Dv(e)]));for(let[n,r]of Object.entries(e.pinnedRows))t.has(n)||t.set(n,Dv(r));return e=>t.get(e)??null},[e.sessions,e.pinnedRows]),u=async(e,t)=>{c(e.id);try{await t()&&r()}finally{c(null)}},d=n?.filter(e=>ze(e)).length??0;return(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-bg`,"data-testid":`scheduled-page`,children:(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-6 sm:px-8`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,K.jsx)(Y.Clock,{className:`w-5 h-5 shrink-0 text-fg-muted`}),(0,K.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:`Scheduled`})]}),(0,K.jsxs)(`p`,{className:`mb-5 text-sm text-fg-muted`,children:[`What OonaCode's scheduler sends into your chats on this PC — once, or on a repeat — even when the chat has gone quiet.`,n&&n.length>0?` ${d} active${n.length>d?`, ${n.length-d} paused or done`:``}.`:``]}),n===null?null:n.length===0?(0,K.jsx)(`div`,{"data-testid":`scheduled-empty`,children:(0,K.jsx)(vC,{icon:(0,K.jsx)(Y.Clock,{className:`h-8 w-8`}),title:`Nothing scheduled`,hint:`Ask a chat to do something later or on a repeat — “remind me at 9 to check the build”, “every morning, summarise the new issues” — and its model schedules it with OonaCode’s scheduler. Every task, from every chat, shows here.`})}):(0,K.jsx)(`ul`,{className:`space-y-2`,"data-testid":`scheduled-list`,children:n.map(e=>{let n=eH(e),r=tH(e,i),c=l(e.sessionId),d=rH(e.prompt),f=ze(e),p=Be(e);return(0,K.jsxs)(`li`,{className:G(`rounded-xl border p-3 text-sm`,f?`bg-surface`:`bg-surface-2 opacity-60`,n?`border-warn/60`:`border-border`),"data-testid":`scheduled-row-${e.id}`,"data-active":f?`true`:`false`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-fg`,title:e.title,children:e.title}),r&&!n?(0,K.jsx)(`span`,{className:`rounded-full bg-accent-soft px-1.5 text-[11px] text-accent`,children:`due soon`}):null,e.createdBy===`model`?(0,K.jsx)(`span`,{className:`text-[11px] text-fg-faint`,children:`set by the agent`}):null,(0,K.jsx)(X,{size:`sm`,variant:`ghost`,disabled:s===e.id||!e.enabled&&e.nextRunAt===null&&`at`in e.when,onClick:()=>void u(e,()=>t.updateScheduledTask(e.id,{enabled:!e.enabled})),"data-testid":`scheduled-row-toggle`,children:e.enabled?`Pause`:`Resume`}),(0,K.jsx)(X,{size:`sm`,variant:a===e.id?`danger`:`ghost`,disabled:s===e.id,onClick:()=>{if(a!==e.id){o(e.id);return}o(null),u(e,()=>t.deleteScheduledTask(e.id))},"data-testid":`scheduled-row-delete`,children:a===e.id?`Delete?`:`Delete`})]}),d?(0,K.jsxs)(`div`,{className:`mt-1 truncate text-fg-muted`,title:e.prompt,"data-testid":`scheduled-row-sends`,children:[`Sends: “`,d,`”`]}):null,(0,K.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-fg-muted`,children:[(0,K.jsx)(`span`,{"data-testid":`scheduled-row-when`,children:om(e.when)}),(0,K.jsx)(`span`,{"data-testid":`scheduled-row-next`,children:sm(e.nextRunAt,e.enabled)}),(0,K.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:[`in`,(0,K.jsx)(`button`,{type:`button`,className:`min-w-0 truncate text-accent hover:underline`,title:`Open this chat`,onClick:()=>t.selectSession(e.sessionId),"data-testid":`scheduled-row-chat`,children:c??`a chat`})]})]}),e.lastRunAt||e.lastResult?(0,K.jsxs)(`div`,{className:G(`mt-0.5 text-xs`,n?`text-warn`:`text-fg-faint`),"data-testid":`scheduled-row-last`,children:[e.lastRunAt?(0,K.jsxs)(`span`,{title:xv(e.lastRunAt),children:[`last ran `,yv(e.lastRunAt,i)]}):(0,K.jsx)(`span`,{children:`not run yet`}),e.lastResult?` · ${e.lastResult}`:``]}):null,f?null:(0,K.jsxs)(`div`,{className:`mt-0.5 text-xs text-fg-faint`,title:`Tasks that are paused or have finished are deleted 10 days after their last change`,"data-testid":`scheduled-row-deletes`,children:[e.nextRunAt===null?`Finished`:`Paused`,p?` — deleted automatically on ${xv(p)}`:``]})]},e.id)})})]})})}var aH=5e3,oH=12;function sH(e){return Math.min(oH,Math.max(4,e))}var cH=(0,v.memo)(function({messages:e,onPick:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let e=i.current;n&&e&&(e.scrollTop=e.scrollHeight)},[n]),e.length<2?null:(0,K.jsxs)(`div`,{className:`absolute right-2 top-1/2 z-10 -translate-y-1/2`,"data-testid":`user-message-rail`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||r(!1)},onKeyDown:e=>{e.key===`Escape`&&r(!1)},children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Your messages in this chat`,"aria-haspopup":`true`,"aria-expanded":n,className:`flex flex-col items-end gap-1 p-1 text-fg opacity-70 hover:opacity-100 focus-visible:opacity-100`,onClick:()=>r(!0),"data-testid":`user-message-rail-handle`,children:Array.from({length:sH(e.length)},(e,t)=>(0,K.jsx)(`span`,{className:`block h-[2px] w-5 rounded-full bg-current`},t))}),n?(0,K.jsx)(`div`,{className:`absolute right-full top-1/2 -translate-y-1/2 pr-2`,"data-testid":`user-message-rail-bridge`,children:(0,K.jsx)(`div`,{ref:i,className:`max-h-[60vh] w-72 max-w-[70vw] overflow-y-auto rounded-md border border-border bg-surface p-1 shadow-md`,"data-testid":`user-message-rail-list`,children:e.map(e=>{let n=e.reachable!==!1,i=[e.at?xv(e.at):null,e.label,n?null:`Too far back to jump to (more than ${aH.toLocaleString()} lines ago).`].filter(e=>e!==null).join(`
|
|
160
160
|
`);return(0,K.jsx)(`button`,{type:`button`,"aria-disabled":!n,className:n?`block w-full truncate rounded px-2 py-1 text-left text-xs hover:bg-surface-2 focus-visible:bg-surface-2`:`block w-full cursor-not-allowed truncate rounded px-2 py-1 text-left text-xs opacity-40`,title:i,onClick:()=>{n&&(r(!1),t(e.id))},"data-testid":`user-message-rail-item`,children:e.label},e.id)})})}):null]})}),lH=(0,v.memo)(function({text:e,localFiles:t=!1}){let{head:n,tail:r}=Tz(e);return(0,K.jsxs)(K.Fragment,{children:[n?(0,K.jsx)(CL,{text:n,localFiles:t}):null,(0,K.jsx)(CL,{text:r,localFiles:t})]})});function uH(e){let t=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=t.current;e&&(e.focus(),e.select())},[e.focusSeq]);let n=t=>{t.key===`Enter`||t.key===`ArrowDown`?(t.preventDefault(),e.onStep(t.key===`Enter`&&t.shiftKey?-1:1)):t.key===`ArrowUp`?(t.preventDefault(),e.onStep(-1)):t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose())},r=e.query.trim()!==``&&e.count===0;return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface px-3 py-1.5`,"data-testid":`chat-search`,role:`search`,children:[(0,K.jsx)(Y.Search,{className:`w-3.5 h-3.5 shrink-0 text-fg-faint`}),(0,K.jsx)(`input`,{ref:t,type:`text`,value:e.query,onChange:t=>e.onQuery(t.target.value),onKeyDown:n,placeholder:`Find in this chat`,"aria-label":`Find in this chat`,spellCheck:!1,className:G(Z,`h-7 min-w-0 flex-1 py-0 text-xs`),"data-testid":`chat-search-input`}),(0,K.jsx)(`span`,{className:G(`shrink-0 tabular-nums text-xs`,r?`text-warn`:`text-fg-muted`),"data-testid":`chat-search-count`,children:e.query.trim()===``?``:Fe(e.index,e.count)}),(0,K.jsx)(uC,{label:`Previous match (Shift+Enter)`,onClick:()=>e.onStep(-1),disabled:e.count===0,"data-testid":`chat-search-prev`,children:(0,K.jsx)(Y.ArrowDown,{className:`w-3.5 h-3.5 rotate-180`})}),(0,K.jsx)(uC,{label:`Next match (Enter)`,onClick:()=>e.onStep(1),disabled:e.count===0,"data-testid":`chat-search-next`,children:(0,K.jsx)(Y.ArrowDown,{className:`w-3.5 h-3.5`})}),(0,K.jsx)(uC,{label:`Close search (Esc)`,onClick:e.onClose,"data-testid":`chat-search-close`,children:(0,K.jsx)(Y.X,{className:`w-3.5 h-3.5`})})]})}var dH=`data-item-id`;function fH(e){return`[${dH}="${e.replace(/["\\]/g,`\\$&`)}"]`}var pH=`oona-search`,mH=`oona-search-current`,hH=2e3;function gH(){let e=globalThis.CSS,t=globalThis.Highlight;return!e?.highlights||typeof t!=`function`?null:{registry:e.highlights,Highlight:t}}function _H(e,t,n,r){let i=gH();if(i===null)return;let a=Oe(r);if(a===``||t.length===0){vH();return}let o=Ae(a),s=[],c=[],l=hH;for(let r of t){let t=e.querySelector(fH(r.id));if(!t)continue;let i=SH(t,o,l);if(l-=i.length,r.id===n?c.push(...i):s.push(...i),l<=0)break}i.registry.set(pH,new i.Highlight(...s)),i.registry.set(mH,new i.Highlight(...c))}function vH(){let e=gH();e!==null&&(e.registry.delete(pH),e.registry.delete(mH))}function yH(e,t){let n=Oe(t);return n===``?null:SH(e,Ae(n),1)[0]??null}function bH(e,t){let n=e.startContainer instanceof Element?e.startContainer:e.startContainer.parentElement;for(;n;){if(n instanceof HTMLElement&&xH(n)){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();n.scrollTop+=t.top-r.top-(n.clientHeight-t.height)/2}if(n===t)break;n=n.parentElement}}function xH(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`}function SH(e,t,n){let r=e.ownerDocument;if(!r||n<=0)return[];let i=[],a=r.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e=a.nextNode();e!==null;e=a.nextNode()){let a=e.data;t.lastIndex=0;for(let o of a.matchAll(t)){if(o[0].length===0)continue;let t=r.createRange();if(t.setStart(e,o.index??0),t.setEnd(e,(o.index??0)+o[0].length),i.push(t),i.length>=n)return i}}return i}function CH(e,t){switch(e.kind){case`user`:return e.text;case`assistant`:return e.text;case`thinking`:return t?e.text:``;case`tool`:return[e.name,CB(e.name,e.input)??``,wH(e.result)].filter(e=>e!==``).join(`
|
|
161
161
|
`);case`system`:return e.text;case`error`:return e.message;case`permission`:return e.request.toolName;case`result`:case`compact`:return``}}function wH(e){return e===null?``:typeof e.content==`string`?e.content:e.content.map(e=>`text`in e&&typeof e.text==`string`?e.text:``).filter(e=>e!==``).join(`
|
|
162
162
|
`)}function TH(e,t,n){let r=Ne(e,t,e=>CH(e,n.showReasoning));if(r.length===0)return[];let i=new Map;for(let t of e)t.kind===`tool`&&i.set(t.toolUseId,t);return r.map(t=>{let n=e[t],r=EH(n,i);return{id:n.id,rootId:r[0]??n.id,path:r}})}function EH(e,t){let n=[],r=e;for(let e=0;e<16&&r.parentToolUseId!==null;e++){let e=t.get(r.parentToolUseId);if(e===void 0)break;n.unshift(e.id),r=e}return n}function DH(e,t){let n=e instanceof Element?e:null,r=e=>e!==null&&t.contains(e)?e:null,i=typeof window<`u`?window.getSelection():null,a=i&&!i.isCollapsed&&i.anchorNode&&t.contains(i.anchorNode)?i.toString():``,o=r(n?.closest(`[data-item-id]`)??null),s=r(n?.closest(`pre`)??null),c=r(n?.closest(`a[href]`)??null);return{selection:a,itemId:o?.getAttribute(`data-item-id`)??null,code:s?.textContent??null,link:c?.href||null}}function OH(e){switch(e.kind){case`user`:case`assistant`:case`thinking`:case`system`:return e.text;case`tool`:{let t=wH(e.result);return t===``?CB(e.name,e.input)??``:t}case`error`:return e.message;case`permission`:return e.request.toolName;case`result`:case`compact`:return``}}function kH(e){switch(e.kind){case`user`:return`Copy message`;case`assistant`:return`Copy reply`;case`tool`:return e.result?`Copy tool output`:`Copy tool call`;case`thinking`:return`Copy thought`;default:return`Copy text`}}function AH(e){let t=e.trim();return t===``||t.length>80||/[\r\n]/.test(t)?null:t}function jH(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:null}catch{return null}}function MH(e,t,n={}){let r=[],i=t!==null&&OH(t).trim()!==``;n.canReply!==!1&&(e.selection.trim()!==``||i)&&r.push({key:`reply`,label:e.selection.trim()===``?`Reply`:`Reply to selection`}),r.push({key:`copy`,label:`Copy`,hint:`Ctrl+C`,disabled:e.selection===``,separated:r.length>0}),e.code!==null&&e.code.trim()!==``&&r.push({key:`copy-code`,label:`Copy code block`}),e.link!==null&&(r.push({key:`copy-link`,label:`Copy link address`}),jH(e.link)&&r.push({key:`open-link`,label:`Open link`})),t!==null&&i&&r.push({key:`copy-item`,label:kH(t)});let a=AH(e.selection);if(a!==null){let e=a.length>32?`${a.slice(0,31)}…`:a;r.push({key:`find`,label:`Find “${e}” in this chat`,separated:!0})}return e.itemId!==null&&r.push({key:`select-block`,label:`Select all in this block`,separated:a===null}),r}var NH=`data-pin-message`;function PH(e,t,n){let r=0,i=e-1,a=-1;for(;r<=i;){let e=r+i>>1;t(e)<n?(a=e,r=e+1):i=e-1}return a}function FH(e,t=240){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1)}…`}function IH(e){switch(e.status){case`done`:return`answered`;case`skipped`:return`skipped`;case`denied`:case`error`:return`dismissed`;case`cancelled`:return`unanswered`;default:return null}}var LH=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(!1),r=IH(e),i=(0,v.useMemo)(()=>Gl(e.input),[e.input]),a=(0,v.useMemo)(()=>Jl(e.result?.structured)??Jl(e.input),[e.result,e.input]);if(r===null)return null;let o=ql({outcome:r,questions:i.length,answers:a}),s=r===`answered`&&a?i.map(e=>({question:e.question,answer:a[e.question]})).filter(e=>typeof e.answer==`string`):[],c=r===`answered`;return(0,K.jsxs)(`div`,{className:`my-1 text-xs text-fg-faint`,"data-testid":`question-line-${e.toolUseId}`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":s.length>0?t:void 0,disabled:s.length===0,onClick:()=>n(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded px-1 py-0.5 text-left enabled:hover:bg-surface-2`,children:[c?(0,K.jsx)(Y.Check,{className:`w-3 h-3 shrink-0 text-ok`}):(0,K.jsx)(Y.X,{className:`w-3 h-3 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,"data-testid":`question-line-text`,children:o}),s.length>0?(0,K.jsx)(Y.Chevron,{open:t,className:`w-3 h-3 shrink-0`}):null]}),t&&s.length>0?(0,K.jsx)(`dl`,{className:`ml-5 mt-1 space-y-1`,"data-testid":`question-line-answers`,children:s.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{className:`text-fg-muted`,children:e.question}),(0,K.jsx)(`dd`,{className:`pre-wrap text-fg`,children:e.answer})]},e.question))}):null]})});function RH(e){return e.map(e=>{let t=e.source,n=t?.type===`base64`&&!!t.data;if(e.type===`image`&&n){let e=t.media_type??`image/png`;return{kind:`picture`,picture:{name:Iz(`picture`,e),mediaType:e,base64:t.data}}}if(e.type===`document`&&n){let e=t.media_type??`application/pdf`;return{kind:`file`,label:e===`application/pdf`?`PDF · open`:`File · open`,file:{name:Iz(`document`,e),mediaType:e,base64:t.data}}}if(e.type===`text`){let t=e.text??``,n=Lz(t);if(n)return{kind:`localpath`,label:`${wv(n.name,28)} · open`,name:n.name,path:n.path};let r=ch(t);if(r)return{kind:`file`,label:`${wv(r.name,28)} · open`,file:{name:r.name,mediaType:`text/plain`,base64:Nz(r.content)}}}return{kind:`other`,type:e.type}})}var zH=(0,v.memo)(function({attachments:e}){let t=(0,v.useMemo)(()=>RH(e),[e]),[n,r]=(0,v.useState)(null),i=(0,v.useContext)(eL).notify??void 0;return(0,K.jsxs)(`div`,{className:`mb-1 flex flex-wrap gap-1`,"data-testid":`sent-attachments`,children:[t.map((e,t)=>e.kind===`picture`?(0,K.jsx)(`button`,{type:`button`,"aria-label":`Open picture`,title:`Open picture`,"data-testid":`attachment-picture`,onClick:()=>r(e.picture),className:`cursor-zoom-in rounded border border-border p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,K.jsx)(`img`,{src:`data:${e.picture.mediaType};base64,${e.picture.base64}`,alt:`attachment`,className:`block max-h-40 rounded`})},t):e.kind===`file`?(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Open ${e.file.name}`,title:`Open ${e.file.name} in its own program`,"data-testid":`attachment-file`,onClick:()=>void Uz(e.file,i),className:`inline-flex items-center gap-1 rounded bg-surface-2 px-1.5 py-0.5 text-[11px] font-medium leading-4 text-fg hover:bg-surface-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,K.jsx)(Y.File,{className:`h-3 w-3 text-fg-muted`}),e.label]},t):e.kind===`localpath`?(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Open ${e.name}`,title:`Open ${e.name} — ${e.path}`,"data-testid":`attachment-path`,onClick:()=>void zz(e.path,i),className:`inline-flex items-center gap-1 rounded bg-surface-2 px-1.5 py-0.5 text-[11px] font-medium leading-4 text-fg hover:bg-surface-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,K.jsx)(Y.File,{className:`h-3 w-3 text-fg-muted`}),e.label]},t):(0,K.jsx)(Q,{children:e.type},t)),(0,K.jsx)(nB,{picture:n,onClose:()=>r(null),notify:i})]})});function BH(e){let t=[],n=0;for(;n<e.length;){let r=e[n].item;if(r.kind===`permission`&&r.status!==`pending`){let r=[],i=n;for(;i<e.length;){let t=e[i].item;if(t.kind!==`permission`||t.status===`pending`)break;r.push(t),i+=1}if(r.length>=3){t.push({run:r}),n=i;continue}}t.push(e[n]),n+=1}return t}function VH(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r].item;i.kind===`permission`&&i.status!==`pending`&&(i.status===`allowed`||i.request.toolName===`AskUserQuestion`)&&t(i.request.toolUseId)?n??=e.slice(0,r):n&&n.push(e[r])}return n??e}function HH(e){if(!e)return{flow:void 0,queued:[]};let t=[];for(let n of e)n.kind===`user`&&n.waiting&&!n.failed&&t.push(n);if(t.length===0)return{flow:e,queued:t};let n=new Set(t.map(e=>e.id));return{flow:e.filter(e=>!n.has(e.id)),queued:t}}function UH({items:e,onCancel:t,onSendNow:n}){let[r,i]=(0,v.useState)(()=>new Set),[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)(()=>new Set),l=e=>{let t=e.requestId;!n||!t||r.has(t)||s.has(t)||(i(e=>new Set(e).add(t)),o(({[t]:e,...n})=>n),n(e).catch(e=>e instanceof Error?e.message:String(e)).then(e=>{e?o(n=>({...n,[t]:e})):c(e=>new Set(e).add(t))}).finally(()=>i(e=>{let n=new Set(e);return n.delete(t),n})))},u=(0,v.useRef)(null),d=e.length;return(0,v.useEffect)(()=>{let e=u.current;e&&(e.scrollTop=e.scrollHeight)},[d]),e.length===0?null:(0,K.jsxs)(`div`,{className:`shrink-0 border-t border-border bg-surface px-3 pb-1 pt-2 sm:px-6`,"data-testid":`queued-strip`,children:[(0,K.jsxs)(`div`,{className:`mb-0.5 text-right text-[11px] text-fg-faint`,children:[e.length===1?`Queued`:`${e.length} queued`,` — the agent reads this at its next step`]}),(0,K.jsx)(`div`,{ref:u,className:`max-h-[200px] overflow-y-auto`,"data-testid":`queued-strip-list`,children:e.map(e=>(0,K.jsxs)(`div`,{className:`relative`,[dH]:e.id,children:[(0,K.jsx)(WH,{children:(0,K.jsx)(qH,{item:e})}),t&&e.requestId?(0,K.jsx)(`button`,{type:`button`,onClick:()=>t(e),title:`Withdraw this message — the agent has not read it yet`,"aria-label":`Withdraw this message`,"data-testid":`queued-cancel-${e.requestId}`,className:`absolute right-1 top-1 rounded-full border border-border bg-surface p-0.5 text-fg-muted shadow-sm hover:bg-surface-2 hover:text-fg`,children:(0,K.jsx)(Y.X,{className:`h-3 w-3`})}):null,n&&e.requestId&&!e.deliveredAt?(0,K.jsxs)(`div`,{className:`-mt-0.5 mb-1 flex flex-wrap items-center justify-end gap-1.5 text-[11px] text-fg-faint`,"data-testid":`queued-now-row-${e.requestId}`,children:[(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:s.has(e.requestId)?`Stopping the current step…`:`Stops the current step`}),(0,K.jsx)(dC,{label:Ie.label,details:Ie.warning}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>l(e),disabled:r.has(e.requestId)||s.has(e.requestId),title:s.has(e.requestId)?`On its way — the agent takes it as soon as it has stopped its current step (a few seconds at most)`:Ie.warning,"aria-label":`${Ie.label}: ${Ie.warning}`,"data-testid":`queued-now-${e.requestId}`,className:`inline-flex items-center gap-1 rounded border border-border bg-surface px-1.5 py-0.5 text-fg-muted shadow-sm hover:bg-surface-2 hover:text-fg disabled:opacity-50`,children:[r.has(e.requestId)||s.has(e.requestId)?(0,K.jsx)(Y.Spinner,{className:`h-3 w-3`}):null,s.has(e.requestId)?`Sending now…`:r.has(e.requestId)?`Sending…`:Ie.label]}),a[e.requestId]?(0,K.jsx)(`span`,{className:`basis-full text-right text-danger`,role:`status`,"data-testid":`queued-now-refused-${e.requestId}`,children:a[e.requestId]}):null]}):null]},e.id))})]})}function WH({children:e}){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1);return(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let n=e.scrollHeight>116;n!==i&&a(n)}),(0,K.jsxs)(`div`,{"data-testid":`queued-clamp`,"data-open":n?`true`:`false`,children:[(0,K.jsx)(`div`,{ref:t,className:G(!n&&`overflow-hidden`),style:n?void 0:{maxHeight:112},children:e}),i||n?(0,K.jsx)(`div`,{className:`-mt-1 mb-0.5 text-right`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`text-[11px] text-fg-muted underline-offset-2 hover:text-fg hover:underline`,"data-testid":`queued-clamp-toggle`,children:n?`Show less`:`Show all`})}):null]})}function GH(e){return e.failed?`failed`:e.optimistic||e.waiting?`pending`:`delivered`}function KH(e){return e.chatMarker===void 0&&!e.compactSummary&&!e.taskNotification&&!e.engineNote&&e.scheduledTask===void 0&&!ie(e.text)&&!V(e.text)}var qH=(0,v.memo)(function({item:e}){if(e.chatMarker)return(0,K.jsx)(vz,{item:e});if(V(e.text))return(0,K.jsx)(ZH,{item:e});if(e.compactSummary)return(0,K.jsx)(lU,{item:e});if(e.taskNotification)return(0,K.jsx)(cU,{item:e});if(ie(e.text))return(0,K.jsx)(QH,{item:e});if(e.engineNote)return(0,K.jsx)(YH,{item:e});if(e.scheduledTask!==void 0)return(0,K.jsx)(XH,{item:e});let t=GH(e);return(0,K.jsx)(`div`,{className:`my-2 flex justify-end`,"data-testid":`user-bubble`,"data-delivery":t,children:(0,K.jsxs)(`div`,{className:G(`max-w-[85%] rounded-2xl rounded-br-md bg-user-bubble px-3.5 py-2 text-sm`,t===`pending`&&`opacity-70`,e.failed&&`border border-danger/50`),children:[e.attachments.length>0?(0,K.jsx)(zH,{attachments:e.attachments}):null,(0,K.jsx)(JH,{text:e.text}),e.failed?(0,K.jsx)(`div`,{className:`mt-1 text-right text-[10px] text-danger`,"data-testid":`user-not-sent`,children:`Not sent — send it again`}):null,(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-end gap-1 text-[10px] text-fg-muted`,"data-testid":`user-time`,children:[e.timestamp?(0,K.jsx)(`span`,{title:xv(e.timestamp),children:Sv(e.timestamp)}):null,t===`pending`?(0,K.jsx)(`span`,{"data-testid":`user-waiting`,title:e.waiting?`Handed to the agent — it reads this at its next step`:`Sending…`,"aria-label":`not read yet`,children:(0,K.jsx)(Y.Clock,{className:`h-3 w-3`})}):t===`delivered`?(0,K.jsx)(`span`,{"data-testid":`user-delivered`,title:e.deliveredAt?`Read by the agent at ${xv(e.deliveredAt)}`:`Sent to the model`,"aria-label":`read by the agent`,children:(0,K.jsx)(Y.Check,{className:`h-3 w-3`})}):null]})]})})});function JH({text:e}){let t=ed(e);return t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-1.5 flex flex-col gap-1`,children:t.quotes.map((e,t)=>(0,K.jsxs)(`button`,{type:`button`,className:`flex min-w-0 max-w-full items-center gap-1.5 rounded-md border-l-2 border-accent bg-accent-soft/60 py-1 pl-2 pr-2 text-left text-xs text-fg-muted hover:text-fg`,title:`Go to the quoted message:\n\n${td(e)}`,"data-quote":e,"data-testid":`user-reply-quote`,children:[(0,K.jsx)(Y.Reply,{className:`h-3.5 w-3.5 shrink-0 text-accent`}),(0,K.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,K.jsx)(`span`,{className:`text-fg`,children:`Reply to `}),id(td(e))]})]},t))}),t.reply===``?null:(0,K.jsx)(`div`,{className:`pre-wrap`,children:(0,K.jsx)(pL,{text:t.reply})})]}):(0,K.jsx)(`div`,{className:`pre-wrap`,children:(0,K.jsx)(pL,{text:e})})}var YH=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(!1);jz(e.id,n);let r=ce(e.text),i=r.trim()?r.trim().split(/\s+/).length:0;return(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`engine-note`,title:xv(e.timestamp),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Engine note`}),(0,K.jsxs)(`span`,{className:`min-w-0 truncate text-xs opacity-70`,children:[de(e.text),i>40?` · ${i.toLocaleString()} words`:``]}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:t,className:`w-3.5 h-3.5 text-fg-faint`})]}),t?(0,K.jsx)(`div`,{className:`border-t border-border px-3 py-2 text-fg-muted`,children:(0,K.jsx)(CL,{text:r})}):null]})}),XH=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(!1);jz(e.id,n);let r=lc(e.text)?.prompt??e.text;return(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`scheduled-task-line`,title:xv(e.timestamp),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Clock,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Scheduled task`}),(0,K.jsx)(`span`,{className:`min-w-0 truncate text-xs opacity-70`,children:e.scheduledTask}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:t,className:`w-3.5 h-3.5 text-fg-faint`})]}),t?(0,K.jsx)(`div`,{className:`border-t border-border px-3 py-2 text-fg-muted`,children:(0,K.jsx)(CL,{text:r})}):null]})}),ZH=(0,v.memo)(function({item:e}){return(0,K.jsxs)(`div`,{className:`my-2 flex items-center gap-2 text-xs text-fg-faint`,"data-testid":`interrupt-marker`,title:xv(e.timestamp),children:[(0,K.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2.5 py-0.5`,children:[(0,K.jsx)(Y.Stop,{className:`h-3 w-3 text-danger`}),(0,K.jsx)(`span`,{className:`font-medium text-fg-muted`,children:`User requested stop`})]}),(0,K.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})}),QH=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(!1);return jz(e.id,n),(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`stream-cut`,title:xv(e.timestamp),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Reply cut off`}),(0,K.jsx)(`span`,{className:`text-xs opacity-70`,children:`the stream broke mid-answer; the engine asked the model to resume where it stopped`}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:t,className:`w-3.5 h-3.5 text-fg-faint`})]}),t?(0,K.jsx)(`div`,{className:`border-t border-border px-3 py-2 text-fg-muted`,children:(0,K.jsx)(CL,{text:e.text})}):null]})}),$H=(0,v.memo)(function({item:e}){let t=Im(e.error,e.text),n=Ez(t?jm(e.text):e.text,e.streaming);return(0,K.jsxs)(`div`,{className:`my-2 text-sm`,"data-testid":`assistant-bubble`,title:xv(e.timestamp),children:[(0,K.jsx)(`div`,{className:G(e.streaming&&`caret`),children:e.streaming?(0,K.jsx)(lH,{text:n,localFiles:!0}):(0,K.jsx)(CL,{text:n,localFiles:!0})}),t?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-danger`,"data-testid":`assistant-error`,children:t}):null,e.aborted?(0,K.jsx)(Q,{tone:`warn`,className:`mt-1`,children:`interrupted`}):null]})});function eU(e){if(e.kind!==`user`||!e.taskNotification)return!1;let t=be(e.text).summary??``;return/orphaned by a previous claude code process exit/i.test(t)||/background .*tasks? didn.t finish before the previous session ended/i.test(t)}function tU(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(`item`in r&&eU(r.item)){let r=[],i=n;for(;i<e.length;){let t=e[i];if(!(`item`in t)||!eU(t.item))break;r.push(t.item),i+=1}if(r.length>=2){t.push({orphans:r}),n=i;continue}}t.push(r),n+=1}return t}function nU(e){return e.kind===`tool`&&e.name===`Agent`&&e.id.startsWith(`subagent:subagents/agent-`)}function rU(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(`item`in r&&nU(r.item)){let r=[],i=n;for(;i<e.length;){let t=e[i];if(!(`item`in t)||!nU(t.item))break;r.push(t),i+=1}if(r.length>=3){t.push({agents:r}),n=i;continue}}t.push(r),n+=1}return t}var iU=(0,v.memo)(function({nodes:e,renderChildren:t}){let[n,r]=(0,v.useState)(!1),i=jz((0,v.useMemo)(()=>e.map(e=>e.item.id),[e]),r),a=n||i,{span:o,when:s}=(0,v.useMemo)(()=>{let t=e.map(e=>e.item.timestamp?Date.parse(e.item.timestamp):NaN).filter(e=>Number.isFinite(e));if(t.length===0)return{span:void 0,when:null};let n=Math.min(...t),r=Math.max(...t),i=kU.format(n),a=kU.format(r),o=new Date(n).toISOString(),s=new Date(r).toISOString(),c=MU(o)===MU(s)?`${NU(o)}, ${DU.format(n)}${n===r?``:` – ${DU.format(r)}`}`:`${NU(o)} → ${NU(s)}`;return{span:i===a?i:`${i} — ${a}`,when:c}},[e]);return(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`earlier-agents`,"data-count":e.length,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":a,title:o,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`${e.length} earlier agents`}),s?(0,K.jsx)(`span`,{className:`shrink-0 text-xs`,children:s}):null,(0,K.jsx)(`span`,{className:`min-w-0 truncate text-xs opacity-70`,children:`their launch is older than what this chat has loaded — open to read each one’s transcript`}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:a,className:`w-3.5 h-3.5 text-fg-faint`})]}),a?(0,K.jsx)(`div`,{className:`border-t border-border px-2 py-1`,children:t(e)}):null]})});function aU(e){for(let t of e){let e=be(t.text).summary??``,n=/(\d+) background .*tasks? didn.t finish/i.exec(e);if(n)return Number(n[1])}return e.length}var oU=(0,v.memo)(function({items:e}){let[t,n]=(0,v.useState)(!1),r=aU(e);return(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`restart-orphans`,"data-count":r,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:r===1?`1 background task`:`${r} background tasks`}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-warn`,children:`stopped`}),(0,K.jsxs)(`span`,{className:`min-w-0 truncate text-xs opacity-70`,children:[r===1?`it was`:`they were`,` running when OonaCode restarted this chat (an update or a restart); the model can start again what it still needs`]}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:t,className:`w-3.5 h-3.5 text-fg-faint`})]}),t?(0,K.jsx)(`div`,{className:`border-t border-border px-2 py-1`,children:e.map(e=>(0,K.jsx)(cU,{item:e},e.id))}):null]})});function sU(e){if(!e)return null;if(/orphaned by a previous claude code process exit/i.test(e))return`it was still running when OonaCode restarted this chat (an update or a restart), so it stopped`;let t=/(\d+) background .*tasks? didn.t finish before the previous session ended/i.exec(e);return t?`${t[1]} background tasks were still running when OonaCode restarted this chat (an update or a restart), so they stopped`:e}var cU=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(!1);jz(e.id,n);let r=be(e.text),i=r.status??`ended`,a=i===`completed`?`text-ok`:i===`failed`?`text-danger`:`text-warn`,o=sU(r.summary);return(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`task-notification`,"data-status":i,title:xv(e.timestamp),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Background task`}),(0,K.jsx)(`span`,{className:`text-xs font-medium ${a}`,children:i}),o?(0,K.jsx)(`span`,{className:`min-w-0 truncate text-xs opacity-70`,title:r.summary??void 0,children:o}):null,(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:t,className:`w-3.5 h-3.5 text-fg-faint`})]}),t?(0,K.jsxs)(`div`,{className:`border-t border-border px-3 py-2 text-xs text-fg-muted`,children:[r.note?(0,K.jsx)(`p`,{className:`mb-2`,children:r.note}):null,(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[11px] text-fg-faint`,children:e.text})]}):null]})}),lU=(0,v.memo)(function({item:e}){let[t,n]=(0,v.useState)(!1);jz(e.id,n);let r=e.text.trim()?e.text.trim().split(/\s+/).length:0;return(0,K.jsxs)(`div`,{className:`my-2 rounded-lg border border-border bg-surface text-sm`,"data-testid":`compact-summary`,title:xv(e.timestamp),children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-fg-muted hover:bg-surface-2`,children:[(0,K.jsx)(Y.Info,{className:`w-3.5 h-3.5 text-fg-faint`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Context compacted`}),(0,K.jsxs)(`span`,{className:`text-xs opacity-70`,children:[`the engine summarised the conversation so far to make room · `,r.toLocaleString(),` `,`words`]}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(Y.Chevron,{open:t,className:`w-3.5 h-3.5 text-fg-faint`})]}),t?(0,K.jsx)(`div`,{className:`border-t border-border px-3 py-2 text-fg-muted`,children:(0,K.jsx)(CL,{text:e.text})}):null]})}),uU=(0,v.memo)(function({item:e,modelNameOf:t}){let n=[_v(e.durationMs),`${vv(e.inputTokens)} in${(e.cachedInputTokens??0)>0?` (+${vv(e.cachedInputTokens??0)} cached)`:``} / ${vv(e.outputTokens)} out`,`${e.numTurns} step${e.numTurns===1?``:`s`}`],r=e.safeguards,i=r?ml(r,t):e.isError?Pm(e):`turn complete`,a=r&&r.outcome===`blocked`||e.isError;return(0,K.jsxs)(`div`,{className:G(`my-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]`,a?`text-danger`:`text-fg-faint`),"data-testid":`result-line`,title:xv(e.timestamp),children:[a?(0,K.jsx)(Y.Alert,{className:`w-3 h-3`}):(0,K.jsx)(Y.Check,{className:`w-3 h-3`}),(0,K.jsx)(`span`,{"data-testid":`result-outcome`,children:i}),(0,K.jsx)(`span`,{children:`·`}),(0,K.jsx)(`span`,{children:n.join(` · `)}),e.errors.length>0?(0,K.jsx)(`span`,{className:`w-full pre-wrap font-mono`,children:e.errors.join(`
|