@swifty.js/swifty 0.0.18 → 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.
@@ -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{h as a}from"./chunk-SUWMNSWK.js";import"./chunk-ASZMSWK5.js";import"./chunk-FZPTNGTU.js";import"./chunk-ZM2V2A7B.js";import"./chunk-X3UA5OZL.js";export{a as Agent};
4
+ import{h as a}from"./chunk-5J4WCPY4.js";import"./chunk-ASZMSWK5.js";import"./chunk-FZPTNGTU.js";import"./chunk-ZM2V2A7B.js";import"./chunk-X3UA5OZL.js";export{a as Agent};
@@ -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{a,b,c,d,e}from"./chunk-GM65WMIB.js";import"./chunk-P276SKAC.js";import"./chunk-7MHXMDYC.js";import"./chunk-ZM2V2A7B.js";import"./chunk-E55KH72M.js";import"./chunk-X3UA5OZL.js";export{b as PathSandbox,e as PermissionChecker,d as RuleEngine,c as evaluateRules,a as extractContent};
4
+ import{a,b,c,d,e}from"./chunk-T74SUDUF.js";import"./chunk-P276SKAC.js";import"./chunk-7MHXMDYC.js";import"./chunk-ZM2V2A7B.js";import"./chunk-E55KH72M.js";import"./chunk-X3UA5OZL.js";export{b as PathSandbox,e as PermissionChecker,d as RuleEngine,c as evaluateRules,a as extractContent};
@@ -72,7 +72,7 @@ from={worker name}: {what the worker reported}
72
72
 
73
73
  When calling Agent, use subagent_type \`general-purpose\` or a specific agent definition. Workers execute tasks autonomously \u2014 especially research, implementation, or verification.
74
74
 
75
- Workers have access to standard tools: ReadFile, EditFile, WriteFile, Bash, Grep, Glob, plus the team coordination tools (TaskCreate, TaskGet, TaskList, TaskUpdate, SendMessage). Anything you cannot do yourself, a worker can do for you.
75
+ Workers have access to standard tools: ReadFile, EditFile, WriteFile, Bash, PowerShell, Grep, Glob, plus the team coordination tools (TaskCreate, TaskGet, TaskList, TaskUpdate, SendMessage). Anything you cannot do yourself, a worker can do for you.
76
76
 
77
77
  Because workers have Bash, git work belongs to them too. Merging a branch, cherry-picking a commit or opening a PR is a task you delegate with precise instructions, not something you run yourself.
78
78
 
@@ -0,0 +1,4 @@
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,r=[];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 n=s.schema();o?r.push({strict:!1,type:"function",name:n.name,description:n.description,parameters:n.input_schema,function:{name:n.name,description:n.description,parameters:n.input_schema}}):r.push(i?{...n,type:"custom",defer_loading:!0}:{...n,type:"custom"})}return r}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(),r=[];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))&&(r.push(s),r.length>=o))break;return r}findDeferredByNames(e){let o=new Map;for(let[t,r]of this.tools)o.set(t.toLowerCase(),r);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"]),w=new Set(["TeamCreate","TeamDelete"]),m=new Set(["ExitPlanMode","Agent","AskUserQuestion","TaskStop"]),u=new Set(["ReadFile","Grep","Glob","Bash","PowerShell","EditFile","WriteFile","LoadSkill","SyntheticOutput","ToolSearch","EnterWorktree","ExitWorktree","McpCall"]);function g(a){return a.startsWith("mcp__")}function M(a,e,o,t,r=!1){let s=new Set(o??[]),i=new Set(e??[]),n=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)||r&&m.has(l)||t&&!u.has(l)||s.has(l)||n&&!i.has(l)||p.register(d)}return p}var A="agent:builtin:fork";function k(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,w as c,m as d,u as e,M as f,A as g,k as h};