@tangle-network/agent-interface 5.2.0 → 5.3.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.
Files changed (38) hide show
  1. package/dist/agent-candidate-code-schema.d.ts +63 -14
  2. package/dist/agent-candidate-code-schema.js +2 -1
  3. package/dist/agent-candidate-execution-plan-schema.d.ts +262 -20
  4. package/dist/agent-candidate-execution-plan-schema.js +30 -7
  5. package/dist/agent-candidate-profile-schema.d.ts +63 -8
  6. package/dist/agent-candidate-profile-schema.js +2 -0
  7. package/dist/agent-candidate-promotion-schema.d.ts +952 -100
  8. package/dist/agent-candidate-receipt-schema.d.ts +104 -8
  9. package/dist/agent-candidate-schema-common.d.ts +30 -3
  10. package/dist/agent-candidate-schema-common.js +14 -8
  11. package/dist/agent-candidate-schema.d.ts +72 -10
  12. package/dist/agent-candidate.d.ts +12 -4
  13. package/dist/agent-execution-preparation-receipt.d.ts +2 -0
  14. package/dist/agent-execution-preparation.js +4 -2
  15. package/dist/agent-profile-materialization.d.ts +1 -1
  16. package/dist/agent-profile-materialization.js +3 -0
  17. package/dist/agent-profile.d.ts +6 -0
  18. package/dist/agent-profile.js +9 -2
  19. package/dist/environment-interactive-control.d.ts +10 -0
  20. package/dist/environment-interactive-start.d.ts +33 -6
  21. package/dist/environment-profile-capabilities.d.ts +18 -0
  22. package/dist/environment-profile-capabilities.js +2 -0
  23. package/dist/environment-provider.d.ts +1 -0
  24. package/dist/environment-provider.js +1 -0
  25. package/dist/environment-runtime.d.ts +176 -18
  26. package/dist/environment-runtime.js +14 -1
  27. package/dist/harness-capabilities.js +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +1 -0
  30. package/dist/portable-context-transfer.d.ts +33 -6
  31. package/dist/profile-diff.d.ts +4 -3
  32. package/dist/profile-diff.js +11 -0
  33. package/dist/profile-schema.d.ts +50 -21
  34. package/dist/profile-schema.js +6 -13
  35. package/dist/proxy-secrets.d.ts +329 -0
  36. package/dist/proxy-secrets.js +183 -0
  37. package/fixtures/proxy-secret-wire-v1.json +1119 -0
  38. package/package.json +2 -1
@@ -100,6 +100,33 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
100
100
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
101
101
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
102
102
  }, z.core.$strict>>>;
103
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
104
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
105
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
106
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
107
+ envName: z.ZodString;
108
+ secretRef: z.ZodObject<{
109
+ kind: z.ZodLiteral<"secret-ref">;
110
+ key: z.ZodString;
111
+ }, z.core.$strict>;
112
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
113
+ type: z.ZodLiteral<"bearer">;
114
+ }, z.core.$strict>, z.ZodObject<{
115
+ type: z.ZodLiteral<"basic">;
116
+ username: z.ZodString;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ type: z.ZodLiteral<"header">;
119
+ name: z.ZodString;
120
+ }, z.core.$strict>, z.ZodObject<{
121
+ type: z.ZodLiteral<"query">;
122
+ name: z.ZodString;
123
+ }, z.core.$strict>], "type">;
124
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
125
+ jwt: "jwt";
126
+ opaque: "opaque";
127
+ }>>;
128
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
129
+ }, z.core.$strict>>>;
103
130
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
104
131
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
105
132
  mcp: z.ZodOptional<z.ZodType<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown>>>;
@@ -208,12 +235,12 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
208
235
  blocking?: boolean | undefined;
209
236
  matcher?: string | undefined;
210
237
  env?: Record<string, {
211
- kind: "public";
212
- value: string;
213
- } | {
214
238
  kind: "secret-ref";
215
239
  key: string;
216
240
  format?: "bearer" | "raw" | undefined;
241
+ } | {
242
+ kind: "public";
243
+ value: string;
217
244
  }> | undefined;
218
245
  }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
219
246
  command: string;
@@ -221,12 +248,12 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
221
248
  blocking?: boolean | undefined;
222
249
  matcher?: string | undefined;
223
250
  env?: Record<string, {
224
- kind: "public";
225
- value: string;
226
- } | {
227
251
  kind: "secret-ref";
228
252
  key: string;
229
253
  format?: "bearer" | "raw" | undefined;
254
+ } | {
255
+ kind: "public";
256
+ value: string;
230
257
  }> | undefined;
231
258
  }[]>, unknown>>>;
232
259
  modes: z.ZodOptional<z.ZodType<Record<string, {
@@ -1,6 +1,24 @@
1
1
  import { z } from "zod";
2
2
  export declare const AgentProfileCapabilitiesSchema: z.ZodObject<{
3
3
  namedProfiles: z.ZodBoolean;
4
+ proxySecrets: z.ZodOptional<z.ZodObject<{
5
+ protocolVersion: z.ZodLiteral<1>;
6
+ supportedDrivers: z.ZodArray<z.ZodString>;
7
+ presentations: z.ZodArray<z.ZodEnum<{
8
+ basic: "basic";
9
+ bearer: "bearer";
10
+ header: "header";
11
+ query: "query";
12
+ }>>;
13
+ placeholderFormats: z.ZodArray<z.ZodEnum<{
14
+ jwt: "jwt";
15
+ opaque: "opaque";
16
+ }>>;
17
+ enforcement: z.ZodLiteral<"exact">;
18
+ transports: z.ZodTuple<[z.ZodLiteral<"https:443">], null>;
19
+ lifecycle: z.ZodLiteral<true>;
20
+ placementReceiptRequired: z.ZodLiteral<true>;
21
+ }, z.core.$strict>>;
4
22
  systemPrompt: z.ZodObject<{
5
23
  replace: z.ZodBoolean;
6
24
  append: z.ZodBoolean;
@@ -1,7 +1,9 @@
1
1
  import { z } from "zod";
2
+ import { ProxySecretCapabilitiesSchema } from "./proxy-secrets.js";
2
3
  import { boundedIdentifierSchema, CONTRACT_MAX_ARRAY_LENGTH, } from "./contract-limits.js";
3
4
  export const AgentProfileCapabilitiesSchema = z.strictObject({
4
5
  namedProfiles: z.boolean(),
6
+ proxySecrets: ProxySecretCapabilitiesSchema.optional(),
5
7
  /*
6
8
  * Replacement and addition are independent provider capabilities. Require
7
9
  * both declarations so an omitted bit cannot be mistaken for support.
@@ -9,3 +9,4 @@ export * from "./environment-runtime.js";
9
9
  export * from "./environment-command-turn.js";
10
10
  export * from "./workspace-cwd.js";
11
11
  export * from "./workspace-snapshot.js";
12
+ export * from "./proxy-secrets.js";
@@ -9,3 +9,4 @@ export * from "./environment-runtime.js";
9
9
  export * from "./environment-command-turn.js";
10
10
  export * from "./workspace-cwd.js";
11
11
  export * from "./workspace-snapshot.js";
12
+ export * from "./proxy-secrets.js";
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { type ProxySecretBinding, type ProxySecretCapabilities, type ProxySecretReceipt } from "./proxy-secrets.js";
2
3
  import type { AgentRuntimeAttachments } from "./runtime-attachments.js";
3
4
  export { AgentRuntimeAttachmentsSchema, type AgentRuntimeAttachments } from "./runtime-attachments.js";
4
5
  import type { AgentCandidateArtifactPort, Sha256Digest } from "./agent-candidate.js";
@@ -123,6 +124,33 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
123
124
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
124
125
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
125
126
  }, z.core.$strict>>>;
127
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
128
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
129
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
130
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
131
+ envName: z.ZodString;
132
+ secretRef: z.ZodObject<{
133
+ kind: z.ZodLiteral<"secret-ref">;
134
+ key: z.ZodString;
135
+ }, z.core.$strict>;
136
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
137
+ type: z.ZodLiteral<"bearer">;
138
+ }, z.core.$strict>, z.ZodObject<{
139
+ type: z.ZodLiteral<"basic">;
140
+ username: z.ZodString;
141
+ }, z.core.$strict>, z.ZodObject<{
142
+ type: z.ZodLiteral<"header">;
143
+ name: z.ZodString;
144
+ }, z.core.$strict>, z.ZodObject<{
145
+ type: z.ZodLiteral<"query">;
146
+ name: z.ZodString;
147
+ }, z.core.$strict>], "type">;
148
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
149
+ jwt: "jwt";
150
+ opaque: "opaque";
151
+ }>>;
152
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
153
+ }, z.core.$strict>>>;
126
154
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
127
155
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
128
156
  mcp: z.ZodOptional<z.ZodType<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown>>>;
@@ -231,12 +259,12 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
231
259
  blocking?: boolean | undefined;
232
260
  matcher?: string | undefined;
233
261
  env?: Record<string, {
234
- kind: "public";
235
- value: string;
236
- } | {
237
262
  kind: "secret-ref";
238
263
  key: string;
239
264
  format?: "bearer" | "raw" | undefined;
265
+ } | {
266
+ kind: "public";
267
+ value: string;
240
268
  }> | undefined;
241
269
  }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
242
270
  command: string;
@@ -244,12 +272,12 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
244
272
  blocking?: boolean | undefined;
245
273
  matcher?: string | undefined;
246
274
  env?: Record<string, {
247
- kind: "public";
248
- value: string;
249
- } | {
250
275
  kind: "secret-ref";
251
276
  key: string;
252
277
  format?: "bearer" | "raw" | undefined;
278
+ } | {
279
+ kind: "public";
280
+ value: string;
253
281
  }> | undefined;
254
282
  }[]>, unknown>>>;
255
283
  modes: z.ZodOptional<z.ZodType<Record<string, {
@@ -494,6 +522,33 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
494
522
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
495
523
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
496
524
  }, z.core.$strict>>>;
525
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
526
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
527
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
528
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
529
+ envName: z.ZodString;
530
+ secretRef: z.ZodObject<{
531
+ kind: z.ZodLiteral<"secret-ref">;
532
+ key: z.ZodString;
533
+ }, z.core.$strict>;
534
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
535
+ type: z.ZodLiteral<"bearer">;
536
+ }, z.core.$strict>, z.ZodObject<{
537
+ type: z.ZodLiteral<"basic">;
538
+ username: z.ZodString;
539
+ }, z.core.$strict>, z.ZodObject<{
540
+ type: z.ZodLiteral<"header">;
541
+ name: z.ZodString;
542
+ }, z.core.$strict>, z.ZodObject<{
543
+ type: z.ZodLiteral<"query">;
544
+ name: z.ZodString;
545
+ }, z.core.$strict>], "type">;
546
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
547
+ jwt: "jwt";
548
+ opaque: "opaque";
549
+ }>>;
550
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
551
+ }, z.core.$strict>>>;
497
552
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
498
553
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
499
554
  mcp: z.ZodOptional<z.ZodType<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown>>>;
@@ -602,12 +657,12 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
602
657
  blocking?: boolean | undefined;
603
658
  matcher?: string | undefined;
604
659
  env?: Record<string, {
605
- kind: "public";
606
- value: string;
607
- } | {
608
660
  kind: "secret-ref";
609
661
  key: string;
610
662
  format?: "bearer" | "raw" | undefined;
663
+ } | {
664
+ kind: "public";
665
+ value: string;
611
666
  }> | undefined;
612
667
  }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
613
668
  command: string;
@@ -615,12 +670,12 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
615
670
  blocking?: boolean | undefined;
616
671
  matcher?: string | undefined;
617
672
  env?: Record<string, {
618
- kind: "public";
619
- value: string;
620
- } | {
621
673
  kind: "secret-ref";
622
674
  key: string;
623
675
  format?: "bearer" | "raw" | undefined;
676
+ } | {
677
+ kind: "public";
678
+ value: string;
624
679
  }> | undefined;
625
680
  }[]>, unknown>>>;
626
681
  modes: z.ZodOptional<z.ZodType<Record<string, {
@@ -1264,6 +1319,8 @@ export interface AgentEnvironment {
1264
1319
  readonly creation?: AgentEnvironmentCreation;
1265
1320
  /** Authoritative receipt returned only by a qualified context-transfer attachment. */
1266
1321
  readonly contextTransferReceipt?: ContextTransferReceipt;
1322
+ /** Trusted metadata only; dispatch requires an installed receipt, never proxy-installed. */
1323
+ readonly proxySecretReceipt?: ProxySecretReceipt;
1267
1324
  /**
1268
1325
  * Detached metadata returned by the provider.
1269
1326
  * It can contain caller-authored annotations and is not authorization evidence.
@@ -1443,6 +1500,7 @@ export interface AgentEnvironmentCapabilities {
1443
1500
  workspaceCheckpoint?: boolean;
1444
1501
  /** True only when this qualified receiver verifies and restores WorkspaceRequest.snapshot. */
1445
1502
  workspaceSnapshot?: boolean;
1503
+ proxySecrets?: ProxySecretCapabilities;
1446
1504
  };
1447
1505
  /** Per-surface flags for the normalized environment observation. */
1448
1506
  observation?: {
@@ -1481,6 +1539,24 @@ export interface AgentEnvironmentCapabilities {
1481
1539
  export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
1482
1540
  profile: z.ZodObject<{
1483
1541
  namedProfiles: z.ZodBoolean;
1542
+ proxySecrets: z.ZodOptional<z.ZodObject<{
1543
+ protocolVersion: z.ZodLiteral<1>;
1544
+ supportedDrivers: z.ZodArray<z.ZodString>;
1545
+ presentations: z.ZodArray<z.ZodEnum<{
1546
+ basic: "basic";
1547
+ bearer: "bearer";
1548
+ header: "header";
1549
+ query: "query";
1550
+ }>>;
1551
+ placeholderFormats: z.ZodArray<z.ZodEnum<{
1552
+ jwt: "jwt";
1553
+ opaque: "opaque";
1554
+ }>>;
1555
+ enforcement: z.ZodLiteral<"exact">;
1556
+ transports: z.ZodTuple<[z.ZodLiteral<"https:443">], null>;
1557
+ lifecycle: z.ZodLiteral<true>;
1558
+ placementReceiptRequired: z.ZodLiteral<true>;
1559
+ }, z.core.$strict>>;
1484
1560
  systemPrompt: z.ZodObject<{
1485
1561
  replace: z.ZodBoolean;
1486
1562
  append: z.ZodBoolean;
@@ -1592,6 +1668,24 @@ export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
1592
1668
  runtimeAttachments: z.ZodOptional<z.ZodObject<{
1593
1669
  mcp: z.ZodLiteral<true>;
1594
1670
  }, z.core.$strict>>;
1671
+ proxySecrets: z.ZodOptional<z.ZodObject<{
1672
+ protocolVersion: z.ZodLiteral<1>;
1673
+ supportedDrivers: z.ZodArray<z.ZodString>;
1674
+ presentations: z.ZodArray<z.ZodEnum<{
1675
+ basic: "basic";
1676
+ bearer: "bearer";
1677
+ header: "header";
1678
+ query: "query";
1679
+ }>>;
1680
+ placeholderFormats: z.ZodArray<z.ZodEnum<{
1681
+ jwt: "jwt";
1682
+ opaque: "opaque";
1683
+ }>>;
1684
+ enforcement: z.ZodLiteral<"exact">;
1685
+ transports: z.ZodTuple<[z.ZodLiteral<"https:443">], null>;
1686
+ lifecycle: z.ZodLiteral<true>;
1687
+ placementReceiptRequired: z.ZodLiteral<true>;
1688
+ }, z.core.$strict>>;
1595
1689
  workspaceCheckpoint: z.ZodOptional<z.ZodBoolean>;
1596
1690
  workspaceSnapshot: z.ZodOptional<z.ZodBoolean>;
1597
1691
  }, z.core.$strict>>;
@@ -1641,6 +1735,9 @@ export interface CreateAgentEnvironmentInput {
1641
1735
  resources?: ResourceRequest;
1642
1736
  env?: Record<string, string>;
1643
1737
  secrets?: string[] | Record<string, string>;
1738
+ /** Same declaration as AgentProfile. Empty selections remain explicit wire values.
1739
+ * Trusted issuer authorization is required before resolving any reference. */
1740
+ proxySecrets?: readonly ProxySecretBinding[];
1644
1741
  /**
1645
1742
  * Outbound network policy for this environment.
1646
1743
  *
@@ -1715,6 +1812,11 @@ export declare function createAgentEnvironmentWithIdempotency<T extends object>(
1715
1812
  /** Reconstruct an existing environment; never allocates a replacement. */
1716
1813
  export interface AgentEnvironmentGetOptions {
1717
1814
  signal?: AbortSignal;
1815
+ /** Explicit custody attachment through the existing egress lifecycle. Omission reads current
1816
+ * custody; [] revokes custom bindings. A get never allocates a replacement environment. */
1817
+ proxySecrets?: readonly ProxySecretBinding[];
1818
+ expectedProxySecretGeneration?: number;
1819
+ requireInPlace?: boolean;
1718
1820
  /**
1719
1821
  * Authorize the first turn of an accepted portable transfer. The provider looks up the exact
1720
1822
  * durable operation and returns its dispatch-capable environment with contextTransferReceipt.
@@ -1724,7 +1826,36 @@ export interface AgentEnvironmentGetOptions {
1724
1826
  contextTransfer?: ContextTransferRequest;
1725
1827
  }
1726
1828
  export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
1829
+ expectedProxySecretGeneration: z.ZodOptional<z.ZodNumber>;
1830
+ requireInPlace: z.ZodOptional<z.ZodBoolean>;
1727
1831
  signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
1832
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1833
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1834
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1835
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1836
+ envName: z.ZodString;
1837
+ secretRef: z.ZodObject<{
1838
+ kind: z.ZodLiteral<"secret-ref">;
1839
+ key: z.ZodString;
1840
+ }, z.core.$strict>;
1841
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
1842
+ type: z.ZodLiteral<"bearer">;
1843
+ }, z.core.$strict>, z.ZodObject<{
1844
+ type: z.ZodLiteral<"basic">;
1845
+ username: z.ZodString;
1846
+ }, z.core.$strict>, z.ZodObject<{
1847
+ type: z.ZodLiteral<"header">;
1848
+ name: z.ZodString;
1849
+ }, z.core.$strict>, z.ZodObject<{
1850
+ type: z.ZodLiteral<"query">;
1851
+ name: z.ZodString;
1852
+ }, z.core.$strict>], "type">;
1853
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
1854
+ jwt: "jwt";
1855
+ opaque: "opaque";
1856
+ }>>;
1857
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
1858
+ }, z.core.$strict>>>;
1728
1859
  contextTransfer: z.ZodOptional<z.ZodObject<{
1729
1860
  operationId: z.ZodString;
1730
1861
  requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
@@ -1910,6 +2041,33 @@ export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
1910
2041
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
1911
2042
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
1912
2043
  }, z.core.$strict>>>;
2044
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
2045
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
2046
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2047
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2048
+ envName: z.ZodString;
2049
+ secretRef: z.ZodObject<{
2050
+ kind: z.ZodLiteral<"secret-ref">;
2051
+ key: z.ZodString;
2052
+ }, z.core.$strict>;
2053
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
2054
+ type: z.ZodLiteral<"bearer">;
2055
+ }, z.core.$strict>, z.ZodObject<{
2056
+ type: z.ZodLiteral<"basic">;
2057
+ username: z.ZodString;
2058
+ }, z.core.$strict>, z.ZodObject<{
2059
+ type: z.ZodLiteral<"header">;
2060
+ name: z.ZodString;
2061
+ }, z.core.$strict>, z.ZodObject<{
2062
+ type: z.ZodLiteral<"query">;
2063
+ name: z.ZodString;
2064
+ }, z.core.$strict>], "type">;
2065
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
2066
+ jwt: "jwt";
2067
+ opaque: "opaque";
2068
+ }>>;
2069
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
2070
+ }, z.core.$strict>>>;
1913
2071
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
1914
2072
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
1915
2073
  mcp: z.ZodOptional<z.ZodType<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown>>>;
@@ -2018,12 +2176,12 @@ export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
2018
2176
  blocking?: boolean | undefined;
2019
2177
  matcher?: string | undefined;
2020
2178
  env?: Record<string, {
2021
- kind: "public";
2022
- value: string;
2023
- } | {
2024
2179
  kind: "secret-ref";
2025
2180
  key: string;
2026
2181
  format?: "bearer" | "raw" | undefined;
2182
+ } | {
2183
+ kind: "public";
2184
+ value: string;
2027
2185
  }> | undefined;
2028
2186
  }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
2029
2187
  command: string;
@@ -2031,12 +2189,12 @@ export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
2031
2189
  blocking?: boolean | undefined;
2032
2190
  matcher?: string | undefined;
2033
2191
  env?: Record<string, {
2034
- kind: "public";
2035
- value: string;
2036
- } | {
2037
2192
  kind: "secret-ref";
2038
2193
  key: string;
2039
2194
  format?: "bearer" | "raw" | undefined;
2195
+ } | {
2196
+ kind: "public";
2197
+ value: string;
2040
2198
  }> | undefined;
2041
2199
  }[]>, unknown>>>;
2042
2200
  modes: z.ZodOptional<z.ZodType<Record<string, {
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { ProxySecretCapabilitiesSchema, ProxySecretsSchema, ProxySecretUpdateControlsSchema } from "./proxy-secrets.js";
2
3
  export { AgentRuntimeAttachmentsSchema } from "./runtime-attachments.js";
3
4
  import { canonicalCandidateDigest, canonicalCandidateJson, } from "./agent-candidate-schema-common.js";
4
5
  import { agentProfileSchema } from "./profile-schema.js";
@@ -246,6 +247,7 @@ export const AgentEnvironmentCapabilitiesSchema = z
246
247
  durableIdempotency: z.boolean().optional(),
247
248
  billingOwner: z.boolean().optional(),
248
249
  runtimeAttachments: z.strictObject({ mcp: z.literal(true) }).optional(),
250
+ proxySecrets: ProxySecretCapabilitiesSchema.optional(),
249
251
  workspaceCheckpoint: z.boolean().optional(),
250
252
  workspaceSnapshot: z.boolean().optional(),
251
253
  })
@@ -361,7 +363,8 @@ export const AgentEnvironmentCapabilitiesSchema = z
361
363
  create.billingOwner === undefined &&
362
364
  create.runtimeAttachments === undefined &&
363
365
  create.workspaceCheckpoint === undefined &&
364
- create.workspaceSnapshot === undefined) {
366
+ create.workspaceSnapshot === undefined &&
367
+ create.proxySecrets === undefined) {
365
368
  refinement.addIssue({
366
369
  code: "custom",
367
370
  path: ["create"],
@@ -525,5 +528,15 @@ export async function createAgentEnvironmentWithIdempotency(records, input, crea
525
528
  }
526
529
  export const AgentEnvironmentGetOptionsSchema = z.strictObject({
527
530
  signal: z.custom().optional(),
531
+ proxySecrets: ProxySecretsSchema.optional(),
532
+ ...ProxySecretUpdateControlsSchema.shape,
528
533
  contextTransfer: ContextTransferRequestSchema.optional(),
534
+ }).superRefine((options, ctx) => {
535
+ if (options.proxySecrets !== undefined && options.contextTransfer !== undefined) {
536
+ ctx.addIssue({ code: "custom", path: ["proxySecrets"], message: "context-transfer attachment cannot also change proxy custody" });
537
+ }
538
+ if (options.proxySecrets === undefined &&
539
+ (options.expectedProxySecretGeneration !== undefined || options.requireInPlace !== undefined)) {
540
+ ctx.addIssue({ code: "custom", path: ["proxySecrets"], message: "proxy update controls require an explicit proxySecrets selection" });
541
+ }
529
542
  });
@@ -72,7 +72,7 @@ export function resolveModelProvider(modelId) {
72
72
  export function harnessProviders(harness) {
73
73
  return harnessProviderLock[harness] ?? null;
74
74
  }
75
- const SANDBOX_HARNESS_MATRIX_EVIDENCE = "https://github.com/tangle-network/agent-dev-container/issues/9382";
75
+ const SANDBOX_HARNESS_MATRIX_EVIDENCE = "https://github.com/tangle-network/agent-container/issues/9382";
76
76
  /**
77
77
  * Pairs a router-backed harness cannot run, measured on production with the Router credential: one
78
78
  * prompt per pair, profile reasoning effort `medium` (2026-10-05). The same run passed pi with
package/dist/index.d.ts CHANGED
@@ -45,3 +45,4 @@ export { CONTRACT_MAX_ARRAY_LENGTH, CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_
45
45
  export { AgentEnvironmentEgressPolicySchema } from "./environment-requests.js";
46
46
  export * from "./native-session-event.js";
47
47
  export * from "./learning-state.js";
48
+ export * from "./proxy-secrets.js";
package/dist/index.js CHANGED
@@ -47,3 +47,4 @@ CONTRACT_MAX_ARRAY_LENGTH, CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, C
47
47
  export { AgentEnvironmentEgressPolicySchema } from "./environment-requests.js";
48
48
  export * from "./native-session-event.js";
49
49
  export * from "./learning-state.js";
50
+ export * from "./proxy-secrets.js";
@@ -210,6 +210,33 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
210
210
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
211
211
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
212
212
  }, z.core.$strict>>>;
213
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
214
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
215
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
216
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
217
+ envName: z.ZodString;
218
+ secretRef: z.ZodObject<{
219
+ kind: z.ZodLiteral<"secret-ref">;
220
+ key: z.ZodString;
221
+ }, z.core.$strict>;
222
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
223
+ type: z.ZodLiteral<"bearer">;
224
+ }, z.core.$strict>, z.ZodObject<{
225
+ type: z.ZodLiteral<"basic">;
226
+ username: z.ZodString;
227
+ }, z.core.$strict>, z.ZodObject<{
228
+ type: z.ZodLiteral<"header">;
229
+ name: z.ZodString;
230
+ }, z.core.$strict>, z.ZodObject<{
231
+ type: z.ZodLiteral<"query">;
232
+ name: z.ZodString;
233
+ }, z.core.$strict>], "type">;
234
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
235
+ jwt: "jwt";
236
+ opaque: "opaque";
237
+ }>>;
238
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
239
+ }, z.core.$strict>>>;
213
240
  permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
214
241
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
215
242
  mcp: z.ZodOptional<z.ZodType<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown>>>;
@@ -318,12 +345,12 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
318
345
  blocking?: boolean | undefined;
319
346
  matcher?: string | undefined;
320
347
  env?: Record<string, {
321
- kind: "public";
322
- value: string;
323
- } | {
324
348
  kind: "secret-ref";
325
349
  key: string;
326
350
  format?: "bearer" | "raw" | undefined;
351
+ } | {
352
+ kind: "public";
353
+ value: string;
327
354
  }> | undefined;
328
355
  }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
329
356
  command: string;
@@ -331,12 +358,12 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
331
358
  blocking?: boolean | undefined;
332
359
  matcher?: string | undefined;
333
360
  env?: Record<string, {
334
- kind: "public";
335
- value: string;
336
- } | {
337
361
  kind: "secret-ref";
338
362
  key: string;
339
363
  format?: "bearer" | "raw" | undefined;
364
+ } | {
365
+ kind: "public";
366
+ value: string;
340
367
  }> | undefined;
341
368
  }[]>, unknown>>>;
342
369
  modes: z.ZodOptional<z.ZodType<Record<string, {
@@ -1,5 +1,5 @@
1
1
  import type { AgentProfile } from "./agent-profile.js";
2
- declare const agentProfileDiffPropertyAxes: readonly ["prompt", "model", "harness", "seats", "permissions", "tools", "mcp", "connections", "subagents", "resources", "hooks", "modes", "confidential", "metadata", "extensions"];
2
+ declare const agentProfileDiffPropertyAxes: readonly ["prompt", "model", "harness", "seats", "proxySecrets", "permissions", "tools", "mcp", "connections", "subagents", "resources", "hooks", "modes", "confidential", "metadata", "extensions"];
3
3
  export type AgentProfileDiffAxis = "identity" | (typeof agentProfileDiffPropertyAxes)[number];
4
4
  export type AgentProfileRemoveList = true | readonly string[];
5
5
  export interface AgentProfilePromptRemoval {
@@ -24,6 +24,7 @@ export interface AgentProfileDiffRemoval {
24
24
  model?: AgentProfileRemoveList;
25
25
  harness?: true;
26
26
  seats?: true;
27
+ proxySecrets?: true;
27
28
  permissions?: AgentProfileRemoveList;
28
29
  tools?: AgentProfileRemoveList;
29
30
  mcp?: AgentProfileRemoveList;
@@ -39,8 +40,8 @@ export interface AgentProfileDiffRemoval {
39
40
  /**
40
41
  * A portable profile improvement artifact.
41
42
  *
42
- * `set` is an AgentProfile overlay: profile arrays are appended with the same
43
- * semantics as {@link mergeAgentProfiles}. `remove` deletes whole axes or named
43
+ * `set` follows {@link mergeAgentProfiles}: additive arrays append, while
44
+ * proxySecrets replaces the complete selection. `remove` deletes whole axes or named
44
45
  * entries after the overlay is applied. This keeps the optimized unit the full
45
46
  * AgentProfile instead of a benchmark-specific file mount.
46
47
  */
@@ -5,6 +5,7 @@ const agentProfileDiffPropertyAxes = [
5
5
  "model",
6
6
  "harness",
7
7
  "seats",
8
+ "proxySecrets",
8
9
  "permissions",
9
10
  "tools",
10
11
  "mcp",
@@ -119,6 +120,14 @@ function replaceChangedProfileResources(baseline, candidate, remove, set) {
119
120
  }
120
121
  return;
121
122
  }
123
+ // Resource removals prune empty sibling arrays. Restore only the candidate's
124
+ // explicit empties, without copying unchanged nonempty or external resources.
125
+ for (const axis of agentProfileResourceDiffPropertyAxes) {
126
+ const value = candidate?.[axis];
127
+ if (Array.isArray(value) && value.length === 0) {
128
+ Object.assign(resourceSet, { [axis]: [] });
129
+ }
130
+ }
122
131
  remove.resources = resourceRemove;
123
132
  const canonicalCandidate = canonicalProfileValue(candidate);
124
133
  if (Object.keys(resourceSet).length > 0 ||
@@ -263,6 +272,8 @@ function applyRemoval(profile, remove) {
263
272
  delete next.harness;
264
273
  if (remove.seats !== undefined)
265
274
  delete next.seats;
275
+ if (remove.proxySecrets !== undefined)
276
+ delete next.proxySecrets;
266
277
  if (remove.permissions !== undefined) {
267
278
  setOrDelete(next, "permissions", removeKeys(next.permissions, remove.permissions));
268
279
  }