@teammy/server 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/main.js +346 -66
- package/dist/web/assets/Assistant-C6pKB7Ad.js +1 -0
- package/dist/web/assets/Assistant-CpCuE2gu.css +1 -0
- package/dist/web/assets/Dashboard-9YigAZz5.js +1 -0
- package/dist/web/assets/Dashboard-BOW5jKmH.css +1 -0
- package/dist/web/assets/Files-DV2qyyA7.js +1 -0
- package/dist/web/assets/{Markdown-D-FafgUB.js → Markdown-B3gyVKQQ.js} +4 -4
- package/dist/web/assets/Sessions-paWfamTw.js +1 -0
- package/dist/web/assets/WorkspaceTree-1wC3k-B-.js +1 -0
- package/dist/web/assets/{file-links-DTDtI322.js → file-links-BV_YvnFy.js} +1 -1
- package/dist/web/assets/index-COCTfq_q.js +12 -0
- package/dist/web/assets/{project-context-ClIYZ2Zu.js → project-context--9YVXMif.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/Assistant-B712NOqs.js +0 -1
- package/dist/web/assets/Assistant-DULVRmR1.css +0 -1
- package/dist/web/assets/Dashboard-BMek5kfz.js +0 -1
- package/dist/web/assets/Dashboard-C7EDndZA.css +0 -1
- package/dist/web/assets/Files-BQ1LdKKa.js +0 -1
- package/dist/web/assets/Sessions-11r38zLA.js +0 -1
- package/dist/web/assets/WorkspaceTree-C406dC60.js +0 -1
- package/dist/web/assets/index-B02ttZKr.js +0 -12
|
@@ -52,4 +52,4 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
52
52
|
|
|
53
53
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=C,c=!A.jitless,l=c&&fe.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Ar([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Nr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!E(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Fe(e,r,j())))}),t)}var Pr=k(`$ZodUnion`,(e,t)=>{N.init(e,t),O(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),O(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),O(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),O(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ae(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Nr(t,r,e,i)):Nr(o,r,e,i)}});function Fr(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ir=k(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Pr.init(e,t);let n=e._zod.parse;O(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||_(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=v(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=re(()=>Fr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!C(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Lr=k(`$ZodIntersection`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>zr(e,t,n)):zr(e,i,a)}});function Rr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pe(e)&&pe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Rr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Rr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function zr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Rr(t.value,n.value);if(!c.valid){if(E(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Br=k(`$ZodEnum`,(e,t)=>{N.init(e,t);let n=ee(t.entries),r=new Set(n);e._zod.values=r,O(e,`pattern`,e=>{let t=ee(e.def.entries).filter(e=>he.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ge(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Vr=k(`$ZodLiteral`,(e,t)=>{N.init(e,t);let n=new Set(t.values);e._zod.values=n,O(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?ge(e):e?ge(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Hr=k(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,A.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new nt;return n.value=i,n}});function Ur(e,t){return e.value=t.issues.length?void 0:t.value,e}var Wr=k(`$ZodOptional`,(e,t)=>{N.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,O(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ae(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ur(e,t)):Ur(e,r)}return t.innerType._zod.run(e,n)}}),Gr=k(`$ZodExactOptional`,(e,t)=>{Wr.init(e,t),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Kr=k(`$ZodNullable`,(e,t)=>{N.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin),O(e,`optout`,e=>e.def.innerType._zod.optout),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ae(t.source)}|null)$`):void 0}),O(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),qr=k(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,O(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Jr(e,t)):Jr(r,t)}});function Jr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Yr=k(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,O(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Xr=k(`$ZodNonOptional`,(e,t)=>{N.init(e,t),O(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Zr(t,e)):Zr(i,e)}});function Zr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Qr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Fe(e,r,j()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var $r=k(`$ZodCatch`,(e,t)=>{N.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),O(e,`optout`,e=>e.def.innerType._zod.optout),O(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Qr(e,r,t,n)):Qr(e,r,t,n)}}),ei=k(`$ZodPipe`,(e,t)=>{N.init(e,t),O(e,`values`,e=>e.def.in._zod.values),O(e,`optin`,e=>e.def.in._zod.optin),O(e,`optout`,e=>e.def.out._zod.optout),O(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ti(e,t.in,n)):ti(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ti(e,t.out,n)):ti(r,t.out,n)}});function ti(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ni=k(`$ZodReadonly`,(e,t)=>{N.init(e,t),O(e,`propValues`,e=>e.def.innerType._zod.propValues),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`optin`,e=>e.def.innerType?._zod?.optin),O(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ri):ri(r)}});function ri(e){return e.memo||(e.value=Object.freeze(e.value)),e}var ii=k(`$ZodCustom`,(e,t)=>{M.init(e,t),N.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ai(t,n,r,e));ai(i,n,r,e)}});function ai(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Be(e))}}var oi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},si=`~memo`,ci=[];function li(e){return typeof e==`object`&&!!e}function ui(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var di=new WeakMap,fi=0,pi=1,mi=2;function hi(e,t,n){let r=di.get(e);if(r!==void 0)return r?mi:fi;if(t.has(e))return mi;t.add(e);let i=fi,a=e=>{if(i!==mi&&e?._zod){let r=hi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=fi;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?pi:o.value?._zod?hi(o.value,t,n):fi;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=v(c);s(e?o(e,!0):pi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?hi(r,t,!1):pi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),gi(e,i)}function gi(e,t){return t!==pi&&di.set(e,t===mi),t}function _i(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var vi,yi=[],bi={alloc(e,t,n){let r=vi;if(!r)return n;vi=void 0;let i={value:n,issues:null};return r.set(t.value,i),yi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Si(n,e.value))throw new oi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=hi(e,new Set,!1);if(i===fi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===mi||r?n=!0:r=!0}let l=s.value;if(!li(l))return t(s,c);let u=c[si];u||(u={buckets:new WeakMap,backEdges:void 0},c[si]=u);let d;i===c?d=a:(d=_i(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ui(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;vi=d;let p=yi.length,m=t(s,c);vi=void 0;let h=yi.length>p?yi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ui(e.issues):ci),e)):(h&&(h.issues=m.issues.length?ui(m.issues):ci),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function xi(){return bi}function Si(e,t){let n=e[si]?.backEdges;return n!==void 0&&li(t)&&n.has(t)}var Ci=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(ze(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${_e(e.values[0])}`:`Invalid option: expected one of ${te(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${te(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function wi(){return{localeError:Ci()}}var Ti,Ei=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Di(){return new Ei}(Ti=globalThis).__zod_globalRegistry??(Ti.__zod_globalRegistry=Di());var Oi=globalThis.__zod_globalRegistry;function ki(e){return e.checks&&=[...e.checks],e}function Ai(e,t){return new e(ki({type:`string`,...T(t)}))}function ji(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...T(t)})}function Mi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...T(t)})}function Ni(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...T(t)})}function Pi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...T(t)})}function Fi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...T(t)})}function Ii(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...T(t)})}function Li(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...T(t)})}function Ri(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...T(t)})}function zi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...T(t)})}function Bi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...T(t)})}function Vi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...T(t)})}function Hi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...T(t)})}function Ui(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...T(t)})}function Wi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...T(t)})}function Gi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...T(t)})}function Ki(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...T(t)})}function qi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...T(t)})}function Ji(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...T(t)})}function Yi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...T(t)})}function Xi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...T(t)})}function Zi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...T(t)})}function Qi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...T(t)})}function $i(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...T(t)})}function ea(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...T(t)})}function ta(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...T(t)})}function na(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...T(t)})}function ra(e,t){return new e(ki({type:`number`,checks:[],...T(t)}))}function ia(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...T(t)})}function aa(e,t){return new e({type:`boolean`,...T(t)})}function oa(e){return new e({type:`unknown`})}function sa(e,t){return new e({type:`never`,...T(t)})}function ca(e,t){return new pn({check:`less_than`,...T(t),value:e,inclusive:!1})}function la(e,t){return new pn({check:`less_than`,...T(t),value:e,inclusive:!0})}function ua(e,t){return new mn({check:`greater_than`,...T(t),value:e,inclusive:!1})}function da(e,t){return new mn({check:`greater_than`,...T(t),value:e,inclusive:!0})}function fa(e,t){return new hn({check:`multiple_of`,...T(t),value:e})}function pa(e,t){return new _n({check:`max_length`,...T(t),maximum:e})}function ma(e,t){return new vn({check:`min_length`,...T(t),minimum:e})}function ha(e,t){return new yn({check:`length_equals`,...T(t),length:e})}function ga(e,t){return new xn({check:`string_format`,format:`regex`,...T(t),pattern:e})}function _a(e){return new Sn({check:`string_format`,format:`lowercase`,...T(e)})}function va(e){return new Cn({check:`string_format`,format:`uppercase`,...T(e)})}function ya(e,t){return new wn({check:`string_format`,format:`includes`,...T(t),includes:e})}function ba(e,t){return new Tn({check:`string_format`,format:`starts_with`,...T(t),prefix:e})}function xa(e,t){return new En({check:`string_format`,format:`ends_with`,...T(t),suffix:e})}function Sa(e){return new Dn({check:`overwrite`,tx:e})}function Ca(e){return Sa(t=>t.normalize(e))}function wa(){return Sa(e=>e.trim())}function Ta(){return Sa(e=>e.toLowerCase())}function Ea(){return Sa(e=>e.toUpperCase())}function Da(){return Sa(e=>de(e))}function Oa(e,t,n){return new e({type:`array`,element:t,...T(n)})}function ka(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...T(n)})}function Aa(e,t){let n=ja(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Be(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Be(r))}},e(t.value,t)),t);return n}function ja(e,t){let n=new M({check:`custom`,...T(t)});return n._zod.check=e,n}function Ma(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&_(e,t,n[t]);return e}function Na(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Oi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function F(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function I(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,I(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ma(o.schema,c),t.io===`input`&&L(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Pa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Fa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Pa(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Pa(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
54
|
|
|
55
|
-
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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ia(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ia(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var La=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ra=[`oneOf`,`anyOf`];function za(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ba(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!La.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??za(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}_(n,r,e.length===1?e[0]:Ba(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=za(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Va(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of La)if(t in e)return;let n=t.filter(e=>Ra.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ba(t);else{let e=n[0],i=Ra.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ba([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ma(e,r))}function Ha(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)):Ma(i,s),Ma(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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ia(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Va(e)}}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)}Ma(i,n.defId?n.schema: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??{};if(!e.external||e.sharedEmitDoneFor!==e.external)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&&(e.sharedEmitDoneFor=e.external),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:Wa(t,`input`,e.processors),output:Wa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L(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 L(r.element,n);if(r.type===`set`)return L(r.valueType,n);if(r.type===`lazy`)return L(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`||r.type===`catch`)return L(r.innerType,n);if(r.type===`intersection`)return L(r.left,n)||L(r.right,n);if(r.type===`record`||r.type===`map`)return L(r.keyType,n)||L(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:L(r.in,n)||L(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L(e,n))return!0;return!!(r.rest&&L(r.rest,n))}return!1}var Ua=(e,t={})=>n=>{let r=Na({...n,processors:t});return I(e,r),Fa(r,e),Ha(r,e)},Wa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Na({...i??{},target:a,io:t,processors:n});return I(e,o),Fa(o,e),Ha(o,e)},Ga=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ka=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},qa=(e,t)=>{Ga(e,`minimum`,t),Ka(e,`maximum`,t)},Ja=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ya=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Xa=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Za=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Qa=(e,t)=>Ga(e,`minimum`,t.minimum),$a=(e,t)=>Ka(e,`maximum`,t.maximum),eo=e=>(t,n)=>{Za(t,n.format);let[r,i]=e[n.format];Ga(t,`minimum`,r),Ka(t,`maximum`,i)},to={greater_than:(e,t)=>Ga(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ka(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ja(e,t.value),number_format:eo(ye),bigint_format:eo(be),min_length:Qa,max_length:$a,length_equals:(e,t)=>qa(e,t.length),min_size:Qa,max_size:$a,size_equals:(e,t)=>qa(e,t.size),string_format:(e,t)=>{Za(e,t.format),t.pattern&&Ya(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Xa(e,t.mime)};function R(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)to[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ga(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ga(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ka(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ka(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ja(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Xa(t,i.mime);for(let e of i.patterns??[])Ya(t,e);return t}var no={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ro=new Map([[ur,Yt],[fr,Xt]]),io=e=>ro.get(e)??e,ao=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=R(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=no[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(io);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}))])}},oo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=R(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):F(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},so=(e,t,n,r)=>{n.type=`boolean`},co=(e,t,n,r)=>{n.not={}},lo=(e,t,n,r)=>{let i=e._zod.def,a=ee(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},uo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(F(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(F(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},fo=(e,t,n,r)=>{F(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},po=(e,t,n,r)=>{F(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},mo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=R(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=I(a.element,t,{...r,path:[...r.path,`items`]})};function ho(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?ho(t.out):t.type===`catch`?ho(t.innerType):e._zod.optin}var go=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&F(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)_(i.properties,e,I(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?ho(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=I(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},_o=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>I(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},vo=(e,t,n,r)=>{let i=e._zod.def,a=I(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=I(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},yo=(e,t,n,r)=>{let i=e._zod.def,a=I(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`}]},bo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xo=Symbol();function So(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(F(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),xo):JSON.parse(o)}var Co=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=So(i.defaultValue,e,t,n,r);o!==xo&&(n.default=o)},wo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=So(i.defaultValue,e,t,n,r);o!==xo&&(n._prefault=o)},To=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{F(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Eo=(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;I(o,t,r);let s=t.seen.get(e);s.ref=o},Do=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Oo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ko=new WeakSet([Object.prototype,Error.prototype]);function Ao(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var jo=(e,t)=>{lt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ko.has(n)||(ko.add(n),Ao(n,`format`,e=>t=>ft(e,t)),Ao(n,`flatten`,e=>t=>dt(e,t)),Ao(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ne,2)}),Ao(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ne,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Mo=k(`ZodError`,jo),z=k(`ZodError`,jo,void 0,{Parent:Error}),No=mt(z),Po=ht(z),Fo=gt(z),Io=vt(z),Lo=wt(z),Ro=Tt(z),zo=Et(z),Bo=Dt(z),Vo=Ot(z),Ho=kt(z),Uo=At(z),Wo=jt(z);function Go(){A.localeError||j(wi())}function Ko(){A.memoizer||j({memoizer:xi()})}var B=k(`ZodType`,(e,t)=>(Go(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(x(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 w(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(oc(e,t))},superRefine(e,t){return this.check(sc(e,t))},overwrite(e){return this.check(Sa(e))},optional(){return Hs(this)},exactOptional(){return Ws(this)},nullable(){return Ks(this)},nullish(){return Hs(Ks(this))},nonoptional(e){return Qs(this,e)},array(){return W(this)},or(e){return js([this,e])},and(e){return Fs(this,e)},transform(e){return nc(this,Bs(e))},default(e){return Js(this,e)},prefault(e){return Xs(this,e)},catch(e){return ec(this,e)},pipe(e){return nc(this,e)},readonly(){return ic(this)},describe(e){let t=this.clone();return Oi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Oi.get(this);let t=this.clone();return Oi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return He(this,`~standard`,{...Mn(this),jsonSchema:{input:Wa(this,`input`),output:Wa(this,`output`)}})},set"~standard"(e){D(this,`~standard`,e)},parse:function e(t,n){return No(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Po(this,t,n,{callee:e})},safeParse(e,t){return Fo(this,e,t)},async safeParseAsync(e,t){return Io(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){D(this,`spa`,e)},validate(e,t){return xt(this,e,t)},validateAsync(e,t){return Ct(this,e,t)},encode:function e(t,n){return Lo(this,t,n,{callee:e})},decode:function e(t,n){return Ro(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await zo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Bo(this,t,n,{callee:e})},safeEncode(e,t){return Vo(this,e,t)},safeDecode(e,t){return Ho(this,e,t)},async safeEncodeAsync(e,t){return Uo(this,e,t)},async safeDecodeAsync(e,t){return Wo(this,e,t)},toJSONSchema(e){return Ua(this,{})(e)},get description(){return Oi.get(this)?.description},get _def(){return this._zod.def}}),qo=k(`_ZodString`,(e,t)=>{Nn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)},Ue({format:e=>R(e).format??null,minLength:e=>R(e).minimum??null,maxLength:e=>R(e).maximum??null},{regex(...e){return this.check(ga(...e))},includes(...e){return this.check(ya(...e))},startsWith(...e){return this.check(ba(...e))},endsWith(...e){return this.check(xa(...e))},min(...e){return this.check(ma(...e))},max(...e){return this.check(pa(...e))},length(...e){return this.check(ha(...e))},nonempty(...e){return this.check(ma(1,...e))},lowercase(e){return this.check(_a(e))},uppercase(e){return this.check(va(e))},trim(){return this.check(wa())},normalize(...e){return this.check(Ca(...e))},toLowerCase(){return this.check(Ta())},toUpperCase(){return this.check(Ea())},slugify(){return this.check(Da())}})),Jo=k(`ZodString`,(e,t)=>{Nn.init(e,t),qo.init(e,t)},{email(e){return this.check(ji($o,e))},url(e){return this.check(Li(rs,e))},jwt(e){return this.check(Qi(vs,e))},emoji(e){return this.check(Ri(is,e))},guid(e){return this.check(Mi(es,e))},uuid(e){return this.check(Ni(ts,e))},uuidv4(e){return this.check(Pi(ts,e))},uuidv6(e){return this.check(Fi(ts,e))},uuidv7(e){return this.check(Ii(ts,e))},nanoid(e){return this.check(zi(as,e))},cuid(e){return this.check(Bi(os,e))},cuid2(e){return this.check(Vi(ss,e))},ulid(e){return this.check(Hi(cs,e))},base64(e){return this.check(Yi(hs,e))},base64url(e){return this.check(Xi(gs,e))},xid(e){return this.check(Ui(ls,e))},ksuid(e){return this.check(Wi(us,e))},ipv4(e){return this.check(Gi(ds,e))},ipv6(e){return this.check(Ki(fs,e))},cidrv4(e){return this.check(qi(ps,e))},cidrv6(e){return this.check(Ji(ms,e))},e164(e){return this.check(Zi(_s,e))},datetime(e){return this.check($i(Yo,e))},date(e){return this.check(ea(Xo,e))},time(e){return this.check(ta(Zo,e))},duration(e){return this.check(na(Qo,e))}});function V(e){return Ai(Jo,e)}var H=k(`ZodStringFormat`,(e,t)=>{P.init(e,t),qo.init(e,t)}),Yo=k(`ZodISODateTime`,(e,t)=>{Qn.init(e,t),H.init(e,t)}),Xo=k(`ZodISODate`,(e,t)=>{$n.init(e,t),H.init(e,t)}),Zo=k(`ZodISOTime`,(e,t)=>{er.init(e,t),H.init(e,t)}),Qo=k(`ZodISODuration`,(e,t)=>{tr.init(e,t),H.init(e,t)}),$o=k(`ZodEmail`,(e,t)=>{In.init(e,t),H.init(e,t)}),es=k(`ZodGUID`,(e,t)=>{Pn.init(e,t),H.init(e,t)}),ts=k(`ZodUUID`,(e,t)=>{Fn.init(e,t),H.init(e,t)});function ns(e){return Ni(ts,e)}var rs=k(`ZodURL`,(e,t)=>{Wn.init(e,t),H.init(e,t)}),is=k(`ZodEmoji`,(e,t)=>{Gn.init(e,t),H.init(e,t)}),as=k(`ZodNanoID`,(e,t)=>{Kn.init(e,t),H.init(e,t)}),os=k(`ZodCUID`,(e,t)=>{qn.init(e,t),H.init(e,t)}),ss=k(`ZodCUID2`,(e,t)=>{Jn.init(e,t),H.init(e,t)}),cs=k(`ZodULID`,(e,t)=>{Yn.init(e,t),H.init(e,t)}),ls=k(`ZodXID`,(e,t)=>{Xn.init(e,t),H.init(e,t)}),us=k(`ZodKSUID`,(e,t)=>{Zn.init(e,t),H.init(e,t)}),ds=k(`ZodIPv4`,(e,t)=>{nr.init(e,t),H.init(e,t)}),fs=k(`ZodIPv6`,(e,t)=>{ar.init(e,t),H.init(e,t)}),ps=k(`ZodCIDRv4`,(e,t)=>{or.init(e,t),H.init(e,t)}),ms=k(`ZodCIDRv6`,(e,t)=>{cr.init(e,t),H.init(e,t)}),hs=k(`ZodBase64`,(e,t)=>{dr.init(e,t),H.init(e,t)}),gs=k(`ZodBase64URL`,(e,t)=>{mr.init(e,t),H.init(e,t)}),_s=k(`ZodE164`,(e,t)=>{hr.init(e,t),H.init(e,t)}),vs=k(`ZodJWT`,(e,t)=>{_r.init(e,t),H.init(e,t)}),ys=k(`ZodNumber`,(e,t)=>{vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.isFinite=!0},Ue({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=R(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=R(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=R(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>R(e).format??null},{gt(e,t){return this.check(ua(e,t))},gte(e,t){return this.check(da(e,t))},min(e,t){return this.check(da(e,t))},lt(e,t){return this.check(ca(e,t))},lte(e,t){return this.check(la(e,t))},max(e,t){return this.check(la(e,t))},int(e){return this.check(Ss(e))},safe(e){return this.check(Ss(e))},positive(e){return this.check(ua(0,e))},nonnegative(e){return this.check(da(0,e))},negative(e){return this.check(ca(0,e))},nonpositive(e){return this.check(la(0,e))},multipleOf(e,t){return this.check(fa(e,t))},step(e,t){return this.check(fa(e,t))},finite(){return this}}));function bs(e){return ra(ys,e)}var xs=k(`ZodNumberFormat`,(e,t)=>{yr.init(e,t),ys.init(e,t)});function Ss(e){return ia(xs,e)}var Cs=k(`ZodBoolean`,(e,t)=>{br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r)});function U(e){return aa(Cs,e)}var ws=k(`ZodUnknown`,(e,t)=>{xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ts(){return oa(ws)}var Es=k(`ZodNever`,(e,t)=>{Sr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r)});function Ds(e){return sa(Es,e)}var Os=k(`ZodArray`,(e,t)=>{Ko(),Er.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ma(e,t))},nonempty(e){return this.check(ma(1,e))},max(e,t){return this.check(pa(e,t))},length(e,t){return this.check(ha(e,t))},unwrap(){return this.element}});function W(e,t){return Oa(Os,e,t)}var ks=k(`ZodObject`,(e,t)=>{Ko(),Mr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),Ye(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ls(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(x(this._zod.def,{catchall:e}))},passthrough(){return this.clone(x(this._zod.def,{catchall:Ts()}))},loose(){return this.clone(x(this._zod.def,{catchall:Ts()}))},strict(){return this.clone(x(this._zod.def,{catchall:Ds()}))},strip(){return this.clone(x(this._zod.def,{catchall:void 0}))},extend(e){return we(this,e)},safeExtend(e){return Ee(this,e)},merge(e){return De(this,e)},pick(e){return xe(this,e)},omit(e){return Ce(this,e)},partial(...e){return Oe(Vs,this,e[0])},exactPartial(...e){return Oe(Us,this,e[0],`exactPartial`)},required(...e){return ke(Zs,this,e[0])}});function G(e,t){return new ks({type:`object`,shape:e??{},...T(t)})}var As=k(`ZodUnion`,(e,t)=>{Pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.options=t.options});function js(e,t){return new As({type:`union`,options:e,...T(t)})}var Ms=k(`ZodDiscriminatedUnion`,(e,t)=>{As.init(e,t),Ir.init(e,t)});function Ns(e,t,n){return new Ms({type:`union`,options:t,discriminator:e,...T(n)})}var Ps=k(`ZodIntersection`,(e,t)=>{Lr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)});function Fs(e,t){return new Ps({type:`intersection`,left:e,right:t})}var Is=k(`ZodEnum`,(e,t)=>{Br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 Is({...t,checks:[],...T(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 Is({...t,checks:[],...T(r),entries:i})}});function Ls(e,t){return new Is({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}var Rs=k(`ZodLiteral`,(e,t)=>{Vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(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 K(e,t){return new Rs({type:`literal`,values:Array.isArray(e)?e:[e],...T(t)})}var zs=k(`ZodTransform`,(e,t)=>{Ko(),Hr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Be(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Be(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Bs(e){return new zs({type:`transform`,transform:e})}var Vs=k(`ZodOptional`,(e,t)=>{Wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hs(e){return new Vs({type:`optional`,innerType:e})}var Us=k(`ZodExactOptional`,(e,t)=>{Gr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ws(e){return new Us({type:`optional`,innerType:e})}var Gs=k(`ZodNullable`,(e,t)=>{Kr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ks(e){return new Gs({type:`nullable`,innerType:e})}var qs=k(`ZodDefault`,(e,t)=>{qr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Js(e,t){return new qs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}var Ys=k(`ZodPrefault`,(e,t)=>{Yr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xs(e,t){return new Ys({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}var Zs=k(`ZodNonOptional`,(e,t)=>{Xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qs(e,t){return new Zs({type:`nonoptional`,innerType:e,...T(t)})}var $s=k(`ZodCatch`,(e,t)=>{$r.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ec(e,t){return new $s({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ze(t)})}var tc=k(`ZodPipe`,(e,t)=>{ei.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.in=t.in,e.out=t.out});function nc(e,t){return new tc({type:`pipe`,in:e,out:t})}var rc=k(`ZodReadonly`,(e,t)=>{ni.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ic(e){return new rc({type:`readonly`,innerType:e})}var ac=k(`ZodCustom`,(e,t)=>{ii.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r)});function oc(e,t={}){return ka(ac,e,t)}function sc(e,t){return Aa(e,t)}var q=h(),J=V().regex(/^[a-z][a-z0-9_-]{0,63}$/),cc=ns();G({deviceId:cc,projectId:J.optional()}).strict(),G({workspaceId:J,memberId:J,deviceId:cc}),G({members:W(J)});var lc=134217728,uc=10485760,dc=3e5,fc=V().regex(/^[a-f0-9]{64}$/),Y=bs().int().nonnegative().max(2**53-1),pc=V().min(1).max(1024).refine(e=>e!==e.normalize(`NFC`)||/[\\\x00-\x1f\x7f:<>"|?*]/.test(e)?!1:e.split(`/`).every(e=>e.length>0&&e.length<=255&&e!==`.`&&e!==`..`&&!/[. ]$/.test(e)&&!/^\.teammy(?:-|$)/i.test(e)&&!/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(e)),`Path must be a portable, normalized relative file path.`),mc=G({sha256:fc,size:bs().int().min(0).max(lc)}),hc=mc.extend({size:bs().int().min(0).max(uc)}),gc=Ns(`kind`,[hc.extend({kind:K(`upsert`),path:pc}).strict(),G({kind:K(`delete`),path:pc}).strict()]);G({operationId:ns(),parentRevision:Y,changes:W(gc)}).strict().refine(e=>new Set(e.changes.map(e=>e.path)).size===e.changes.length,`Duplicate paths in a publication.`),G({operationId:ns(),revision:Y});var _c=hc.extend({path:pc,revision:Y});G({revision:Y,complete:U().default(!1),files:W(_c),nextCursor:V().nullable()}),G({headRevision:Y,revisions:W(G({revision:Y,operationId:ns(),createdAt:V(),changes:W(gc)}))}),G({hashes:W(fc).max(200)}).strict(),G({missing:W(fc)});var vc=Ns(`kind`,[_c.extend({kind:K(`file`)}),G({kind:K(`directory`),path:pc,fileCount:bs().int().positive()})]),yc=G({revision:Y,path:js([K(``),pc]),entries:W(vc),nextCursor:V().nullable()}),bc=G({revision:Y,file:_c}),xc=V().url().max(2048).refine(e=>{let t=new URL(e);return[`http:`,`https:`].includes(t.protocol)&&!t.username&&!t.password&&!t.search&&!t.hash},`Use an HTTP(S) server URL without credentials, query or fragment.`),Sc=G({checkIntervalSeconds:bs().int().min(1).max(86400),fileSettleSeconds:bs().int().min(0).max(86400)}).strict(),Cc=G({schemaVersion:K(1),projectId:J,projectName:V().trim().min(1).max(120),description:V().max(2e3),publicServerUrl:xc,configRevision:Y,scopeProfile:K(`workspace-and-sessions-v1`),sync:Sc}).strict(),wc=G({operationId:ns(),publicServerUrl:xc,adminId:J}).strict(),Tc=G({initialized:U()}),Ec=Cc.pick({projectName:!0,description:!0}).extend({expectedRevision:Y.optional()}).strict(),Dc=G({id:J,displayName:V().max(120),enabled:U(),accountEnabled:U(),revision:Y,bound:U(),fileRevision:Y,lastPublishedAt:V().nullable()}),Oc=G({memberId:J,displayName:V(),siteRole:Ls([`admin`,`member`])}),kc=Oc.extend({workspaceId:J}),Ac=G({id:J}).strict(),jc=G({expectedRevision:Y,displayName:V().trim().max(120).optional(),enabled:U().optional()}).strict();G({operationId:ns(),projectName:V().trim().min(1).max(120),description:V().max(2e3).default(``),workspacePath:V().trim().min(1).optional()}).strict();var Mc=G({projects:W(G({projectId:J,projectName:V(),description:V()}))}),Nc=G({sync:Sc,publicServerUrl:xc,revision:Y}),Pc=G({publicServerUrl:xc.optional(),sync:Sc.optional(),expectedRevision:Y}).strict().refine(e=>e.publicServerUrl!==void 0||e.sync!==void 0,`Provide a setting to update.`),Fc=G({id:J,displayName:V(),siteRole:Ls([`admin`,`member`]),enabled:U(),revision:Y}),Ic=G({id:J,displayName:V().trim().max(120).default(``),siteRole:Ls([`admin`,`member`]).default(`member`)}).strict(),Lc=G({expectedRevision:Y,displayName:V().trim().max(120).optional(),enabled:U().optional(),siteRole:Ls([`admin`,`member`]).optional()}).strict(),X={brand:`Teammy`,navigation:`主导航`,filePreview:`文件预览`,versionPicker:`选择目录版本`,connectCommand:`连接命令`,syncCommand:`开启同步命令`,syncStopCommand:`停止同步命令`,installCommandLabel:`安装命令`,skipToMain:`跳到主要内容`,loading:`正在加载…`,retry:`重试`,refresh:`刷新`,cancel:`取消`,close:`关闭`,save:`保存`,saving:`正在保存…`,next:`下一步`,back:`上一步`,confirm:`确认`,logout:`退出登录`,menu:`导航菜单`,files:`文件浏览`,dashboard:`工作看板`,sessions:`对话库`,members:`成员`,settings:`设置`,account:`个人账户`,project:`项目`,projectName:`项目名称`,description:`项目说明`,address:`团队接入地址`,addressHint:`填写成员设备能够访问的服务地址。`,adminId:`管理员 ID`,memberId:`成员 ID`,idHint:`以小写字母开头,最多 64 位,可包含数字、短横线或下划线。ID 创建后不可修改。`,displayName:`显示名称`,admin:`管理员`,member:`成员`,enabled:`已启用`,disabled:`已停用`,login:`进入工作台`,loginTitle:`连接你的团队`,loginHint:`输入管理员预先建立的成员 ID。`,existing:`接入已有工作区`,choose:`请选择`,interval:`文件检查间隔(秒)`,settle:`文件稳定等待(秒)`,timingHint:`文件停止修改后开始计时。新设置约 30 秒后下发,当前批次结束后生效。`,scope:`共享范围`,owner:`文件所属成员`,noFiles:`该目录版本暂无文件`,noFilesHint:`运行客户端同步后查看。`,pickFile:`选择文件,查看内容`,more:`加载更多`,name:`文件路径`,size:`大小`,version:`版本`,directoryVersion:`目录版本`,latest:`最新版本`,viewVersion:`查看版本`,download:`下载原文件`,raw:`原文`,rendered:`预览`,previewUnavailable:`该文件不支持文本预览,请下载查看。`,previewLarge:`文件超过 512 KiB,请下载查看完整内容。`,readOnly:`只读`,refreshFiles:`刷新目录`,remoteImage:`图片`,addMember:`添加成员`,editName:`修改名称`,disableMember:`停用成员`,enableMember:`启用成员`,resetDevice:`重置设备`,resetHint:`撤销该成员的设备凭证,保留共享文件与历史。成员需要重新运行 connect --reconnect。`,disableHint:`停止该成员访问和同步本项目,保留历史资料。其他项目不受影响。`,enableHint:`恢复本项目访问权限。设备需要重新接入。`,bound:`设备已绑定`,unbound:`尚未绑定设备`,noContact:`尚无状态报告`,lastContact:`最近联系`,lastPublished:`最近发布`,noPublication:`尚未发布文件`,stale:`报告已超过 2 分钟`,applied:`已应用`,waiting:`等待应用`,failed:`应用失败`,received:`已接收`,saved:`服务端已保存`,override:`含命令行覆盖`,effective:`当前有效策略`,syncResult:`最近同步`,pending:`待发文件`,clientVersion:`客户端版本`,syncIssues:`同步提示`,statusHint:`最近上报状态,非实时在线状态。`,connectTitle:`连接项目目录`,connectHint:`在本地项目目录中运行:`,connectAfter:`连接后自动后台同步,关闭终端后仍会继续。`,install:`首次使用`,installHint:`需要 Node.js 22.19+,客户端版本与服务端保持一致。`,installCommand:`npm install -g @teammy/cli@0.0.7`,copy:`复制`,copied:`已复制`,copyFailed:`复制失败,请手动选择命令。`,configSaved:`设置已保存,等待客户端接收并上报。`,reloadConfig:`读取最新设置`,configConflict:`设置已被其他成员修改。先读取最新设置,再重新编辑。`,permissionHint:`公共设置由管理员维护。`,application:`配置应用情况`,serverVersion:`服务端版本`,notReported:`未上报`,seconds:`秒`,errors:{AI_DEFAULT_REQUIRED:`请选择模型,或先设置默认接入点。`,AI_PROFILE_DISABLED:`该模型接入点已停用,请重新选择。`,AI_CONFIG_CONFLICT:`模型设置已更新,请重新载入后保存。`,SITE_ADMIN_REQUIRED:`此操作需要站点管理员身份。`,USER_NOT_FOUND:`用户尚未建立或账号已停用,请联系站点管理员。`,USER_EXISTS:`该用户 ID 已存在。`,PROJECT_NOT_FOUND:`项目不存在或你已不再是该项目成员。`,PROJECT_REQUIRED:`请选择一个项目。`,PROJECT_MISMATCH:`设备凭证属于其他项目。`,UNKNOWN_MEMBER:`成员 ID 不存在或已被停用。`,LOGIN_REQUIRED:`登录已失效,请重新登录。`,ADMIN_REQUIRED:`此操作需要管理员身份。`,STALE_CONFIG:`设置已变更,请读取最新设置后重试。`,STALE_MEMBER:`成员信息已变更,请刷新后重试。`,LAST_ADMIN:`至少需要保留一位启用的管理员。`,MEMBER_EXISTS:`该成员 ID 已存在。`,ALREADY_INITIALIZED:`服务已初始化,请刷新页面进入登录。`,INVALID_REQUEST:`请检查输入内容和数值范围。`,FORBIDDEN:`没有执行此操作的权限。`,INVALID_REVISION:`该目录版本不存在。`}};function Rc(e){let t=e.replace(/\s+/g,` `).trim()||`未命名对话`,n=Array.from(t);return n.length>56?n.slice(0,56).join(``)+`…`:t}var zc=class extends Error{code;status;constructor(e,t,n){super(X.errors[e]??t),this.code=e,this.status=n}};async function Z(e,t,n={}){let r=await fetch(d(`/api/v1/${e}`),{method:n.method??`GET`,headers:{accept:`application/json`,...n.body===void 0?{}:{"content-type":`application/json`},...n.method&&n.method!==`GET`?{"x-teammy-web":`1`}:{}},body:n.body===void 0?void 0:JSON.stringify(n.body),signal:n.signal?AbortSignal.any([n.signal,AbortSignal.timeout(n.timeoutMs??15e3)]):AbortSignal.timeout(n.timeoutMs??15e3),credentials:`same-origin`}),i=await r.json();if(!r.ok){let e=new zc(i.error?.code??`HTTP_ERROR`,i.error?.message??`HTTP ${r.status}`,r.status);throw e.code===`LOGIN_REQUIRED`&&window.dispatchEvent(new Event(`teammy:logout`)),e}return t.parse(i)}var Bc={server:e=>Z(`server`,G({version:V()}),{signal:e}),projects:e=>Z(`projects`,Mc,{signal:e}),setup:e=>Z(`setup`,Tc,{signal:e}),session:e=>Z(`web/session`,Oc,{signal:e}),login:e=>Z(`web/session`,Oc,{method:`POST`,body:{id:e}}),logout:()=>Z(`web/session`,G({ok:U()}),{method:`DELETE`})};function Vc(e){return{config:t=>e(`project/config`,Cc,{signal:t}),members:t=>e(`web/members`,G({members:W(Dc)}),{signal:t}),file:(t,n,r,i)=>e(`files/${encodeURIComponent(t)}/entry?${new URLSearchParams({path:n,...r===void 0?{}:{revision:String(r)}})}`,bc,{signal:i}),tree:(t,n,r,i,a)=>e(`files/${encodeURIComponent(t)}/tree?${new URLSearchParams({path:n,after:i,limit:`100`,...r===void 0?{}:{revision:String(r)}})}`,yc,{signal:a})}}function Hc(e){return e instanceof Mo?X.errors.INVALID_REQUEST:e instanceof Error?e.message:String(e)}function Uc(e){return`'${e.replaceAll(`'`,`'\\''`)}'`}function Wc(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function Gc(e,t,n){let r=await fetch(d(`${n}/blobs/${e.sha256}`),{signal:AbortSignal.any([t,AbortSignal.timeout(dc)])});if(!r.ok)throw r.status===401&&window.dispatchEvent(new Event(`teammy:logout`)),Error(`HTTP ${r.status}`);let i=await r.arrayBuffer();if(i.byteLength!==e.size)throw Error(`File size mismatch.`);let a;try{a=new TextDecoder(`utf-8`,{fatal:!0}).decode(i)}catch{throw Error(X.previewUnavailable)}if(a.includes(`\0`))throw Error(X.previewUnavailable);return a}function Kc(e,t=!1){let[n,r]=(0,q.useState)(),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(!0),c=(0,q.useRef)(null),l=(0,q.useRef)(0),u=(0,q.useCallback)(async()=>{c.current?.abort();let t=new AbortController;c.current=t;let n=++l.current;s(!0);try{let i=await e(t.signal);n===l.current&&(r(i),a(``))}catch(e){!t.signal.aborted&&n===l.current&&a(Hc(e))}finally{n===l.current&&(s(!1),c.current=null)}},[e]);return(0,q.useEffect)(()=>{u();let e=()=>{!document.hidden&&!c.current&&u()},n=t?setInterval(e,typeof t==`number`?t:3e4):void 0;return t&&document.addEventListener(`visibilitychange`,e),()=>{l.current++,c.current?.abort(),c.current=null,clearInterval(n),document.removeEventListener(`visibilitychange`,e)}},[u,t]),{data:n,error:i,loading:o,reload:u}}function qc(){let[e]=(0,q.useState)(()=>new AbortController);return(0,q.useEffect)(()=>()=>e.abort(),[e]),e.signal}async function Jc(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.activeElement,n=window.getSelection(),r=n?Array.from({length:n.rangeCount},(e,t)=>n.getRangeAt(t).cloneRange()):[],i=document.createElement(`textarea`);i.value=e,i.readOnly=!0,i.style.cssText=`position:fixed;left:0;top:0;opacity:0;pointer-events:none;`,document.body.append(i);try{if(i.focus({preventScroll:!0}),i.select(),!document.execCommand(`copy`))throw Error(`Clipboard copy was denied.`)}finally{if(i.remove(),t instanceof HTMLElement&&t.focus({preventScroll:!0}),n){n.removeAllRanges();for(let e of r)n.addRange(e)}}}var Yc=new URL(`teammy-wordmark-ZFwxG0yl.png`,import.meta.url).href,Xc=new URL(`teammy-mark-CxBtF1-X.png`,import.meta.url).href,Zc=new URL(`teammy-calm-DVuoOK0F.png`,import.meta.url).href,Qc=new URL(`teammy-wave-CVTgecuC.png`,import.meta.url).href,$c=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function el(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:$c(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var tl=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},nl=e=>{let t=tl(e);return t.charAt(0).toUpperCase()+t.slice(1)},rl=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),il={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function al(e){return e!=null}function ol(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??il.width,a=e.size??e.height??il.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?rl(...c):rl(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??il[`stroke-width`])*Number(e.size??e.width??il.width)/Number(t.size??t.width??il.width):t.strokeWidth??il[`stroke-width`];return[`svg`,{...Object.entries(il).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&al(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&al(t.width)&&{[r(`width`)]:t.width},...`height`in t&&al(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function sl(e,t={}){return ol(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var cl=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ll=(0,q.createContext)({}),ul=()=>(0,q.useContext)(ll),dl=(0,q.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:ee=!1,color:te=`currentColor`,className:ne=``}=ul()??{},g=!!c||cl(d),[re,ie,ae=[]]=sl(u,{color:e??te,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??ee,className:rl(ne,s),hasA11yProp:g,attributes:d});return(0,q.createElement)(re,{ref:f,...ie},[...ae.map(([e,t])=>(0,q.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Q(e,t=[],n=[]){let r=typeof e==`string`?el(e,t,n):e,i=(0,q.forwardRef)(({className:e,...t},n)=>(0,q.createElement)(dl,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=nl(r.name)),i}var fl={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};fl.node;var pl=Q(fl),ml={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};ml.node;var hl=Q(ml),gl={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};gl.node;var _l=Q(gl),vl={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};vl.node;var yl=Q(vl),bl={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};bl.node;var xl=Q(bl),Sl={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Sl.node;var Cl=Q(Sl),wl={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};wl.node;var Tl=Q(wl),El={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};El.node;var Dl=Q(El),Ol={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};Ol.node;var kl=Q(Ol),Al={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Al.node;var jl=Q(Al),Ml={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Ml.node;var Nl=Q(Ml),Pl={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Pl.node;var Fl=Q(Pl),Il={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Il.node;var Ll=Q(Il),Rl={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Rl.node;var zl=Q(Rl),Bl={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Bl.node;var Vl=Q(Bl),Hl={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Hl.node;var Ul=Q(Hl),Wl={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Wl.node;var Gl=Q(Wl),Kl={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Kl.node;var ql=Q(Kl),Jl={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Jl.node;var Yl=Q(Jl),Xl={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Xl.node;var Zl=Q(Xl),Ql={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};Ql.node;var $l=Q(Ql),eu={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};eu.node;var tu=Q(eu),nu={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};nu.node;var ru=Q(nu),iu={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};iu.node;var au=Q(iu),ou={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};ou.node;var su=Q(ou),cu={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};cu.node;var lu=Q(cu),uu={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};uu.node;var du=Q(uu),fu={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};fu.node;var pu=Q(fu),mu={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};mu.node;var hu=Q(mu),gu={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};gu.node;var _u=Q(gu),vu={name:`user-round-check`,size:24,node:[[`path`,{d:`M2 21a8 8 0 0 1 13.292-6`,key:`bjp14o`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]],aliases:[`user-check-2`]};vu.node;var yu=Q(vu),bu={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};bu.node;var xu=Q(bu),Su={name:`user-round-x`,size:24,node:[[`path`,{d:`m16.5 16.5 5 5`,key:`zc9lw7`}],[`path`,{d:`M2 21a8 8 0 0 1 11.531-7.18`,key:`x5izle`}],[`path`,{d:`m21.5 16.5-5 5`,key:`1empo3`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]],aliases:[`user-x-2`]};Su.node;var Cu=Q(Su),wu={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};wu.node;var Tu=Q(wu),Eu={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Eu.node;var Du=Q(Eu),Ou=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ku=o(((e,t)=>{t.exports=Ou()})),$=ku();function Au({compact:e=!1}){return(0,$.jsx)(`div`,{className:`brand ${e?`brand-compact`:``}`,children:(0,$.jsx)(`img`,{src:e?Xc:Yc,alt:`Teammy`})})}function ju({pose:e=`calm`}){return(0,$.jsx)(`img`,{className:`mascot mascot-${e}`,src:e===`wave`?Qc:Zc,alt:``,"aria-hidden":`true`})}function Mu({name:e,small:t=!1}){return(0,$.jsx)(`span`,{className:`avatar ${t?`small`:``}`,"aria-hidden":`true`,children:Array.from(e)[0]?.toUpperCase()})}function Nu({children:e}){return(0,$.jsx)(`span`,{className:`count`,children:e})}function Pu({title:e,description:t,icon:n,mascot:r=!1,children:i}){return(0,$.jsxs)(`div`,{className:`empty-state`,children:[r?(0,$.jsx)(ju,{}):n?(0,$.jsx)(Gu,{name:n}):null,(0,$.jsx)(`h3`,{children:e}),t&&(0,$.jsx)(`p`,{children:t}),i]})}function Fu({title:e,count:t,children:n}){return(0,$.jsxs)(`div`,{className:`section-heading`,children:[(0,$.jsxs)(`h2`,{children:[e,t!==void 0&&(0,$.jsx)(Nu,{children:t})]}),n]})}function Iu({label:e,children:t}){return(0,$.jsx)(`div`,{className:`toolbar-actions`,role:`group`,"aria-label":e,children:t})}function Lu({children:e,error:t=!1}){return e?(0,$.jsx)(`div`,{"data-testid":`notice`,"data-kind":t?`error`:`info`,className:`notice ${t?`error`:``}`,role:t?`alert`:`status`,children:e}):null}function Ru({id:e,name:t,label:n,hint:r,children:i}){let a=[i.props[`aria-describedby`],r?`${e}-hint`:void 0].filter(Boolean).join(` `)||void 0;return(0,$.jsxs)(`label`,{className:`field`,htmlFor:e,children:[(0,$.jsx)(`span`,{id:`${e}-label`,children:n}),(0,q.cloneElement)(i,{id:e,name:t??i.props.name??e,"data-testid":e,"aria-labelledby":`${e}-label`,"aria-describedby":a}),r&&(0,$.jsx)(`small`,{id:`${e}-hint`,children:r})]})}function zu({title:e,description:t,children:n}){return(0,$.jsxs)(`header`,{className:`page-header`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{children:e}),t&&(0,$.jsx)(`p`,{children:t})]}),n]})}function Bu({id:e,title:t,children:n,onClose:r}){let i=(0,q.useRef)(null);return(0,q.useEffect)(()=>{let e=document.activeElement;return i.current?.showModal(),()=>{i.current?.close(),e?.focus()}},[]),(0,$.jsx)(`dialog`,{id:e,"data-testid":e,"aria-labelledby":`${e}-title`,ref:i,onCancel:r,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,$.jsxs)(`div`,{className:`dialog-content`,children:[(0,$.jsxs)(`header`,{className:`dialog-header`,children:[(0,$.jsx)(`h2`,{id:`${e}-title`,children:t}),(0,$.jsx)(Ku,{icon:`close`,label:X.close,"data-testid":`dialog-close`,onClick:r})]}),n]})})}function Vu({id:e,label:t,value:n}){let[r,i]=(0,q.useState)(``);return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`command`,"data-testid":e,children:[(0,$.jsx)(`code`,{"data-testid":`${e}-value`,children:n}),(0,$.jsx)(Ku,{icon:`copy`,"data-testid":`${e}-copy`,label:`${X.copy}${t}`,onClick:async()=>{try{await Jc(n),i(X.copied)}catch{i(X.copyFailed)}}})]}),r&&(0,$.jsx)(`small`,{"data-testid":`${e}-feedback`,role:`status`,children:r})]})}function Hu({value:e}){return e?(0,$.jsx)(`time`,{dateTime:e,children:new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}):(0,$.jsx)(`span`,{children:`—`})}var Uu={assistant:_u,archive:pl,send:hl,dashboard:ql,sessions:$l,files:Ul,folderOpen:Vl,chevronUp:Tl,chevronDown:xl,members:Tu,settings:pu,refresh:lu,chevron:Cl,file:zl,download:Fl,code:kl,preview:Ll,sparkles:_u,close:Du,plus:su,edit:ru,device:tu,disable:Cu,enable:yu,reset:Gl,menu:Zl,logout:Yl,account:xu,copy:jl,general:hu,connect:au,model:Nl,check:yl,search:du,notifications:_l,attention:Dl},Wu={small:16,normal:24,navigation:38};function Gu({name:e,size:t=`normal`}){let n=Uu[e];return(0,$.jsx)(n,{className:`icon`,size:Wu[t],strokeWidth:2,absoluteStrokeWidth:!0,"aria-hidden":`true`})}function Ku({label:e,icon:t,tooltip:n=t!==`refresh`,className:r=``,variant:i=`ghost`,...a}){return(0,$.jsx)(`button`,{type:`button`,...a,className:`icon-button ${i===`primary`?`primary`:``} ${r}`,"aria-label":e,"data-tooltip":n?e:void 0,children:(0,$.jsx)(Gu,{name:t})})}function qu(e){let t=`projects/${encodeURIComponent(e)}`,n=(e,n,r)=>Z(`${t}/${e}`,n,r);return{projectId:e,request:n,api:Vc(n),blobUrl:e=>d(`/api/v1/${t}/blobs/${e}`),readTextBlob:(e,n)=>Gc(e,n,`/api/v1/${t}`)}}var Ju=(0,q.createContext)(null);function Yu(){let e=(0,q.useContext)(Ju);if(!e)throw Error(`Project context is required.`);return e}export{K as $,Ec as A,Fc as B,Bc as C,Uc as D,Z as E,xc as F,pc as G,Oc as H,wc as I,J,fc as K,Nc as L,Dc as M,jc as N,Rc as O,Cc as P,Ns as Q,Pc as R,zc as S,Wc as T,kc as U,Lc as V,mc as W,W as X,Ls as Y,U as Z,Iu as _,Au as a,h as at,qc as b,Pu as c,p as ct,Ku as d,l as dt,bs as et,ju as f,Fu as g,zu as h,Mu as i,ns as it,Ac as j,X as k,Ru as l,o as lt,Lu as m,qu as n,V as nt,Vu as o,d as ot,Bu as p,Y as q,Yu as r,js as rt,Nu as s,f as st,Ju as t,G as tt,Gu as u,s as ut,Hu as v,Hc as w,Kc as x,ku as y,Ic as z};
|
|
55
|
+
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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ia(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ia(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var La=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ra=[`oneOf`,`anyOf`];function za(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ba(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!La.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??za(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}_(n,r,e.length===1?e[0]:Ba(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=za(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Va(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of La)if(t in e)return;let n=t.filter(e=>Ra.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ba(t);else{let e=n[0],i=Ra.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ba([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ma(e,r))}function Ha(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)):Ma(i,s),Ma(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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ia(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Va(e)}}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)}Ma(i,n.defId?n.schema: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??{};if(!e.external||e.sharedEmitDoneFor!==e.external)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&&(e.sharedEmitDoneFor=e.external),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:Wa(t,`input`,e.processors),output:Wa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L(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 L(r.element,n);if(r.type===`set`)return L(r.valueType,n);if(r.type===`lazy`)return L(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`||r.type===`catch`)return L(r.innerType,n);if(r.type===`intersection`)return L(r.left,n)||L(r.right,n);if(r.type===`record`||r.type===`map`)return L(r.keyType,n)||L(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:L(r.in,n)||L(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L(e,n))return!0;return!!(r.rest&&L(r.rest,n))}return!1}var Ua=(e,t={})=>n=>{let r=Na({...n,processors:t});return I(e,r),Fa(r,e),Ha(r,e)},Wa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Na({...i??{},target:a,io:t,processors:n});return I(e,o),Fa(o,e),Ha(o,e)},Ga=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ka=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},qa=(e,t)=>{Ga(e,`minimum`,t),Ka(e,`maximum`,t)},Ja=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ya=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Xa=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Za=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Qa=(e,t)=>Ga(e,`minimum`,t.minimum),$a=(e,t)=>Ka(e,`maximum`,t.maximum),eo=e=>(t,n)=>{Za(t,n.format);let[r,i]=e[n.format];Ga(t,`minimum`,r),Ka(t,`maximum`,i)},to={greater_than:(e,t)=>Ga(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ka(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ja(e,t.value),number_format:eo(ye),bigint_format:eo(be),min_length:Qa,max_length:$a,length_equals:(e,t)=>qa(e,t.length),min_size:Qa,max_size:$a,size_equals:(e,t)=>qa(e,t.size),string_format:(e,t)=>{Za(e,t.format),t.pattern&&Ya(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Xa(e,t.mime)};function R(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)to[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ga(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ga(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ka(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ka(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ja(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Xa(t,i.mime);for(let e of i.patterns??[])Ya(t,e);return t}var no={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ro=new Map([[ur,Yt],[fr,Xt]]),io=e=>ro.get(e)??e,ao=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=R(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=no[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(io);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}))])}},oo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=R(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):F(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},so=(e,t,n,r)=>{n.type=`boolean`},co=(e,t,n,r)=>{n.not={}},lo=(e,t,n,r)=>{let i=e._zod.def,a=ee(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},uo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(F(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(F(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},fo=(e,t,n,r)=>{F(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},po=(e,t,n,r)=>{F(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},mo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=R(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=I(a.element,t,{...r,path:[...r.path,`items`]})};function ho(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?ho(t.out):t.type===`catch`?ho(t.innerType):e._zod.optin}var go=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&F(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)_(i.properties,e,I(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?ho(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=I(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},_o=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>I(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},vo=(e,t,n,r)=>{let i=e._zod.def,a=I(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=I(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},yo=(e,t,n,r)=>{let i=e._zod.def,a=I(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`}]},bo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xo=Symbol();function So(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(F(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),xo):JSON.parse(o)}var Co=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=So(i.defaultValue,e,t,n,r);o!==xo&&(n.default=o)},wo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=So(i.defaultValue,e,t,n,r);o!==xo&&(n._prefault=o)},To=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{F(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Eo=(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;I(o,t,r);let s=t.seen.get(e);s.ref=o},Do=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Oo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ko=new WeakSet([Object.prototype,Error.prototype]);function Ao(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var jo=(e,t)=>{lt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ko.has(n)||(ko.add(n),Ao(n,`format`,e=>t=>ft(e,t)),Ao(n,`flatten`,e=>t=>dt(e,t)),Ao(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ne,2)}),Ao(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ne,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Mo=k(`ZodError`,jo),z=k(`ZodError`,jo,void 0,{Parent:Error}),No=mt(z),Po=ht(z),Fo=gt(z),Io=vt(z),Lo=wt(z),Ro=Tt(z),zo=Et(z),Bo=Dt(z),Vo=Ot(z),Ho=kt(z),Uo=At(z),Wo=jt(z);function Go(){A.localeError||j(wi())}function Ko(){A.memoizer||j({memoizer:xi()})}var B=k(`ZodType`,(e,t)=>(Go(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(x(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 w(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(oc(e,t))},superRefine(e,t){return this.check(sc(e,t))},overwrite(e){return this.check(Sa(e))},optional(){return Hs(this)},exactOptional(){return Ws(this)},nullable(){return Ks(this)},nullish(){return Hs(Ks(this))},nonoptional(e){return Qs(this,e)},array(){return W(this)},or(e){return js([this,e])},and(e){return Fs(this,e)},transform(e){return nc(this,Bs(e))},default(e){return Js(this,e)},prefault(e){return Xs(this,e)},catch(e){return ec(this,e)},pipe(e){return nc(this,e)},readonly(){return ic(this)},describe(e){let t=this.clone();return Oi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Oi.get(this);let t=this.clone();return Oi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return He(this,`~standard`,{...Mn(this),jsonSchema:{input:Wa(this,`input`),output:Wa(this,`output`)}})},set"~standard"(e){D(this,`~standard`,e)},parse:function e(t,n){return No(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Po(this,t,n,{callee:e})},safeParse(e,t){return Fo(this,e,t)},async safeParseAsync(e,t){return Io(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){D(this,`spa`,e)},validate(e,t){return xt(this,e,t)},validateAsync(e,t){return Ct(this,e,t)},encode:function e(t,n){return Lo(this,t,n,{callee:e})},decode:function e(t,n){return Ro(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await zo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Bo(this,t,n,{callee:e})},safeEncode(e,t){return Vo(this,e,t)},safeDecode(e,t){return Ho(this,e,t)},async safeEncodeAsync(e,t){return Uo(this,e,t)},async safeDecodeAsync(e,t){return Wo(this,e,t)},toJSONSchema(e){return Ua(this,{})(e)},get description(){return Oi.get(this)?.description},get _def(){return this._zod.def}}),qo=k(`_ZodString`,(e,t)=>{Nn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)},Ue({format:e=>R(e).format??null,minLength:e=>R(e).minimum??null,maxLength:e=>R(e).maximum??null},{regex(...e){return this.check(ga(...e))},includes(...e){return this.check(ya(...e))},startsWith(...e){return this.check(ba(...e))},endsWith(...e){return this.check(xa(...e))},min(...e){return this.check(ma(...e))},max(...e){return this.check(pa(...e))},length(...e){return this.check(ha(...e))},nonempty(...e){return this.check(ma(1,...e))},lowercase(e){return this.check(_a(e))},uppercase(e){return this.check(va(e))},trim(){return this.check(wa())},normalize(...e){return this.check(Ca(...e))},toLowerCase(){return this.check(Ta())},toUpperCase(){return this.check(Ea())},slugify(){return this.check(Da())}})),Jo=k(`ZodString`,(e,t)=>{Nn.init(e,t),qo.init(e,t)},{email(e){return this.check(ji($o,e))},url(e){return this.check(Li(rs,e))},jwt(e){return this.check(Qi(vs,e))},emoji(e){return this.check(Ri(is,e))},guid(e){return this.check(Mi(es,e))},uuid(e){return this.check(Ni(ts,e))},uuidv4(e){return this.check(Pi(ts,e))},uuidv6(e){return this.check(Fi(ts,e))},uuidv7(e){return this.check(Ii(ts,e))},nanoid(e){return this.check(zi(as,e))},cuid(e){return this.check(Bi(os,e))},cuid2(e){return this.check(Vi(ss,e))},ulid(e){return this.check(Hi(cs,e))},base64(e){return this.check(Yi(hs,e))},base64url(e){return this.check(Xi(gs,e))},xid(e){return this.check(Ui(ls,e))},ksuid(e){return this.check(Wi(us,e))},ipv4(e){return this.check(Gi(ds,e))},ipv6(e){return this.check(Ki(fs,e))},cidrv4(e){return this.check(qi(ps,e))},cidrv6(e){return this.check(Ji(ms,e))},e164(e){return this.check(Zi(_s,e))},datetime(e){return this.check($i(Yo,e))},date(e){return this.check(ea(Xo,e))},time(e){return this.check(ta(Zo,e))},duration(e){return this.check(na(Qo,e))}});function V(e){return Ai(Jo,e)}var H=k(`ZodStringFormat`,(e,t)=>{P.init(e,t),qo.init(e,t)}),Yo=k(`ZodISODateTime`,(e,t)=>{Qn.init(e,t),H.init(e,t)}),Xo=k(`ZodISODate`,(e,t)=>{$n.init(e,t),H.init(e,t)}),Zo=k(`ZodISOTime`,(e,t)=>{er.init(e,t),H.init(e,t)}),Qo=k(`ZodISODuration`,(e,t)=>{tr.init(e,t),H.init(e,t)}),$o=k(`ZodEmail`,(e,t)=>{In.init(e,t),H.init(e,t)}),es=k(`ZodGUID`,(e,t)=>{Pn.init(e,t),H.init(e,t)}),ts=k(`ZodUUID`,(e,t)=>{Fn.init(e,t),H.init(e,t)});function ns(e){return Ni(ts,e)}var rs=k(`ZodURL`,(e,t)=>{Wn.init(e,t),H.init(e,t)}),is=k(`ZodEmoji`,(e,t)=>{Gn.init(e,t),H.init(e,t)}),as=k(`ZodNanoID`,(e,t)=>{Kn.init(e,t),H.init(e,t)}),os=k(`ZodCUID`,(e,t)=>{qn.init(e,t),H.init(e,t)}),ss=k(`ZodCUID2`,(e,t)=>{Jn.init(e,t),H.init(e,t)}),cs=k(`ZodULID`,(e,t)=>{Yn.init(e,t),H.init(e,t)}),ls=k(`ZodXID`,(e,t)=>{Xn.init(e,t),H.init(e,t)}),us=k(`ZodKSUID`,(e,t)=>{Zn.init(e,t),H.init(e,t)}),ds=k(`ZodIPv4`,(e,t)=>{nr.init(e,t),H.init(e,t)}),fs=k(`ZodIPv6`,(e,t)=>{ar.init(e,t),H.init(e,t)}),ps=k(`ZodCIDRv4`,(e,t)=>{or.init(e,t),H.init(e,t)}),ms=k(`ZodCIDRv6`,(e,t)=>{cr.init(e,t),H.init(e,t)}),hs=k(`ZodBase64`,(e,t)=>{dr.init(e,t),H.init(e,t)}),gs=k(`ZodBase64URL`,(e,t)=>{mr.init(e,t),H.init(e,t)}),_s=k(`ZodE164`,(e,t)=>{hr.init(e,t),H.init(e,t)}),vs=k(`ZodJWT`,(e,t)=>{_r.init(e,t),H.init(e,t)}),ys=k(`ZodNumber`,(e,t)=>{vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.isFinite=!0},Ue({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=R(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=R(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=R(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>R(e).format??null},{gt(e,t){return this.check(ua(e,t))},gte(e,t){return this.check(da(e,t))},min(e,t){return this.check(da(e,t))},lt(e,t){return this.check(ca(e,t))},lte(e,t){return this.check(la(e,t))},max(e,t){return this.check(la(e,t))},int(e){return this.check(Ss(e))},safe(e){return this.check(Ss(e))},positive(e){return this.check(ua(0,e))},nonnegative(e){return this.check(da(0,e))},negative(e){return this.check(ca(0,e))},nonpositive(e){return this.check(la(0,e))},multipleOf(e,t){return this.check(fa(e,t))},step(e,t){return this.check(fa(e,t))},finite(){return this}}));function bs(e){return ra(ys,e)}var xs=k(`ZodNumberFormat`,(e,t)=>{yr.init(e,t),ys.init(e,t)});function Ss(e){return ia(xs,e)}var Cs=k(`ZodBoolean`,(e,t)=>{br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r)});function U(e){return aa(Cs,e)}var ws=k(`ZodUnknown`,(e,t)=>{xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ts(){return oa(ws)}var Es=k(`ZodNever`,(e,t)=>{Sr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r)});function Ds(e){return sa(Es,e)}var Os=k(`ZodArray`,(e,t)=>{Ko(),Er.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ma(e,t))},nonempty(e){return this.check(ma(1,e))},max(e,t){return this.check(pa(e,t))},length(e,t){return this.check(ha(e,t))},unwrap(){return this.element}});function W(e,t){return Oa(Os,e,t)}var ks=k(`ZodObject`,(e,t)=>{Ko(),Mr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),Ye(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ls(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(x(this._zod.def,{catchall:e}))},passthrough(){return this.clone(x(this._zod.def,{catchall:Ts()}))},loose(){return this.clone(x(this._zod.def,{catchall:Ts()}))},strict(){return this.clone(x(this._zod.def,{catchall:Ds()}))},strip(){return this.clone(x(this._zod.def,{catchall:void 0}))},extend(e){return we(this,e)},safeExtend(e){return Ee(this,e)},merge(e){return De(this,e)},pick(e){return xe(this,e)},omit(e){return Ce(this,e)},partial(...e){return Oe(Vs,this,e[0])},exactPartial(...e){return Oe(Us,this,e[0],`exactPartial`)},required(...e){return ke(Zs,this,e[0])}});function G(e,t){return new ks({type:`object`,shape:e??{},...T(t)})}var As=k(`ZodUnion`,(e,t)=>{Pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.options=t.options});function js(e,t){return new As({type:`union`,options:e,...T(t)})}var Ms=k(`ZodDiscriminatedUnion`,(e,t)=>{As.init(e,t),Ir.init(e,t)});function Ns(e,t,n){return new Ms({type:`union`,options:t,discriminator:e,...T(n)})}var Ps=k(`ZodIntersection`,(e,t)=>{Lr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)});function Fs(e,t){return new Ps({type:`intersection`,left:e,right:t})}var Is=k(`ZodEnum`,(e,t)=>{Br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 Is({...t,checks:[],...T(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 Is({...t,checks:[],...T(r),entries:i})}});function Ls(e,t){return new Is({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}var Rs=k(`ZodLiteral`,(e,t)=>{Vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(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 K(e,t){return new Rs({type:`literal`,values:Array.isArray(e)?e:[e],...T(t)})}var zs=k(`ZodTransform`,(e,t)=>{Ko(),Hr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Be(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Be(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Bs(e){return new zs({type:`transform`,transform:e})}var Vs=k(`ZodOptional`,(e,t)=>{Wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hs(e){return new Vs({type:`optional`,innerType:e})}var Us=k(`ZodExactOptional`,(e,t)=>{Gr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ws(e){return new Us({type:`optional`,innerType:e})}var Gs=k(`ZodNullable`,(e,t)=>{Kr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ks(e){return new Gs({type:`nullable`,innerType:e})}var qs=k(`ZodDefault`,(e,t)=>{qr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Js(e,t){return new qs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}var Ys=k(`ZodPrefault`,(e,t)=>{Yr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xs(e,t){return new Ys({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}var Zs=k(`ZodNonOptional`,(e,t)=>{Xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qs(e,t){return new Zs({type:`nonoptional`,innerType:e,...T(t)})}var $s=k(`ZodCatch`,(e,t)=>{$r.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ec(e,t){return new $s({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ze(t)})}var tc=k(`ZodPipe`,(e,t)=>{ei.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.in=t.in,e.out=t.out});function nc(e,t){return new tc({type:`pipe`,in:e,out:t})}var rc=k(`ZodReadonly`,(e,t)=>{ni.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ic(e){return new rc({type:`readonly`,innerType:e})}var ac=k(`ZodCustom`,(e,t)=>{ii.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r)});function oc(e,t={}){return ka(ac,e,t)}function sc(e,t){return Aa(e,t)}var q=h(),J=V().regex(/^[a-z][a-z0-9_-]{0,63}$/),cc=ns();G({deviceId:cc,projectId:J.optional()}).strict(),G({workspaceId:J,memberId:J,deviceId:cc}),G({members:W(J)});var lc=134217728,uc=10485760,dc=3e5,fc=V().regex(/^[a-f0-9]{64}$/),Y=bs().int().nonnegative().max(2**53-1),pc=V().min(1).max(1024).refine(e=>e!==e.normalize(`NFC`)||/[\\\x00-\x1f\x7f:<>"|?*]/.test(e)?!1:e.split(`/`).every(e=>e.length>0&&e.length<=255&&e!==`.`&&e!==`..`&&!/[. ]$/.test(e)&&!/^\.teammy(?:-|$)/i.test(e)&&!/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(e)),`Path must be a portable, normalized relative file path.`),mc=G({sha256:fc,size:bs().int().min(0).max(lc)}),hc=mc.extend({size:bs().int().min(0).max(uc)}),gc=Ns(`kind`,[hc.extend({kind:K(`upsert`),path:pc}).strict(),G({kind:K(`delete`),path:pc}).strict()]);G({operationId:ns(),parentRevision:Y,changes:W(gc)}).strict().refine(e=>new Set(e.changes.map(e=>e.path)).size===e.changes.length,`Duplicate paths in a publication.`),G({operationId:ns(),revision:Y});var _c=hc.extend({path:pc,revision:Y});G({revision:Y,complete:U().default(!1),files:W(_c),nextCursor:V().nullable()}),G({headRevision:Y,revisions:W(G({revision:Y,operationId:ns(),createdAt:V(),changes:W(gc)}))}),G({hashes:W(fc).max(200)}).strict(),G({missing:W(fc)});var vc=Ns(`kind`,[_c.extend({kind:K(`file`)}),G({kind:K(`directory`),path:pc,fileCount:bs().int().positive()})]),yc=G({revision:Y,path:js([K(``),pc]),entries:W(vc),nextCursor:V().nullable()}),bc=G({revision:Y,file:_c}),xc=V().url().max(2048).refine(e=>{let t=new URL(e);return[`http:`,`https:`].includes(t.protocol)&&!t.username&&!t.password&&!t.search&&!t.hash},`Use an HTTP(S) server URL without credentials, query or fragment.`),Sc=G({checkIntervalSeconds:bs().int().min(1).max(86400),fileSettleSeconds:bs().int().min(0).max(86400)}).strict(),Cc=G({schemaVersion:K(1),projectId:J,projectName:V().trim().min(1).max(120),description:V().max(2e3),publicServerUrl:xc,configRevision:Y,scopeProfile:K(`workspace-and-sessions-v1`),sync:Sc}).strict(),wc=G({operationId:ns(),publicServerUrl:xc,adminId:J}).strict(),Tc=G({initialized:U()}),Ec=Cc.pick({projectName:!0,description:!0}).extend({expectedRevision:Y.optional()}).strict(),Dc=G({id:J,displayName:V().max(120),enabled:U(),accountEnabled:U(),revision:Y,bound:U(),fileRevision:Y,lastPublishedAt:V().nullable()}),Oc=G({memberId:J,displayName:V(),siteRole:Ls([`admin`,`member`])}),kc=Oc.extend({workspaceId:J}),Ac=G({id:J}).strict(),jc=G({expectedRevision:Y,displayName:V().trim().max(120).optional(),enabled:U().optional()}).strict();G({operationId:ns(),projectName:V().trim().min(1).max(120),description:V().max(2e3).default(``),workspacePath:V().trim().min(1).optional()}).strict();var Mc=G({projects:W(G({projectId:J,projectName:V(),description:V()}))}),Nc=G({sync:Sc,publicServerUrl:xc,revision:Y}),Pc=G({publicServerUrl:xc.optional(),sync:Sc.optional(),expectedRevision:Y}).strict().refine(e=>e.publicServerUrl!==void 0||e.sync!==void 0,`Provide a setting to update.`),Fc=G({id:J,displayName:V(),siteRole:Ls([`admin`,`member`]),enabled:U(),revision:Y}),Ic=G({id:J,displayName:V().trim().max(120).default(``),siteRole:Ls([`admin`,`member`]).default(`member`)}).strict(),Lc=G({expectedRevision:Y,displayName:V().trim().max(120).optional(),enabled:U().optional(),siteRole:Ls([`admin`,`member`]).optional()}).strict(),X={brand:`Teammy`,navigation:`主导航`,filePreview:`文件预览`,versionPicker:`选择目录版本`,connectCommand:`连接命令`,syncCommand:`开启同步命令`,syncStopCommand:`停止同步命令`,installCommandLabel:`安装命令`,skipToMain:`跳到主要内容`,loading:`正在加载…`,retry:`重试`,refresh:`刷新`,cancel:`取消`,close:`关闭`,save:`保存`,saving:`正在保存…`,next:`下一步`,back:`上一步`,confirm:`确认`,logout:`退出登录`,menu:`导航菜单`,files:`文件浏览`,dashboard:`工作看板`,sessions:`对话库`,members:`成员`,settings:`设置`,account:`个人账户`,project:`项目`,projectName:`项目名称`,description:`项目说明`,address:`团队接入地址`,addressHint:`填写成员设备能够访问的服务地址。`,adminId:`管理员 ID`,memberId:`成员 ID`,idHint:`以小写字母开头,最多 64 位,可包含数字、短横线或下划线。ID 创建后不可修改。`,displayName:`显示名称`,admin:`管理员`,member:`成员`,enabled:`已启用`,disabled:`已停用`,login:`进入工作台`,loginTitle:`连接你的团队`,loginHint:`输入管理员预先建立的成员 ID。`,existing:`接入已有工作区`,choose:`请选择`,interval:`文件检查间隔(秒)`,settle:`文件稳定等待(秒)`,timingHint:`文件停止修改后开始计时。新设置约 30 秒后下发,当前批次结束后生效。`,scope:`共享范围`,owner:`文件所属成员`,noFiles:`该目录版本暂无文件`,noFilesHint:`运行客户端同步后查看。`,pickFile:`选择文件,查看内容`,more:`加载更多`,name:`文件路径`,size:`大小`,version:`版本`,directoryVersion:`目录版本`,latest:`最新版本`,viewVersion:`查看版本`,download:`下载原文件`,raw:`原文`,rendered:`预览`,previewUnavailable:`该文件不支持文本预览,请下载查看。`,previewLarge:`文件超过 512 KiB,请下载查看完整内容。`,readOnly:`只读`,refreshFiles:`刷新目录`,remoteImage:`图片`,addMember:`添加成员`,editName:`修改名称`,disableMember:`停用成员`,enableMember:`启用成员`,resetDevice:`重置设备`,resetHint:`撤销该成员的设备凭证,保留共享文件与历史。成员需要重新运行 connect --reconnect。`,disableHint:`停止该成员访问和同步本项目,保留历史资料。其他项目不受影响。`,enableHint:`恢复本项目访问权限。设备需要重新接入。`,bound:`设备已绑定`,unbound:`尚未绑定设备`,noContact:`尚无状态报告`,lastContact:`最近联系`,lastPublished:`最近发布`,noPublication:`尚未发布文件`,stale:`报告已超过 2 分钟`,applied:`已应用`,waiting:`等待应用`,failed:`应用失败`,received:`已接收`,saved:`服务端已保存`,override:`含命令行覆盖`,effective:`当前有效策略`,syncResult:`最近同步`,pending:`待发文件`,clientVersion:`客户端版本`,syncIssues:`同步提示`,statusHint:`最近上报状态,非实时在线状态。`,connectTitle:`连接项目目录`,connectHint:`在工作目录(例如 utu/)运行以下命令,并在打开的网页中确认用户 ID,将当前工作目录连接到 Teammy 服务:`,connectAfter:`注意:会话采集以工作目录为范围,只采集该目录及其子目录中的 Agent 会话。因此,建议在项目根目录(例如 utu/)执行此命令。`,install:`首次使用`,installHint:`需要 Node.js 22.19+,客户端版本与服务端保持一致。`,copy:`复制`,copied:`已复制`,copyFailed:`复制失败,请手动选择命令。`,configSaved:`设置已保存,等待客户端接收并上报。`,reloadConfig:`读取最新设置`,configConflict:`设置已被其他成员修改。先读取最新设置,再重新编辑。`,permissionHint:`公共设置由管理员维护。`,application:`配置应用情况`,serverVersion:`服务端版本`,notReported:`未上报`,seconds:`秒`,errors:{AI_DEFAULT_REQUIRED:`请选择模型,或先设置默认接入点。`,AI_PROFILE_DISABLED:`该模型接入点已停用,请重新选择。`,AI_CONFIG_CONFLICT:`模型设置已更新,请重新载入后保存。`,SITE_ADMIN_REQUIRED:`此操作需要站点管理员身份。`,USER_NOT_FOUND:`用户尚未建立或账号已停用,请联系站点管理员。`,USER_EXISTS:`该用户 ID 已存在。`,PROJECT_NOT_FOUND:`项目不存在或你已不再是该项目成员。`,PROJECT_REQUIRED:`请选择一个项目。`,PROJECT_MISMATCH:`设备凭证属于其他项目。`,UNKNOWN_MEMBER:`成员 ID 不存在或已被停用。`,LOGIN_REQUIRED:`登录已失效,请重新登录。`,ADMIN_REQUIRED:`此操作需要管理员身份。`,STALE_CONFIG:`设置已变更,请读取最新设置后重试。`,STALE_MEMBER:`成员信息已变更,请刷新后重试。`,LAST_ADMIN:`至少需要保留一位启用的管理员。`,MEMBER_EXISTS:`该成员 ID 已存在。`,ALREADY_INITIALIZED:`服务已初始化,请刷新页面进入登录。`,INVALID_REQUEST:`请检查输入内容和数值范围。`,FORBIDDEN:`没有执行此操作的权限。`,INVALID_REVISION:`该目录版本不存在。`}};function Rc(e){let t=e.replace(/\s+/g,` `).trim()||`未命名对话`,n=Array.from(t);return n.length>56?n.slice(0,56).join(``)+`…`:t}var zc=class extends Error{code;status;constructor(e,t,n){super(X.errors[e]??t),this.code=e,this.status=n}};async function Z(e,t,n={}){let r=await fetch(d(`/api/v1/${e}`),{method:n.method??`GET`,headers:{accept:`application/json`,...n.body===void 0?{}:{"content-type":`application/json`},...n.method&&n.method!==`GET`?{"x-teammy-web":`1`}:{}},body:n.body===void 0?void 0:JSON.stringify(n.body),signal:n.signal?AbortSignal.any([n.signal,AbortSignal.timeout(n.timeoutMs??15e3)]):AbortSignal.timeout(n.timeoutMs??15e3),credentials:`same-origin`}),i=await r.json();if(!r.ok){let e=new zc(i.error?.code??`HTTP_ERROR`,i.error?.message??`HTTP ${r.status}`,r.status);throw e.code===`LOGIN_REQUIRED`&&window.dispatchEvent(new Event(`teammy:logout`)),e}return t.parse(i)}var Bc={server:e=>Z(`server`,G({version:V()}),{signal:e}),projects:e=>Z(`projects`,Mc,{signal:e}),setup:e=>Z(`setup`,Tc,{signal:e}),session:e=>Z(`web/session`,Oc,{signal:e}),login:e=>Z(`web/session`,Oc,{method:`POST`,body:{id:e}}),logout:()=>Z(`web/session`,G({ok:U()}),{method:`DELETE`})};function Vc(e){return{config:t=>e(`project/config`,Cc,{signal:t}),members:t=>e(`web/members`,G({members:W(Dc)}),{signal:t}),file:(t,n,r,i)=>e(`files/${encodeURIComponent(t)}/entry?${new URLSearchParams({path:n,...r===void 0?{}:{revision:String(r)}})}`,bc,{signal:i}),tree:(t,n,r,i,a)=>e(`files/${encodeURIComponent(t)}/tree?${new URLSearchParams({path:n,after:i,limit:`100`,...r===void 0?{}:{revision:String(r)}})}`,yc,{signal:a})}}function Hc(e){return e instanceof Mo?X.errors.INVALID_REQUEST:e instanceof Error?e.message:String(e)}function Uc(e){return`'${e.replaceAll(`'`,`'\\''`)}'`}function Wc(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function Gc(e,t,n){let r=await fetch(d(`${n}/blobs/${e.sha256}`),{signal:AbortSignal.any([t,AbortSignal.timeout(dc)])});if(!r.ok)throw r.status===401&&window.dispatchEvent(new Event(`teammy:logout`)),new zc(`HTTP_ERROR`,`HTTP ${r.status}`,r.status);let i=await r.arrayBuffer();if(i.byteLength!==e.size)throw Error(`File size mismatch.`);let a;try{a=new TextDecoder(`utf-8`,{fatal:!0}).decode(i)}catch{throw Error(X.previewUnavailable)}if(a.includes(`\0`))throw Error(X.previewUnavailable);return a}var Kc=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qc=o(((e,t)=>{t.exports=Kc()})),Q=qc(),Jc=class{values=new Map;get(e){return this.values.get(e)}set(e,t){this.values.set(e,t)}delete(e){this.values.delete(e)}},Yc=(0,q.createContext)(void 0);function Xc({children:e}){let[t]=(0,q.useState)(()=>new Jc);return(0,Q.jsx)(Yc.Provider,{value:t,children:e})}var Zc=()=>(0,q.useContext)(Yc),Qc=(...e)=>JSON.stringify(e);function $c(e,t=!1,n){let r=Zc(),i=n??e,a=()=>n?r?.get(n):void 0,[o,s]=(0,q.useState)(()=>({source:i,data:a(),error:``,loading:!0})),c=o.source===i?o:{source:i,data:a(),error:``,loading:!0},l=(0,q.useRef)(null),u=(0,q.useRef)(0),d=(0,q.useCallback)(async()=>{l.current?.abort();let t=new AbortController;l.current=t;let o=++u.current;s(e=>({source:i,data:e.source===i?e.data:a(),error:``,loading:!0}));try{let a=await e(t.signal);o===u.current&&(n&&r?.set(n,a),s({source:i,data:a,error:``,loading:!1}))}catch(e){if(!t.signal.aborted&&o===u.current){let t=e instanceof zc&&[401,403,404].includes(e.status);t&&n&&r?.delete(n),s(n=>({...n,data:t?void 0:n.data,error:Hc(e)}))}}finally{o===u.current&&(s(e=>({...e,loading:!1})),l.current=null)}},[e,n,r]);return(0,q.useEffect)(()=>{d();let e=()=>{!document.hidden&&!l.current&&d()},n=t?setInterval(e,typeof t==`number`?t:3e4):void 0;return t&&document.addEventListener(`visibilitychange`,e),()=>{u.current++,l.current?.abort(),l.current=null,clearInterval(n),document.removeEventListener(`visibilitychange`,e)}},[d,t]),{data:c.data,error:c.error,loading:c.loading,reload:d}}function el(){let[e]=(0,q.useState)(()=>new AbortController);return(0,q.useEffect)(()=>()=>e.abort(),[e]),e.signal}async function tl(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.activeElement,n=window.getSelection(),r=n?Array.from({length:n.rangeCount},(e,t)=>n.getRangeAt(t).cloneRange()):[],i=document.createElement(`textarea`);i.value=e,i.readOnly=!0,i.style.cssText=`position:fixed;left:0;top:0;opacity:0;pointer-events:none;`,document.body.append(i);try{if(i.focus({preventScroll:!0}),i.select(),!document.execCommand(`copy`))throw Error(`Clipboard copy was denied.`)}finally{if(i.remove(),t instanceof HTMLElement&&t.focus({preventScroll:!0}),n){n.removeAllRanges();for(let e of r)n.addRange(e)}}}var nl=new URL(`teammy-wordmark-ZFwxG0yl.png`,import.meta.url).href,rl=new URL(`teammy-mark-CxBtF1-X.png`,import.meta.url).href,il=new URL(`teammy-calm-DVuoOK0F.png`,import.meta.url).href,al=new URL(`teammy-wave-CVTgecuC.png`,import.meta.url).href,ol=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function sl(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:ol(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var cl=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},ll=e=>{let t=cl(e);return t.charAt(0).toUpperCase()+t.slice(1)},ul=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),dl={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function fl(e){return e!=null}function pl(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??dl.width,a=e.size??e.height??dl.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ul(...c):ul(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??dl[`stroke-width`])*Number(e.size??e.width??dl.width)/Number(t.size??t.width??dl.width):t.strokeWidth??dl[`stroke-width`];return[`svg`,{...Object.entries(dl).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&fl(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&fl(t.width)&&{[r(`width`)]:t.width},...`height`in t&&fl(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ml(e,t={}){return pl(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var hl=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},gl=(0,q.createContext)({}),_l=()=>(0,q.useContext)(gl),vl=(0,q.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:ee=!1,color:te=`currentColor`,className:ne=``}=_l()??{},g=!!c||hl(d),[re,ie,ae=[]]=ml(u,{color:e??te,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??ee,className:ul(ne,s),hasA11yProp:g,attributes:d});return(0,q.createElement)(re,{ref:f,...ie},[...ae.map(([e,t])=>(0,q.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function $(e,t=[],n=[]){let r=typeof e==`string`?sl(e,t,n):e,i=(0,q.forwardRef)(({className:e,...t},n)=>(0,q.createElement)(vl,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ll(r.name)),i}var yl={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};yl.node;var bl=$(yl),xl={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};xl.node;var Sl=$(xl),Cl={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Cl.node;var wl=$(Cl),Tl={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Tl.node;var El=$(Tl),Dl={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Dl.node;var Ol=$(Dl),kl={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};kl.node;var Al=$(kl),jl={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};jl.node;var Ml=$(jl),Nl={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Nl.node;var Pl=$(Nl),Fl={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};Fl.node;var Il=$(Fl),Ll={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Ll.node;var Rl=$(Ll),zl={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};zl.node;var Bl=$(zl),Vl={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Vl.node;var Hl=$(Vl),Ul={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ul.node;var Wl=$(Ul),Gl={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Gl.node;var Kl=$(Gl),ql={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};ql.node;var Jl=$(ql),Yl={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Yl.node;var Xl=$(Yl),Zl={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Zl.node;var Ql=$(Zl),$l={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};$l.node;var eu=$($l),tu={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};tu.node;var nu=$(tu),ru={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};ru.node;var iu=$(ru),au={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};au.node;var ou=$(au),su={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};su.node;var cu=$(su),lu={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};lu.node;var uu=$(lu),du={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};du.node;var fu=$(du),pu={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};pu.node;var mu=$(pu),hu={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};hu.node;var gu=$(hu),_u={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};_u.node;var vu=$(_u),yu={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};yu.node;var bu=$(yu),xu={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};xu.node;var Su=$(xu),Cu={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Cu.node;var wu=$(Cu),Tu={name:`user-round-check`,size:24,node:[[`path`,{d:`M2 21a8 8 0 0 1 13.292-6`,key:`bjp14o`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]],aliases:[`user-check-2`]};Tu.node;var Eu=$(Tu),Du={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Du.node;var Ou=$(Du),ku={name:`user-round-x`,size:24,node:[[`path`,{d:`m16.5 16.5 5 5`,key:`zc9lw7`}],[`path`,{d:`M2 21a8 8 0 0 1 11.531-7.18`,key:`x5izle`}],[`path`,{d:`m21.5 16.5-5 5`,key:`1empo3`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]],aliases:[`user-x-2`]};ku.node;var Au=$(ku),ju={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};ju.node;var Mu=$(ju),Nu={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Nu.node;var Pu=$(Nu);function Fu({compact:e=!1}){return(0,Q.jsx)(`div`,{className:`brand ${e?`brand-compact`:``}`,children:(0,Q.jsx)(`img`,{src:e?rl:nl,alt:`Teammy`})})}function Iu({pose:e=`calm`}){return(0,Q.jsx)(`img`,{className:`mascot mascot-${e}`,src:e===`wave`?al:il,alt:``,"aria-hidden":`true`})}function Lu({name:e,small:t=!1}){return(0,Q.jsx)(`span`,{className:`avatar ${t?`small`:``}`,"aria-hidden":`true`,children:Array.from(e)[0]?.toUpperCase()})}function Ru({children:e}){return(0,Q.jsx)(`span`,{className:`count`,children:e})}function zu({title:e,description:t,icon:n,mascot:r=!1,children:i}){return(0,Q.jsxs)(`div`,{className:`empty-state`,children:[r?(0,Q.jsx)(Iu,{}):n?(0,Q.jsx)(Xu,{name:n}):null,(0,Q.jsx)(`h3`,{children:e}),t&&(0,Q.jsx)(`p`,{children:t}),i]})}function Bu({title:e,count:t,children:n}){return(0,Q.jsxs)(`div`,{className:`section-heading`,children:[(0,Q.jsxs)(`h2`,{children:[e,t!==void 0&&(0,Q.jsx)(Ru,{children:t})]}),n]})}function Vu({label:e,children:t}){return(0,Q.jsx)(`div`,{className:`toolbar-actions`,role:`group`,"aria-label":e,children:t})}function Hu({children:e,error:t=!1}){return e?(0,Q.jsx)(`div`,{"data-testid":`notice`,"data-kind":t?`error`:`info`,className:`notice ${t?`error`:``}`,role:t?`alert`:`status`,children:e}):null}function Uu({id:e,name:t,label:n,hint:r,children:i}){let a=[i.props[`aria-describedby`],r?`${e}-hint`:void 0].filter(Boolean).join(` `)||void 0;return(0,Q.jsxs)(`label`,{className:`field`,htmlFor:e,children:[(0,Q.jsx)(`span`,{id:`${e}-label`,children:n}),(0,q.cloneElement)(i,{id:e,name:t??i.props.name??e,"data-testid":e,"aria-labelledby":`${e}-label`,"aria-describedby":a}),r&&(0,Q.jsx)(`small`,{id:`${e}-hint`,children:r})]})}function Wu({title:e,description:t,children:n}){return(0,Q.jsxs)(`header`,{className:`page-header`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{children:e}),t&&(0,Q.jsx)(`p`,{children:t})]}),n]})}function Gu({id:e,title:t,children:n,onClose:r}){let i=(0,q.useRef)(null);return(0,q.useEffect)(()=>{let e=document.activeElement;return i.current?.showModal(),()=>{i.current?.close(),e?.focus()}},[]),(0,Q.jsx)(`dialog`,{id:e,"data-testid":e,"aria-labelledby":`${e}-title`,ref:i,onCancel:r,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,Q.jsxs)(`div`,{className:`dialog-content`,children:[(0,Q.jsxs)(`header`,{className:`dialog-header`,children:[(0,Q.jsx)(`h2`,{id:`${e}-title`,children:t}),(0,Q.jsx)(Zu,{icon:`close`,label:X.close,"data-testid":`dialog-close`,onClick:r})]}),n]})})}function Ku({id:e,label:t,value:n}){let[r,i]=(0,q.useState)(``);return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`command`,"data-testid":e,children:[(0,Q.jsx)(`code`,{"data-testid":`${e}-value`,children:n}),(0,Q.jsx)(Zu,{icon:`copy`,"data-testid":`${e}-copy`,label:`${X.copy}${t}`,onClick:async()=>{try{await tl(n),i(X.copied)}catch{i(X.copyFailed)}}})]}),r&&(0,Q.jsx)(`small`,{"data-testid":`${e}-feedback`,role:`status`,children:r})]})}function qu({value:e}){return e?(0,Q.jsx)(`time`,{dateTime:e,children:new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}):(0,Q.jsx)(`span`,{children:`—`})}var Ju={assistant:wu,archive:bl,send:Sl,dashboard:eu,sessions:ou,files:Xl,folderOpen:Jl,chevronUp:Ml,chevronDown:Ol,members:Mu,settings:bu,refresh:gu,chevron:Al,file:Kl,download:Hl,code:Il,preview:Wl,sparkles:wu,close:Pu,plus:mu,edit:uu,device:cu,disable:Au,enable:Eu,reset:Ql,menu:iu,logout:nu,account:Ou,copy:Rl,general:Su,connect:fu,model:Bl,check:El,search:vu,notifications:wl,attention:Pl},Yu={small:16,normal:24,navigation:38};function Xu({name:e,size:t=`normal`}){let n=Ju[e];return(0,Q.jsx)(n,{className:`icon`,size:Yu[t],strokeWidth:2,absoluteStrokeWidth:!0,"aria-hidden":`true`})}function Zu({label:e,icon:t,tooltip:n=t!==`refresh`,className:r=``,variant:i=`ghost`,...a}){return(0,Q.jsx)(`button`,{type:`button`,...a,className:`icon-button ${i===`primary`?`primary`:``} ${r}`,"aria-label":e,"data-tooltip":n?e:void 0,children:(0,Q.jsx)(Xu,{name:t})})}function Qu(e){let t=`projects/${encodeURIComponent(e)}`,n=(e,n,r)=>Z(`${t}/${e}`,n,r);return{projectId:e,request:n,api:Vc(n),blobUrl:e=>d(`/api/v1/${t}/blobs/${e}`),readTextBlob:(e,n)=>Gc(e,n,`/api/v1/${t}`)}}var $u=(0,q.createContext)(null);function ed(){let e=(0,q.useContext)($u);if(!e)throw Error(`Project context is required.`);return e}export{Ls as $,Uc as A,Nc as B,Zc as C,Hc as D,Bc as E,Dc as F,Oc as G,Ic as H,jc as I,pc as J,kc as K,Cc as L,X as M,Ec as N,Wc as O,Ac as P,J as Q,xc as R,Qc as S,zc as T,Fc as U,Pc as V,Lc as W,Y as X,fc as Y,cc as Z,Vu as _,Fu as a,G as at,$c as b,zu as c,ns as ct,Zu as d,f as dt,W as et,Iu as f,p as ft,Bu as g,Wu as h,l as ht,Lu as i,bs as it,Rc as j,Z as k,Uu as l,h as lt,Hu as m,s as mt,Qu as n,Ns as nt,Ku as o,V as ot,Gu as p,o as pt,mc as q,ed as r,K as rt,Ru as s,js as st,$u as t,U as tt,Xu as u,d as ut,qu as v,qc as w,Xc as x,el as y,wc as z};
|
package/dist/web/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="theme-color" content="#161615" />
|
|
7
7
|
<title>Teammy 工作台</title>
|
|
8
8
|
<link rel="icon" type="image/png" href="./assets/teammy-favicon-BiDvlPj2.png" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/project-context
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-COCTfq_q.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/project-context--9YVXMif.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./assets/index-C_jc0zVK.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e,et as t,f as n,m as r,ot as i,r as a,tt as o,u as s,w as c,x as l,y as u}from"./project-context-ClIYZ2Zu.js";import{c as d,i as f,n as p,r as m,t as h}from"./index-B02ttZKr.js";import{t as g}from"./Markdown-D-FafgUB.js";var _=e(),v=u(),y=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),b=e=>e.replace(/[#*_`>]/g,``).replace(/\s+/g,` `).trim();function x({mine:e=!1,author:t,time:n,children:r}){return(0,v.jsx)(`div`,{className:`assistant-bubble-row ${e?`mine`:``}`,children:(0,v.jsxs)(`div`,{className:`assistant-bubble`,children:[(0,v.jsxs)(`div`,{className:`assistant-bubble-meta`,children:[(0,v.jsx)(`span`,{children:t}),(0,v.jsx)(`time`,{dateTime:n,children:y(n)})]}),r]})})}function S({me:e}){let{projectId:u,request:S}=a(),w=(0,_.useCallback)(e=>S(`agents/outbox`,m,{signal:e}),[S]),T=l(w,3e3),[E,D]=(0,_.useState)(),[O,k]=(0,_.useState)(`instant`),[A,j]=(0,_.useState)(),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(!1),[I,L]=(0,_.useState)(``),R=(0,_.useRef)(null),z=(0,_.useRef)(!0),B=(T.data?.messages??[]).filter(e=>e.box===`debug`).reverse(),V=T.data?.messages.find(e=>e.id===(O===`debug`?A:O)),H=B.filter(e=>!e.readAt).map(e=>e.id).join(`,`);(0,_.useEffect)(()=>{O===`debug`&&H&&Promise.all(H.split(`,`).map(e=>S(`agents/outbox/${e}/read`,f,{method:`POST`}))).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}).catch(e=>L(c(e)))},[O,H,S,T.reload]),(0,_.useEffect)(()=>{let e=new EventSource(i(`/api/v1/projects/${encodeURIComponent(u)}/agents/chat/events`));e.addEventListener(`snapshot`,e=>{try{D(h.parse(JSON.parse(e.data))),L(``)}catch(e){L(c(e))}}),e.addEventListener(`run`,e=>{let t=p.parse(JSON.parse(e.data));D(e=>e&&{...e,runs:e.runs.some(e=>e.id===t.id)?e.runs:[...e.runs,t]})});for(let t of[`delta`,`reset`,`state`])e.addEventListener(t,e=>{let n=JSON.parse(e.data);D(e=>e&&{...e,runs:e.runs.map(e=>e.id===n.id?{...e,answer:t===`delta`?e.answer+(n.text??``):t===`reset`?``:n.answer??e.answer,state:n.state??e.state,error:n.error===void 0?e.error:n.error}:e)})});return()=>e.close()},[u]),(0,_.useEffect)(()=>{z.current&&R.current?.scrollIntoView({block:`end`})},[O,E?.runs,V?.recipients,B.length]);function U(){window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}async function W(e){if(z.current=!0,k(e),N(``),L(``),j(void 0),e!==`instant`&&e!==`debug`)try{await S(`agents/outbox/${e}/read`,f,{method:`POST`}),U()}catch(e){L(c(e))}}async function G(e){e.preventDefault();let n=M.trim();if(n&&!P){F(!0),L(``);try{if(O===`instant`){let e=await S(`agents/chat`,p,{method:`POST`,body:{text:n}});D(t=>t&&{...t,runs:t.runs.some(t=>t.id===e.id)?t.runs:[...t.runs,e]})}else await S(`agents/outbox/${V.id}/reply`,o({taskId:t()}),{method:`POST`,body:{body:n}}),U(),j(void 0);N(``)}catch(e){L(c(e))}finally{F(!1)}}}let K=O===`instant`||!!V&&!V.archivedAt&&!V.recipients.find(t=>t.userId===e)?.reply;return(0,v.jsxs)(`div`,{className:`split-layout assistant-layout`,"data-testid":`assistant-page`,children:[(0,v.jsxs)(`aside`,{className:`assistant-list`,"aria-label":`消息列表`,children:[(0,v.jsx)(`header`,{className:`assistant-list-heading`,children:(0,v.jsx)(`h1`,{children:`消息`})}),(0,v.jsxs)(`div`,{className:`assistant-message-scroll`,children:[!!B.length&&(0,v.jsxs)(`button`,{type:`button`,"data-testid":`debug-outbox`,className:`assistant-message-item ${O===`debug`?`selected`:``}`,onClick:()=>void W(`debug`),children:[(0,v.jsx)(`span`,{className:`assistant-message-dot ${H?`unread`:``}`}),(0,v.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,v.jsx)(`strong`,{children:`运行提醒`}),(0,v.jsx)(`span`,{children:b(B.at(-1).body)})]})]}),T.data?.messages.filter(e=>e.box!==`debug`).sort((e,t)=>Number(!!e.archivedAt)-Number(!!t.archivedAt)).map(e=>(0,v.jsxs)(`button`,{type:`button`,"data-testid":`outbox-${e.id}`,className:`assistant-message-item ${e.archivedAt?`archived`:``} ${O===e.id?`selected`:``}`,onClick:()=>void W(e.id),children:[(0,v.jsx)(`span`,{className:`assistant-message-dot ${e.readAt?``:`unread`}`}),(0,v.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,v.jsx)(`strong`,{children:b(e.body)}),(0,v.jsxs)(`time`,{dateTime:e.createdAt,children:[new Date(e.createdAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,y(e.createdAt)]})]})]},e.id))]}),(0,v.jsx)(r,{error:!0,children:T.error}),(0,v.jsx)(`footer`,{className:`assistant-entry-footer`,children:(0,v.jsxs)(d,{className:`assistant-launcher`,"aria-pressed":O===`instant`,onClick:()=>void W(`instant`),"data-testid":`assistant-launcher`,children:[(0,v.jsx)(n,{}),(0,v.jsx)(`strong`,{className:`assistant-launcher-copy`,children:`与提百事聊聊`})]})})]}),(0,v.jsxs)(`section`,{className:`assistant-thread`,"aria-label":O===`instant`?`提百事对话`:`消息内容`,children:[(0,v.jsx)(`header`,{className:`assistant-thread-heading`,children:(0,v.jsx)(`h2`,{children:O===`instant`?`提百事`:O===`debug`?`运行提醒`:`项目消息`})}),(0,v.jsxs)(`div`,{className:`assistant-transcript`,role:`log`,"aria-live":`polite`,"data-testid":`assistant-transcript`,onScroll:e=>{let t=e.currentTarget;z.current=t.scrollHeight-t.scrollTop-t.clientHeight<100},children:[O===`instant`?E?.runs.length?E.runs.map(t=>(0,v.jsxs)(`div`,{className:`assistant-turn`,children:[(0,v.jsx)(x,{mine:!0,author:e,time:t.createdAt,children:(0,v.jsx)(`div`,{className:`markdown`,children:(0,v.jsx)(g,{children:t.text})})}),(0,v.jsxs)(x,{author:`提百事`,time:t.createdAt,children:[t.answer&&(0,v.jsx)(`div`,{className:`markdown`,children:(0,v.jsx)(g,{children:t.answer})}),[`queued`,`running`].includes(t.state)&&(0,v.jsxs)(`span`,{className:`assistant-typing`,"aria-label":`正在回答`,children:[(0,v.jsx)(`i`,{}),(0,v.jsx)(`i`,{}),(0,v.jsx)(`i`,{})]}),t.state===`failed`&&(0,v.jsx)(r,{error:!0,children:t.error||`本次回答未完成。`})]})]},t.id)):(0,v.jsxs)(`div`,{className:`assistant-empty`,children:[(0,v.jsx)(n,{}),(0,v.jsx)(`p`,{children:`有什么项目问题想聊聊?`})]}):O===`debug`?B.map(t=>(0,v.jsx)(C,{item:t,me:e,onReply:!t.archivedAt&&!t.recipients.find(t=>t.userId===e)?.reply?()=>{j(t.id),N(``),L(``)}:void 0},t.id)):V&&(0,v.jsx)(C,{item:V,me:e}),(0,v.jsx)(`div`,{ref:R})]}),(0,v.jsx)(r,{error:!0,children:I}),K&&O!==`instant`&&(0,v.jsx)(`p`,{className:`assistant-reply-hint`,id:`assistant-reply-hint`,children:O===`debug`?`回复运行提醒:${b(V.body).split(`诊断码`)[0]}。发送后将作为新的后台输入。`:`回应「提百事」的问题。注意:只能发送一条消息,发送后「提百事」会恢复工作。`}),K?(0,v.jsxs)(`form`,{className:`assistant-composer`,onSubmit:e=>void G(e),children:[(0,v.jsx)(`textarea`,{value:M,onChange:e=>N(e.target.value),"aria-label":O===`instant`?`向提百事提问`:`回复消息`,"aria-describedby":O===`instant`?void 0:`assistant-reply-hint`,placeholder:O===`instant`?`问问提百事…`:`回复…`,rows:2,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),(0,v.jsx)(`button`,{className:`primary assistant-send`,type:`submit`,disabled:P||!M.trim(),"aria-label":`发送`,children:(0,v.jsx)(s,{name:`send`})})]}):O!==`debug`&&V&&(0,v.jsxs)(`div`,{className:`assistant-archived`,children:[(0,v.jsx)(s,{name:`archive`}),`已归档`]})]})]})}function C({item:e,me:t,onReply:n}){return(0,v.jsxs)(`div`,{"data-testid":`outbox-thread-${e.id}`,children:[(0,v.jsxs)(x,{author:e.box===`debug`?`运行提醒`:`提百事`,time:e.createdAt,children:[(0,v.jsx)(`div`,{className:`markdown`,children:(0,v.jsx)(g,{children:e.body})}),n&&(0,v.jsx)(`button`,{type:`button`,className:`assistant-debug-reply`,onClick:n,children:`回复`})]}),[...e.recipients].filter(e=>e.reply).sort((e,t)=>e.reply.createdAt.localeCompare(t.reply.createdAt)).map(e=>(0,v.jsx)(x,{mine:e.userId===t,author:e.userId,time:e.reply.createdAt,children:(0,v.jsx)(`div`,{className:`markdown`,children:(0,v.jsx)(g,{children:e.reply.body})})},e.userId))]})}export{S as Assistant};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
main#main[data-page=assistant]{height:100dvh;padding:0}.assistant-layout{grid-template-columns:var(--pane-width) minmax(0, 1fr);height:100%;min-height:0}.assistant-list{border-right:1px solid var(--color-line);background:var(--color-surface);flex-direction:column;min-height:0;display:flex}.assistant-list-heading,.assistant-thread-heading{border-bottom:1px solid var(--color-line);flex:0 0 76px;justify-content:space-between;align-items:center;padding:0 24px;display:flex}.assistant-list-heading h1{margin:0;font-size:20px}.assistant-thread-heading h2{margin:0;font-size:17px}.assistant-message-scroll{flex:1;min-height:0;overflow-y:auto}.assistant-message-item{border:0;border-bottom:1px solid var(--color-line);text-align:left;width:100%;color:var(--color-text);background:0 0;border-radius:0;align-items:center;gap:12px;padding:20px 24px;display:flex}.assistant-message-item:hover{background:var(--color-hover)}.assistant-message-item.selected{background:var(--color-soft)}.assistant-message-item.archived{color:var(--color-muted)}.assistant-message-item.archived strong{font-weight:400}.assistant-entry-footer{border-top:1px solid var(--color-line);background:var(--color-surface);flex-shrink:0}.assistant-launcher{width:100%;min-height:76px;color:var(--color-text);text-align:center;background:0 0;border:0;border-radius:0;justify-content:center;align-items:center;margin:0;padding:0 24px;display:flex}.assistant-launcher:hover{background:var(--color-hover)}.assistant-launcher:focus-visible{outline-offset:-4px}.assistant-launcher .selection-content{padding:12px 18px}.assistant-launcher .mascot{flex-shrink:0;width:31.5px;height:47.7px}.assistant-launcher-copy{white-space:nowrap;font-size:16px}.assistant-message-copy{flex-direction:column;gap:6px;min-width:0;display:flex}.assistant-message-copy strong,.assistant-message-copy>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.assistant-message-copy strong{font-size:var(--text-base);font-weight:600}.assistant-message-copy>span,.assistant-message-copy time{font-size:var(--text-xs);color:var(--color-muted)}.assistant-message-dot{border-radius:50%;flex:0 0 7px;width:7px;height:7px}.assistant-message-dot.unread{background:var(--brand-orange)}.assistant-thread{background:var(--color-canvas);flex-direction:column;min-width:0;min-height:0;display:flex}.assistant-transcript{flex:1;min-height:0;padding:28px clamp(20px,4vw,64px);overflow-y:auto}.assistant-bubble-row{margin:0 0 24px;display:flex}.assistant-bubble-row.mine{justify-content:flex-end}.assistant-bubble{border-radius:4px var(--radius-lg) var(--radius-lg);background:var(--color-soft);overflow-wrap:anywhere;min-width:100px;max-width:min(88%,800px);padding:14px 18px}.assistant-bubble-row.mine .assistant-bubble{background:var(--color-accent-soft);border-radius:var(--radius-lg) 4px var(--radius-lg) var(--radius-lg)}.assistant-bubble-meta{font-size:var(--text-xs);color:var(--color-muted);align-items:baseline;gap:16px;margin-bottom:8px;display:flex}.assistant-debug-reply{font-size:var(--text-xs);background:var(--color-surface);margin-top:12px;padding:4px 10px}.assistant-bubble .markdown>:first-child{margin-top:0}.assistant-bubble .markdown>:last-child{margin-bottom:0}.assistant-bubble .markdown{font-size:var(--text-base);line-height:1.75}.assistant-bubble pre{max-width:100%;overflow-x:auto}.assistant-composer{background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-lg);align-items:flex-end;gap:12px;margin:0 28px 28px;padding:12px;display:flex}.assistant-reply-hint{font-size:var(--text-xs);color:var(--color-muted);margin:0 28px 10px;line-height:1.7}.assistant-composer:focus-within{border-color:var(--color-muted)}.assistant-composer textarea{box-shadow:none;resize:vertical;background:0 0;border:0;flex:1;min-height:56px;max-height:220px;padding:8px}.assistant-composer textarea:focus{box-shadow:none;outline:none}.assistant-send{flex:0 0 40px;place-items:center;width:40px;height:40px;padding:0;display:grid}.assistant-empty{height:100%;min-height:240px;color:var(--color-muted);flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex}.assistant-empty .mascot{width:96px;height:144px}.assistant-empty p{margin:0}.assistant-archived{color:var(--color-muted);font-size:var(--text-sm);justify-content:center;align-items:center;gap:8px;padding:24px;display:flex}.assistant-thread>.notice{margin:0 28px 12px}.assistant-typing{gap:5px;padding:8px 0;display:inline-flex}.assistant-typing i{background:var(--color-muted);border-radius:50%;width:5px;height:5px;animation:1.4s infinite assistant-pulse}.assistant-typing i:nth-child(2){animation-delay:.15s}.assistant-typing i:nth-child(3){animation-delay:.3s}@keyframes assistant-pulse{0%,70%,to{opacity:.35}35%{opacity:1}}@media (prefers-reduced-motion:reduce){.assistant-typing i{animation:none}}@media (width<=900px){.assistant-layout{grid-template-columns:240px minmax(0,1fr)}.assistant-message-item{padding:16px}.assistant-composer{margin:0 16px 16px}.assistant-reply-hint{margin:0 16px 10px}.assistant-launcher{padding:0 12px}.assistant-bubble{max-width:96%}}@media (width<=600px){.assistant-layout{grid-template-columns:150px minmax(0,1fr)}.assistant-list-heading,.assistant-thread-heading{padding:0 12px}.assistant-launcher{padding:0 4px}.assistant-launcher .selection-content{padding:12px 6px}.assistant-launcher .selection-inner{gap:4px}.assistant-launcher-copy{font-size:12px}.assistant-transcript{padding:16px 10px}.assistant-composer{gap:4px;margin:0 8px 12px;padding:6px}.assistant-reply-hint{margin:0 8px 10px}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e,b as t,d as n,h as r,l as i,m as a,ot as o,p as s,r as c,s as l,u,v as d,w as f,x as p,y as m}from"./project-context-ClIYZ2Zu.js";import{l as h,u as g}from"./index-B02ttZKr.js";import{t as _}from"./project-links-XbF78Bal.js";import"./file-links-DTDtI322.js";var v=e(),y=m(),b=[{status:`planned`,label:`计划`},{status:`in_progress`,label:`进行中`},{status:`in_review`,label:`待验收`},{status:`completed`,label:`已完成`},{status:null,label:`未明确`}];function x({members:e}){let{request:t}=c(),n=(0,v.useCallback)(e=>t(`tasks`,h,{signal:e}),[t]),i=p(n,3e3),[o,s]=(0,v.useState)(),u=i.data,d=u?.members.some(e=>[`queued`,`running`].includes(e.status)),f=new Map(e.map(e=>[e.id,e.displayName||e.id]));return(0,y.jsxs)(`div`,{className:`task-board`,children:[(0,y.jsx)(r,{title:`工作看板`}),(0,y.jsx)(`span`,{className:`sr-only`,role:`status`,children:d?`正在整理工作区`:i.loading&&!u?`正在读取任务`:``}),(0,y.jsx)(a,{error:!0,children:i.error}),(0,y.jsx)(`section`,{className:`task-board-lanes`,"aria-label":`任务进度`,"data-testid":`progress-board`,children:b.filter(e=>e.status!==null||u?.tasks.some(e=>e.status===null)).map(e=>{let t=u?.tasks.filter(t=>t.status===e.status)??[];return(0,y.jsxs)(`section`,{className:`task-lane`,"aria-label":e.label,"data-stage":e.status??`unknown`,children:[(0,y.jsxs)(`h2`,{children:[(0,y.jsx)(`span`,{className:`lane-dot`}),e.label,(0,y.jsx)(l,{children:u?t.length:`—`})]}),(0,y.jsx)(`div`,{className:`task-lane-content`,children:t.length?t.map(e=>(0,y.jsx)(S,{task:e,names:f,onEdit:()=>s(e),onSaved:()=>void i.reload()},e.id)):(0,y.jsx)(`p`,{className:`task-lane-empty`,children:i.error&&!u?`读取失败`:u?`暂无任务`:`读取中…`})})]},e.label)})}),o&&(0,y.jsx)(w,{task:o,onClose:()=>s(void 0),onSaved:()=>{s(void 0),i.reload()}},o.id)]})}function S({task:e,names:r,onEdit:i,onSaved:s}){let{projectId:l,request:p}=c(),m=t(),[h,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(``);async function w(){if(!h){b(!0),S(``);try{await p(`tasks/${e.id}/correction`,g,{method:`PATCH`,signal:m,body:{needsConfirmation:!1}}),m.aborted||s()}catch(e){m.aborted||S(f(e))}finally{b(!1)}}}return(0,y.jsxs)(`details`,{className:`task-card`,"data-testid":`task-card`,"data-task-id":e.id,"data-owner":e.owner,"data-status":e.status??`unknown`,children:[(0,y.jsxs)(`summary`,{className:`task-card-heading`,"data-testid":`task-toggle`,children:[(0,y.jsx)(`h3`,{children:e.title}),(0,y.jsxs)(`span`,{className:`task-card-meta`,children:[(0,y.jsx)(`small`,{children:r.get(e.owner)??e.owner}),e.needsConfirmation&&(0,y.jsxs)(`span`,{className:`task-confirmation`,"data-testid":`task-confirmation`,children:[(0,y.jsx)(u,{name:`attention`,size:`small`}),`需要确认`]})]})]}),(0,y.jsx)(n,{icon:`edit`,className:`task-card-edit`,label:`纠正任务:${e.title}`,"data-testid":`task-correct`,disabled:h,onClick:i}),(0,y.jsxs)(`div`,{className:`task-card-details`,children:[e.corrected&&!e.needsConfirmation&&(0,y.jsx)(`small`,{children:`已确认`}),e.needsReview&&(0,y.jsx)(`p`,{children:`本次整理未能明确对应,请核对来源。`}),(0,y.jsx)(`h4`,{children:`目标`}),(0,y.jsx)(`p`,{children:e.goal?(0,y.jsx)(C,{value:e.goal,names:r}):`目标未明确`}),(0,y.jsx)(`h4`,{children:`当前进展`}),(0,y.jsx)(`p`,{className:`task-progress`,children:(0,y.jsx)(C,{value:e.progress,names:r})}),(0,y.jsx)(`div`,{className:`task-card-sources`,children:e.sources.map(t=>(0,y.jsxs)(`a`,{"data-testid":`task-source`,href:o(_(l,e.owner,t.path)),children:[(0,y.jsx)(u,{name:`file`,size:`small`}),(0,y.jsx)(`span`,{children:t.path})]},t.path))}),e.syncedAt&&(0,y.jsxs)(`small`,{children:[`资料同步于 `,(0,y.jsx)(d,{value:e.syncedAt})]}),e.needsConfirmation&&(0,y.jsxs)(`div`,{className:`task-card-confirm`,children:[(0,y.jsx)(a,{error:!0,children:x}),(0,y.jsx)(`button`,{className:`primary`,"data-testid":`task-confirm-save`,disabled:h,onClick:()=>void w(),children:h?`正在保存…`:`保存`})]})]})]})}function C({value:e,names:t}){return e.split(/(@[a-z][a-z0-9_-]*)/gi).map((e,n)=>e.startsWith(`@`)&&t.has(e.slice(1))?(0,y.jsx)(`mark`,{className:`task-mention`,children:e},n):e)}function w({task:e,onClose:n,onSaved:r}){let{request:o}=c(),l=t(),[u,d]=(0,v.useState)(e.title),[p,m]=(0,v.useState)(e.status??``),[h,_]=(0,v.useState)(e.goal??``),[x,S]=(0,v.useState)(e.progress),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(``),D={...u===e.title?{}:{title:u},...p===(e.status??``)?{}:{status:p||null},...h===(e.goal??``)?{}:{goal:h||null},...x===e.progress?{}:{progress:x},...e.needsConfirmation?{needsConfirmation:!1}:{}};async function O(t=!1){if(!(C||!t&&!Object.keys(D).length)){w(!0),E(``);try{await o(`tasks/${e.id}/correction`,g,{method:t?`DELETE`:`PATCH`,signal:l,...t?{}:{body:D}}),l.aborted||r()}catch(e){l.aborted||E(f(e))}finally{w(!1)}}}return(0,y.jsx)(s,{id:`task-correction`,title:`纠正任务`,onClose:n,children:(0,y.jsxs)(`form`,{className:`stack`,"aria-busy":C,onSubmit:e=>{e.preventDefault(),O()},children:[(0,y.jsx)(i,{id:`task-title`,label:`标题`,children:(0,y.jsx)(`input`,{value:u,required:!0,onChange:e=>d(e.target.value)})}),(0,y.jsxs)(`fieldset`,{className:`task-status-field`,disabled:C,children:[(0,y.jsx)(`legend`,{children:`状态`}),(0,y.jsx)(`div`,{className:`task-status-options`,"data-testid":`task-status`,children:b.filter(e=>e.status!==null).map(e=>(0,y.jsxs)(`label`,{className:`task-status-choice`,children:[(0,y.jsx)(`input`,{type:`radio`,name:`task-status`,value:e.status,checked:p===e.status,onChange:()=>m(e.status)}),(0,y.jsx)(`span`,{children:e.label})]},e.status))})]}),(0,y.jsx)(i,{id:`task-goal`,label:`目标`,children:(0,y.jsx)(`textarea`,{value:h,onChange:e=>_(e.target.value)})}),(0,y.jsx)(i,{id:`task-progress`,label:`当前进展`,children:(0,y.jsx)(`textarea`,{value:x,onChange:e=>S(e.target.value)})}),(0,y.jsx)(a,{error:!0,children:T}),(0,y.jsxs)(`div`,{className:`row wrap`,children:[(0,y.jsx)(`button`,{type:`submit`,className:`primary`,disabled:C||!Object.keys(D).length,"data-testid":`task-correction-save`,children:`保存`}),e.corrected&&(0,y.jsx)(`button`,{type:`button`,disabled:C,"data-testid":`task-correction-reset`,onClick:()=>void O(!0),children:`恢复自动结果`})]})]})})}function T({members:e}){return(0,y.jsx)(x,{members:e})}export{T as Dashboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.task-board{min-width:0}.task-board .page-header{margin-bottom:40px}.task-board-lanes{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));align-items:start;gap:24px;margin-bottom:32px;display:grid}.task-lane{min-width:0}.task-lane h2{font-size:var(--text-base);border-bottom:1px solid var(--color-line);align-items:center;gap:10px;padding:0 0 16px;font-weight:600;display:flex}.task-lane .count{margin-left:auto}.task-lane-content{flex-direction:column;gap:12px;padding-top:16px;display:flex}.lane-dot{border:1.5px solid var(--color-muted);border-radius:50%;width:8px;height:8px}.task-lane[data-stage=in_progress] .lane-dot{border-color:var(--brand-orange);background:var(--brand-orange)}.task-lane[data-stage=in_review] .lane-dot{border-color:var(--brand-black);background:var(--brand-black)}.task-lane[data-stage=completed] .lane-dot{border-color:var(--color-muted);background:var(--color-muted)}.task-lane-empty{font-size:var(--text-xs);color:var(--color-muted);padding:44px 0}.task-card{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface);overflow-wrap:anywhere;min-width:0;position:relative}.task-card>.task-card-heading{border-radius:inherit;padding:16px;list-style:none;position:relative}.task-card-heading::-webkit-details-marker{display:none}.task-card-heading:hover{background:var(--color-soft)}.task-card[open]>.task-card-heading{padding-right:48px}.task-card-meta{flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;display:flex}.task-confirmation{border-radius:var(--radius-sm);background:var(--color-accent-soft);color:var(--brand-orange);font-size:calc(var(--text-xs) - 1px);align-items:center;gap:3px;padding:0 4px;font-weight:400;line-height:18px;display:inline-flex}.task-confirmation .icon{width:12px;height:12px}.task-card-confirm{flex-direction:column;align-items:flex-end;gap:8px;margin-top:16px;display:flex}.task-card-confirm button{min-height:32px;font-size:var(--text-xs);padding:4px 12px}.task-status-field legend{font-size:var(--text-sm);margin-bottom:8px;font-weight:600}.task-status-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;display:grid}.task-status-choice{cursor:pointer;position:relative}.task-status-choice input{opacity:0;width:100%;height:100%;min-height:0;cursor:inherit;position:absolute;inset:0}.task-status-choice span{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface);min-height:36px;font-size:var(--text-sm);justify-content:center;align-items:center;font-weight:550;display:flex}.task-status-choice:hover span{background:var(--color-soft)}.task-status-choice input:checked+span{border-color:var(--brand-black);background:var(--brand-black);color:var(--color-on-dark)}.task-status-choice input:focus-visible+span{outline:2px solid var(--brand-orange);outline-offset:3px}.task-status-choice input:disabled+span{opacity:.45;cursor:default}.task-card-heading h3{font-size:var(--text-base);font-weight:650;line-height:1.55}.task-card-edit{opacity:0;pointer-events:none;position:absolute;top:10px;right:8px}.task-card[open]:hover>.task-card-edit{opacity:1;pointer-events:auto}.task-card[open]:has(:focus-visible)>.task-card-edit{opacity:1;pointer-events:auto}.task-progress{font-size:var(--text-sm);white-space:pre-wrap;line-height:1.85}.task-card small{color:var(--color-muted);font-size:var(--text-xs)}.task-card-details{padding:0 16px 16px}.task-card-details h4{font-size:var(--text-xs);margin:16px 0 4px;font-weight:600}.task-card-details p{font-size:var(--text-sm);margin:0}.task-card-sources{flex-direction:column;align-items:flex-start;gap:8px;margin:16px 0;display:flex}.task-card-sources a{text-align:left;overflow-wrap:anywhere;max-width:100%;font-size:var(--text-xs);min-height:28px;color:var(--color-muted);justify-content:flex-start;gap:8px;padding:4px 0;text-decoration:none;display:inline-flex}.task-card-sources a:hover{color:var(--color-link);text-decoration:underline}.task-mention{border-radius:var(--radius-sm);background:var(--color-accent-soft);color:inherit;padding:0 2px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as e,S as t,_ as n,at as r,c as i,d as a,k as o,m as s,ot as c,r as l,u,x as d,y as f}from"./project-context-ClIYZ2Zu.js";import{a as p,o as m,s as h}from"./index-B02ttZKr.js";import{t as g}from"./Markdown-D-FafgUB.js";import{t as _}from"./project-links-XbF78Bal.js";import{t as v}from"./file-links-DTDtI322.js";import{n as y,t as b}from"./WorkspaceTree-C406dC60.js";var x=r(),S=f();function C(e,t){let n=t.split(`/`).slice(0,-1);return n.map((t,r)=>y(e,n.slice(0,r+1).join(`/`))).concat(y(e,``))}function w({members:n,me:r,onRefresh:u}){let{api:f,projectId:g}=l(),[w,E]=(0,x.useState)(()=>{let t=new URLSearchParams(location.search),r=t.get(`owner`),i=e.safeParse(t.get(`path`));return r&&(r===`_project`||n.some(e=>e.id===r))&&i.success&&!m(i.data)?{owner:r,path:i.data}:void 0}),[D,O]=(0,x.useState)(()=>new Set(w?C(w.owner,w.path):[y(r,``)])),[k,A]=(0,x.useState)(()=>w?{...w,kind:`file`}:void 0),[j,M]=(0,x.useState)(0),[N,P]=(0,x.useState)(()=>{let e=new URLSearchParams(location.search);return!w&&(e.has(`owner`)||e.has(`path`))?`文件链接不完整或目标已不可用。`:``}),F=(0,x.useCallback)(async e=>{if(w)try{return{owner:w.owner,...await f.file(w.owner,w.path,void 0,e)}}catch(e){throw e instanceof t&&e.code===`FILE_NOT_FOUND`?Error(`找不到这个文件,可能已被删除或移动。`):e}},[w?.owner,w?.path,j]),I=d(F),L=I.data?.owner===w?.owner&&I.data?.file.path===w?.path?I.data:void 0;function R(e,t){let n=t.split(`/`).filter(Boolean);O(t=>{let r=new Set(t);for(let t=0;t<=n.length;t++)r.add(y(e,n.slice(0,t).join(`/`)));return r})}function z(e,t){P(``),R(e,t.split(`/`).slice(0,-1).join(`/`)),E({owner:e,path:t}),A({owner:e,path:t,kind:`file`}),history.replaceState(null,``,c(_(g,e,t)))}function B(e){if(!w)return!1;let t=v(w.owner===`_project`?w.path:`${w.owner}/${w.path}`,e);if(!t)return!/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(`//`)&&(P(`该链接超出工作区,请在原仓库查看。`),!0);if(m(t.path))return P(`配置文件不在文件浏览中显示。`),!0;let[r,...i]=t.path.split(`/`),a=n.some(e=>e.id===r),o=a?r:p,s=a?i.join(`/`):t.path;return P(``),t.directory?(R(o,s),A({owner:o,path:s,kind:`directory`})):o===w.owner&&s===w.path?t.anchor&&[...document.querySelectorAll(`.markdown h1,.markdown h2,.markdown h3,.markdown h4`)].find(e=>e.textContent?.trim().toLowerCase().replace(/\s+/g,`-`)===t.anchor.toLowerCase())?.scrollIntoView({block:`center`}):z(o,s),!0}return(0,S.jsxs)(`div`,{className:`split-layout file-explorer`,"data-testid":`file-browser`,children:[(0,S.jsxs)(`aside`,{className:`file-tree-pane`,"aria-label":`文件资源管理器`,children:[(0,S.jsx)(h,{title:`文件`,icon:`files`,children:(0,S.jsx)(a,{icon:`refresh`,label:`刷新文件`,"data-testid":`files-refresh`,onClick:()=>{P(``),M(e=>e+1),u()}})}),(0,S.jsx)(b,{members:n,expanded:D,selected:k,revealed:!I.loading&&!I.error&&L?{owner:L.owner,path:L.file.path,file:L.file}:void 0,onSelect:z,onToggle:(e,t)=>{A({owner:e,path:t,kind:`directory`}),O(n=>{let r=new Set(n),i=y(e,t);return r.has(i)?r.delete(i):r.add(i),r})}},j)]}),(0,S.jsx)(`section`,{className:`file-detail`,"data-testid":`file-preview`,"data-owner-id":w?.owner,"data-file-path":w?.path,"aria-label":o.filePreview,children:w?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{error:!0,children:N||!I.loading&&I.error}),I.error&&(0,S.jsx)(`button`,{className:`file-entry-retry`,"data-testid":`files-retry`,onClick:()=>void I.reload(),children:o.retry}),I.loading?(0,S.jsx)(`p`,{className:`preview-body`,role:`status`,children:o.loading}):!I.error&&L&&(0,S.jsx)(T,{owner:L.owner,file:L.file,onLink:B},`${L.owner}:${L.file.path}:${L.file.sha256}`)]}):N?(0,S.jsx)(s,{error:!0,children:N}):(0,S.jsx)(i,{mascot:!0,title:`从一份资料开始`,description:o.pickFile})})]})}function T({owner:e,file:t,onLink:r}){let{readTextBlob:i,blobUrl:c}=l(),[f,p]=(0,x.useState)(!1),m=t.size>524288,h=/\.(md|markdown)$/i.test(t.path),_=(0,x.useCallback)(e=>m?Promise.resolve(void 0):i(t,e),[t.sha256,t.size,m]),v=d(_);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`header`,{className:`file-detail-header`,children:[(0,S.jsxs)(`span`,{className:`file-detail-path`,title:`${e===`_project`?`workspaces`:e}/${t.path}`,children:[(0,S.jsxs)(`span`,{children:[e===`_project`?`workspaces`:e,` / `]}),t.path]}),(0,S.jsxs)(n,{label:`文件操作`,children:[h&&(0,S.jsx)(a,{icon:f?`preview`:`code`,label:f?`切换为预览`:`切换为原文`,"data-testid":`file-toggle-raw`,"aria-pressed":f,onClick:()=>p(!f)}),(0,S.jsx)(`a`,{className:`icon-button`,"data-testid":`file-download`,"aria-label":o.download,title:o.download,href:c(t.sha256),download:t.path.split(`/`).at(-1),children:(0,S.jsx)(u,{name:`download`})})]})]}),m?(0,S.jsx)(`div`,{className:`empty`,children:(0,S.jsx)(`p`,{children:o.previewLarge})}):v.error?(0,S.jsxs)(`div`,{className:`preview-body`,children:[(0,S.jsx)(s,{error:!0,children:v.error}),(0,S.jsx)(`button`,{"data-testid":`file-preview-retry`,onClick:()=>void v.reload(),children:o.retry})]}):v.loading?(0,S.jsx)(`p`,{className:`preview-body`,role:`status`,children:o.loading}):(0,S.jsx)(`div`,{className:`preview-body`,children:h&&!f?(0,S.jsx)(`article`,{className:`markdown`,"data-testid":`file-content`,"data-format":`markdown`,children:(0,S.jsx)(g,{onLink:r,children:v.data??``})}):(0,S.jsx)(`pre`,{className:`raw`,"data-testid":`file-content`,"data-format":`text`,children:v.data})})]})}export{w as Files};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,J as t,K as n,O as r,S as i,W as a,X as o,Y as s,Z as c,at as l,b as u,c as d,d as f,et as p,it as m,k as h,m as g,nt as _,ot as v,q as y,r as b,rt as x,tt as S,u as C,v as w,w as T,x as E,y as D}from"./project-context-ClIYZ2Zu.js";import{c as O,s as k}from"./index-B02ttZKr.js";import{n as A,r as j,t as M}from"./Markdown-D-FafgUB.js";import{n as N}from"./project-links-XbF78Bal.js";import{i as P,r as F}from"./WorkspaceTree-C406dC60.js";var I=l(),L=s([`overview`,`handoff`]),R=S({title:_().trim().min(1),summary:_().trim().min(1)}).strict(),z=S({markdown:_().trim().min(1)}).strict(),B=R.extend({sourceRevision:y,sourceHash:n,generatedAt:_(),stale:c()}),V=S({kind:L,status:s([`absent`,`queued`,`running`,`succeeded`,`failed`]),available:c(),currentRevision:y,sourceRevision:y.nullable(),stale:c(),result:x([R,z]).nullable(),generatedAt:_().nullable(),error:_().nullable()}),H=s([`claude-code`,`codex`,`cursor`,`pi`,`dsh`]),U=S({formatVersion:e(1),adapterVersion:e(1),agent:H,nativeId:_().min(1).max(512),cwd:_().min(1).max(4096),messages:o(S({id:_().min(1).max(1024),role:s([`user`,`assistant`]),text:_().min(1),source:_().min(1).max(1024)}).strict())}).strict().refine(e=>new Set(e.messages.map(e=>e.id)).size===e.messages.length,`Duplicate message IDs.`);S({operationId:m(),sessionKey:n,parentRevision:y,blob:a}).strict();var W=S({owner:t,sessionKey:n,agent:H,nativeId:_(),cwd:_(),title:_(),revision:y,updatedAt:_(),messageCount:p().int().nonnegative(),blob:a,overview:B.optional()}),G=S({sessions:o(W),nextCursor:y.nullable()}),K=S({totalSessions:p().int().nonnegative(),totalMessages:p().int().nonnegative(),memberCount:p().int().nonnegative(),updatedAt:_().nullable()});S({owner:t.optional(),sessionKey:n.optional()}).strict().refine(e=>!e.sessionKey||!!e.owner,`A session scope requires an owner.`);var q=S({matches:o(S({owner:t,sessionKey:n,revision:y,messageId:_(),role:s([`user`,`assistant`]),snippet:_(),title:_()})),nextCursor:y.nullable()}),J=S({owner:t,key:n,revision:y.refine(e=>e>0).optional(),messageId:_().min(1).optional()});function Y(e){let t=new URLSearchParams(e);if(![`owner`,`sessionKey`,`revision`,`messageId`].some(e=>t.has(e)))return{};let n=J.safeParse({owner:t.get(`owner`),key:t.get(`sessionKey`),...t.has(`revision`)?{revision:Number(t.get(`revision`))}:{},...t.has(`messageId`)?{messageId:t.get(`messageId`)}:{}});return n.success?{target:n.data}:{error:`对话链接不完整或已损坏。`}}var X=D();function Z({members:e,refresh:t,selected:n,onOwner:r,onSession:i}){let[a,o]=(0,I.useState)(()=>new Set(n?.key?[n.owner]:[])),[s,c]=(0,I.useState)(e[0]?.id??``);return(0,X.jsx)(`div`,{role:`tree`,"aria-label":`成员对话`,"data-testid":`session-tree`,onKeyDown:F,children:[...e].sort((e,t)=>P(e.displayName,t.displayName)||P(e.id,t.id)).map(e=>(0,X.jsxs)(`div`,{role:`none`,children:[(0,X.jsxs)(O,{type:`button`,role:`treeitem`,"aria-level":1,"aria-expanded":a.has(e.id),"aria-selected":n?.owner===e.id&&!n.key,className:`tree-item tree-folder`,style:{"--tree-level":1},tabIndex:s===e.id?0:-1,"data-testid":`session-owner`,"data-owner-id":e.id,onFocus:()=>c(e.id),onClick:()=>{o(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),r(e.id)},leading:(0,X.jsx)(`span`,{className:`tree-chevron ${a.has(e.id)?`expanded`:``}`,children:(0,X.jsx)(C,{name:`chevron`,size:`small`})}),children:[(0,X.jsx)(C,{name:`files`}),(0,X.jsx)(`span`,{className:`tree-name`,title:e.id,children:e.displayName})]}),a.has(e.id)&&(0,X.jsx)(Q,{owner:e.id,selected:n,onSession:i,focused:s,onFocus:c},`${e.id}/${t}`)]},e.id))})}function Q({owner:e,selected:t,onSession:n,focused:i,onFocus:a}){let{request:o}=b(),s=(0,I.useCallback)(t=>o(`sessions?${new URLSearchParams({owner:e,limit:`50`,order:`title`})}`,G,{signal:t}),[e,o]),c=E(s,15e3),[l,u]=(0,I.useState)(),[d,f]=(0,I.useState)(!1),[p,m]=(0,I.useState)(``),h=(0,I.useRef)(null);(0,I.useEffect)(()=>()=>h.current?.abort(),[]);let _=l?l.nextCursor:c.data?.nextCursor;return(0,X.jsxs)(`div`,{role:`group`,"aria-busy":c.loading||d,children:[(0,X.jsx)(g,{error:!0,children:c.error||p}),c.error&&(0,X.jsx)(`button`,{onClick:()=>void c.reload(),children:`重试`}),c.loading&&!c.data&&(0,X.jsx)(`span`,{className:`tree-status`,role:`status`,children:`正在加载…`}),[...new Map([...l?.sessions??[],...c.data?.sessions??[]].map(e=>[e.sessionKey,e])).values()].sort((e,t)=>P(e.title,t.title)||P(e.sessionKey,t.sessionKey)).map(o=>(0,X.jsxs)(O,{type:`button`,role:`treeitem`,"aria-level":2,"aria-selected":t?.owner===e&&t.key===o.sessionKey,className:`tree-item`,style:{"--tree-level":2},tabIndex:i===`${e}/${o.sessionKey}`?0:-1,"data-testid":`session-row`,"data-owner-id":e,"data-session-key":o.sessionKey,title:r(o.title||o.nativeId),onFocus:()=>a(`${e}/${o.sessionKey}`),onClick:()=>n({owner:e,key:o.sessionKey,title:o.title||o.nativeId}),leading:(0,X.jsx)(`span`,{className:`tree-chevron`}),children:[(0,X.jsx)(C,{name:`sessions`}),(0,X.jsx)(`span`,{className:`tree-name`,children:r(o.title||o.nativeId)})]},o.sessionKey)),_!=null&&(0,X.jsx)(`button`,{className:`tree-action`,"data-testid":`session-tree-more`,disabled:d,onClick:async()=>{f(!0),m(``);let t=new AbortController;h.current=t;try{let n=await o(`sessions?${new URLSearchParams({owner:e,after:String(_),limit:`50`,order:`title`})}`,G,{signal:t.signal});u(e=>({sessions:[...e?.sessions??[],...n.sessions],nextCursor:n.nextCursor}))}catch(e){t.signal.aborted||m(T(e))}finally{t.signal.aborted||f(!1)}},children:`加载更多`})]})}function $({info:e}){let[t,n]=(0,I.useState)(!1);return(0,X.jsxs)(`details`,{className:`session-handoff`,onToggle:e=>n(e.currentTarget.open),children:[(0,X.jsx)(`summary`,{children:`交接说明`}),t&&(0,X.jsx)(ee,{info:e})]})}function ee({info:e}){let{request:t}=b(),n=`sessions/${encodeURIComponent(e.owner)}/${e.sessionKey}`,r=(0,I.useCallback)(e=>t(`${n}/analysis/handoff`,V,{signal:e}),[t,n]),i=E(r,5e3),a=u(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(``),d=i.data,f=o||d?.status===`queued`||d?.status===`running`,p=d?.result&&`markdown`in d.result?d.result.markdown:void 0;return(0,X.jsxs)(`div`,{className:`stack`,"data-testid":`session-handoff`,children:[(0,X.jsx)(g,{error:!0,children:c||i.error}),d&&(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(!p||d.stale)&&(0,X.jsx)(`button`,{"data-testid":`session-handoff-generate`,disabled:f||!d.available,onClick:async()=>{s(!0),l(``);try{await t(`${n}/handoff`,V,{method:`POST`,signal:a}),await i.reload()}catch(e){a.aborted||l(T(e))}finally{a.aborted||s(!1)}},children:f?`正在整理…`:d.status===`failed`?`重新生成`:p?`更新交接说明`:`生成交接说明`}),!d.available&&(0,X.jsx)(`small`,{children:`请先配置项目模型接入点`}),d.status===`failed`&&(0,X.jsx)(`small`,{children:`整理未完成,可重试`}),d.stale&&(0,X.jsx)(`small`,{children:`对话已有新内容`}),d.currentRevision!==e.revision&&(0,X.jsx)(`small`,{children:`交接说明使用最新对话;当前阅读的是历史原文`})]}),p&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`small`,{children:[`基于版本 `,d.sourceRevision,` · `,(0,X.jsx)(w,{value:d.generatedAt})]}),(0,X.jsx)(`div`,{className:`markdown`,"data-testid":`session-handoff-body`,children:(0,X.jsx)(M,{children:p})})]})]})}function te({members:e}){let{request:t,projectId:n}=b(),i=(0,I.useCallback)(e=>t(`sessions/stats`,K,{signal:e}),[t]),a=E(i,!0),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,p]=(0,I.useState)(0),[m]=(0,I.useState)(()=>Y(location.search)),[_,y]=(0,I.useState)(m.target),[x,S]=(0,I.useState)(m.target),[C,w]=(0,I.useState)(m.error??``),[T,D]=(0,I.useState)(``),O=(0,I.useRef)(null),A=_?.key?_.title?`搜索对话:${r(_.title)}`:`搜索当前对话`:_?`搜索:${e.find(e=>e.id===_.owner)?.displayName??_.owner} 的对话内容`:``,j=()=>{y(void 0),D(``),M(),O.current?.focus()};function M(){if(!x?.messageId)return;let{messageId:e,...t}=x;S(t),history.replaceState(null,``,v(N(n,t.owner,t.key,t)))}let P=(0,I.useCallback)(e=>{y(t=>t?.owner===e.owner&&t.key===e.sessionKey&&t.title!==e.title?{...t,title:e.title}:t)},[]);(0,I.useEffect)(()=>{let e=()=>{let e=Y(location.search);S(e.target),y(e.target),w(e.error??``),l(``),s(``),D(``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let F=(e,t=``)=>{S(e),y(e),l(``),D(t),w(``),history.replaceState(null,``,v(N(n,e.owner,e.key,e)))};return(0,X.jsxs)(`div`,{className:`split-layout file-explorer session-explorer`,children:[(0,X.jsxs)(`section`,{className:`file-tree-pane`,"aria-label":`${h.sessions}目录`,children:[(0,X.jsx)(k,{title:h.sessions,icon:`sessions`,count:(0,X.jsx)(`span`,{"data-testid":`session-total`,children:a.data?.totalSessions??`—`}),children:(0,X.jsx)(f,{icon:`refresh`,label:`刷新${h.sessions}`,"data-testid":`sessions-refresh`,disabled:a.loading,onClick:()=>{a.reload(),p(e=>e+1)}})}),(0,X.jsx)(g,{error:!0,children:a.error}),(0,X.jsx)(Z,{members:e,refresh:u,selected:_,onOwner:e=>{y({owner:e}),S(void 0),l(``),D(``),w(``),history.replaceState(null,``,v(`/projects/${encodeURIComponent(n)}/sessions`))},onSession:F})]}),(0,X.jsxs)(`section`,{className:`session-reader`,"aria-label":`对话内容与搜索`,children:[(0,X.jsx)(`div`,{className:`session-reader-content`,children:C?(0,X.jsx)(g,{error:!0,children:C}):c?(0,X.jsx)(ne,{query:c,refresh:u,scope:{..._?{owner:_.owner}:{},..._?.key?{sessionKey:_.key}:{}},onSelect:e=>F(e,c)},`${c}/${_?.owner??``}/${_?.key??``}`):x?(0,X.jsx)(re,{selection:x,highlight:T,onLoaded:P,onLatest:()=>F({owner:x.owner,key:x.key})},`${x.owner}/${x.key}/${x.revision}/${u}`):(0,X.jsx)(d,{mascot:!0,title:`选择对话开始阅读`,description:`也可以在下方搜索对话内容。`})}),(0,X.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`session-search-form`,onSubmit:e=>{e.preventDefault(),l(o.trim()),D(``),w(``),p(e=>e+1)},children:[_&&(0,X.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,"data-testid":`session-search-scope`,title:`清除搜索范围`,"aria-label":`清除范围:${A}`,onClick:j,children:[(0,X.jsx)(`span`,{className:`scope-label`,children:A}),(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,X.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,X.jsx)(`input`,{ref:O,"aria-label":`搜索对话`,"data-testid":`session-query`,value:o,maxLength:500,placeholder:`搜索对话内容`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!o&&_&&(e.preventDefault(),j())}}),(c||o||T)&&(0,X.jsx)(f,{icon:`close`,label:`清空搜索`,"data-testid":`session-search-clear`,onClick:()=>{s(``),l(``),D(``),M(),O.current?.focus()}}),(0,X.jsx)(f,{icon:`search`,type:`submit`,label:`搜索`,"data-testid":`session-search`,disabled:!o.trim()})]})]})]})]})}function ne({query:e,refresh:t,scope:n,onSelect:i}){let{request:a}=b(),[o,s]=(0,I.useState)(0),c=(0,I.useCallback)(t=>a(`sessions/search?${new URLSearchParams({q:e,after:String(o),limit:`30`,...n.owner?{owner:n.owner}:{},...n.sessionKey?{sessionKey:n.sessionKey}:{}})}`,q,{signal:t}),[a,e,o,t,n.owner,n.sessionKey]),l=E(c);return(0,X.jsxs)(`section`,{className:`session-results stack`,"aria-label":`搜索结果`,"aria-busy":l.loading,children:[(0,X.jsx)(g,{error:!0,children:l.error}),l.error&&(0,X.jsx)(`button`,{onClick:()=>void l.reload(),children:`重试`}),l.loading&&(0,X.jsx)(`p`,{role:`status`,children:`正在搜索…`}),!l.loading&&l.data?.matches.map(t=>(0,X.jsxs)(`button`,{className:`session-item`,"data-testid":`session-match`,"data-message-id":t.messageId,onClick:()=>i({owner:t.owner,key:t.sessionKey,revision:t.revision,messageId:t.messageId,title:t.title}),children:[(0,X.jsx)(`strong`,{children:r(t.title)}),(0,X.jsxs)(`small`,{children:[t.owner,` · `,t.role===`user`?`用户`:`助手`]}),(0,X.jsx)(`span`,{className:`session-excerpt`,children:(0,X.jsx)(A,{value:j(t.snippet,e),query:e})})]},`${t.owner}:${t.sessionKey}:${t.revision}:${t.messageId}`)),!l.loading&&l.data?.matches.length===0&&(0,X.jsx)(`p`,{className:`empty`,children:`没有找到匹配的对话`}),l.data?.nextCursor!=null&&(0,X.jsx)(`button`,{"data-testid":`sessions-next`,disabled:l.loading,onClick:()=>s(l.data.nextCursor),children:`下一页`}),o>0&&(0,X.jsx)(`button`,{disabled:l.loading,onClick:()=>s(0),children:`返回第一页`})]})}function re({selection:e,highlight:t,onLoaded:n,onLatest:r}){let{request:a}=b(),o=(0,I.useCallback)(async t=>{try{return await a(`sessions/${encodeURIComponent(e.owner)}/${e.key}${e.revision===void 0?``:`?revision=${e.revision}`}`,W,{signal:t})}catch(e){throw e instanceof i&&e.code===`SESSION_NOT_FOUND`?Error(`找不到这条对话或引用的版本,原链接可能已失效。`):e}},[a,e.owner,e.key,e.revision]),s=E(o,5e3);return(0,I.useEffect)(()=>{s.data&&n(s.data)},[s.data,n]),(0,X.jsxs)(`section`,{className:`session-conversation stack`,"data-testid":`session-detail`,children:[(0,X.jsx)(g,{error:!0,children:s.error}),s.error&&(0,X.jsx)(`button`,{onClick:()=>void s.reload(),children:`重试`}),s.loading&&!s.data&&(0,X.jsx)(`p`,{role:`status`,children:`正在读取对话…`}),s.data&&(0,X.jsx)(ie,{info:s.data,messageId:e.messageId,highlight:t,pinned:e.revision!==void 0,onLatest:r},s.data.blob.sha256)]})}function ie({info:e,messageId:t,highlight:n,pinned:i,onLatest:a}){let{readTextBlob:o,projectId:s}=b(),c=(0,I.useCallback)(async t=>U.parse(JSON.parse(await o(e.blob,t))),[e.blob.sha256,e.blob.size]),l=E(c),u=(0,I.useRef)(null);return(0,I.useEffect)(()=>{l.data&&t&&u.current?.scrollIntoView({block:`center`})},[l.data,t]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`header`,{className:`conversation-header`,children:[(0,X.jsx)(`h2`,{className:`session-title`,children:r(e.title||e.nativeId)}),(0,X.jsxs)(`p`,{children:[e.owner,` · `,e.agent,` · `,e.messageCount,` 条消息`]}),(0,X.jsxs)(`small`,{children:[(0,X.jsx)(w,{value:e.updatedAt}),i&&(0,X.jsxs)(X.Fragment,{children:[` `,`· 引用版本 `,e.revision,` ·`,` `,(0,X.jsx)(`a`,{href:v(N(s,e.owner,e.sessionKey)),onClick:e=>{e.preventDefault(),a()},children:`查看最新`})]})]}),e.overview&&(0,X.jsx)(`p`,{"data-testid":`session-summary`,children:e.overview.summary}),e.overview?.stale&&(0,X.jsx)(`small`,{children:`摘要待更新`})]}),(0,X.jsx)($,{info:e}),(0,X.jsx)(g,{error:!0,children:l.error}),l.error&&(0,X.jsx)(`button`,{onClick:()=>void l.reload(),children:`重新读取`}),l.loading&&(0,X.jsx)(`p`,{role:`status`,children:`正在读取对话…`}),l.data&&(0,X.jsxs)(X.Fragment,{children:[t&&!l.data.messages.some(e=>e.id===t)&&(0,X.jsx)(g,{children:`该版本中找不到引用的消息,已打开对话原文。`}),(0,X.jsx)(`div`,{className:`session-messages`,children:l.data.messages.map(e=>(0,X.jsxs)(`article`,{className:`session-message ${e.role} ${e.id===t?`matched`:``}`,"data-testid":`session-message`,"data-message-id":e.id,ref:e.id===t?u:void 0,children:[(0,X.jsx)(`div`,{className:`message-role`,children:e.role===`user`?`用户`:`助手`}),(0,X.jsx)(`div`,{className:`markdown`,children:(0,X.jsx)(M,{highlight:n,children:e.text})})]},e.id))})]})]})}export{te as Sessions};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e,m as t,r as n,u as r,w as i,x as a,y as o}from"./project-context-ClIYZ2Zu.js";import{a as s,c,o as l}from"./index-B02ttZKr.js";var u=e(),d=new Intl.Collator(`zh-CN`,{numeric:!0,sensitivity:`base`});function f(e,t){return d.compare(e,t)||(e<t?-1:+(e>t))}var p=o();function m(e){let t=e.target.closest(`[role="treeitem"]`);if(!t)return;let n=[...e.currentTarget.querySelectorAll(`[role="treeitem"]`)],r=n.indexOf(t),i=Number(t.getAttribute(`aria-level`)),a;switch(e.key){case`ArrowDown`:a=n[r+1];break;case`ArrowUp`:a=n[r-1];break;case`Home`:a=n[0];break;case`End`:a=n.at(-1);break;case`ArrowRight`:t.getAttribute(`aria-expanded`)===`false`?t.click():Number(n[r+1]?.getAttribute(`aria-level`))>i&&(a=n[r+1]);break;case`ArrowLeft`:t.getAttribute(`aria-expanded`)===`true`?t.click():a=n.slice(0,r).reverse().find(e=>Number(e.getAttribute(`aria-level`))<i);break;default:return}e.preventDefault(),a?.focus()}var h=(e,t)=>`${e}/${t}`,g=e=>({"--tree-level":e});function _({members:e,...t}){let[n,r]=(0,u.useState)(`folder:${h(e[0]?.id??``,``)}`);return(0,p.jsx)(`div`,{role:`tree`,"aria-label":`工作区文件`,"data-testid":`workspace-tree`,onKeyDown:m,children:(0,p.jsx)(y,{owner:s,path:``,level:1,members:e,context:{...t,focused:n,onFocus:r}})})}function v({owner:e,path:t,level:n,context:i}){let a=i.expanded.has(h(e,t)),o=`folder:${h(e,t)}`;return(0,p.jsxs)(`div`,{role:`none`,children:[(0,p.jsxs)(c,{type:`button`,role:`treeitem`,className:`tree-item tree-folder`,style:g(n),"aria-label":t||e,"aria-level":n,"aria-expanded":a,"aria-selected":i.selected?.kind===`directory`&&i.selected.owner===e&&i.selected.path===t,tabIndex:i.focused===o?0:-1,"data-testid":`directory-row`,"data-owner-id":e,"data-directory-path":t,onFocus:()=>i.onFocus(o),onClick:()=>i.onToggle(e,t),leading:(0,p.jsx)(`span`,{className:`tree-chevron ${a?`expanded`:``}`,children:(0,p.jsx)(r,{name:`chevron`,size:`small`})}),children:[(0,p.jsx)(r,{name:`files`}),(0,p.jsx)(`span`,{className:`tree-name`,children:t.split(`/`).at(-1)||e})]}),a&&(0,p.jsx)(y,{owner:e,path:t,level:n+1,context:i})]})}function y({owner:e,path:o,level:s,context:d,members:m=[]}){let{api:_}=n(),y=(0,u.useCallback)(t=>_.tree(e,o,void 0,``,t),[e,o]),b=a(y),[x,S]=(0,u.useState)(),[C,w]=(0,u.useState)(!1),[T,E]=(0,u.useState)(``),D=(0,u.useRef)(null);(0,u.useEffect)(()=>()=>D.current?.abort(),[]);let O=x?x.nextCursor:b.data?.nextCursor;async function k(){if(!O||!b.data||C)return;w(!0),E(``);let t=new AbortController;D.current=t;try{let n=await _.tree(e,o,b.data.revision,O,t.signal);t.signal.aborted||S({...n,entries:[...x?.entries??[],...n.entries]})}catch(e){t.signal.aborted||E(i(e))}finally{t.signal.aborted||w(!1)}}let A=[...(b.data?.entries??[]).filter(e=>!l(e.path)),...(x?.entries??[]).filter(e=>!l(e.path))],j=d.revealed;if(j?.owner===e&&!l(j.path)&&(!o||j.path.startsWith(o+`/`))){let e=o?j.path.slice(o.length+1):j.path,t=e.indexOf(`/`),n=t<0?j.path:[o,e.slice(0,t)].filter(Boolean).join(`/`);A.some(e=>e.path===n)||A.push(t<0?{...j.file,kind:`file`}:{kind:`directory`,path:n})}let M=[...A.map(t=>({...t,owner:e})),...m.map(e=>({kind:`directory`,path:``,owner:e.id}))].sort((e,t)=>e.kind===t.kind?f(e.path.split(`/`).at(-1)||e.owner,t.path.split(`/`).at(-1)||t.owner):e.kind===`directory`?-1:1);return(0,p.jsxs)(`div`,{role:`group`,"aria-label":h(e===`_project`?`workspaces`:e,o),"aria-busy":b.loading||C,children:[b.loading&&(0,p.jsx)(`p`,{className:`tree-status`,role:`status`,children:`正在加载…`}),(0,p.jsx)(t,{error:!0,children:b.error||T}),b.error&&(0,p.jsx)(`button`,{className:`tree-action`,onClick:()=>void b.reload(),children:`重试`}),M.map(t=>t.kind===`directory`?(0,p.jsx)(v,{owner:t.owner,path:t.path,level:s,context:d},h(t.owner,t.path)):(0,p.jsxs)(c,{type:`button`,role:`treeitem`,className:`tree-item`,style:g(s),"aria-label":t.path,"aria-level":s,"aria-selected":d.selected?.kind===`file`&&d.selected.owner===e&&d.selected.path===t.path,tabIndex:d.focused===`file:${h(e,t.path)}`?0:-1,"data-testid":`file-row`,"data-owner-id":e,"data-file-path":t.path,onFocus:()=>d.onFocus(`file:${h(e,t.path)}`),onClick:()=>d.onSelect(e,t.path),leading:(0,p.jsx)(`span`,{className:`tree-chevron`}),children:[(0,p.jsx)(r,{name:`file`}),(0,p.jsx)(`span`,{className:`tree-name`,children:t.path.split(`/`).at(-1)})]},t.path)),O&&(0,p.jsx)(`button`,{className:`tree-action`,"data-testid":`files-load-more`,disabled:C,onClick:()=>void k(),children:C?`正在加载…`:`加载更多`})]})}export{f as i,h as n,m as r,_ as t};
|