@plusonelabs/cue 0.0.17 → 0.0.19
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/cue-v0.0.19.tar.gz +0 -0
- package/dist/cli.mjs +1 -2
- package/package.json +1 -1
- package/cue-v0.0.17.tar.gz +0 -0
|
Binary file
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url); global.__CUE_VERSION__ = '0.0.19';
|
|
4
3
|
var kde=Object.create;var qS=Object.defineProperty;var Ode=Object.getOwnPropertyDescriptor;var Ude=Object.getOwnPropertyNames;var Mde=Object.getPrototypeOf,Lde=Object.prototype.hasOwnProperty;var nt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var _=(t,e)=>()=>(t&&(e=t(t=0)),e);var se=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ha=(t,e)=>{for(var n in e)qS(t,n,{get:e[n],enumerable:!0})},Pde=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ude(e))!Lde.call(t,a)&&a!==n&&qS(t,a,{get:()=>e[a],enumerable:!(i=Ode(e,a))||i.enumerable});return t};var be=(t,e,n)=>(n=t!=null?kde(Mde(t)):{},Pde(e||!t||!t.__esModule?qS(n,"default",{value:t,enumerable:!0}):n,t));import vD from"fs";import KS from"path";function hc(){if(typeof global.__CUE_VERSION__<"u")return global.__CUE_VERSION__;try{let t=process.argv[1],e=KS.join(KS.dirname(t),"..","package.json");if(vD.existsSync(e)){let n=vD.readFileSync(e,"utf-8");return JSON.parse(n).version}}catch{}if(process.argv[1].includes("src/cli.tsx"))try{let t=KS.join(process.cwd(),"package.json");if(vD.existsSync(t)){let e=vD.readFileSync(t,"utf-8");return JSON.parse(e).version}}catch{}return"unknown"}var kg=_(()=>{"use strict"});function gt(t,e,n,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(t,n):a?a.value=n:e.set(t,n),n}function xe(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}var Jm=_(()=>{});var VS,Kj=_(()=>{VS=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return VS=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))}});function Vp(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var $3,Og=_(()=>{$3=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var At,Wi,wr,Ym,Ug,Mg,Lg,Pg,zg,jg,$g,Hg,Gg,gc=_(()=>{Og();At=class extends Error{},Wi=class t extends At{constructor(e,n,i,a){super(`${t.makeMessage(e,n,i)}`),this.status=e,this.headers=a,this.requestID=a?.get("request-id"),this.error=n}static makeMessage(e,n,i){let a=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return e&&a?`${e} ${a}`:e?`${e} status code (no body)`:a||"(no status code or body)"}static generate(e,n,i,a){if(!e||!a)return new Ym({message:i,cause:$3(n)});let r=n;return e===400?new Mg(e,r,i,a):e===401?new Lg(e,r,i,a):e===403?new Pg(e,r,i,a):e===404?new zg(e,r,i,a):e===409?new jg(e,r,i,a):e===422?new $g(e,r,i,a):e===429?new Hg(e,r,i,a):e>=500?new Gg(e,r,i,a):new t(e,r,i,a)}},wr=class extends Wi{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Ym=class extends Wi{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},Ug=class extends Ym{constructor({message:e}={}){super({message:e??"Request timed out."})}},Mg=class extends Wi{},Lg=class extends Wi{},Pg=class extends Wi{},zg=class extends Wi{},jg=class extends Wi{},$g=class extends Wi{},Hg=class extends Wi{},Gg=class extends Wi{}});function ZS(t){return typeof t!="object"?{}:t??{}}function Jj(t){if(!t)return!0;for(let e in t)return!1;return!0}function Yj(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var jde,Vj,JS,YS,Zj,ED,EA=_(()=>{gc();jde=/^[a-z][a-z0-9+.-]*:/i,Vj=t=>jde.test(t),JS=t=>(JS=Array.isArray,JS(t)),YS=JS;Zj=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new At(`${t} must be an integer`);if(e<0)throw new At(`${t} must be a positive integer`);return e},ED=t=>{try{return JSON.parse(t)}catch{return}}});var Wj,Xj=_(()=>{Wj=t=>new Promise(e=>setTimeout(e,t))});var Zm,WS=_(()=>{Zm="0.57.0"});function $de(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function Gde(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let i=n.exec(navigator.userAgent);if(i){let a=i[1]||0,r=i[2]||0,l=i[3]||0;return{browser:e,version:`${a}.${r}.${l}`}}}return null}var a$,Hde,e$,t$,n$,i$,XS=_(()=>{WS();a$=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";Hde=()=>{let t=$de();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Zm,"X-Stainless-OS":t$(Deno.build.os),"X-Stainless-Arch":e$(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Zm,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Zm,"X-Stainless-OS":t$(globalThis.process.platform??"unknown"),"X-Stainless-Arch":e$(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=Gde();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Zm,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Zm,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};e$=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",t$=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),i$=()=>n$??(n$=Hde())});function r$(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ew(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function yD(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return ew({start(){},async pull(n){let{done:i,value:a}=await e.next();i?n.close():n.enqueue(a)},async cancel(){await e.return?.()}})}function H3(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function o$(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),n=e.cancel();e.releaseLock(),await n}var qg=_(()=>{});var s$,l$=_(()=>{s$=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});function p$(t){let e=0;for(let a of t)e+=a.length;let n=new Uint8Array(e),i=0;for(let a of t)n.set(a,i),i+=a.length;return n}function G3(t){let e;return(u$??(e=new globalThis.TextEncoder,u$=e.encode.bind(e)))(t)}function tw(t){let e;return(c$??(e=new globalThis.TextDecoder,c$=e.decode.bind(e)))(t)}var u$,c$,nw=_(()=>{});function Vde(t,e){for(let a=e??0;a<t.length;a++){if(t[a]===10)return{preceding:a,index:a+1,carriage:!1};if(t[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function d$(t){for(let i=0;i<t.length-1;i++){if(t[i]===10&&t[i+1]===10||t[i]===13&&t[i+1]===13)return i+2;if(t[i]===13&&t[i+1]===10&&i+3<t.length&&t[i+2]===13&&t[i+3]===10)return i+4}return-1}var xs,Bs,Jp,aw=_(()=>{Jm();nw();Jp=class{constructor(){xs.set(this,void 0),Bs.set(this,void 0),gt(this,xs,new Uint8Array,"f"),gt(this,Bs,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?G3(e):e;gt(this,xs,p$([xe(this,xs,"f"),n]),"f");let i=[],a;for(;(a=Vde(xe(this,xs,"f"),xe(this,Bs,"f")))!=null;){if(a.carriage&&xe(this,Bs,"f")==null){gt(this,Bs,a.index,"f");continue}if(xe(this,Bs,"f")!=null&&(a.index!==xe(this,Bs,"f")+1||a.carriage)){i.push(tw(xe(this,xs,"f").subarray(0,xe(this,Bs,"f")-1))),gt(this,xs,xe(this,xs,"f").subarray(xe(this,Bs,"f")),"f"),gt(this,Bs,null,"f");continue}let r=xe(this,Bs,"f")!==null?a.preceding-1:a.preceding,l=tw(xe(this,xs,"f").subarray(0,r));i.push(l),gt(this,xs,xe(this,xs,"f").subarray(a.index),"f"),gt(this,Bs,null,"f")}return i}flush(){return xe(this,xs,"f").length?this.decode(`
|
|
5
4
|
`):[]}};xs=new WeakMap,Bs=new WeakMap;Jp.NEWLINE_CHARS=new Set([`
|
|
6
5
|
`,"\r"]);Jp.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function q3(){}function DD(t,e,n){return!e||CD[t]>CD[n]?q3:e[t].bind(e)}function Xi(t){let e=t.logger,n=t.logLevel??"off";if(!e)return Jde;let i=m$.get(e);if(i&&i[0]===n)return i[1];let a={error:DD("error",e,n),warn:DD("warn",e,n),info:DD("info",e,n),debug:DD("debug",e,n)};return m$.set(e,[n,a]),a}var CD,iw,Jde,m$,Yp,bD=_(()=>{EA();CD={off:0,error:200,warn:300,info:400,debug:500},iw=(t,e,n)=>{if(t){if(Yj(CD,t))return t;Xi(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(CD))}`)}};Jde={error:q3,warn:q3,info:q3,debug:q3},m$=new WeakMap;Yp=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});async function*Yde(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new At("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new At("Attempted to iterate over a response with no body");let n=new rw,i=new Jp,a=H3(t.body);for await(let r of Zde(a))for(let l of i.decode(r)){let d=n.decode(l);d&&(yield d)}for(let r of i.flush()){let l=n.decode(r);l&&(yield l)}}async function*Zde(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?G3(n):n,a=new Uint8Array(e.length+i.length);a.set(e),a.set(i,e.length),e=a;let r;for(;(r=d$(e))!==-1;)yield e.slice(0,r),e=e.slice(r)}e.length>0&&(yield e)}function Wde(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var K3,vc,rw,ow=_(()=>{Jm();gc();qg();aw();qg();Og();EA();nw();bD();gc();vc=class t{constructor(e,n,i){this.iterator=e,K3.set(this,void 0),this.controller=n,gt(this,K3,i,"f")}static fromSSEResponse(e,n,i){let a=!1,r=i?Xi(i):console;async function*l(){if(a)throw new At("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let d=!1;try{for await(let m of Yde(e,n)){if(m.event==="completion")try{yield JSON.parse(m.data)}catch(h){throw r.error("Could not parse message into JSON:",m.data),r.error("From chunk:",m.raw),h}if(m.event==="message_start"||m.event==="message_delta"||m.event==="message_stop"||m.event==="content_block_start"||m.event==="content_block_delta"||m.event==="content_block_stop")try{yield JSON.parse(m.data)}catch(h){throw r.error("Could not parse message into JSON:",m.data),r.error("From chunk:",m.raw),h}if(m.event!=="ping"&&m.event==="error")throw new Wi(void 0,ED(m.data)??m.data,void 0,e.headers)}d=!0}catch(m){if(Vp(m))return;throw m}finally{d||n.abort()}}return new t(l,n,i)}static fromReadableStream(e,n,i){let a=!1;async function*r(){let d=new Jp,m=H3(e);for await(let h of m)for(let E of d.decode(h))yield E;for(let h of d.flush())yield h}async function*l(){if(a)throw new At("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let d=!1;try{for await(let m of r())d||m&&(yield JSON.parse(m));d=!0}catch(m){if(Vp(m))return;throw m}finally{d||n.abort()}}return new t(l,n,i)}[(K3=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],n=[],i=this.iterator(),a=r=>({next:()=>{if(r.length===0){let l=i.next();e.push(l),n.push(l)}return r.shift()}});return[new t(()=>a(e),this.controller,xe(this,K3,"f")),new t(()=>a(n),this.controller,xe(this,K3,"f"))]}toReadableStream(){let e=this,n;return ew({async start(){n=e[Symbol.asyncIterator]()},async pull(i){try{let{value:a,done:r}=await n.next();if(r)return i.close();let l=G3(JSON.stringify(a)+`
|
package/package.json
CHANGED
package/cue-v0.0.17.tar.gz
DELETED
|
Binary file
|