deepagents 1.10.0 → 1.10.2
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/dist/index.cjs +1146 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +436 -6
- package/dist/index.d.ts +436 -6
- package/dist/index.js +1137 -25
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import * as _messages from "@langchain/core/messages";
|
|
|
7
7
|
import * as z$2 from "zod";
|
|
8
8
|
import { z as z$1 } from "zod";
|
|
9
9
|
import { Client } from "@langchain/langgraph-sdk";
|
|
10
|
-
import {
|
|
10
|
+
import { Client as Client$1 } from "langsmith";
|
|
11
|
+
import { CaptureSnapshotOptions, CaptureSnapshotOptions as LangSmithCaptureSnapshotOptions, CreateSandboxOptions, Sandbox, Snapshot, Snapshot as LangSmithSnapshot, StartSandboxOptions, StartSandboxOptions as LangSmithStartSandboxOptions } from "langsmith/experimental/sandbox";
|
|
11
12
|
import * as _$zod_v30 from "zod/v3";
|
|
12
13
|
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
13
14
|
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
@@ -1420,6 +1421,43 @@ declare class CompositeBackend implements BackendProtocolV2 {
|
|
|
1420
1421
|
downloadFiles(paths: string[]): Promise<FileDownloadResponse[]>;
|
|
1421
1422
|
}
|
|
1422
1423
|
//#endregion
|
|
1424
|
+
//#region src/backends/context-hub.d.ts
|
|
1425
|
+
/**
|
|
1426
|
+
* Backend that stores files in a LangSmith Hub agent repo (persistent).
|
|
1427
|
+
*/
|
|
1428
|
+
declare class ContextHubBackend implements BackendProtocolV2 {
|
|
1429
|
+
private identifier;
|
|
1430
|
+
private client;
|
|
1431
|
+
private cache;
|
|
1432
|
+
private linkedEntries;
|
|
1433
|
+
private commitHash;
|
|
1434
|
+
constructor(identifier: string, options?: {
|
|
1435
|
+
client?: Client$1;
|
|
1436
|
+
});
|
|
1437
|
+
private static stripPrefix;
|
|
1438
|
+
private static toHubUnavailableError;
|
|
1439
|
+
private loadTree;
|
|
1440
|
+
private ensureCache;
|
|
1441
|
+
private commit;
|
|
1442
|
+
/**
|
|
1443
|
+
* Return linked-entry paths mapped to their repo handles.
|
|
1444
|
+
*/
|
|
1445
|
+
getLinkedEntries(): Promise<Record<string, string>>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Return true if the hub repo already exists with at least one commit.
|
|
1448
|
+
*/
|
|
1449
|
+
hasPriorCommits(): Promise<boolean>;
|
|
1450
|
+
ls(path?: string): Promise<LsResult>;
|
|
1451
|
+
read(filePath: string, offset?: number, limit?: number): Promise<ReadResult>;
|
|
1452
|
+
readRaw(filePath: string): Promise<ReadRawResult>;
|
|
1453
|
+
grep(pattern: string, path?: string | null, glob?: string | null): Promise<GrepResult>;
|
|
1454
|
+
glob(pattern: string, _path?: string): Promise<GlobResult>;
|
|
1455
|
+
write(filePath: string, content: string): Promise<WriteResult>;
|
|
1456
|
+
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): Promise<EditResult>;
|
|
1457
|
+
uploadFiles(files: Array<[string, Uint8Array]>): Promise<FileUploadResponse[]>;
|
|
1458
|
+
downloadFiles(paths: string[]): Promise<FileDownloadResponse[]>;
|
|
1459
|
+
}
|
|
1460
|
+
//#endregion
|
|
1423
1461
|
//#region src/backends/local-shell.d.ts
|
|
1424
1462
|
/**
|
|
1425
1463
|
* Options for creating a LocalShellBackend instance.
|
|
@@ -1705,10 +1743,17 @@ interface LangSmithSandboxOptions {
|
|
|
1705
1743
|
defaultTimeout?: number;
|
|
1706
1744
|
}
|
|
1707
1745
|
/** Options for the `LangSmithSandbox.create()` static factory. */
|
|
1708
|
-
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady"> {
|
|
1746
|
+
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady" | "snapshotName"> {
|
|
1747
|
+
/**
|
|
1748
|
+
* Snapshot ID to boot from.
|
|
1749
|
+
* Mutually exclusive with `templateName`.
|
|
1750
|
+
*/
|
|
1751
|
+
snapshotId?: string;
|
|
1709
1752
|
/**
|
|
1710
1753
|
* Name of the LangSmith sandbox template to use.
|
|
1711
|
-
*
|
|
1754
|
+
* Mutually exclusive with `snapshotId`.
|
|
1755
|
+
* @deprecated Use `snapshotId` instead. Template-based creation will be
|
|
1756
|
+
* removed in a future release.
|
|
1712
1757
|
*/
|
|
1713
1758
|
templateName?: string;
|
|
1714
1759
|
/**
|
|
@@ -1767,6 +1812,33 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1767
1812
|
* cannot be used again.
|
|
1768
1813
|
*/
|
|
1769
1814
|
close(): Promise<void>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Start a stopped sandbox and wait until it is ready.
|
|
1817
|
+
*
|
|
1818
|
+
* After calling this, `isRunning` will be `true` and the sandbox
|
|
1819
|
+
* can be used for command execution and file operations again.
|
|
1820
|
+
*
|
|
1821
|
+
* @param options - Start options (timeout, signal).
|
|
1822
|
+
*/
|
|
1823
|
+
start(options?: StartSandboxOptions): Promise<void>;
|
|
1824
|
+
/**
|
|
1825
|
+
* Stop the sandbox without deleting it.
|
|
1826
|
+
*
|
|
1827
|
+
* Sandbox files are preserved and the sandbox can be restarted later
|
|
1828
|
+
* with `start()`. After calling this, `isRunning` will be `false`.
|
|
1829
|
+
*/
|
|
1830
|
+
stop(): Promise<void>;
|
|
1831
|
+
/**
|
|
1832
|
+
* Capture a snapshot from this running sandbox.
|
|
1833
|
+
*
|
|
1834
|
+
* Snapshots can be used to create new sandboxes via
|
|
1835
|
+
* `LangSmithSandbox.create({ snapshotId })`.
|
|
1836
|
+
*
|
|
1837
|
+
* @param name - Name for the snapshot.
|
|
1838
|
+
* @param options - Capture options (checkpoint, timeout).
|
|
1839
|
+
* @returns The created Snapshot in "ready" status.
|
|
1840
|
+
*/
|
|
1841
|
+
captureSnapshot(name: string, options?: CaptureSnapshotOptions): Promise<Snapshot>;
|
|
1770
1842
|
/**
|
|
1771
1843
|
* Create and return a new LangSmithSandbox in one step.
|
|
1772
1844
|
*
|
|
@@ -1775,7 +1847,10 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1775
1847
|
*
|
|
1776
1848
|
* @example
|
|
1777
1849
|
* ```typescript
|
|
1778
|
-
* const sandbox = await LangSmithSandbox.create({
|
|
1850
|
+
* const sandbox = await LangSmithSandbox.create({
|
|
1851
|
+
* snapshotId: "abc-123",
|
|
1852
|
+
* });
|
|
1853
|
+
*
|
|
1779
1854
|
* try {
|
|
1780
1855
|
* const agent = createDeepAgent({ model, backend: sandbox });
|
|
1781
1856
|
* await agent.invoke({ messages: [...] });
|
|
@@ -1784,7 +1859,7 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1784
1859
|
* }
|
|
1785
1860
|
* ```
|
|
1786
1861
|
*/
|
|
1787
|
-
static create(options
|
|
1862
|
+
static create(options: LangSmithSandboxCreateOptions): Promise<LangSmithSandbox>;
|
|
1788
1863
|
}
|
|
1789
1864
|
//#endregion
|
|
1790
1865
|
//#region src/backends/utils.d.ts
|
|
@@ -3322,6 +3397,361 @@ declare class ConfigurationError extends Error {
|
|
|
3322
3397
|
static isInstance(error: unknown): error is ConfigurationError;
|
|
3323
3398
|
}
|
|
3324
3399
|
//#endregion
|
|
3400
|
+
//#region src/profiles/harness/types.d.ts
|
|
3401
|
+
/**
|
|
3402
|
+
* Middleware names that provide essential agent capabilities and cannot
|
|
3403
|
+
* be excluded via `excludedMiddleware`.
|
|
3404
|
+
*
|
|
3405
|
+
* - `FilesystemMiddleware` backs all built-in file tools and enforces
|
|
3406
|
+
* filesystem permissions.
|
|
3407
|
+
* - `SubAgentMiddleware` backs the `task` tool for subagent delegation.
|
|
3408
|
+
*/
|
|
3409
|
+
declare const REQUIRED_MIDDLEWARE_NAMES: Set<string>;
|
|
3410
|
+
/**
|
|
3411
|
+
* Configuration for the auto-added general-purpose subagent.
|
|
3412
|
+
*
|
|
3413
|
+
* All fields use three-state semantics: `undefined` inherits the
|
|
3414
|
+
* default, an explicit value overrides it. This allows model-level
|
|
3415
|
+
* profiles to selectively override provider-level defaults without
|
|
3416
|
+
* clobbering fields they don't care about.
|
|
3417
|
+
*/
|
|
3418
|
+
interface GeneralPurposeSubagentConfig {
|
|
3419
|
+
/**
|
|
3420
|
+
* Whether to auto-add the general-purpose subagent.
|
|
3421
|
+
*
|
|
3422
|
+
* - `undefined` — inherit the default (enabled).
|
|
3423
|
+
* - `true` — force inclusion even if a provider profile disables it.
|
|
3424
|
+
* - `false` — disable the GP subagent entirely.
|
|
3425
|
+
*
|
|
3426
|
+
* @default undefined
|
|
3427
|
+
*/
|
|
3428
|
+
enabled?: boolean;
|
|
3429
|
+
/**
|
|
3430
|
+
* Override the default GP subagent description shown to the model.
|
|
3431
|
+
*
|
|
3432
|
+
* @default undefined (uses `DEFAULT_GENERAL_PURPOSE_DESCRIPTION`)
|
|
3433
|
+
*/
|
|
3434
|
+
description?: string;
|
|
3435
|
+
/**
|
|
3436
|
+
* Override the default GP subagent system prompt.
|
|
3437
|
+
*
|
|
3438
|
+
* When both this and `HarnessProfile.baseSystemPrompt` are set, this
|
|
3439
|
+
* more-specific value wins for the GP subagent.
|
|
3440
|
+
*
|
|
3441
|
+
* @default undefined (uses `DEFAULT_SUBAGENT_PROMPT`)
|
|
3442
|
+
*/
|
|
3443
|
+
systemPrompt?: string;
|
|
3444
|
+
}
|
|
3445
|
+
/**
|
|
3446
|
+
* User-facing options for creating a {@link HarnessProfile}.
|
|
3447
|
+
*
|
|
3448
|
+
* Accepts plain arrays and records; the factory function converts them
|
|
3449
|
+
* to their frozen counterparts. All fields are optional — an empty
|
|
3450
|
+
* object produces a no-op profile.
|
|
3451
|
+
*/
|
|
3452
|
+
interface HarnessProfileOptions {
|
|
3453
|
+
/**
|
|
3454
|
+
* Replaces the default `BASE_AGENT_PROMPT` when set.
|
|
3455
|
+
*
|
|
3456
|
+
* Use this when a model requires a fundamentally different base
|
|
3457
|
+
* prompt rather than an additive suffix. Most profiles should prefer
|
|
3458
|
+
* `systemPromptSuffix` instead.
|
|
3459
|
+
*
|
|
3460
|
+
* @default undefined (keeps the default base prompt)
|
|
3461
|
+
*/
|
|
3462
|
+
baseSystemPrompt?: string;
|
|
3463
|
+
/**
|
|
3464
|
+
* Text appended to the assembled base prompt with a blank-line
|
|
3465
|
+
* separator (`\n\n`).
|
|
3466
|
+
*
|
|
3467
|
+
* This is the primary mechanism for model-specific prompt tuning.
|
|
3468
|
+
* Applied uniformly to the main agent, declarative subagents, and
|
|
3469
|
+
* the auto-added general-purpose subagent.
|
|
3470
|
+
*
|
|
3471
|
+
* @default undefined (no suffix appended)
|
|
3472
|
+
*/
|
|
3473
|
+
systemPromptSuffix?: string;
|
|
3474
|
+
/**
|
|
3475
|
+
* Per-tool description replacements keyed by tool name.
|
|
3476
|
+
*
|
|
3477
|
+
* Allows profiles to rewrite tool descriptions for models that
|
|
3478
|
+
* respond better to different phrasing. Keys that don't match any
|
|
3479
|
+
* tool in the final tool set are silently ignored.
|
|
3480
|
+
*
|
|
3481
|
+
* @default {} (no overrides)
|
|
3482
|
+
*/
|
|
3483
|
+
toolDescriptionOverrides?: Record<string, string>;
|
|
3484
|
+
/**
|
|
3485
|
+
* Tool names to remove from the agent's visible tool set.
|
|
3486
|
+
*
|
|
3487
|
+
* Applied via a filtering middleware after all tool-injecting
|
|
3488
|
+
* middleware have run, so it catches both user-provided and
|
|
3489
|
+
* middleware-provided tools.
|
|
3490
|
+
*
|
|
3491
|
+
* @default [] (no tools excluded)
|
|
3492
|
+
*/
|
|
3493
|
+
excludedTools?: string[];
|
|
3494
|
+
/**
|
|
3495
|
+
* Middleware names to remove from the assembled middleware stack.
|
|
3496
|
+
*
|
|
3497
|
+
* Matched against each middleware's `.name` property. Cannot include
|
|
3498
|
+
* required scaffolding names (`FilesystemMiddleware`,
|
|
3499
|
+
* `SubAgentMiddleware`) — attempting to do so throws at construction
|
|
3500
|
+
* time.
|
|
3501
|
+
*
|
|
3502
|
+
* @default [] (no middleware excluded)
|
|
3503
|
+
*/
|
|
3504
|
+
excludedMiddleware?: string[];
|
|
3505
|
+
/**
|
|
3506
|
+
* Additional middleware appended to the stack after user middleware.
|
|
3507
|
+
*
|
|
3508
|
+
* Can be a static array or a zero-arg factory that returns fresh
|
|
3509
|
+
* instances per agent construction (important when middleware carries
|
|
3510
|
+
* mutable state).
|
|
3511
|
+
*
|
|
3512
|
+
* @default [] (no extra middleware)
|
|
3513
|
+
*/
|
|
3514
|
+
extraMiddleware?: AgentMiddleware[] | (() => AgentMiddleware[]);
|
|
3515
|
+
/**
|
|
3516
|
+
* Configuration for the auto-added general-purpose subagent.
|
|
3517
|
+
*
|
|
3518
|
+
* @default undefined (GP subagent uses all defaults)
|
|
3519
|
+
*/
|
|
3520
|
+
generalPurposeSubagent?: GeneralPurposeSubagentConfig;
|
|
3521
|
+
}
|
|
3522
|
+
/**
|
|
3523
|
+
* Frozen runtime harness profile that shapes agent behavior at
|
|
3524
|
+
* assembly time.
|
|
3525
|
+
*
|
|
3526
|
+
* Created by {@link createHarnessProfile} from user-provided
|
|
3527
|
+
* {@link HarnessProfileOptions}. Collection types are narrowed
|
|
3528
|
+
* (arrays → `Set`, records frozen) and all fields are required.
|
|
3529
|
+
* The object is frozen via `Object.freeze()` to prevent mutation
|
|
3530
|
+
* after construction.
|
|
3531
|
+
*
|
|
3532
|
+
* Profiles are **orthogonal to model selection**: they control prompt
|
|
3533
|
+
* assembly, tool visibility, middleware composition, and subagent
|
|
3534
|
+
* configuration — not which model is used.
|
|
3535
|
+
*/
|
|
3536
|
+
interface HarnessProfile {
|
|
3537
|
+
/**
|
|
3538
|
+
* Replaces the default `BASE_AGENT_PROMPT` when set.
|
|
3539
|
+
*
|
|
3540
|
+
* Use this when a model requires a fundamentally different base
|
|
3541
|
+
* prompt rather than an additive suffix. Most profiles should prefer
|
|
3542
|
+
* `systemPromptSuffix` instead.
|
|
3543
|
+
*/
|
|
3544
|
+
baseSystemPrompt: string | undefined;
|
|
3545
|
+
/**
|
|
3546
|
+
* Text appended to the assembled base prompt with a blank-line
|
|
3547
|
+
* separator (`\n\n`).
|
|
3548
|
+
*
|
|
3549
|
+
* This is the primary mechanism for model-specific prompt tuning.
|
|
3550
|
+
* Applied uniformly to the main agent, declarative subagents, and
|
|
3551
|
+
* the auto-added general-purpose subagent.
|
|
3552
|
+
*/
|
|
3553
|
+
systemPromptSuffix: string | undefined;
|
|
3554
|
+
/**
|
|
3555
|
+
* Per-tool description replacements keyed by tool name.
|
|
3556
|
+
*
|
|
3557
|
+
* Allows profiles to rewrite tool descriptions for models that
|
|
3558
|
+
* respond better to different phrasing. Keys that don't match any
|
|
3559
|
+
* tool in the final tool set are silently ignored.
|
|
3560
|
+
*/
|
|
3561
|
+
toolDescriptionOverrides: Record<string, string>;
|
|
3562
|
+
/**
|
|
3563
|
+
* Tool names to remove from the agent's visible tool set.
|
|
3564
|
+
*
|
|
3565
|
+
* Applied via a filtering middleware after all tool-injecting
|
|
3566
|
+
* middleware have run, so it catches both user-provided and
|
|
3567
|
+
* middleware-provided tools.
|
|
3568
|
+
*/
|
|
3569
|
+
excludedTools: Set<string>;
|
|
3570
|
+
/**
|
|
3571
|
+
* Middleware names to remove from the assembled middleware stack.
|
|
3572
|
+
*
|
|
3573
|
+
* Matched against each middleware's `.name` property. Cannot include
|
|
3574
|
+
* required scaffolding names (`FilesystemMiddleware`,
|
|
3575
|
+
* `SubAgentMiddleware`) — attempting to do so throws at construction
|
|
3576
|
+
* time.
|
|
3577
|
+
*/
|
|
3578
|
+
excludedMiddleware: Set<string>;
|
|
3579
|
+
/**
|
|
3580
|
+
* Additional middleware appended to the stack after user middleware.
|
|
3581
|
+
*
|
|
3582
|
+
* Can be a static array or a zero-arg factory that returns fresh
|
|
3583
|
+
* instances per agent construction (important when middleware carries
|
|
3584
|
+
* mutable state).
|
|
3585
|
+
*/
|
|
3586
|
+
extraMiddleware: AgentMiddleware[] | (() => AgentMiddleware[]);
|
|
3587
|
+
/**
|
|
3588
|
+
* Configuration for the auto-added general-purpose subagent.
|
|
3589
|
+
*/
|
|
3590
|
+
generalPurposeSubagent: GeneralPurposeSubagentConfig | undefined;
|
|
3591
|
+
}
|
|
3592
|
+
//#endregion
|
|
3593
|
+
//#region src/profiles/harness/create.d.ts
|
|
3594
|
+
/**
|
|
3595
|
+
* Create a frozen {@link HarnessProfile} from user-provided options.
|
|
3596
|
+
*
|
|
3597
|
+
* Validates all fields, converts mutable collections to their
|
|
3598
|
+
* frozen counterparts, and returns a frozen object.
|
|
3599
|
+
* Empty options produce a no-op profile (all defaults).
|
|
3600
|
+
*
|
|
3601
|
+
* @param options - Partial profile configuration.
|
|
3602
|
+
* @returns A frozen, validated `HarnessProfile`.
|
|
3603
|
+
* @throws {Error} When any field violates validation rules (invalid
|
|
3604
|
+
* middleware names, scaffolding exclusion attempts).
|
|
3605
|
+
*
|
|
3606
|
+
* @example
|
|
3607
|
+
* ```typescript
|
|
3608
|
+
* const profile = createHarnessProfile({
|
|
3609
|
+
* systemPromptSuffix: "Think step by step.",
|
|
3610
|
+
* excludedTools: ["execute"],
|
|
3611
|
+
* });
|
|
3612
|
+
* ```
|
|
3613
|
+
*/
|
|
3614
|
+
declare function createHarnessProfile(options?: HarnessProfileOptions): HarnessProfile;
|
|
3615
|
+
/**
|
|
3616
|
+
* An empty no-op profile used as the default when no registered
|
|
3617
|
+
* profile matches. Avoids creating a new object on every miss.
|
|
3618
|
+
*/
|
|
3619
|
+
declare const EMPTY_HARNESS_PROFILE: HarnessProfile;
|
|
3620
|
+
//#endregion
|
|
3621
|
+
//#region src/profiles/harness/serialization.d.ts
|
|
3622
|
+
/**
|
|
3623
|
+
* Zod schema for the general-purpose subagent config section of an
|
|
3624
|
+
* external harness profile config file.
|
|
3625
|
+
*/
|
|
3626
|
+
declare const generalPurposeSubagentConfigSchema: z.ZodObject<{
|
|
3627
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3628
|
+
description: z.ZodOptional<z.ZodString>;
|
|
3629
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
3630
|
+
}, z.core.$strict>;
|
|
3631
|
+
/**
|
|
3632
|
+
* Zod schema for parsing a harness profile from an external JSON or
|
|
3633
|
+
* YAML config file.
|
|
3634
|
+
*
|
|
3635
|
+
* Uses `.strict()` to reject unknown keys (catches typos early). Array
|
|
3636
|
+
* fields (`excludedTools`, `excludedMiddleware`) accept arrays of
|
|
3637
|
+
* strings; the result is passed to {@link createHarnessProfile} which
|
|
3638
|
+
* converts them to `Set`.
|
|
3639
|
+
*
|
|
3640
|
+
* Does not include `extraMiddleware` — middleware instances cannot be
|
|
3641
|
+
* represented in JSON/YAML.
|
|
3642
|
+
*
|
|
3643
|
+
* @example
|
|
3644
|
+
* ```typescript
|
|
3645
|
+
* import { readFileSync } from "fs";
|
|
3646
|
+
* import YAML from "yaml";
|
|
3647
|
+
*
|
|
3648
|
+
* const raw = YAML.parse(readFileSync("profile.yaml", "utf-8"));
|
|
3649
|
+
* const config = harnessProfileConfigSchema.parse(raw);
|
|
3650
|
+
* const profile = createHarnessProfile(config);
|
|
3651
|
+
* ```
|
|
3652
|
+
*/
|
|
3653
|
+
declare const harnessProfileConfigSchema: z.ZodObject<{
|
|
3654
|
+
baseSystemPrompt: z.ZodOptional<z.ZodString>;
|
|
3655
|
+
systemPromptSuffix: z.ZodOptional<z.ZodString>;
|
|
3656
|
+
toolDescriptionOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3657
|
+
excludedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3658
|
+
excludedMiddleware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3659
|
+
generalPurposeSubagent: z.ZodOptional<z.ZodObject<{
|
|
3660
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3661
|
+
description: z.ZodOptional<z.ZodString>;
|
|
3662
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
3663
|
+
}, z.core.$strict>>;
|
|
3664
|
+
}, z.core.$strict>;
|
|
3665
|
+
/**
|
|
3666
|
+
* TypeScript type inferred from the Zod config schema.
|
|
3667
|
+
*
|
|
3668
|
+
* Represents the JSON/YAML-compatible shape of a harness profile. This
|
|
3669
|
+
* is the type of data that comes out of `harnessProfileConfigSchema.parse()`.
|
|
3670
|
+
*/
|
|
3671
|
+
type HarnessProfileConfigData = z.infer<typeof harnessProfileConfigSchema>;
|
|
3672
|
+
/**
|
|
3673
|
+
* Parse an untrusted JSON/YAML object into a validated
|
|
3674
|
+
* {@link HarnessProfile}.
|
|
3675
|
+
*
|
|
3676
|
+
* Combines Zod schema validation with prototype-pollution protection
|
|
3677
|
+
* and profile construction validation. Use this for any config data
|
|
3678
|
+
* that originates from files, network, or user input.
|
|
3679
|
+
*
|
|
3680
|
+
* @param data - Raw object from `JSON.parse()` or `YAML.parse()`.
|
|
3681
|
+
* @returns A frozen, validated `HarnessProfile`.
|
|
3682
|
+
* @throws {z.ZodError} When the data fails schema validation.
|
|
3683
|
+
* @throws {Error} When profile-level validation fails (e.g.,
|
|
3684
|
+
* scaffolding violation in `excludedMiddleware`).
|
|
3685
|
+
*/
|
|
3686
|
+
declare function parseHarnessProfileConfig(data: unknown): HarnessProfile;
|
|
3687
|
+
/**
|
|
3688
|
+
* Serialize a {@link HarnessProfile} to a JSON-compatible object.
|
|
3689
|
+
*
|
|
3690
|
+
* Omits `undefined` fields and `extraMiddleware` (runtime-only).
|
|
3691
|
+
* Throws if `extraMiddleware` contains instances — callers should
|
|
3692
|
+
* strip it before serializing if they've set it.
|
|
3693
|
+
*
|
|
3694
|
+
* @param profile - The profile to serialize.
|
|
3695
|
+
* @returns A plain object matching {@link HarnessProfileConfigData}.
|
|
3696
|
+
* @throws {Error} When `extraMiddleware` is non-empty (cannot be
|
|
3697
|
+
* serialized to JSON).
|
|
3698
|
+
*/
|
|
3699
|
+
declare function serializeProfile(profile: HarnessProfile): HarnessProfileConfigData;
|
|
3700
|
+
//#endregion
|
|
3701
|
+
//#region src/profiles/harness/registry.d.ts
|
|
3702
|
+
/**
|
|
3703
|
+
* Register a harness profile for a provider or specific model.
|
|
3704
|
+
*
|
|
3705
|
+
* Accepts either a pre-built {@link HarnessProfile} (from
|
|
3706
|
+
* {@link createHarnessProfile}) or raw {@link HarnessProfileOptions}
|
|
3707
|
+
* that will be validated and frozen automatically.
|
|
3708
|
+
*
|
|
3709
|
+
* Registrations are **additive**: if a profile already exists under
|
|
3710
|
+
* `key`, the new profile is merged on top. The incoming profile's
|
|
3711
|
+
* fields win on scalar conflicts; set fields union; middleware
|
|
3712
|
+
* sequences merge by name.
|
|
3713
|
+
*
|
|
3714
|
+
* @param key - Either a bare provider (`"openai"`) for provider-wide
|
|
3715
|
+
* defaults, or `"provider:model"` for a per-model override.
|
|
3716
|
+
* @param profile - A `HarnessProfile` or options to build one from.
|
|
3717
|
+
* @throws {Error} When `key` is malformed or profile validation
|
|
3718
|
+
* fails.
|
|
3719
|
+
*
|
|
3720
|
+
* @example
|
|
3721
|
+
* ```typescript
|
|
3722
|
+
* import { registerHarnessProfile } from "@langchain/deepagents";
|
|
3723
|
+
*
|
|
3724
|
+
* registerHarnessProfile("openai", {
|
|
3725
|
+
* systemPromptSuffix: "Respond concisely.",
|
|
3726
|
+
* });
|
|
3727
|
+
*
|
|
3728
|
+
* registerHarnessProfile("openai:gpt-5.4", {
|
|
3729
|
+
* excludedTools: ["execute"],
|
|
3730
|
+
* });
|
|
3731
|
+
* ```
|
|
3732
|
+
*/
|
|
3733
|
+
declare function registerHarnessProfile(key: string, profile: HarnessProfile | HarnessProfileOptions): void;
|
|
3734
|
+
/**
|
|
3735
|
+
* Look up the {@link HarnessProfile} for a model spec string.
|
|
3736
|
+
*
|
|
3737
|
+
* Resolution order:
|
|
3738
|
+
*
|
|
3739
|
+
* 1. **Exact match** on `spec` (e.g., `"openai:gpt-5.4"`).
|
|
3740
|
+
* 2. **Provider prefix** (everything before `:`) when `spec` contains
|
|
3741
|
+
* a colon and both halves are non-empty.
|
|
3742
|
+
* 3. When both exist, they are **merged** (provider as base, exact as
|
|
3743
|
+
* override).
|
|
3744
|
+
* 4. `undefined` when nothing matches.
|
|
3745
|
+
*
|
|
3746
|
+
* Malformed specs (empty, multiple colons, empty halves) return
|
|
3747
|
+
* `undefined` without consulting the registry.
|
|
3748
|
+
*
|
|
3749
|
+
* @param spec - Model spec in `"provider:model"` format, or a bare
|
|
3750
|
+
* provider/model identifier.
|
|
3751
|
+
* @returns The matching profile, or `undefined`.
|
|
3752
|
+
*/
|
|
3753
|
+
declare function getHarnessProfile(spec: string): HarnessProfile | undefined;
|
|
3754
|
+
//#endregion
|
|
3325
3755
|
//#region src/config.d.ts
|
|
3326
3756
|
/**
|
|
3327
3757
|
* Configuration and settings for deepagents.
|
|
@@ -3527,5 +3957,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
3527
3957
|
*/
|
|
3528
3958
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
3529
3959
|
//#endregion
|
|
3530
|
-
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, GENERAL_PURPOSE_SUBAGENT, type GlobResult, type GrepMatch, type GrepResult, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, LangSmithSandbox, type LangSmithSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3960
|
+
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, ContextHubBackend, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, EMPTY_HARNESS_PROFILE, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, GENERAL_PURPOSE_SUBAGENT, type GeneralPurposeSubagentConfig, type GlobResult, type GrepMatch, type GrepResult, type HarnessProfile, type HarnessProfileConfigData, type HarnessProfileOptions, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type LangSmithCaptureSnapshotOptions, LangSmithSandbox, type LangSmithSandboxCreateOptions, type LangSmithSandboxOptions, type LangSmithSnapshot, type LangSmithStartSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, REQUIRED_MIDDLEWARE_NAMES, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createHarnessProfile, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, generalPurposeSubagentConfigSchema, getHarnessProfile, harnessProfileConfigSchema, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseHarnessProfileConfig, parseSkillMetadata, registerHarnessProfile, resolveBackend, serializeProfile };
|
|
3531
3961
|
//# sourceMappingURL=index.d.ts.map
|