@anthropic-ai/claude-agent-sdk 0.3.222 → 0.3.224
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 +94 -97
- package/browser-sdk.js +49 -49
- package/manifest.json +21 -21
- package/manifest.zst.json +25 -25
- package/package.json +10 -10
- package/sdk-tools.d.ts +25 -1
- package/sdk.d.ts +250 -12
- package/sdk.mjs +84 -82
package/sdk.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Readable } from 'stream';
|
|
|
10
10
|
import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
|
|
11
11
|
import type { UUID } from 'crypto';
|
|
12
12
|
import type { Writable } from 'stream';
|
|
13
|
-
import
|
|
13
|
+
import * as z from 'zod/v4';
|
|
14
14
|
import type { ZodRawShape } from 'zod';
|
|
15
15
|
import type { ZodRawShape as ZodRawShape_2 } from 'zod/v4';
|
|
16
16
|
|
|
@@ -1810,9 +1810,62 @@ export declare type Options = {
|
|
|
1810
1810
|
/**
|
|
1811
1811
|
* When resuming, only resume messages up to and including the message with this UUID.
|
|
1812
1812
|
* Use with `resume`. This allows you to resume from a specific point in the conversation.
|
|
1813
|
-
*
|
|
1813
|
+
* Accepts any chain-entry UUID — typically `SDKAssistantMessage.uuid`, but
|
|
1814
|
+
* end-turn tool sessions and transcript-only appends need a later entry's
|
|
1815
|
+
* UUID (see `resumeDropsTurn` for the fork-point guidance).
|
|
1814
1816
|
*/
|
|
1815
1817
|
resumeSessionAt?: string;
|
|
1818
|
+
/**
|
|
1819
|
+
* With `resumeSessionAt`: declares the prompt UUID of the turn this
|
|
1820
|
+
* truncating resume intends to discard. The CLI validates at fork time
|
|
1821
|
+
* that every entry past the `resumeSessionAt` point is attributable to
|
|
1822
|
+
* that turn, and refuses the resume (an `error_during_execution` result
|
|
1823
|
+
* whose message starts with `Resume rejected by --resume-drops-turn:`)
|
|
1824
|
+
* when the discarded range contains anything else — e.g. a queued user
|
|
1825
|
+
* message or task notification the session absorbed mid-turn that the
|
|
1826
|
+
* caller's view of the conversation had not yet observed. Omit to keep
|
|
1827
|
+
* the unvalidated truncation behavior.
|
|
1828
|
+
*
|
|
1829
|
+
* Consumers MUST map a refusal (match on the message prefix above) to
|
|
1830
|
+
* their rewind-recovery path — clear the pending fork target and resume
|
|
1831
|
+
* plainly, keeping the evidence — not retry: the refusal is
|
|
1832
|
+
* deterministic, so re-sending the same fork request fails forever.
|
|
1833
|
+
*
|
|
1834
|
+
* End-turn tool sessions (`outputFormat: {type: 'json_schema'}`, or any
|
|
1835
|
+
* MCP tool using `_meta['claude/endTurn']`): a completed turn there ends
|
|
1836
|
+
* on a successful tool_result carrier — with no trailing assistant
|
|
1837
|
+
* message — followed by a `structured_output` attachment holding the
|
|
1838
|
+
* turn's actual output (the carrier's data is a placeholder). Fork at
|
|
1839
|
+
* the LAST entry of the turn being kept — the `structured_output`
|
|
1840
|
+
* attachment when present, else the carrier — not the last assistant
|
|
1841
|
+
* UUID; `resumeSessionAt` accepts any chain UUID. Forking earlier
|
|
1842
|
+
* leaves the carrier or attachment in the discarded range, and the
|
|
1843
|
+
* validator deliberately refuses: both are the kept turn's own payload,
|
|
1844
|
+
* and dropping either would discard kept-turn output (the attachment is
|
|
1845
|
+
* its sole persisted copy) or leave its tool_use dangling.
|
|
1846
|
+
*
|
|
1847
|
+
* The same fork-past-your-appends rule applies to plain (non-synthetic)
|
|
1848
|
+
* `shouldQuery: false` transcript appends (e.g. CCD bash mode): they
|
|
1849
|
+
* persist as bare user entries, so a fork point that leaves one in the
|
|
1850
|
+
* discarded range refuses. Fork at or after your own last append.
|
|
1851
|
+
*
|
|
1852
|
+
* PRINT/HEADLESS LANE ONLY: the pair is consumed exclusively by the
|
|
1853
|
+
* headless boot path (print-mode CLI, Agent SDK, ProcessTransport). An
|
|
1854
|
+
* interactive `claude --resume` boot and background-job worker boots
|
|
1855
|
+
* ignore both options — the resume loads the full chain with no
|
|
1856
|
+
* truncation, no guard, and no error — so callers must not pass the
|
|
1857
|
+
* pair outside print mode and expect an armed guard (rejecting it on
|
|
1858
|
+
* those lanes is tracked follow-up work).
|
|
1859
|
+
*
|
|
1860
|
+
* General rule subsuming all of the above: fork at the KEPT turn's last
|
|
1861
|
+
* chain entry, whatever it is — `resumeSessionAt` accepts any chain
|
|
1862
|
+
* UUID. This also covers interrupted turns that completed one or more
|
|
1863
|
+
* tools before Esc: the completed (non-error) tool_result in the tail
|
|
1864
|
+
* is kept-turn payload and deliberately refuses at an assistant-UUID
|
|
1865
|
+
* fork point, while the marker / cancel-batch entries after it are
|
|
1866
|
+
* skippable — so fork at the last entry and the refusal never fires.
|
|
1867
|
+
*/
|
|
1868
|
+
resumeDropsTurn?: string;
|
|
1816
1869
|
/**
|
|
1817
1870
|
* Sandbox settings for command execution isolation.
|
|
1818
1871
|
*
|
|
@@ -2717,6 +2770,10 @@ declare const SandboxCredentialsConfigSchema: () => z.ZodOptional<z.ZodObject<{
|
|
|
2717
2770
|
error: "error";
|
|
2718
2771
|
warn: "warn";
|
|
2719
2772
|
}>>;
|
|
2773
|
+
decode: z.ZodOptional<z.ZodEnum<{
|
|
2774
|
+
jwt: "jwt";
|
|
2775
|
+
}>>;
|
|
2776
|
+
maskClaims: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2720
2777
|
maskDuplicates: z.ZodOptional<z.ZodBoolean>;
|
|
2721
2778
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2722
2779
|
}, z.core.$strip>>>>;
|
|
@@ -2726,9 +2783,38 @@ declare const SandboxCredentialsConfigSchema: () => z.ZodOptional<z.ZodObject<{
|
|
|
2726
2783
|
deny: "deny";
|
|
2727
2784
|
mask: "mask";
|
|
2728
2785
|
}>;
|
|
2786
|
+
extract: z.ZodOptional<z.ZodString>;
|
|
2787
|
+
onExtractNoMatch: z.ZodOptional<z.ZodEnum<{
|
|
2788
|
+
deny: "deny";
|
|
2789
|
+
error: "error";
|
|
2790
|
+
warn: "warn";
|
|
2791
|
+
}>>;
|
|
2792
|
+
decode: z.ZodOptional<z.ZodEnum<{
|
|
2793
|
+
jwt: "jwt";
|
|
2794
|
+
}>>;
|
|
2795
|
+
maskClaims: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2729
2796
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2730
2797
|
}, z.core.$strip>>>>;
|
|
2731
2798
|
allowPlaintextInject: z.ZodOptional<z.ZodBoolean>;
|
|
2799
|
+
awsPairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2800
|
+
accessKeyIdVar: z.ZodString;
|
|
2801
|
+
secretAccessKeyVar: z.ZodString;
|
|
2802
|
+
sessionTokenVar: z.ZodOptional<z.ZodString>;
|
|
2803
|
+
}, z.core.$strip>>>;
|
|
2804
|
+
sigv4: z.ZodOptional<z.ZodObject<{
|
|
2805
|
+
streaming: z.ZodOptional<z.ZodEnum<{
|
|
2806
|
+
deny: "deny";
|
|
2807
|
+
passthrough: "passthrough";
|
|
2808
|
+
}>>;
|
|
2809
|
+
presigned: z.ZodOptional<z.ZodEnum<{
|
|
2810
|
+
deny: "deny";
|
|
2811
|
+
passthrough: "passthrough";
|
|
2812
|
+
}>>;
|
|
2813
|
+
sigv4a: z.ZodOptional<z.ZodEnum<{
|
|
2814
|
+
deny: "deny";
|
|
2815
|
+
passthrough: "passthrough";
|
|
2816
|
+
}>>;
|
|
2817
|
+
}, z.core.$strip>>;
|
|
2732
2818
|
}, z.core.$strip>>;
|
|
2733
2819
|
|
|
2734
2820
|
export declare type SandboxFilesystemConfig = NonNullable<z.infer<ReturnType<typeof SandboxFilesystemConfigSchema>>>;
|
|
@@ -2816,6 +2902,10 @@ declare const SandboxSettingsSchema: () => z.ZodObject<{
|
|
|
2816
2902
|
error: "error";
|
|
2817
2903
|
warn: "warn";
|
|
2818
2904
|
}>>;
|
|
2905
|
+
decode: z.ZodOptional<z.ZodEnum<{
|
|
2906
|
+
jwt: "jwt";
|
|
2907
|
+
}>>;
|
|
2908
|
+
maskClaims: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2819
2909
|
maskDuplicates: z.ZodOptional<z.ZodBoolean>;
|
|
2820
2910
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2821
2911
|
}, z.core.$strip>>>>;
|
|
@@ -2825,9 +2915,38 @@ declare const SandboxSettingsSchema: () => z.ZodObject<{
|
|
|
2825
2915
|
deny: "deny";
|
|
2826
2916
|
mask: "mask";
|
|
2827
2917
|
}>;
|
|
2918
|
+
extract: z.ZodOptional<z.ZodString>;
|
|
2919
|
+
onExtractNoMatch: z.ZodOptional<z.ZodEnum<{
|
|
2920
|
+
deny: "deny";
|
|
2921
|
+
error: "error";
|
|
2922
|
+
warn: "warn";
|
|
2923
|
+
}>>;
|
|
2924
|
+
decode: z.ZodOptional<z.ZodEnum<{
|
|
2925
|
+
jwt: "jwt";
|
|
2926
|
+
}>>;
|
|
2927
|
+
maskClaims: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2828
2928
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2829
2929
|
}, z.core.$strip>>>>;
|
|
2830
2930
|
allowPlaintextInject: z.ZodOptional<z.ZodBoolean>;
|
|
2931
|
+
awsPairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2932
|
+
accessKeyIdVar: z.ZodString;
|
|
2933
|
+
secretAccessKeyVar: z.ZodString;
|
|
2934
|
+
sessionTokenVar: z.ZodOptional<z.ZodString>;
|
|
2935
|
+
}, z.core.$strip>>>;
|
|
2936
|
+
sigv4: z.ZodOptional<z.ZodObject<{
|
|
2937
|
+
streaming: z.ZodOptional<z.ZodEnum<{
|
|
2938
|
+
deny: "deny";
|
|
2939
|
+
passthrough: "passthrough";
|
|
2940
|
+
}>>;
|
|
2941
|
+
presigned: z.ZodOptional<z.ZodEnum<{
|
|
2942
|
+
deny: "deny";
|
|
2943
|
+
passthrough: "passthrough";
|
|
2944
|
+
}>>;
|
|
2945
|
+
sigv4a: z.ZodOptional<z.ZodEnum<{
|
|
2946
|
+
deny: "deny";
|
|
2947
|
+
passthrough: "passthrough";
|
|
2948
|
+
}>>;
|
|
2949
|
+
}, z.core.$strip>>;
|
|
2831
2950
|
}, z.core.$strip>>;
|
|
2832
2951
|
ignoreViolations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
2833
2952
|
enableWeakerNestedSandbox: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -4075,11 +4194,13 @@ export declare type SDKMessageOrigin = {
|
|
|
4075
4194
|
} | {
|
|
4076
4195
|
kind: 'task-notification';
|
|
4077
4196
|
/**
|
|
4078
|
-
* Present when the delivery is the fired stored prompt of a scheduled task/routine (stamped from server-asserted provenance; the schedule attests storage, not authorship). The harness frames
|
|
4197
|
+
* Present when the delivery is the fired stored prompt of a scheduled task/routine ('scheduled-trigger', stamped from server-asserted provenance; the schedule attests storage, not authorship), or a coordinator co-member SendMessage delivery ('peer-send-message': model-authored text from another of the same user's sessions, verified by the server-stamped receiver co-membership — task-notification for prompt authority, but distinguishable so the receive-side crossSessionInbound setting can apply to it). The harness frames a scheduled-trigger delivery as the session's assigned task instead of the generic background-notification frame. Absent on webhook, PR-steward, plugin, and background-event deliveries.
|
|
4079
4198
|
*/
|
|
4080
|
-
subkind?: 'scheduled-trigger';
|
|
4199
|
+
subkind?: 'scheduled-trigger' | 'peer-send-message';
|
|
4081
4200
|
} | {
|
|
4082
4201
|
kind: 'coordinator';
|
|
4202
|
+
} | {
|
|
4203
|
+
kind: 'unclassified';
|
|
4083
4204
|
} | {
|
|
4084
4205
|
kind: 'observer';
|
|
4085
4206
|
from: string;
|
|
@@ -4189,7 +4310,7 @@ export declare type SDKPermissionDenial = {
|
|
|
4189
4310
|
};
|
|
4190
4311
|
|
|
4191
4312
|
/**
|
|
4192
|
-
* Emitted when a tool call is auto-denied without an interactive permission prompt (e.g. auto-mode classifier, dontAsk mode, headless-agent auto-deny, or a deny rule).
|
|
4313
|
+
* Emitted when a tool call is auto-denied without an interactive permission prompt (e.g. auto-mode classifier, dontAsk mode, headless-agent auto-deny, or a deny rule). With a permission prompt surface (stdio/SDK canUseTool), the 'ask' path surfaces via a can_use_tool control_request and this event covers the 'deny' short-circuit. Without one (bare -p / SDK query() with no canUseTool), 'ask' decisions are terminal, so this event also covers those implicit denials. Best-effort advisory: in rare races a denial can book without a frame or a frame can lack a booking twin — result.permission_denials is the authoritative record. Denials that resolve before canUseTool runs — PreToolUse hook denies, and deny-rule overrides of hook allow/ask decisions — are not covered here, and neither is the MCP --permission-prompt-tool surface (the prompt tool is the host there).
|
|
4193
4314
|
*/
|
|
4194
4315
|
export declare type SDKPermissionDeniedMessage = {
|
|
4195
4316
|
type: 'system';
|
|
@@ -4300,8 +4421,17 @@ export declare type SDKResultError = {
|
|
|
4300
4421
|
is_error: boolean;
|
|
4301
4422
|
num_turns: number;
|
|
4302
4423
|
stop_reason: string | null;
|
|
4424
|
+
/**
|
|
4425
|
+
* Cumulative estimated cost in USD for this query() call, covering the same query-pipeline calls as modelUsage and sharing its lifecycle: cumulative across turns in streaming-input sessions — each result carries the running total so far, so read the latest result rather than summing across results. Crash/startup-error results may carry zeroed values, resumed sessions start fresh, and a mid-session /clear resets the running total. An estimate, not a billing statement.
|
|
4426
|
+
*/
|
|
4303
4427
|
total_cost_usd: number;
|
|
4428
|
+
/**
|
|
4429
|
+
* MAIN AGENT LOOP ONLY — excludes Task subagent, sidechain, and auxiliary model calls, and is per-turn in streaming-input sessions. Prefer modelUsage for token/cost accounting.
|
|
4430
|
+
*/
|
|
4304
4431
|
usage: NonNullableUsage;
|
|
4432
|
+
/**
|
|
4433
|
+
* Per-model totals for every model call made through the query pipeline during this query() call — main loop, Task subagents, sidechains, and internal calls such as compaction and Workflow agents. Cumulative across turns in streaming-input sessions: each result carries the running total so far, so read the latest result rather than summing across results. Internal helper calls outside the query pipeline (e.g. the permission classifier, token-count probes) are excluded; crash/startup-error results may carry zeroed usage, resumed sessions start fresh, and a mid-session /clear resets the running total. The correct field for token/cost accounting; treat it as an estimate, not a billing statement.
|
|
4434
|
+
*/
|
|
4305
4435
|
modelUsage: Record<string, ModelUsage>;
|
|
4306
4436
|
permission_denials: SDKPermissionDenial[];
|
|
4307
4437
|
errors: string[];
|
|
@@ -4333,8 +4463,17 @@ export declare type SDKResultSuccess = {
|
|
|
4333
4463
|
num_turns: number;
|
|
4334
4464
|
result: string;
|
|
4335
4465
|
stop_reason: string | null;
|
|
4466
|
+
/**
|
|
4467
|
+
* Cumulative estimated cost in USD for this query() call, covering the same query-pipeline calls as modelUsage and sharing its lifecycle: cumulative across turns in streaming-input sessions — each result carries the running total so far, so read the latest result rather than summing across results. Crash/startup-error results may carry zeroed values, resumed sessions start fresh, and a mid-session /clear resets the running total. An estimate, not a billing statement.
|
|
4468
|
+
*/
|
|
4336
4469
|
total_cost_usd: number;
|
|
4470
|
+
/**
|
|
4471
|
+
* MAIN AGENT LOOP ONLY — excludes Task subagent, sidechain, and auxiliary model calls, and is per-turn in streaming-input sessions. Prefer modelUsage for token/cost accounting.
|
|
4472
|
+
*/
|
|
4337
4473
|
usage: NonNullableUsage;
|
|
4474
|
+
/**
|
|
4475
|
+
* Per-model totals for every model call made through the query pipeline during this query() call — main loop, Task subagents, sidechains, and internal calls such as compaction and Workflow agents. Cumulative across turns in streaming-input sessions: each result carries the running total so far, so read the latest result rather than summing across results. Internal helper calls outside the query pipeline (e.g. the permission classifier, token-count probes) are excluded; crash/startup-error results may carry zeroed usage, resumed sessions start fresh, and a mid-session /clear resets the running total. The correct field for token/cost accounting; treat it as an estimate, not a billing statement.
|
|
4476
|
+
*/
|
|
4338
4477
|
modelUsage: Record<string, ModelUsage>;
|
|
4339
4478
|
permission_denials: SDKPermissionDenial[];
|
|
4340
4479
|
structured_output?: unknown;
|
|
@@ -5552,7 +5691,7 @@ export declare interface Settings {
|
|
|
5552
5691
|
} | {
|
|
5553
5692
|
source: 'github';
|
|
5554
5693
|
/**
|
|
5555
|
-
* GitHub repository in owner/repo format
|
|
5694
|
+
* 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.
|
|
5556
5695
|
*/
|
|
5557
5696
|
repo: string;
|
|
5558
5697
|
/**
|
|
@@ -5702,8 +5841,19 @@ export declare interface Settings {
|
|
|
5702
5841
|
* Specific commit SHA to use
|
|
5703
5842
|
*/
|
|
5704
5843
|
sha?: string;
|
|
5844
|
+
} | {
|
|
5845
|
+
source: 'archive';
|
|
5846
|
+
/**
|
|
5847
|
+
* 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.
|
|
5848
|
+
*/
|
|
5849
|
+
url: string;
|
|
5850
|
+
/**
|
|
5851
|
+
* 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.
|
|
5852
|
+
*/
|
|
5853
|
+
sha256?: string;
|
|
5705
5854
|
} | {
|
|
5706
5855
|
source: 'unsupported';
|
|
5856
|
+
error?: string;
|
|
5707
5857
|
};
|
|
5708
5858
|
description?: string;
|
|
5709
5859
|
version?: string;
|
|
@@ -5735,7 +5885,7 @@ export declare interface Settings {
|
|
|
5735
5885
|
};
|
|
5736
5886
|
};
|
|
5737
5887
|
/**
|
|
5738
|
-
* Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these
|
|
5888
|
+
* 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.
|
|
5739
5889
|
*/
|
|
5740
5890
|
strictKnownMarketplaces?: ({
|
|
5741
5891
|
source: 'url';
|
|
@@ -5752,7 +5902,7 @@ export declare interface Settings {
|
|
|
5752
5902
|
} | {
|
|
5753
5903
|
source: 'github';
|
|
5754
5904
|
/**
|
|
5755
|
-
* GitHub repository in owner/repo format
|
|
5905
|
+
* 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.
|
|
5756
5906
|
*/
|
|
5757
5907
|
repo: string;
|
|
5758
5908
|
/**
|
|
@@ -5902,8 +6052,19 @@ export declare interface Settings {
|
|
|
5902
6052
|
* Specific commit SHA to use
|
|
5903
6053
|
*/
|
|
5904
6054
|
sha?: string;
|
|
6055
|
+
} | {
|
|
6056
|
+
source: 'archive';
|
|
6057
|
+
/**
|
|
6058
|
+
* 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.
|
|
6059
|
+
*/
|
|
6060
|
+
url: string;
|
|
6061
|
+
/**
|
|
6062
|
+
* 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.
|
|
6063
|
+
*/
|
|
6064
|
+
sha256?: string;
|
|
5905
6065
|
} | {
|
|
5906
6066
|
source: 'unsupported';
|
|
6067
|
+
error?: string;
|
|
5907
6068
|
};
|
|
5908
6069
|
description?: string;
|
|
5909
6070
|
version?: string;
|
|
@@ -5925,7 +6086,7 @@ export declare interface Settings {
|
|
|
5925
6086
|
};
|
|
5926
6087
|
})[];
|
|
5927
6088
|
/**
|
|
5928
|
-
* Enterprise blocklist of marketplace sources. When set in managed settings, these
|
|
6089
|
+
* Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.
|
|
5929
6090
|
*/
|
|
5930
6091
|
blockedMarketplaces?: ({
|
|
5931
6092
|
source: 'url';
|
|
@@ -5942,7 +6103,7 @@ export declare interface Settings {
|
|
|
5942
6103
|
} | {
|
|
5943
6104
|
source: 'github';
|
|
5944
6105
|
/**
|
|
5945
|
-
* GitHub repository in owner/repo format
|
|
6106
|
+
* 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.
|
|
5946
6107
|
*/
|
|
5947
6108
|
repo: string;
|
|
5948
6109
|
/**
|
|
@@ -6092,8 +6253,19 @@ export declare interface Settings {
|
|
|
6092
6253
|
* Specific commit SHA to use
|
|
6093
6254
|
*/
|
|
6094
6255
|
sha?: string;
|
|
6256
|
+
} | {
|
|
6257
|
+
source: 'archive';
|
|
6258
|
+
/**
|
|
6259
|
+
* 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.
|
|
6260
|
+
*/
|
|
6261
|
+
url: string;
|
|
6262
|
+
/**
|
|
6263
|
+
* 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.
|
|
6264
|
+
*/
|
|
6265
|
+
sha256?: string;
|
|
6095
6266
|
} | {
|
|
6096
6267
|
source: 'unsupported';
|
|
6268
|
+
error?: string;
|
|
6097
6269
|
};
|
|
6098
6270
|
description?: string;
|
|
6099
6271
|
version?: string;
|
|
@@ -6251,11 +6423,19 @@ export declare interface Settings {
|
|
|
6251
6423
|
*/
|
|
6252
6424
|
extract?: string;
|
|
6253
6425
|
/**
|
|
6254
|
-
* What to do when `extract` matches nothing in the file. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to mode `deny` so the file is unreadable (fail-closed) — under `sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set; accepted but ignored otherwise.
|
|
6426
|
+
* What to do when `extract` matches nothing in the file — or, with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to mode `deny` so the file is unreadable (fail-closed) — under `sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise.
|
|
6255
6427
|
*/
|
|
6256
6428
|
onExtractNoMatch?: 'warn' | 'deny' | 'error';
|
|
6257
6429
|
/**
|
|
6258
|
-
*
|
|
6430
|
+
* Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`.
|
|
6431
|
+
*/
|
|
6432
|
+
decode?: 'jwt';
|
|
6433
|
+
/**
|
|
6434
|
+
* Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`.
|
|
6435
|
+
*/
|
|
6436
|
+
maskClaims?: string[];
|
|
6437
|
+
/**
|
|
6438
|
+
* If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the corresponding sentinel — for a secret repeated where the regex does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise.
|
|
6259
6439
|
*/
|
|
6260
6440
|
maskDuplicates?: boolean;
|
|
6261
6441
|
/**
|
|
@@ -6275,6 +6455,22 @@ export declare interface Settings {
|
|
|
6275
6455
|
* Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the host proxy swaps sentinel→real on egress to `injectHosts`.
|
|
6276
6456
|
*/
|
|
6277
6457
|
mode: 'deny' | 'mask';
|
|
6458
|
+
/**
|
|
6459
|
+
* Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels — the rest of the value is preserved so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`.
|
|
6460
|
+
*/
|
|
6461
|
+
extract?: string;
|
|
6462
|
+
/**
|
|
6463
|
+
* What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting cannot be honored — `deny` and `error` are rejected there; only `warn` is accepted. In all other shapes the field is accepted but ignored.
|
|
6464
|
+
*/
|
|
6465
|
+
onExtractNoMatch?: 'warn' | 'deny' | 'error';
|
|
6466
|
+
/**
|
|
6467
|
+
* Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning (fail-open). Cannot be combined with `extract` — the decode path never consults it. Accepted but ignored for `deny`.
|
|
6468
|
+
*/
|
|
6469
|
+
decode?: 'jwt';
|
|
6470
|
+
/**
|
|
6471
|
+
* Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`.
|
|
6472
|
+
*/
|
|
6473
|
+
maskClaims?: string[];
|
|
6278
6474
|
/**
|
|
6279
6475
|
* Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` — the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).
|
|
6280
6476
|
*/
|
|
@@ -6284,6 +6480,40 @@ export declare interface Settings {
|
|
|
6284
6480
|
* Allow sentinel→real substitution on the plain-HTTP proxy path. Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.
|
|
6285
6481
|
*/
|
|
6286
6482
|
allowPlaintextInject?: boolean;
|
|
6483
|
+
/**
|
|
6484
|
+
* Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not qualify — re-signing needs the whole real value). A pair whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed).
|
|
6485
|
+
*/
|
|
6486
|
+
awsPairs?: {
|
|
6487
|
+
/**
|
|
6488
|
+
* Name of the masked env var holding the AWS access key id.
|
|
6489
|
+
*/
|
|
6490
|
+
accessKeyIdVar: string;
|
|
6491
|
+
/**
|
|
6492
|
+
* Name of the masked env var holding the AWS secret access key.
|
|
6493
|
+
*/
|
|
6494
|
+
secretAccessKeyVar: string;
|
|
6495
|
+
/**
|
|
6496
|
+
* Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.
|
|
6497
|
+
*/
|
|
6498
|
+
sessionTokenVar?: string;
|
|
6499
|
+
}[];
|
|
6500
|
+
/**
|
|
6501
|
+
* Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.
|
|
6502
|
+
*/
|
|
6503
|
+
sigv4?: {
|
|
6504
|
+
/**
|
|
6505
|
+
* Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature).
|
|
6506
|
+
*/
|
|
6507
|
+
streaming?: 'deny' | 'passthrough';
|
|
6508
|
+
/**
|
|
6509
|
+
* Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`.
|
|
6510
|
+
*/
|
|
6511
|
+
presigned?: 'deny' | 'passthrough';
|
|
6512
|
+
/**
|
|
6513
|
+
* Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.
|
|
6514
|
+
*/
|
|
6515
|
+
sigv4a?: 'deny' | 'passthrough';
|
|
6516
|
+
};
|
|
6287
6517
|
};
|
|
6288
6518
|
ignoreViolations?: {
|
|
6289
6519
|
[k: string]: string[];
|
|
@@ -6394,6 +6624,10 @@ export declare interface Settings {
|
|
|
6394
6624
|
* Idle time before Claude's questions auto-continue with any answers selected so far. Defaults to never — auto-continue only runs when explicitly set to 60s/5m/10m.
|
|
6395
6625
|
*/
|
|
6396
6626
|
askUserQuestionTimeout?: '60s' | '5m' | '10m' | 'never';
|
|
6627
|
+
/**
|
|
6628
|
+
* Max time a permission/user dialog forwarded to a remote client stays parked awaiting an answer, and how long a HELD cross-session message awaits approval, before either resolves to its safe no-action default (cancelled / dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog deadline; "never" disables the deadline. Local-only permission prompts (no remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, when set, overrides this. Read from trusted sources only (never a checked-in repo settings file).
|
|
6629
|
+
*/
|
|
6630
|
+
dialogExpiry?: '60s' | '5m' | '10m' | 'never';
|
|
6397
6631
|
/**
|
|
6398
6632
|
* Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model.
|
|
6399
6633
|
*/
|
|
@@ -6635,6 +6869,10 @@ export declare interface Settings {
|
|
|
6635
6869
|
* When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently
|
|
6636
6870
|
*/
|
|
6637
6871
|
daemonColdStart?: 'transient' | 'ask';
|
|
6872
|
+
/**
|
|
6873
|
+
* Inbound cross-session peer messages (SendMessage from your other sessions): 'accept' delivers them, 'hold' parks them for your review without letting Claude act, 'refuse' opts this session out. An explicit value always wins. Unset (mode parity): a message auto-delivers only when the sending session's permission-mode class matches yours (bypass↔bypass or prompting↔prompting); a mismatched sender's message is held for your approval; a sender that asserts no class is held only while this session bypasses permission prompts.
|
|
6874
|
+
*/
|
|
6875
|
+
crossSessionInbound?: 'accept' | 'hold' | 'refuse';
|
|
6638
6876
|
/**
|
|
6639
6877
|
* Mirror local sessions to claude.ai as view-only (no remote control)
|
|
6640
6878
|
*/
|