@opencow-ai/opencow-agent-sdk 0.4.21 → 0.4.23

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 (39) hide show
  1. package/dist/capabilities/lsp/LSPServerManager.d.ts +2 -1
  2. package/dist/capabilities/mcp/types.d.ts +3 -3
  3. package/dist/capabilities/plugins/loadPluginAgents.d.ts +6 -0
  4. package/dist/capabilities/plugins/loadPluginCommands.d.ts +10 -0
  5. package/dist/capabilities/plugins/loadPluginHooks.d.ts +5 -0
  6. package/dist/capabilities/plugins/loadPluginOutputStyles.d.ts +6 -0
  7. package/dist/capabilities/plugins/lspPluginIntegration.d.ts +1 -0
  8. package/dist/capabilities/plugins/mcpPluginIntegration.d.ts +1 -0
  9. package/dist/capabilities/plugins/pluginOptionsStorage.d.ts +1 -0
  10. package/dist/capabilities/plugins/schemas.d.ts +4 -4
  11. package/dist/capabilities/plugins/sdkPluginRuntime.d.ts +35 -0
  12. package/dist/capabilities/todo/types.d.ts +2 -2
  13. package/dist/capabilities/tools/AgentTool/AgentTool.d.ts +8 -8
  14. package/dist/capabilities/tools/AgentTool/inputSchema.d.ts +3 -3
  15. package/dist/capabilities/tools/AgentTool/loadAgentsDir.d.ts +4 -0
  16. package/dist/capabilities/tools/TodoWriteTool/TodoWriteTool.d.ts +10 -10
  17. package/dist/cli.mjs +11952 -11679
  18. package/dist/client.d.ts +2 -0
  19. package/dist/client.js +8778 -3479
  20. package/dist/entrypoints/sdk/controlSchemas.d.ts +139 -139
  21. package/dist/entrypoints/sdk/coreSchemas.d.ts +57 -57
  22. package/dist/entrypoints/sdk/runtimeTypes.d.ts +82 -1
  23. package/dist/permissions/PermissionMode.d.ts +2 -2
  24. package/dist/permissions/PermissionPromptToolResultSchema.d.ts +1 -1
  25. package/dist/permissions/PermissionUpdateSchema.d.ts +1 -1
  26. package/dist/providers/anthropic/teleport/api.d.ts +3 -3
  27. package/dist/providers/shared/requestSideChannels.d.ts +6 -0
  28. package/dist/sdk.js +8778 -3479
  29. package/dist/session/layout/schemas.d.ts +12 -12
  30. package/dist/session/settings/types.d.ts +3 -3
  31. package/dist/session/state/als.d.ts +16 -0
  32. package/dist/session/state/index.d.ts +1 -1
  33. package/dist/session/state/registries.d.ts +4 -0
  34. package/dist/session/state/types.d.ts +4 -0
  35. package/dist/session/tasks.d.ts +2 -2
  36. package/dist/session/teammateMailbox.d.ts +2 -2
  37. package/dist/types/command.d.ts +2 -0
  38. package/dist/types/plugin.d.ts +2 -0
  39. package/package.json +1 -1
@@ -32,14 +32,14 @@ export declare const OutputFormatSchema: () => z.ZodObject<{
32
32
  export declare const ApiKeySourceSchema: () => z.ZodEnum<{
33
33
  user: "user";
34
34
  project: "project";
35
+ oauth: "oauth";
35
36
  org: "org";
36
37
  temporary: "temporary";
37
- oauth: "oauth";
38
38
  }>;
39
39
  export declare const ConfigScopeSchema: () => z.ZodEnum<{
40
+ local: "local";
40
41
  user: "user";
41
42
  project: "project";
42
- local: "local";
43
43
  }>;
44
44
  export declare const SdkBetaSchema: () => z.ZodLiteral<"context-1m-2025-08-07">;
45
45
  export declare const ThinkingAdaptiveSchema: () => z.ZodObject<{
@@ -126,11 +126,11 @@ export declare const McpServerStatusConfigSchema: () => z.ZodUnion<readonly [z.Z
126
126
  export declare const McpServerStatusSchema: () => z.ZodObject<{
127
127
  name: z.ZodString;
128
128
  status: z.ZodEnum<{
129
+ pending: "pending";
129
130
  disabled: "disabled";
130
131
  connected: "connected";
131
132
  failed: "failed";
132
133
  "needs-auth": "needs-auth";
133
- pending: "pending";
134
134
  }>;
135
135
  serverInfo: z.ZodOptional<z.ZodObject<{
136
136
  name: z.ZodString;
@@ -253,8 +253,8 @@ export declare const PermissionUpdateSchema: () => z.ZodDiscriminatedUnion<[z.Zo
253
253
  default: "default";
254
254
  acceptEdits: "acceptEdits";
255
255
  bypassPermissions: "bypassPermissions";
256
- plan: "plan";
257
256
  dontAsk: "dontAsk";
257
+ plan: "plan";
258
258
  }>>;
259
259
  destination: z.ZodEnum<{
260
260
  userSettings: "userSettings";
@@ -352,8 +352,8 @@ export declare const PermissionResultSchema: () => z.ZodUnion<readonly [z.ZodObj
352
352
  default: "default";
353
353
  acceptEdits: "acceptEdits";
354
354
  bypassPermissions: "bypassPermissions";
355
- plan: "plan";
356
355
  dontAsk: "dontAsk";
356
+ plan: "plan";
357
357
  }>>;
358
358
  destination: z.ZodEnum<{
359
359
  userSettings: "userSettings";
@@ -404,8 +404,8 @@ export declare const PermissionModeSchema: () => z.ZodEnum<{
404
404
  default: "default";
405
405
  acceptEdits: "acceptEdits";
406
406
  bypassPermissions: "bypassPermissions";
407
- plan: "plan";
408
407
  dontAsk: "dontAsk";
408
+ plan: "plan";
409
409
  }>;
410
410
  export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "Notification", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged"];
411
411
  export declare const HookEventSchema: () => z.ZodEnum<{
@@ -529,8 +529,8 @@ export declare const PermissionRequestHookInputSchema: () => z.ZodIntersection<z
529
529
  default: "default";
530
530
  acceptEdits: "acceptEdits";
531
531
  bypassPermissions: "bypassPermissions";
532
- plan: "plan";
533
532
  dontAsk: "dontAsk";
533
+ plan: "plan";
534
534
  }>>;
535
535
  destination: z.ZodEnum<{
536
536
  userSettings: "userSettings";
@@ -638,9 +638,9 @@ export declare const SessionStartHookInputSchema: () => z.ZodIntersection<z.ZodO
638
638
  }, z.core.$strip>, z.ZodObject<{
639
639
  hook_event_name: z.ZodLiteral<"SessionStart">;
640
640
  source: z.ZodEnum<{
641
- startup: "startup";
642
- resume: "resume";
643
641
  clear: "clear";
642
+ resume: "resume";
643
+ startup: "startup";
644
644
  compact: "compact";
645
645
  }>;
646
646
  agent_type: z.ZodOptional<z.ZodString>;
@@ -683,9 +683,9 @@ export declare const StopFailureHookInputSchema: () => z.ZodIntersection<z.ZodOb
683
683
  hook_event_name: z.ZodLiteral<"StopFailure">;
684
684
  error: z.ZodEnum<{
685
685
  unknown: "unknown";
686
+ rate_limit: "rate_limit";
686
687
  authentication_failed: "authentication_failed";
687
688
  billing_error: "billing_error";
688
- rate_limit: "rate_limit";
689
689
  invalid_request: "invalid_request";
690
690
  server_error: "server_error";
691
691
  max_output_tokens: "max_output_tokens";
@@ -722,8 +722,8 @@ export declare const SubagentStopHookInputSchema: () => z.ZodIntersection<z.ZodO
722
722
  agent_type: z.ZodString;
723
723
  last_assistant_message: z.ZodOptional<z.ZodString>;
724
724
  status: z.ZodOptional<z.ZodEnum<{
725
- failed: "failed";
726
725
  completed: "completed";
726
+ failed: "failed";
727
727
  stopped: "stopped";
728
728
  }>>;
729
729
  error_message: z.ZodOptional<z.ZodString>;
@@ -738,8 +738,8 @@ export declare const PreCompactHookInputSchema: () => z.ZodIntersection<z.ZodObj
738
738
  }, z.core.$strip>, z.ZodObject<{
739
739
  hook_event_name: z.ZodLiteral<"PreCompact">;
740
740
  trigger: z.ZodEnum<{
741
- manual: "manual";
742
741
  auto: "auto";
742
+ manual: "manual";
743
743
  }>;
744
744
  custom_instructions: z.ZodNullable<z.ZodString>;
745
745
  }, z.core.$strip>>;
@@ -753,8 +753,8 @@ export declare const PostCompactHookInputSchema: () => z.ZodIntersection<z.ZodOb
753
753
  }, z.core.$strip>, z.ZodObject<{
754
754
  hook_event_name: z.ZodLiteral<"PostCompact">;
755
755
  trigger: z.ZodEnum<{
756
- manual: "manual";
757
756
  auto: "auto";
757
+ manual: "manual";
758
758
  }>;
759
759
  compact_summary: z.ZodString;
760
760
  }, z.core.$strip>>;
@@ -852,11 +852,11 @@ export declare const ConfigChangeHookInputSchema: () => z.ZodIntersection<z.ZodO
852
852
  }, z.core.$strip>, z.ZodObject<{
853
853
  hook_event_name: z.ZodLiteral<"ConfigChange">;
854
854
  source: z.ZodEnum<{
855
+ skills: "skills";
855
856
  user_settings: "user_settings";
856
857
  project_settings: "project_settings";
857
858
  local_settings: "local_settings";
858
859
  policy_settings: "policy_settings";
859
- skills: "skills";
860
860
  }>;
861
861
  file_path: z.ZodOptional<z.ZodString>;
862
862
  }, z.core.$strip>>;
@@ -941,14 +941,14 @@ export declare const FileChangedHookInputSchema: () => z.ZodIntersection<z.ZodOb
941
941
  }, z.core.$strip>>;
942
942
  export declare const EXIT_REASONS: readonly ["clear", "resume", "logout", "prompt_input_exit", "bypass_permissions_disabled", "normal", "aborted", "error", "other"];
943
943
  export declare const ExitReasonSchema: () => z.ZodEnum<{
944
- error: "error";
945
- resume: "resume";
946
944
  clear: "clear";
945
+ resume: "resume";
947
946
  logout: "logout";
948
947
  prompt_input_exit: "prompt_input_exit";
949
948
  bypass_permissions_disabled: "bypass_permissions_disabled";
950
949
  normal: "normal";
951
950
  aborted: "aborted";
951
+ error: "error";
952
952
  other: "other";
953
953
  }>;
954
954
  export declare const SessionEndHookInputSchema: () => z.ZodIntersection<z.ZodObject<{
@@ -961,14 +961,14 @@ export declare const SessionEndHookInputSchema: () => z.ZodIntersection<z.ZodObj
961
961
  }, z.core.$strip>, z.ZodObject<{
962
962
  hook_event_name: z.ZodLiteral<"SessionEnd">;
963
963
  reason: z.ZodEnum<{
964
- error: "error";
965
- resume: "resume";
966
964
  clear: "clear";
965
+ resume: "resume";
967
966
  logout: "logout";
968
967
  prompt_input_exit: "prompt_input_exit";
969
968
  bypass_permissions_disabled: "bypass_permissions_disabled";
970
969
  normal: "normal";
971
970
  aborted: "aborted";
971
+ error: "error";
972
972
  other: "other";
973
973
  }>;
974
974
  }, z.core.$strip>>;
@@ -1056,9 +1056,9 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1056
1056
  }, z.core.$strip>, z.ZodObject<{
1057
1057
  hook_event_name: z.ZodLiteral<"SessionStart">;
1058
1058
  source: z.ZodEnum<{
1059
- startup: "startup";
1060
- resume: "resume";
1061
1059
  clear: "clear";
1060
+ resume: "resume";
1061
+ startup: "startup";
1062
1062
  compact: "compact";
1063
1063
  }>;
1064
1064
  agent_type: z.ZodOptional<z.ZodString>;
@@ -1073,14 +1073,14 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1073
1073
  }, z.core.$strip>, z.ZodObject<{
1074
1074
  hook_event_name: z.ZodLiteral<"SessionEnd">;
1075
1075
  reason: z.ZodEnum<{
1076
- error: "error";
1077
- resume: "resume";
1078
1076
  clear: "clear";
1077
+ resume: "resume";
1079
1078
  logout: "logout";
1080
1079
  prompt_input_exit: "prompt_input_exit";
1081
1080
  bypass_permissions_disabled: "bypass_permissions_disabled";
1082
1081
  normal: "normal";
1083
1082
  aborted: "aborted";
1083
+ error: "error";
1084
1084
  other: "other";
1085
1085
  }>;
1086
1086
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1105,9 +1105,9 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1105
1105
  hook_event_name: z.ZodLiteral<"StopFailure">;
1106
1106
  error: z.ZodEnum<{
1107
1107
  unknown: "unknown";
1108
+ rate_limit: "rate_limit";
1108
1109
  authentication_failed: "authentication_failed";
1109
1110
  billing_error: "billing_error";
1110
- rate_limit: "rate_limit";
1111
1111
  invalid_request: "invalid_request";
1112
1112
  server_error: "server_error";
1113
1113
  max_output_tokens: "max_output_tokens";
@@ -1142,8 +1142,8 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1142
1142
  agent_type: z.ZodString;
1143
1143
  last_assistant_message: z.ZodOptional<z.ZodString>;
1144
1144
  status: z.ZodOptional<z.ZodEnum<{
1145
- failed: "failed";
1146
1145
  completed: "completed";
1146
+ failed: "failed";
1147
1147
  stopped: "stopped";
1148
1148
  }>>;
1149
1149
  error_message: z.ZodOptional<z.ZodString>;
@@ -1157,8 +1157,8 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1157
1157
  }, z.core.$strip>, z.ZodObject<{
1158
1158
  hook_event_name: z.ZodLiteral<"PreCompact">;
1159
1159
  trigger: z.ZodEnum<{
1160
- manual: "manual";
1161
1160
  auto: "auto";
1161
+ manual: "manual";
1162
1162
  }>;
1163
1163
  custom_instructions: z.ZodNullable<z.ZodString>;
1164
1164
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1171,8 +1171,8 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1171
1171
  }, z.core.$strip>, z.ZodObject<{
1172
1172
  hook_event_name: z.ZodLiteral<"PostCompact">;
1173
1173
  trigger: z.ZodEnum<{
1174
- manual: "manual";
1175
1174
  auto: "auto";
1175
+ manual: "manual";
1176
1176
  }>;
1177
1177
  compact_summary: z.ZodString;
1178
1178
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1246,8 +1246,8 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1246
1246
  default: "default";
1247
1247
  acceptEdits: "acceptEdits";
1248
1248
  bypassPermissions: "bypassPermissions";
1249
- plan: "plan";
1250
1249
  dontAsk: "dontAsk";
1250
+ plan: "plan";
1251
1251
  }>>;
1252
1252
  destination: z.ZodEnum<{
1253
1253
  userSettings: "userSettings";
@@ -1378,11 +1378,11 @@ export declare const HookInputSchema: () => z.ZodUnion<readonly [z.ZodIntersecti
1378
1378
  }, z.core.$strip>, z.ZodObject<{
1379
1379
  hook_event_name: z.ZodLiteral<"ConfigChange">;
1380
1380
  source: z.ZodEnum<{
1381
+ skills: "skills";
1381
1382
  user_settings: "user_settings";
1382
1383
  project_settings: "project_settings";
1383
1384
  local_settings: "local_settings";
1384
1385
  policy_settings: "policy_settings";
1385
- skills: "skills";
1386
1386
  }>;
1387
1387
  file_path: z.ZodOptional<z.ZodString>;
1388
1388
  }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
@@ -1573,8 +1573,8 @@ export declare const PermissionRequestHookSpecificOutputSchema: () => z.ZodObjec
1573
1573
  default: "default";
1574
1574
  acceptEdits: "acceptEdits";
1575
1575
  bypassPermissions: "bypassPermissions";
1576
- plan: "plan";
1577
1576
  dontAsk: "dontAsk";
1577
+ plan: "plan";
1578
1578
  }>>;
1579
1579
  destination: z.ZodEnum<{
1580
1580
  userSettings: "userSettings";
@@ -1730,8 +1730,8 @@ export declare const SyncHookJSONOutputSchema: () => z.ZodObject<{
1730
1730
  default: "default";
1731
1731
  acceptEdits: "acceptEdits";
1732
1732
  bypassPermissions: "bypassPermissions";
1733
- plan: "plan";
1734
1733
  dontAsk: "dontAsk";
1734
+ plan: "plan";
1735
1735
  }>>;
1736
1736
  destination: z.ZodEnum<{
1737
1737
  userSettings: "userSettings";
@@ -1930,8 +1930,8 @@ export declare const HookJSONOutputSchema: () => z.ZodUnion<readonly [z.ZodObjec
1930
1930
  default: "default";
1931
1931
  acceptEdits: "acceptEdits";
1932
1932
  bypassPermissions: "bypassPermissions";
1933
- plan: "plan";
1934
1933
  dontAsk: "dontAsk";
1934
+ plan: "plan";
1935
1935
  }>>;
1936
1936
  destination: z.ZodEnum<{
1937
1937
  userSettings: "userSettings";
@@ -2095,9 +2095,9 @@ export declare const AgentDefinitionSchema: () => z.ZodObject<{
2095
2095
  maxTurns: z.ZodOptional<z.ZodNumber>;
2096
2096
  background: z.ZodOptional<z.ZodBoolean>;
2097
2097
  memory: z.ZodOptional<z.ZodEnum<{
2098
+ local: "local";
2098
2099
  user: "user";
2099
2100
  project: "project";
2100
- local: "local";
2101
2101
  }>>;
2102
2102
  effort: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2103
2103
  low: "low";
@@ -2109,14 +2109,14 @@ export declare const AgentDefinitionSchema: () => z.ZodObject<{
2109
2109
  default: "default";
2110
2110
  acceptEdits: "acceptEdits";
2111
2111
  bypassPermissions: "bypassPermissions";
2112
- plan: "plan";
2113
2112
  dontAsk: "dontAsk";
2113
+ plan: "plan";
2114
2114
  }>>;
2115
2115
  }, z.core.$strip>;
2116
2116
  export declare const SettingSourceSchema: () => z.ZodEnum<{
2117
+ local: "local";
2117
2118
  user: "user";
2118
2119
  project: "project";
2119
- local: "local";
2120
2120
  }>;
2121
2121
  export declare const SdkPluginConfigSchema: () => z.ZodObject<{
2122
2122
  type: z.ZodLiteral<"local">;
@@ -2141,9 +2141,9 @@ export declare const UUIDPlaceholder: () => z.ZodString;
2141
2141
  export declare const NonNullableUsagePlaceholder: () => z.ZodUnknown;
2142
2142
  export declare const SDKAssistantMessageErrorSchema: () => z.ZodEnum<{
2143
2143
  unknown: "unknown";
2144
+ rate_limit: "rate_limit";
2144
2145
  authentication_failed: "authentication_failed";
2145
2146
  billing_error: "billing_error";
2146
- rate_limit: "rate_limit";
2147
2147
  invalid_request: "invalid_request";
2148
2148
  server_error: "server_error";
2149
2149
  max_output_tokens: "max_output_tokens";
@@ -2183,8 +2183,8 @@ export declare const SDKUserMessageReplaySchema: () => z.ZodObject<{
2183
2183
  export declare const SDKRateLimitInfoSchema: () => z.ZodObject<{
2184
2184
  status: z.ZodEnum<{
2185
2185
  allowed: "allowed";
2186
- allowed_warning: "allowed_warning";
2187
2186
  rejected: "rejected";
2187
+ allowed_warning: "allowed_warning";
2188
2188
  }>;
2189
2189
  resetsAt: z.ZodOptional<z.ZodNumber>;
2190
2190
  rateLimitType: z.ZodOptional<z.ZodEnum<{
@@ -2197,8 +2197,8 @@ export declare const SDKRateLimitInfoSchema: () => z.ZodObject<{
2197
2197
  utilization: z.ZodOptional<z.ZodNumber>;
2198
2198
  overageStatus: z.ZodOptional<z.ZodEnum<{
2199
2199
  allowed: "allowed";
2200
- allowed_warning: "allowed_warning";
2201
2200
  rejected: "rejected";
2201
+ allowed_warning: "allowed_warning";
2202
2202
  }>>;
2203
2203
  overageResetsAt: z.ZodOptional<z.ZodNumber>;
2204
2204
  overageDisabledReason: z.ZodOptional<z.ZodEnum<{
@@ -2225,9 +2225,9 @@ export declare const SDKAssistantMessageSchema: () => z.ZodObject<{
2225
2225
  parent_tool_use_id: z.ZodNullable<z.ZodString>;
2226
2226
  error: z.ZodOptional<z.ZodEnum<{
2227
2227
  unknown: "unknown";
2228
+ rate_limit: "rate_limit";
2228
2229
  authentication_failed: "authentication_failed";
2229
2230
  billing_error: "billing_error";
2230
- rate_limit: "rate_limit";
2231
2231
  invalid_request: "invalid_request";
2232
2232
  server_error: "server_error";
2233
2233
  max_output_tokens: "max_output_tokens";
@@ -2240,8 +2240,8 @@ export declare const SDKRateLimitEventSchema: () => z.ZodObject<{
2240
2240
  rate_limit_info: z.ZodObject<{
2241
2241
  status: z.ZodEnum<{
2242
2242
  allowed: "allowed";
2243
- allowed_warning: "allowed_warning";
2244
2243
  rejected: "rejected";
2244
+ allowed_warning: "allowed_warning";
2245
2245
  }>;
2246
2246
  resetsAt: z.ZodOptional<z.ZodNumber>;
2247
2247
  rateLimitType: z.ZodOptional<z.ZodEnum<{
@@ -2254,8 +2254,8 @@ export declare const SDKRateLimitEventSchema: () => z.ZodObject<{
2254
2254
  utilization: z.ZodOptional<z.ZodNumber>;
2255
2255
  overageStatus: z.ZodOptional<z.ZodEnum<{
2256
2256
  allowed: "allowed";
2257
- allowed_warning: "allowed_warning";
2258
2257
  rejected: "rejected";
2258
+ allowed_warning: "allowed_warning";
2259
2259
  }>>;
2260
2260
  overageResetsAt: z.ZodOptional<z.ZodNumber>;
2261
2261
  overageDisabledReason: z.ZodOptional<z.ZodEnum<{
@@ -2450,9 +2450,9 @@ export declare const SDKSystemMessageSchema: () => z.ZodObject<{
2450
2450
  apiKeySource: z.ZodEnum<{
2451
2451
  user: "user";
2452
2452
  project: "project";
2453
+ oauth: "oauth";
2453
2454
  org: "org";
2454
2455
  temporary: "temporary";
2455
- oauth: "oauth";
2456
2456
  }>;
2457
2457
  betas: z.ZodOptional<z.ZodArray<z.ZodString>>;
2458
2458
  claude_code_version: z.ZodString;
@@ -2467,8 +2467,8 @@ export declare const SDKSystemMessageSchema: () => z.ZodObject<{
2467
2467
  default: "default";
2468
2468
  acceptEdits: "acceptEdits";
2469
2469
  bypassPermissions: "bypassPermissions";
2470
- plan: "plan";
2471
2470
  dontAsk: "dontAsk";
2471
+ plan: "plan";
2472
2472
  }>;
2473
2473
  slash_commands: z.ZodArray<z.ZodString>;
2474
2474
  output_style: z.ZodString;
@@ -2498,8 +2498,8 @@ export declare const SDKCompactBoundaryMessageSchema: () => z.ZodObject<{
2498
2498
  subtype: z.ZodLiteral<"compact_boundary">;
2499
2499
  compact_metadata: z.ZodObject<{
2500
2500
  trigger: z.ZodEnum<{
2501
- manual: "manual";
2502
2501
  auto: "auto";
2502
+ manual: "manual";
2503
2503
  }>;
2504
2504
  pre_tokens: z.ZodNumber;
2505
2505
  post_tokens: z.ZodOptional<z.ZodNumber>;
@@ -2520,8 +2520,8 @@ export declare const SDKStatusMessageSchema: () => z.ZodObject<{
2520
2520
  default: "default";
2521
2521
  acceptEdits: "acceptEdits";
2522
2522
  bypassPermissions: "bypassPermissions";
2523
- plan: "plan";
2524
2523
  dontAsk: "dontAsk";
2524
+ plan: "plan";
2525
2525
  }>>;
2526
2526
  uuid: z.ZodString;
2527
2527
  session_id: z.ZodString;
@@ -2531,10 +2531,10 @@ export declare const SDKPostTurnSummaryMessageSchema: () => z.ZodObject<{
2531
2531
  subtype: z.ZodLiteral<"post_turn_summary">;
2532
2532
  summarizes_uuid: z.ZodString;
2533
2533
  status_category: z.ZodEnum<{
2534
- failed: "failed";
2535
2534
  completed: "completed";
2536
- blocked: "blocked";
2537
2535
  waiting: "waiting";
2536
+ failed: "failed";
2537
+ blocked: "blocked";
2538
2538
  review_ready: "review_ready";
2539
2539
  }>;
2540
2540
  status_detail: z.ZodString;
@@ -2556,9 +2556,9 @@ export declare const SDKAPIRetryMessageSchema: () => z.ZodObject<{
2556
2556
  error_status: z.ZodNullable<z.ZodNumber>;
2557
2557
  error: z.ZodEnum<{
2558
2558
  unknown: "unknown";
2559
+ rate_limit: "rate_limit";
2559
2560
  authentication_failed: "authentication_failed";
2560
2561
  billing_error: "billing_error";
2561
- rate_limit: "rate_limit";
2562
2562
  invalid_request: "invalid_request";
2563
2563
  server_error: "server_error";
2564
2564
  max_output_tokens: "max_output_tokens";
@@ -2651,8 +2651,8 @@ export declare const SDKTaskNotificationMessageSchema: () => z.ZodObject<{
2651
2651
  task_id: z.ZodString;
2652
2652
  tool_use_id: z.ZodOptional<z.ZodString>;
2653
2653
  status: z.ZodEnum<{
2654
- failed: "failed";
2655
2654
  completed: "completed";
2655
+ failed: "failed";
2656
2656
  stopped: "stopped";
2657
2657
  }>;
2658
2658
  output_file: z.ZodString;
@@ -2744,9 +2744,9 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
2744
2744
  parent_tool_use_id: z.ZodNullable<z.ZodString>;
2745
2745
  error: z.ZodOptional<z.ZodEnum<{
2746
2746
  unknown: "unknown";
2747
+ rate_limit: "rate_limit";
2747
2748
  authentication_failed: "authentication_failed";
2748
2749
  billing_error: "billing_error";
2749
- rate_limit: "rate_limit";
2750
2750
  invalid_request: "invalid_request";
2751
2751
  server_error: "server_error";
2752
2752
  max_output_tokens: "max_output_tokens";
@@ -2861,9 +2861,9 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
2861
2861
  apiKeySource: z.ZodEnum<{
2862
2862
  user: "user";
2863
2863
  project: "project";
2864
+ oauth: "oauth";
2864
2865
  org: "org";
2865
2866
  temporary: "temporary";
2866
- oauth: "oauth";
2867
2867
  }>;
2868
2868
  betas: z.ZodOptional<z.ZodArray<z.ZodString>>;
2869
2869
  claude_code_version: z.ZodString;
@@ -2878,8 +2878,8 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
2878
2878
  default: "default";
2879
2879
  acceptEdits: "acceptEdits";
2880
2880
  bypassPermissions: "bypassPermissions";
2881
- plan: "plan";
2882
2881
  dontAsk: "dontAsk";
2882
+ plan: "plan";
2883
2883
  }>;
2884
2884
  slash_commands: z.ZodArray<z.ZodString>;
2885
2885
  output_style: z.ZodString;
@@ -2907,8 +2907,8 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
2907
2907
  subtype: z.ZodLiteral<"compact_boundary">;
2908
2908
  compact_metadata: z.ZodObject<{
2909
2909
  trigger: z.ZodEnum<{
2910
- manual: "manual";
2911
2910
  auto: "auto";
2911
+ manual: "manual";
2912
2912
  }>;
2913
2913
  pre_tokens: z.ZodNumber;
2914
2914
  post_tokens: z.ZodOptional<z.ZodNumber>;
@@ -2928,8 +2928,8 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
2928
2928
  default: "default";
2929
2929
  acceptEdits: "acceptEdits";
2930
2930
  bypassPermissions: "bypassPermissions";
2931
- plan: "plan";
2932
2931
  dontAsk: "dontAsk";
2932
+ plan: "plan";
2933
2933
  }>>;
2934
2934
  uuid: z.ZodString;
2935
2935
  session_id: z.ZodString;
@@ -2942,9 +2942,9 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
2942
2942
  error_status: z.ZodNullable<z.ZodNumber>;
2943
2943
  error: z.ZodEnum<{
2944
2944
  unknown: "unknown";
2945
+ rate_limit: "rate_limit";
2945
2946
  authentication_failed: "authentication_failed";
2946
2947
  billing_error: "billing_error";
2947
- rate_limit: "rate_limit";
2948
2948
  invalid_request: "invalid_request";
2949
2949
  server_error: "server_error";
2950
2950
  max_output_tokens: "max_output_tokens";
@@ -3015,8 +3015,8 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
3015
3015
  task_id: z.ZodString;
3016
3016
  tool_use_id: z.ZodOptional<z.ZodString>;
3017
3017
  status: z.ZodEnum<{
3018
- failed: "failed";
3019
3018
  completed: "completed";
3019
+ failed: "failed";
3020
3020
  stopped: "stopped";
3021
3021
  }>;
3022
3022
  output_file: z.ZodString;
@@ -3089,8 +3089,8 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
3089
3089
  rate_limit_info: z.ZodObject<{
3090
3090
  status: z.ZodEnum<{
3091
3091
  allowed: "allowed";
3092
- allowed_warning: "allowed_warning";
3093
3092
  rejected: "rejected";
3093
+ allowed_warning: "allowed_warning";
3094
3094
  }>;
3095
3095
  resetsAt: z.ZodOptional<z.ZodNumber>;
3096
3096
  rateLimitType: z.ZodOptional<z.ZodEnum<{
@@ -3103,8 +3103,8 @@ export declare const SDKMessageSchema: () => z.ZodUnion<readonly [z.ZodObject<{
3103
3103
  utilization: z.ZodOptional<z.ZodNumber>;
3104
3104
  overageStatus: z.ZodOptional<z.ZodEnum<{
3105
3105
  allowed: "allowed";
3106
- allowed_warning: "allowed_warning";
3107
3106
  rejected: "rejected";
3107
+ allowed_warning: "allowed_warning";
3108
3108
  }>>;
3109
3109
  overageResetsAt: z.ZodOptional<z.ZodNumber>;
3110
3110
  overageDisabledReason: z.ZodOptional<z.ZodEnum<{
@@ -1,7 +1,7 @@
1
1
  import type { ChildProcessWithoutNullStreams } from 'node:child_process';
2
2
  import type { ModelProviders } from '../../providers/shared/routing.js';
3
3
  import type { UploadMediaFn } from '../../types/toolRuntime.js';
4
- export type { ModelProviders, ModelProviderConfig } from '../../providers/shared/routing.js';
4
+ export type { ModelProviders, ModelProviderConfig, } from '../../providers/shared/routing.js';
5
5
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
6
  import type { CallToolResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
7
7
  import type { z } from 'zod/v4';
@@ -122,6 +122,81 @@ export type SdkMcpToolDefinition<Schema extends AnyZodRawShape = AnyZodRawShape>
122
122
  };
123
123
  export type SettingSource = 'user' | 'project' | 'local';
124
124
  export type BuiltInToolPreset = 'default' | 'none';
125
+ /** A Claude-compatible plugin directory loaded explicitly by the host. */
126
+ export type SdkLocalPlugin = {
127
+ type: 'local';
128
+ path: string;
129
+ };
130
+ export type SdkPluginComponentKind = 'skill' | 'command' | 'agent' | 'hook' | 'mcp' | 'lsp' | 'output-style' | 'monitor';
131
+ export type SdkPluginPermissionGrant = {
132
+ /** Import-time plugin identity approved by the host. */
133
+ contentHash: string;
134
+ approved: boolean;
135
+ grantedAt?: string;
136
+ /** Approved process commands declared by hooks, MCP, and LSP components. */
137
+ process?: readonly string[];
138
+ /** Approved HTTP(S) origins declared by plugin runtime components. */
139
+ network?: readonly string[];
140
+ /** Approved environment variable names referenced by runtime components. */
141
+ environment?: readonly string[];
142
+ /** Approved writable roots. Managed plugins must include their dataPath. */
143
+ writableDirectories?: readonly string[];
144
+ };
145
+ export type SdkManagedPlugin = {
146
+ id: string;
147
+ source: SdkLocalPlugin;
148
+ /** Import-time version identity; managed snapshots do not re-hash source.path. */
149
+ contentHash: string;
150
+ dataPath: string;
151
+ permissionGrant: SdkPluginPermissionGrant;
152
+ };
153
+ export type SdkPluginSnapshot = {
154
+ revision: string;
155
+ plugins: readonly SdkManagedPlugin[];
156
+ };
157
+ export type SdkPluginDiagnostic = {
158
+ severity: 'warning' | 'error';
159
+ code: string;
160
+ message: string;
161
+ pluginId?: string;
162
+ componentKind?: SdkPluginComponentKind;
163
+ componentName?: string;
164
+ };
165
+ export type SdkPluginComponentCounts = Record<SdkPluginComponentKind, number>;
166
+ export type SdkPluginCommandCatalogEntry = {
167
+ runtimeId: string;
168
+ pluginId: string;
169
+ componentKind: 'command' | 'skill';
170
+ name: string;
171
+ /** Runtime-only user-facing name resolved from the loaded component. */
172
+ displayName?: string;
173
+ description: string;
174
+ argumentHint?: string;
175
+ sourcePath?: string;
176
+ };
177
+ export type SdkPluginAgentCatalogEntry = {
178
+ runtimeId: string;
179
+ pluginId: string;
180
+ name: string;
181
+ description: string;
182
+ sourcePath?: string;
183
+ };
184
+ export type SdkPluginApplyResult = {
185
+ status: 'applied' | 'unchanged' | 'rejected';
186
+ requestedRevision: string;
187
+ appliedRevision: string | null;
188
+ componentCounts: SdkPluginComponentCounts;
189
+ commandCatalog: readonly SdkPluginCommandCatalogEntry[];
190
+ agentCatalog: readonly SdkPluginAgentCatalogEntry[];
191
+ diagnostics: readonly SdkPluginDiagnostic[];
192
+ };
193
+ export type SdkPluginState = {
194
+ appliedRevision: string | null;
195
+ componentCounts: SdkPluginComponentCounts;
196
+ commandCatalog: readonly SdkPluginCommandCatalogEntry[];
197
+ agentCatalog: readonly SdkPluginAgentCatalogEntry[];
198
+ diagnostics: readonly SdkPluginDiagnostic[];
199
+ };
125
200
  import type { SdkTool } from '../../capabilities/SdkTool.js';
126
201
  import type { LayoutProfile } from '../../session/layout/LayoutProfile.js';
127
202
  import type { SdkRule } from '../../session/rules/SdkRule.js';
@@ -131,6 +206,8 @@ import type { BrandingOptions } from '../../session/brandingConfig.js';
131
206
  export type { BrandingOptions } from '../../session/brandingConfig.js';
132
207
  export type Options = {
133
208
  cwd?: string;
209
+ /** Claude-compatible local plugin roots. No settings or marketplace state is read. */
210
+ plugins?: readonly SdkLocalPlugin[];
134
211
  /**
135
212
  * Host-controlled product and assistant names.
136
213
  *
@@ -521,6 +598,10 @@ export type SDKSession = {
521
598
  }): Query;
522
599
  prompt(message: string, options?: Options): Promise<SDKResultMessage>;
523
600
  getInfo(): Promise<SDKSessionInfo | undefined>;
601
+ /** Atomically replace this session's managed plugin revision while idle. */
602
+ applyPluginSnapshot(snapshot: SdkPluginSnapshot): Promise<SdkPluginApplyResult>;
603
+ /** Read the last successfully applied plugin revision and diagnostics. */
604
+ getPluginState(): SdkPluginState;
524
605
  /**
525
606
  * Tear down the session container and fire the SessionEnd hook once.
526
607
  *
@@ -5,16 +5,16 @@ export declare const permissionModeSchema: () => z.ZodEnum<{
5
5
  default: "default";
6
6
  acceptEdits: "acceptEdits";
7
7
  bypassPermissions: "bypassPermissions";
8
- plan: "plan";
9
8
  dontAsk: "dontAsk";
9
+ plan: "plan";
10
10
  auto: "auto";
11
11
  }>;
12
12
  export declare const externalPermissionModeSchema: () => z.ZodEnum<{
13
13
  default: "default";
14
14
  acceptEdits: "acceptEdits";
15
15
  bypassPermissions: "bypassPermissions";
16
- plan: "plan";
17
16
  dontAsk: "dontAsk";
17
+ plan: "plan";
18
18
  }>;
19
19
  type ModeColorKey = 'text' | 'planMode' | 'permission' | 'autoAccept' | 'error' | 'warning';
20
20
  /**
@@ -70,8 +70,8 @@ export declare const outputSchema: () => z.ZodUnion<readonly [z.ZodObject<{
70
70
  default: "default";
71
71
  acceptEdits: "acceptEdits";
72
72
  bypassPermissions: "bypassPermissions";
73
- plan: "plan";
74
73
  dontAsk: "dontAsk";
74
+ plan: "plan";
75
75
  }>;
76
76
  destination: z.ZodEnum<{
77
77
  userSettings: "userSettings";