@yukino.js/yukino 0.0.20 → 0.0.21-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.
Files changed (35) hide show
  1. package/README.md +12 -38
  2. package/dist/anthropic-LB4T3BEN.js +4 -0
  3. package/dist/browser/dist/index.html +2 -2
  4. package/dist/browser/dist/static/chunk-3HWUJ4KR.js +1 -0
  5. package/dist/browser/dist/static/{highlight-ZDY7K2CR.js → highlight-KNDEBJWF.js} +10 -10
  6. package/dist/browser/dist/static/index.css +1 -1
  7. package/dist/browser/dist/static/index.js +40 -40
  8. package/dist/{chunk-3V2Q65BE.js → chunk-2N7OIUQW.js} +197 -198
  9. package/dist/{chunk-LUBMW3QT.js → chunk-57IGGFHK.js} +5 -5
  10. package/dist/{chunk-Q6322VDG.js → chunk-5AOJ5ZSQ.js} +20 -20
  11. package/dist/chunk-5D3QKHYQ.js +36 -0
  12. package/dist/{chunk-FK5B4XFN.js → chunk-7WP7SERS.js} +1 -1
  13. package/dist/{chunk-SLZKGKP5.js → chunk-EQABLL4S.js} +1 -1
  14. package/dist/{chunk-T3MBBXTU.js → chunk-P6K7EQHF.js} +29 -29
  15. package/dist/{chunk-D64ZLLSN.js → chunk-WKTO7XPO.js} +1 -1
  16. package/dist/lib/{anthropic-UZXEGJN5.js → anthropic-TYBMDJP3.js} +3 -3
  17. package/dist/lib/{chunk-6RBU5LDC.js → chunk-3QGT2MSI.js} +0 -42
  18. package/dist/lib/{chunk-V3WAJBLN.js → chunk-IPKULHXR.js} +2 -2
  19. package/dist/lib/{chunk-FHJHT233.js → chunk-NIUCGP4C.js} +80 -238
  20. package/dist/lib/{chunk-2QPNVR5H.js → chunk-OPEO6D4O.js} +2 -5
  21. package/dist/lib/{chunk-Y3EO3KLE.js → chunk-XVXFUSSS.js} +2 -2
  22. package/dist/lib/index.d.ts +616 -819
  23. package/dist/lib/index.js +666 -1441
  24. package/dist/lib/{openai-DNNUHOKV.js → openai-Z2JCYL6F.js} +3 -3
  25. package/dist/lib/{providers-NBWCB4EA.js → providers-2NPR2VR4.js} +2 -2
  26. package/dist/{main-IEQSD5OX.js → main-OMIZDIYB.js} +221 -221
  27. package/dist/main.js +2 -2
  28. package/dist/{openai-SRAHPUVF.js → openai-UOCUBMFA.js} +1 -1
  29. package/dist/{providers-ETXXDQGM.js → providers-G5SKN22T.js} +1 -1
  30. package/dist/server-ESDMJACZ.js +14 -0
  31. package/dist/{server-N2WSM46R.js → server-Z742CQSK.js} +1 -1
  32. package/package.json +4 -4
  33. package/dist/anthropic-XJSWCDJD.js +0 -4
  34. package/dist/chunk-ZZF3DILS.js +0 -38
  35. package/dist/server-HXOWUX6N.js +0 -14
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __yukinoCreateRequire } from "node:module";
3
3
  const require = __yukinoCreateRequire(import.meta.url);
4
- import{Jc as p,Lc as O,Mb as I,Nb as R,Oc as l,Pa as y,nc as S,ob as E,oc as C}from"./chunk-Q6322VDG.js";function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L(e){return E.has(e)}function h(e){return u(e)&&e.type==="text"&&typeof e.text=="string"?{type:"text",text:e.text}:null}function x(e){return!u(e)||e.type!=="image"||!u(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"&&L(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"||!u(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 r of e.source.content){let s=h(r)??x(r);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 $(e){let t=h(e);if(t)return t;let o=x(e);if(o)return o;if(!u(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 r=[];for(let s of e.content){let n=h(s);if(!n)return null;r.push(n)}return{type:"search_result",source:e.source,title:e.title,content:r}}return U(e)}var J="# MCP Server Instructions",a="mcp__",Q="io.modelcontextprotocol/ui",V="text/html;profile=mcp-app",Z="ui://";var ee="advanced-tool-use-2025-11-20",P=new Set(["api.anthropic.com"]),te=new Set(["image/png","image/jpeg","image/gif","image/webp"]),oe="Not connected";var v=y({module:"mcp"});function d(e){return e.replace(/[^a-zA-Z0-9_]/g,"_")}function F(e){return`${a}${d(e)}${"__"}`}function f(e,t){return F(e)+d(t)}var k=class{name;description;category="command";deferred=!0;mcpServerName;client;originalName;inputSchema;constructor(t,o,r){this.name=f(o,r.name),this.description=r.description,this.originalName=r.name,this.client=t,this.inputSchema=r.inputSchema,this.mcpServerName=o}mcpInputSchema(){return this.inputSchema??{}}setDeferLoading(t){this.deferred=t}schema(){return{name:this.name,description:this.description,input_schema:this.inputSchema}}async execute(t,o){try{return await this.client.callTool(this.originalName,o,t.abortSignal)}catch(r){return v.error({err:r},"mcp operation failed"),{output:`MCP tool error: ${O(r)}`,isError:!0}}}};function ce(e,t,o){switch(e){case"explicit":return`Command running in background (task_id: ${t}). You will be notified when it completes; do not poll. Use TaskStop with task_id to kill it early.`;case"timeout":return`Command exceeded its ${String(o)}s timeout and was moved to the background (task_id: ${t}). It is still running \u2014 you will be notified when it completes.`;case"user":return`Command was manually backgrounded by the user (task_id: ${t}). It is still running \u2014 you will be notified when it completes.`}}var b="Git: commit or push only when requested. Destructive operations (push --force, reset --hard, checkout ., clean -f, branch -D), amending, or skipping hooks/signing require explicit authorization; never bypass permission/hook denials. Prefer new commits. When committing, include Co-Authored-By: Yukino <usr161043261@outlook.com>.",le=`Execute command in Bash; return stdout and stderr. Prefer PowerShell on Windows.
4
+ import{Bc as O,Ec as l,Ib as I,Jb as R,Pa as y,jc as S,kc as C,ob as E,zc as p}from"./chunk-5AOJ5ZSQ.js";function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L(e){return E.has(e)}function h(e){return u(e)&&e.type==="text"&&typeof e.text=="string"?{type:"text",text:e.text}:null}function x(e){return!u(e)||e.type!=="image"||!u(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"&&L(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"||!u(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 r of e.source.content){let s=h(r)??x(r);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 $(e){let t=h(e);if(t)return t;let o=x(e);if(o)return o;if(!u(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 r=[];for(let s of e.content){let n=h(s);if(!n)return null;r.push(n)}return{type:"search_result",source:e.source,title:e.title,content:r}}return U(e)}var J="# MCP Server Instructions",a="mcp__",Q="io.modelcontextprotocol/ui",V="text/html;profile=mcp-app",Z="ui://";var ee="advanced-tool-use-2025-11-20",P=new Set(["api.anthropic.com"]),te=new Set(["image/png","image/jpeg","image/gif","image/webp"]),oe="Not connected";var v=y({module:"mcp"});function d(e){return e.replace(/[^a-zA-Z0-9_]/g,"_")}function F(e){return`${a}${d(e)}${"__"}`}function f(e,t){return F(e)+d(t)}var k=class{name;description;category="command";deferred=!0;mcpServerName;client;originalName;inputSchema;constructor(t,o,r){this.name=f(o,r.name),this.description=r.description,this.originalName=r.name,this.client=t,this.inputSchema=r.inputSchema,this.mcpServerName=o}mcpInputSchema(){return this.inputSchema??{}}setDeferLoading(t){this.deferred=t}schema(){return{name:this.name,description:this.description,input_schema:this.inputSchema}}async execute(t,o){try{return await this.client.callTool(this.originalName,o,t.abortSignal)}catch(r){return v.error({err:r},"mcp operation failed"),{output:`MCP tool error: ${O(r)}`,isError:!0}}}};function ce(e,t,o){switch(e){case"explicit":return`Command running in background (task_id: ${t}). You will be notified when it completes; do not poll. Use TaskStop with task_id to kill it early.`;case"timeout":return`Command exceeded its ${String(o)}s timeout and was moved to the background (task_id: ${t}). It is still running \u2014 you will be notified when it completes.`;case"user":return`Command was manually backgrounded by the user (task_id: ${t}). It is still running \u2014 you will be notified when it completes.`}}var A="Git: commit or push only when requested. Destructive operations (push --force, reset --hard, checkout ., clean -f, branch -D), amending, or skipping hooks/signing require explicit authorization; never bypass permission/hook denials. Prefer new commits. When committing, include Co-Authored-By: Yukino <usr161043261@outlook.com>.",le=`Execute command in Bash; return stdout and stderr. Prefer PowerShell on Windows.
5
5
  - timeout is in seconds: default 120, maximum 600. Each call starts a fresh, independent shell in the Agent's working directory; cd, variables, functions, and options do not persist.
6
6
  - Quote paths with spaces. To change directory, use cd "path" && command in the same call. Separate independent commands; chain dependent commands with &&, not ;.
7
7
  - Prefer dedicated file/search tools over cat, head, tail, sed, awk, echo, or find. Scope searches to a directory, never the filesystem root. Diagnose failures rather than retrying in sleep loops.
8
- ${b}`,pe="- Set run_in_background to true to run the command in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll or sleep waiting for it. Use this for long-running commands you do not need the result of right away. Use TaskStop with the task_id to kill a background command early. A foreground command that exceeds its timeout is moved to the background automatically instead of being killed.",ue="Shell command to execute",de=`Execute command in PowerShell; return stdout and stderr. Recommended on Windows (powershell.exe); uses pwsh elsewhere.
8
+ ${A}`,pe="- Set run_in_background to true to run the command in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll or sleep waiting for it. Use this for long-running commands you do not need the result of right away. Use TaskStop with the task_id to kill a background command early. A foreground command that exceeds its timeout is moved to the background automatically instead of being killed.",ue="Shell command to execute",de=`Execute command in PowerShell; return stdout and stderr. Recommended on Windows (powershell.exe); uses pwsh elsewhere.
9
9
  - timeout is in seconds: default 120, maximum 600. Each call starts a fresh, independent shell in the Agent's working directory; location, variables, and options do not persist.
10
10
  - Quote paths with spaces; use Set-Location -LiteralPath "path" in the same call. Separate independent commands. For dependencies, check $LASTEXITCODE for native commands and use -ErrorAction Stop for cmdlets; ; does not stop on failure. Do not assume PowerShell 7 syntax.
11
11
  - Prefer dedicated file/search tools over Get-Content, Select-String, or Write-Output. Scope recursion to a directory, not a drive root. Diagnose failures rather than retrying in Start-Sleep loops.
12
- ${b}`,me="- Set run_in_background to true to run the command in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll or Start-Sleep waiting for it. Use this for long-running commands you do not need the result of right away. Use TaskStop with the task_id to kill a background command early. A foreground command that exceeds its timeout is moved to the background automatically instead of being killed.",he="PowerShell command to execute",ge="Timeout in seconds (max 600)",fe="Run the command in the background. Returns a task ID immediately; the result arrives later as a task notification.",_e=`Read text with 1-based display line numbers, or images (png, jpg, jpeg, gif, webp) as visual content; not directories.
12
+ ${A}`,me="- Set run_in_background to true to run the command in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll or Start-Sleep waiting for it. Use this for long-running commands you do not need the result of right away. Use TaskStop with the task_id to kill a background command early. A foreground command that exceeds its timeout is moved to the background automatically instead of being killed.",he="PowerShell command to execute",ge="Timeout in seconds (max 600)",fe="Run the command in the background. Returns a task ID immediately; the result arrives later as a task notification.",_e=`Read text with 1-based display line numbers, or images (png, jpg, jpeg, gif, webp) as visual content; not directories.
13
13
  - file_path is absolute or relative to the Agent's working directory. offset skips lines (0-based, default 0); limit defaults to 2000 lines, with a 50KB text output cap. Displayed line 101 starts at offset=100. Follow continuation/readback instructions for partial output.
14
14
  - Images ignore offset/limit. A successful read refreshes the file-state cache used by EditFile/WriteFile; re-read after an external-change error.`,Te="File path, absolute or relative to the Agent's working directory. Supports text and image files.",ye="Number of text lines to skip (0-based). Use 0 for the first line, 100 for displayed line 101. Ignored for images.",Ee="Maximum number of text lines to return (default 2000), subject to a 50KB output limit. Ignored for images.",Ie=`Replace exact text in an existing file and return a diff. Prefer this over whole-file rewrites; batch disjoint changes in one edits array to read and write the file once.
15
15
  - file_path is absolute or relative to the Agent's working directory. ReadFile is required first; stale file-state errors require a fresh read and revised edit.
@@ -17,7 +17,7 @@ ${b}`,me="- Set run_in_background to true to run the command in the background.
17
17
  - old_string must be non-empty and unique unless replace_all=true (default false). LF and CRLF line endings match equivalently. Use enough context to disambiguate; preserve all other whitespace and exclude display line numbers. If matching fails, stray carriage returns in both edit strings are removed before retrying.
18
18
  - new_string must differ from old_string; an empty string deletes the match. The file's line endings and unchanged text are preserved.`,Re="Path to the existing file, absolute or relative to the Agent's working directory. Read it first with ReadFile.",Se="Targeted replacements matched against the original file. Batch disjoint changes in one call; overlapping edits are rejected before writing.",Ce="Non-empty text from the original file, without ReadFile line-number prefixes. LF and CRLF line endings match equivalently; all other whitespace must match exactly. If matching fails, stray carriage returns in the edit strings are removed and matching is retried. Must be unique unless replace_all is true.",Oe="Replacement text. An empty string deletes the match. The file's line endings are preserved.",xe="Replace all occurrences (default false)",Pe=`Write complete UTF-8 content to file_path, creating parent directories and overwriting existing content. Use for new files or complete rewrites; prefer EditFile for targeted changes.
19
19
  - file_path is absolute or relative to the Agent's working directory. Existing files require ReadFile first; re-read if the cached state is stale.
20
- - content includes any desired trailing newline; an empty string creates or truncates an empty file. Avoid unrelated files or unsolicited documentation.`,ke="File path, absolute or relative to the Agent's working directory. Missing parent directories are created; existing files must be read first.",be="Complete UTF-8 file contents. Replaces all existing content; an empty string creates or truncates an empty file.",Ae=`Find files by glob pattern (e.g. "**/*.ts", "*.{ts,tsx}"). Return paths relative to path, sorted newest modification first.
20
+ - content includes any desired trailing newline; an empty string creates or truncates an empty file. Avoid unrelated files or unsolicited documentation.`,ke="File path, absolute or relative to the Agent's working directory. Missing parent directories are created; existing files must be read first.",Ae="Complete UTF-8 file contents. Replaces all existing content; an empty string creates or truncates an empty file.",be=`Find files by glob pattern (e.g. "**/*.ts", "*.{ts,tsx}"). Return paths relative to path, sorted newest modification first.
21
21
  - path is absolute or relative to the Agent's working directory (default "."); never search the filesystem root.
22
22
  - Includes dotfiles; traversal skips fixed directories such as .git, .agents, .yukino, node_modules, dist, and __pycache__, not rules from .gitignore.
23
23
  - At most 1000 matches; narrow limited searches rather than treating them as exhaustive. Prefer this over shell find/ls.`,Ne="Filename glob relative to path, e.g. '**/*.ts' for recursive search or '*.{ts,tsx}' for direct children.",we="Search base, absolute or relative to the Agent's working directory (default '.'). Returned filenames are relative to this base.",De=`Search file content with a case-insensitive, line-by-line JavaScript-style regex pattern; return file:line:content with 1-based lines and working-directory-relative paths.
@@ -32,4 +32,4 @@ ${b}`,me="- Set run_in_background to true to run the command in the background.
32
32
  Set multiSelect=true when the user may choose multiple options, or false for one mutually exclusive choice. Ask only for missing information that changes the task; do not re-request authorization already given.
33
33
  `,He="question",je="The question to ask",Ge="options",qe="label",We="description",Ke="Set to true for multiple-choice, false for single-choice",Xe=`Use this tool proactively before a non-trivial implementation when the right approach is genuinely unclear and user review would prevent significant rework. It runs the built-in plan agent synchronously in the foreground with a fork of your conversation. The read-only agent investigates and returns a concrete plan; the host saves the plan and presents it for user approval. A successful call ends this turn. Do not implement until the user approves.
34
34
 
35
- Use it for significant architectural ambiguity, unclear requirements that require exploration, or high-impact restructuring. Skip it when the task is straightforward, the user has already specified the implementation, the fix is obvious after diagnosis, or the request is pure research. Do not use it from delegated agents. This tool takes no parameters.`,Ye="Submit the completed plan from the plan file. The main agent presents it for user approval; a teammate follows the host's team approval policy (leader review in coordinator mode, automatic approval otherwise); a one-shot subagent returns it to the parent. Do not implement until the host approves execution.",$e="Create an isolated git worktree and switch this agent's working directory into it. Use only when the user explicitly requests a worktree. Only one worktree session may be active at a time. The optional slug is generated randomly when omitted. Use ExitWorktree to return to the original directory.",ze="Exit this agent's active EnterWorktree session and restore its original working directory. Use only when the user asks to leave the worktree. With no active session this is a no-op. Use action: keep to preserve the worktree and branch, or remove to delete both. Removal refuses uncommitted files, new commits, or unverifiable state unless discard_changes is true. If removal is refused, confirm with the user before retrying with discard_changes: true. Manually created worktrees and worktrees from other runtimes are never adopted.",Je="Optional worktree identifier and branch suffix, using letters, digits, hyphens, or underscores. A random slug is generated when omitted.",Qe='"keep" preserves the worktree and branch; "remove" deletes both.',Ve="Explicitly allow discarding uncommitted files and new commits, or removing when changes cannot be verified. Confirm with the user before setting true. Only applies to remove.",Ze="Get the user-set persistent goal, or report in_progress, complete, or blocked with a reason. A goal is active automatically when the user sets it; in_progress reports progress and resets the blocker audit while keeping it active. Only the user can set, replace, pause, resume, or clear goals. Complete only when all requirements are achieved and verified. Record the same blocker on three consecutive continuation turns before stopping; multiple calls in one turn count once.",et="Read goal status, or report progress, completion, or blockage.",tt="Required for update. Use in_progress to report progress and reset the blocker audit on an active goal, complete when verified, or blocked for an unavoidable blocker.",ot="Required for update. Describe progress, evidence of completion, or the specific blocker.",rt="Query a configured language server for definitions, references, hover, symbols, implementations, type definitions, call hierarchy, or diagnostics. file_path resolves against the current working directory; line and character are 1-based UTF-16 positions. Returned ranges use the LSP standard (0-based UTF-16) and file URIs. This tool cannot edit files or run arbitrary commands. Servers must be explicitly configured in lsp_servers; no automatic installation.",A="Invoke a tool on a connected MCP server. Call ToolSearch first to load the tool's schema, then pass its arguments here exactly as that schema requires, using the same JSON types.",N="MCP server name, e.g. 'linear'.",w="Full tool name as returned by ToolSearch, e.g. 'mcp__linear__create_issue'.",D="The target tool's arguments. Must match that tool's input_schema exactly, including JSON types: bare numbers for integer fields, bare true/false for boolean fields, quoted strings for string fields, and plain JSON arrays for array fields.",nt="Return structured output in JSON format. Use this tool to return your final response as structured data in non-interactive or coordinator mode sessions.",st="The structured result: an object, an array, or a plain string",it="Inspect a background Agent/Bash/PowerShell task by its task_id, or wait once for at most timeout_ms (maximum 60000). This does not consume completion notifications or cancel timed-out tasks. Prefer automatic task notifications over repeated polling. TodoWrite item IDs belong to the separate TODO board and cannot be used here.",at="Search for and load deferred tools by name or keyword.",ct='Search query. Use "select:name1,name2" to load specific tools by name, or keywords to search.',lt="Max results to return",pt="OpenAI-style action type: click (button, x, y, keys), double_click (x, y, keys), drag (path, keys), keypress (keys), move (x, y, keys), screenshot, scroll (x, y, scrollX, scrollY, keys), type (text), wait.",ut="Anthropic-style single computer action. Send either action or actions, not both.",dt="OpenAI-style ordered batch of computer actions, executed in sequence; a screenshot is returned after the batch.",mt="Button for type=click.",ht="Keys held during the action, or pressed by keypress.",gt="Drag path for type=drag.",ft="Horizontal scroll delta for type=scroll.",_t="Vertical scroll delta for type=scroll.",Tt="Text to type for type=type.",yt="OpenAI-style safety checks raised with the batch; acknowledged in the tool result.",Et="OpenAI-style status of the computer call; echoed in the tool result.",It="Anthropic-style [x, y] coordinate in the latest screenshot space.",Rt="Seconds for hold_key or wait.",St="Zoom region [x1, y1, x2, y2] in the latest screenshot space.",Ct="Anthropic-style number of wheel clicks to scroll.",Ot="Anthropic-style drag start coordinate.",xt="Text to type, or a '+'-separated key combination.",Pt="OpenAI-style x coordinate.",kt="OpenAI-style y coordinate.",bt="Button for action=click.",At="OpenAI-style keys held during an action or pressed by keypress.",Nt="OpenAI-style drag path.",wt="OpenAI-style horizontal scroll delta.",Dt="OpenAI-style vertical scroll delta.";function Mt(e){return`Control the current ${e} computer with screenshots, mouse, keyboard, scrolling, waiting, and zoom. Use screenshot before choosing coordinates and verify consequential actions with another screenshot. Two call styles are supported: Anthropic-style single actions (action + coordinate/scroll_amount/scroll_direction/start_coordinate/region/text), and OpenAI-style batches (actions[] of typed actions with x/y/button/keys/path/scrollX/scrollY/text, plus pendingSafetyChecks and status; a screenshot is returned after the batch). Flat OpenAI aliases (action=click/drag/keypress/move) are also accepted.`}function B(e,t){if(t==="string"&&typeof e=="number"&&Number.isFinite(e))return String(e);if((t==="integer"||t==="number")&&typeof e=="string"){let o=e.trim();if(o===""||!(t==="integer"?I:R).test(o))return e;let s=t==="integer"?Number.parseInt(o,10):Number.parseFloat(o);return Number.isFinite(s)?s:e}if(t==="boolean"&&typeof e=="string"){let o=e.trim().toLowerCase();if(o==="true")return!0;if(o==="false")return!1}return e}function _(e,t){if(typeof t!="object"||t===null)return e;let o=p(t),r=l(o,"type","");if(r==="object"&&typeof e=="object"&&e!==null&&!Array.isArray(e)){let s=p(o.properties??{}),n={};for(let[i,c]of Object.entries(p(e))){let m=Object.hasOwn(s,i)?_(c,s[i]):c;i==="__proto__"?Object.defineProperty(n,i,{value:m,writable:!0,enumerable:!0,configurable:!0}):n[i]=m}return n}if(r==="array"){let s=o.items??{},n=e;if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let i=Object.values(n);i.length===1&&Array.isArray(i[0])&&(n=i[0])}else typeof n=="string"&&(n=n.split(",").map(i=>i.trim()).filter(i=>i!==""));return Array.isArray(n)?n.map(i=>_(i,s)):n}return r!==""?B(e,r):e}function jt(e,t){return t.startsWith(a)?t.slice(a.length):d(e)+"__"+d(t)}function T(e){return"mcpInputSchema"in e&&typeof e.mcpInputSchema=="function"}var M=class{constructor(t){this.registry=t}registry;name="McpCall";description=A;category="command";deferred=!1;schema(){return{name:this.name,description:this.description,input_schema:{type:"object",properties:{server:{type:"string",description:N},tool:{type:"string",description:w},arguments:{type:"object",description:D}},required:["server","tool","arguments"]}}}resolveTarget(t){let o=l(t,"server"),r=l(t,"tool");if(!o||!r)return;let s=r.startsWith(a)?r:f(o,r),n=this.registry.get(s);return n&&T(n)&&n.mcpServerName===o?n:void 0}availableNames(){return this.registry.listTools().filter(t=>t.name.startsWith(a)).map(t=>t.name).sort()}prepareArguments(t){let o=this.resolveTarget(t);return!o||typeof t.arguments!="object"||t.arguments===null||Array.isArray(t.arguments)?t:{...t,arguments:_(t.arguments,o.mcpInputSchema())}}async execute(t,o){let r=l(o,"server",""),s=l(o,"tool","");if(s==="")return{output:S,isError:!0};let n=this.resolveTarget(o);if(!n){let c=this.availableNames(),m=c.length>0?c.join(", "):"(none connected)";return{output:`Unknown MCP tool '${s}' on server '${r}'. Available tools: ${m}`,isError:!0}}if(typeof o.arguments!="object"||o.arguments===null||Array.isArray(o.arguments))return{output:C,isError:!0};let i=p(this.prepareArguments(o).arguments);return t.abortSignal?.throwIfAborted(),n.execute(t,i)}};function G(e){if(!e)return!0;try{return P.has(new URL(e).hostname.toLowerCase())}catch{return!1}}function q(e){return Math.floor(e/2.5)}function W(e,t,o,r,s="auto",n=10){if(s!=="auto")return s==="native"&&t!=="anthropic"?"dispatch":s;if(r<=0)return"eager";let i=o*n/100;return q(r)<i?"eager":t==="anthropic"&&G(e)?"native":"dispatch"}function K(e){let t=0;for(let o of e.listTools())if(o.name.startsWith(a))try{t+=JSON.stringify(o.schema()).length}catch{t+=o.name.length+(o.description?.length??0)}return t}function X(e,t){e.mcpLoadingMode=t;let o=t==="eager";for(let r of e.listTools())T(r)&&typeof r.setDeferLoading=="function"&&r.setDeferLoading(!o);e.exposeToolSearch=!o,e.exposeMcpCall=t==="dispatch"}function Kt(e,t,o,r,s="auto"){let n=W(t,o,r,K(e),s);return X(e,n),n}export{$ as a,J as b,a as c,Q as d,V as e,Z as f,ee as g,te as h,oe as i,f as j,k,ce as l,le as m,pe as n,ue as o,de as p,me as q,he as r,ge as s,fe as t,_e as u,Te as v,ye as w,Ee as x,Ie as y,Re as z,Se as A,Ce as B,Oe as C,xe as D,Pe as E,ke as F,be as G,Ae as H,Ne as I,we as J,De as K,Me as L,Le as M,Ue as N,ve as O,Fe as P,Be as Q,He as R,je as S,Ge as T,qe as U,We as V,Ke as W,Xe as X,Ye as Y,$e as Z,ze as _,Je as $,Qe as aa,Ve as ba,Ze as ca,et as da,tt as ea,ot as fa,rt as ga,nt as ha,st as ia,it as ja,at as ka,ct as la,lt as ma,pt as na,ut as oa,dt as pa,mt as qa,ht as ra,gt as sa,ft as ta,_t as ua,Tt as va,yt as wa,Et as xa,It as ya,Rt as za,St as Aa,Ct as Ba,Ot as Ca,xt as Da,Pt as Ea,kt as Fa,bt as Ga,At as Ha,Nt as Ia,wt as Ja,Dt as Ka,Mt as La,jt as Ma,M as Na,G as Oa,X as Pa,Kt as Qa};
35
+ Use it for significant architectural ambiguity, unclear requirements that require exploration, or high-impact restructuring. Skip it when the task is straightforward, the user has already specified the implementation, the fix is obvious after diagnosis, or the request is pure research. Do not use it from delegated agents. This tool takes no parameters.`,Ye="Submit the completed plan from the plan file. The main agent presents it for user approval; a teammate follows the host's team approval policy (leader review in coordinator mode, automatic approval otherwise); a one-shot subagent returns it to the parent. Do not implement until the host approves execution.",$e="Create an isolated git worktree and switch this agent's working directory into it. Use only when the user explicitly requests a worktree. Only one worktree session may be active at a time. The optional slug is generated randomly when omitted. Use ExitWorktree to return to the original directory.",ze="Exit this agent's active EnterWorktree session and restore its original working directory. Use only when the user asks to leave the worktree. With no active session this is a no-op. Use action: keep to preserve the worktree and branch, or remove to delete both. Removal refuses uncommitted files, new commits, or unverifiable state unless discard_changes is true. If removal is refused, confirm with the user before retrying with discard_changes: true. Manually created worktrees and worktrees from other runtimes are never adopted.",Je="Optional worktree identifier and branch suffix, using letters, digits, hyphens, or underscores. A random slug is generated when omitted.",Qe='"keep" preserves the worktree and branch; "remove" deletes both.',Ve="Explicitly allow discarding uncommitted files and new commits, or removing when changes cannot be verified. Confirm with the user before setting true. Only applies to remove.",Ze="Get the user-set persistent goal, or report in_progress, complete, or blocked with a reason. A goal is active automatically when the user sets it; in_progress reports progress and resets the blocker audit while keeping it active. Only the user can set, replace, pause, resume, or clear goals. Complete only when all requirements are achieved and verified. Record the same blocker on three consecutive continuation turns before stopping; multiple calls in one turn count once.",et="Read goal status, or report progress, completion, or blockage.",tt="Required for update. Use in_progress to report progress and reset the blocker audit on an active goal, complete when verified, or blocked for an unavoidable blocker.",ot="Required for update. Describe progress, evidence of completion, or the specific blocker.",b="Invoke a tool on a connected MCP server. Call ToolSearch first to load the tool's schema, then pass its arguments here exactly as that schema requires, using the same JSON types.",N="MCP server name, e.g. 'linear'.",w="Full tool name as returned by ToolSearch, e.g. 'mcp__linear__create_issue'.",D="The target tool's arguments. Must match that tool's input_schema exactly, including JSON types: bare numbers for integer fields, bare true/false for boolean fields, quoted strings for string fields, and plain JSON arrays for array fields.",rt="Return structured output in JSON format. Use this tool to return your final response as structured data in non-interactive or coordinator mode sessions.",nt="The structured result: an object, an array, or a plain string",st="Inspect a background Agent/Bash/PowerShell task by its task_id, or wait once for at most timeout_ms (maximum 60000). This does not consume completion notifications or cancel timed-out tasks. Prefer automatic task notifications over repeated polling. TodoWrite item IDs belong to the separate TODO board and cannot be used here.",it="Search for and load deferred tools by name or keyword.",at='Search query. Use "select:name1,name2" to load specific tools by name, or keywords to search.',ct="Max results to return",lt="OpenAI-style action type: click (button, x, y, keys), double_click (x, y, keys), drag (path, keys), keypress (keys), move (x, y, keys), screenshot, scroll (x, y, scrollX, scrollY, keys), type (text), wait.",pt="Anthropic-style single computer action. Send either action or actions, not both.",ut="OpenAI-style ordered batch of computer actions, executed in sequence; a screenshot is returned after the batch.",dt="Button for type=click.",mt="Keys held during the action, or pressed by keypress.",ht="Drag path for type=drag.",gt="Horizontal scroll delta for type=scroll.",ft="Vertical scroll delta for type=scroll.",_t="Text to type for type=type.",Tt="OpenAI-style safety checks raised with the batch; acknowledged in the tool result.",yt="OpenAI-style status of the computer call; echoed in the tool result.",Et="Anthropic-style [x, y] coordinate in the latest screenshot space.",It="Seconds for hold_key or wait.",Rt="Zoom region [x1, y1, x2, y2] in the latest screenshot space.",St="Anthropic-style number of wheel clicks to scroll.",Ct="Anthropic-style drag start coordinate.",Ot="Text to type, or a '+'-separated key combination.",xt="OpenAI-style x coordinate.",Pt="OpenAI-style y coordinate.",kt="Button for action=click.",At="OpenAI-style keys held during an action or pressed by keypress.",bt="OpenAI-style drag path.",Nt="OpenAI-style horizontal scroll delta.",wt="OpenAI-style vertical scroll delta.";function Dt(e){return`Control the current ${e} computer with screenshots, mouse, keyboard, scrolling, waiting, and zoom. Use screenshot before choosing coordinates and verify consequential actions with another screenshot. Two call styles are supported: Anthropic-style single actions (action + coordinate/scroll_amount/scroll_direction/start_coordinate/region/text), and OpenAI-style batches (actions[] of typed actions with x/y/button/keys/path/scrollX/scrollY/text, plus pendingSafetyChecks and status; a screenshot is returned after the batch). Flat OpenAI aliases (action=click/drag/keypress/move) are also accepted.`}function B(e,t){if(t==="string"&&typeof e=="number"&&Number.isFinite(e))return String(e);if((t==="integer"||t==="number")&&typeof e=="string"){let o=e.trim();if(o===""||!(t==="integer"?I:R).test(o))return e;let s=t==="integer"?Number.parseInt(o,10):Number.parseFloat(o);return Number.isFinite(s)?s:e}if(t==="boolean"&&typeof e=="string"){let o=e.trim().toLowerCase();if(o==="true")return!0;if(o==="false")return!1}return e}function _(e,t){if(typeof t!="object"||t===null)return e;let o=p(t),r=l(o,"type","");if(r==="object"&&typeof e=="object"&&e!==null&&!Array.isArray(e)){let s=p(o.properties??{}),n={};for(let[i,c]of Object.entries(p(e))){let m=Object.hasOwn(s,i)?_(c,s[i]):c;i==="__proto__"?Object.defineProperty(n,i,{value:m,writable:!0,enumerable:!0,configurable:!0}):n[i]=m}return n}if(r==="array"){let s=o.items??{},n=e;if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let i=Object.values(n);i.length===1&&Array.isArray(i[0])&&(n=i[0])}else typeof n=="string"&&(n=n.split(",").map(i=>i.trim()).filter(i=>i!==""));return Array.isArray(n)?n.map(i=>_(i,s)):n}return r!==""?B(e,r):e}function Ht(e,t){return t.startsWith(a)?t.slice(a.length):d(e)+"__"+d(t)}function T(e){return"mcpInputSchema"in e&&typeof e.mcpInputSchema=="function"}var M=class{constructor(t){this.registry=t}registry;name="McpCall";description=b;category="command";deferred=!1;schema(){return{name:this.name,description:this.description,input_schema:{type:"object",properties:{server:{type:"string",description:N},tool:{type:"string",description:w},arguments:{type:"object",description:D}},required:["server","tool","arguments"]}}}resolveTarget(t){let o=l(t,"server"),r=l(t,"tool");if(!o||!r)return;let s=r.startsWith(a)?r:f(o,r),n=this.registry.get(s);return n&&T(n)&&n.mcpServerName===o?n:void 0}availableNames(){return this.registry.listTools().filter(t=>t.name.startsWith(a)).map(t=>t.name).sort()}prepareArguments(t){let o=this.resolveTarget(t);return!o||typeof t.arguments!="object"||t.arguments===null||Array.isArray(t.arguments)?t:{...t,arguments:_(t.arguments,o.mcpInputSchema())}}async execute(t,o){let r=l(o,"server",""),s=l(o,"tool","");if(s==="")return{output:S,isError:!0};let n=this.resolveTarget(o);if(!n){let c=this.availableNames(),m=c.length>0?c.join(", "):"(none connected)";return{output:`Unknown MCP tool '${s}' on server '${r}'. Available tools: ${m}`,isError:!0}}if(typeof o.arguments!="object"||o.arguments===null||Array.isArray(o.arguments))return{output:C,isError:!0};let i=p(this.prepareArguments(o).arguments);return t.abortSignal?.throwIfAborted(),n.execute(t,i)}};function G(e){if(!e)return!0;try{return P.has(new URL(e).hostname.toLowerCase())}catch{return!1}}function q(e){return Math.floor(e/2.5)}function W(e,t,o,r,s="auto",n=10){if(s!=="auto")return s==="native"&&t!=="anthropic"?"dispatch":s;if(r<=0)return"eager";let i=o*n/100;return q(r)<i?"eager":t==="anthropic"&&G(e)?"native":"dispatch"}function K(e){let t=0;for(let o of e.listTools())if(o.name.startsWith(a))try{t+=JSON.stringify(o.schema()).length}catch{t+=o.name.length+(o.description?.length??0)}return t}function X(e,t){e.mcpLoadingMode=t;let o=t==="eager";for(let r of e.listTools())T(r)&&typeof r.setDeferLoading=="function"&&r.setDeferLoading(!o);e.exposeToolSearch=!o,e.exposeMcpCall=t==="dispatch"}function Wt(e,t,o,r,s="auto"){let n=W(t,o,r,K(e),s);return X(e,n),n}export{$ as a,J as b,a as c,Q as d,V as e,Z as f,ee as g,te as h,oe as i,f as j,k,ce as l,le as m,pe as n,ue as o,de as p,me as q,he as r,ge as s,fe as t,_e as u,Te as v,ye as w,Ee as x,Ie as y,Re as z,Se as A,Ce as B,Oe as C,xe as D,Pe as E,ke as F,Ae as G,be as H,Ne as I,we as J,De as K,Me as L,Le as M,Ue as N,ve as O,Fe as P,Be as Q,He as R,je as S,Ge as T,qe as U,We as V,Ke as W,Xe as X,Ye as Y,$e as Z,ze as _,Je as $,Qe as aa,Ve as ba,Ze as ca,et as da,tt as ea,ot as fa,rt as ga,nt as ha,st as ia,it as ja,at as ka,ct as la,lt as ma,pt as na,ut as oa,dt as pa,mt as qa,ht as ra,gt as sa,ft as ta,_t as ua,Tt as va,yt as wa,Et as xa,It as ya,Rt as za,St as Aa,Ct as Ba,Ot as Ca,xt as Da,Pt as Ea,kt as Fa,At as Ga,bt as Ha,Nt as Ia,wt as Ja,Dt as Ka,Ht as La,M as Ma,G as Na,X as Oa,Wt as Pa};