@yukino.js/yukino 0.0.1 → 0.0.3-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 (42) hide show
  1. package/README.md +34 -27
  2. package/dist/{acp-IVY5HZR4.js → acp-J6EPN6TP.js} +6 -6
  3. package/dist/{agent-QANDY7FO.js → agent-LA65FOAB.js} +1 -1
  4. package/dist/anthropic-YP6DY2F3.js +4 -0
  5. package/dist/{chunk-UPNNYP7M.js → chunk-2UNWKNDU.js} +1 -1
  6. package/dist/{chunk-T4O4GQVL.js → chunk-675L7SRF.js} +98 -98
  7. package/dist/{chunk-VWUGGYUP.js → chunk-7CVY4FXY.js} +1 -1
  8. package/dist/{chunk-SOO5OXX2.js → chunk-CT773IEX.js} +3 -3
  9. package/dist/{chunk-RAS3ORX3.js → chunk-JEOQXHOX.js} +29 -29
  10. package/dist/chunk-M5H5EYXN.js +5 -0
  11. package/dist/{chunk-SAJCBGHL.js → chunk-P77AEADG.js} +1 -1
  12. package/dist/{chunk-XO7ITAWR.js → chunk-Y6COQ5UY.js} +1 -1
  13. package/dist/{chunk-RCXKUD3Y.js → chunk-ZQP5DTJA.js} +1 -1
  14. package/dist/{esm-ZTIYTMTS.js → esm-NCEEJIH3.js} +3 -3
  15. package/dist/lib/{agent-6FZX4P2Y.js → agent-KDWPLLAV.js} +5 -5
  16. package/dist/lib/{anthropic-IP23YZ3P.js → anthropic-OJALXK4E.js} +4 -6
  17. package/dist/lib/{chunk-O7ELJUEK.js → chunk-24L3QT3J.js} +8 -2
  18. package/dist/lib/{chunk-KA6POJKI.js → chunk-2DEH6DOX.js} +9 -11
  19. package/dist/lib/{chunk-I34MAQRE.js → chunk-6AKRDUQF.js} +6 -2
  20. package/dist/lib/{chunk-2VF3XTGH.js → chunk-77FSPN6Y.js} +148 -60
  21. package/dist/lib/{chunk-5TGXH7BX.js → chunk-7G4AI2PP.js} +5 -55
  22. package/dist/lib/{chunk-6OMQD7MK.js → chunk-7SU77J32.js} +9 -1
  23. package/dist/lib/{chunk-FFM2LB4C.js → chunk-EFNPK4SJ.js} +7 -2
  24. package/dist/lib/{chunk-QYBQT2DM.js → chunk-SS7OJYHN.js} +27 -9
  25. package/dist/lib/{chunk-AZRC67RW.js → chunk-WOMWIFSN.js} +2 -2
  26. package/dist/lib/{chunk-5DVQ64YL.js → chunk-ZF52ER22.js} +3 -3
  27. package/dist/lib/index.d.ts +69 -52
  28. package/dist/lib/index.js +331 -123
  29. package/dist/lib/{openai-EMJ6U4FW.js → openai-FB7BBZVN.js} +3 -3
  30. package/dist/lib/{permissions-KZ5ACZAX.js → permissions-BZRN4RES.js} +3 -3
  31. package/dist/lib/{providers-2CGZPBFI.js → providers-7ZGRBCQ4.js} +1 -1
  32. package/dist/lib/{sandbox-runtime-CCQ3X3SM.js → sandbox-runtime-QDN5SXPM.js} +1 -1
  33. package/dist/lib/{tool-filter-CKHZUUBQ.js → tool-filter-PY6XY254.js} +1 -1
  34. package/dist/main.js +223 -217
  35. package/dist/{openai-YXYO5OW6.js → openai-2FE77NB2.js} +14 -14
  36. package/dist/{permissions-VCDMNX3L.js → permissions-R7P7RWZU.js} +1 -1
  37. package/dist/{providers-HNMBGGW6.js → providers-EZFC2EPW.js} +1 -1
  38. package/dist/{server-ZHQILOBP.js → server-54LNMGWU.js} +1 -1
  39. package/package.json +19 -12
  40. package/postinstall.mjs +80 -0
  41. package/dist/anthropic-6YLT4JZR.js +0 -4
  42. package/dist/chunk-5VOCXSSX.js +0 -5
@@ -734,7 +734,7 @@ declare const ToolUseRecordSchema: z.ZodObject<{
734
734
  tool_name: z.ZodString;
735
735
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
736
736
  provider_item_id: z.ZodOptional<z.ZodString>;
737
- }, z.core.$strip>;
737
+ }, z.core.$loose>;
738
738
  type ToolUseRecord = z.infer<typeof ToolUseRecordSchema>;
739
739
  /** Persisted form of a tool result, paired with a ToolUseRecord via tool_use_id. */
740
740
  declare const ToolResultRecordSchema: z.ZodObject<{
@@ -742,7 +742,7 @@ declare const ToolResultRecordSchema: z.ZodObject<{
742
742
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
743
743
  content_blocks: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
744
744
  is_error: z.ZodOptional<z.ZodBoolean>;
745
- }, z.core.$strip>;
745
+ }, z.core.$loose>;
746
746
  type ToolResultRecord = z.infer<typeof ToolResultRecordSchema>;
747
747
  declare const SessionMessageSchema: z.ZodObject<{
748
748
  role: z.ZodString;
@@ -754,14 +754,14 @@ declare const SessionMessageSchema: z.ZodObject<{
754
754
  tool_name: z.ZodString;
755
755
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
756
756
  provider_item_id: z.ZodOptional<z.ZodString>;
757
- }, z.core.$strip>>>;
757
+ }, z.core.$loose>>>;
758
758
  tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
759
759
  tool_use_id: z.ZodString;
760
760
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
761
761
  content_blocks: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
762
762
  is_error: z.ZodOptional<z.ZodBoolean>;
763
- }, z.core.$strip>>>;
764
- }, z.core.$strip>;
763
+ }, z.core.$loose>>>;
764
+ }, z.core.$loose>;
765
765
  type SessionMessage = z.infer<typeof SessionMessageSchema>;
766
766
  declare const KeptMessageSchema: z.ZodObject<{
767
767
  role: z.ZodString;
@@ -771,14 +771,14 @@ declare const KeptMessageSchema: z.ZodObject<{
771
771
  tool_name: z.ZodString;
772
772
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
773
773
  provider_item_id: z.ZodOptional<z.ZodString>;
774
- }, z.core.$strip>>>;
774
+ }, z.core.$loose>>>;
775
775
  tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
776
776
  tool_use_id: z.ZodString;
777
777
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
778
778
  content_blocks: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
779
779
  is_error: z.ZodOptional<z.ZodBoolean>;
780
- }, z.core.$strip>>>;
781
- }, z.core.$strip>;
780
+ }, z.core.$loose>>>;
781
+ }, z.core.$loose>;
782
782
  type KeptMessage = z.infer<typeof KeptMessageSchema>;
783
783
  /** Conversation-layer tool blocks (camelCase) → persisted records (snake_case); empty values are omitted. */
784
784
  declare function toolUsesToRecords(toolUses?: {
@@ -798,15 +798,15 @@ declare const CompactBoundaryPayloadSchema: z.ZodObject<{
798
798
  tool_name: z.ZodString;
799
799
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
800
800
  provider_item_id: z.ZodOptional<z.ZodString>;
801
- }, z.core.$strip>>>;
801
+ }, z.core.$loose>>>;
802
802
  tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
803
803
  tool_use_id: z.ZodString;
804
804
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
805
805
  content_blocks: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
806
806
  is_error: z.ZodOptional<z.ZodBoolean>;
807
- }, z.core.$strip>>>;
808
- }, z.core.$strip>>;
809
- }, z.core.$strip>;
807
+ }, z.core.$loose>>>;
808
+ }, z.core.$loose>>;
809
+ }, z.core.$loose>;
810
810
  type CompactBoundaryPayload = z.infer<typeof CompactBoundaryPayloadSchema>;
811
811
  interface SessionInfo {
812
812
  id: string;
@@ -834,9 +834,11 @@ interface RestoredMessage {
834
834
  declare function rebuildFromSession(saved: SessionMessage[]): RestoredMessage[];
835
835
  declare function listSessions(workDir: string): SessionInfo[];
836
836
  /**
837
- * Cleans up expired sessions: deletes .jsonl files whose last modified time exceeds SESSION_EXPIRY_DAYS.
838
- * Not currently invoked anywhere; intended to run during listSessions or on
839
- * startup to prevent the session directory from growing indefinitely.
837
+ * Cleans up expired sessions: deletes .jsonl files whose last modified time
838
+ * exceeds SESSION_EXPIRY_DAYS, together with each session's subdirectory
839
+ * (which holds the tool-results spill files written by spillDir()), to
840
+ * prevent the session directory from growing indefinitely.
841
+ * Invoked lazily by listSessions (once per process per sessions directory).
840
842
  * Silently skips failures (best-effort).
841
843
  */
842
844
  declare function cleanExpiredSessions(workDir: string): number;
@@ -1384,7 +1386,7 @@ declare const MCPServerConfigSchema: z$1.ZodObject<{
1384
1386
  transport: z$1.ZodOptional<z$1.ZodString>;
1385
1387
  headers: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1386
1388
  env: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1387
- }, z$1.core.$strip>;
1389
+ }, z$1.core.$loose>;
1388
1390
  type MCPServerConfig = z$1.infer<typeof MCPServerConfigSchema>;
1389
1391
  declare const HookConfigSchema: z$1.ZodObject<{
1390
1392
  id: z$1.ZodOptional<z$1.ZodString>;
@@ -1396,12 +1398,12 @@ declare const HookConfigSchema: z$1.ZodObject<{
1396
1398
  url: z$1.ZodOptional<z$1.ZodString>;
1397
1399
  method: z$1.ZodOptional<z$1.ZodString>;
1398
1400
  prompt: z$1.ZodOptional<z$1.ZodString>;
1399
- }, z$1.core.$strip>;
1401
+ }, z$1.core.$loose>;
1400
1402
  reject: z$1.ZodOptional<z$1.ZodBoolean>;
1401
1403
  once: z$1.ZodOptional<z$1.ZodBoolean>;
1402
1404
  async: z$1.ZodOptional<z$1.ZodBoolean>;
1403
1405
  on_error: z$1.ZodOptional<z$1.ZodString>;
1404
- }, z$1.core.$strip>;
1406
+ }, z$1.core.$loose>;
1405
1407
  type HookConfig = z$1.infer<typeof HookConfigSchema>;
1406
1408
  declare const SandboxYamlConfigSchema: z$1.ZodObject<{
1407
1409
  enabled: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -1411,9 +1413,10 @@ declare const SandboxYamlConfigSchema: z$1.ZodObject<{
1411
1413
  }>>;
1412
1414
  auto_allow: z$1.ZodOptional<z$1.ZodBoolean>;
1413
1415
  network_enabled: z$1.ZodOptional<z$1.ZodBoolean>;
1414
- }, z$1.core.$strip>;
1416
+ }, z$1.core.$loose>;
1415
1417
  type SandboxYamlConfig = z$1.infer<typeof SandboxYamlConfigSchema>;
1416
1418
  declare const AppConfigSchema: z$1.ZodObject<{
1419
+ default_provider: z$1.ZodDefault<z$1.ZodNumber>;
1417
1420
  providers: z$1.ZodArray<z$1.ZodObject<{
1418
1421
  name: z$1.ZodString;
1419
1422
  protocol: z$1.ZodEnum<{
@@ -1507,7 +1510,7 @@ declare const AppConfigSchema: z$1.ZodObject<{
1507
1510
  transport: z$1.ZodOptional<z$1.ZodString>;
1508
1511
  headers: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1509
1512
  env: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1510
- }, z$1.core.$strip>>>;
1513
+ }, z$1.core.$loose>>>;
1511
1514
  hooks: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
1512
1515
  id: z$1.ZodOptional<z$1.ZodString>;
1513
1516
  event: z$1.ZodString;
@@ -1518,12 +1521,12 @@ declare const AppConfigSchema: z$1.ZodObject<{
1518
1521
  url: z$1.ZodOptional<z$1.ZodString>;
1519
1522
  method: z$1.ZodOptional<z$1.ZodString>;
1520
1523
  prompt: z$1.ZodOptional<z$1.ZodString>;
1521
- }, z$1.core.$strip>;
1524
+ }, z$1.core.$loose>;
1522
1525
  reject: z$1.ZodOptional<z$1.ZodBoolean>;
1523
1526
  once: z$1.ZodOptional<z$1.ZodBoolean>;
1524
1527
  async: z$1.ZodOptional<z$1.ZodBoolean>;
1525
1528
  on_error: z$1.ZodOptional<z$1.ZodString>;
1526
- }, z$1.core.$strip>>>;
1529
+ }, z$1.core.$loose>>>;
1527
1530
  sandbox: z$1.ZodOptional<z$1.ZodObject<{
1528
1531
  enabled: z$1.ZodOptional<z$1.ZodBoolean>;
1529
1532
  backend: z$1.ZodOptional<z$1.ZodEnum<{
@@ -1532,7 +1535,7 @@ declare const AppConfigSchema: z$1.ZodObject<{
1532
1535
  }>>;
1533
1536
  auto_allow: z$1.ZodOptional<z$1.ZodBoolean>;
1534
1537
  network_enabled: z$1.ZodOptional<z$1.ZodBoolean>;
1535
- }, z$1.core.$strip>>;
1538
+ }, z$1.core.$loose>>;
1536
1539
  enable_coordinator_mode: z$1.ZodOptional<z$1.ZodBoolean>;
1537
1540
  enable_fork: z$1.ZodOptional<z$1.ZodBoolean>;
1538
1541
  }, z$1.core.$loose>;
@@ -1774,7 +1777,6 @@ declare function markToolsForCache(tools: {
1774
1777
  * use it at all.
1775
1778
  */
1776
1779
  declare function needsToolSearchBeta(toolSchemas: ProviderToolSchema[]): boolean;
1777
- declare function fetchModelContextWindow(config: ProviderConfig): Promise<number>;
1778
1780
  declare function buildAnthropicMessages(messages: Message[]): Anthropic.MessageParam[];
1779
1781
  declare class AnthropicClient implements LLMClient {
1780
1782
  readonly protocol: "anthropic";
@@ -1802,12 +1804,11 @@ declare function markLastUserTailForCache(messages: Anthropic.Messages.MessagePa
1802
1804
  type anthropic_AnthropicClient = AnthropicClient;
1803
1805
  declare const anthropic_AnthropicClient: typeof AnthropicClient;
1804
1806
  declare const anthropic_buildAnthropicMessages: typeof buildAnthropicMessages;
1805
- declare const anthropic_fetchModelContextWindow: typeof fetchModelContextWindow;
1806
1807
  declare const anthropic_markLastUserTailForCache: typeof markLastUserTailForCache;
1807
1808
  declare const anthropic_markToolsForCache: typeof markToolsForCache;
1808
1809
  declare const anthropic_needsToolSearchBeta: typeof needsToolSearchBeta;
1809
1810
  declare namespace anthropic {
1810
- export { anthropic_AnthropicClient as AnthropicClient, anthropic_buildAnthropicMessages as buildAnthropicMessages, anthropic_fetchModelContextWindow as fetchModelContextWindow, anthropic_markLastUserTailForCache as markLastUserTailForCache, anthropic_markToolsForCache as markToolsForCache, anthropic_needsToolSearchBeta as needsToolSearchBeta };
1811
+ export { anthropic_AnthropicClient as AnthropicClient, anthropic_buildAnthropicMessages as buildAnthropicMessages, anthropic_markLastUserTailForCache as markLastUserTailForCache, anthropic_markToolsForCache as markToolsForCache, anthropic_needsToolSearchBeta as needsToolSearchBeta };
1811
1812
  }
1812
1813
 
1813
1814
  interface LLMClient extends Partial<MaxTokensSetter>, Partial<ThinkingLevelControl> {
@@ -2990,7 +2991,7 @@ declare const FileMailMessageSchema: z.ZodObject<{
2990
2991
  type: z.ZodOptional<z.ZodString>;
2991
2992
  requestId: z.ZodOptional<z.ZodString>;
2992
2993
  approve: z.ZodOptional<z.ZodBoolean>;
2993
- }, z.core.$strip>;
2994
+ }, z.core.$loose>;
2994
2995
  type FileMailMessage = z.infer<typeof FileMailMessageSchema>;
2995
2996
  declare class FileMailbox {
2996
2997
  private filePath;
@@ -3042,12 +3043,12 @@ declare const ToolActivitySchema: z$1.ZodObject<{
3042
3043
  toolName: z$1.ZodString;
3043
3044
  input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
3044
3045
  activityDescription: z$1.ZodString;
3045
- }, z$1.core.$strip>;
3046
+ }, z$1.core.$loose>;
3046
3047
  type ToolActivity = z$1.infer<typeof ToolActivitySchema>;
3047
3048
  declare const ActiveToolSchema: z$1.ZodObject<{
3048
3049
  toolId: z$1.ZodString;
3049
3050
  toolName: z$1.ZodString;
3050
- }, z$1.core.$strip>;
3051
+ }, z$1.core.$loose>;
3051
3052
  type ActiveTool = z$1.infer<typeof ActiveToolSchema>;
3052
3053
  declare const AgentProgressSchema: z$1.ZodObject<{
3053
3054
  toolUseCount: z$1.ZodNumber;
@@ -3056,18 +3057,18 @@ declare const AgentProgressSchema: z$1.ZodObject<{
3056
3057
  activeTools: z$1.ZodArray<z$1.ZodObject<{
3057
3058
  toolId: z$1.ZodString;
3058
3059
  toolName: z$1.ZodString;
3059
- }, z$1.core.$strip>>;
3060
+ }, z$1.core.$loose>>;
3060
3061
  lastActivity: z$1.ZodOptional<z$1.ZodObject<{
3061
3062
  toolName: z$1.ZodString;
3062
3063
  input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
3063
3064
  activityDescription: z$1.ZodString;
3064
- }, z$1.core.$strip>>;
3065
+ }, z$1.core.$loose>>;
3065
3066
  recentActivities: z$1.ZodArray<z$1.ZodObject<{
3066
3067
  toolName: z$1.ZodString;
3067
3068
  input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
3068
3069
  activityDescription: z$1.ZodString;
3069
- }, z$1.core.$strip>>;
3070
- }, z$1.core.$strip>;
3070
+ }, z$1.core.$loose>>;
3071
+ }, z$1.core.$loose>;
3071
3072
  type AgentProgress = z$1.infer<typeof AgentProgressSchema>;
3072
3073
  declare const TeammateUIStateSchema: z$1.ZodObject<{
3073
3074
  name: z$1.ZodString;
@@ -3086,23 +3087,23 @@ declare const TeammateUIStateSchema: z$1.ZodObject<{
3086
3087
  activeTools: z$1.ZodArray<z$1.ZodObject<{
3087
3088
  toolId: z$1.ZodString;
3088
3089
  toolName: z$1.ZodString;
3089
- }, z$1.core.$strip>>;
3090
+ }, z$1.core.$loose>>;
3090
3091
  lastActivity: z$1.ZodOptional<z$1.ZodObject<{
3091
3092
  toolName: z$1.ZodString;
3092
3093
  input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
3093
3094
  activityDescription: z$1.ZodString;
3094
- }, z$1.core.$strip>>;
3095
+ }, z$1.core.$loose>>;
3095
3096
  recentActivities: z$1.ZodArray<z$1.ZodObject<{
3096
3097
  toolName: z$1.ZodString;
3097
3098
  input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
3098
3099
  activityDescription: z$1.ZodString;
3099
- }, z$1.core.$strip>>;
3100
- }, z$1.core.$strip>;
3100
+ }, z$1.core.$loose>>;
3101
+ }, z$1.core.$loose>;
3101
3102
  originToolCallId: z$1.ZodOptional<z$1.ZodString>;
3102
3103
  startTime: z$1.ZodNumber;
3103
3104
  spinnerVerb: z$1.ZodString;
3104
3105
  lastMessage: z$1.ZodOptional<z$1.ZodString>;
3105
- }, z$1.core.$strip>;
3106
+ }, z$1.core.$loose>;
3106
3107
  type TeammateUIState = z$1.infer<typeof TeammateUIStateSchema>;
3107
3108
  declare function createProgress(): AgentProgress;
3108
3109
  declare function recordToolUse(p: AgentProgress, toolName: string, input: Record<string, unknown>): void;
@@ -3244,7 +3245,7 @@ declare const TeamMemberEntrySchema: z.ZodObject<{
3244
3245
  worktreePath: z.ZodOptional<z.ZodString>;
3245
3246
  backendType: z.ZodOptional<z.ZodString>;
3246
3247
  isActive: z.ZodOptional<z.ZodBoolean>;
3247
- }, z.core.$strip>;
3248
+ }, z.core.$loose>;
3248
3249
  type TeamMemberEntry = z.infer<typeof TeamMemberEntrySchema>;
3249
3250
  /**
3250
3251
  * On-disk representation of team configuration, stored at <teamsBaseDir>/<slug>/config.json.
@@ -3271,8 +3272,8 @@ declare const TeamFileSchema: z.ZodObject<{
3271
3272
  worktreePath: z.ZodOptional<z.ZodString>;
3272
3273
  backendType: z.ZodOptional<z.ZodString>;
3273
3274
  isActive: z.ZodOptional<z.ZodBoolean>;
3274
- }, z.core.$strip>>;
3275
- }, z.core.$strip>;
3275
+ }, z.core.$loose>>;
3276
+ }, z.core.$loose>;
3276
3277
  type TeamFile = z.infer<typeof TeamFileSchema>;
3277
3278
  /**
3278
3279
  * Root directory for all team data. Placed under the user's home directory rather than
@@ -3926,13 +3927,13 @@ declare const TranscriptEntrySchema: z.ZodObject<{
3926
3927
  tool_use_id: z.ZodString;
3927
3928
  tool_name: z.ZodString;
3928
3929
  arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3929
- }, z.core.$strip>>>;
3930
+ }, z.core.$loose>>>;
3930
3931
  tool_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
3931
3932
  tool_use_id: z.ZodString;
3932
3933
  content: z.ZodString;
3933
3934
  is_error: z.ZodOptional<z.ZodBoolean>;
3934
- }, z.core.$strip>>>;
3935
- }, z.core.$strip>;
3935
+ }, z.core.$loose>>>;
3936
+ }, z.core.$loose>;
3936
3937
  type TranscriptEntry = z.infer<typeof TranscriptEntrySchema>;
3937
3938
  /**
3938
3939
  * Persists a teammate's conversation history to disk for debugging and troubleshooting.
@@ -4187,7 +4188,7 @@ declare const CodeReviewTeamSchema: z.ZodObject<{
4187
4188
  }, z.core.$strip>>;
4188
4189
  createdAt: z.ZodString;
4189
4190
  lastActive: z.ZodString;
4190
- }, z.core.$strip>;
4191
+ }, z.core.$loose>;
4191
4192
  type CodeReviewTeam = z.infer<typeof CodeReviewTeamSchema>;
4192
4193
  declare class CodeReviewManager {
4193
4194
  private teams;
@@ -4782,12 +4783,20 @@ declare function saveProvider(input: unknown, available: ProviderConfig[]): {
4782
4783
  * the endpoint is absent so callers can surface a clear error.
4783
4784
  */
4784
4785
  declare function persistThinkingLevel(baseUrl: string, level: ThinkingLevel): void;
4786
+ /**
4787
+ * Persist the index (into the config's providers array) of the provider the
4788
+ * user selected last, so the next start selects it directly instead of showing
4789
+ * the provider picker. No-op when the stored index already matches, so the file
4790
+ * is not rewritten (and reformatted) on every selection.
4791
+ */
4792
+ declare function persistDefaultProvider(index: number): void;
4785
4793
 
4786
4794
  declare const providerLogin_ProviderLoginSchema: typeof ProviderLoginSchema;
4795
+ declare const providerLogin_persistDefaultProvider: typeof persistDefaultProvider;
4787
4796
  declare const providerLogin_persistThinkingLevel: typeof persistThinkingLevel;
4788
4797
  declare const providerLogin_saveProvider: typeof saveProvider;
4789
4798
  declare namespace providerLogin {
4790
- export { providerLogin_ProviderLoginSchema as ProviderLoginSchema, providerLogin_persistThinkingLevel as persistThinkingLevel, providerLogin_saveProvider as saveProvider };
4799
+ export { providerLogin_ProviderLoginSchema as ProviderLoginSchema, providerLogin_persistDefaultProvider as persistDefaultProvider, providerLogin_persistThinkingLevel as persistThinkingLevel, providerLogin_saveProvider as saveProvider };
4791
4800
  }
4792
4801
 
4793
4802
  /**
@@ -4967,6 +4976,14 @@ declare class NetworkError extends LLMError {
4967
4976
  declare class ContextTooLongError extends LLMError {
4968
4977
  constructor(message: string);
4969
4978
  }
4979
+ /**
4980
+ * Detects provider "context too long" failures across protocols by message.
4981
+ * Anthropic returns 400 invalid_request_error with "prompt is too long:
4982
+ * N tokens > M maximum"; OpenAI (and Anthropic-compatible gateways such as
4983
+ * DeepSeek) use the context_length_exceeded code or "maximum context length
4984
+ * is N tokens" wording.
4985
+ */
4986
+ declare function containsContextLengthError(msg: string): boolean;
4970
4987
 
4971
4988
  type errors_AuthenticationError = AuthenticationError;
4972
4989
  declare const errors_AuthenticationError: typeof AuthenticationError;
@@ -4978,8 +4995,9 @@ type errors_NetworkError = NetworkError;
4978
4995
  declare const errors_NetworkError: typeof NetworkError;
4979
4996
  type errors_RateLimitError = RateLimitError;
4980
4997
  declare const errors_RateLimitError: typeof RateLimitError;
4998
+ declare const errors_containsContextLengthError: typeof containsContextLengthError;
4981
4999
  declare namespace errors {
4982
- export { errors_AuthenticationError as AuthenticationError, errors_ContextTooLongError as ContextTooLongError, errors_LLMError as LLMError, errors_NetworkError as NetworkError, errors_RateLimitError as RateLimitError };
5000
+ export { errors_AuthenticationError as AuthenticationError, errors_ContextTooLongError as ContextTooLongError, errors_LLMError as LLMError, errors_NetworkError as NetworkError, errors_RateLimitError as RateLimitError, errors_containsContextLengthError as containsContextLengthError };
4983
5001
  }
4984
5002
 
4985
5003
  /**
@@ -5008,7 +5026,7 @@ declare const ModelSchema: z$1.ZodObject<{
5008
5026
  id: z$1.ZodString;
5009
5027
  display_name: z$1.ZodOptional<z$1.ZodString>;
5010
5028
  name: z$1.ZodOptional<z$1.ZodString>;
5011
- }, z$1.core.$strip>;
5029
+ }, z$1.core.$loose>;
5012
5030
  type DiscoveryConfig = Pick<ProviderConfig, "protocol" | "base_url" | "api_key">;
5013
5031
  type DiscoveredModel = z$1.infer<typeof ModelSchema>;
5014
5032
  declare function modelListUrl(protocol: ProviderConfig["protocol"], baseUrl: string): string | undefined;
@@ -5628,7 +5646,6 @@ declare class MemoryExtractor {
5628
5646
  private inProgress;
5629
5647
  private pendingContext;
5630
5648
  private turnsSinceLastExtraction;
5631
- private lastMemoryMessageIdx;
5632
5649
  constructor(client: LLMClient, workDir: string);
5633
5650
  extract(conversationSummary: string): Promise<string[]>;
5634
5651
  private runExtraction;
@@ -6213,7 +6230,7 @@ declare namespace log {
6213
6230
  declare const QuestionOptionSchema: z$1.ZodObject<{
6214
6231
  label: z$1.ZodString;
6215
6232
  description: z$1.ZodOptional<z$1.ZodString>;
6216
- }, z$1.core.$strip>;
6233
+ }, z$1.core.$loose>;
6217
6234
  type QuestionOption = z$1.infer<typeof QuestionOptionSchema>;
6218
6235
  declare const QuestionSchema: z$1.ZodObject<{
6219
6236
  question: z$1.ZodString;
@@ -6221,7 +6238,7 @@ declare const QuestionSchema: z$1.ZodObject<{
6221
6238
  options: z$1.ZodArray<z$1.ZodObject<{
6222
6239
  label: z$1.ZodString;
6223
6240
  description: z$1.ZodOptional<z$1.ZodString>;
6224
- }, z$1.core.$strip>>;
6241
+ }, z$1.core.$loose>>;
6225
6242
  multiSelect: z$1.ZodBoolean;
6226
6243
  }, z$1.core.$strip>;
6227
6244
  type Question = z$1.infer<typeof QuestionSchema>;
@@ -7844,7 +7861,7 @@ declare namespace shellOutput {
7844
7861
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
7845
7862
  * SOFTWARE.
7846
7863
  */
7847
- declare const MACOS_SNIPPET = "\nimport AppKit\nimport ApplicationServices\nimport Foundation\n\nfunc fail(_ message: String) -> Never {\n FileHandle.standardError.write(Data(message.utf8))\n exit(2)\n}\n\nguard let encoded = ProcessInfo.processInfo.environment[\"YUKINO_COMPUTER_INPUT\"],\n let data = Data(base64Encoded: encoded),\n let object = try? JSONSerialization.jsonObject(with: data),\n let input = object as? [String: Any],\n let action = input[\"action\"] as? String\nelse {\n fail(\"Invalid computer action payload.\")\n}\n\nlet keyCodes: [String: CGKeyCode] = [\n \"A\": 0, \"S\": 1, \"D\": 2, \"F\": 3, \"H\": 4, \"G\": 5, \"Z\": 6, \"X\": 7,\n \"C\": 8, \"V\": 9, \"B\": 11, \"Q\": 12, \"W\": 13, \"E\": 14, \"R\": 15,\n \"Y\": 16, \"T\": 17, \"1\": 18, \"2\": 19, \"3\": 20, \"4\": 21, \"6\": 22,\n \"5\": 23, \"=\": 24, \"9\": 25, \"7\": 26, \"-\": 27, \"8\": 28, \"0\": 29,\n \"]\": 30, \"O\": 31, \"U\": 32, \"[\": 33, \"I\": 34, \"P\": 35, \"RETURN\": 36,\n \"ENTER\": 36, \"L\": 37, \"J\": 38, \"'\": 39, \"K\": 40, \";\": 41, \"\\\": 42,\n \",\": 43, \"/\": 44, \"N\": 45, \"M\": 46, \".\": 47, \"TAB\": 48, \"SPACE\": 49,\n \"GRAVE\": 50, \"BACKTICK\": 50, \"BACKSPACE\": 51, \"DELETE\": 51, \"ESC\": 53, \"ESCAPE\": 53,\n \"CMD\": 55, \"COMMAND\": 55, \"META\": 55, \"SHIFT\": 56, \"CAPSLOCK\": 57,\n \"ALT\": 58, \"OPTION\": 58, \"CTRL\": 59, \"CONTROL\": 59, \"LEFT\": 123,\n \"RIGHT\": 124, \"DOWN\": 125, \"UP\": 126, \"HOME\": 115, \"END\": 119,\n \"PAGEUP\": 116, \"PAGEDOWN\": 121, \"F1\": 122, \"F2\": 120, \"F3\": 99,\n \"F4\": 118, \"F5\": 96, \"F6\": 97, \"F7\": 98, \"F8\": 100, \"F9\": 101,\n \"F10\": 109, \"F11\": 103, \"F12\": 111,\n]\n\nfunc number(_ name: String) -> CGFloat {\n guard let value = input[name] as? NSNumber else { fail(\"Missing \" + name + \".\") }\n return CGFloat(value.doubleValue)\n}\n\nfunc keys() -> [String] {\n return (input[\"keys\"] as? [String] ?? []).map { $0.uppercased() }\n}\n\nfunc keyCode(_ name: String) -> CGKeyCode {\n guard let code = keyCodes[name.uppercased()] else { fail(\"Unsupported key: \" + name) }\n return code\n}\n\nfunc keyEvent(_ name: String, _ down: Bool) {\n guard let event = CGEvent(keyboardEventSource: nil, virtualKey: keyCode(name), keyDown: down)\n else {\n fail(\"Unable to create keyboard event.\")\n }\n event.post(tap: .cghidEventTap)\n}\n\nfunc withKeys(_ names: [String], _ body: () -> Void) {\n for name in names { keyEvent(name, true) }\n body()\n for name in names.reversed() { keyEvent(name, false) }\n}\n\nfunc mouseEvent(_ type: CGEventType, _ point: CGPoint, _ button: CGMouseButton, clicks: Int64 = 1) {\n guard\n let event = CGEvent(\n mouseEventSource: nil, mouseType: type, mouseCursorPosition: point, mouseButton: button)\n else {\n fail(\"Unable to create mouse event.\")\n }\n event.setIntegerValueField(.mouseEventClickState, value: clicks)\n event.post(tap: .cghidEventTap)\n}\n\nif action == \"screen_size\" {\n let bounds = CGDisplayBounds(CGMainDisplayID())\n print(\"\\(Int(bounds.width)),\\(Int(bounds.height))\")\n exit(0)\n}\n\nif action == \"cursor_position\" {\n guard let event = CGEvent(source: nil) else { fail(\"Unable to read cursor position.\") }\n print(\"\\(Int(event.location.x)),\\(Int(event.location.y))\")\n exit(0)\n}\n\nif !AXIsProcessTrusted() {\n fail(\n \"Accessibility permission is required. Enable it for the terminal running Yukino in System Settings > Privacy & Security > Accessibility.\"\n )\n}\n\nlet point = CGPoint(\n x: (input[\"x\"] as? NSNumber)?.doubleValue ?? 0,\n y: (input[\"y\"] as? NSNumber)?.doubleValue ?? 0\n)\nlet heldKeys = keys()\n\nswitch action {\ncase \"mouse_move\":\n withKeys(heldKeys) { mouseEvent(.mouseMoved, point, .left) }\ncase \"left_mouse_down\":\n mouseEvent(.leftMouseDown, CGEvent(source: nil)?.location ?? point, .left)\ncase \"left_mouse_up\":\n mouseEvent(.leftMouseUp, CGEvent(source: nil)?.location ?? point, .left)\ncase \"mouse_click\":\n let buttonName = input[\"button\"] as? String ?? \"left\"\n let button: CGMouseButton =\n buttonName == \"right\" ? .right : buttonName == \"middle\" ? .center : .left\n let downType: CGEventType =\n button == .right ? .rightMouseDown : button == .center ? .otherMouseDown : .leftMouseDown\n let upType: CGEventType =\n button == .right ? .rightMouseUp : button == .center ? .otherMouseUp : .leftMouseUp\n let count = (input[\"clicks\"] as? NSNumber)?.int64Value ?? 1\n withKeys(heldKeys) {\n mouseEvent(.mouseMoved, point, button)\n for click in 1...count {\n mouseEvent(downType, point, button, clicks: click)\n mouseEvent(upType, point, button, clicks: click)\n Thread.sleep(forTimeInterval: 0.08)\n }\n }\ncase \"left_click_drag\":\n guard let path = input[\"path\"] as? [[String: NSNumber]], let first = path.first else {\n fail(\"Drag path is missing.\")\n }\n let start = CGPoint(x: first[\"x\"]?.doubleValue ?? 0, y: first[\"y\"]?.doubleValue ?? 0)\n withKeys(heldKeys) {\n mouseEvent(.mouseMoved, start, .left)\n mouseEvent(.leftMouseDown, start, .left)\n for item in path.dropFirst() {\n let next = CGPoint(x: item[\"x\"]?.doubleValue ?? 0, y: item[\"y\"]?.doubleValue ?? 0)\n mouseEvent(.leftMouseDragged, next, .left)\n Thread.sleep(forTimeInterval: 0.02)\n }\n let end = path.last ?? first\n mouseEvent(\n .leftMouseUp, CGPoint(x: end[\"x\"]?.doubleValue ?? 0, y: end[\"y\"]?.doubleValue ?? 0), .left)\n }\ncase \"scroll\":\n if let x = input[\"x\"] as? NSNumber, let y = input[\"y\"] as? NSNumber {\n mouseEvent(.mouseMoved, CGPoint(x: x.doubleValue, y: y.doubleValue), .left)\n }\n let horizontal = Int32((input[\"scrollX\"] as? NSNumber)?.intValue ?? 0)\n let vertical = Int32((input[\"scrollY\"] as? NSNumber)?.intValue ?? 0)\n withKeys(heldKeys) {\n CGEvent(\n scrollWheelEvent2Source: nil, units: .line, wheelCount: 2, wheel1: -vertical,\n wheel2: -horizontal, wheel3: 0)?.post(tap: .cghidEventTap)\n }\ncase \"key\", \"hold_key\":\n let names = keys()\n if names.isEmpty { fail(\"No keys supplied.\") }\n for name in names { keyEvent(name, true) }\n if action == \"hold_key\" {\n Thread.sleep(forTimeInterval: (input[\"duration\"] as? NSNumber)?.doubleValue ?? 0)\n }\n for name in names.reversed() { keyEvent(name, false) }\ncase \"type\":\n let text = input[\"text\"] as? String ?? \"\"\n let units = Array(text.utf16)\n units.withUnsafeBufferPointer { buffer in\n guard let down = CGEvent(keyboardEventSource: nil, virtualKey: 0, keyDown: true),\n let up = CGEvent(keyboardEventSource: nil, virtualKey: 0, keyDown: false)\n else {\n fail(\"Unable to create text input events.\")\n }\n down.keyboardSetUnicodeString(stringLength: units.count, unicodeString: buffer.baseAddress)\n up.keyboardSetUnicodeString(stringLength: units.count, unicodeString: buffer.baseAddress)\n down.post(tap: .cghidEventTap)\n up.post(tap: .cghidEventTap)\n }\ndefault:\n fail(\"Unsupported action: \" + action)\n}\n";
7864
+ declare const MACOS_SNIPPET: string;
7848
7865
  declare const WINDOWS_PWSH_SNIPPET = "\n$ErrorActionPreference = 'Stop';\nAdd-Type -AssemblyName System.Drawing;\nAdd-Type -AssemblyName System.Windows.Forms;\n$bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds;\n$bitmap = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height;\n$graphics = [System.Drawing.Graphics]::FromImage($bitmap);\n$graphics.CopyFromScreen($bounds.X, $bounds.Y, 0, 0, $bounds.Size);\n$bitmap.Save($env:YUKINO_SCREENSHOT_PATH, [System.Drawing.Imaging.ImageFormat]::Png);\n$graphics.Dispose(); $bitmap.Dispose();\nWrite-Output \"$($bounds.Width),$($bounds.Height)\"\n";
7849
7866
  declare const WINDOWS_CSHARP_SNIPPET = "\nusing System;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Windows.Forms;\n\npublic static class YukinoComputer\n{\n [StructLayout(LayoutKind.Sequential)]\n private struct INPUT { public uint type; public InputUnion value; }\n [StructLayout(LayoutKind.Explicit)]\n private struct InputUnion { [FieldOffset(0)] public KEYBDINPUT keyboard; }\n [StructLayout(LayoutKind.Sequential)]\n private struct KEYBDINPUT\n {\n public ushort virtualKey;\n public ushort scanCode;\n public uint flags;\n public uint time;\n public UIntPtr extraInfo;\n }\n\n [DllImport(\"user32.dll\")]\n private static extern void mouse_event(uint flags, uint dx, uint dy, int data, UIntPtr extraInfo);\n [DllImport(\"user32.dll\", SetLastError = true)]\n private static extern uint SendInput(uint count, INPUT[] inputs, int size);\n\n private static void SendKeyboard(ushort virtualKey, ushort scanCode, uint flags)\n {\n var inputs = new[] {\n new INPUT {\n type = 1,\n value = new InputUnion {\n keyboard = new KEYBDINPUT {\n virtualKey = virtualKey,\n scanCode = scanCode,\n flags = flags,\n extraInfo = UIntPtr.Zero\n }\n }\n }\n };\n if (SendInput(1, inputs, Marshal.SizeOf(typeof(INPUT))) != 1)\n {\n throw new InvalidOperationException(\"SendInput failed.\");\n }\n }\n\n public static void Move(int x, int y) { Cursor.Position = new Point(x, y); }\n public static Point Position() { return Cursor.Position; }\n public static void Mouse(uint flags, int data = 0) { mouse_event(flags, 0, 0, data, UIntPtr.Zero); }\n public static void Key(int virtualKey, bool down) { SendKeyboard((ushort)virtualKey, 0, down ? 0u : 2u); }\n public static void Text(string text)\n {\n foreach (char value in text)\n {\n SendKeyboard(0, value, 4u);\n SendKeyboard(0, value, 6u);\n }\n }\n}\n";
7850
7867
  declare const WINDOWS_PWSH_INCLUDES_CSHARP_SNIPPET = "\n$ErrorActionPreference = 'Stop'\nAdd-Type -AssemblyName System.Drawing\nAdd-Type -AssemblyName System.Windows.Forms\nAdd-Type -TypeDefinition @'\n\nusing System;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Windows.Forms;\n\npublic static class YukinoComputer\n{\n [StructLayout(LayoutKind.Sequential)]\n private struct INPUT { public uint type; public InputUnion value; }\n [StructLayout(LayoutKind.Explicit)]\n private struct InputUnion { [FieldOffset(0)] public KEYBDINPUT keyboard; }\n [StructLayout(LayoutKind.Sequential)]\n private struct KEYBDINPUT\n {\n public ushort virtualKey;\n public ushort scanCode;\n public uint flags;\n public uint time;\n public UIntPtr extraInfo;\n }\n\n [DllImport(\"user32.dll\")]\n private static extern void mouse_event(uint flags, uint dx, uint dy, int data, UIntPtr extraInfo);\n [DllImport(\"user32.dll\", SetLastError = true)]\n private static extern uint SendInput(uint count, INPUT[] inputs, int size);\n\n private static void SendKeyboard(ushort virtualKey, ushort scanCode, uint flags)\n {\n var inputs = new[] {\n new INPUT {\n type = 1,\n value = new InputUnion {\n keyboard = new KEYBDINPUT {\n virtualKey = virtualKey,\n scanCode = scanCode,\n flags = flags,\n extraInfo = UIntPtr.Zero\n }\n }\n }\n };\n if (SendInput(1, inputs, Marshal.SizeOf(typeof(INPUT))) != 1)\n {\n throw new InvalidOperationException(\"SendInput failed.\");\n }\n }\n\n public static void Move(int x, int y) { Cursor.Position = new Point(x, y); }\n public static Point Position() { return Cursor.Position; }\n public static void Mouse(uint flags, int data = 0) { mouse_event(flags, 0, 0, data, UIntPtr.Zero); }\n public static void Key(int virtualKey, bool down) { SendKeyboard((ushort)virtualKey, 0, down ? 0u : 2u); }\n public static void Text(string text)\n {\n foreach (char value in text)\n {\n SendKeyboard(0, value, 4u);\n SendKeyboard(0, value, 6u);\n }\n }\n}\n\n'@\n\n$payload = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($env:YUKINO_COMPUTER_INPUT)) | ConvertFrom-Json\nfunction Resolve-Key([string]$name) {\n switch ($name.ToUpperInvariant()) {\n 'CTRL' { return 0x11 }\n 'CONTROL' { return 0x11 }\n 'SHIFT' { return 0x10 }\n 'ALT' { return 0x12 }\n 'OPTION' { return 0x12 }\n 'CMD' { return 0x5B }\n 'COMMAND' { return 0x5B }\n 'META' { return 0x5B }\n 'WIN' { return 0x5B }\n 'WINDOWS' { return 0x5B }\n 'ENTER' { return 0x0D }\n 'RETURN' { return 0x0D }\n 'ESC' { return 0x1B }\n 'ESCAPE' { return 0x1B }\n 'BACKSPACE' { return 0x08 }\n 'DELETE' { return 0x2E }\n 'TAB' { return 0x09 }\n 'SPACE' { return 0x20 }\n 'LEFT' { return 0x25 }\n 'UP' { return 0x26 }\n 'RIGHT' { return 0x27 }\n 'DOWN' { return 0x28 }\n 'HOME' { return 0x24 }\n 'END' { return 0x23 }\n 'PAGEUP' { return 0x21 }\n 'PAGEDOWN' { return 0x22 }\n default {\n if ($name.Length -eq 1) { return [int][char]$name.ToUpperInvariant() }\n try { return [int]([System.Enum]::Parse([System.Windows.Forms.Keys], $name, $true)) }\n catch { throw \"Unsupported key: $name\" }\n }\n }\n}\nfunction Key-Down($keys) { foreach ($key in $keys) { [YukinoComputer]::Key((Resolve-Key $key), $true) } }\nfunction Key-Up($keys) { for ($i = $keys.Count - 1; $i -ge 0; $i--) { [YukinoComputer]::Key((Resolve-Key $keys[$i]), $false) } }\nfunction Move-To($value) {\n $bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds\n [YukinoComputer]::Move($bounds.X + [int]$value.x, $bounds.Y + [int]$value.y)\n}\n\n$keys = @($payload.keys)\nswitch ($payload.action) {\n 'cursor_position' {\n $bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds\n $point = [YukinoComputer]::Position()\n Write-Output \"$(($point.X - $bounds.X)),$(($point.Y - $bounds.Y))\"\n }\n 'mouse_move' { Key-Down $keys; Move-To $payload; Key-Up $keys }\n 'left_mouse_down' { [YukinoComputer]::Mouse(0x0002) }\n 'left_mouse_up' { [YukinoComputer]::Mouse(0x0004) }\n 'mouse_click' {\n Move-To $payload\n Key-Down $keys\n $down = switch ($payload.button) { 'right' { 0x0008 } 'middle' { 0x0020 } default { 0x0002 } }\n $up = switch ($payload.button) { 'right' { 0x0010 } 'middle' { 0x0040 } default { 0x0004 } }\n for ($i = 0; $i -lt [int]$payload.clicks; $i++) {\n [YukinoComputer]::Mouse($down); [YukinoComputer]::Mouse($up); Start-Sleep -Milliseconds 80\n }\n Key-Up $keys\n }\n 'left_click_drag' {\n Key-Down $keys\n Move-To $payload.path[0]\n [YukinoComputer]::Mouse(0x0002)\n foreach ($point in $payload.path | Select-Object -Skip 1) { Move-To $point; Start-Sleep -Milliseconds 20 }\n [YukinoComputer]::Mouse(0x0004)\n Key-Up $keys\n }\n 'scroll' {\n if ($null -ne $payload.x -and $null -ne $payload.y) { Move-To $payload }\n Key-Down $keys\n [YukinoComputer]::Mouse(0x0800, - ([int]$payload.scrollY * 120))\n [YukinoComputer]::Mouse(0x01000, [int]$payload.scrollX * 120)\n Key-Up $keys\n }\n 'key' { Key-Down $keys; Key-Up $keys }\n 'hold_key' { Key-Down $keys; Start-Sleep -Milliseconds ([int]([double]$payload.duration * 1000)); Key-Up $keys }\n 'type' { [YukinoComputer]::Text([string]$payload.text) }\n default { throw \"Unsupported action: $($payload.action)\" }\n}\n";