@tangle-network/agent-interface 5.2.1 → 5.3.1

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 (37) 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/environment-interactive-control.d.ts +10 -0
  19. package/dist/environment-interactive-start.d.ts +33 -6
  20. package/dist/environment-profile-capabilities.d.ts +18 -0
  21. package/dist/environment-profile-capabilities.js +2 -0
  22. package/dist/environment-provider.d.ts +1 -0
  23. package/dist/environment-provider.js +1 -0
  24. package/dist/environment-runtime.d.ts +176 -18
  25. package/dist/environment-runtime.js +14 -1
  26. package/dist/harness-capabilities.js +1 -1
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/portable-context-transfer.d.ts +33 -6
  30. package/dist/profile-diff.d.ts +4 -3
  31. package/dist/profile-diff.js +3 -0
  32. package/dist/profile-schema.d.ts +50 -21
  33. package/dist/profile-schema.js +6 -13
  34. package/dist/proxy-secrets.d.ts +329 -0
  35. package/dist/proxy-secrets.js +183 -0
  36. package/fixtures/proxy-secret-wire-v1.json +1173 -0
  37. package/package.json +2 -1
@@ -98,10 +98,17 @@ export declare const agentCandidateWorkingDirectorySchema: z.ZodObject<{
98
98
  export declare const agentCandidateContainerLaunchSchema: z.ZodObject<{
99
99
  kind: z.ZodLiteral<"container-command">;
100
100
  executable: z.ZodString;
101
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
101
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
102
102
  kind: z.ZodLiteral<"public">;
103
103
  value: z.ZodString;
104
- }, z.core.$strict>>>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ kind: z.ZodLiteral<"secret-ref">;
106
+ key: z.ZodString;
107
+ format: z.ZodOptional<z.ZodEnum<{
108
+ bearer: "bearer";
109
+ raw: "raw";
110
+ }>>;
111
+ }, z.core.$strict>], "kind">>>;
105
112
  }, z.core.$strict>;
106
113
  export declare const agentCandidateEntrypointLaunchSchema: z.ZodObject<{
107
114
  kind: z.ZodLiteral<"candidate-entrypoint">;
@@ -115,18 +122,32 @@ export declare const agentCandidateEntrypointLaunchSchema: z.ZodObject<{
115
122
  tsx: "tsx";
116
123
  uv: "uv";
117
124
  }>>;
118
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
125
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
119
126
  kind: z.ZodLiteral<"public">;
120
127
  value: z.ZodString;
121
- }, z.core.$strict>>>;
128
+ }, z.core.$strict>, z.ZodObject<{
129
+ kind: z.ZodLiteral<"secret-ref">;
130
+ key: z.ZodString;
131
+ format: z.ZodOptional<z.ZodEnum<{
132
+ bearer: "bearer";
133
+ raw: "raw";
134
+ }>>;
135
+ }, z.core.$strict>], "kind">>>;
122
136
  }, z.core.$strict>;
123
137
  export declare const agentCandidateLaunchSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
124
138
  kind: z.ZodLiteral<"container-command">;
125
139
  executable: z.ZodString;
126
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
140
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
127
141
  kind: z.ZodLiteral<"public">;
128
142
  value: z.ZodString;
129
- }, z.core.$strict>>>;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ kind: z.ZodLiteral<"secret-ref">;
145
+ key: z.ZodString;
146
+ format: z.ZodOptional<z.ZodEnum<{
147
+ bearer: "bearer";
148
+ raw: "raw";
149
+ }>>;
150
+ }, z.core.$strict>], "kind">>>;
130
151
  }, z.core.$strict>, z.ZodObject<{
131
152
  kind: z.ZodLiteral<"candidate-entrypoint">;
132
153
  entrypoint: z.ZodString;
@@ -139,10 +160,17 @@ export declare const agentCandidateLaunchSchema: z.ZodDiscriminatedUnion<[z.ZodO
139
160
  tsx: "tsx";
140
161
  uv: "uv";
141
162
  }>>;
142
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
163
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
143
164
  kind: z.ZodLiteral<"public">;
144
165
  value: z.ZodString;
145
- }, z.core.$strict>>>;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ kind: z.ZodLiteral<"secret-ref">;
168
+ key: z.ZodString;
169
+ format: z.ZodOptional<z.ZodEnum<{
170
+ bearer: "bearer";
171
+ raw: "raw";
172
+ }>>;
173
+ }, z.core.$strict>], "kind">>>;
146
174
  }, z.core.$strict>], "kind">;
147
175
  export declare const agentCandidateInstructionDeliverySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
148
176
  kind: z.ZodLiteral<"argv-append">;
@@ -176,10 +204,17 @@ export declare const agentCandidateExecutionSchema: z.ZodObject<{
176
204
  launch: z.ZodDiscriminatedUnion<[z.ZodObject<{
177
205
  kind: z.ZodLiteral<"container-command">;
178
206
  executable: z.ZodString;
179
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
207
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
180
208
  kind: z.ZodLiteral<"public">;
181
209
  value: z.ZodString;
182
- }, z.core.$strict>>>;
210
+ }, z.core.$strict>, z.ZodObject<{
211
+ kind: z.ZodLiteral<"secret-ref">;
212
+ key: z.ZodString;
213
+ format: z.ZodOptional<z.ZodEnum<{
214
+ bearer: "bearer";
215
+ raw: "raw";
216
+ }>>;
217
+ }, z.core.$strict>], "kind">>>;
183
218
  }, z.core.$strict>, z.ZodObject<{
184
219
  kind: z.ZodLiteral<"candidate-entrypoint">;
185
220
  entrypoint: z.ZodString;
@@ -192,10 +227,17 @@ export declare const agentCandidateExecutionSchema: z.ZodObject<{
192
227
  tsx: "tsx";
193
228
  uv: "uv";
194
229
  }>>;
195
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
196
231
  kind: z.ZodLiteral<"public">;
197
232
  value: z.ZodString;
198
- }, z.core.$strict>>>;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ kind: z.ZodLiteral<"secret-ref">;
235
+ key: z.ZodString;
236
+ format: z.ZodOptional<z.ZodEnum<{
237
+ bearer: "bearer";
238
+ raw: "raw";
239
+ }>>;
240
+ }, z.core.$strict>], "kind">>>;
199
241
  }, z.core.$strict>], "kind">;
200
242
  instructionDelivery: z.ZodDiscriminatedUnion<[z.ZodObject<{
201
243
  kind: z.ZodLiteral<"argv-append">;
@@ -213,10 +255,17 @@ export declare const agentCandidateExecutionSchema: z.ZodObject<{
213
255
  }>;
214
256
  path: z.ZodString;
215
257
  }, z.core.$strict>;
216
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
258
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
217
259
  kind: z.ZodLiteral<"public">;
218
260
  value: z.ZodString;
219
- }, z.core.$strict>>>;
261
+ }, z.core.$strict>, z.ZodObject<{
262
+ kind: z.ZodLiteral<"secret-ref">;
263
+ key: z.ZodString;
264
+ format: z.ZodOptional<z.ZodEnum<{
265
+ bearer: "bearer";
266
+ raw: "raw";
267
+ }>>;
268
+ }, z.core.$strict>], "kind">>>;
220
269
  environment: z.ZodDiscriminatedUnion<[z.ZodObject<{
221
270
  kind: z.ZodLiteral<"pinned-container">;
222
271
  container: z.ZodObject<{
@@ -177,7 +177,8 @@ export const agentCandidateExecutionSchema = z
177
177
  const requiresPath = execution.launch.kind === "container-command"
178
178
  ? !execution.launch.executable.startsWith("/")
179
179
  : execution.launch.interpreter !== undefined;
180
- if (requiresPath && !execution.env?.PATH?.value.trim()) {
180
+ const executablePath = execution.env?.PATH;
181
+ if (requiresPath && (executablePath?.kind !== "public" || !executablePath.value.trim())) {
181
182
  ctx.addIssue({
182
183
  code: "custom",
183
184
  path: ["env", "PATH"],
@@ -65,6 +65,33 @@ export declare const agentCandidateRetryPolicySchema: z.ZodEnum<{
65
65
  "pre-model-infrastructure-only": "pre-model-infrastructure-only";
66
66
  }>;
67
67
  export declare const agentCandidateProfilePlanMaterialSchema: z.ZodObject<{
68
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
69
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
70
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
71
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
72
+ envName: z.ZodString;
73
+ secretRef: z.ZodObject<{
74
+ kind: z.ZodLiteral<"secret-ref">;
75
+ key: z.ZodString;
76
+ }, z.core.$strict>;
77
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
78
+ type: z.ZodLiteral<"bearer">;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ type: z.ZodLiteral<"basic">;
81
+ username: z.ZodString;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ type: z.ZodLiteral<"header">;
84
+ name: z.ZodString;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ type: z.ZodLiteral<"query">;
87
+ name: z.ZodString;
88
+ }, z.core.$strict>], "type">;
89
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
90
+ jwt: "jwt";
91
+ opaque: "opaque";
92
+ }>>;
93
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
94
+ }, z.core.$strict>>>;
68
95
  sourceProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
69
96
  harness: z.ZodEnum<{
70
97
  acp: "acp";
@@ -88,16 +115,41 @@ export declare const agentCandidateProfilePlanMaterialSchema: z.ZodObject<{
88
115
  relPath: z.ZodString;
89
116
  mode: z.ZodNumber;
90
117
  contentSha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
118
+ secretSlots: z.ZodOptional<z.ZodArray<z.ZodObject<{
119
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
120
+ ref: z.ZodObject<{
121
+ kind: z.ZodLiteral<"secret-ref">;
122
+ key: z.ZodString;
123
+ format: z.ZodOptional<z.ZodEnum<{
124
+ bearer: "bearer";
125
+ raw: "raw";
126
+ }>>;
127
+ }, z.core.$strict>;
128
+ }, z.core.$strict>>>;
91
129
  root: z.ZodOptional<z.ZodLiteral<"agent">>;
92
130
  }, z.core.$strict>>;
93
- env: z.ZodRecord<z.ZodString, z.ZodObject<{
131
+ env: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
94
132
  kind: z.ZodLiteral<"public">;
95
133
  value: z.ZodString;
96
- }, z.core.$strict>>;
97
- flags: z.ZodArray<z.ZodObject<{
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ kind: z.ZodLiteral<"secret-ref">;
136
+ key: z.ZodString;
137
+ format: z.ZodOptional<z.ZodEnum<{
138
+ bearer: "bearer";
139
+ raw: "raw";
140
+ }>>;
141
+ }, z.core.$strict>], "kind">>;
142
+ flags: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
98
143
  kind: z.ZodLiteral<"public">;
99
144
  value: z.ZodString;
100
- }, z.core.$strict>>;
145
+ }, z.core.$strict>, z.ZodObject<{
146
+ kind: z.ZodLiteral<"secret-ref">;
147
+ key: z.ZodString;
148
+ format: z.ZodOptional<z.ZodEnum<{
149
+ bearer: "bearer";
150
+ raw: "raw";
151
+ }>>;
152
+ }, z.core.$strict>], "kind">>;
101
153
  systemPrompt: z.ZodOptional<z.ZodObject<{
102
154
  kind: z.ZodLiteral<"public">;
103
155
  value: z.ZodString;
@@ -448,14 +500,28 @@ export declare const agentCandidateExecutionPlanMaterialSchema: z.ZodObject<{
448
500
  }, z.core.$strict>;
449
501
  launch: z.ZodObject<{
450
502
  executable: z.ZodString;
451
- args: z.ZodArray<z.ZodObject<{
503
+ args: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
452
504
  kind: z.ZodLiteral<"public">;
453
505
  value: z.ZodString;
454
- }, z.core.$strict>>;
455
- env: z.ZodRecord<z.ZodString, z.ZodObject<{
506
+ }, z.core.$strict>, z.ZodObject<{
507
+ kind: z.ZodLiteral<"secret-ref">;
508
+ key: z.ZodString;
509
+ format: z.ZodOptional<z.ZodEnum<{
510
+ bearer: "bearer";
511
+ raw: "raw";
512
+ }>>;
513
+ }, z.core.$strict>], "kind">>;
514
+ env: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
456
515
  kind: z.ZodLiteral<"public">;
457
516
  value: z.ZodString;
458
- }, z.core.$strict>>;
517
+ }, z.core.$strict>, z.ZodObject<{
518
+ kind: z.ZodLiteral<"secret-ref">;
519
+ key: z.ZodString;
520
+ format: z.ZodOptional<z.ZodEnum<{
521
+ bearer: "bearer";
522
+ raw: "raw";
523
+ }>>;
524
+ }, z.core.$strict>], "kind">>;
459
525
  cwd: z.ZodObject<{
460
526
  workspace: z.ZodEnum<{
461
527
  candidate: "candidate";
@@ -567,22 +633,62 @@ export declare const agentCandidateProfilePlanEvidenceSchema: z.ZodObject<{
567
633
  kind: z.ZodLiteral<"agent-profile-workspace-plan">;
568
634
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
569
635
  material: z.ZodType<{
636
+ proxySecrets?: {
637
+ hosts: readonly string[];
638
+ methods?: readonly string[] | undefined;
639
+ paths?: readonly string[] | undefined;
640
+ envName: string;
641
+ secretRef: {
642
+ kind: "secret-ref";
643
+ key: string;
644
+ };
645
+ presentation: {
646
+ type: "bearer";
647
+ } | {
648
+ type: "basic";
649
+ username: string;
650
+ } | {
651
+ type: "header";
652
+ name: string;
653
+ } | {
654
+ type: "query";
655
+ name: string;
656
+ };
657
+ placeholderFormat?: "jwt" | "opaque" | undefined;
658
+ ttlSeconds?: number | undefined;
659
+ }[] | undefined;
570
660
  sourceProfileDigest: `sha256:${string}`;
571
661
  harness: "acp" | "amp" | "claude-code" | "cli-base" | "codex" | "cursor" | "factory-droids" | "forge" | "gemini" | "hermes" | "kimi-code" | "nanoclaw" | "openclaw" | "opencode" | "pi" | "prime";
572
662
  files: {
573
663
  relPath: string;
574
664
  mode: number;
575
665
  contentSha256: `sha256:${string}`;
666
+ secretSlots?: {
667
+ path: (string | number)[];
668
+ ref: {
669
+ kind: "secret-ref";
670
+ key: string;
671
+ format?: "bearer" | "raw" | undefined;
672
+ };
673
+ }[] | undefined;
576
674
  root?: "agent" | undefined;
577
675
  }[];
578
676
  env: Record<string, {
677
+ kind: "secret-ref";
678
+ key: string;
679
+ format?: "bearer" | "raw" | undefined;
680
+ } | {
579
681
  kind: "public";
580
682
  value: string;
581
683
  }>;
582
- flags: {
684
+ flags: ({
685
+ kind: "secret-ref";
686
+ key: string;
687
+ format?: "bearer" | "raw" | undefined;
688
+ } | {
583
689
  kind: "public";
584
690
  value: string;
585
- }[];
691
+ })[];
586
692
  systemPrompt?: {
587
693
  kind: "public";
588
694
  value: string;
@@ -596,22 +702,62 @@ export declare const agentCandidateProfilePlanEvidenceSchema: z.ZodObject<{
596
702
  reason: string;
597
703
  }[];
598
704
  }, unknown, z.core.$ZodTypeInternals<{
705
+ proxySecrets?: {
706
+ hosts: readonly string[];
707
+ methods?: readonly string[] | undefined;
708
+ paths?: readonly string[] | undefined;
709
+ envName: string;
710
+ secretRef: {
711
+ kind: "secret-ref";
712
+ key: string;
713
+ };
714
+ presentation: {
715
+ type: "bearer";
716
+ } | {
717
+ type: "basic";
718
+ username: string;
719
+ } | {
720
+ type: "header";
721
+ name: string;
722
+ } | {
723
+ type: "query";
724
+ name: string;
725
+ };
726
+ placeholderFormat?: "jwt" | "opaque" | undefined;
727
+ ttlSeconds?: number | undefined;
728
+ }[] | undefined;
599
729
  sourceProfileDigest: `sha256:${string}`;
600
730
  harness: "acp" | "amp" | "claude-code" | "cli-base" | "codex" | "cursor" | "factory-droids" | "forge" | "gemini" | "hermes" | "kimi-code" | "nanoclaw" | "openclaw" | "opencode" | "pi" | "prime";
601
731
  files: {
602
732
  relPath: string;
603
733
  mode: number;
604
734
  contentSha256: `sha256:${string}`;
735
+ secretSlots?: {
736
+ path: (string | number)[];
737
+ ref: {
738
+ kind: "secret-ref";
739
+ key: string;
740
+ format?: "bearer" | "raw" | undefined;
741
+ };
742
+ }[] | undefined;
605
743
  root?: "agent" | undefined;
606
744
  }[];
607
745
  env: Record<string, {
746
+ kind: "secret-ref";
747
+ key: string;
748
+ format?: "bearer" | "raw" | undefined;
749
+ } | {
608
750
  kind: "public";
609
751
  value: string;
610
752
  }>;
611
- flags: {
753
+ flags: ({
754
+ kind: "secret-ref";
755
+ key: string;
756
+ format?: "bearer" | "raw" | undefined;
757
+ } | {
612
758
  kind: "public";
613
759
  value: string;
614
- }[];
760
+ })[];
615
761
  systemPrompt?: {
616
762
  kind: "public";
617
763
  value: string;
@@ -654,22 +800,62 @@ export declare const agentCandidateProfileActivationSchema: z.ZodObject<{
654
800
  kind: "agent-profile-workspace-plan";
655
801
  digest: `sha256:${string}`;
656
802
  material: {
803
+ proxySecrets?: {
804
+ hosts: readonly string[];
805
+ methods?: readonly string[] | undefined;
806
+ paths?: readonly string[] | undefined;
807
+ envName: string;
808
+ secretRef: {
809
+ kind: "secret-ref";
810
+ key: string;
811
+ };
812
+ presentation: {
813
+ type: "bearer";
814
+ } | {
815
+ type: "basic";
816
+ username: string;
817
+ } | {
818
+ type: "header";
819
+ name: string;
820
+ } | {
821
+ type: "query";
822
+ name: string;
823
+ };
824
+ placeholderFormat?: "jwt" | "opaque" | undefined;
825
+ ttlSeconds?: number | undefined;
826
+ }[] | undefined;
657
827
  sourceProfileDigest: `sha256:${string}`;
658
828
  harness: "acp" | "amp" | "claude-code" | "cli-base" | "codex" | "cursor" | "factory-droids" | "forge" | "gemini" | "hermes" | "kimi-code" | "nanoclaw" | "openclaw" | "opencode" | "pi" | "prime";
659
829
  files: {
660
830
  relPath: string;
661
831
  mode: number;
662
832
  contentSha256: `sha256:${string}`;
833
+ secretSlots?: {
834
+ path: (string | number)[];
835
+ ref: {
836
+ kind: "secret-ref";
837
+ key: string;
838
+ format?: "bearer" | "raw" | undefined;
839
+ };
840
+ }[] | undefined;
663
841
  root?: "agent" | undefined;
664
842
  }[];
665
843
  env: Record<string, {
844
+ kind: "secret-ref";
845
+ key: string;
846
+ format?: "bearer" | "raw" | undefined;
847
+ } | {
666
848
  kind: "public";
667
849
  value: string;
668
850
  }>;
669
- flags: {
851
+ flags: ({
852
+ kind: "secret-ref";
853
+ key: string;
854
+ format?: "bearer" | "raw" | undefined;
855
+ } | {
670
856
  kind: "public";
671
857
  value: string;
672
- }[];
858
+ })[];
673
859
  systemPrompt?: {
674
860
  kind: "public";
675
861
  value: string;
@@ -710,22 +896,62 @@ export declare const agentCandidateProfileActivationSchema: z.ZodObject<{
710
896
  kind: "agent-profile-workspace-plan";
711
897
  digest: `sha256:${string}`;
712
898
  material: {
899
+ proxySecrets?: {
900
+ hosts: readonly string[];
901
+ methods?: readonly string[] | undefined;
902
+ paths?: readonly string[] | undefined;
903
+ envName: string;
904
+ secretRef: {
905
+ kind: "secret-ref";
906
+ key: string;
907
+ };
908
+ presentation: {
909
+ type: "bearer";
910
+ } | {
911
+ type: "basic";
912
+ username: string;
913
+ } | {
914
+ type: "header";
915
+ name: string;
916
+ } | {
917
+ type: "query";
918
+ name: string;
919
+ };
920
+ placeholderFormat?: "jwt" | "opaque" | undefined;
921
+ ttlSeconds?: number | undefined;
922
+ }[] | undefined;
713
923
  sourceProfileDigest: `sha256:${string}`;
714
924
  harness: "acp" | "amp" | "claude-code" | "cli-base" | "codex" | "cursor" | "factory-droids" | "forge" | "gemini" | "hermes" | "kimi-code" | "nanoclaw" | "openclaw" | "opencode" | "pi" | "prime";
715
925
  files: {
716
926
  relPath: string;
717
927
  mode: number;
718
928
  contentSha256: `sha256:${string}`;
929
+ secretSlots?: {
930
+ path: (string | number)[];
931
+ ref: {
932
+ kind: "secret-ref";
933
+ key: string;
934
+ format?: "bearer" | "raw" | undefined;
935
+ };
936
+ }[] | undefined;
719
937
  root?: "agent" | undefined;
720
938
  }[];
721
939
  env: Record<string, {
940
+ kind: "secret-ref";
941
+ key: string;
942
+ format?: "bearer" | "raw" | undefined;
943
+ } | {
722
944
  kind: "public";
723
945
  value: string;
724
946
  }>;
725
- flags: {
947
+ flags: ({
948
+ kind: "secret-ref";
949
+ key: string;
950
+ format?: "bearer" | "raw" | undefined;
951
+ } | {
726
952
  kind: "public";
727
953
  value: string;
728
- }[];
954
+ })[];
729
955
  systemPrompt?: {
730
956
  kind: "public";
731
957
  value: string;
@@ -927,11 +1153,19 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
927
1153
  };
928
1154
  launch: {
929
1155
  executable: string;
930
- args: {
1156
+ args: ({
1157
+ kind: "secret-ref";
1158
+ key: string;
1159
+ format?: "bearer" | "raw" | undefined;
1160
+ } | {
931
1161
  kind: "public";
932
1162
  value: string;
933
- }[];
1163
+ })[];
934
1164
  env: Record<string, {
1165
+ kind: "secret-ref";
1166
+ key: string;
1167
+ format?: "bearer" | "raw" | undefined;
1168
+ } | {
935
1169
  kind: "public";
936
1170
  value: string;
937
1171
  }>;
@@ -1191,11 +1425,19 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
1191
1425
  };
1192
1426
  launch: {
1193
1427
  executable: string;
1194
- args: {
1428
+ args: ({
1429
+ kind: "secret-ref";
1430
+ key: string;
1431
+ format?: "bearer" | "raw" | undefined;
1432
+ } | {
1195
1433
  kind: "public";
1196
1434
  value: string;
1197
- }[];
1435
+ })[];
1198
1436
  env: Record<string, {
1437
+ kind: "secret-ref";
1438
+ key: string;
1439
+ format?: "bearer" | "raw" | undefined;
1440
+ } | {
1199
1441
  kind: "public";
1200
1442
  value: string;
1201
1443
  }>;
@@ -3,7 +3,8 @@ import { z } from "zod";
3
3
  import { agentCandidateArtifactRefSchema, agentCandidateCapturedArtifactSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, } from "./agent-candidate-artifact-schema.js";
4
4
  import { agentCandidateContainerSchema, agentCandidateInstructionDeliverySchema, agentCandidateWorkingDirectorySchema, } from "./agent-candidate-code-schema.js";
5
5
  import { reasoningEffortSchema } from "./profile-schema.js";
6
- import { addDuplicateIssues, agentCandidateConfigValueSchema, agentCandidateMediaTypeSchema, environmentConfigSchema, gitObjectSchema, isCanonicalJsonValue, isObviouslyPrivateHostname, isSafeExecutable, isSafeRelativePath, sameGitObjectFormat, sha256Utf8, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
6
+ import { addDuplicateIssues, agentCandidateConfigValueSchema, agentCandidateSecretRefSchema, agentCandidatePublicValueSchema, agentCandidateMediaTypeSchema, environmentConfigSchema, gitObjectSchema, isCanonicalJsonValue, isObviouslyPrivateHostname, isSafeExecutable, isSafeRelativePath, sameGitObjectFormat, sha256Utf8, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
7
+ import { ProxySecretsSchema } from "./proxy-secrets.js";
7
8
  import { harnessTypeSchema } from "./harness.js";
8
9
  import { createAgentProfileActivationEvidenceSchema } from "./agent-profile-activation.js";
9
10
  function isCanonicalAbsolutePath(value) {
@@ -107,6 +108,7 @@ export const agentCandidateRetryPolicySchema = z.enum([
107
108
  ]);
108
109
  export const agentCandidateProfilePlanMaterialSchema = z
109
110
  .object({
111
+ proxySecrets: ProxySecretsSchema.optional(),
110
112
  sourceProfileDigest: sha256DigestSchema,
111
113
  harness: harnessTypeSchema,
112
114
  files: z.array(z
@@ -116,13 +118,20 @@ export const agentCandidateProfilePlanMaterialSchema = z
116
118
  .refine((value) => isSafeRelativePath(value, false), "profile-plan file must use a canonical relative path"),
117
119
  mode: z.number().int().min(0).max(0o777),
118
120
  contentSha256: sha256DigestSchema,
121
+ secretSlots: z.array(z.strictObject({
122
+ path: z.array(z.union([
123
+ z.string().refine((value) => !["__proto__", "prototype", "constructor"].includes(value)),
124
+ z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
125
+ ])),
126
+ ref: agentCandidateSecretRefSchema,
127
+ })).optional(),
119
128
  root: z.literal("agent").optional(),
120
129
  })
121
130
  .strict()),
122
131
  env: environmentConfigSchema,
123
132
  flags: z.array(agentCandidateConfigValueSchema),
124
- systemPrompt: agentCandidateConfigValueSchema.optional(),
125
- appendSystemPrompt: agentCandidateConfigValueSchema.optional(),
133
+ systemPrompt: agentCandidatePublicValueSchema.optional(),
134
+ appendSystemPrompt: agentCandidatePublicValueSchema.optional(),
126
135
  unsupported: z
127
136
  .array(z
128
137
  .object({
@@ -134,6 +143,18 @@ export const agentCandidateProfilePlanMaterialSchema = z
134
143
  })
135
144
  .strict()
136
145
  .superRefine((material, ctx) => {
146
+ material.files.forEach((file, fileIndex) => {
147
+ const slots = file.secretSlots ?? [];
148
+ slots.forEach((slot, slotIndex) => {
149
+ if (slots.slice(0, slotIndex).some((previous) => {
150
+ const common = Math.min(previous.path.length, slot.path.length);
151
+ return previous.path.slice(0, common).every((segment, index) => segment === slot.path[index]);
152
+ })) {
153
+ ctx.addIssue({ code: "custom", path: ["files", fileIndex, "secretSlots", slotIndex],
154
+ message: "secret slot paths cannot duplicate or overlap" });
155
+ }
156
+ });
157
+ });
137
158
  const fileIdentities = material.files.map(profilePlanFileIdentity);
138
159
  addDuplicateIssues(fileIdentities, ["files"], ctx);
139
160
  for (let index = 1; index < material.files.length; index++) {
@@ -328,7 +349,9 @@ export const agentCandidateExecutionPlanMaterialSchema = z
328
349
  })
329
350
  .strict()
330
351
  .superRefine((material, ctx) => {
331
- if (!material.launch.executable.startsWith("/") && !material.launch.env.PATH?.value.trim()) {
352
+ const executablePath = material.launch.env.PATH;
353
+ if (!material.launch.executable.startsWith("/") &&
354
+ (executablePath?.kind !== "public" || !executablePath.value.trim())) {
332
355
  ctx.addIssue({
333
356
  code: "custom",
334
357
  path: ["launch", "env", "PATH"],
@@ -405,16 +428,16 @@ export const agentCandidateExecutionPlanMaterialSchema = z
405
428
  }
406
429
  const taskPath = material.launch.env.TANGLE_CANDIDATE_TASK_PATH;
407
430
  if (taskPath !== undefined) {
408
- if (taskPath.value !== "/tangle/input/task.txt") {
431
+ if (taskPath.kind !== "public" || taskPath.value !== "/tangle/input/task.txt") {
409
432
  ctx.addIssue({
410
433
  code: "custom",
411
434
  path: ["launch", "env", "TANGLE_CANDIDATE_TASK_PATH"],
412
435
  message: "task file delivery must use the fixed evaluator-owned path",
413
436
  });
414
437
  }
415
- if (pathsOverlap(taskPath.value, material.workspaces.taskRoot) ||
438
+ if (taskPath.kind === "public" && (pathsOverlap(taskPath.value, material.workspaces.taskRoot) ||
416
439
  (material.workspaces.candidateRoot !== undefined &&
417
- pathsOverlap(taskPath.value, material.workspaces.candidateRoot))) {
440
+ pathsOverlap(taskPath.value, material.workspaces.candidateRoot)))) {
418
441
  ctx.addIssue({
419
442
  code: "custom",
420
443
  path: ["launch", "env", "TANGLE_CANDIDATE_TASK_PATH"],