@yukino.js/yukino 0.0.11 → 0.0.13-dev
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 +111 -68
- package/dist/a2a-DG2JNM3U.js +14 -0
- package/dist/acp-DCZDS6FQ.js +14 -0
- package/dist/anthropic-5BTWVZVT.js +4 -0
- package/dist/chunk-4CLD7LEU.js +5 -0
- package/dist/{chunk-QMHSZVNF.js → chunk-5DK2M7VI.js} +1 -1
- package/dist/chunk-5URXBVET.js +4 -0
- package/dist/{chunk-3VTVI62N.js → chunk-AZQD75PX.js} +1 -1
- package/dist/{chunk-WH5FUZXY.js → chunk-BDLFNDC4.js} +3 -3
- package/dist/{chunk-TPEUG7AU.js → chunk-COHBT6M7.js} +161 -155
- package/dist/chunk-CW5XFH7H.js +59 -0
- package/dist/{chunk-YWTRNPNR.js → chunk-IWMCIYOG.js} +21 -21
- package/dist/chunk-OI2W6R6H.js +28 -0
- package/dist/chunk-SZXXASVH.js +4 -0
- package/dist/chunk-UGX62ZSO.js +4 -0
- package/dist/chunk-W4GMCNWF.js +65 -0
- package/dist/lib/{anthropic-7HQY42TP.js → anthropic-AVZIC22O.js} +5 -5
- package/dist/lib/bwrap-JS5GRKWY.js +7 -0
- package/dist/lib/{chunk-QQ2V5EX3.js → chunk-EGJKLA2W.js} +3 -3
- package/dist/lib/{chunk-AUU4RKMV.js → chunk-GVI5R2DA.js} +47 -29
- package/dist/lib/{chunk-XDGZMZ2B.js → chunk-LSI3T24Q.js} +2 -2
- package/dist/lib/{chunk-EATSQNOB.js → chunk-O2H6VKKR.js} +3 -3
- package/dist/lib/{chunk-55LKYMVV.js → chunk-OFDOP6I2.js} +2 -2
- package/dist/lib/{chunk-JXZ5KIUV.js → chunk-PCZ63WQL.js} +1 -1
- package/dist/lib/{chunk-Q6B6TAR3.js → chunk-QJ32WYQY.js} +120 -152
- package/dist/lib/{chunk-VXHBKGZW.js → chunk-TUNZLQLO.js} +12 -13
- package/dist/lib/{chunk-OCGX3ISG.js → chunk-XH7D5FLE.js} +4 -4
- package/dist/lib/{chunk-KC54MV5H.js → chunk-XLRV26YW.js} +1 -1
- package/dist/lib/index.d.ts +380 -351
- package/dist/lib/index.js +925 -638
- package/dist/lib/{openai-Z7PCXN2X.js → openai-54IQOU6Y.js} +4 -4
- package/dist/lib/{providers-GOU5DD3X.js → providers-MOCB6Y5L.js} +3 -3
- package/dist/lib/seatbelt-LDM6UB6N.js +7 -0
- package/dist/lib/{tool-filter-GVVYY5QO.js → tool-filter-5Z6UTRRR.js} +4 -4
- package/dist/main-IA22XMQR.js +494 -0
- package/dist/main.js +2 -487
- package/dist/{openai-WNPMC64P.js → openai-I2TTMBWK.js} +1 -1
- package/dist/providers-DXQRJUIY.js +4 -0
- package/dist/server-QS7CX37F.js +4 -0
- package/dist/tool-filter-KDQMXIDC.js +4 -0
- package/package.json +2 -2
- package/dist/a2a-WKGEGTP6.js +0 -14
- package/dist/acp-W2I7T2NT.js +0 -14
- package/dist/anthropic-CQUMQFUK.js +0 -4
- package/dist/chunk-CH7VZVG4.js +0 -4
- package/dist/chunk-F6WFTAOT.js +0 -59
- package/dist/chunk-R567WVDL.js +0 -90
- package/dist/chunk-ZPL2YHQU.js +0 -5
- package/dist/lib/bwrap-V6MFP7PT.js +0 -7
- package/dist/lib/seatbelt-2OE46ZE7.js +0 -7
- package/dist/providers-CMCKMYGG.js +0 -4
- package/dist/server-OQ5XVSZY.js +0 -4
- package/dist/tool-filter-BTQ7WTHR.js +0 -4
package/dist/chunk-ZPL2YHQU.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a as _}from"./chunk-MQAQBW7F.js";import{C as r,b as x}from"./chunk-R567WVDL.js";import{homedir as z}from"os";import{join as D}from"path";function h(){return D(z(),".yukino","config.yaml")}var g=["off","minimal","low","medium","high","xhigh","max"],p=r.enum(["none","minimal","low","medium","high","xhigh","max"]),M=r.enum(["low","medium","high","xhigh","max"]),K=r.strictObject({off:r.literal("none").nullable().optional(),minimal:p.nullable().optional(),low:p.nullable().optional(),medium:p.nullable().optional(),high:p.nullable().optional(),xhigh:p.nullable().optional(),max:p.nullable().optional()}),y=r.looseObject({name:r.string(),protocol:r.enum(["anthropic","openai","openai-compat"]),base_url:r.string(),model:r.string(),api_key:r.string().optional(),thinking:r.enum(g).optional(),reasoning:r.boolean().optional(),thinking_level_map:K.optional(),thinking_mode:r.enum(["budget","adaptive"]).optional(),context_window:r.coerce.number().optional(),max_output_tokens:r.coerce.number().optional()});function fe(e,n){return e[n]??e[0]}var V="high",d=1e6,m=128e3,$={minimal:1024,low:2048,medium:8192,high:16384,xhigh:32768,max:65536},F=1024,G=1024;function ce(e){return g.some(n=>n===e)}function v(e){return W(e,e.thinking??V)}function le(e){return e==="off"?0:$[e]}function b(e,n){if(n?.reasoning===!1)return null;if(e==="off")return"none";let t=n?.thinking_level_map?.[e];if(t!==void 0)return t;if(n?.protocol==="anthropic"&&n.thinking_mode==="adaptive"){if(e==="minimal")return"low";if(e==="xhigh")return"high"}return(n?.protocol==="openai"||n?.protocol==="openai-compat")&&(e==="xhigh"||e==="max")?"high":e}function H(e,n){let t=M.safeParse(b(e,n));return t.success?t.data:null}function B(e){return e.reasoning===!1||e.protocol==="anthropic"&&e.thinking_mode!=="adaptive"&&E(e)<F+G?["off"]:g.filter(n=>{if(n==="off")return!0;if(e.protocol==="anthropic"&&e.thinking_mode==="adaptive")return H(n,e)!==null;let t=b(n,e);return!(t===null||t==="none"||(e.protocol==="openai"||e.protocol==="openai-compat")&&(n==="xhigh"||n==="max")&&e.thinking_level_map?.[n]===void 0)})}function W(e,n){let t=B(e),o="off";for(let s of g)if(t.includes(s)&&(o=s),s===n)break;return o}function pe(e){return{...e,thinking:v(e),context_window:w(e),max_output_tokens:E(e)}}function w(e){return Number.isSafeInteger(e.context_window)&&(e.context_window??0)>0?e.context_window??d:d}function E(e){let n=e.max_output_tokens,t=Number.isSafeInteger(n)&&(n??0)>0?n??m:m;return Math.min(t,w(e))}import{randomUUID as X}from"crypto";import{existsSync as P,mkdirSync as q,readFileSync as Z,renameSync as J,unlinkSync as Q,writeFileSync as Y}from"fs";import{dirname as ee,join as ne}from"path";var L=(e,n,t)=>r.preprocess(o=>o===void 0||typeof o=="string"&&!o.trim()?e:o,r.union([r.number(),r.string().trim().regex(/^\d+$/,"Enter a whole number").transform(Number)]).pipe(r.number().int().min(n).max(t))),te=y.extend({name:r.string().trim().min(1,"Name is required"),base_url:r.url("Enter a valid HTTP(S) URL").refine(e=>/^https?:\/\//i.test(e),"Use an HTTP(S) URL"),api_key:r.string().trim().min(1,"API key is required"),model:r.string().trim().min(1,"Model is required"),thinking:r.enum(g).optional(),context_window:L(d,1e3,1e7),max_output_tokens:L(m,1,1e6)}).refine(e=>e.max_output_tokens<=e.context_window,{path:["max_output_tokens"],message:"Max output tokens must not exceed the context window"}).transform(e=>({...e,thinking:v(e)}));function k(e){if(!P(e))return{};let n;try{n=_.load(Z(e,"utf-8"))}catch{throw new Error(`Unable to read existing ${e}; it has not been changed.`)}return r.record(r.string(),r.unknown()).parse(n??{})}function T(e,n){let t=ee(e);q(t,{recursive:!0});let o=ne(t,`.config-${X()}.tmp`);try{Y(o,_.dump(n,{lineWidth:-1,noRefs:!0}),{encoding:"utf-8",mode:384,flag:"wx"}),J(o,e)}finally{P(o)&&Q(o)}}function ve(e,n){let t=te.parse(e),o=h(),s=k(o),f=[...r.array(r.record(r.string(),r.unknown())).parse(s.providers??[])];for(let c of n)f.some(j=>j.base_url===c.base_url)||f.push({...c});let i=[],a=!1;for(let c of f){if(c.base_url!==t.base_url){i.push(c);continue}a||(a=!0,i.push(t))}a||i.push(t);let R=i.map(c=>y.parse(c));return T(o,{...s,providers:i}),{provider:t,providers:R,replaced:a,path:o}}function N(e,n,t){let o=h(),s=k(o),u=r.array(r.record(r.string(),r.unknown())).parse(s.providers??[]),f=u.filter(a=>a.base_url===e);if(f.length===0)throw new Error(`Provider with base URL "${e}" not found in ${o}.`);let i=f.filter(a=>a[n]!==t);if(i.length!==0){for(let a of i)a[n]=t;T(o,{...s,providers:u})}}function ke(e,n){N(e,"thinking",n)}function Te(e,n){N(e,"model",n)}function Se(e){let n=h(),t=k(n);t.default_provider!==e&&T(n,{...t,default_provider:e})}var oe="Tool execution was interrupted. The tool may or may not have completed; verify before relying on its effects.",we="The user rejected this tool use. Nothing was changed (for file edits, the new content was NOT written).";function Ee(e){let n=[];for(let t=0;t<e.length;t++){let o=e[t];if(o.role==="assistant"&&o.toolUses?.length){n.push(o);let s=new Set(o.toolUses.map(i=>i.toolUseId)),u=[],f=[];for(;t+1<e.length;){let i=e[t+1];if(i.role!=="user"||!i.toolResults?.length||i.toolUses?.length)break;t++,f.push(i);for(let a of i.toolResults)s.delete(a.toolUseId)&&u.push(a)}for(let i of s)u.push({toolUseId:i,content:oe,isError:!0});n.push({...f[0]??{role:"user",content:""},toolResults:u});for(let i of f.slice(1))(i.content.length>0||i.thinkingBlocks?.length)&&n.push({...i,toolResults:[]});continue}if((o.toolResults?.length??0)>0){if(o.content.length===0&&!o.toolUses?.length&&!o.thinkingBlocks?.length)continue;n.push({...o,toolResults:[]})}else n.push(o)}return n}var l=class extends Error{constructor(n){super(n),this.name="LLMError"}},A=class extends l{constructor(n){super(n),this.name="AuthenticationError"}},C=class extends l{retryAfter;constructor(n,t){super(n),this.name="RateLimitError",this.retryAfter=t}},O=class extends l{constructor(n){super(n),this.name="NetworkError"}},U=class extends l{constructor(t,o){super(t);this.retryAfter=o;this.name="ServerError"}retryAfter},I=class extends l{constructor(n){super(n),this.name="ContextTooLongError"}};function Pe(e){return/context_length_exceeded/i.test(e)||/maximum\s+context\s+length/i.test(e)||/prompts?\s+(?:is\s+)?too\s+long/i.test(e)}function S(e){return!!e._zod}function Be(e,n){return S(e)?x(e,n):e.safeParse(n)}function We(e){if(!e)return;let n;if(S(e)?n=e._zod?.def?.shape:n=e.shape,!!n){if(typeof n=="function")try{return n()}catch{return}return n}}function ie(e){return e.length===0?"object root":e.reduce((n,t,o)=>o===0?String(t):typeof t=="number"?`${n}[${t}]`:`${n}.${t}`,"")}function Xe(e){if(e&&typeof e=="object"){if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0)return e.issues.map(n=>n.path?.length?`${n.message} at ${ie(n.path)}`:n.message).join(`
|
|
5
|
-
`);if("message"in e&&typeof e.message=="string")return e.message;try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function qe(e){if(S(e)){let u=e._zod?.def;if(u){if(u.value!==void 0)return u.value;if(Array.isArray(u.values)&&u.values.length>0)return u.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let o=e.value;if(o!==void 0)return o}export{Be as a,We as b,Xe as c,qe as d,h as e,g as f,y as g,fe as h,V as i,d as j,m as k,G as l,ce as m,v as n,le as o,b as p,H as q,B as r,W as s,pe as t,w as u,E as v,te as w,ve as x,ke as y,Te as z,Se as A,we as B,Ee as C,l as D,A as E,C as F,O as G,U as H,I,Pe as J};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{b as a,c as b}from"./chunk-WH5FUZXY.js";import"./chunk-R567WVDL.js";import"./chunk-JFKC4VCA.js";import"./chunk-LCWNSYZU.js";import"./chunk-HMZQYFYG.js";import"./chunk-3QL446GD.js";import"./chunk-AGSYLE4E.js";import"./chunk-CU3IISCC.js";import"./chunk-VCIRD267.js";import"./chunk-7MKA3SHV.js";export{b as createTelemetryRuntime,a as parseExporterTypes};
|
package/dist/server-OQ5XVSZY.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{g as a,h as b}from"./chunk-YWTRNPNR.js";import"./chunk-WGFROGUC.js";import"./chunk-TPEUG7AU.js";import"./chunk-QMHSZVNF.js";import"./chunk-ZPL2YHQU.js";import"./chunk-F6WFTAOT.js";import"./chunk-3VTVI62N.js";import"./chunk-MQAQBW7F.js";import"./chunk-VU3JWAJR.js";import"./chunk-WH5FUZXY.js";import"./chunk-R567WVDL.js";import"./chunk-JFKC4VCA.js";import"./chunk-KJJYW5IY.js";import"./chunk-I74AL3PF.js";import"./chunk-LCWNSYZU.js";import"./chunk-VM4YKTHC.js";import"./chunk-HMZQYFYG.js";import"./chunk-3QL446GD.js";import"./chunk-AGSYLE4E.js";import"./chunk-CU3IISCC.js";import"./chunk-VCIRD267.js";import"./chunk-7MKA3SHV.js";export{b as RemoteServer,a as createRemoteAgent};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{$ as e,X as a,Y as b,Z as c,_ as d,aa as f,ba as g}from"./chunk-F6WFTAOT.js";import"./chunk-3VTVI62N.js";import"./chunk-MQAQBW7F.js";import"./chunk-R567WVDL.js";import"./chunk-LCWNSYZU.js";import"./chunk-7MKA3SHV.js";export{c as ASYNC_AGENT_ALLOWED_TOOLS,e as FORK_QUERY_SOURCE,a as MAIN_AGENT_ONLY_TOOLS,b as SUBAGENT_DISALLOWED_TOOLS,g as cloneRegistryForFork,f as cloneRegistryForTeammate,d as filterToolsForAgent};
|