@declaw/sdk 1.1.12 → 1.2.0
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/CHANGELOG.md +35 -0
- package/LICENSE +1 -1
- package/dist/index.cjs +566 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +327 -12
- package/dist/index.d.ts +327 -12
- package/dist/index.js +554 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -234,10 +234,9 @@ declare function networkPolicyToOpts(policy: NetworkPolicy): SandboxNetworkOpts;
|
|
|
234
234
|
/**
|
|
235
235
|
* Toggle for per-sandbox audit logging.
|
|
236
236
|
*
|
|
237
|
-
* Declaw records
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* the collector and nothing is persisted.
|
|
237
|
+
* When enabled, Declaw records lifecycle, network, command, filesystem,
|
|
238
|
+
* snapshot, and security events. Set `enabled: false` to suppress all
|
|
239
|
+
* gated categories; only lifecycle and admin events are still recorded.
|
|
241
240
|
*
|
|
242
241
|
* Retention is a platform-wide setting (global 7-day default), not a
|
|
243
242
|
* per-sandbox knob. Body logging is not user-configurable today.
|
|
@@ -343,6 +342,62 @@ declare function parseInvisibleTextConfig(data: Record<string, unknown>): Invisi
|
|
|
343
342
|
/** Serialize an InvisibleTextConfig to a JSON-friendly object. */
|
|
344
343
|
declare function invisibleTextConfigToJSON(config: InvisibleTextConfig): Record<string, unknown>;
|
|
345
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Custom OPA policy configuration for per-sandbox policy overrides.
|
|
347
|
+
*/
|
|
348
|
+
interface CustomPolicyConfig {
|
|
349
|
+
/** Enable custom policy evaluation for this sandbox. */
|
|
350
|
+
enabled: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Customer-supplied Rego code appended to platform defaults.
|
|
353
|
+
*
|
|
354
|
+
* Example:
|
|
355
|
+
* deny_command contains msg if {
|
|
356
|
+
* input.action.command in {"rm", "dd"}
|
|
357
|
+
* msg := "dangerous command blocked"
|
|
358
|
+
* }
|
|
359
|
+
*/
|
|
360
|
+
inlineRego?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Additional independent Rego modules, each with its own `package` declaration.
|
|
363
|
+
*
|
|
364
|
+
* Use when your policy spans multiple packages (e.g. a `cmd` package and a
|
|
365
|
+
* `network` package) that need to cross-reference each other. Each entry is
|
|
366
|
+
* compiled as a separate OPA module alongside `inlineRego`.
|
|
367
|
+
*/
|
|
368
|
+
inlineModules?: string[];
|
|
369
|
+
/** Future: reference to a bundled policy (URL, policy ID, version hash). */
|
|
370
|
+
policyRef?: string;
|
|
371
|
+
/**
|
|
372
|
+
* When the evaluator is unreachable, deny (true) or allow (false).
|
|
373
|
+
*
|
|
374
|
+
* Fail-closed (defaultDeny=true) is safer for security gates.
|
|
375
|
+
* Fail-open (defaultDeny=false) is acceptable for advisory scanners.
|
|
376
|
+
*/
|
|
377
|
+
defaultDeny?: boolean;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Configuration for the content.scan OPA gate (model/endpoint allowlist).
|
|
381
|
+
*
|
|
382
|
+
* Opts a sandbox into content-gate enforcement without requiring an ML
|
|
383
|
+
* scanner. {@link enabled} defaults to false (gate off). {@link domains}
|
|
384
|
+
* is an optional list of hosts to intercept; omit or leave undefined to
|
|
385
|
+
* intercept none.
|
|
386
|
+
*/
|
|
387
|
+
interface ContentGateConfig {
|
|
388
|
+
enabled: boolean;
|
|
389
|
+
/** Optional list of hosts to intercept. Undefined = none. */
|
|
390
|
+
domains?: string[];
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Create a ContentGateConfig with defaults.
|
|
394
|
+
*/
|
|
395
|
+
declare function createContentGateConfig(opts?: Partial<ContentGateConfig>): ContentGateConfig;
|
|
396
|
+
/** Parse raw JSON data into ContentGateConfig. */
|
|
397
|
+
declare function parseContentGateConfig(data: Record<string, unknown>): ContentGateConfig;
|
|
398
|
+
/** Serialize a ContentGateConfig to a JSON-friendly object. */
|
|
399
|
+
declare function contentGateConfigToJSON(config: ContentGateConfig): Record<string, unknown>;
|
|
400
|
+
|
|
346
401
|
/** The top-level security policy for a sandbox. */
|
|
347
402
|
interface SecurityPolicy {
|
|
348
403
|
pii: PIIConfig;
|
|
@@ -354,6 +409,8 @@ interface SecurityPolicy {
|
|
|
354
409
|
toxicity?: ToxicityConfig;
|
|
355
410
|
codeSecurity?: CodeSecurityConfig;
|
|
356
411
|
invisibleText?: InvisibleTextConfig;
|
|
412
|
+
contentGate?: ContentGateConfig;
|
|
413
|
+
customPolicy?: CustomPolicyConfig;
|
|
357
414
|
}
|
|
358
415
|
/**
|
|
359
416
|
* Create a SecurityPolicy with defaults.
|
|
@@ -992,10 +1049,24 @@ declare class Stdio {
|
|
|
992
1049
|
start(cmd: string, opts?: StdioStartOpts): Promise<StdioProcess>;
|
|
993
1050
|
}
|
|
994
1051
|
|
|
1052
|
+
/** Live-mount / copy mode for a volume attachment on Sandbox.create. */
|
|
1053
|
+
type VolumeAttachMode = 'copy' | 'mount' | 'mount-ro';
|
|
995
1054
|
/** Request-side shape of a volume attachment on Sandbox.create. */
|
|
996
1055
|
interface VolumeAttachment {
|
|
997
1056
|
volumeId: string;
|
|
998
1057
|
mountPath: string;
|
|
1058
|
+
/**
|
|
1059
|
+
* Attach mode. `copy` (default) hydrates the volume into the sandbox
|
|
1060
|
+
* filesystem at boot. `mount` is a read-write live NFS mount; `mount-ro`
|
|
1061
|
+
* is a read-only live mount. Omitted from the wire when unset (server
|
|
1062
|
+
* defaults to copy).
|
|
1063
|
+
*/
|
|
1064
|
+
mode?: VolumeAttachMode;
|
|
1065
|
+
/**
|
|
1066
|
+
* Relative path within the volume to mount. LIVE-MOUNT ONLY — the server
|
|
1067
|
+
* rejects a subpath on a copy-mode attachment.
|
|
1068
|
+
*/
|
|
1069
|
+
subpath?: string;
|
|
999
1070
|
}
|
|
1000
1071
|
/** Server-side metadata for a single volume. */
|
|
1001
1072
|
interface VolumeInfo {
|
|
@@ -1007,9 +1078,48 @@ interface VolumeInfo {
|
|
|
1007
1078
|
contentType: string;
|
|
1008
1079
|
metadata: Record<string, string>;
|
|
1009
1080
|
createdAt: string;
|
|
1081
|
+
/** Storage backend ("tarball" or a file-granular backend). */
|
|
1082
|
+
backend: string;
|
|
1083
|
+
/** Per-volume quota in bytes (0 = unset/unlimited). */
|
|
1084
|
+
quotaBytes: number;
|
|
1085
|
+
/** Last-modified timestamp (ISO 8601). */
|
|
1086
|
+
updatedAt: string;
|
|
1087
|
+
}
|
|
1088
|
+
/** A single directory entry inside a file-granular volume (volumefs.Entry). */
|
|
1089
|
+
interface FileEntry {
|
|
1090
|
+
name: string;
|
|
1091
|
+
path: string;
|
|
1092
|
+
isDir: boolean;
|
|
1093
|
+
size: number;
|
|
1094
|
+
modTime: string;
|
|
1095
|
+
mode: number;
|
|
1096
|
+
}
|
|
1097
|
+
/** A file entry plus the CAS token returned by `info`/`stat`. */
|
|
1098
|
+
interface FileInfo extends FileEntry {
|
|
1099
|
+
/** CAS token to round-trip into a conditional write's `ifVersion`. */
|
|
1100
|
+
version: string;
|
|
1101
|
+
}
|
|
1102
|
+
/** Result of acquiring or renewing a lock. */
|
|
1103
|
+
interface LockLease {
|
|
1104
|
+
token: string;
|
|
1105
|
+
ttlSeconds: number;
|
|
1106
|
+
expiresAt: string;
|
|
1107
|
+
}
|
|
1108
|
+
/** Result of querying lock status. */
|
|
1109
|
+
interface LockStatus {
|
|
1110
|
+
held: boolean;
|
|
1111
|
+
expiresInMs: number;
|
|
1010
1112
|
}
|
|
1011
1113
|
/** Convert a wire-format volume row into a VolumeInfo. */
|
|
1012
1114
|
declare function parseVolumeInfo(data: Record<string, unknown>): VolumeInfo;
|
|
1115
|
+
/** Convert a wire-format file entry into a FileEntry. */
|
|
1116
|
+
declare function parseFileEntry(data: Record<string, unknown>): FileEntry;
|
|
1117
|
+
/** Convert a wire-format stat response into a FileInfo (FileEntry + version). */
|
|
1118
|
+
declare function parseFileInfo(data: Record<string, unknown>): FileInfo;
|
|
1119
|
+
/** Convert a wire-format lock lease into a LockLease. */
|
|
1120
|
+
declare function parseLockLease(data: Record<string, unknown>): LockLease;
|
|
1121
|
+
/** Convert a wire-format lock status into a LockStatus. */
|
|
1122
|
+
declare function parseLockStatus(data: Record<string, unknown>): LockStatus;
|
|
1013
1123
|
/** Render a VolumeAttachment in wire (snake_case) form. */
|
|
1014
1124
|
declare function volumeAttachmentToJSON(att: VolumeAttachment): Record<string, string>;
|
|
1015
1125
|
|
|
@@ -1375,6 +1485,20 @@ declare class NotEnoughSpaceError extends SandboxError {
|
|
|
1375
1485
|
sandboxId?: string;
|
|
1376
1486
|
});
|
|
1377
1487
|
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Thrown on an HTTP 409 conflict.
|
|
1490
|
+
*
|
|
1491
|
+
* For volume file writes this signals a CAS (compare-and-swap) version
|
|
1492
|
+
* mismatch — the file changed since the `if_version` token was read. For
|
|
1493
|
+
* volume locks it signals the lock is already held by another holder (on
|
|
1494
|
+
* acquire) or that the caller is not the current holder (on release/renew).
|
|
1495
|
+
* Catch this to re-read and retry.
|
|
1496
|
+
*/
|
|
1497
|
+
declare class ConflictError extends SandboxError {
|
|
1498
|
+
constructor(message: string, opts?: {
|
|
1499
|
+
sandboxId?: string;
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1378
1502
|
/** Thrown for template-related errors. */
|
|
1379
1503
|
declare class TemplateError extends SandboxError {
|
|
1380
1504
|
constructor(message: string, opts?: {
|
|
@@ -1591,35 +1715,226 @@ declare class Template {
|
|
|
1591
1715
|
static getBuildStatus(buildId: string, opts?: GetBuildStatusOpts): Promise<TemplateBuildStatus>;
|
|
1592
1716
|
}
|
|
1593
1717
|
|
|
1594
|
-
/** Shared per-call options. */
|
|
1718
|
+
/** Shared per-call options for volume operations. */
|
|
1595
1719
|
interface VolumeRequestOpts {
|
|
1596
1720
|
apiKey?: string;
|
|
1597
1721
|
domain?: string;
|
|
1598
1722
|
apiUrl?: string;
|
|
1599
1723
|
requestTimeout?: number;
|
|
1600
1724
|
}
|
|
1601
|
-
|
|
1725
|
+
|
|
1726
|
+
/** Options for VolumeFiles.write. */
|
|
1727
|
+
interface VolumeWriteOpts extends VolumeRequestOpts {
|
|
1728
|
+
/**
|
|
1729
|
+
* CAS token from `info(path).version`. When set, the server rejects the
|
|
1730
|
+
* write with a ConflictError (409) if the file changed since the token was
|
|
1731
|
+
* read. Omit for an unconditional write.
|
|
1732
|
+
*/
|
|
1733
|
+
ifVersion?: string;
|
|
1734
|
+
}
|
|
1735
|
+
/** Options for VolumeFiles.remove. */
|
|
1736
|
+
interface VolumeRemoveOpts extends VolumeRequestOpts {
|
|
1737
|
+
/** Recursively remove a directory and its contents. */
|
|
1738
|
+
recursive?: boolean;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* File-granular operations on a single volume.
|
|
1742
|
+
*
|
|
1743
|
+
* Only valid for file-granular (non-tarball) volumes — the server returns
|
|
1744
|
+
* a ConflictError (409) for a tarball-backed volume and a 503 when no
|
|
1745
|
+
* file-granular accessor is configured. Obtain an instance via
|
|
1746
|
+
* `Volumes.files(volumeId)`.
|
|
1747
|
+
*/
|
|
1748
|
+
declare class VolumeFiles {
|
|
1749
|
+
private readonly volumeId;
|
|
1750
|
+
private readonly opts?;
|
|
1751
|
+
constructor(volumeId: string, opts?: VolumeRequestOpts);
|
|
1752
|
+
private client;
|
|
1753
|
+
private timeout;
|
|
1754
|
+
/** Write raw bytes to `path`. Optionally conditional on `ifVersion` (CAS). */
|
|
1755
|
+
write(path: string, data: Uint8Array | ArrayBuffer, opts?: VolumeWriteOpts): Promise<string>;
|
|
1756
|
+
/** Read raw bytes from `path`. */
|
|
1757
|
+
read(path: string): Promise<Uint8Array>;
|
|
1758
|
+
/** List directory entries under `path`. */
|
|
1759
|
+
list(path: string): Promise<FileEntry[]>;
|
|
1760
|
+
/** Stat `path`, returning the entry plus the CAS `version` token. */
|
|
1761
|
+
info(path: string): Promise<FileInfo>;
|
|
1762
|
+
/** Return whether `path` exists. */
|
|
1763
|
+
exists(path: string): Promise<boolean>;
|
|
1764
|
+
/** Remove `path`. Pass `{ recursive: true }` to remove a directory tree. */
|
|
1765
|
+
remove(path: string, opts?: VolumeRemoveOpts): Promise<void>;
|
|
1766
|
+
/** Rename `oldPath` to `newPath`. */
|
|
1767
|
+
rename(oldPath: string, newPath: string): Promise<{
|
|
1768
|
+
oldPath: string;
|
|
1769
|
+
newPath: string;
|
|
1770
|
+
}>;
|
|
1771
|
+
/** Create a directory at `path`. */
|
|
1772
|
+
mkdir(path: string): Promise<string>;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* Advisory locks (leases) over a (volume, path) pair.
|
|
1777
|
+
*
|
|
1778
|
+
* Acquire returns a token; renew/release require it. A ConflictError (409)
|
|
1779
|
+
* is raised on acquire when the path is already locked, and on renew/release
|
|
1780
|
+
* when the caller is not the current holder. Obtain an instance via
|
|
1781
|
+
* `Volumes.locks(volumeId)`.
|
|
1782
|
+
*/
|
|
1783
|
+
declare class VolumeLocks {
|
|
1784
|
+
private readonly volumeId;
|
|
1785
|
+
private readonly opts?;
|
|
1786
|
+
constructor(volumeId: string, opts?: VolumeRequestOpts);
|
|
1787
|
+
private client;
|
|
1788
|
+
private timeout;
|
|
1789
|
+
/** Acquire a lock on `path`. Throws ConflictError (409) if already held. */
|
|
1790
|
+
acquire(path: string, ttlSeconds?: number): Promise<LockLease>;
|
|
1791
|
+
/** Release a lock on `path` held under `token`. Throws ConflictError (409) if not the holder. */
|
|
1792
|
+
release(path: string, token: string): Promise<boolean>;
|
|
1793
|
+
/** Renew a lock on `path` held under `token`. Throws ConflictError (409) if not the holder. */
|
|
1794
|
+
renew(path: string, token: string, ttlSeconds?: number): Promise<LockLease>;
|
|
1795
|
+
/** Query whether `path` is currently locked. */
|
|
1796
|
+
status(path: string): Promise<LockStatus>;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
/** Options for Volumes.create / ingest. */
|
|
1602
1800
|
interface VolumeCreateOpts extends VolumeRequestOpts {
|
|
1603
1801
|
/** Override the Content-Type header. Defaults to application/gzip. */
|
|
1604
1802
|
contentType?: string;
|
|
1605
1803
|
}
|
|
1606
1804
|
/**
|
|
1607
|
-
* Volumes: upload a tarball once and attach it to one or many sandboxes
|
|
1805
|
+
* Volumes: upload a tarball once and attach it to one or many sandboxes,
|
|
1806
|
+
* or create file-granular volumes that support per-file read/write,
|
|
1807
|
+
* compare-and-swap (CAS), and advisory locks.
|
|
1608
1808
|
*
|
|
1609
|
-
* Phase 1: the body must be a gzip-compressed tar archive;
|
|
1610
|
-
* materializes regular-file entries inside the sandbox filesystem
|
|
1611
|
-
* the attachment's mount_path. Symlinks, hardlinks, and device nodes
|
|
1809
|
+
* Phase 1 (tarball backend): the body must be a gzip-compressed tar archive;
|
|
1810
|
+
* the server materializes regular-file entries inside the sandbox filesystem
|
|
1811
|
+
* under the attachment's mount_path. Symlinks, hardlinks, and device nodes
|
|
1612
1812
|
* are dropped on the server for safety.
|
|
1613
1813
|
*/
|
|
1614
1814
|
declare class Volumes {
|
|
1615
|
-
/** Create a volume by streaming a tarball to the server. */
|
|
1815
|
+
/** Create a volume by streaming a tarball (gzip tar.gz) to the server. */
|
|
1616
1816
|
static create(name: string, data: Uint8Array | ArrayBuffer, opts?: VolumeCreateOpts): Promise<VolumeInfo>;
|
|
1817
|
+
/**
|
|
1818
|
+
* Capture the attached volume's mount path in `sandboxId` into a NEW volume.
|
|
1819
|
+
*
|
|
1820
|
+
* The source volume is left unchanged. If `name` is omitted the server names
|
|
1821
|
+
* the new volume "<source-name>-commit". Returns the new VolumeInfo.
|
|
1822
|
+
*/
|
|
1823
|
+
static commit(sandboxId: string, volumeId: string, name?: string, opts?: VolumeRequestOpts): Promise<VolumeInfo>;
|
|
1824
|
+
/**
|
|
1825
|
+
* Snapshot an arbitrary absolute in-sandbox `path` into a NEW volume.
|
|
1826
|
+
*
|
|
1827
|
+
* Unlike `commit` (which captures an already-attached volume's mount path),
|
|
1828
|
+
* `snapshot` captures any path in the running sandbox. `name` defaults to
|
|
1829
|
+
* "snapshot" on the server. Synthetic paths (/proc, /sys, /dev) are rejected.
|
|
1830
|
+
*/
|
|
1831
|
+
static snapshot(sandboxId: string, path: string, name?: string, opts?: VolumeRequestOpts): Promise<VolumeInfo>;
|
|
1832
|
+
/**
|
|
1833
|
+
* Create an empty file-granular volume. Requires a file-granular backend
|
|
1834
|
+
* (503 if not configured). Returns the new VolumeInfo.
|
|
1835
|
+
*/
|
|
1836
|
+
static empty(name: string, opts?: VolumeRequestOpts): Promise<VolumeInfo>;
|
|
1837
|
+
/**
|
|
1838
|
+
* Ingest a gzip tar.gz archive into a NEW file-granular volume. Requires a
|
|
1839
|
+
* file-granular backend (503 if not configured). 413 on quota exceeded.
|
|
1840
|
+
*/
|
|
1841
|
+
static ingest(name: string, data: Uint8Array | ArrayBuffer, opts?: VolumeCreateOpts): Promise<VolumeInfo>;
|
|
1617
1842
|
/** Fetch metadata for a single volume. */
|
|
1618
1843
|
static get(volumeId: string, opts?: VolumeRequestOpts): Promise<VolumeInfo>;
|
|
1619
1844
|
/** List all volumes owned by the caller, newest first. */
|
|
1620
1845
|
static list(opts?: VolumeRequestOpts): Promise<VolumeInfo[]>;
|
|
1846
|
+
/** Download the volume's contents as raw bytes (the stored archive/blob). */
|
|
1847
|
+
static download(volumeId: string, opts?: VolumeRequestOpts): Promise<Uint8Array>;
|
|
1621
1848
|
/** Delete a volume and its blob. Idempotent on the wire. */
|
|
1622
1849
|
static delete(volumeId: string, opts?: VolumeRequestOpts): Promise<void>;
|
|
1850
|
+
/**
|
|
1851
|
+
* File-granular operations (read/write/list/info/exists/remove/rename/mkdir,
|
|
1852
|
+
* plus CAS via `write(..., { ifVersion })`) on `volumeId`. File-granular
|
|
1853
|
+
* volumes only.
|
|
1854
|
+
*/
|
|
1855
|
+
static files(volumeId: string, opts?: VolumeRequestOpts): VolumeFiles;
|
|
1856
|
+
/** Advisory locks (acquire/release/renew/status) over a (volume, path). */
|
|
1857
|
+
static locks(volumeId: string, opts?: VolumeRequestOpts): VolumeLocks;
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
/** A single enforced control within a governance pack gate. */
|
|
1861
|
+
interface GovernanceControl {
|
|
1862
|
+
/** Control identifier, e.g. "OWASP-LLM06-ExcessiveAgency". */
|
|
1863
|
+
control: string;
|
|
1864
|
+
/** Gate that enforces this control: "cmd", "network", or "content". */
|
|
1865
|
+
gate: string;
|
|
1866
|
+
/** Human-readable rule description. */
|
|
1867
|
+
rule: string;
|
|
1868
|
+
/** Remediation playbook / guidance. */
|
|
1869
|
+
playbook: string;
|
|
1870
|
+
}
|
|
1871
|
+
/** An advisory (non-enforced) item within a governance pack. */
|
|
1872
|
+
interface GovernanceAdvisory {
|
|
1873
|
+
/** Control identifier this advisory references. */
|
|
1874
|
+
control: string;
|
|
1875
|
+
/** Explanation of why this control is advisory rather than enforced. */
|
|
1876
|
+
reason: string;
|
|
1877
|
+
}
|
|
1878
|
+
/** A governance pack returned by GET /governance/packs or GET /governance/packs/:name. */
|
|
1879
|
+
interface GovernancePack {
|
|
1880
|
+
/** Pack name / slug, e.g. "owasp-llm-top10". */
|
|
1881
|
+
name: string;
|
|
1882
|
+
/** Pack version string, e.g. "v1". */
|
|
1883
|
+
version: string;
|
|
1884
|
+
/** Full framework name, e.g. "OWASP Top 10 for LLM Applications (2025)". */
|
|
1885
|
+
framework: string;
|
|
1886
|
+
/** Human-readable description of what this pack enforces. */
|
|
1887
|
+
description: string;
|
|
1888
|
+
/** Gates activated by this pack, e.g. ["cmd","network","content"]. */
|
|
1889
|
+
gates: string[];
|
|
1890
|
+
/** Enforced controls within this pack. */
|
|
1891
|
+
enforces: GovernanceControl[];
|
|
1892
|
+
/** Advisory (non-enforced) controls within this pack. */
|
|
1893
|
+
advisory: GovernanceAdvisory[];
|
|
1894
|
+
/**
|
|
1895
|
+
* Canonical policy reference string, e.g. "owasp-llm-top10@v1".
|
|
1896
|
+
* Mapped from wire field `policy_ref`.
|
|
1897
|
+
*/
|
|
1898
|
+
policyRef: string;
|
|
1899
|
+
/** Whether this pack was seeded (built-in) vs. user-created. */
|
|
1900
|
+
seeded: boolean;
|
|
1901
|
+
}
|
|
1902
|
+
/** Parse a raw wire-format pack row into a GovernancePack. */
|
|
1903
|
+
declare function parseGovernancePack(data: Record<string, unknown>): GovernancePack;
|
|
1904
|
+
|
|
1905
|
+
/** Shared per-call options for Governance methods. */
|
|
1906
|
+
interface GovernanceRequestOpts {
|
|
1907
|
+
/** API key override. */
|
|
1908
|
+
apiKey?: string;
|
|
1909
|
+
/** Domain override. */
|
|
1910
|
+
domain?: string;
|
|
1911
|
+
/** Full API URL override. */
|
|
1912
|
+
apiUrl?: string;
|
|
1913
|
+
/** Per-request timeout in milliseconds. */
|
|
1914
|
+
requestTimeout?: number;
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Governance pack discovery.
|
|
1918
|
+
*
|
|
1919
|
+
* Lists and retrieves governance packs exposed by the Declaw control plane.
|
|
1920
|
+
* The /governance/packs endpoint is public — no auth is required — but the
|
|
1921
|
+
* SDK's normal Authorization header is still sent when an API key is
|
|
1922
|
+
* configured (harmless and consistent with other list methods).
|
|
1923
|
+
*/
|
|
1924
|
+
declare class Governance {
|
|
1925
|
+
/**
|
|
1926
|
+
* List all available governance packs.
|
|
1927
|
+
*
|
|
1928
|
+
* Sends GET /governance/packs and returns the `packs` array.
|
|
1929
|
+
*/
|
|
1930
|
+
static listPacks(opts?: GovernanceRequestOpts): Promise<GovernancePack[]>;
|
|
1931
|
+
/**
|
|
1932
|
+
* Fetch a single governance pack by name.
|
|
1933
|
+
*
|
|
1934
|
+
* Sends GET /governance/packs/:name and returns the pack object.
|
|
1935
|
+
* Throws InvalidArgumentError if the name contains unsafe characters.
|
|
1936
|
+
*/
|
|
1937
|
+
static getPack(name: string, opts?: GovernanceRequestOpts): Promise<GovernancePack>;
|
|
1623
1938
|
}
|
|
1624
1939
|
|
|
1625
|
-
export { ALL_TRAFFIC, ApiClient, type AuditConfig, type AuditEntry, AuthenticationError, BuildError, type BuildInfo, type CodeSecurityConfig, CommandExitError, CommandHandle, type CommandResult, type CommandWaitOpts, Commands, ConnectionConfig, type ConnectionConfigOptions, type CopyItem, DEFAULT_MASK_PATTERNS, type EntryInfo, type EnvSecurityConfig, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type GetBuildStatusOpts, GitAuthError, GitUpstreamError, InjectionAction, type InjectionDefenseConfig, InjectionSensitivity, InvalidArgumentError, type InvisibleTextConfig, type NetworkPolicy, NotEnoughSpaceError, NotFoundError, type PIIConfig, PIIType, type ProcessInfo, Pty, type PtyConnectOpts, type PtyCreateOpts, PtyHandle, type PtyOutput, type PtyResult, type PtySize, RedactionAction, type RequestOpts, type RunOpts, type RunStreamOpts, Sandbox, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxMetrics, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxQuery, SandboxState, type SecureEnvVar, type SecurityPolicy, type Snapshot, type SnapshotInfo, SnapshotPaginator, type SnapshotSource, type Stderr, Stdio, StdioProcess, type StdioResult, type StdioStartOpts, type Stdout, Template, TemplateBase, type TemplateBuildOpts, type TemplateBuildStatus, TemplateError, TimeoutError, type ToxicityConfig, TransformDirection, type TransformationRule, type VolumeAttachment, type VolumeCreateOpts, type VolumeInfo, type VolumeRequestOpts, Volumes, WatchHandle, type WriteEntry, type WriteInfo, applyTransformation, codeSecurityConfigToJSON, createAuditConfig, createCodeSecurityConfig, createEnvSecurityConfig, createInjectionDefenseConfig, createInvisibleTextConfig, createNetworkPolicy, createPIIConfig, createSecurityPolicy, createToxicityConfig, createTransformationRule, domainMatches, getSharedClient, invisibleTextConfigToJSON, isSensitive, networkPolicyToOpts, parseAuditConfig, parseAuditEntry, parseBuildInfo, parseCodeSecurityConfig, parseCommandResult, parseEntryInfo, parseEnvSecurityConfig, parseFilesystemEvent, parseInjectionDefenseConfig, parseInvisibleTextConfig, parseNetworkPolicy, parsePIIConfig, parseProcessInfo, parseSandboxInfo, parseSandboxLifecycle, parseSandboxMetrics, parseSecurityPolicy, parseSnapshot, parseSnapshotInfo, parseTemplateBuildStatus, parseToxicityConfig, parseVolumeInfo, parseWriteInfo, requiresTlsInterception, resetSharedClients, securityPolicyToJSON, toxicityConfigToJSON, validateNetworkEntry, volumeAttachmentToJSON };
|
|
1940
|
+
export { ALL_TRAFFIC, ApiClient, type AuditConfig, type AuditEntry, AuthenticationError, BuildError, type BuildInfo, type CodeSecurityConfig, CommandExitError, CommandHandle, type CommandResult, type CommandWaitOpts, Commands, ConflictError, ConnectionConfig, type ConnectionConfigOptions, type ContentGateConfig, type CopyItem, DEFAULT_MASK_PATTERNS, type EntryInfo, type EnvSecurityConfig, type FileEntry, type FileInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type GetBuildStatusOpts, GitAuthError, GitUpstreamError, Governance, type GovernanceAdvisory, type GovernanceControl, type GovernancePack, type GovernanceRequestOpts, InjectionAction, type InjectionDefenseConfig, InjectionSensitivity, InvalidArgumentError, type InvisibleTextConfig, type LockLease, type LockStatus, type NetworkPolicy, NotEnoughSpaceError, NotFoundError, type PIIConfig, PIIType, type ProcessInfo, Pty, type PtyConnectOpts, type PtyCreateOpts, PtyHandle, type PtyOutput, type PtyResult, type PtySize, RedactionAction, type RequestOpts, type RunOpts, type RunStreamOpts, Sandbox, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxMetrics, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxQuery, SandboxState, type SecureEnvVar, type SecurityPolicy, type Snapshot, type SnapshotInfo, SnapshotPaginator, type SnapshotSource, type Stderr, Stdio, StdioProcess, type StdioResult, type StdioStartOpts, type Stdout, Template, TemplateBase, type TemplateBuildOpts, type TemplateBuildStatus, TemplateError, TimeoutError, type ToxicityConfig, TransformDirection, type TransformationRule, type VolumeAttachMode, type VolumeAttachment, type VolumeCreateOpts, VolumeFiles, type VolumeInfo, VolumeLocks, type VolumeRemoveOpts, type VolumeRequestOpts, type VolumeWriteOpts, Volumes, WatchHandle, type WriteEntry, type WriteInfo, applyTransformation, codeSecurityConfigToJSON, contentGateConfigToJSON, createAuditConfig, createCodeSecurityConfig, createContentGateConfig, createEnvSecurityConfig, createInjectionDefenseConfig, createInvisibleTextConfig, createNetworkPolicy, createPIIConfig, createSecurityPolicy, createToxicityConfig, createTransformationRule, domainMatches, getSharedClient, invisibleTextConfigToJSON, isSensitive, networkPolicyToOpts, parseAuditConfig, parseAuditEntry, parseBuildInfo, parseCodeSecurityConfig, parseCommandResult, parseContentGateConfig, parseEntryInfo, parseEnvSecurityConfig, parseFileEntry, parseFileInfo, parseFilesystemEvent, parseGovernancePack, parseInjectionDefenseConfig, parseInvisibleTextConfig, parseLockLease, parseLockStatus, parseNetworkPolicy, parsePIIConfig, parseProcessInfo, parseSandboxInfo, parseSandboxLifecycle, parseSandboxMetrics, parseSecurityPolicy, parseSnapshot, parseSnapshotInfo, parseTemplateBuildStatus, parseToxicityConfig, parseVolumeInfo, parseWriteInfo, requiresTlsInterception, resetSharedClients, securityPolicyToJSON, toxicityConfigToJSON, validateNetworkEntry, volumeAttachmentToJSON };
|