@anthropic-ai/claude-agent-sdk 0.1.26 → 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/cli.js +960 -960
- package/package.json +1 -1
- package/sdk.d.ts +23 -0
- package/sdk.mjs +16 -4
- package/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.12-beta-searchableOptions.jar +0 -0
- package/vendor/claude-code-jetbrains-plugin/lib/{claude-code-jetbrains-plugin-0.1.11-beta.jar → claude-code-jetbrains-plugin-0.1.12-beta.jar} +0 -0
- package/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta-searchableOptions.jar +0 -0
package/package.json
CHANGED
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[];
|
|
@@ -429,6 +437,21 @@ export type Options = {
|
|
|
429
437
|
permissionMode?: PermissionMode;
|
|
430
438
|
allowDangerouslySkipPermissions?: boolean;
|
|
431
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[];
|
|
432
455
|
resume?: string;
|
|
433
456
|
/**
|
|
434
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.
|
|
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
|
|
@@ -6400,7 +6400,8 @@ class ProcessTransport {
|
|
|
6400
6400
|
mcpServers,
|
|
6401
6401
|
strictMcpConfig,
|
|
6402
6402
|
canUseTool,
|
|
6403
|
-
includePartialMessages
|
|
6403
|
+
includePartialMessages,
|
|
6404
|
+
plugins
|
|
6404
6405
|
} = this.options;
|
|
6405
6406
|
const args = [
|
|
6406
6407
|
"--output-format",
|
|
@@ -6470,6 +6471,15 @@ class ProcessTransport {
|
|
|
6470
6471
|
for (const dir of additionalDirectories) {
|
|
6471
6472
|
args.push("--add-dir", dir);
|
|
6472
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
|
+
}
|
|
6473
6483
|
if (this.options.forkSession) {
|
|
6474
6484
|
args.push("--fork-session");
|
|
6475
6485
|
}
|
|
@@ -14749,7 +14759,7 @@ function query({
|
|
|
14749
14759
|
const dirname2 = join3(filename, "..");
|
|
14750
14760
|
pathToClaudeCodeExecutable = join3(dirname2, "cli.js");
|
|
14751
14761
|
}
|
|
14752
|
-
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.
|
|
14762
|
+
process.env.CLAUDE_AGENT_SDK_VERSION = "0.1.27";
|
|
14753
14763
|
const {
|
|
14754
14764
|
abortController = createAbortController(),
|
|
14755
14765
|
additionalDirectories = [],
|
|
@@ -14774,6 +14784,7 @@ function query({
|
|
|
14774
14784
|
permissionMode = "default",
|
|
14775
14785
|
allowDangerouslySkipPermissions = false,
|
|
14776
14786
|
permissionPromptToolName,
|
|
14787
|
+
plugins,
|
|
14777
14788
|
resume,
|
|
14778
14789
|
resumeSessionAt,
|
|
14779
14790
|
stderr,
|
|
@@ -14836,7 +14847,8 @@ function query({
|
|
|
14836
14847
|
strictMcpConfig,
|
|
14837
14848
|
canUseTool: !!canUseTool,
|
|
14838
14849
|
hooks: !!hooks,
|
|
14839
|
-
includePartialMessages
|
|
14850
|
+
includePartialMessages,
|
|
14851
|
+
plugins
|
|
14840
14852
|
});
|
|
14841
14853
|
const queryInstance = new Query(transport, isSingleUserTurn, canUseTool, hooks, abortController, sdkMcpServers);
|
|
14842
14854
|
if (typeof prompt === "string") {
|
|
Binary file
|
|
index e855e95..8716feb 100644
|
|
|
Binary file
|