sliccy 2.8.1 → 2.9.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.
Files changed (52) hide show
  1. package/dist/ui/assets/{anthropic-D9AKau0f.js → anthropic-CMVA8z4u.js} +1 -1
  2. package/dist/ui/assets/{azure-openai-responses-CcuuXi-2.js → azure-openai-responses-BcVCOWjr.js} +1 -1
  3. package/dist/ui/assets/{dist-Ehp5JdjU2.js → dist-BNEtmCAc2.js} +2 -2
  4. package/dist/ui/assets/{dist-BZxeNw0j.js → dist-BqCqxkrA.js} +1 -1
  5. package/dist/ui/assets/{dist-C1MjLlkt.js → dist-CxsgJFgV.js} +1 -1
  6. package/dist/ui/assets/{dist-BZOmMqub.js → dist-DPNMKo07.js} +1 -1
  7. package/dist/ui/assets/{dist-B7V-aBlB.js → dist-Sngeewv4.js} +1 -1
  8. package/dist/ui/assets/{es-DJ77iRn1.js → es-Dh2rgMJQ.js} +1 -1
  9. package/dist/ui/assets/{google-BANtDTmH.js → google-CJIGxdKe.js} +1 -1
  10. package/dist/ui/assets/{google-gemini-cli-B5CjSBL1.js → google-gemini-cli-CBH9v3m0.js} +1 -1
  11. package/dist/ui/assets/{google-shared-B3zPxYIU.js → google-shared-jyMmIrwc.js} +1 -1
  12. package/dist/ui/assets/{google-vertex-cJKBT3E8.js → google-vertex-BrN3Tz3e.js} +1 -1
  13. package/dist/ui/assets/{index-IDACqBJ7.js → index-CwOoNoZz.js} +996 -1000
  14. package/dist/ui/assets/{magick-wasm-frXbjDiE.js → magick-wasm-BtLTRPKb.js} +1 -1
  15. package/dist/ui/assets/{mistral-iglh-v6b.js → mistral-BO8fQ2lz.js} +1 -1
  16. package/dist/ui/assets/{openai-codex-responses-G1lNlKN0.js → openai-codex-responses-DglthLmz.js} +1 -1
  17. package/dist/ui/assets/{openai-completions-CBYiDqK8.js → openai-completions-B9-2Retb.js} +1 -1
  18. package/dist/ui/assets/{openai-responses-COE9LHl3.js → openai-responses-Bay2AY5u.js} +1 -1
  19. package/dist/ui/assets/{openai-responses-shared-DECKIcXP.js → openai-responses-shared-BU6CEk9U.js} +1 -1
  20. package/dist/ui/assets/{pdfjs-Bc7iJ0mN.js → pdfjs-C_fzykJW.js} +1 -1
  21. package/dist/ui/assets/{provider-settings-4OQd2fZE.js → provider-settings-lbdVYpIy.js} +4 -4
  22. package/dist/ui/assets/{pyodide-B0c5k_as.js → pyodide-JXDzDQlX.js} +3 -3
  23. package/dist/ui/assets/{skills-D8MzH7Ze.js → skills-O_vTBFE5.js} +1 -1
  24. package/dist/ui/assets/{slicc-editor-DqjxtQn6.js → slicc-editor-BXeXUUnd.js} +2 -2
  25. package/dist/ui/assets/{sql-wasm-CNZ88Vcf.js → sql-wasm-DsCCg8Gn.js} +1 -1
  26. package/dist/ui/index.html +11 -12
  27. package/dist/ui/lucide-icons.js +1 -1
  28. package/dist/ui/packages/webapp/index.html +11 -12
  29. package/package.json +1 -1
  30. package/dist/ui/assets/theme-DWhQUmVA.js +0 -1
  31. /package/dist/ui/assets/{__vite-browser-external-MxCBxUMe.js → __vite-browser-external-BotBUAC3.js} +0 -0
  32. /package/dist/ui/assets/{addon-fit-CniRnSyE.js → addon-fit-B0aHsvmX.js} +0 -0
  33. /package/dist/ui/assets/{bsh-watchdog-BofJVeV-.js → bsh-watchdog-DYfdvOrR.js} +0 -0
  34. /package/dist/ui/assets/{chat-fixture-CIjL7BDw.js → chat-fixture-BWvups7M.js} +0 -0
  35. /package/dist/ui/assets/{constants-MAaNOa4c.js → constants-BnzYaC4L.js} +0 -0
  36. /package/dist/ui/assets/{db-CJnk7hWr.js → db-ybNEUfR8.js} +0 -0
  37. /package/dist/ui/assets/{dist-BreQU7P7.js → dist-CPYmBmyZ.js} +0 -0
  38. /package/dist/ui/assets/{dist-CEBWSFtw.js → dist-Ct5XR8EU.js} +0 -0
  39. /package/dist/ui/assets/{github-copilot-headers-BFowJEWi.js → github-copilot-headers-BxUvy78-.js} +0 -0
  40. /package/dist/ui/assets/{hash-B7CztTb_.js → hash-BwzabXYv.js} +0 -0
  41. /package/dist/ui/assets/{headers-CrRy8cka.js → headers-BCPSYYop.js} +0 -0
  42. /package/dist/ui/assets/{lick-manager-proxy-Dw3D3AzG.js → lick-manager-proxy-BF0GrOv_.js} +0 -0
  43. /package/dist/ui/assets/{oauth-service-DUXASG7L.js → oauth-service-8Xax8Fjw.js} +0 -0
  44. /package/dist/ui/assets/{offscreen-client-Dom7iV01.js → offscreen-client-DJYi05-D.js} +0 -0
  45. /package/dist/ui/assets/{openai-5CK-qymG.js → openai-CuiHR4mv.js} +0 -0
  46. /package/dist/ui/assets/{path-utils-DFPXxD-4.js → path-utils-CgbXfwyO.js} +0 -0
  47. /package/dist/ui/assets/{preload-helper-rov5CBGT.js → preload-helper-D4M6sveU.js} +0 -0
  48. /package/dist/ui/assets/{sanitize-unicode-6mS7gbvU.js → sanitize-unicode-ncMKN_SD.js} +0 -0
  49. /package/dist/ui/assets/{secret-masking-ZNVanUmG.js → secret-masking-CXZkZ8rX.js} +0 -0
  50. /package/dist/ui/assets/{simple-options-CkmMCYsO.js → simple-options-DEbfD_Ko.js} +0 -0
  51. /package/dist/ui/assets/{src-BqF-C6jp.js → src-Cu5WM_BM.js} +0 -0
  52. /package/dist/ui/assets/{xterm-BaLOnk9X.js → xterm-D5M9QCcR.js} +0 -0
@@ -1 +1 @@
1
- import{a as e,n as t,r as n,s as r}from"./simple-options-CkmMCYsO.js";import{o as i}from"./index-IDACqBJ7.js";import{t as a}from"./sanitize-unicode-6mS7gbvU.js";import{c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-B3zPxYIU.js";var p=0,m=(t,n,a)=>{let o=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-generative-ai`,provider:t.provider,model:t.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 c=g(t,a?.apiKey||i(t.provider)||``,a?.headers),l=_(t,n,a),f=await a?.onPayload?.(l,t);f!==void 0&&(l=f);let m=await c.models.generateContentStream(l);o.push({type:`start`,partial:e});let h=null,v=e.content,y=()=>v.length-1;for await(let n of m){e.responseId||=n.responseId;let i=n.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=u(t);(!h||n&&h.type!==`thinking`||!n&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:e}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:e})),n?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:e})):(h={type:`text`,text:``},e.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:e}))),h.type===`thinking`?(h.thinking+=t.text,h.thinkingSignature=d(h.thinkingSignature,t.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:t.text,partial:e})):(h.text+=t.text,h.textSignature=d(h.textSignature,t.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:t.text,partial:e}))}if(t.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:e}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++p}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:e}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:e}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=s(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),n.usageMetadata&&(e.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}},r(t,e.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:e}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:e})),a?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:e.stopReason,message:e}),o.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=a?.signal?.aborted?`aborted`:`error`,e.errorMessage=t instanceof Error?t.message:JSON.stringify(t),o.push({type:`error`,reason:e.stopReason,error:e}),o.end()}})(),o},h=(e,r,a)=>{let o=a?.apiKey||i(e.provider);if(!o)throw Error(`No API key for provider: ${e.provider}`);let s=t(e,a,o);if(!a?.reasoning)return m(e,r,{...s,thinking:{enabled:!1}});let c=n(a.reasoning),l=e;return y(l)||b(l)||v(l)?m(e,r,{...s,thinking:{enabled:!0,level:S(c,l)}}):m(e,r,{...s,thinking:{enabled:!0,budgetTokens:C(l,c,a.thinkingBudgets)}})};function g(e,t,n){let r={};return e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``),(e.headers||n)&&(r.headers={...e.headers,...n}),new o({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function _(e,t,n={}){let r=f(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:l(n.toolChoice)}}:o.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=n.thinking.level,o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=x(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function v(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function b(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function x(e){return y(e)?{thinkingLevel:`LOW`}:b(e)||v(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function S(e,t){if(y(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(v(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;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 C(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-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{m as streamGoogle,h as streamSimpleGoogle};
1
+ import{a as e,n as t,r as n,s as r}from"./simple-options-DEbfD_Ko.js";import{o as i}from"./index-CwOoNoZz.js";import{t as a}from"./sanitize-unicode-ncMKN_SD.js";import{c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-jyMmIrwc.js";var p=0,m=(t,n,a)=>{let o=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-generative-ai`,provider:t.provider,model:t.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 c=g(t,a?.apiKey||i(t.provider)||``,a?.headers),l=_(t,n,a),f=await a?.onPayload?.(l,t);f!==void 0&&(l=f);let m=await c.models.generateContentStream(l);o.push({type:`start`,partial:e});let h=null,v=e.content,y=()=>v.length-1;for await(let n of m){e.responseId||=n.responseId;let i=n.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=u(t);(!h||n&&h.type!==`thinking`||!n&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:e}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:e})),n?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:e})):(h={type:`text`,text:``},e.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:e}))),h.type===`thinking`?(h.thinking+=t.text,h.thinkingSignature=d(h.thinkingSignature,t.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:t.text,partial:e})):(h.text+=t.text,h.textSignature=d(h.textSignature,t.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:t.text,partial:e}))}if(t.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:e}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++p}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:e}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:e}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=s(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),n.usageMetadata&&(e.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}},r(t,e.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:e}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:e})),a?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:e.stopReason,message:e}),o.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=a?.signal?.aborted?`aborted`:`error`,e.errorMessage=t instanceof Error?t.message:JSON.stringify(t),o.push({type:`error`,reason:e.stopReason,error:e}),o.end()}})(),o},h=(e,r,a)=>{let o=a?.apiKey||i(e.provider);if(!o)throw Error(`No API key for provider: ${e.provider}`);let s=t(e,a,o);if(!a?.reasoning)return m(e,r,{...s,thinking:{enabled:!1}});let c=n(a.reasoning),l=e;return y(l)||b(l)||v(l)?m(e,r,{...s,thinking:{enabled:!0,level:S(c,l)}}):m(e,r,{...s,thinking:{enabled:!0,budgetTokens:C(l,c,a.thinkingBudgets)}})};function g(e,t,n){let r={};return e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``),(e.headers||n)&&(r.headers={...e.headers,...n}),new o({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function _(e,t,n={}){let r=f(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:l(n.toolChoice)}}:o.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=n.thinking.level,o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=x(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function v(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function b(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function x(e){return y(e)?{thinkingLevel:`LOW`}:b(e)||v(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function S(e,t){if(y(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(v(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;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 C(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-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{m as streamGoogle,h as streamSimpleGoogle};
@@ -1,2 +1,2 @@
1
- import{a as e,n as t,r as n,s as r}from"./simple-options-CkmMCYsO.js";import{t as i}from"./headers-CrRy8cka.js";import{t as a}from"./sanitize-unicode-6mS7gbvU.js";import{a as o,n as s,o as c,r as l,s as u,t as d}from"./google-shared-B3zPxYIU.js";var f=`https://cloudcode-pa.googleapis.com`,p=[`https://daily-cloudcode-pa.sandbox.googleapis.com`,`https://autopush-cloudcode-pa.sandbox.googleapis.com`,f],m={"User-Agent":`google-cloud-sdk vscode_cloudshelleditor/0.1`,"X-Goog-Api-Client":`gl-node/22.17.0`,"Client-Metadata":JSON.stringify({ideType:`IDE_UNSPECIFIED`,platform:`PLATFORM_UNSPECIFIED`,pluginType:`GEMINI`})},h=`1.21.9`;function g(){return{"User-Agent":`antigravity/${{}.PI_AI_ANTIGRAVITY_VERSION||h} darwin/arm64`}}var _=`You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**`,v=0,y=3,b=1e3,x=2,S=500,C=`interleaved-thinking-2025-05-14`;function w(e,t){let n=e=>e>0?Math.ceil(e+1e3):void 0,r=t instanceof Headers?t:t?.headers;if(r){let e=r.get(`retry-after`);if(e){let t=Number(e);if(Number.isFinite(t)){let e=n(t*1e3);if(e!==void 0)return e}let r=new Date(e).getTime();if(!Number.isNaN(r)){let e=n(r-Date.now());if(e!==void 0)return e}}let t=r.get(`x-ratelimit-reset`);if(t){let e=Number.parseInt(t,10);if(!Number.isNaN(e)){let t=n(e*1e3-Date.now());if(t!==void 0)return t}}let i=r.get(`x-ratelimit-reset-after`);if(i){let e=Number(i);if(Number.isFinite(e)){let t=n(e*1e3);if(t!==void 0)return t}}}let i=e.match(/reset after (?:(\d+)h)?(?:(\d+)m)?(\d+(?:\.\d+)?)s/i);if(i){let e=i[1]?parseInt(i[1],10):0,t=i[2]?parseInt(i[2],10):0,r=parseFloat(i[3]);if(!Number.isNaN(r)){let i=n(((e*60+t)*60+r)*1e3);if(i!==void 0)return i}}let a=e.match(/Please retry in ([0-9.]+)(ms|s)/i);if(a?.[1]){let e=parseFloat(a[1]);if(!Number.isNaN(e)&&e>0){let t=n(a[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}let o=e.match(/"retryDelay":\s*"([0-9.]+)(ms|s)"/i);if(o?.[1]){let e=parseFloat(o[1]);if(!Number.isNaN(e)&&e>0){let t=n(o[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}}function T(e){return e.provider===`google-antigravity`&&e.id.startsWith(`claude-`)&&e.reasoning}function E(e){return/gemini-3(?:\.1)?-pro/.test(e.toLowerCase())}function D(e){return/gemini-3(?:\.1)?-flash/.test(e.toLowerCase())}function O(e){return E(e)||D(e)}function k(e,t){return e===429||e===500||e===502||e===503||e===504?!0:/resource.?exhausted|rate.?limit|overloaded|service.?unavailable|other.?side.?closed/i.test(t)}function A(e){try{let t=JSON.parse(e);if(t.error?.message)return t.error.message}catch{}return e}function j(e,t){return new Promise((n,r)=>{if(t?.aborted){r(Error(`Request was aborted`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(Error(`Request was aborted`))})})}var M=(t,n,a)=>{let s=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-gemini-cli`,provider:t.provider,model:t.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 c=a?.apiKey;if(!c)throw Error(`Google Cloud Code Assist requires OAuth authentication. Use /login to authenticate.`);let d,h;try{let e=JSON.parse(c);d=e.token,h=e.projectId}catch{throw Error(`Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate.`)}if(!d||!h)throw Error(`Missing token or projectId in Google Cloud credentials. Use /login to re-authenticate.`);let _=t.provider===`google-antigravity`,E=t.baseUrl?.trim(),D=E?[E]:_?p:[f],O=P(t,n,h,a,_),M=await a?.onPayload?.(O,t);M!==void 0&&(O=M);let N=_?g():m,F={Authorization:`Bearer ${d}`,"Content-Type":`application/json`,Accept:`text/event-stream`,...N,...T(t)?{"anthropic-beta":C}:{},...a?.headers},I=JSON.stringify(O),L,R,z,B=0;for(let e=0;e<=y;e++){if(a?.signal?.aborted)throw Error(`Request was aborted`);try{if(z=`${D[B]}/v1internal:streamGenerateContent?alt=sse`,L=await fetch(z,{method:`POST`,headers:F,body:I,signal:a?.signal}),await a?.onResponse?.({status:L.status,headers:i(L.headers)},t),L.ok)break;let n=await L.text();if((L.status===403||L.status===404)&&B<D.length-1){B++;continue}if(e<y&&k(L.status,n)){B<D.length-1&&B++;let t=w(n,L),r=t??b*2**e,i=a?.maxRetryDelayMs??6e4;if(i>0&&t&&t>i){let e=Math.ceil(t/1e3);throw Error(`Server requested ${e}s retry delay (max: ${Math.ceil(i/1e3)}s). ${A(n)}`)}await j(r,a?.signal);continue}throw Error(`Cloud Code Assist API error (${L.status}): ${A(n)}`)}catch(t){if(t instanceof Error&&(t.name===`AbortError`||t.message===`Request was aborted`))throw Error(`Request was aborted`);if(R=t instanceof Error?t:Error(String(t)),R.message===`fetch failed`&&R.cause instanceof Error&&(R=Error(`Network error: ${R.cause.message}`)),e<y){await j(b*2**e,a?.signal);continue}throw R}}if(!L||!L.ok)throw R??Error(`Failed to get response after retries`);let V=!1,H=()=>{V||=(s.push({type:`start`,partial:e}),!0)},U=()=>{e.content=[],e.usage={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},e.stopReason=`stop`,e.errorMessage=void 0,e.timestamp=Date.now(),V=!1},W=async n=>{if(!n.body)throw Error(`No response body`);let i=!1,c=null,d=e.content,f=()=>d.length-1,p=n.body.getReader(),m=new TextDecoder,h=``,g=()=>{p.cancel().catch(()=>{})};a?.signal?.addEventListener(`abort`,g);try{for(;;){if(a?.signal?.aborted)throw Error(`Request was aborted`);let{done:n,value:g}=await p.read();if(n)break;h+=m.decode(g,{stream:!0});let _=h.split(`
1
+ import{a as e,n as t,r as n,s as r}from"./simple-options-DEbfD_Ko.js";import{t as i}from"./headers-BCPSYYop.js";import{t as a}from"./sanitize-unicode-ncMKN_SD.js";import{a as o,n as s,o as c,r as l,s as u,t as d}from"./google-shared-jyMmIrwc.js";var f=`https://cloudcode-pa.googleapis.com`,p=[`https://daily-cloudcode-pa.sandbox.googleapis.com`,`https://autopush-cloudcode-pa.sandbox.googleapis.com`,f],m={"User-Agent":`google-cloud-sdk vscode_cloudshelleditor/0.1`,"X-Goog-Api-Client":`gl-node/22.17.0`,"Client-Metadata":JSON.stringify({ideType:`IDE_UNSPECIFIED`,platform:`PLATFORM_UNSPECIFIED`,pluginType:`GEMINI`})},h=`1.21.9`;function g(){return{"User-Agent":`antigravity/${{}.PI_AI_ANTIGRAVITY_VERSION||h} darwin/arm64`}}var _=`You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**`,v=0,y=3,b=1e3,x=2,S=500,C=`interleaved-thinking-2025-05-14`;function w(e,t){let n=e=>e>0?Math.ceil(e+1e3):void 0,r=t instanceof Headers?t:t?.headers;if(r){let e=r.get(`retry-after`);if(e){let t=Number(e);if(Number.isFinite(t)){let e=n(t*1e3);if(e!==void 0)return e}let r=new Date(e).getTime();if(!Number.isNaN(r)){let e=n(r-Date.now());if(e!==void 0)return e}}let t=r.get(`x-ratelimit-reset`);if(t){let e=Number.parseInt(t,10);if(!Number.isNaN(e)){let t=n(e*1e3-Date.now());if(t!==void 0)return t}}let i=r.get(`x-ratelimit-reset-after`);if(i){let e=Number(i);if(Number.isFinite(e)){let t=n(e*1e3);if(t!==void 0)return t}}}let i=e.match(/reset after (?:(\d+)h)?(?:(\d+)m)?(\d+(?:\.\d+)?)s/i);if(i){let e=i[1]?parseInt(i[1],10):0,t=i[2]?parseInt(i[2],10):0,r=parseFloat(i[3]);if(!Number.isNaN(r)){let i=n(((e*60+t)*60+r)*1e3);if(i!==void 0)return i}}let a=e.match(/Please retry in ([0-9.]+)(ms|s)/i);if(a?.[1]){let e=parseFloat(a[1]);if(!Number.isNaN(e)&&e>0){let t=n(a[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}let o=e.match(/"retryDelay":\s*"([0-9.]+)(ms|s)"/i);if(o?.[1]){let e=parseFloat(o[1]);if(!Number.isNaN(e)&&e>0){let t=n(o[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}}function T(e){return e.provider===`google-antigravity`&&e.id.startsWith(`claude-`)&&e.reasoning}function E(e){return/gemini-3(?:\.1)?-pro/.test(e.toLowerCase())}function D(e){return/gemini-3(?:\.1)?-flash/.test(e.toLowerCase())}function O(e){return E(e)||D(e)}function k(e,t){return e===429||e===500||e===502||e===503||e===504?!0:/resource.?exhausted|rate.?limit|overloaded|service.?unavailable|other.?side.?closed/i.test(t)}function A(e){try{let t=JSON.parse(e);if(t.error?.message)return t.error.message}catch{}return e}function j(e,t){return new Promise((n,r)=>{if(t?.aborted){r(Error(`Request was aborted`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(Error(`Request was aborted`))})})}var M=(t,n,a)=>{let s=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-gemini-cli`,provider:t.provider,model:t.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 c=a?.apiKey;if(!c)throw Error(`Google Cloud Code Assist requires OAuth authentication. Use /login to authenticate.`);let d,h;try{let e=JSON.parse(c);d=e.token,h=e.projectId}catch{throw Error(`Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate.`)}if(!d||!h)throw Error(`Missing token or projectId in Google Cloud credentials. Use /login to re-authenticate.`);let _=t.provider===`google-antigravity`,E=t.baseUrl?.trim(),D=E?[E]:_?p:[f],O=P(t,n,h,a,_),M=await a?.onPayload?.(O,t);M!==void 0&&(O=M);let N=_?g():m,F={Authorization:`Bearer ${d}`,"Content-Type":`application/json`,Accept:`text/event-stream`,...N,...T(t)?{"anthropic-beta":C}:{},...a?.headers},I=JSON.stringify(O),L,R,z,B=0;for(let e=0;e<=y;e++){if(a?.signal?.aborted)throw Error(`Request was aborted`);try{if(z=`${D[B]}/v1internal:streamGenerateContent?alt=sse`,L=await fetch(z,{method:`POST`,headers:F,body:I,signal:a?.signal}),await a?.onResponse?.({status:L.status,headers:i(L.headers)},t),L.ok)break;let n=await L.text();if((L.status===403||L.status===404)&&B<D.length-1){B++;continue}if(e<y&&k(L.status,n)){B<D.length-1&&B++;let t=w(n,L),r=t??b*2**e,i=a?.maxRetryDelayMs??6e4;if(i>0&&t&&t>i){let e=Math.ceil(t/1e3);throw Error(`Server requested ${e}s retry delay (max: ${Math.ceil(i/1e3)}s). ${A(n)}`)}await j(r,a?.signal);continue}throw Error(`Cloud Code Assist API error (${L.status}): ${A(n)}`)}catch(t){if(t instanceof Error&&(t.name===`AbortError`||t.message===`Request was aborted`))throw Error(`Request was aborted`);if(R=t instanceof Error?t:Error(String(t)),R.message===`fetch failed`&&R.cause instanceof Error&&(R=Error(`Network error: ${R.cause.message}`)),e<y){await j(b*2**e,a?.signal);continue}throw R}}if(!L||!L.ok)throw R??Error(`Failed to get response after retries`);let V=!1,H=()=>{V||=(s.push({type:`start`,partial:e}),!0)},U=()=>{e.content=[],e.usage={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},e.stopReason=`stop`,e.errorMessage=void 0,e.timestamp=Date.now(),V=!1},W=async n=>{if(!n.body)throw Error(`No response body`);let i=!1,c=null,d=e.content,f=()=>d.length-1,p=n.body.getReader(),m=new TextDecoder,h=``,g=()=>{p.cancel().catch(()=>{})};a?.signal?.addEventListener(`abort`,g);try{for(;;){if(a?.signal?.aborted)throw Error(`Request was aborted`);let{done:n,value:g}=await p.read();if(n)break;h+=m.decode(g,{stream:!0});let _=h.split(`
2
2
  `);h=_.pop()||``;for(let n of _){if(!n.startsWith(`data:`))continue;let a=n.slice(5).trim();if(!a)continue;let p;try{p=JSON.parse(a)}catch{continue}let m=p.response;if(!m)continue;e.responseId||=m.responseId;let h=m.candidates?.[0];if(h?.content?.parts)for(let t of h.content.parts){if(t.text!==void 0){i=!0;let n=l(t);(!c||n&&c.type!==`thinking`||!n&&c.type!==`text`)&&(c&&(c.type===`text`?s.push({type:`text_end`,contentIndex:d.length-1,content:c.text,partial:e}):s.push({type:`thinking_end`,contentIndex:f(),content:c.thinking,partial:e})),n?(c={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(c),H(),s.push({type:`thinking_start`,contentIndex:f(),partial:e})):(c={type:`text`,text:``},e.content.push(c),H(),s.push({type:`text_start`,contentIndex:f(),partial:e}))),c.type===`thinking`?(c.thinking+=t.text,c.thinkingSignature=u(c.thinkingSignature,t.thoughtSignature),s.push({type:`thinking_delta`,contentIndex:f(),delta:t.text,partial:e})):(c.text+=t.text,c.textSignature=u(c.textSignature,t.thoughtSignature),s.push({type:`text_delta`,contentIndex:f(),delta:t.text,partial:e}))}if(t.functionCall){i=!0,c&&=(c.type===`text`?s.push({type:`text_end`,contentIndex:f(),content:c.text,partial:e}):s.push({type:`thinking_end`,contentIndex:f(),content:c.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++v}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),H(),s.push({type:`toolcall_start`,contentIndex:f(),partial:e}),s.push({type:`toolcall_delta`,contentIndex:f(),delta:JSON.stringify(r.arguments),partial:e}),s.push({type:`toolcall_end`,contentIndex:f(),toolCall:r,partial:e})}}if(h?.finishReason&&(e.stopReason=o(h.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),m.usageMetadata){let n=m.usageMetadata.promptTokenCount||0,i=m.usageMetadata.cachedContentTokenCount||0;e.usage={input:n-i,output:(m.usageMetadata.candidatesTokenCount||0)+(m.usageMetadata.thoughtsTokenCount||0),cacheRead:i,cacheWrite:0,totalTokens:m.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},r(t,e.usage)}}}}finally{a?.signal?.removeEventListener(`abort`,g)}return c&&(c.type===`text`?s.push({type:`text_end`,contentIndex:f(),content:c.text,partial:e}):s.push({type:`thinking_end`,contentIndex:f(),content:c.thinking,partial:e})),i},G=!1,K=L;for(let e=0;e<=x;e++){if(a?.signal?.aborted)throw Error(`Request was aborted`);if(e>0){if(await j(S*2**(e-1),a?.signal),!z)throw Error(`Missing request URL`);if(K=await fetch(z,{method:`POST`,headers:F,body:I,signal:a?.signal}),await a?.onResponse?.({status:K.status,headers:i(K.headers)},t),!K.ok){let e=await K.text();throw Error(`Cloud Code Assist API error (${K.status}): ${e}`)}}if(await W(K)){G=!0;break}e<x&&U()}if(!G)throw Error(`Cloud Code Assist API returned an empty response`);if(a?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);s.push({type:`done`,reason:e.stopReason,message:e}),s.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=a?.signal?.aborted?`aborted`:`error`,e.errorMessage=t instanceof Error?t.message:JSON.stringify(t),s.push({type:`error`,reason:e.stopReason,error:e}),s.end()}})(),s},N=(e,r,i)=>{let a=i?.apiKey;if(!a)throw Error(`Google Cloud Code Assist requires OAuth authentication. Use /login to authenticate.`);let o=t(e,i,a);if(!i?.reasoning)return M(e,r,{...o,thinking:{enabled:!1}});let s=n(i.reasoning);if(O(e.id))return M(e,r,{...o,thinking:{enabled:!0,level:I(s,e.id)}});let c={minimal:1024,low:2048,medium:8192,high:16384,...i.thinkingBudgets}[s],l=Math.min((o.maxTokens||0)+c,e.maxTokens);return l<=c&&(c=Math.max(0,l-1024)),M(e,r,{...o,maxTokens:l,thinking:{enabled:!0,budgetTokens:c}})};function P(e,t,n,r={},i=!1){let o=d(e,t),l={};r.temperature!==void 0&&(l.temperature=r.temperature),r.maxTokens!==void 0&&(l.maxOutputTokens=r.maxTokens),r.thinking?.enabled&&e.reasoning?(l.thinkingConfig={includeThoughts:!0},r.thinking.level===void 0?r.thinking.budgetTokens!==void 0&&(l.thinkingConfig.thinkingBudget=r.thinking.budgetTokens):l.thinkingConfig.thinkingLevel=r.thinking.level):e.reasoning&&r.thinking&&!r.thinking.enabled&&(l.thinkingConfig=F(e.id));let u={contents:o};if(u.sessionId=r.sessionId,t.systemPrompt&&(u.systemInstruction={parts:[{text:a(t.systemPrompt)}]}),Object.keys(l).length>0&&(u.generationConfig=l),t.tools&&t.tools.length>0){let n=e.id.startsWith(`claude-`);u.tools=s(t.tools,n),r.toolChoice&&(u.toolConfig={functionCallingConfig:{mode:c(r.toolChoice)}})}if(i){let e=u.systemInstruction?.parts??[];u.systemInstruction={role:`user`,parts:[{text:_},{text:`Please ignore following [ignore]${_}[/ignore]`},...e]}}return{project:n,model:e.id,request:u,...i?{requestType:`agent`}:{},userAgent:i?`antigravity`:`pi-coding-agent`,requestId:`${i?`agent`:`pi`}-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}}function F(e){return E(e)?{thinkingLevel:`LOW`}:D(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function I(e,t){if(E(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`}}export{P as buildRequest,w as extractRetryDelay,M as streamGoogleGeminiCli,N as streamSimpleGoogleGeminiCli};