@tangle-network/agent-interface 2.0.0 → 2.1.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.
@@ -84,6 +84,7 @@ export declare const agentCandidateProfilePlanMaterialSchema: z.ZodObject<{
84
84
  relPath: z.ZodString;
85
85
  mode: z.ZodNumber;
86
86
  contentSha256: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
87
+ root: z.ZodOptional<z.ZodLiteral<"agent">>;
87
88
  }, z.core.$strict>>;
88
89
  env: z.ZodRecord<z.ZodString, z.ZodObject<{
89
90
  kind: z.ZodLiteral<"public">;
@@ -536,6 +537,7 @@ export declare const agentCandidateProfilePlanEvidenceSchema: z.ZodObject<{
536
537
  relPath: string;
537
538
  mode: number;
538
539
  contentSha256: `sha256:${string}`;
540
+ root?: "agent" | undefined;
539
541
  }[];
540
542
  env: Record<string, {
541
543
  kind: "public";
@@ -564,6 +566,7 @@ export declare const agentCandidateProfilePlanEvidenceSchema: z.ZodObject<{
564
566
  relPath: string;
565
567
  mode: number;
566
568
  contentSha256: `sha256:${string}`;
569
+ root?: "agent" | undefined;
567
570
  }[];
568
571
  env: Record<string, {
569
572
  kind: "public";
@@ -617,6 +620,7 @@ export declare const agentCandidateProfileActivationSchema: z.ZodObject<{
617
620
  relPath: string;
618
621
  mode: number;
619
622
  contentSha256: `sha256:${string}`;
623
+ root?: "agent" | undefined;
620
624
  }[];
621
625
  env: Record<string, {
622
626
  kind: "public";
@@ -668,6 +672,7 @@ export declare const agentCandidateProfileActivationSchema: z.ZodObject<{
668
672
  relPath: string;
669
673
  mode: number;
670
674
  contentSha256: `sha256:${string}`;
675
+ root?: "agent" | undefined;
671
676
  }[];
672
677
  env: Record<string, {
673
678
  kind: "public";
@@ -15,6 +15,9 @@ function isCanonicalAbsolutePath(value) {
15
15
  function pathsOverlap(left, right) {
16
16
  return left === right || left.startsWith(`${right}/`) || right.startsWith(`${left}/`);
17
17
  }
18
+ function profilePlanFileIdentity(file) {
19
+ return `${file.root ?? "workspace"}\u0000${file.relPath}`;
20
+ }
18
21
  function isExactPublicGatewayDomain(value) {
19
22
  if (value.length > 253 ||
20
23
  value !== value.toLowerCase() ||
@@ -113,6 +116,7 @@ export const agentCandidateProfilePlanMaterialSchema = z
113
116
  .refine((value) => isSafeRelativePath(value, false), "profile-plan file must use a canonical relative path"),
114
117
  mode: z.number().int().min(0).max(0o777),
115
118
  contentSha256: sha256DigestSchema,
119
+ root: z.literal("agent").optional(),
116
120
  })
117
121
  .strict()),
118
122
  env: environmentConfigSchema,
@@ -130,14 +134,14 @@ export const agentCandidateProfilePlanMaterialSchema = z
130
134
  })
131
135
  .strict()
132
136
  .superRefine((material, ctx) => {
133
- addDuplicateIssues(material.files.map((file) => file.relPath), ["files"], ctx);
137
+ const fileIdentities = material.files.map(profilePlanFileIdentity);
138
+ addDuplicateIssues(fileIdentities, ["files"], ctx);
134
139
  for (let index = 1; index < material.files.length; index++) {
135
- if ((material.files[index - 1]?.relPath ?? "") >=
136
- (material.files[index]?.relPath ?? "")) {
140
+ if ((fileIdentities[index - 1] ?? "") >= (fileIdentities[index] ?? "")) {
137
141
  ctx.addIssue({
138
142
  code: "custom",
139
143
  path: ["files", index, "relPath"],
140
- message: "profile-plan files must be lexicographically sorted",
144
+ message: "profile-plan files must be lexicographically sorted by root and path",
141
145
  });
142
146
  }
143
147
  }
@@ -2076,6 +2076,7 @@ export declare const candidateExecutionEvidenceSchema: z.ZodObject<{
2076
2076
  relPath: string;
2077
2077
  mode: number;
2078
2078
  contentSha256: `sha256:${string}`;
2079
+ root?: "agent" | undefined;
2079
2080
  }[];
2080
2081
  env: Record<string, {
2081
2082
  kind: "public";
@@ -2127,6 +2128,7 @@ export declare const candidateExecutionEvidenceSchema: z.ZodObject<{
2127
2128
  relPath: string;
2128
2129
  mode: number;
2129
2130
  contentSha256: `sha256:${string}`;
2131
+ root?: "agent" | undefined;
2130
2132
  }[];
2131
2133
  env: Record<string, {
2132
2134
  kind: "public";
@@ -5664,6 +5666,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
5664
5666
  relPath: string;
5665
5667
  mode: number;
5666
5668
  contentSha256: `sha256:${string}`;
5669
+ root?: "agent" | undefined;
5667
5670
  }[];
5668
5671
  env: Record<string, {
5669
5672
  kind: "public";
@@ -5715,6 +5718,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
5715
5718
  relPath: string;
5716
5719
  mode: number;
5717
5720
  contentSha256: `sha256:${string}`;
5721
+ root?: "agent" | undefined;
5718
5722
  }[];
5719
5723
  env: Record<string, {
5720
5724
  kind: "public";
@@ -7059,6 +7063,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
7059
7063
  relPath: string;
7060
7064
  mode: number;
7061
7065
  contentSha256: `sha256:${string}`;
7066
+ root?: "agent" | undefined;
7062
7067
  }[];
7063
7068
  env: Record<string, {
7064
7069
  kind: "public";
@@ -7110,6 +7115,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
7110
7115
  relPath: string;
7111
7116
  mode: number;
7112
7117
  contentSha256: `sha256:${string}`;
7118
+ root?: "agent" | undefined;
7113
7119
  }[];
7114
7120
  env: Record<string, {
7115
7121
  kind: "public";
@@ -10679,6 +10685,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
10679
10685
  relPath: string;
10680
10686
  mode: number;
10681
10687
  contentSha256: `sha256:${string}`;
10688
+ root?: "agent" | undefined;
10682
10689
  }[];
10683
10690
  env: Record<string, {
10684
10691
  kind: "public";
@@ -10730,6 +10737,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
10730
10737
  relPath: string;
10731
10738
  mode: number;
10732
10739
  contentSha256: `sha256:${string}`;
10740
+ root?: "agent" | undefined;
10733
10741
  }[];
10734
10742
  env: Record<string, {
10735
10743
  kind: "public";
@@ -12074,6 +12082,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
12074
12082
  relPath: string;
12075
12083
  mode: number;
12076
12084
  contentSha256: `sha256:${string}`;
12085
+ root?: "agent" | undefined;
12077
12086
  }[];
12078
12087
  env: Record<string, {
12079
12088
  kind: "public";
@@ -12125,6 +12134,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
12125
12134
  relPath: string;
12126
12135
  mode: number;
12127
12136
  contentSha256: `sha256:${string}`;
12137
+ root?: "agent" | undefined;
12128
12138
  }[];
12129
12139
  env: Record<string, {
12130
12140
  kind: "public";
@@ -201,6 +201,7 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
201
201
  relPath: string;
202
202
  mode: number;
203
203
  contentSha256: `sha256:${string}`;
204
+ root?: "agent" | undefined;
204
205
  }[];
205
206
  env: Record<string, {
206
207
  kind: "public";
@@ -252,6 +253,7 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
252
253
  relPath: string;
253
254
  mode: number;
254
255
  contentSha256: `sha256:${string}`;
256
+ root?: "agent" | undefined;
255
257
  }[];
256
258
  env: Record<string, {
257
259
  kind: "public";
@@ -183,9 +183,11 @@ export const agentCandidateMaterializationReceiptSchema = z
183
183
  ],
184
184
  [
185
185
  JSON.stringify(plan.profile.mountPaths) ===
186
- JSON.stringify(receipt.profileActivation.profilePlan.material.files.map((file) => file.relPath)),
186
+ JSON.stringify(receipt.profileActivation.profilePlan.material.files
187
+ .filter((file) => file.root === undefined)
188
+ .map((file) => file.relPath)),
187
189
  ["executionPlan", "material", "profile", "mountPaths"],
188
- "execution plan must bind every profile mount path",
190
+ "execution plan must bind every workspace profile mount path",
189
191
  ],
190
192
  [
191
193
  receipt.codeKind === plan.codeKind,
@@ -341,6 +341,8 @@ export interface AgentCandidateProfilePlanMaterial {
341
341
  relPath: string;
342
342
  mode: number;
343
343
  contentSha256: Sha256Digest;
344
+ /** Omit for a workspace-root file; agent-root files must name this root. */
345
+ root?: "agent";
344
346
  }>;
345
347
  env: Record<string, AgentCandidateConfigValue>;
346
348
  flags: AgentCandidateConfigValue[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",