@anthropic-ai/claude-agent-sdk 0.1.25 → 0.1.27

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "engines": {
@@ -23,9 +23,6 @@
23
23
  "automation",
24
24
  "code-generation"
25
25
  ],
26
- "scripts": {
27
- "prepare": "node -e \"if (!process.env.AUTHORIZED) { console.error('ERROR: Direct publishing is not allowed.\\nPlease use the publish-agent-sdk.sh script to publish this package.'); process.exit(1); }\""
28
- },
29
26
  "dependencies": {},
30
27
  "peerDependencies": {
31
28
  "zod": "^3.24.1"
package/sdk-tools.d.ts CHANGED
@@ -72,7 +72,7 @@ export interface BashInput {
72
72
  /**
73
73
  * Set this to true to dangerously override sandbox mode and run commands without sandboxing.
74
74
  */
75
- dangerouslyOverrideSandbox?: boolean;
75
+ dangerouslyDisableSandbox?: boolean;
76
76
  }
77
77
  export interface BashOutputInput {
78
78
  /**
package/sdk.d.ts CHANGED
@@ -324,6 +324,10 @@ export type SDKSystemMessage = SDKMessageBase & {
324
324
  slash_commands: string[];
325
325
  output_style: string;
326
326
  skills: string[];
327
+ plugins: {
328
+ name: string;
329
+ path: string;
330
+ }[];
327
331
  };
328
332
  export type SDKPartialAssistantMessage = SDKMessageBase & {
329
333
  type: 'stream_event';
@@ -398,6 +402,10 @@ export type AgentDefinition = {
398
402
  model?: 'sonnet' | 'opus' | 'haiku' | 'inherit';
399
403
  };
400
404
  export type SettingSource = 'user' | 'project' | 'local';
405
+ export type SdkPluginConfig = {
406
+ type: 'local';
407
+ path: string;
408
+ };
401
409
  export type Options = {
402
410
  abortController?: AbortController;
403
411
  additionalDirectories?: string[];
@@ -427,7 +435,23 @@ export type Options = {
427
435
  model?: string;
428
436
  pathToClaudeCodeExecutable?: string;
429
437
  permissionMode?: PermissionMode;
438
+ allowDangerouslySkipPermissions?: boolean;
430
439
  permissionPromptToolName?: string;
440
+ /**
441
+ * Load plugins for this session. Plugins provide custom commands, agents,
442
+ * skills, and hooks that extend Claude Code's capabilities.
443
+ *
444
+ * Currently only local plugins are supported via the 'local' type.
445
+ *
446
+ * @example
447
+ * ```typescript
448
+ * plugins: [
449
+ * { type: 'local', path: './my-plugin' },
450
+ * { type: 'local', path: '/absolute/path/to/plugin' }
451
+ * ]
452
+ * ```
453
+ */
454
+ plugins?: SdkPluginConfig[];
431
455
  resume?: string;
432
456
  /**
433
457
  * When resuming, only resume messages up to and including the assistant
package/sdk.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://docs.claude.com/en/docs/claude-code/legal-and-compliance.
3
3
 
4
- // Version: 0.1.25
4
+ // Version: 0.1.27
5
5
 
6
6
  // Want to see the unminified source? We're hiring!
7
7
  // https://job-boards.greenhouse.io/anthropic/jobs/4816199008
@@ -6390,6 +6390,7 @@ class ProcessTransport {
6390
6390
  model,
6391
6391
  fallbackModel,
6392
6392
  permissionMode,
6393
+ allowDangerouslySkipPermissions,
6393
6394
  permissionPromptToolName,
6394
6395
  continueConversation,
6395
6396
  resume,
@@ -6399,7 +6400,8 @@ class ProcessTransport {
6399
6400
  mcpServers,
6400
6401
  strictMcpConfig,
6401
6402
  canUseTool,
6402
- includePartialMessages
6403
+ includePartialMessages,
6404
+ plugins
6403
6405
  } = this.options;
6404
6406
  const args = [
6405
6407
  "--output-format",
@@ -6454,6 +6456,9 @@ class ProcessTransport {
6454
6456
  if (permissionMode) {
6455
6457
  args.push("--permission-mode", permissionMode);
6456
6458
  }
6459
+ if (allowDangerouslySkipPermissions) {
6460
+ args.push("--allow-dangerously-skip-permissions");
6461
+ }
6457
6462
  if (fallbackModel) {
6458
6463
  if (model && fallbackModel === model) {
6459
6464
  throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");
@@ -6466,6 +6471,15 @@ class ProcessTransport {
6466
6471
  for (const dir of additionalDirectories) {
6467
6472
  args.push("--add-dir", dir);
6468
6473
  }
6474
+ if (plugins && plugins.length > 0) {
6475
+ for (const plugin of plugins) {
6476
+ if (plugin.type === "local") {
6477
+ args.push("--plugin-dir", plugin.path);
6478
+ } else {
6479
+ throw new Error(`Unsupported plugin type: ${plugin.type}`);
6480
+ }
6481
+ }
6482
+ }
6469
6483
  if (this.options.forkSession) {
6470
6484
  args.push("--fork-session");
6471
6485
  }
@@ -14745,7 +14759,7 @@ function query({
14745
14759
  const dirname2 = join3(filename, "..");
14746
14760
  pathToClaudeCodeExecutable = join3(dirname2, "cli.js");
14747
14761
  }
14748
- process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.25";
14762
+ process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.27";
14749
14763
  const {
14750
14764
  abortController = createAbortController(),
14751
14765
  additionalDirectories = [],
@@ -14768,7 +14782,9 @@ function query({
14768
14782
  mcpServers,
14769
14783
  model,
14770
14784
  permissionMode = "default",
14785
+ allowDangerouslySkipPermissions = false,
14771
14786
  permissionPromptToolName,
14787
+ plugins,
14772
14788
  resume,
14773
14789
  resumeSessionAt,
14774
14790
  stderr,
@@ -14819,6 +14835,7 @@ function query({
14819
14835
  model,
14820
14836
  fallbackModel,
14821
14837
  permissionMode,
14838
+ allowDangerouslySkipPermissions,
14822
14839
  permissionPromptToolName,
14823
14840
  continueConversation,
14824
14841
  resume,
@@ -14830,7 +14847,8 @@ function query({
14830
14847
  strictMcpConfig,
14831
14848
  canUseTool: !!canUseTool,
14832
14849
  hooks: !!hooks,
14833
- includePartialMessages
14850
+ includePartialMessages,
14851
+ plugins
14834
14852
  });
14835
14853
  const queryInstance = new Query(transport, isSingleUserTurn, canUseTool, hooks, abortController, sdkMcpServers);
14836
14854
  if (typeof prompt === "string") {
package/yoga.wasm DELETED
Binary file