@swifty.js/swifty 0.0.35 → 0.0.37
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 +8 -8
- package/dist/{acp-A4KRKOHD.js → acp-R22FJPVN.js} +1 -1
- package/dist/{agent-VDWIGFIV.js → agent-WOWGQDBG.js} +1 -1
- package/dist/anthropic-3DXT42SN.js +4 -0
- package/dist/{chunk-4B4SGVJH.js → chunk-ENZ5LHRN.js} +23 -23
- package/dist/chunk-FOPUR6OB.js +610 -0
- package/dist/{chunk-IOLGXPUQ.js → chunk-LW273HD5.js} +1 -1
- package/dist/{chunk-TNF3EHFY.js → chunk-QBGGDF62.js} +1 -1
- package/dist/{chunk-TOM34LJB.js → chunk-R62BGTT4.js} +17 -17
- package/dist/chunk-S2VEXEVV.js +4 -0
- package/dist/{chunk-H56UQALW.js → chunk-VN7HK3YD.js} +1 -1
- package/dist/lib/{agent-TC4HSVMS.js → agent-ZSFK66FQ.js} +2 -2
- package/dist/lib/{anthropic-FKIGL7NL.js → anthropic-GD3ILYG6.js} +1 -1
- package/dist/lib/{chunk-S5VWPTME.js → chunk-5OJV33Y2.js} +37 -14
- package/dist/lib/{chunk-RUDYC7OS.js → chunk-BHSNJT6Z.js} +1 -1
- package/dist/lib/{chunk-LRN4MOQ3.js → chunk-GWZDEU27.js} +0 -5
- package/dist/lib/{chunk-ALQHMYOZ.js → chunk-LKFJIK6F.js} +0 -3
- package/dist/lib/{chunk-OJTISIYU.js → chunk-O35GIE35.js} +1 -1
- package/dist/lib/{chunk-6V7RW6HA.js → chunk-TD7Z6L4D.js} +10 -13
- package/dist/lib/index.d.ts +689 -563
- package/dist/lib/index.js +1153 -729
- package/dist/lib/{openai-ZWIYIBLC.js → openai-N6X7XUQJ.js} +1 -1
- package/dist/lib/{permissions-BW4QPZXV.js → permissions-77UJQITR.js} +1 -1
- package/dist/lib/{providers-ROWSB6ND.js → providers-WQ3UOLMF.js} +1 -1
- package/dist/lib/{tool-filter-QU4LOZII.js → tool-filter-S3ZZOXFD.js} +1 -1
- package/dist/main.js +154 -153
- package/dist/{openai-7LMX5HKW.js → openai-XMJVVTTX.js} +1 -1
- package/dist/{providers-2J4JJYQD.js → providers-NWLGMQOZ.js} +1 -1
- package/dist/{server-ZYK4L22D.js → server-TINTK5DM.js} +1 -1
- package/dist/{tool-filter-U5SSL3LR.js → tool-filter-QETBQPHL.js} +1 -1
- package/package.json +2 -2
- package/dist/anthropic-AR2Y4FBR.js +0 -4
- package/dist/chunk-F4FOFPKL.js +0 -611
- package/dist/chunk-UJGMTIYO.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __swiftyCreateRequire } from "node:module";
|
|
3
3
|
const require = __swiftyCreateRequire(import.meta.url);
|
|
4
|
-
function r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var p=new Set(["image/jpeg","image/png","image/gif","image/webp"]);function a(e){return p.has(e)}function i(e){return r(e)&&e.type==="text"&&typeof e.text=="string"?{type:"text",text:e.text}:null}function l(e){return!r(e)||e.type!=="image"||!r(e.source)?null:e.source.type==="url"&&typeof e.source.url=="string"?{type:"image",source:{type:"url",url:e.source.url}}:e.source.type==="base64"&&typeof e.source.media_type=="string"&&a(e.source.media_type)&&typeof e.source.data=="string"?{type:"image",source:{type:"base64",media_type:e.source.media_type,data:e.source.data}}:null}function u(e){if(e.type!=="document"||!r(e.source))return null;let
|
|
4
|
+
function r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var p=new Set(["image/jpeg","image/png","image/gif","image/webp"]);function a(e){return p.has(e)}function i(e){return r(e)&&e.type==="text"&&typeof e.text=="string"?{type:"text",text:e.text}:null}function l(e){return!r(e)||e.type!=="image"||!r(e.source)?null:e.source.type==="url"&&typeof e.source.url=="string"?{type:"image",source:{type:"url",url:e.source.url}}:e.source.type==="base64"&&typeof e.source.media_type=="string"&&a(e.source.media_type)&&typeof e.source.data=="string"?{type:"image",source:{type:"base64",media_type:e.source.media_type,data:e.source.data}}:null}function u(e){if(e.type!=="document"||!r(e.source))return null;let t=null;if(e.source.type==="url"&&typeof e.source.url=="string")t={type:"url",url:e.source.url};else if(e.source.type==="base64"&&e.source.media_type==="application/pdf"&&typeof e.source.data=="string")t={type:"base64",media_type:"application/pdf",data:e.source.data};else if(e.source.type==="text"&&e.source.media_type==="text/plain"&&typeof e.source.data=="string")t={type:"text",media_type:"text/plain",data:e.source.data};else if(e.source.type==="content"){if(typeof e.source.content=="string")t={type:"content",content:e.source.content};else if(Array.isArray(e.source.content)){let o=[];for(let n of e.source.content){let s=i(n)??l(n);if(!s)return null;o.push(s)}t={type:"content",content:o}}}return t?{type:"document",source:t,...typeof e.title=="string"||e.title===null?{title:e.title}:{},...typeof e.context=="string"||e.context===null?{context:e.context}:{}}:null}function y(e){let t=i(e);if(t)return t;let o=l(e);if(o)return o;if(!r(e))return null;if(e.type==="tool_reference"&&typeof e.tool_name=="string")return{type:"tool_reference",tool_name:e.tool_name};if(e.type==="search_result"&&typeof e.source=="string"&&typeof e.title=="string"&&Array.isArray(e.content)){let n=[];for(let s of e.content){let c=i(s);if(!c)return null;n.push(c)}return{type:"search_result",source:e.source,title:e.title,content:n}}return u(e)}var m=new Set([".agents",".git",".swifty",".next",".venv",".mypy_cache","__pycache__","dist","node_modules"]);export{y as a,m as b};
|