@tangle-network/agent-interface 1.8.0 → 2.0.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/README.md +14 -0
- package/dist/agent-candidate-code-schema.d.ts +17 -17
- package/dist/agent-candidate-execution-plan-schema.d.ts +179 -179
- package/dist/agent-candidate-lineage-schema.d.ts +2 -2
- package/dist/agent-candidate-outcome-schema.d.ts +56 -56
- package/dist/agent-candidate-profile-schema.d.ts +17 -17
- package/dist/agent-candidate-promotion-schema.d.ts +1085 -1085
- package/dist/agent-candidate-receipt-schema.d.ts +195 -195
- package/dist/agent-candidate-schema-common.d.ts +6 -0
- package/dist/agent-candidate-schema-common.js +25 -10
- package/dist/agent-candidate-schema.d.ts +30 -30
- package/dist/agent-candidate-task-schema.d.ts +16 -16
- package/dist/agent-execution-limits.d.ts +1 -1
- package/dist/agent-execution-preparation-receipt.d.ts +71 -71
- package/dist/agent-improvement-measurement-schema.d.ts +26 -26
- package/dist/agent-instance.d.ts +2 -2
- package/dist/agent-profile-improvement-schema.d.ts +75 -75
- package/dist/agent-workspace-lease.d.ts +4 -4
- package/dist/certified-context.d.ts +2 -2
- package/dist/environment-command-turn.js +4 -1
- package/dist/environment-interactive-control.d.ts +422 -422
- package/dist/environment-interactive-start.d.ts +17 -17
- package/dist/environment-observation.d.ts +39 -39
- package/dist/environment-provider.d.ts +1 -0
- package/dist/environment-provider.js +1 -0
- package/dist/environment-requests.d.ts +22 -2
- package/dist/environment-requests.js +29 -1
- package/dist/environment-runtime.d.ts +53 -20
- package/dist/environment-runtime.js +23 -0
- package/dist/harness.d.ts +11 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction-envelope.d.ts +26 -26
- package/dist/interaction-fields.d.ts +22 -22
- package/dist/interaction-permissions.d.ts +2 -2
- package/dist/portable-context-base.d.ts +1 -1
- package/dist/portable-context-continuation.d.ts +4 -4
- package/dist/portable-context-plan-request.d.ts +1 -1
- package/dist/portable-context-plan.d.ts +5 -5
- package/dist/portable-context-shared.d.ts +1 -1
- package/dist/portable-context-transfer.d.ts +6 -6
- package/dist/profile-schema.d.ts +37 -37
- package/dist/runtime-control.d.ts +10 -10
- package/dist/workspace-cleanup.d.ts +3 -3
- package/dist/workspace-cwd.d.ts +28 -0
- package/dist/workspace-cwd.js +77 -0
- package/dist/workspace-fork.d.ts +4 -4
- package/package.json +6 -6
package/dist/profile-schema.d.ts
CHANGED
|
@@ -112,13 +112,13 @@ export declare const agentProfileResourcesSchema: z.ZodObject<{
|
|
|
112
112
|
failOnError: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
}, z.core.$strict>;
|
|
114
114
|
export declare const reasoningEffortSchema: z.ZodEnum<{
|
|
115
|
-
|
|
116
|
-
minimal: "minimal";
|
|
115
|
+
high: "high";
|
|
117
116
|
low: "low";
|
|
118
117
|
medium: "medium";
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
minimal: "minimal";
|
|
119
|
+
none: "none";
|
|
121
120
|
ultracode: "ultracode";
|
|
121
|
+
xhigh: "xhigh";
|
|
122
122
|
}>;
|
|
123
123
|
/**
|
|
124
124
|
* Enforce the token ceilings that live together: each single ceiling must not
|
|
@@ -135,13 +135,13 @@ export declare const agentProfileModelHintsBaseSchema: z.ZodObject<{
|
|
|
135
135
|
small: z.ZodOptional<z.ZodString>;
|
|
136
136
|
provider: z.ZodOptional<z.ZodString>;
|
|
137
137
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
138
|
-
|
|
139
|
-
minimal: "minimal";
|
|
138
|
+
high: "high";
|
|
140
139
|
low: "low";
|
|
141
140
|
medium: "medium";
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
minimal: "minimal";
|
|
142
|
+
none: "none";
|
|
144
143
|
ultracode: "ultracode";
|
|
144
|
+
xhigh: "xhigh";
|
|
145
145
|
}>>;
|
|
146
146
|
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
147
147
|
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -153,13 +153,13 @@ export declare const agentProfileModelHintsSchema: z.ZodObject<{
|
|
|
153
153
|
small: z.ZodOptional<z.ZodString>;
|
|
154
154
|
provider: z.ZodOptional<z.ZodString>;
|
|
155
155
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
156
|
-
|
|
157
|
-
minimal: "minimal";
|
|
156
|
+
high: "high";
|
|
158
157
|
low: "low";
|
|
159
158
|
medium: "medium";
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
minimal: "minimal";
|
|
160
|
+
none: "none";
|
|
162
161
|
ultracode: "ultracode";
|
|
162
|
+
xhigh: "xhigh";
|
|
163
163
|
}>>;
|
|
164
164
|
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
165
165
|
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -187,8 +187,8 @@ export declare const agentProfileSecretRefSchema: z.ZodObject<{
|
|
|
187
187
|
kind: z.ZodLiteral<"secret-ref">;
|
|
188
188
|
key: z.ZodString;
|
|
189
189
|
format: z.ZodOptional<z.ZodEnum<{
|
|
190
|
-
raw: "raw";
|
|
191
190
|
bearer: "bearer";
|
|
191
|
+
raw: "raw";
|
|
192
192
|
}>>;
|
|
193
193
|
}, z.core.$strict>;
|
|
194
194
|
export declare const agentProfileConfigValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -198,8 +198,8 @@ export declare const agentProfileConfigValueSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
198
198
|
kind: z.ZodLiteral<"secret-ref">;
|
|
199
199
|
key: z.ZodString;
|
|
200
200
|
format: z.ZodOptional<z.ZodEnum<{
|
|
201
|
-
raw: "raw";
|
|
202
201
|
bearer: "bearer";
|
|
202
|
+
raw: "raw";
|
|
203
203
|
}>>;
|
|
204
204
|
}, z.core.$strict>], "kind">;
|
|
205
205
|
export declare const agentProfileEnvironmentSchema: z.ZodType<Record<string, {
|
|
@@ -208,14 +208,14 @@ export declare const agentProfileEnvironmentSchema: z.ZodType<Record<string, {
|
|
|
208
208
|
} | {
|
|
209
209
|
kind: "secret-ref";
|
|
210
210
|
key: string;
|
|
211
|
-
format?: "
|
|
211
|
+
format?: "bearer" | "raw" | undefined;
|
|
212
212
|
}>, unknown, z.core.$ZodTypeInternals<Record<string, {
|
|
213
213
|
kind: "public";
|
|
214
214
|
value: string;
|
|
215
215
|
} | {
|
|
216
216
|
kind: "secret-ref";
|
|
217
217
|
key: string;
|
|
218
|
-
format?: "
|
|
218
|
+
format?: "bearer" | "raw" | undefined;
|
|
219
219
|
}>, unknown>>;
|
|
220
220
|
export declare const agentProfileHeaderSchema: z.ZodType<Record<string, {
|
|
221
221
|
kind: "public";
|
|
@@ -223,14 +223,14 @@ export declare const agentProfileHeaderSchema: z.ZodType<Record<string, {
|
|
|
223
223
|
} | {
|
|
224
224
|
kind: "secret-ref";
|
|
225
225
|
key: string;
|
|
226
|
-
format?: "
|
|
226
|
+
format?: "bearer" | "raw" | undefined;
|
|
227
227
|
}>, unknown, z.core.$ZodTypeInternals<Record<string, {
|
|
228
228
|
kind: "public";
|
|
229
229
|
value: string;
|
|
230
230
|
} | {
|
|
231
231
|
kind: "secret-ref";
|
|
232
232
|
key: string;
|
|
233
|
-
format?: "
|
|
233
|
+
format?: "bearer" | "raw" | undefined;
|
|
234
234
|
}>, unknown>>;
|
|
235
235
|
export declare const agentSubagentProfileSchema: z.ZodObject<{
|
|
236
236
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -252,14 +252,14 @@ export declare const agentProfileHookCommandSchema: z.ZodObject<{
|
|
|
252
252
|
} | {
|
|
253
253
|
kind: "secret-ref";
|
|
254
254
|
key: string;
|
|
255
|
-
format?: "
|
|
255
|
+
format?: "bearer" | "raw" | undefined;
|
|
256
256
|
}>, unknown, z.core.$ZodTypeInternals<Record<string, {
|
|
257
257
|
kind: "public";
|
|
258
258
|
value: string;
|
|
259
259
|
} | {
|
|
260
260
|
kind: "secret-ref";
|
|
261
261
|
key: string;
|
|
262
|
-
format?: "
|
|
262
|
+
format?: "bearer" | "raw" | undefined;
|
|
263
263
|
}>, unknown>>>;
|
|
264
264
|
}, z.core.$strict>;
|
|
265
265
|
export declare const agentProfileModeSchema: z.ZodObject<{
|
|
@@ -346,13 +346,13 @@ export declare const agentProfileSchema: z.ZodObject<{
|
|
|
346
346
|
small: z.ZodOptional<z.ZodString>;
|
|
347
347
|
provider: z.ZodOptional<z.ZodString>;
|
|
348
348
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
349
|
-
|
|
350
|
-
minimal: "minimal";
|
|
349
|
+
high: "high";
|
|
351
350
|
low: "low";
|
|
352
351
|
medium: "medium";
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
minimal: "minimal";
|
|
353
|
+
none: "none";
|
|
355
354
|
ultracode: "ultracode";
|
|
355
|
+
xhigh: "xhigh";
|
|
356
356
|
}>>;
|
|
357
357
|
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
358
358
|
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -360,22 +360,22 @@ export declare const agentProfileSchema: z.ZodObject<{
|
|
|
360
360
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
361
361
|
}, z.core.$strict>>;
|
|
362
362
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
363
|
+
acp: "acp";
|
|
364
|
+
amp: "amp";
|
|
363
365
|
"claude-code": "claude-code";
|
|
364
|
-
|
|
366
|
+
"cli-base": "cli-base";
|
|
365
367
|
codex: "codex";
|
|
366
|
-
|
|
367
|
-
"
|
|
368
|
-
|
|
369
|
-
prime: "prime";
|
|
368
|
+
cursor: "cursor";
|
|
369
|
+
"factory-droids": "factory-droids";
|
|
370
|
+
forge: "forge";
|
|
370
371
|
gemini: "gemini";
|
|
371
372
|
hermes: "hermes";
|
|
373
|
+
"kimi-code": "kimi-code";
|
|
374
|
+
nanoclaw: "nanoclaw";
|
|
372
375
|
openclaw: "openclaw";
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
cursor: "cursor";
|
|
377
|
-
acp: "acp";
|
|
378
|
-
"cli-base": "cli-base";
|
|
376
|
+
opencode: "opencode";
|
|
377
|
+
pi: "pi";
|
|
378
|
+
prime: "prime";
|
|
379
379
|
}>>;
|
|
380
380
|
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>>>;
|
|
381
381
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
@@ -486,7 +486,7 @@ export declare const agentProfileSchema: z.ZodObject<{
|
|
|
486
486
|
} | {
|
|
487
487
|
kind: "secret-ref";
|
|
488
488
|
key: string;
|
|
489
|
-
format?: "
|
|
489
|
+
format?: "bearer" | "raw" | undefined;
|
|
490
490
|
}> | undefined;
|
|
491
491
|
}[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
|
|
492
492
|
command: string;
|
|
@@ -499,7 +499,7 @@ export declare const agentProfileSchema: z.ZodObject<{
|
|
|
499
499
|
} | {
|
|
500
500
|
kind: "secret-ref";
|
|
501
501
|
key: string;
|
|
502
|
-
format?: "
|
|
502
|
+
format?: "bearer" | "raw" | undefined;
|
|
503
503
|
}> | undefined;
|
|
504
504
|
}[]>, unknown>>>;
|
|
505
505
|
modes: z.ZodOptional<z.ZodType<Record<string, {
|
|
@@ -53,7 +53,6 @@ export interface AgentRunCancellationRequest extends AgentRunCancellationRequest
|
|
|
53
53
|
}
|
|
54
54
|
export declare function agentRunCancellationRequestDigest(request: AgentRunCancellationRequestMaterial): Sha256Digest;
|
|
55
55
|
export declare const AgentRunCancellationRequestSchema: z.ZodObject<{
|
|
56
|
-
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
57
56
|
operationId: z.ZodString;
|
|
58
57
|
run: z.ZodObject<{
|
|
59
58
|
runId: z.ZodString;
|
|
@@ -64,6 +63,7 @@ export declare const AgentRunCancellationRequestSchema: z.ZodObject<{
|
|
|
64
63
|
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
65
64
|
}, z.core.$strict>;
|
|
66
65
|
reason: z.ZodOptional<z.ZodString>;
|
|
66
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
67
67
|
}, z.core.$strict>;
|
|
68
68
|
export interface AgentRunCancellationAcknowledgement {
|
|
69
69
|
operationId: string;
|
|
@@ -87,16 +87,16 @@ export declare const AgentRunCancellationAcknowledgementSchema: z.ZodObject<{
|
|
|
87
87
|
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
88
88
|
}, z.core.$strict>;
|
|
89
89
|
status: z.ZodEnum<{
|
|
90
|
-
unknown: "unknown";
|
|
91
|
-
conflict: "conflict";
|
|
92
90
|
accepted: "accepted";
|
|
91
|
+
conflict: "conflict";
|
|
93
92
|
replayed: "replayed";
|
|
93
|
+
unknown: "unknown";
|
|
94
94
|
}>;
|
|
95
95
|
effect: z.ZodEnum<{
|
|
96
|
-
unknown: "unknown";
|
|
97
|
-
cancelled: "cancelled";
|
|
98
96
|
cancel_requested: "cancel_requested";
|
|
97
|
+
cancelled: "cancelled";
|
|
99
98
|
not_live: "not_live";
|
|
99
|
+
unknown: "unknown";
|
|
100
100
|
}>;
|
|
101
101
|
message: z.ZodOptional<z.ZodString>;
|
|
102
102
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -115,13 +115,12 @@ export interface AgentRunControlRequest extends AgentRunControlRequestMaterial {
|
|
|
115
115
|
}
|
|
116
116
|
export declare function agentRunControlRequestDigest(request: AgentRunControlRequestMaterial): Sha256Digest;
|
|
117
117
|
export declare const AgentRunControlRequestSchema: z.ZodObject<{
|
|
118
|
-
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
119
118
|
operationId: z.ZodString;
|
|
120
119
|
action: z.ZodEnum<{
|
|
121
|
-
status: "status";
|
|
122
|
-
steer: "steer";
|
|
123
120
|
cancel: "cancel";
|
|
124
121
|
reconnect: "reconnect";
|
|
122
|
+
status: "status";
|
|
123
|
+
steer: "steer";
|
|
125
124
|
}>;
|
|
126
125
|
run: z.ZodObject<{
|
|
127
126
|
runId: z.ZodString;
|
|
@@ -132,6 +131,7 @@ export declare const AgentRunControlRequestSchema: z.ZodObject<{
|
|
|
132
131
|
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
133
132
|
}, z.core.$strict>;
|
|
134
133
|
payload: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
134
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
135
135
|
}, z.core.$strict>;
|
|
136
136
|
export interface AgentRunControlAcknowledgement {
|
|
137
137
|
operationId: string;
|
|
@@ -154,10 +154,10 @@ export declare const AgentRunControlAcknowledgementSchema: z.ZodObject<{
|
|
|
154
154
|
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
155
155
|
}, z.core.$strict>;
|
|
156
156
|
status: z.ZodEnum<{
|
|
157
|
-
unknown: "unknown";
|
|
158
|
-
conflict: "conflict";
|
|
159
157
|
accepted: "accepted";
|
|
158
|
+
conflict: "conflict";
|
|
160
159
|
replayed: "replayed";
|
|
160
|
+
unknown: "unknown";
|
|
161
161
|
}>;
|
|
162
162
|
message: z.ZodOptional<z.ZodString>;
|
|
163
163
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -43,12 +43,12 @@ export declare const WorkspaceCleanupAcknowledgementSchema: z.ZodObject<{
|
|
|
43
43
|
provider: z.ZodString;
|
|
44
44
|
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
45
45
|
status: z.ZodEnum<{
|
|
46
|
-
|
|
46
|
+
already_absent: "already_absent";
|
|
47
47
|
conflict: "conflict";
|
|
48
|
-
transport_failure: "transport_failure";
|
|
49
48
|
deleted: "deleted";
|
|
50
|
-
already_absent: "already_absent";
|
|
51
49
|
in_use: "in_use";
|
|
50
|
+
transport_failure: "transport_failure";
|
|
51
|
+
unknown: "unknown";
|
|
52
52
|
}>;
|
|
53
53
|
existingRequestDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
|
|
54
54
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Maximum number of UTF-16 code units accepted in a workspace cwd path. */
|
|
3
|
+
export declare const MAX_WORKSPACE_CWD_LENGTH = 4096;
|
|
4
|
+
export type WorkspaceCwdBase = "repository" | "host";
|
|
5
|
+
export type WorkspaceCwd = {
|
|
6
|
+
base: "repository";
|
|
7
|
+
path: string;
|
|
8
|
+
} | {
|
|
9
|
+
base: "host";
|
|
10
|
+
path: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Validate and canonicalize an explicitly based workspace path.
|
|
14
|
+
*
|
|
15
|
+
* Repository paths never start with `./`, contain duplicate separators, or
|
|
16
|
+
* leave the workspace root. Host paths preserve native separators and values.
|
|
17
|
+
*/
|
|
18
|
+
export declare const workspaceCwdSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
base: z.ZodLiteral<"repository">;
|
|
20
|
+
path: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
base: z.ZodLiteral<"host">;
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
}, z.core.$strict>], "base">;
|
|
25
|
+
/** Validate and return the canonical form of a workspace cwd. */
|
|
26
|
+
export declare function canonicalWorkspaceCwd(value: WorkspaceCwd): WorkspaceCwd;
|
|
27
|
+
/** Return a provider path only when its explicit base is supported. */
|
|
28
|
+
export declare function workspaceCwdPathForBase(value: WorkspaceCwd | undefined, base: WorkspaceCwdBase, providerLabel: string): string | undefined;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { pathSafetyIssues, relativePathSafetyIssues, } from "./agent-candidate-schema-common.js";
|
|
3
|
+
/** Maximum number of UTF-16 code units accepted in a workspace cwd path. */
|
|
4
|
+
export const MAX_WORKSPACE_CWD_LENGTH = 4_096;
|
|
5
|
+
const workspaceCwdIssueMessages = {
|
|
6
|
+
absolute: "Workspace cwd must be relative",
|
|
7
|
+
backslash: "Workspace cwd must use POSIX separators",
|
|
8
|
+
"control-character": "Workspace cwd cannot contain control characters",
|
|
9
|
+
"parent-traversal": "Workspace cwd cannot leave the workspace root",
|
|
10
|
+
"malformed-unicode": "Workspace cwd must contain well-formed Unicode",
|
|
11
|
+
};
|
|
12
|
+
function normalizeWorkspaceCwd(value) {
|
|
13
|
+
const segments = value
|
|
14
|
+
.split("/")
|
|
15
|
+
.filter((segment) => segment.length > 0 && segment !== ".");
|
|
16
|
+
return segments.join("/") || ".";
|
|
17
|
+
}
|
|
18
|
+
const pathIssueMessages = {
|
|
19
|
+
"control-character": "Workspace cwd cannot contain control characters",
|
|
20
|
+
"malformed-unicode": "Workspace cwd must contain well-formed Unicode",
|
|
21
|
+
};
|
|
22
|
+
const repositoryWorkspaceCwdPathSchema = z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.max(MAX_WORKSPACE_CWD_LENGTH)
|
|
26
|
+
.superRefine((value, refinement) => {
|
|
27
|
+
for (const issue of relativePathSafetyIssues(value)) {
|
|
28
|
+
const message = workspaceCwdIssueMessages[issue];
|
|
29
|
+
if (message === undefined)
|
|
30
|
+
continue;
|
|
31
|
+
refinement.addIssue({
|
|
32
|
+
code: "custom",
|
|
33
|
+
message,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.transform(normalizeWorkspaceCwd);
|
|
38
|
+
const hostWorkspaceCwdPathSchema = z
|
|
39
|
+
.string()
|
|
40
|
+
.max(MAX_WORKSPACE_CWD_LENGTH)
|
|
41
|
+
.superRefine((value, refinement) => {
|
|
42
|
+
for (const issue of pathSafetyIssues(value)) {
|
|
43
|
+
refinement.addIssue({
|
|
44
|
+
code: "custom",
|
|
45
|
+
message: pathIssueMessages[issue],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Validate and canonicalize an explicitly based workspace path.
|
|
51
|
+
*
|
|
52
|
+
* Repository paths never start with `./`, contain duplicate separators, or
|
|
53
|
+
* leave the workspace root. Host paths preserve native separators and values.
|
|
54
|
+
*/
|
|
55
|
+
export const workspaceCwdSchema = z.discriminatedUnion("base", [
|
|
56
|
+
z.strictObject({
|
|
57
|
+
base: z.literal("repository"),
|
|
58
|
+
path: repositoryWorkspaceCwdPathSchema,
|
|
59
|
+
}),
|
|
60
|
+
z.strictObject({
|
|
61
|
+
base: z.literal("host"),
|
|
62
|
+
path: hostWorkspaceCwdPathSchema,
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
/** Validate and return the canonical form of a workspace cwd. */
|
|
66
|
+
export function canonicalWorkspaceCwd(value) {
|
|
67
|
+
return workspaceCwdSchema.parse(value);
|
|
68
|
+
}
|
|
69
|
+
/** Return a provider path only when its explicit base is supported. */
|
|
70
|
+
export function workspaceCwdPathForBase(value, base, providerLabel) {
|
|
71
|
+
if (value === undefined)
|
|
72
|
+
return undefined;
|
|
73
|
+
if (value.base !== base) {
|
|
74
|
+
throw new Error(`${providerLabel} supports workspace cwd base "${base}", not "${value.base}"`);
|
|
75
|
+
}
|
|
76
|
+
return value.path;
|
|
77
|
+
}
|
package/dist/workspace-fork.d.ts
CHANGED
|
@@ -39,10 +39,10 @@ export declare const WorkspaceForkRequestSchema: z.ZodObject<{
|
|
|
39
39
|
metadata: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
40
40
|
placement: z.ZodObject<{
|
|
41
41
|
kind: z.ZodEnum<{
|
|
42
|
-
|
|
42
|
+
fleet: "fleet";
|
|
43
43
|
local: "local";
|
|
44
|
+
provider: "provider";
|
|
44
45
|
sandbox: "sandbox";
|
|
45
|
-
fleet: "fleet";
|
|
46
46
|
}>;
|
|
47
47
|
sandboxId: z.ZodOptional<z.ZodString>;
|
|
48
48
|
fleetId: z.ZodOptional<z.ZodString>;
|
|
@@ -100,10 +100,10 @@ export declare const ForkedEnvironmentRefSchema: z.ZodObject<{
|
|
|
100
100
|
createdAt: z.ZodISODateTime;
|
|
101
101
|
placement: z.ZodObject<{
|
|
102
102
|
kind: z.ZodEnum<{
|
|
103
|
-
|
|
103
|
+
fleet: "fleet";
|
|
104
104
|
local: "local";
|
|
105
|
+
provider: "provider";
|
|
105
106
|
sandbox: "sandbox";
|
|
106
|
-
fleet: "fleet";
|
|
107
107
|
}>;
|
|
108
108
|
sandboxId: z.ZodOptional<z.ZodString>;
|
|
109
109
|
fleetId: z.ZodOptional<z.ZodString>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-interface",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,15 +83,15 @@
|
|
|
83
83
|
"LICENSE"
|
|
84
84
|
],
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@noble/hashes": "
|
|
86
|
+
"@noble/hashes": "2.4.0",
|
|
87
87
|
"spdx-expression-parse": "5.0.0",
|
|
88
|
-
"zod": "4.4
|
|
88
|
+
"zod": "4.5.4"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@types/node": "
|
|
91
|
+
"@types/node": "26.4.0",
|
|
92
92
|
"@types/spdx-expression-parse": "4.0.0",
|
|
93
|
-
"typescript": "
|
|
94
|
-
"vitest": "
|
|
93
|
+
"typescript": "7.0.2",
|
|
94
|
+
"vitest": "4.1.11"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"build": "tsc -p tsconfig.json",
|