hummin-cli 1.0.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/README.md +3 -0
- package/dist/bundle/chunks/anthropic-messages-RS73YAAL.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-WDUJVP6K.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +78 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
- package/dist/bundle/chunks/chunk-AXIIZGTV.js +2 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
- package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
- package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
- package/dist/bundle/chunks/chunk-GTBU4EAF.js +2 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
- package/dist/bundle/chunks/chunk-NV6PWB3O.js +11 -0
- package/dist/bundle/chunks/chunk-OENBO5ZB.js +1589 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
- package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
- package/dist/bundle/chunks/chunk-WG5HGQZU.js +44 -0
- package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
- package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-BZMAU2ZY.js +2 -0
- package/dist/bundle/chunks/google-vertex-PW4J25VW.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-NITCU2PD.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
- package/dist/bundle/chunks/mistral-conversations-KKK7YQAI.js +5 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/dist/bundle/chunks/node-O3RIBJRH.js +16 -0
- package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
- package/dist/bundle/chunks/openai-codex-responses-Y5ODP57V.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-EIF77N53.js +7 -0
- package/dist/bundle/chunks/openai-responses-3W4DADHO.js +2 -0
- package/dist/bundle/chunks/openrouter-images-N4XVVFSD.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-ZRYGTSON.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli.js +3 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/package.json +32 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
function inferCopilotInitiator(messages){let last=messages[messages.length-1];return last&&last.role!=="user"?"agent":"user"}function hasCopilotVisionInput(messages){return messages.some(msg=>msg.role==="user"&&Array.isArray(msg.content)?msg.content.some(c=>c.type==="image"):msg.role==="toolResult"&&Array.isArray(msg.content)?msg.content.some(c=>c.type==="image"):!1)}function buildCopilotDynamicHeaders(params){let headers={"X-Initiator":inferCopilotInitiator(params.messages),"Openai-Intent":"conversation-edits"};return params.hasImages&&(headers["Copilot-Vision-Request"]="true"),headers}export{hasCopilotVisionInput,buildCopilotDynamicHeaders};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
function shortHash(str){let h1=3735928559,h2=1103547991;for(let i=0;i<str.length;i++){let ch=str.charCodeAt(i);h1=Math.imul(h1^ch,2654435761),h2=Math.imul(h2^ch,1597334677)}return h1=Math.imul(h1^h1>>>16,2246822507)^Math.imul(h2^h2>>>13,3266489909),h2=Math.imul(h2^h2>>>16,2246822507)^Math.imul(h1^h1>>>13,3266489909),(h2>>>0).toString(36)+(h1>>>0).toString(36)}export{shortHash};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
function clampOpenAIPromptCacheKey(key){if(key===void 0)return;let chars=Array.from(key);return chars.length<=64?key:chars.slice(0,64).join("")}export{clampOpenAIPromptCacheKey};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
function normalizeProviderError(error){if(!(error instanceof Error))return{message:safeJsonStringify(error),messageCarriesBody:!1};let sdkError=error,status=extractStatus(sdkError),body=extractBody(sdkError),messageCarriesBody=body===void 0||error.message.includes(body);return{status,body,message:error.message,messageCarriesBody}}function extractStatus(error){if(typeof error.statusCode=="number")return error.statusCode;if(typeof error.status=="number")return error.status;if(typeof error.$metadata?.httpStatusCode=="number")return error.$metadata.httpStatusCode;if(typeof error.$response?.statusCode=="number")return error.$response.statusCode}function extractBody(error){let bodyText=pickBodyText(error);if(bodyText===void 0)return;let trimmed=bodyText.trim();if(trimmed.length!==0)return truncateErrorText(trimmed,4e3)}function pickBodyText(error){if(typeof error.body=="string")return error.body;if(isPlainNonEmptyObject(error.error))return safeJsonStringify(error.error);let responseBody=error.$response?.body;if(typeof responseBody=="string")return responseBody;if(!isReadableStreamLike(responseBody)&&isPlainNonEmptyObject(responseBody))return safeJsonStringify(responseBody)}function isReadableStreamLike(value){return typeof value=="object"&&value!==null&&"pipe"in value&&typeof value.pipe=="function"}function isPlainNonEmptyObject(value){if(typeof value!="object"||value===null)return!1;let proto=Object.getPrototypeOf(value);return proto!==Object.prototype&&proto!==null?!1:Object.keys(value).length>0}function formatProviderError(norm,prefix){return norm.messageCarriesBody||norm.status===void 0||norm.body===void 0?prefix!==void 0&&norm.status!==void 0?`${prefix} (${norm.status}): ${norm.message}`:norm.message:prefix!==void 0?`${prefix} (${norm.status}): ${norm.body}`:`${norm.status}: ${norm.body}`}function truncateErrorText(text,maxChars){return text.length<=maxChars?text:`${text.slice(0,maxChars)}... [truncated ${text.length-maxChars} chars]`}function safeJsonStringify(value){try{let serialized=JSON.stringify(value);return serialized===void 0?String(value):serialized}catch{return String(value)}}export{normalizeProviderError,formatProviderError};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
import{__commonJS,__toESM}from"./chunk-4L3WN2XY.js";var require_options=__commonJS({"node_modules/partial-json/dist/options.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.Allow=exports.ALL=exports.COLLECTION=exports.ATOM=exports.SPECIAL=exports.INF=exports._INFINITY=exports.INFINITY=exports.NAN=exports.BOOL=exports.NULL=exports.OBJ=exports.ARR=exports.NUM=exports.STR=void 0;exports.STR=1;exports.NUM=2;exports.ARR=4;exports.OBJ=8;exports.NULL=16;exports.BOOL=32;exports.NAN=64;exports.INFINITY=128;exports._INFINITY=256;exports.INF=exports.INFINITY|exports._INFINITY;exports.SPECIAL=exports.NULL|exports.BOOL|exports.INF|exports.NAN;exports.ATOM=exports.STR|exports.NUM|exports.SPECIAL;exports.COLLECTION=exports.ARR|exports.OBJ;exports.ALL=exports.ATOM|exports.COLLECTION;exports.Allow={STR:exports.STR,NUM:exports.NUM,ARR:exports.ARR,OBJ:exports.OBJ,NULL:exports.NULL,BOOL:exports.BOOL,NAN:exports.NAN,INFINITY:exports.INFINITY,_INFINITY:exports._INFINITY,INF:exports.INF,SPECIAL:exports.SPECIAL,ATOM:exports.ATOM,COLLECTION:exports.COLLECTION,ALL:exports.ALL};exports.default=exports.Allow}});var require_dist=__commonJS({"node_modules/partial-json/dist/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.Allow=exports.MalformedJSON=exports.PartialJSON=exports.parseJSON=exports.parse=void 0;var options_1=require_options();Object.defineProperty(exports,"Allow",{enumerable:!0,get:function(){return options_1.Allow}});__exportStar(require_options(),exports);var PartialJSON=class extends Error{};exports.PartialJSON=PartialJSON;var MalformedJSON=class extends Error{};exports.MalformedJSON=MalformedJSON;function parseJSON(jsonString,allowPartial=options_1.Allow.ALL){if(typeof jsonString!="string")throw new TypeError(`expecting str, got ${typeof jsonString}`);if(!jsonString.trim())throw new Error(`${jsonString} is empty`);return _parseJSON(jsonString.trim(),allowPartial)}exports.parseJSON=parseJSON;var _parseJSON=(jsonString,allow)=>{let length=jsonString.length,index=0,markPartialJSON=msg=>{throw new PartialJSON(`${msg} at position ${index}`)},throwMalformedError=msg=>{throw new MalformedJSON(`${msg} at position ${index}`)},parseAny=()=>(skipBlank(),index>=length&&markPartialJSON("Unexpected end of input"),jsonString[index]==='"'?parseStr():jsonString[index]==="{"?parseObj():jsonString[index]==="["?parseArr():jsonString.substring(index,index+4)==="null"||options_1.Allow.NULL&allow&&length-index<4&&"null".startsWith(jsonString.substring(index))?(index+=4,null):jsonString.substring(index,index+4)==="true"||options_1.Allow.BOOL&allow&&length-index<4&&"true".startsWith(jsonString.substring(index))?(index+=4,!0):jsonString.substring(index,index+5)==="false"||options_1.Allow.BOOL&allow&&length-index<5&&"false".startsWith(jsonString.substring(index))?(index+=5,!1):jsonString.substring(index,index+8)==="Infinity"||options_1.Allow.INFINITY&allow&&length-index<8&&"Infinity".startsWith(jsonString.substring(index))?(index+=8,1/0):jsonString.substring(index,index+9)==="-Infinity"||options_1.Allow._INFINITY&allow&&1<length-index&&length-index<9&&"-Infinity".startsWith(jsonString.substring(index))?(index+=9,-1/0):jsonString.substring(index,index+3)==="NaN"||options_1.Allow.NAN&allow&&length-index<3&&"NaN".startsWith(jsonString.substring(index))?(index+=3,NaN):parseNum()),parseStr=()=>{let start=index,escape=!1;for(index++;index<length&&(jsonString[index]!=='"'||escape&&jsonString[index-1]==="\\");)escape=jsonString[index]==="\\"?!escape:!1,index++;if(jsonString.charAt(index)=='"')try{return JSON.parse(jsonString.substring(start,++index-Number(escape)))}catch(e){throwMalformedError(String(e))}else if(options_1.Allow.STR&allow)try{return JSON.parse(jsonString.substring(start,index-Number(escape))+'"')}catch{return JSON.parse(jsonString.substring(start,jsonString.lastIndexOf("\\"))+'"')}markPartialJSON("Unterminated string literal")},parseObj=()=>{index++,skipBlank();let obj={};try{for(;jsonString[index]!=="}";){if(skipBlank(),index>=length&&options_1.Allow.OBJ&allow)return obj;let key=parseStr();skipBlank(),index++;try{let value=parseAny();obj[key]=value}catch(e){if(options_1.Allow.OBJ&allow)return obj;throw e}skipBlank(),jsonString[index]===","&&index++}}catch{if(options_1.Allow.OBJ&allow)return obj;markPartialJSON("Expected '}' at end of object")}return index++,obj},parseArr=()=>{index++;let arr=[];try{for(;jsonString[index]!=="]";)arr.push(parseAny()),skipBlank(),jsonString[index]===","&&index++}catch{if(options_1.Allow.ARR&allow)return arr;markPartialJSON("Expected ']' at end of array")}return index++,arr},parseNum=()=>{if(index===0){jsonString==="-"&&throwMalformedError("Not sure what '-' is");try{return JSON.parse(jsonString)}catch(e){if(options_1.Allow.NUM&allow)try{return JSON.parse(jsonString.substring(0,jsonString.lastIndexOf("e")))}catch{}throwMalformedError(String(e))}}let start=index;for(jsonString[index]==="-"&&index++;jsonString[index]&&",]}".indexOf(jsonString[index])===-1;)index++;index==length&&!(options_1.Allow.NUM&allow)&&markPartialJSON("Unterminated number literal");try{return JSON.parse(jsonString.substring(start,index))}catch{jsonString.substring(start,index)==="-"&&markPartialJSON("Not sure what '-' is");try{return JSON.parse(jsonString.substring(start,jsonString.lastIndexOf("e")))}catch(e2){throwMalformedError(String(e2))}}},skipBlank=()=>{for(;index<length&&`
|
|
3
|
+
\r `.includes(jsonString[index]);)index++};return parseAny()},parse=parseJSON;exports.parse=parse}});var import_partial_json=__toESM(require_dist(),1),VALID_JSON_ESCAPES=new Set(['"',"\\","/","b","f","n","r","t","u"]);function isControlCharacter(char){let codePoint=char.codePointAt(0);return codePoint!==void 0&&codePoint>=0&&codePoint<=31}function escapeControlCharacter(char){switch(char){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
4
|
+
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${char.codePointAt(0)?.toString(16).padStart(4,"0")??"0000"}`}}function repairJson(json){let repaired="",inString=!1;for(let index=0;index<json.length;index++){let char=json[index];if(!inString){repaired+=char,char==='"'&&(inString=!0);continue}if(char==='"'){repaired+=char,inString=!1;continue}if(char==="\\"){let nextChar=json[index+1];if(nextChar===void 0){repaired+="\\\\";continue}if(nextChar==="u"){let unicodeDigits=json.slice(index+2,index+6);if(/^[0-9a-fA-F]{4}$/.test(unicodeDigits)){repaired+=`\\u${unicodeDigits}`,index+=5;continue}}if(VALID_JSON_ESCAPES.has(nextChar)){repaired+=`\\${nextChar}`,index+=1;continue}repaired+="\\\\";continue}repaired+=isControlCharacter(char)?escapeControlCharacter(char):char}return repaired}function parseJsonWithRepair(json){try{return JSON.parse(json)}catch(error){let repairedJson=repairJson(json);if(repairedJson!==json)return JSON.parse(repairedJson);throw error}}function parseStreamingJson(partialJson){if(!partialJson||partialJson.trim()==="")return{};try{return parseJsonWithRepair(partialJson)}catch{try{return(0,import_partial_json.parse)(partialJson)??{}}catch{try{return(0,import_partial_json.parse)(repairJson(partialJson))??{}}catch{return{}}}}}export{repairJson,parseJsonWithRepair,parseStreamingJson};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
var sessionResourceCleanups=new Set;function registerSessionResourceCleanup(cleanup){return sessionResourceCleanups.add(cleanup),()=>{sessionResourceCleanups.delete(cleanup)}}function cleanupSessionResources(sessionId){let errors=[];for(let cleanup of sessionResourceCleanups)try{cleanup(sessionId)}catch(error){errors.push(error)}if(errors.length>0)throw new AggregateError(errors,"Failed to cleanup session resources")}var MAX_SEQUENCE=(1n<<41n)-1n,lastOrdinaryTimestamp=-1,sequence;function uuidv7(timestampMs){let requestedTimestamp=timestampMs??Date.now();if(!Number.isInteger(requestedTimestamp)||requestedTimestamp<0||requestedTimestamp>0xffffffffffff)throw new RangeError(`UUIDv7 timestamp must be an integer between 0 and ${0xffffffffffff}`);let effectiveTimestamp=timestampMs===void 0?Math.max(requestedTimestamp,lastOrdinaryTimestamp):timestampMs;timestampMs===void 0&&(lastOrdinaryTimestamp=effectiveTimestamp);let bytes=new Uint8Array(16);if(globalThis.crypto.getRandomValues(bytes),sequence===void 0)sequence=BigInt(bytes[1])<<32n|BigInt(bytes[2])<<24n|BigInt(bytes[3])<<16n|BigInt(bytes[4])<<8n|BigInt(bytes[5]);else{if(sequence===MAX_SEQUENCE)throw new RangeError("UUIDv7 generator sequence exhausted");sequence++}let timestamp=BigInt(effectiveTimestamp);for(let index=5;index>=0;index--)bytes[index]=Number(timestamp>>BigInt((5-index)*8))&255;bytes[6]=112|Number(sequence>>37n&0x0fn),bytes[7]=Number(sequence>>29n&0xffn),bytes[8]=128|Number(sequence>>23n&0x3fn),bytes[9]=Number(sequence>>15n&0xffn),bytes[10]=Number(sequence>>7n&0xffn),bytes[11]=Number((sequence&0x7fn)<<1n)|bytes[11]&1;let hex=Array.from(bytes,byte=>byte.toString(16).padStart(2,"0"));return`${hex.slice(0,4).join("")}-${hex.slice(4,6).join("")}-${hex.slice(6,8).join("")}-${hex.slice(8,10).join("")}-${hex.slice(10).join("")}`}export{registerSessionResourceCleanup,cleanupSessionResources,uuidv7};
|