sliccy 3.19.0 → 3.20.0
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/dist/ui/assets/{adobe-DohCGdaJ.js → adobe--rNKRAem.js} +2 -2
- package/dist/ui/assets/{adobe-Bf86h1D5.js → adobe-pYVVZiyh.js} +1 -1
- package/dist/ui/assets/{agent-bridge-DgkXjoLd.js → agent-bridge-DiWmQ1Bk.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-BuiGWj85.js → agent-message-to-chat-BAl1q6wG.js} +1 -1
- package/dist/ui/assets/{anthropic-WNHH5JyQ.js → anthropic-ByqrgzCA.js} +1 -1
- package/dist/ui/assets/{anthropic-DJLnEQZ9.js → anthropic-DWSyZP9r.js} +1 -1
- package/dist/ui/assets/{apps-BraHktts.js → apps-DiF3CACO.js} +1 -1
- package/dist/ui/assets/{azure-openai-Dz4OVG4b.js → azure-openai-BN2mH0t5.js} +1 -1
- package/dist/ui/assets/{azure-openai-CPTiUnIL.js → azure-openai-CxyEghVN.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-CAvOJMzb.js → azure-openai-responses-BvGIdiyW.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-D0Ndn-ik.js → azure-openai-responses-CK9UYNRy.js} +1 -1
- package/dist/ui/assets/{biome_wasm-z8i0VDCH.js → biome_wasm-DlOgPs6W.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-BhGeKRMq.js → bsh-watchdog-DVqBFRhH.js} +1 -1
- package/dist/ui/assets/{cdp-BgnUSApZ.js → cdp-Ck4NtBbS.js} +3 -3
- package/dist/ui/assets/{cdp-ws-page-bridge-CtQek50l.js → cdp-ws-page-bridge-DLgbKh_S.js} +1 -1
- package/dist/ui/assets/{common-DwS5kTD-.js → common-CdeC4eUO.js} +1 -1
- package/dist/ui/assets/cost-command-BuYudiOy.js +1 -0
- package/dist/ui/assets/{es-DrLYZKIz.js → es-CUaP64aR.js} +1 -1
- package/dist/ui/assets/{follower-sprinkle-bridge-DMMMcWs2.js → follower-sprinkle-bridge-D9Zjm826.js} +1 -1
- package/dist/ui/assets/{github-CMtldO8p.js → github-CRuBt3_B.js} +2 -2
- package/dist/ui/assets/{github-CQv_kWPC.js → github-XR8X3iC4.js} +1 -1
- package/dist/ui/assets/{github-copilot-q3CyJiDZ.js → github-copilot-9G33rr-U.js} +1 -1
- package/dist/ui/assets/{github-copilot-C_PjnsFf.js → github-copilot-iXx_svyc.js} +2 -2
- package/dist/ui/assets/{google-BNEuyyRq.js → google-C7-NvPwD.js} +1 -1
- package/dist/ui/assets/{google-DmCxXYnr.js → google-CP-E88PX.js} +1 -1
- package/dist/ui/assets/{google-shared-CHC5uKaU.js → google-shared-BjHEmgq5.js} +1 -1
- package/dist/ui/assets/{google-shared-Lv724FYP.js → google-shared-DiEz9UPD.js} +1 -1
- package/dist/ui/assets/{google-vertex-DRebsB5t.js → google-vertex-af00KRdw.js} +1 -1
- package/dist/ui/assets/{google-vertex-CxXhMKiI.js → google-vertex-yN3iW84J.js} +1 -1
- package/dist/ui/assets/{intercepted-oauth-gtkEQVcI.js → intercepted-oauth-DmlOF4OS.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-XtbGPqy4.js → js-realm-worker-z70bd_yW.js} +1 -1
- package/dist/ui/assets/{kernel-worker-Cq4HHNuZ.js → kernel-worker-CNIz8m27.js} +23 -23
- package/dist/ui/assets/{lick-ws-bridge-C5rOdYXL.js → lick-ws-bridge-CNQNoyxB.js} +1 -1
- package/dist/ui/assets/{local-llm-BmssqP0a.js → local-llm-CpnZdH3D.js} +1 -1
- package/dist/ui/assets/{magick-wasm-B1c9qQE8.js → magick-wasm-uiQYJr9i.js} +1 -1
- package/dist/ui/assets/{main-1HA17VRp.js → main-BWwTlr49.js} +15 -10
- package/dist/ui/assets/{mistral-gnRdyjaX.js → mistral-CV-0dpIh.js} +1 -1
- package/dist/ui/assets/{mistral-B6J6fedI.js → mistral-rDlWJdxh.js} +1 -1
- package/dist/ui/assets/{nodejs-676uQ5cR.js → nodejs-BD5T0n1m.js} +1 -1
- package/dist/ui/assets/{nuke-command-CMbi4E09.js → nuke-command-B3cOvgFo.js} +1 -1
- package/dist/ui/assets/{oauth-DvxY3mW-.js → oauth-DVUeD7Pm.js} +1 -1
- package/dist/ui/assets/{oauth-bootstrap-DCu7o6-Z.js → oauth-bootstrap-B1mG7gcG.js} +2 -2
- package/dist/ui/assets/{oauth-service-iZMR-e0K.js → oauth-service-C2eJg_2h.js} +1 -1
- package/dist/ui/assets/{oauth-service-DhoC_n4f.js → oauth-service-CqJBezCe.js} +1 -1
- package/dist/ui/assets/{offscreen-client-ChMOthQe.js → offscreen-client-DZC47O--.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-D5XdqYy3.js → onboarding-orchestrator-CSNPkBRs.js} +1 -1
- package/dist/ui/assets/{openai-codex-Cs_6orFK.js → openai-codex-BCTk1GQJ.js} +1 -1
- package/dist/ui/assets/{openai-codex-B3GUW0FP.js → openai-codex-BDVXy43g.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-B4Jr-ytv.js → openai-codex-responses-DkgoFiTw.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-AxMGCfaS.js → openai-codex-responses-LayikwJU.js} +1 -1
- package/dist/ui/assets/{openai-completions-ChDle1uZ.js → openai-completions-2ELktAHg.js} +1 -1
- package/dist/ui/assets/{openai-responses-CqajgT1r.js → openai-responses-CDqNYYvr.js} +1 -1
- package/dist/ui/assets/{openai-responses-Brs6EvoF.js → openai-responses-COa_3YtE.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-BPj98v-h.js → openai-responses-shared-Dq4rm_sb.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-DUElfQLi.js → openai-responses-shared-MQFYKPG4.js} +1 -1
- package/dist/ui/assets/{openrouter-BJcFPr_N.js → openrouter-BCx6jAdP.js} +1 -1
- package/dist/ui/assets/{openrouter-DaeB7mxb.js → openrouter-DtvbLwaN.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-DLJ0zpkn.js → panel-rpc-handlers-t012QsEp.js} +1 -1
- package/dist/ui/assets/{provider-CTIc_i--.js → provider-5FFQ_FIt.js} +1 -1
- package/dist/ui/assets/{provider-E1BWvR5h.js → provider-BQqKnnOZ.js} +2 -2
- package/dist/ui/assets/provider-store-access-B_ejm7jx.js +1 -0
- package/dist/ui/assets/provider-store-access-C4XzXN4y.js +1 -0
- package/dist/ui/assets/{proxied-fetch-BIEqaGzW.js → proxied-fetch-BZ0ZdBXu.js} +1 -1
- package/dist/ui/assets/{pyodide-Cay-cF8t.js → pyodide-Dur0JMev.js} +2 -2
- package/dist/ui/assets/{remote-terminal-view-BqyMrgfa.js → remote-terminal-view-CiYBhs5N.js} +1 -1
- package/dist/ui/assets/{secret-env-DHCnqj3K.js → secret-env-CF6e38Ud.js} +1 -1
- package/dist/ui/assets/{slicc-editor-BFRfg1wD.js → slicc-editor-Be-4DTgL.js} +1 -1
- package/dist/ui/assets/{spawn-ClSHQKYe.js → spawn-B70HvMZb.js} +1 -1
- package/dist/ui/assets/{sql-wasm-D2RI7zQy.js → sql-wasm-B285_eDR.js} +1 -1
- package/dist/ui/assets/{store-Dl3LWB1x.js → store-CGz9_44V.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-CBZWxgMq.js → tray-leave-runtime-N9ug2vpc.js} +1 -1
- package/dist/ui/assets/{typescript-K6kRRWqX.js → typescript-Dr9FEqtD.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-7ltlm158.js → upgrade-detection-CTnnRHL9.js} +1 -1
- package/dist/ui/assets/{web-s8rYqMHF.js → web-DOfYcQx3.js} +1 -1
- package/dist/ui/assets/{ws-subscribers-BTKXGMWq.js → ws-subscribers-DFYWbWpb.js} +1 -1
- package/dist/ui/assets/{xai-grok-B36GAOZB.js → xai-grok-CvQ6Y3aW.js} +1 -1
- package/dist/ui/assets/{xai-grok-C8z08n38.js → xai-grok-s53Z9Pms.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/ui/packages/webapp/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/cost-command-BC6EXJB2.js +0 -1
- package/dist/ui/assets/provider-store-access-B32J9iDo.js +0 -1
- package/dist/ui/assets/provider-store-access-C7JFfvhc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{O as e,_t as t,ft as n,l as r}from"./kernel-worker-
|
|
1
|
+
import{O as e,_t as t,ft as n,l as r}from"./kernel-worker-CNIz8m27.js";var i=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),a=n((e=>{var t=i();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),o=n(((e,t)=>{t.exports=a()})),s=t(n(((e,t)=>{let n=o(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},s=e=>r.includes(e),c=(e,t)=>new Promise((r,o)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){o(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),o(e.originalError);else if(e instanceof TypeError&&!s(e.message))c.stop(),o(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){o(e);return}c.retry(e)||o(c.mainError())}}})});t.exports=c,t.exports.default=c,t.exports.AbortError=i}))(),1)
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2025 Google LLC
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,G as t,J as n,l as r,q as i}from"./kernel-worker-
|
|
1
|
+
import{A as e,G as t,J as n,l as r,q as i}from"./kernel-worker-CNIz8m27.js";import{a,c as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p}from"./google-shared-DiEz9UPD.js";const m={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH};let h=0;const g=(e,n,r)=>{let a=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=C(r),c=o?y(e,o,r?.headers):v(e,T(r),E(r),r?.headers),l=D(e,n,r),f=await r?.onPayload?.(l,e);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:t});let m=null,g=t.content,_=()=>g.length-1;for await(let n of p){t.responseId||=n.responseId;let r=n.candidates?.[0];if(r?.content?.parts)for(let e of r.content.parts){if(e.text!==void 0){let n=d(e);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g.length-1,content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:t}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:e.text,partial:t})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t}),null);let n=e.functionCall.id,r={type:`toolCall`,id:!n||t.content.some(e=>e.type===`toolCall`&&e.id===n)?`${e.functionCall.name}_${Date.now()}_${++h}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:t})}}r?.finishReason&&(t.stopReason=s(r.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),n.usageMetadata&&(t.usage={input:(n.usageMetadata.promptTokenCount||0)-(n.usageMetadata.cachedContentTokenCount||0),output:(n.usageMetadata.candidatesTokenCount||0)+(n.usageMetadata.thoughtsTokenCount||0),cacheRead:n.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},i(e,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t})),r?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:t.stopReason,message:t}),a.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=r?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:t.stopReason,error:t}),a.end()}})(),a},_=(t,r,i)=>{let a=e(t,i,void 0);if(!i?.reasoning)return g(t,r,{...a,thinking:{enabled:!1}});let o=n(t,i.reasoning),s=o===`off`?`high`:o,c=t;return O(c)||k(c)?g(t,r,{...a,thinking:{enabled:!0,level:j(s,c)}}):g(t,r,{...a,thinking:{enabled:!0,budgetTokens:M(c,s,i.thinkingBudgets)}})};function v(e,t,n,r){return new f({vertexai:!0,project:t,location:n,apiVersion:`v1`,httpOptions:b(e,r)})}function y(e,t,n){return new f({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:b(e,n)})}function b(e,t){let n={},r=x(e.baseUrl);return r&&(n.baseUrl=r,n.baseUrlResourceScope=o.COLLECTION,S(r)&&(n.apiVersion=``)),(e.headers||t)&&(n.headers={...e.headers,...t}),Object.keys(n).length>0?n:void 0}function x(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function S(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function C(e){let t=e?.apiKey?.trim()||{}.GOOGLE_CLOUD_API_KEY?.trim();if(!(!t||t===`gcp-vertex-credentials`||w(t)))return t}function w(e){return/^<[^>]+>$/.test(e)}function T(e){let t=e?.project||{}.GOOGLE_CLOUD_PROJECT||{}.GCLOUD_PROJECT;if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function E(e){let t=e?.location||{}.GOOGLE_CLOUD_LOCATION;if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function D(e,t,n={}){let i=p(e,t),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let s={...Object.keys(o).length>0&&o,...t.systemPrompt&&{systemInstruction:r(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:l(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:a(n.toolChoice)}}:s.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=m[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=A(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:i,config:s}}function O(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function k(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function A(e){let t=e;return O(t)?{thinkingLevel:c.LOW}:k(t)?{thinkingLevel:c.MINIMAL}:{thinkingBudget:0}}function j(e,t){if(O(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function M(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{g as streamGoogleVertex,_ as streamSimpleGoogleVertex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e,K as t,Y as n,m as r}from"./main-
|
|
1
|
+
import{J as e,K as t,Y as n,m as r}from"./main-BWwTlr49.js";import{t as i}from"./sanitize-unicode-DmIE6hZJ.js";import{a,c as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p}from"./google-shared-BjHEmgq5.js";var m=`v1`,h=`gcp-vertex-credentials`,g={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH},_=0,v=(n,r,i)=>{let a=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-vertex`,provider:n.provider,model:n.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=T(i),c=o?x(n,o,i?.headers):b(n,D(i),O(i),i?.headers),l=k(n,r,i),f=await i?.onPayload?.(l,n);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:t});let m=null,h=t.content,g=()=>h.length-1;for await(let r of p){t.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let n=d(e);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:h.length-1,content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:t}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:e.text,partial:t})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t}),null);let n=e.functionCall.id,r={type:`toolCall`,id:!n||t.content.some(e=>e.type===`toolCall`&&e.id===n)?`${e.functionCall.name}_${Date.now()}_${++_}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:t})}}i?.finishReason&&(t.stopReason=s(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},e(n,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),i?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:t.stopReason,message:t}),a.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=i?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:t.stopReason,error:t}),a.end()}})(),a},y=(e,t,i)=>{let a=r(e,i,void 0);if(!i?.reasoning)return v(e,t,{...a,thinking:{enabled:!1}});let o=n(e,i.reasoning),s=o===`off`?`high`:o,c=e;return A(c)||j(c)?v(e,t,{...a,thinking:{enabled:!0,level:N(s,c)}}):v(e,t,{...a,thinking:{enabled:!0,budgetTokens:P(c,s,i.thinkingBudgets)}})};function b(e,t,n,r){return new f({vertexai:!0,project:t,location:n,apiVersion:m,httpOptions:S(e,r)})}function x(e,t,n){return new f({vertexai:!0,apiKey:t,apiVersion:m,httpOptions:S(e,n)})}function S(e,t){let n={},r=C(e.baseUrl);return r&&(n.baseUrl=r,n.baseUrlResourceScope=o.COLLECTION,w(r)&&(n.apiVersion=``)),(e.headers||t)&&(n.headers={...e.headers,...t}),Object.keys(n).length>0?n:void 0}function C(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function w(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function T(e){let t=e?.apiKey?.trim()||{}.GOOGLE_CLOUD_API_KEY?.trim();if(!(!t||t===h||E(t)))return t}function E(e){return/^<[^>]+>$/.test(e)}function D(e){let t=e?.project||{}.GOOGLE_CLOUD_PROJECT||{}.GCLOUD_PROJECT;if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function O(e){let t=e?.location||{}.GOOGLE_CLOUD_LOCATION;if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function k(e,t,n={}){let r=p(e,t),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let s={...Object.keys(o).length>0&&o,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:l(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:a(n.toolChoice)}}:s.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=g[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=M(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:r,config:s}}function A(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function j(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function M(e){let t=e;return A(t)?{thinkingLevel:c.LOW}:j(t)?{thinkingLevel:c.MINIMAL}:{thinkingBudget:0}}function N(e,t){if(A(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function P(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{v as streamGoogleVertex,y as streamSimpleGoogleVertex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mt as e}from"./kernel-worker-
|
|
1
|
+
import{mt as e}from"./kernel-worker-CNIz8m27.js";var t=e({applyRewrites:()=>o,createInterceptingOAuthLauncher:()=>s,parseInterceptOAuthConfig:()=>n});function n(e){if(typeof e!=`object`||!e||Array.isArray(e))return{ok:!1,error:`expected a JSON object`};let t=e;if(typeof t.authorizeUrl!=`string`||t.authorizeUrl.length===0)return{ok:!1,error:`authorizeUrl must be a non-empty string`};if(typeof t.redirectUriPattern!=`string`||t.redirectUriPattern.length===0)return{ok:!1,error:`redirectUriPattern must be a non-empty string`};if(t.onCapture!==void 0&&t.onCapture!==`close`&&t.onCapture!==`leave`)return{ok:!1,error:`onCapture must be "close" or "leave"`};if(t.timeoutMs!==void 0&&(typeof t.timeoutMs!=`number`||t.timeoutMs<=0))return{ok:!1,error:`timeoutMs must be a positive number`};let n=r(t.rewrite);return n.ok?{ok:!0,config:{authorizeUrl:t.authorizeUrl,redirectUriPattern:t.redirectUriPattern,rewrite:n.rewrites,onCapture:t.onCapture,timeoutMs:t.timeoutMs}}:n}function r(e){if(e===void 0)return{ok:!0,rewrites:void 0};if(!Array.isArray(e))return{ok:!1,error:`rewrite must be an array`};let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(typeof r!=`object`||!r)return{ok:!1,error:`rewrite[${n}] must be an object`};let i=r;if(typeof i.match!=`string`||i.match.length===0)return{ok:!1,error:`rewrite[${n}].match must be a non-empty string`};if(i.replaceUrl!==void 0&&typeof i.replaceUrl!=`string`)return{ok:!1,error:`rewrite[${n}].replaceUrl must be a string when present`};if(i.appendParams!==void 0){if(typeof i.appendParams!=`object`||i.appendParams===null||Array.isArray(i.appendParams))return{ok:!1,error:`rewrite[${n}].appendParams must be an object`};for(let[e,t]of Object.entries(i.appendParams))if(typeof t!=`string`)return{ok:!1,error:`rewrite[${n}].appendParams.${e} must be a string`}}t.push({match:i.match,appendParams:i.appendParams,replaceUrl:i.replaceUrl})}return{ok:!0,rewrites:t}}function i(e,t){return t.endsWith(`*`)?e.startsWith(t.slice(0,-1)):e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}#`)}function a(e){return e.endsWith(`*`)?e:`${e}*`}function o(e,t){if(!t||t.length===0)return e;let n=e;for(let e of t)if(n.includes(e.match)){if(e.replaceUrl){n=e.replaceUrl;continue}if(e.appendParams)try{let t=new URL(n);for(let[n,r]of Object.entries(e.appendParams))t.searchParams.set(n,r);n=t.toString()}catch{}}return n}function s(e){return async t=>{let n=t.timeoutMs??12e4,r=t.rewrite??[],s=t.onCapture??`close`,c,l,u=!1,d=null,f=async()=>{if(l){try{await e.send(`Fetch.disable`,{},l)}catch{}try{await e.send(`Target.detachFromTarget`,{sessionId:l})}catch{}}if(c&&s===`close`)try{await e.send(`Target.closeTarget`,{targetId:c})}catch{}};return await new Promise(s=>{let p=async t=>{u||(u=!0,clearTimeout(h),e.off(`Fetch.requestPaused`,m),await f(),s(t))},m=n=>{let a=n;if(!a?.request?.url||!l||(typeof n.sessionId==`string`?n.sessionId:void 0)!==l)return;if(i(a.request.url,t.redirectUriPattern)){d=a.request.url,e.send(`Fetch.failRequest`,{requestId:a.requestId,errorReason:`Aborted`},l).catch(()=>{}),p(d);return}let s=o(a.request.url,r);if(s!==a.request.url){e.send(`Fetch.continueRequest`,{requestId:a.requestId,url:s},l).catch(e=>{console.warn(`[intercepted-oauth] continueRequest (rewrite) failed:`,e instanceof Error?e.message:String(e))});return}e.send(`Fetch.continueRequest`,{requestId:a.requestId},l).catch(()=>{})},h=setTimeout(()=>{p(null)},n);(async()=>{try{c=(await e.send(`Target.createTarget`,{url:`about:blank`})).targetId,l=(await e.send(`Target.attachToTarget`,{targetId:c,flatten:!0})).sessionId,e.on(`Fetch.requestPaused`,m),await e.send(`Fetch.enable`,{patterns:[{urlPattern:a(t.redirectUriPattern),requestStage:`Request`},...r.map(e=>({urlPattern:`*${e.match}*`,requestStage:`Request`}))]},l),await e.send(`Page.navigate`,{url:t.authorizeUrl},l)}catch(e){console.error(`[intercepted-oauth] setup failed:`,e instanceof Error?e.message:String(e)),p(null)}})()})}}export{t as n,s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[`unpkg`,`com`].join(`.`);const e=[`esm`,`sh`].join(`.`);[`cdn`,`jsdelivr`,`net`].join(`.`);function t(e,t){return new URL(t,`https://${e}`)}function n(n,r={}){let i=t(e,n.startsWith(`/`)?n:`/${n}`),a=[];if(r.bundle&&a.push(`bundle`),r.target&&a.push(`target=${encodeURIComponent(r.target)}`),r.query)for(let[e,t]of Object.entries(r.query))a.push(t===!0?e:`${e}=${encodeURIComponent(t)}`);return a.length>0&&(i.search=`?${a.join(`&`)}`),i}var r=class extends Error{status;statusText;url;body;constructor(e,t,n,r){let a=typeof r==`string`&&r?`: ${r.slice(0,200)}`:r&&typeof r==`object`?`: ${i(r).slice(0,200)}`:``;super(`HTTP ${e} ${t} ${n}${a}`),this.status=e,this.statusText=t,this.url=n,this.body=r,this.name=`HttpError`}};function i(e){try{return JSON.stringify(e)}catch{return String(e)}}function a(e){return new Promise(t=>setTimeout(t,e))}function o(e,t,n){let r;if(r=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:e?`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`:t,!n)return r;let i=[];for(let[e,t]of Object.entries(n))if(t!=null)if(Array.isArray(t))for(let n of t)n!=null&&i.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`);else i.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`);return i.length===0?r:r+(r.includes(`?`)?`&`:`?`)+i.join(`&`)}function s(e,t){let n={};if(e)for(let[t,r]of Object.entries(e))n[t]=r;if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function c(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`application/json`)||/[+/]json(;|$|\s)/.test(t)}function l(e){if(!e)return null;let t=e.trim();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let e=Number(t);if(Number.isFinite(e)&&e>=0)return Math.round(e*1e3)}let n=Date.parse(t);if(Number.isFinite(n)){let e=n-Date.now();return e>0?e:0}return null}async function u(e){if(c(e.headers.get(`content-type`))){let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return t}}return e.text()}function d(e,t){if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<`u`&&e instanceof Blob||typeof FormData<`u`&&e instanceof FormData||typeof URLSearchParams<`u`&&e instanceof URLSearchParams||typeof ReadableStream<`u`&&e instanceof ReadableStream?e:typeof e==`object`?(Object.keys(t).some(e=>e.toLowerCase()===`content-type`)||(t[`Content-Type`]=`application/json`),JSON.stringify(e)):String(e)}function f(e){let t=e.sleep??a;function n(n){let i=new Set(n.retry?.on??[]),a=Math.max(1,Math.trunc(n.retry?.maxAttempts??1));async function c(c,f,p={}){let m=o(n.baseUrl,f,p.params),h=s(n.headers,p.headers);if(n.token){let e=await n.token({method:c,path:f,url:m});e&&(Object.keys(h).some(e=>e.toLowerCase()===`authorization`)||(h.Authorization=`Bearer ${e}`))}let g=d(p.body,h),_={method:c,headers:h};g!==void 0&&(_.body=g);let v=null;for(let o=0;o<a;o++){let s=n.timeoutMs?new AbortController:null,c=s?setTimeout(()=>s.abort(Error(`timeout`)),n.timeoutMs):null,d=p.signal&&s?.signal?AbortSignal.any([p.signal,s.signal]):p.signal??s?.signal,f=d?{..._,signal:d}:_,h;try{h=await e.fetch(m,f)}finally{c!==null&&clearTimeout(c)}if(v=h,h.ok){let e=await u(h);return p.raw?{body:e,headers:Object.fromEntries(h.headers.entries()),status:h.status}:e}if(!(o+1<a&&i.has(h.status))){let e=await u(h).catch(()=>null);throw new r(h.status,h.statusText,m,e)}let g=l(h.headers.get(`retry-after`)),y=500*2**o;await t(g===null?y:g)}if(v){let e=await u(v).catch(()=>null);throw new r(v.status,v.statusText,m,e)}throw Error(`http: no attempts made for ${c} ${m}`)}return Object.freeze({get:((e,t)=>c(`GET`,e,t)),post:((e,t)=>c(`POST`,e,t)),put:((e,t)=>c(`PUT`,e,t)),delete:((e,t)=>c(`DELETE`,e,t))})}return Object.freeze({client:n})}function p(e){let t=[],n={},r=[],i=(e,t)=>{if(e in n){let r=n[e];Array.isArray(r)?r.push(String(t)):n[e]=[String(r),String(t)]}else n[e]=t},a=2;for(;a<e.length;){let n=e[a];if(n===`--`){r.push(...e.slice(a+1));break}if(n.startsWith(`--`)){let t=n.slice(2),r=t.indexOf(`=`);if(r!==-1){i(t.slice(0,r),t.slice(r+1)),a++;continue}let o=e[a+1];if(o!==void 0&&!o.startsWith(`-`)){i(t,o),a+=2;continue}i(t,!0),a++;continue}if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++;continue}t.push(n),a++}return{positional:t,flags:n,subcommand:t.length>0&&/^[a-z][\w-]*$/i.test(t[0])?t[0]:null,passthrough:r}}function m(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>p(t),enumerable:!1,writable:!1,configurable:!1}),t}function h(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
|
|
1
|
+
[`unpkg`,`com`].join(`.`);const e=[`esm`,`sh`].join(`.`);[`cdn`,`jsdelivr`,`net`].join(`.`);function t(e,t){return new URL(t,`https://${e}`)}function n(n,r={}){let i=t(e,n.startsWith(`/`)?n:`/${n}`),a=[];if(r.bundle&&a.push(`bundle`),r.target&&a.push(`target=${encodeURIComponent(r.target)}`),r.query)for(let[e,t]of Object.entries(r.query))a.push(t===!0?e:`${e}=${encodeURIComponent(t)}`);return a.length>0&&(i.search=`?${a.join(`&`)}`),i}var r=class extends Error{status;statusText;url;body;constructor(e,t,n,r){let a=typeof r==`string`&&r?`: ${r.slice(0,200)}`:r&&typeof r==`object`?`: ${i(r).slice(0,200)}`:``;super(`HTTP ${e} ${t} ${n}${a}`),this.status=e,this.statusText=t,this.url=n,this.body=r,this.name=`HttpError`}};function i(e){try{return JSON.stringify(e)}catch{return String(e)}}function a(e){return new Promise(t=>setTimeout(t,e))}function o(e,t,n){let r;if(r=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:e?`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`:t,!n)return r;let i=[];for(let[e,t]of Object.entries(n))if(t!=null)if(Array.isArray(t))for(let n of t)n!=null&&i.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`);else i.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`);return i.length===0?r:r+(r.includes(`?`)?`&`:`?`)+i.join(`&`)}function s(e,t){let n={};if(e)for(let[t,r]of Object.entries(e))n[t]=r;if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function c(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`application/json`)||/[+/]json(;|$|\s)/.test(t)}function l(e){if(!e)return null;let t=e.trim();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let e=Number(t);if(Number.isFinite(e)&&e>=0)return Math.round(e*1e3)}let n=Date.parse(t);if(Number.isFinite(n)){let e=n-Date.now();return e>0?e:0}return null}async function u(e){if(c(e.headers.get(`content-type`))){let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return t}}return e.text()}function d(e,t){if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<`u`&&e instanceof Blob||typeof FormData<`u`&&e instanceof FormData||typeof URLSearchParams<`u`&&e instanceof URLSearchParams||typeof ReadableStream<`u`&&e instanceof ReadableStream?e:typeof e==`object`?(Object.keys(t).some(e=>e.toLowerCase()===`content-type`)||(t[`Content-Type`]=`application/json`),JSON.stringify(e)):String(e)}function f(e){let t=e.sleep??a;function n(n){let i=new Set(n.retry?.on??[]),a=Math.max(1,Math.trunc(n.retry?.maxAttempts??1));async function c(c,f,p={}){let m=o(n.baseUrl,f,p.params),h=s(n.headers,p.headers);if(n.token){let e=await n.token({method:c,path:f,url:m});e&&(Object.keys(h).some(e=>e.toLowerCase()===`authorization`)||(h.Authorization=`Bearer ${e}`))}let g=d(p.body,h),_={method:c,headers:h};g!==void 0&&(_.body=g);let v=null;for(let o=0;o<a;o++){let s=n.timeoutMs?new AbortController:null,c=s?setTimeout(()=>s.abort(Error(`timeout`)),n.timeoutMs):null,d=p.signal&&s?.signal?AbortSignal.any([p.signal,s.signal]):p.signal??s?.signal,f=d?{..._,signal:d}:_,h;try{h=await e.fetch(m,f)}finally{c!==null&&clearTimeout(c)}if(v=h,h.ok){let e=await u(h);return p.raw?{body:e,headers:Object.fromEntries(h.headers.entries()),status:h.status}:e}if(!(o+1<a&&i.has(h.status))){let e=await u(h).catch(()=>null);throw new r(h.status,h.statusText,m,e)}let g=l(h.headers.get(`retry-after`)),y=500*2**o;await t(g===null?y:g)}if(v){let e=await u(v).catch(()=>null);throw new r(v.status,v.statusText,m,e)}throw Error(`http: no attempts made for ${c} ${m}`)}return Object.freeze({get:((e,t)=>c(`GET`,e,t)),post:((e,t)=>c(`POST`,e,t)),put:((e,t)=>c(`PUT`,e,t)),patch:((e,t)=>c(`PATCH`,e,t)),delete:((e,t)=>c(`DELETE`,e,t))})}return Object.freeze({client:n})}function p(e){let t=[],n={},r=[],i=(e,t)=>{if(e in n){let r=n[e];Array.isArray(r)?r.push(String(t)):n[e]=[String(r),String(t)]}else n[e]=t},a=2;for(;a<e.length;){let n=e[a];if(n===`--`){r.push(...e.slice(a+1));break}if(n.startsWith(`--`)){let t=n.slice(2),r=t.indexOf(`=`);if(r!==-1){i(t.slice(0,r),t.slice(r+1)),a++;continue}let o=e[a+1];if(o!==void 0&&!o.startsWith(`-`)){i(t,o),a+=2;continue}i(t,!0),a++;continue}if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++;continue}t.push(n),a++}return{positional:t,flags:n,subcommand:t.length>0&&/^[a-z][\w-]*$/i.test(t[0])?t[0]:null,passthrough:r}}function m(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>p(t),enumerable:!1,writable:!1,configurable:!1}),t}function h(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
|
|
2
2
|
`)?t:`${t}\n`);return}try{e.writeStdout(`${JSON.stringify(t,null,2)}\n`)}catch{e.writeStdout(`${String(t)}\n`)}},warn(n,i){let a=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0;e.writeStderr(r(a,t(n)))},help(t){throw e.writeStdout(t.endsWith(`
|
|
3
3
|
`)?t:`${t}\n`),e.exit(0),Error(`unreachable`)}}}const g={reset:`\x1B[0m`,green:`\x1B[32m`,red:`\x1B[31m`,yellow:`\x1B[33m`,gray:`\x1B[90m`,bold:`\x1B[1m`,cyan:`\x1B[36m`,dim:`\x1B[2m`};function _(e){let t=e.isTTY&&!e.noColor,n=e=>n=>t?`${e}${n}${g.reset}`:String(n);return{enabled:t,green:n(g.green),red:n(g.red),yellow:n(g.yellow),gray:n(g.gray),bold:n(g.bold),cyan:n(g.cyan),dim:n(g.dim)}}const v={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function y(e){if(typeof e==`number`&&Number.isFinite(e))return Math.trunc(e);if(typeof e!=`string`)throw TypeError(`time.parseDuration: spec must be string or number`);let t=e.trim(),n=/^([0-9]+(?:\.[0-9]+)?)\s*(ms|s|m|h|d|w|M|y)?$/.exec(t);if(!n)throw RangeError(`time.parseDuration: unrecognized spec "${e}"`);let r=Number(n[1]),i=n[2]??`ms`;return Math.trunc(r*v[i])}function b(e){return e<10?`0${e}`:String(e)}const x={parseDuration:y,ago(e,t=new Date){return new Date(t.getTime()-y(e))},range(e,t=new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-y(e)),end:n}},future(e,t=new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+y(e))}},gmailDate(e,t=new Date){let n=new Date(t.getTime()-y(e));return`${n.getFullYear()}/${b(n.getMonth()+1)}/${b(n.getDate())}`}},S=/\u001b\[[0-9;]*m/g;function C(e){return e.replace(S,``)}function w(e){return C(e).length}function T(e,t){let n=String(e??``);return t<=0?``:w(n)<=t?n:t<=1?n.slice(0,t):`${C(n).slice(0,t-1)}…`}function E(e,t){let n=String(e??``),r=w(n);return r===t?n:r>t?T(n,t):n+` `.repeat(t-r)}function D(e,t){if(!e.length)return``;let n=Math.max(...e.map(e=>e.length)),r=[];for(let i=0;i<n;i++)if(t&&t[i]!==void 0)r[i]=t[i];else{let t=0;for(let n of e){let e=i<n.length?String(n[i]??``):``;t=Math.max(t,w(e))}r[i]=t}return e.map(e=>r.map((t,n)=>E(n<e.length?String(e[n]??``):``,t)).join(` `).replace(/\s+$/,``)).join(`
|
|
4
4
|
`)}function O(e){return e instanceof Date?e:new Date(e)}function k(e,t=`short`){let n=O(e);if(Number.isNaN(n.getTime()))return String(e);if(t===`iso`)return n.toISOString();if(t===`locale`)return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}).format(n);if(t===`human`){let e=Date.now()-n.getTime(),t=Math.abs(e);if(t<6e4)return e>=0?`just now`:`in a moment`;let r=(t,n)=>e>=0?`${t} ${n}${t===1?``:`s`} ago`:`in ${t} ${n}${t===1?``:`s`}`;return t<36e5?r(Math.round(t/6e4),`minute`):t<864e5?r(Math.round(t/36e5),`hour`):t<26298e5?r(Math.round(t/864e5),`day`):t<315576e5?r(Math.round(t/26298e5),`month`):r(Math.round(t/315576e5),`year`)}return`${n.getFullYear()}-${b(n.getMonth()+1)}-${b(n.getDate())}`}const A={trunc:T,col:E,table:D,date:k},j=async(e,t,n)=>{let r=Math.max(1,Math.trunc(e)||1),i=Array(t.length),a=0,o=[],s=async()=>{for(;;){let e=a++;if(e>=t.length)return;i[e]=await n(t[e],e)}};for(let e=0;e<Math.min(r,t.length);e++)o.push(s());return await Promise.all(o),i};var M=class{port;nextId=1;pending=new Map;handler;disposed=!1;constructor(e){this.port=e,this.handler=e=>{if(e.data?.type!==`realm-rpc-res`)return;let t=e.data,n=this.pending.get(t.id);n&&(this.pending.delete(t.id),typeof t.error==`string`?n.reject(Error(t.error)):n.resolve(t.result))},e.addEventListener(`message`,this.handler),e.start?.()}call(e,t,n=[]){if(this.disposed)return Promise.reject(Error(`realm-rpc: client disposed`));let r=this.nextId++,i={type:`realm-rpc-req`,id:r,channel:e,op:t,args:n};return new Promise((e,t)=>{this.pending.set(r,{resolve:e,reject:t}),this.port.postMessage(i)})}dispose(){if(this.disposed)return;this.disposed=!0,this.port.removeEventListener(`message`,this.handler);let e=Error(`realm-rpc: client disposed`);for(let t of this.pending.values())t.reject(e);this.pending.clear()}};const N=new Set([`bcrypt`,`better-sqlite3`,`canvas`,`cpu-features`,`fsevents`,`leveldown`,`libxmljs`,`libxmljs2`,`node-gyp-build`,`node-sass`,`puppeteer`,`robotjs`,`sass-embedded`,`sharp`,`snappy`,`sqlite3`,`tree-sitter`,`usb`]),P={sharp:` Use the built-in 'convert' shell command for image work.`,canvas:` Use the built-in 'convert' / OffscreenCanvas for image work.`,"better-sqlite3":` Use the built-in 'sqlite3' shell command (sql.js WASM).`,sqlite3:` Use the built-in 'sqlite3' shell command (sql.js WASM).`,bcrypt:` Use crypto.subtle.digest() with PBKDF2 / Argon2 in pure JS.`,puppeteer:` Use the built-in browser-automation shell commands.`};function F(e){let t=e?.SLICC_REALM_PREFETCH_BUDGET_MS;if(typeof t==`string`&&t.length>0){let e=Number.parseInt(t,10);if(Number.isFinite(e)&&e>0)return e}return 15e3}function I(e,t){let n=P[t]??``;return Error(`require('${e}'): '${t}' is a Node native module (C++ bindings) — it cannot run in the browser sandbox.${n}`)}function ee(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timed out after ${t/1e3}s loading ${n}`))},t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})})}function L(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}function R(e){return/^[A-Za-z0-9_\-./:@]+$/.test(e)?e:`'`+e.replace(/'/g,`'\\''`)+`'`}function z(e,t){return e===``?t:e===`/`?`/${t}`:`${e}/${t}`}function B(e){let t=L(e.argv[1]??``),n=z(t,`references`),r=z(t,`assets`),i=z(t,`.config`);async function a(){let t;try{t=await e.fs.exists(i)}catch{return null}if(!t)return null;let n;try{n=await e.fs.readFile(i)}catch{return null}let r=typeof n==`string`?n:String(n);if(!r.trim())return null;let a;try{a=JSON.parse(r)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`skill.config(): failed to parse ${i}: ${t}`)}if(a&&typeof a==`object`&&!Array.isArray(a))return a;throw Error(`skill.config(): ${i} must contain a JSON object`)}async function o(t){let n=await a();if(t===void 0)return n;if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`skill.config(updates): updates must be a plain object`);let r={...n??{},...t};return await e.fs.writeFile(i,JSON.stringify(r,null,2)+`
|