@yukino.js/yukino 0.0.15 → 0.0.16

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 (57) hide show
  1. package/README.md +11 -9
  2. package/dist/anthropic-M6YBGTW2.js +4 -0
  3. package/dist/browser/dist/index.html +2 -2
  4. package/dist/browser/dist/static/chunk-OR5FHECQ.js +1 -0
  5. package/dist/browser/dist/static/highlight-AZCRQTGM.js +152 -0
  6. package/dist/browser/dist/static/index.css +1 -1
  7. package/dist/browser/dist/static/index.js +69 -67
  8. package/dist/chunk-3O2CPTOD.js +5 -0
  9. package/dist/chunk-5DGLAJ3U.js +8 -0
  10. package/dist/{chunk-NSNTZXFL.js → chunk-BOZOXLKL.js} +1 -1
  11. package/dist/chunk-CUCQV3CL.js +4 -0
  12. package/dist/chunk-H7DHVEP7.js +30 -0
  13. package/dist/chunk-JL3K6GYG.js +114 -0
  14. package/dist/chunk-MHRZYJJO.js +4 -0
  15. package/dist/chunk-Q6PJ2RD6.js +988 -0
  16. package/dist/chunk-SA7KQIVH.js +371 -0
  17. package/dist/{chunk-CWWRUTF2.js → chunk-SX477ANO.js} +1 -1
  18. package/dist/{chunk-MDPSQ6L7.js → chunk-UDDADKJP.js} +1 -1
  19. package/dist/chunk-WGRGSG2J.js +65 -0
  20. package/dist/{chunk-DVB57IVG.js → chunk-XKLTUIST.js} +1 -1
  21. package/dist/lib/{anthropic-SQBOFRPQ.js → anthropic-2P54PIDT.js} +4 -4
  22. package/dist/lib/{chunk-WXR5HNB4.js → chunk-3HK5RKES.js} +1 -137
  23. package/dist/lib/{chunk-WNGF7243.js → chunk-3QG36U3U.js} +216 -8
  24. package/dist/lib/{chunk-XS3GONYN.js → chunk-7JP46P5T.js} +4 -1
  25. package/dist/lib/{chunk-U3OT4POQ.js → chunk-LU6NOWNY.js} +5 -5
  26. package/dist/lib/{chunk-IHVYAEY2.js → chunk-NCMYMV2M.js} +341 -96
  27. package/dist/lib/{chunk-AW2577J5.js → chunk-NYPUPN23.js} +2 -2
  28. package/dist/lib/{chunk-GPJL4PLE.js → chunk-OEX5PMME.js} +2 -2
  29. package/dist/lib/index.d.ts +540 -397
  30. package/dist/lib/index.js +2671 -1549
  31. package/dist/lib/{openai-UV4KFNQV.js → openai-7NAYCBDV.js} +3 -3
  32. package/dist/lib/{providers-77VBEX3K.js → providers-YRINFWH2.js} +2 -2
  33. package/dist/lib/{tool-filter-MLYQGWM5.js → tool-filter-LYVHXM4N.js} +3 -3
  34. package/dist/{main-653YZQHY.js → main-J7UMFVZ5.js} +221 -233
  35. package/dist/main.js +30 -3
  36. package/dist/{node-634LOHDX.js → node-4OJDE7P6.js} +1 -1
  37. package/dist/{openai-FKLMHNNC.js → openai-HCAV4QMK.js} +1 -1
  38. package/dist/{providers-4IU7SUEQ.js → providers-SPLB2SQZ.js} +1 -1
  39. package/dist/{server-4NHV4RJL.js → server-HBQZYHGG.js} +1 -1
  40. package/dist/server-R4SJR6ZG.js +15 -0
  41. package/dist/stdio-INHOYWG6.js +5 -0
  42. package/dist/{tool-filter-LJTLMGFP.js → tool-filter-GPC6HF2N.js} +1 -1
  43. package/dist/websocket-KLVXQWQZ.js +9 -0
  44. package/package.json +2 -2
  45. package/dist/a2a-ANR7PFD4.js +0 -15
  46. package/dist/acp-4E7R254I.js +0 -14
  47. package/dist/anthropic-ZO73YJFY.js +0 -4
  48. package/dist/chunk-3RH3COZW.js +0 -365
  49. package/dist/chunk-B2RNOTT5.js +0 -4
  50. package/dist/chunk-C56EKYBO.js +0 -4
  51. package/dist/chunk-CW6G3RYM.js +0 -4
  52. package/dist/chunk-F3JTT3TI.js +0 -110
  53. package/dist/chunk-HWCLMDQF.js +0 -28
  54. package/dist/chunk-IOMQY54U.js +0 -967
  55. package/dist/chunk-LTMY67B2.js +0 -5
  56. package/dist/chunk-W4GMCNWF.js +0 -65
  57. package/dist/slim-Q56GHZZP.js +0 -11
package/README.md CHANGED
@@ -14,7 +14,7 @@ Beyond interactive use, Yukino supports a non-interactive print mode for scripti
14
14
 
15
15
  - Multi-provider LLM support with Anthropic (Anthropic Messages), OpenAI (OpenAI Responses), and OpenAI-compatible (OpenAI Chat Completions) protocols
16
16
  - Interactive terminal UI with streaming text, thinking indicators, and tool execution display
17
- - Built-in tool set: ReadFile, WriteFile, EditFile, Bash, PowerShell, Glob, Grep, WebFetch, WebSearch, LSP, ComputerUse, ToolSearch, McpCall, EnterWorktree, ExitWorktree, ExitPlanMode, Goal, the TaskCreate/TaskGet/TaskList/TaskUpdate and TodoWrite tracking tools, plus Agent, LoadSkill, InstallSkill, AskUserQuestion, SyntheticOutput, TeamCreate, SendMessage, TeamDelete, TaskOutput, and TaskStop
17
+ - Built-in tool set: ReadFile, WriteFile, EditFile, Bash, PowerShell, Glob, Grep, WebFetch, LSP, ComputerUse, ToolSearch, McpCall, EnterWorktree, ExitWorktree, ExitPlanMode, Goal, the TaskCreate/TaskGet/TaskList/TaskUpdate and TodoWrite tracking tools, plus Agent, LoadSkill, InstallSkill, AskUserQuestion, SyntheticOutput, TeamCreate, SendMessage, TeamDelete, TaskOutput, and TaskStop
18
18
  - MCP (Model Context Protocol) server integration for extending the tool set with external services
19
19
  - Permission system with four modes: default, acceptEdits, plan (read-only), and bypassPermissions
20
20
  - Sandbox support for isolated command execution (bwrap on Linux, seatbelt on macOS)
@@ -214,7 +214,7 @@ Print, remote, ACP, and A2A modes require at least one configured provider; the
214
214
  ```yaml
215
215
  # Initial permission mode. Enum: default (ask per write/command) | acceptEdits (auto-approve
216
216
  # file edits) | bypassPermissions (approve everything).
217
- # Other values fall back to default. Shift+Tab cycles these modes; only /plan enters plan mode.
217
+ # Other values fall back to default. Shift+Tab cycles these modes and plan mode.
218
218
  permission_mode: bypassPermissions
219
219
 
220
220
  # Model providers. At least one is required.
@@ -462,7 +462,7 @@ In addition to `mcp_servers` in `config.yaml`, Yukino reads a project-level `.mc
462
462
 
463
463
  Each entry takes `command`/`args`/`env` (stdio) or `url`/`headers` with `type` of `http` or `sse`. Environment references support `${VAR}`, `${VAR:-default}`, and `$VAR` in commands, arguments, environment values, URLs, and headers; an unset variable without a default prevents that server from connecting. These servers are merged with the user-level `mcp_servers`; on a name collision the user-level entry wins. At startup, a malformed `.mcp.json` is ignored (logged), while an invalid individual server entry is skipped without disabling valid siblings. During `/mcp reload`, invalid config aborts the reload so the current connections remain intact.
464
464
 
465
- After editing `.mcp.json` or `config.yaml`, use `/mcp reload` in the UI to re-read both sources. Unchanged connections stay live, removed servers disconnect, new servers connect, and servers whose settings changed restart.
465
+ After editing `.mcp.json` or `config.yaml`, use `/mcp reload` in the UI to re-read both sources. The reload is a full reset: every current connection is dropped, then the freshly read list is connected from scratch.
466
466
 
467
467
  ### Language servers (LSP)
468
468
 
@@ -507,14 +507,12 @@ An explicit `run_in_background: false` overrides a predefined agent's `backgroun
507
507
 
508
508
  Persistent teammates become idle after each turn. They keep conversation and private checklist context for follow-up assignments, but must send findings with `SendMessage`; final text is not automatically forwarded to the leader. They exit on explicit shutdown, cancellation, failure, or loss of the leader. Exit clears live permission/cancellation references, releases owned tools, and resets unfinished owned tasks to unassigned/pending. Completed and cancelled records remain intact. Teammate task ownership is not released merely because a turn becomes idle.
509
509
 
510
- The team retains at most 200 terminated member summaries; running and idle members are never evicted. Fully cleaned-up failed/stopped member names can be reused. Agent definitions support `permission_mode: default | acceptEdits | plan | bypassPermissions`. Omitted modes inherit the parent's live mode. Parent `acceptEdits` and `bypassPermissions` override configured child modes; a child cannot enable bypass unless the parent already uses it. Child mode changes never change the parent. Plan mode blocks mutations, even through allow rules or sandbox auto-allow, except the declared plan file and internal coordination tools. `max_turns` must be a positive integer. Built-in explore uses the selected parent model unless explicitly overridden.
510
+ The team retains at most 200 terminated member summaries; running and idle members are never evicted. Fully cleaned-up failed/stopped member names can be reused. Agent definitions support `permission_mode: default | acceptEdits | plan | bypassPermissions`. Omitted modes inherit the parent's live mode. Parent `acceptEdits` and `bypassPermissions` override configured child modes except permanently read-only roles and coordinator teammates awaiting execution approval; a child cannot enable bypass unless the parent already uses it. Built-in `plan` and `explore` workers stay permanently read-only, including follow-up assignments; parent modes and plan approval cannot grant them execution permissions. Child mode changes never change the parent. Plan mode blocks mutations, even through allow rules or sandbox auto-allow, except the declared plan file and internal coordination tools. `max_turns` must be a positive integer. Built-in explore uses the selected parent model unless explicitly overridden.
511
511
 
512
- Teammates run only in-process and route permission requests through the main session. Requests identify the agent and working directory; remembered permission patterns apply to all agents in the project. When its effective mode is `plan`, a teammate requested with `plan_mode_required` submits its plan at turn completion; the runtime automatically approves it without leader review and resumes in the leader's current mode (`default` when the leader remains in `plan`). Plan approval does not authorize subsequent tool calls. Stopped teammates release their task ownership; restored sessions mark old runtimes inactive and reclaim unfinished work. Edited worktrees are retained for explicit integration, not deleted as part of runtime cleanup. Starting an Agent under a different team name never implicitly destroys another existing team.
512
+ Teammates run only in-process and route permission requests through the main session. Requests identify the agent and working directory; remembered permission patterns apply to all agents in the project. Plan-mode definitions can use `ExitPlanMode` unless explicitly excluded by their tool restrictions; `EnterPlanMode` remains unavailable to delegated agents. One-shot planning subagents return their plans to the parent without changing its mode. In coordinator mode, plan-then-execute teammates requested with `plan_mode_required` or a plan-mode definition stay read-only until the leader reviews the plan and sends `SendMessage(type="plan_approval_response", to=teammate, request_id=requestId, approve=true/false, content=review feedback)`. Permanently read-only built-in `plan` and `explore` workers return research without entering execution approval, even when `plan_mode_required` is set. Rejected plans must be revised and resubmitted. Outside coordinator mode, submitted execution plans remain automatically approved. Approval resumes the teammate in the leader's current mode (`default` when the leader remains in `plan`) and does not authorize subsequent tool calls. Before resuming execution or plan revision, the host includes queued ordinary team messages with the review feedback so scope corrections are applied in that next turn. Stopped teammates release their task ownership; restored sessions mark old runtimes inactive and reclaim unfinished work. Edited worktrees are retained for explicit integration, not deleted as part of runtime cleanup. Starting an Agent under a different team name never implicitly destroys another existing team.
513
513
 
514
514
  Bash and PowerShell commands recognized by `isSafeCommand` can run in parallel. Unrecognized commands and file mutations share a process-wide FIFO queue keyed by canonical working directory, so agents in the same workspace cannot perform these operations simultaneously. Independent worktree directories have independent queues. Queued operations can be cancelled and recheck permissions before starting. Background commands hold their workspace slot until the tracked shell exits; moving a command to the background does not release it.
515
515
 
516
- `WebSearch` directly requests Bing's public search pages and extracts organic result titles, source URLs, and snippets. It requires no search API key, subscription, or paid search API. Bing receives the query, requested result count, and market selection, together with ordinary HTTP request information. Requests are cancellable, limited to 25 seconds and 2 MiB, and model output is capped at 100,000 characters. Bing may return fewer results than requested. Network failures, rate limits, CAPTCHA, and unrecognized page layouts are reported as tool errors, distinct from an explicit empty search. `allowed_domains` and `blocked_domains` are mutually exclusive hostname lists, applied locally to decoded result URLs with exact-host/subdomain matching. Filtering can reduce the number of results; it does not ask Bing to search again. No session ID, provider/model, or workspace metadata is transmitted. Never include private source code or secrets in queries; treat results as untrusted content and cite source URLs. Use `WebFetch` to read a source page; search snippets are not full-page content.
517
-
518
516
  `WebFetch` cancels discarded response bodies and honors cancellation even for cached pages. Direct HTTP/HTTPS access, including project intranet endpoints, remains supported.
519
517
 
520
518
  ### Persistent goals
@@ -538,6 +536,8 @@ TUI, Remote/ACP/A2A, and print mode share this goal loop. `yukino -p "/goal <obj
538
536
 
539
537
  ## Usage
540
538
 
539
+ Run `yukino --help` (or `-h`) for a summary of all command-line options; type `/help` inside a session for the list of slash commands.
540
+
541
541
  ### Interactive UI Mode
542
542
 
543
543
  ```bash
@@ -575,6 +575,8 @@ yukino --remote 0 # OS-assigned ephemeral port; the actual URL is
575
575
 
576
576
  Starts an Express HTTP server and WebSocket bridge. The bundled React frontend is served at the configured address for browser-based interaction. With port 0 the OS picks a free port and the server prints the reachable address (e.g. `Remote server listening at http://127.0.0.1:61041`) so you know where to connect.
577
577
 
578
+ The browser UI mirrors the terminal UI's capabilities: streaming replies and thinking, tool cards with live output, permission and ask-user dialogs, plan approval, the code-review form, `/resume` session picker, steering messages while a turn runs (with a follow-up queue for messages that cannot steer), prompt history (`↑`/`↓`), `@file` completion, `!`/`!!` user Bash, image attachments (paste, drop, or the attach button — stored like terminal clipboard images and expanded as `@` references), todo progress, the Agents panel (subagents, background tasks, teammates), context-window usage, and dark/light themes. Model (`/model`), provider (`/login`, `/provider`), thinking level (`/thinking`), permission mode (badge click or `Shift+Tab`), rewind (`/rewind`), sandbox (`/sandbox`), worktree (`/worktree`), MCP reload (`/mcp reload`), fork-mode skills, and `/quit` (shuts the server down) all work from the browser; `Ctrl+B` backgrounds running foreground shells and `Esc` cancels the active turn. Background tasks and teammate notifications wake an idle server the same way they do in the terminal.
579
+
578
580
  ### ACP Mode (Editor Integration)
579
581
 
580
582
  ```bash
@@ -621,7 +623,7 @@ Inside the UI, these commands are available:
621
623
  | /sandbox [mode] | Configure sandbox (auto=on+auto, manual=on+manual, off) |
622
624
  | /worktree | List git worktrees |
623
625
  | /mcp | Show MCP server status |
624
- | /mcp reload | Re-read MCP config; reconcile unchanged, removed, new, and changed servers |
626
+ | /mcp reload | Re-read MCP config; disconnect every server and reconnect the freshly read list |
625
627
  | /thinking [level] | Without an argument, open a picker of the supported thinking levels; with one, set the level (off, minimal, low, medium, high, xhigh, max). The setting persists to `~/.yukino/config.yaml` |
626
628
  | /code-review | Open the code review form for workspace, branch-range, or commit review |
627
629
  | /quit | Exit the application |
@@ -643,7 +645,7 @@ Commands can run while the model is streaming, with at most one user command at
643
645
  | ↓ | On the last input line, view all teammates and background subagents |
644
646
  | Ctrl+B | Move running foreground Bash/PowerShell tasks to the background |
645
647
  | Ctrl+V | Paste a clipboard image (Alt+V on Windows) |
646
- | Shift+Tab | Cycle default → acceptEdits → bypassPermissions; exit plan to default |
648
+ | Shift+Tab | Cycle default → acceptEdits → bypassPermissions → plan |
647
649
 
648
650
  Press ↓ on the last visual row of the input to view all teammates and background subagents, including while the foreground agent is streaming. Completion menus and prompt-history navigation take precedence. Enter opens an agent's details, Escape returns or closes the list, and the unsent draft and cursor are preserved. Teammate spawn cards scroll with the transcript like background subagent cards; current progress is available in the Agents list.
649
651
 
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __yukinoCreateRequire } from "node:module";
3
+ const require = __yukinoCreateRequire(import.meta.url);
4
+ import{g as m}from"./chunk-UDDADKJP.js";import{a as Q}from"./chunk-P6DHMU7R.js";import{a as X,b as Z}from"./chunk-MHRZYJJO.js";import{D as Y,E as w,F as E,G as V,H as u,I as W,J as D,K as J,i as N,k as R,l as B,m as O,n as U,o as $,p as P,r as j,x as H}from"./chunk-3O2CPTOD.js";import"./chunk-CUCQV3CL.js";import"./chunk-MQAQBW7F.js";import{A as G,k as K,l as F,s as q,v as p,w as z}from"./chunk-H7DHVEP7.js";import"./chunk-LCWNSYZU.js";import"./chunk-WGRGSG2J.js";import"./chunk-7MKA3SHV.js";function ne(o){for(let t=o.length-1;t>=0;t--){let e=o[t];if(e.defer_loading!==!0){e.cache_control={type:"ephemeral"};return}}}function se(o){return o.some(t=>"defer_loading"in t&&t.defer_loading===!0)}function re(o,t){if("input_schema"in o){let e=o,{cache_control:n,...r}=e;return t||delete r.type,{...r,...t?{type:"custom"}:{},...e.defer_loading!==!0&&n?{cache_control:n}:{}}}throw new Error("Anthropic received a tool schema serialized for another protocol.")}var ie=K({module:"llm"});function d(o){return typeof o=="string"?[{type:"text",text:o}]:o.map(t=>{let e=F(t);if(!e||e.type==="tool_reference")throw new Error(`Unsupported user content block: ${G(t,"type","unknown")}`);return e})}function ae(o){let t=[];for(let e of o)if(e.role==="assistant"){let n=[];if(e.thinkingBlocks)for(let i of e.thinkingBlocks)n.push({type:"thinking",thinking:i.thinking,signature:i.signature});let r=typeof e.content=="string"?e.content:q(e.content);if(r&&n.push({type:"text",text:r}),e.toolUses)for(let i of e.toolUses)n.push({type:"tool_use",id:i.toolUseId,name:i.toolName==="ComputerUse"?"computer":i.toolName,input:i.arguments});n.length===0&&n.push({type:"text",text:""}),t.push({role:"assistant",content:n})}else if(e.toolResults&&e.toolResults.length>0){let n=[];for(let r of e.toolResults)n.push({type:"tool_result",tool_use_id:r.toolUseId,is_error:r.isError,content:r.contentBlocks?.length?r.contentBlocks:r.content});e.content.length>0&&n.push(...d(e.content)),t.push({role:"user",content:n})}else{if(t.length===0){t.push({role:"user",content:d(e.content)});continue}let n=t[t.length-1],r=n.content;n.role==="user"?(typeof r=="string"&&(r=n.content=r.trim().length>0?[{type:"text",text:r}]:[]),r.push(...d(e.content))):t.push({role:"user",content:d(e.content)})}return t}var ee=class{protocol="anthropic";client;model;thinkingLevel;systemPrompt;config;useExplicitCustomToolType;constructor(t,e){let n=H(t);if(!n)throw new E("Anthropic API key not found, set ANTHROPIC_API_KEY in ~/.yukino/config.yaml, or via ANTHROPIC_API_KEY env variable.");this.client=new m({apiKey:n,baseURL:t.base_url}),this.useExplicitCustomToolType=Z(t.base_url),this.model=t.model,this.config={...t},this.thinkingLevel=R(t),this.systemPrompt=e}setSystemPrompt(t){this.systemPrompt=t}setMaxOutputTokens(t){this.config={...this.config,max_output_tokens:t},this.setThinkingLevel(this.thinkingLevel)}setThinkingLevel(t){return this.thinkingLevel=P(this.config,t),this.thinkingLevel}getThinkingLevel(){return this.thinkingLevel}getSupportedThinkingLevels(){return $(this.config)}async*stream(t,e,n,r){let i=r?.maxOutputTokens===void 0?this.config:{...this.config,max_output_tokens:r.maxOutputTokens},I=j(i),S=ae(Y(t.getMessages())),te=se(e),k=e.map(a=>re(a,this.useExplicitCustomToolType));ne(k),le(S);let h={model:this.model,max_tokens:I,stream:!0,system:[{type:"text",text:this.systemPrompt,cache_control:{type:"ephemeral"}}],messages:S,...k.length>0?{tools:k}:{}},_=P(i,this.getThinkingLevel());if(i.reasoning!==!1)if(_==="off")h.thinking={type:"disabled"};else if(i.thinking_mode==="adaptive"){let a=U(_,i);a!==null&&(h.thinking={type:"adaptive"},h.output_config={effort:a})}else{let a=O(_,i);a!==null&&a!=="none"&&(h.thinking={type:"enabled",budget_tokens:Math.min(B(a),I-N)})}let y=0,T=0,v=0,A=0,C="end_turn",L="",b="",x=!1,M=!1;try{let a=[...te?[X]:[]],oe=this.client.messages.stream(h,{...n?{signal:n}:{},...a.length>0?{headers:{"anthropic-beta":a.join(",")}}:{}}),c="",g="",f="";for await(let l of oe)switch(l.type){case"content_block_start":{let s=l.content_block;if(s.type==="thinking")x=!0,L="",b="";else if(s.type==="tool_use"){if(!s.id||!s.name)throw new u("Anthropic tool call started without a valid id or name");g=s.id,c=s.name==="computer"?"ComputerUse":s.name,f="",yield{type:"tool_call_start",toolName:c,toolId:g}}break}case"content_block_delta":{let s=l.delta;if(s.type==="thinking_delta")L+=s.thinking,yield{type:"thinking_delta",text:s.thinking};else if(s.type==="signature_delta")b+=s.signature;else if(s.type==="text_delta")yield{type:"text_delta",text:s.text};else if(s.type==="input_json_delta"){if(!g||!c)throw new u("Anthropic tool arguments arrived before a valid tool call");f+=s.partial_json,yield{type:"tool_call_delta",text:s.partial_json}}break}case"content_block_stop":{if(x&&(yield{type:"thinking_complete",thinking:L,signature:b},x=!1),c){let s=Q(f);yield{type:"tool_call_complete",toolId:g,toolName:c,arguments:s.arguments,...s.parseError?{parseError:s.parseError}:{}},c="",g="",f=""}break}case"message_delta":{l.delta.stop_reason&&(C=l.delta.stop_reason);let s=l.usage;typeof s.output_tokens=="number"&&(T=s.output_tokens),typeof s.input_tokens=="number"&&(y=s.input_tokens),typeof s.cache_read_input_tokens=="number"&&(v=s.cache_read_input_tokens),typeof s.cache_creation_input_tokens=="number"&&(A=s.cache_creation_input_tokens);break}case"message_stop":{M=!0;break}case"message_start":{y=l.message.usage.input_tokens,T=l.message.usage.output_tokens,v=l.message.usage.cache_read_input_tokens??0,A=l.message.usage.cache_creation_input_tokens??0;break}}if(!M)throw new u("Anthropic stream ended without message_stop; response was truncated");yield{type:"stream_end",stopReason:C,usage:{inputTokens:y,outputTokens:T,cacheReadInputTokens:v,cacheCreationInputTokens:A}}}catch(a){throw ie.error({err:a},"llm operation failed"),ce(a)}}};function le(o){for(let t=o.length-1;t>=0;t--){if(o[t].role!=="user")continue;let e=o[t].content;if(typeof e=="string"&&e.length===0||Array.isArray(e)&&e.length===0)return;typeof e=="string"&&(e=o[t].content=[{type:"text",text:e}]);let n=e[e.length-1];for(let r=e.length-1;r>=0;r--)if(e[r].type!=="image"){n=e[r];break}Reflect.set(n,"cache_control",{type:"ephemeral"});return}}function ce(o){if(o instanceof w)return o;if(o instanceof m.APIConnectionError||o instanceof m.APIUserAbortError)return new u(`Network error: ${o.message}`);if(o instanceof m.APIError){if(o.status===413||o.status===400&&J(o.message))return new D(`Prompt too long: ${o.message}`);if(o.status===401)return new E(`Invalid API key: ${o.message}`);if(o.status===429){let t=o.headers,e=t instanceof Headers?t.get("retry-after"):void 0,n="Rate Limited";if(e){let r=Number.parseInt(p(e));Number.isNaN(r)?n+=", please wait.":n+=`, retry after ${p(r)}s.`}else n+=", please wait.";return new V(n,e?p(e):void 0)}if(o.status!==void 0&&(o.status>=500||o.status===408)){let t=o.headers;return new W(`Anthropic API error (${p(o.status)}): ${o.message}`,t instanceof Headers?t.get("retry-after")??void 0:void 0)}return new w(`Anthropic API error (${p(o.status)}): ${o.message}`)}return new u(`Network error: ${z(o)}`)}export{ee as AnthropicClient,ae as buildAnthropicMessages,le as markLastUserTailForCache,ne as markToolsForCache,se as needsToolSearchBeta};
@@ -8,7 +8,7 @@
8
8
  content="width=device-width, initial-scale=1.0, viewport-fit=cover"
9
9
  />
10
10
  <title>Yukino Remote</title>
11
- <meta name="theme-color" content="#14171a" />
11
+ <meta name="theme-color" content="#18181e" />
12
12
  <script>
13
13
  // Set the color scheme before first paint to avoid a flash. Mirrors the
14
14
  // logic in hooks/use-theme.ts: explicit choice wins, else system pref,
@@ -33,7 +33,7 @@
33
33
  <style>
34
34
  body {
35
35
  margin: 0;
36
- background: #14171a;
36
+ background: #18181e;
37
37
  }
38
38
  </style>
39
39
  </head>
@@ -0,0 +1 @@
1
+ var j=Object.create;var f=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var n=Reflect.get;var i=b=>{throw TypeError(b)};var o=(b,a,c)=>a in b?f(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var q=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),r=(b,a)=>{for(var c in a)f(b,c,{get:a[c],enumerable:!0})},p=(b,a,c,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of l(a))!m.call(b,e)&&e!==c&&f(b,e,{get:()=>a[e],enumerable:!(d=k(a,e))||d.enumerable});return b};var s=(b,a,c)=>(c=b!=null?j(h(b)):{},p(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));var t=(b,a,c)=>o(b,typeof a!="symbol"?a+"":a,c),g=(b,a,c)=>a.has(b)||i("Cannot "+c);var u=(b,a,c)=>(g(b,a,"read from private field"),c?c.call(b):a.get(b)),v=(b,a,c)=>a.has(b)?i("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c),w=(b,a,c,d)=>(g(b,a,"write to private field"),d?d.call(b,c):a.set(b,c),c),x=(b,a,c)=>(g(b,a,"access private method"),c);var y=(b,a,c)=>n(h(b),c,a);export{q as a,r as b,s as c,t as d,u as e,v as f,w as g,x as h,y as i};