@anthropic-ai/claude-agent-sdk 0.3.231 → 0.3.233
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/bridge.mjs +76 -76
- package/browser-sdk.js +47 -47
- package/manifest.json +19 -19
- package/manifest.zst.json +25 -21
- package/package.json +10 -10
- package/sdk.d.ts +539 -41
- package/sdk.mjs +81 -81
package/sdk.d.ts
CHANGED
|
@@ -393,6 +393,8 @@ declare namespace coreTypes {
|
|
|
393
393
|
SDKBackgroundTasksChangedMessage,
|
|
394
394
|
SDKCommandsChangedMessage,
|
|
395
395
|
SDKCompactBoundaryMessage,
|
|
396
|
+
SDKContextUsageCategory,
|
|
397
|
+
SDKContextUsage,
|
|
396
398
|
SDKControlRequestProgressMessage,
|
|
397
399
|
SDKConversationResetMessage,
|
|
398
400
|
SDKDeferredToolUse,
|
|
@@ -2716,7 +2718,7 @@ export declare type ResolvedSettingSource = SettingSource | 'managed' | 'flag';
|
|
|
2716
2718
|
* - **The policy tier matches CLI startup** (managed-settings.json,
|
|
2717
2719
|
* remote-cached managed settings, MDM via macOS plist / Windows
|
|
2718
2720
|
* HKLM/HKCU, and `managedSettings`) **except** the admin-configured
|
|
2719
|
-
* `policyHelper
|
|
2721
|
+
* `policyHelper` subprocess is not executed. MDM resolution may invoke
|
|
2720
2722
|
* `plutil` (macOS, when an MDM plist exists) or `reg.exe` (Windows/WSL)
|
|
2721
2723
|
* on the first call per process. If your deployment relies on
|
|
2722
2724
|
* policyHelper to inject managed settings, results will differ.
|
|
@@ -3050,6 +3052,10 @@ export declare type SDKAssistantMessage = {
|
|
|
3050
3052
|
*/
|
|
3051
3053
|
timestamp?: string;
|
|
3052
3054
|
|
|
3055
|
+
/**
|
|
3056
|
+
* Structured twin of the /context report, carried on the synthetic assistant message that delivers the markdown table. Present only on /context results from CLIs new enough to attach it; the markdown in message.content remains the canonical fallback. Wrapper-level sibling — never inside `message.content` — so it is not replayed to the model.
|
|
3057
|
+
*/
|
|
3058
|
+
context_usage?: SDKContextUsage;
|
|
3053
3059
|
|
|
3054
3060
|
|
|
3055
3061
|
|
|
@@ -3140,6 +3146,87 @@ export declare type SDKCompactBoundaryMessage = {
|
|
|
3140
3146
|
session_id: string;
|
|
3141
3147
|
};
|
|
3142
3148
|
|
|
3149
|
+
/**
|
|
3150
|
+
* Structured twin of the /context report — the data a client needs to render the context-usage card without parsing the markdown table. Evolves additively (new optional fields); a breaking reshape would ship as a sibling field, so consumers can trust the fields they know.
|
|
3151
|
+
*/
|
|
3152
|
+
export declare type SDKContextUsage = {
|
|
3153
|
+
/**
|
|
3154
|
+
* Main-loop model the usage was computed for.
|
|
3155
|
+
*/
|
|
3156
|
+
model: string;
|
|
3157
|
+
/**
|
|
3158
|
+
* Estimated tokens in use, unclamped — may exceed raw_max_tokens when over limit.
|
|
3159
|
+
*/
|
|
3160
|
+
total_tokens: number;
|
|
3161
|
+
/**
|
|
3162
|
+
* The window usage is measured against: the resolved autocompact window — the model's believed limit, or a smaller compaction-policy window (a configured value, or e.g. the 200K boundary on 1M-window models).
|
|
3163
|
+
*/
|
|
3164
|
+
raw_max_tokens: number;
|
|
3165
|
+
/**
|
|
3166
|
+
* Rounded total_tokens / raw_max_tokens, 0-100+.
|
|
3167
|
+
*/
|
|
3168
|
+
percentage: number;
|
|
3169
|
+
/**
|
|
3170
|
+
* Present when total_tokens exceeds raw_max_tokens. kind says how the window was resolved, not whether the API will accept the next request: 'hard_limit' means the window is the model's believed limit (the API will refuse past it); 'compaction_window' means a compaction-policy window, which may or may not coincide with the model's hard limit.
|
|
3171
|
+
*/
|
|
3172
|
+
over_limit?: {
|
|
3173
|
+
tokens_over: number;
|
|
3174
|
+
kind: 'hard_limit' | 'compaction_window';
|
|
3175
|
+
};
|
|
3176
|
+
categories: SDKContextUsageCategory[];
|
|
3177
|
+
mcp_tools: {
|
|
3178
|
+
/**
|
|
3179
|
+
* Wire name, e.g. "mcp__linear__create_issue".
|
|
3180
|
+
*/
|
|
3181
|
+
name: string;
|
|
3182
|
+
server_name: string;
|
|
3183
|
+
tokens: number;
|
|
3184
|
+
}[];
|
|
3185
|
+
memory_files: {
|
|
3186
|
+
path: string;
|
|
3187
|
+
/**
|
|
3188
|
+
* Display label of the memory-file source, e.g. "Project" or "User".
|
|
3189
|
+
*/
|
|
3190
|
+
type: string;
|
|
3191
|
+
tokens: number;
|
|
3192
|
+
}[];
|
|
3193
|
+
agents: {
|
|
3194
|
+
agent_type: string;
|
|
3195
|
+
/**
|
|
3196
|
+
* Raw source identifier, e.g. 'projectSettings', 'userSettings', 'plugin'. Built-in agents are excluded by the producer. Display labels are the renderer's concern.
|
|
3197
|
+
*/
|
|
3198
|
+
source: string;
|
|
3199
|
+
tokens: number;
|
|
3200
|
+
}[];
|
|
3201
|
+
/**
|
|
3202
|
+
* Omitted when no skills contribute tokens.
|
|
3203
|
+
*/
|
|
3204
|
+
skills?: {
|
|
3205
|
+
name: string;
|
|
3206
|
+
/**
|
|
3207
|
+
* Raw source identifier, e.g. 'userSettings', 'plugin', 'syncedSkills'.
|
|
3208
|
+
*/
|
|
3209
|
+
source: string;
|
|
3210
|
+
plugin_name?: string;
|
|
3211
|
+
tokens: number;
|
|
3212
|
+
}[];
|
|
3213
|
+
};
|
|
3214
|
+
|
|
3215
|
+
/**
|
|
3216
|
+
* One row of the /context usage-by-category breakdown. Rows may carry zero tokens; renderers typically hide those.
|
|
3217
|
+
*/
|
|
3218
|
+
export declare type SDKContextUsageCategory = {
|
|
3219
|
+
/**
|
|
3220
|
+
* Display name of the row as the CLI renders it, e.g. "Messages" or "MCP tools (deferred)". Use `kind` (not this name) to classify the row.
|
|
3221
|
+
*/
|
|
3222
|
+
name: string;
|
|
3223
|
+
tokens: number;
|
|
3224
|
+
/**
|
|
3225
|
+
* What the row is: 'used' content occupies the window; 'free' is the remaining window; 'buffer' is the compaction reserve (autocompact or manual); 'deferred' rows are out-of-window tool schemas — listed for awareness, excluded from usage math.
|
|
3226
|
+
*/
|
|
3227
|
+
kind: 'used' | 'free' | 'buffer' | 'deferred';
|
|
3228
|
+
};
|
|
3229
|
+
|
|
3143
3230
|
/**
|
|
3144
3231
|
* Merges the provided settings into the flag settings layer, updating the active configuration.
|
|
3145
3232
|
*/
|
|
@@ -3624,6 +3711,8 @@ export declare type SDKControlInitializeResponse = {
|
|
|
3624
3711
|
|
|
3625
3712
|
|
|
3626
3713
|
|
|
3714
|
+
|
|
3715
|
+
|
|
3627
3716
|
fast_mode_state?: coreTypes.FastModeState;
|
|
3628
3717
|
fast_mode_disabled_reason?: coreTypes.FastModeDisabledReason;
|
|
3629
3718
|
|
|
@@ -5170,43 +5259,7 @@ export declare interface Settings {
|
|
|
5170
5259
|
timeoutMs?: number;
|
|
5171
5260
|
refreshIntervalMs?: 0 | number;
|
|
5172
5261
|
};
|
|
5173
|
-
|
|
5174
|
-
* Per-OS variant of policyHelper, keyed by platform: macos, linux, windows, wsl. The entry for the current platform wins over policyHelper; a platform with no entry falls back to policyHelper (wsl falls back to the linux entry first). Honored only from admin-controlled policy sources.
|
|
5175
|
-
*/
|
|
5176
|
-
policyHelpers?: {
|
|
5177
|
-
macos?: {
|
|
5178
|
-
/**
|
|
5179
|
-
* Absolute path to the helper executable
|
|
5180
|
-
*/
|
|
5181
|
-
path: string;
|
|
5182
|
-
timeoutMs?: number;
|
|
5183
|
-
refreshIntervalMs?: 0 | number;
|
|
5184
|
-
};
|
|
5185
|
-
linux?: {
|
|
5186
|
-
/**
|
|
5187
|
-
* Absolute path to the helper executable
|
|
5188
|
-
*/
|
|
5189
|
-
path: string;
|
|
5190
|
-
timeoutMs?: number;
|
|
5191
|
-
refreshIntervalMs?: 0 | number;
|
|
5192
|
-
};
|
|
5193
|
-
windows?: {
|
|
5194
|
-
/**
|
|
5195
|
-
* Absolute path to the helper executable
|
|
5196
|
-
*/
|
|
5197
|
-
path: string;
|
|
5198
|
-
timeoutMs?: number;
|
|
5199
|
-
refreshIntervalMs?: 0 | number;
|
|
5200
|
-
};
|
|
5201
|
-
wsl?: {
|
|
5202
|
-
/**
|
|
5203
|
-
* Absolute path to the helper executable
|
|
5204
|
-
*/
|
|
5205
|
-
path: string;
|
|
5206
|
-
timeoutMs?: number;
|
|
5207
|
-
refreshIntervalMs?: 0 | number;
|
|
5208
|
-
};
|
|
5209
|
-
};
|
|
5262
|
+
|
|
5210
5263
|
/**
|
|
5211
5264
|
* Custom file suggestion configuration for \@ mentions
|
|
5212
5265
|
*/
|
|
@@ -5965,9 +6018,454 @@ export declare interface Settings {
|
|
|
5965
6018
|
};
|
|
5966
6019
|
};
|
|
5967
6020
|
/**
|
|
5968
|
-
*
|
|
6021
|
+
* Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled extraKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it (and their settings sync would upload a file that uses only this spelling as if it declared no marketplaces), so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings.
|
|
5969
6022
|
*/
|
|
5970
|
-
|
|
6023
|
+
additionalMarketplaces?: {
|
|
6024
|
+
[k: string]: {
|
|
6025
|
+
/**
|
|
6026
|
+
* Where to fetch the marketplace from
|
|
6027
|
+
*/
|
|
6028
|
+
source: {
|
|
6029
|
+
source: 'url';
|
|
6030
|
+
/**
|
|
6031
|
+
* Direct URL to marketplace.json file
|
|
6032
|
+
*/
|
|
6033
|
+
url: string;
|
|
6034
|
+
/**
|
|
6035
|
+
* Custom HTTP headers (e.g., for authentication)
|
|
6036
|
+
*/
|
|
6037
|
+
headers?: {
|
|
6038
|
+
[k: string]: string;
|
|
6039
|
+
};
|
|
6040
|
+
} | {
|
|
6041
|
+
source: 'github';
|
|
6042
|
+
/**
|
|
6043
|
+
* GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form "owner/*" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.
|
|
6044
|
+
*/
|
|
6045
|
+
repo: string;
|
|
6046
|
+
/**
|
|
6047
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6048
|
+
*/
|
|
6049
|
+
ref?: string;
|
|
6050
|
+
/**
|
|
6051
|
+
* Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)
|
|
6052
|
+
*/
|
|
6053
|
+
path?: string;
|
|
6054
|
+
/**
|
|
6055
|
+
* Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.
|
|
6056
|
+
*/
|
|
6057
|
+
sparsePaths?: string[];
|
|
6058
|
+
/**
|
|
6059
|
+
* Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.
|
|
6060
|
+
*/
|
|
6061
|
+
skipLfs?: boolean;
|
|
6062
|
+
} | {
|
|
6063
|
+
source: 'git';
|
|
6064
|
+
/**
|
|
6065
|
+
* Full git repository URL
|
|
6066
|
+
*/
|
|
6067
|
+
url: string;
|
|
6068
|
+
/**
|
|
6069
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6070
|
+
*/
|
|
6071
|
+
ref?: string;
|
|
6072
|
+
/**
|
|
6073
|
+
* Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)
|
|
6074
|
+
*/
|
|
6075
|
+
path?: string;
|
|
6076
|
+
/**
|
|
6077
|
+
* Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.
|
|
6078
|
+
*/
|
|
6079
|
+
sparsePaths?: string[];
|
|
6080
|
+
/**
|
|
6081
|
+
* Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.
|
|
6082
|
+
*/
|
|
6083
|
+
skipLfs?: boolean;
|
|
6084
|
+
} | {
|
|
6085
|
+
source: 'npm';
|
|
6086
|
+
/**
|
|
6087
|
+
* NPM package containing marketplace.json
|
|
6088
|
+
*/
|
|
6089
|
+
package: string;
|
|
6090
|
+
} | {
|
|
6091
|
+
source: 'file';
|
|
6092
|
+
/**
|
|
6093
|
+
* Local file path to marketplace.json
|
|
6094
|
+
*/
|
|
6095
|
+
path: string;
|
|
6096
|
+
} | {
|
|
6097
|
+
source: 'directory';
|
|
6098
|
+
/**
|
|
6099
|
+
* Local directory containing .claude-plugin/marketplace.json
|
|
6100
|
+
*/
|
|
6101
|
+
path: string;
|
|
6102
|
+
} | {
|
|
6103
|
+
source: 'skills-dir';
|
|
6104
|
+
} | {
|
|
6105
|
+
source: 'hostPattern';
|
|
6106
|
+
/**
|
|
6107
|
+
* Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\.mycompany\.com$").
|
|
6108
|
+
*/
|
|
6109
|
+
hostPattern: string;
|
|
6110
|
+
} | {
|
|
6111
|
+
source: 'pathPattern';
|
|
6112
|
+
/**
|
|
6113
|
+
* Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.
|
|
6114
|
+
*/
|
|
6115
|
+
pathPattern: string;
|
|
6116
|
+
} | {
|
|
6117
|
+
source: 'settings';
|
|
6118
|
+
/**
|
|
6119
|
+
* Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.
|
|
6120
|
+
*/
|
|
6121
|
+
name: string;
|
|
6122
|
+
/**
|
|
6123
|
+
* Plugin entries declared inline in settings.json
|
|
6124
|
+
*/
|
|
6125
|
+
plugins: {
|
|
6126
|
+
/**
|
|
6127
|
+
* Plugin name as it appears in the target repository
|
|
6128
|
+
*/
|
|
6129
|
+
name: string;
|
|
6130
|
+
/**
|
|
6131
|
+
* Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.
|
|
6132
|
+
*/
|
|
6133
|
+
source: string | {
|
|
6134
|
+
source: 'npm';
|
|
6135
|
+
/**
|
|
6136
|
+
* Package name (or url, or local path, or anything else that can be passed to `npm` as a package)
|
|
6137
|
+
*/
|
|
6138
|
+
package: string;
|
|
6139
|
+
/**
|
|
6140
|
+
* Specific version or version range (e.g., ^1.0.0, ~2.1.0)
|
|
6141
|
+
*/
|
|
6142
|
+
version?: string;
|
|
6143
|
+
/**
|
|
6144
|
+
* Custom NPM registry URL (defaults to using system default, likely npmjs.org)
|
|
6145
|
+
*/
|
|
6146
|
+
registry?: string;
|
|
6147
|
+
} | {
|
|
6148
|
+
source: 'url';
|
|
6149
|
+
/**
|
|
6150
|
+
* Full git repository URL (https:// or git\@)
|
|
6151
|
+
*/
|
|
6152
|
+
url: string;
|
|
6153
|
+
/**
|
|
6154
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6155
|
+
*/
|
|
6156
|
+
ref?: string;
|
|
6157
|
+
/**
|
|
6158
|
+
* Specific commit SHA to use
|
|
6159
|
+
*/
|
|
6160
|
+
sha?: string;
|
|
6161
|
+
} | {
|
|
6162
|
+
source: 'github';
|
|
6163
|
+
/**
|
|
6164
|
+
* GitHub repository in owner/repo format
|
|
6165
|
+
*/
|
|
6166
|
+
repo: string;
|
|
6167
|
+
/**
|
|
6168
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6169
|
+
*/
|
|
6170
|
+
ref?: string;
|
|
6171
|
+
/**
|
|
6172
|
+
* Specific commit SHA to use
|
|
6173
|
+
*/
|
|
6174
|
+
sha?: string;
|
|
6175
|
+
} | {
|
|
6176
|
+
source: 'git-subdir';
|
|
6177
|
+
/**
|
|
6178
|
+
* Git repository: GitHub owner/repo shorthand, https://, or git\@ URL
|
|
6179
|
+
*/
|
|
6180
|
+
url: string;
|
|
6181
|
+
/**
|
|
6182
|
+
* Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.
|
|
6183
|
+
*/
|
|
6184
|
+
path: string;
|
|
6185
|
+
/**
|
|
6186
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6187
|
+
*/
|
|
6188
|
+
ref?: string;
|
|
6189
|
+
/**
|
|
6190
|
+
* Specific commit SHA to use
|
|
6191
|
+
*/
|
|
6192
|
+
sha?: string;
|
|
6193
|
+
} | {
|
|
6194
|
+
source: 'archive';
|
|
6195
|
+
/**
|
|
6196
|
+
* HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.
|
|
6197
|
+
*/
|
|
6198
|
+
url: string;
|
|
6199
|
+
/**
|
|
6200
|
+
* SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.
|
|
6201
|
+
*/
|
|
6202
|
+
sha256?: string;
|
|
6203
|
+
} | {
|
|
6204
|
+
source: 'command';
|
|
6205
|
+
/**
|
|
6206
|
+
* Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.
|
|
6207
|
+
*/
|
|
6208
|
+
command: string;
|
|
6209
|
+
/**
|
|
6210
|
+
* Seconds to wait for the command before giving up (default: 60)
|
|
6211
|
+
*/
|
|
6212
|
+
timeout?: number;
|
|
6213
|
+
/**
|
|
6214
|
+
* copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.
|
|
6215
|
+
*/
|
|
6216
|
+
mode?: 'copy' | 'link';
|
|
6217
|
+
} | {
|
|
6218
|
+
source: 'unsupported';
|
|
6219
|
+
error?: string;
|
|
6220
|
+
};
|
|
6221
|
+
description?: string;
|
|
6222
|
+
version?: string;
|
|
6223
|
+
strict?: boolean;
|
|
6224
|
+
}[];
|
|
6225
|
+
owner?: {
|
|
6226
|
+
/**
|
|
6227
|
+
* Display name of the plugin author or organization
|
|
6228
|
+
*/
|
|
6229
|
+
name: string;
|
|
6230
|
+
/**
|
|
6231
|
+
* Contact email for support or feedback
|
|
6232
|
+
*/
|
|
6233
|
+
email?: string;
|
|
6234
|
+
/**
|
|
6235
|
+
* Website, GitHub profile, or organization URL
|
|
6236
|
+
*/
|
|
6237
|
+
url?: string;
|
|
6238
|
+
};
|
|
6239
|
+
};
|
|
6240
|
+
/**
|
|
6241
|
+
* Local cache path where marketplace manifest is stored (auto-generated if not provided)
|
|
6242
|
+
*/
|
|
6243
|
+
installLocation?: string;
|
|
6244
|
+
/**
|
|
6245
|
+
* Whether to automatically update this marketplace and its installed plugins on startup
|
|
6246
|
+
*/
|
|
6247
|
+
autoUpdate?: boolean;
|
|
6248
|
+
};
|
|
6249
|
+
};
|
|
6250
|
+
/**
|
|
6251
|
+
* Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these sources can be added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to allow every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only — it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.
|
|
6252
|
+
*/
|
|
6253
|
+
strictKnownMarketplaces?: ({
|
|
6254
|
+
source: 'url';
|
|
6255
|
+
/**
|
|
6256
|
+
* Direct URL to marketplace.json file
|
|
6257
|
+
*/
|
|
6258
|
+
url: string;
|
|
6259
|
+
/**
|
|
6260
|
+
* Custom HTTP headers (e.g., for authentication)
|
|
6261
|
+
*/
|
|
6262
|
+
headers?: {
|
|
6263
|
+
[k: string]: string;
|
|
6264
|
+
};
|
|
6265
|
+
} | {
|
|
6266
|
+
source: 'github';
|
|
6267
|
+
/**
|
|
6268
|
+
* GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form "owner/*" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.
|
|
6269
|
+
*/
|
|
6270
|
+
repo: string;
|
|
6271
|
+
/**
|
|
6272
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6273
|
+
*/
|
|
6274
|
+
ref?: string;
|
|
6275
|
+
/**
|
|
6276
|
+
* Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)
|
|
6277
|
+
*/
|
|
6278
|
+
path?: string;
|
|
6279
|
+
/**
|
|
6280
|
+
* Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.
|
|
6281
|
+
*/
|
|
6282
|
+
sparsePaths?: string[];
|
|
6283
|
+
/**
|
|
6284
|
+
* Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.
|
|
6285
|
+
*/
|
|
6286
|
+
skipLfs?: boolean;
|
|
6287
|
+
} | {
|
|
6288
|
+
source: 'git';
|
|
6289
|
+
/**
|
|
6290
|
+
* Full git repository URL
|
|
6291
|
+
*/
|
|
6292
|
+
url: string;
|
|
6293
|
+
/**
|
|
6294
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6295
|
+
*/
|
|
6296
|
+
ref?: string;
|
|
6297
|
+
/**
|
|
6298
|
+
* Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)
|
|
6299
|
+
*/
|
|
6300
|
+
path?: string;
|
|
6301
|
+
/**
|
|
6302
|
+
* Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.
|
|
6303
|
+
*/
|
|
6304
|
+
sparsePaths?: string[];
|
|
6305
|
+
/**
|
|
6306
|
+
* Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.
|
|
6307
|
+
*/
|
|
6308
|
+
skipLfs?: boolean;
|
|
6309
|
+
} | {
|
|
6310
|
+
source: 'npm';
|
|
6311
|
+
/**
|
|
6312
|
+
* NPM package containing marketplace.json
|
|
6313
|
+
*/
|
|
6314
|
+
package: string;
|
|
6315
|
+
} | {
|
|
6316
|
+
source: 'file';
|
|
6317
|
+
/**
|
|
6318
|
+
* Local file path to marketplace.json
|
|
6319
|
+
*/
|
|
6320
|
+
path: string;
|
|
6321
|
+
} | {
|
|
6322
|
+
source: 'directory';
|
|
6323
|
+
/**
|
|
6324
|
+
* Local directory containing .claude-plugin/marketplace.json
|
|
6325
|
+
*/
|
|
6326
|
+
path: string;
|
|
6327
|
+
} | {
|
|
6328
|
+
source: 'skills-dir';
|
|
6329
|
+
} | {
|
|
6330
|
+
source: 'hostPattern';
|
|
6331
|
+
/**
|
|
6332
|
+
* Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\.mycompany\.com$").
|
|
6333
|
+
*/
|
|
6334
|
+
hostPattern: string;
|
|
6335
|
+
} | {
|
|
6336
|
+
source: 'pathPattern';
|
|
6337
|
+
/**
|
|
6338
|
+
* Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.
|
|
6339
|
+
*/
|
|
6340
|
+
pathPattern: string;
|
|
6341
|
+
} | {
|
|
6342
|
+
source: 'settings';
|
|
6343
|
+
/**
|
|
6344
|
+
* Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.
|
|
6345
|
+
*/
|
|
6346
|
+
name: string;
|
|
6347
|
+
/**
|
|
6348
|
+
* Plugin entries declared inline in settings.json
|
|
6349
|
+
*/
|
|
6350
|
+
plugins: {
|
|
6351
|
+
/**
|
|
6352
|
+
* Plugin name as it appears in the target repository
|
|
6353
|
+
*/
|
|
6354
|
+
name: string;
|
|
6355
|
+
/**
|
|
6356
|
+
* Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.
|
|
6357
|
+
*/
|
|
6358
|
+
source: string | {
|
|
6359
|
+
source: 'npm';
|
|
6360
|
+
/**
|
|
6361
|
+
* Package name (or url, or local path, or anything else that can be passed to `npm` as a package)
|
|
6362
|
+
*/
|
|
6363
|
+
package: string;
|
|
6364
|
+
/**
|
|
6365
|
+
* Specific version or version range (e.g., ^1.0.0, ~2.1.0)
|
|
6366
|
+
*/
|
|
6367
|
+
version?: string;
|
|
6368
|
+
/**
|
|
6369
|
+
* Custom NPM registry URL (defaults to using system default, likely npmjs.org)
|
|
6370
|
+
*/
|
|
6371
|
+
registry?: string;
|
|
6372
|
+
} | {
|
|
6373
|
+
source: 'url';
|
|
6374
|
+
/**
|
|
6375
|
+
* Full git repository URL (https:// or git\@)
|
|
6376
|
+
*/
|
|
6377
|
+
url: string;
|
|
6378
|
+
/**
|
|
6379
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6380
|
+
*/
|
|
6381
|
+
ref?: string;
|
|
6382
|
+
/**
|
|
6383
|
+
* Specific commit SHA to use
|
|
6384
|
+
*/
|
|
6385
|
+
sha?: string;
|
|
6386
|
+
} | {
|
|
6387
|
+
source: 'github';
|
|
6388
|
+
/**
|
|
6389
|
+
* GitHub repository in owner/repo format
|
|
6390
|
+
*/
|
|
6391
|
+
repo: string;
|
|
6392
|
+
/**
|
|
6393
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6394
|
+
*/
|
|
6395
|
+
ref?: string;
|
|
6396
|
+
/**
|
|
6397
|
+
* Specific commit SHA to use
|
|
6398
|
+
*/
|
|
6399
|
+
sha?: string;
|
|
6400
|
+
} | {
|
|
6401
|
+
source: 'git-subdir';
|
|
6402
|
+
/**
|
|
6403
|
+
* Git repository: GitHub owner/repo shorthand, https://, or git\@ URL
|
|
6404
|
+
*/
|
|
6405
|
+
url: string;
|
|
6406
|
+
/**
|
|
6407
|
+
* Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.
|
|
6408
|
+
*/
|
|
6409
|
+
path: string;
|
|
6410
|
+
/**
|
|
6411
|
+
* Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.
|
|
6412
|
+
*/
|
|
6413
|
+
ref?: string;
|
|
6414
|
+
/**
|
|
6415
|
+
* Specific commit SHA to use
|
|
6416
|
+
*/
|
|
6417
|
+
sha?: string;
|
|
6418
|
+
} | {
|
|
6419
|
+
source: 'archive';
|
|
6420
|
+
/**
|
|
6421
|
+
* HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.
|
|
6422
|
+
*/
|
|
6423
|
+
url: string;
|
|
6424
|
+
/**
|
|
6425
|
+
* SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.
|
|
6426
|
+
*/
|
|
6427
|
+
sha256?: string;
|
|
6428
|
+
} | {
|
|
6429
|
+
source: 'command';
|
|
6430
|
+
/**
|
|
6431
|
+
* Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.
|
|
6432
|
+
*/
|
|
6433
|
+
command: string;
|
|
6434
|
+
/**
|
|
6435
|
+
* Seconds to wait for the command before giving up (default: 60)
|
|
6436
|
+
*/
|
|
6437
|
+
timeout?: number;
|
|
6438
|
+
/**
|
|
6439
|
+
* copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.
|
|
6440
|
+
*/
|
|
6441
|
+
mode?: 'copy' | 'link';
|
|
6442
|
+
} | {
|
|
6443
|
+
source: 'unsupported';
|
|
6444
|
+
error?: string;
|
|
6445
|
+
};
|
|
6446
|
+
description?: string;
|
|
6447
|
+
version?: string;
|
|
6448
|
+
strict?: boolean;
|
|
6449
|
+
}[];
|
|
6450
|
+
owner?: {
|
|
6451
|
+
/**
|
|
6452
|
+
* Display name of the plugin author or organization
|
|
6453
|
+
*/
|
|
6454
|
+
name: string;
|
|
6455
|
+
/**
|
|
6456
|
+
* Contact email for support or feedback
|
|
6457
|
+
*/
|
|
6458
|
+
email?: string;
|
|
6459
|
+
/**
|
|
6460
|
+
* Website, GitHub profile, or organization URL
|
|
6461
|
+
*/
|
|
6462
|
+
url?: string;
|
|
6463
|
+
};
|
|
6464
|
+
})[];
|
|
6465
|
+
/**
|
|
6466
|
+
* Alias for strictKnownMarketplaces (managed settings only): this key is read exactly as if it were spelled strictKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored with a warning. Clients older than this alias ignore it, so keep using strictKnownMarketplaces when the allowlist must also bind older Claude Code versions.
|
|
6467
|
+
*/
|
|
6468
|
+
allowedMarketplaces?: ({
|
|
5971
6469
|
source: 'url';
|
|
5972
6470
|
/**
|
|
5973
6471
|
* Direct URL to marketplace.json file
|
|
@@ -6644,7 +7142,7 @@ export declare interface Settings {
|
|
|
6644
7142
|
allowAppleEvents?: boolean;
|
|
6645
7143
|
excludedCommands?: string[];
|
|
6646
7144
|
/**
|
|
6647
|
-
* Custom ripgrep configuration for bundled ripgrep support
|
|
7145
|
+
* Custom ripgrep configuration for bundled ripgrep support. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.
|
|
6648
7146
|
*/
|
|
6649
7147
|
ripgrep?: {
|
|
6650
7148
|
command: string;
|