@swifty.js/swifty 0.0.18 → 0.0.20

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.
@@ -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
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk-4WQF4JIN.js";import"./chunk-E55KH72M.js";import"./chunk-X3UA5OZL.js";export{d as ASYNC_AGENT_ALLOWED_TOOLS,c as CUSTOM_AGENT_DISALLOWED_TOOLS,f as FORK_QUERY_SOURCE,a as SUBAGENT_DISALLOWED_TOOLS,b as TEAMMATE_DISALLOWED_TOOLS,g as cloneRegistryForFork,e as filterToolsForAgent};
4
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk-A2VR3BC4.js";import"./chunk-E55KH72M.js";import"./chunk-X3UA5OZL.js";export{d as ASYNC_AGENT_ALLOWED_TOOLS,c as CUSTOM_AGENT_DISALLOWED_TOOLS,f as FORK_QUERY_SOURCE,a as SUBAGENT_DISALLOWED_TOOLS,b as TEAMMATE_DISALLOWED_TOOLS,g as cloneRegistryForFork,e as filterToolsForAgent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swifty.js/swifty",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Swifty — CLI coding agent",
5
5
  "keywords": [
6
6
  "ai",
@@ -79,8 +79,8 @@
79
79
  "typescript": "^5.9.3",
80
80
  "typescript-eslint": "^8.65.0",
81
81
  "vitest": "^4.1.10",
82
- "@swifty.js/glob-wasm": "0.0.1",
83
- "@swifty.js/marked-terminal": "^0.0.1"
82
+ "@swifty.js/marked-terminal": "^0.0.1",
83
+ "@swifty.js/glob-wasm": "0.0.1"
84
84
  },
85
85
  "scripts": {
86
86
  "fe:dev": "cd src/remote/fe && tsup --watch",
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __swiftyCreateRequire } from "node:module";
3
- const require = __swiftyCreateRequire(import.meta.url);
4
- import{a as T,b as f}from"./chunk-E55KH72M.js";var c=class{tools=new Map;discovered=new Set;mcpLoadingMode="eager";exposeToolSearch=!1;exposeMcpCall=!1;register(e){this.tools.set(e.name,e)}get(e){return this.tools.get(e)}listTools(){return[...this.tools.values()]}getAllSchemas(e="anthropic"){let o=e==="openai"||e==="openai-compat",t=this.mcpLoadingMode==="native"&&!o,n=[];for(let s of this.tools.values()){if(s.name===T&&!this.exposeToolSearch||s.name===f&&!this.exposeMcpCall)continue;let i=!!s.deferred&&!this.discovered.has(s.name);if(i&&!t)continue;let r=s.schema();o?n.push({strict:!1,type:"function",name:r.name,description:r.description,parameters:r.input_schema,function:{name:r.name,description:r.description,parameters:r.input_schema}}):n.push(i?{...r,type:"custom",defer_loading:!0}:{...r,type:"custom"})}return n}getDeferredToolNames(){let e=[];for(let o of this.tools.values())o.deferred&&!this.discovered.has(o.name)&&e.push(o.name);return e.sort()}getDeferredTools(){return[...this.tools.values()].filter(e=>e.deferred&&!this.discovered.has(e.name))}searchDeferred(e,o=5){let t=e.toLowerCase(),n=[];for(let s of this.tools.values())if(!(!s.deferred||this.discovered.has(s.name))&&(s.name.toLowerCase().includes(t)||s.description.toLowerCase().includes(t))&&(n.push(s),n.length>=o))break;return n}findDeferredByNames(e){let o=new Map;for(let[t,n]of this.tools)o.set(t.toLowerCase(),n);return e.map(t=>o.get(t.toLowerCase())).filter(t=>t?.deferred??!1)}markDiscovered(e){this.discovered.add(e)}isDiscovered(e){return this.discovered.has(e)}};var h=new Set(["ExitPlanMode","Agent","AskUserQuestion","TaskStop"]),M=new Set(["TeamCreate","TeamDelete"]),m=new Set(["ExitPlanMode","Agent","AskUserQuestion","TaskStop"]),u=new Set(["ReadFile","Grep","Glob","Bash","EditFile","WriteFile","LoadSkill","SyntheticOutput","ToolSearch","EnterWorktree","ExitWorktree","McpCall"]);function g(a){return a.startsWith("mcp__")}function k(a,e,o,t,n=!1){let s=new Set(o??[]),i=new Set(e??[]),r=i.size>0&&!(i.size===1&&i.has("*")),p=new c;for(let d of a.listTools()){let l=d.name;if(g(l)){p.register(d);continue}h.has(l)||n&&m.has(l)||t&&!u.has(l)||s.has(l)||r&&!i.has(l)||p.register(d)}return p}var A="agent:builtin:fork";function E(a){let e=new c;for(let o of a.listTools())if(o.name==="Agent"&&"querySource"in o){let t=Object.create(Object.getPrototypeOf(o),Object.getOwnPropertyDescriptors(o));t.querySource=A,e.register(t)}else e.register(o);return e}export{c as a,h as b,M as c,m as d,u as e,k as f,A as g,E as h};