@tangle-network/cli-agent-registry 0.15.109 → 0.15.110
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as cliAuthFilesSchema, c as materializeCliAuthBundle, d as resolveCliAuthReference, f as cliAuthReferenceSchema, o as cliAuthObjectSchema, r as assertCliAuthReferenceSupported, t as AUTH_BUNDLE_PATHS, u as parseCliAuthJson } from "./cli-auth-bundle-CQCj_DOW.mjs";
|
|
2
|
-
import { r as proxySecretMaterializationsSchema } from "./harness-
|
|
2
|
+
import { r as proxySecretMaterializationsSchema } from "./harness-Cw-E18j8.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { decodeJwt } from "jose";
|
|
5
5
|
//#region src/native-cli-auth-metadata.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as getSpec } from "./specs-6pK_KTpK.mjs";
|
|
2
2
|
import { a as cliAuthFilesSchema, d as resolveCliAuthReference, f as cliAuthReferenceSchema, n as CLI_AUTH_REFERENCE_ENV_VAR, u as parseCliAuthJson } from "./cli-auth-bundle-CQCj_DOW.mjs";
|
|
3
|
-
import { n as isSafeEnvVarName, t as isForbiddenEnvVarName } from "./harness-
|
|
3
|
+
import { n as isSafeEnvVarName, t as isForbiddenEnvVarName } from "./harness-Cw-E18j8.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/cli-backend-auth-env.ts
|
|
6
6
|
/** The narrow credential leg shared by the host and sidecar rebind boundary. */
|
|
@@ -226,6 +226,119 @@ z.discriminatedUnion("status", [
|
|
|
226
226
|
})
|
|
227
227
|
]);
|
|
228
228
|
//#endregion
|
|
229
|
+
//#region ../runtime-contracts/dist/file-limits.js
|
|
230
|
+
const MEBIBYTE$1 = 1024 * 1024;
|
|
231
|
+
10 * MEBIBYTE$1;
|
|
232
|
+
5 * MEBIBYTE$1;
|
|
233
|
+
5 * MEBIBYTE$1;
|
|
234
|
+
10 * MEBIBYTE$1;
|
|
235
|
+
5 * MEBIBYTE$1;
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region ../runtime-contracts/dist/request-limits.js
|
|
238
|
+
/**
|
|
239
|
+
* Raw WIRE/TRANSPORT caps: request-byte limits checked while the body
|
|
240
|
+
* streams in (bodyLimit middleware, Content-Length, encoded proxy bodies),
|
|
241
|
+
* before anything is parsed or decoded. Rejections against these carry
|
|
242
|
+
* code `PAYLOAD_TOO_LARGE` (`payload-too-large.ts`) — the remedy is to
|
|
243
|
+
* split the delivery. Decoded/parsed-content caps (code `FILE_TOO_LARGE`)
|
|
244
|
+
* live in `file-io.ts`.
|
|
245
|
+
*/
|
|
246
|
+
const MEBIBYTE = 1024 * 1024;
|
|
247
|
+
32 * MEBIBYTE;
|
|
248
|
+
64 * MEBIBYTE;
|
|
249
|
+
128 * MEBIBYTE;
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region ../runtime-contracts/dist/file-transfer.js
|
|
252
|
+
/** Platform control-plane trees are never customer file or retained-workspace content. */
|
|
253
|
+
function isInsideReservedDir(path) {
|
|
254
|
+
return path.replaceAll("\\", "/").split("/").includes(".sidecar");
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region ../runtime-contracts/dist/workspace-cwd.js
|
|
258
|
+
const MAX_RUNTIME_WORKSPACE_CWD_LENGTH = 4096;
|
|
259
|
+
function hasControlCharacter(value) {
|
|
260
|
+
return Array.from(value).some((character) => {
|
|
261
|
+
const codePoint = character.codePointAt(0);
|
|
262
|
+
return codePoint !== void 0 && (codePoint <= 31 || codePoint === 127);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* A portable working directory below a sandbox workspace root.
|
|
267
|
+
*
|
|
268
|
+
* The value is relative because container layouts differ by runtime.
|
|
269
|
+
* The platform resolves it only after it knows the mounted checkout root.
|
|
270
|
+
*/
|
|
271
|
+
const runtimeWorkspaceCwdSchema = z.string().min(1).max(MAX_RUNTIME_WORKSPACE_CWD_LENGTH).superRefine((value, refinement) => {
|
|
272
|
+
if (value.startsWith("/")) refinement.addIssue({
|
|
273
|
+
code: "custom",
|
|
274
|
+
message: "Workspace cwd must be relative"
|
|
275
|
+
});
|
|
276
|
+
if (value.includes("\\")) refinement.addIssue({
|
|
277
|
+
code: "custom",
|
|
278
|
+
message: "Workspace cwd must use POSIX separators"
|
|
279
|
+
});
|
|
280
|
+
if (hasControlCharacter(value)) refinement.addIssue({
|
|
281
|
+
code: "custom",
|
|
282
|
+
message: "Workspace cwd cannot contain control characters"
|
|
283
|
+
});
|
|
284
|
+
if (value.split("/").includes("..")) refinement.addIssue({
|
|
285
|
+
code: "custom",
|
|
286
|
+
message: "Workspace cwd cannot leave the workspace root"
|
|
287
|
+
});
|
|
288
|
+
}).transform((value) => {
|
|
289
|
+
return value.split("/").filter((segment) => segment.length > 0 && segment !== ".").join("/") || ".";
|
|
290
|
+
});
|
|
291
|
+
/**
|
|
292
|
+
* Names the home that keeps harness state when the runtime cwd is a requested
|
|
293
|
+
* project directory below it (the Console's /home/agent/workspace). Set only
|
|
294
|
+
* where that cwd is applied: the host-agent's cold create spec and the
|
|
295
|
+
* sidecar's claim rebind. A caller's env never sets it.
|
|
296
|
+
*/
|
|
297
|
+
const AGENT_STATE_ROOT_ENV_VAR = "AGENT_STATE_ROOT";
|
|
298
|
+
z.object({
|
|
299
|
+
publication: z.literal(true).optional(),
|
|
300
|
+
paths: z.array(runtimeWorkspaceCwdSchema.pipe(z.string().max(450)).refine((path) => !isInsideReservedDir(path), "Retained path is reserved for platform control state")).max(64)
|
|
301
|
+
}).strict();
|
|
302
|
+
/** Existing Intelligence address and immutable revision of one exact regular file. */
|
|
303
|
+
const retainedWorkspaceFileSchema = z.object({
|
|
304
|
+
sourcePath: runtimeWorkspaceCwdSchema.pipe(z.string().max(450)),
|
|
305
|
+
workspaceSnapshot: z.string().regex(/^[a-f0-9]{64}$/),
|
|
306
|
+
sourceKind: z.literal("regular"),
|
|
307
|
+
preserved: z.literal(true)
|
|
308
|
+
}).strip().extend({
|
|
309
|
+
runId: z.string().regex(/^(?!\.+$)[A-Za-z0-9._:-]{1,200}$/),
|
|
310
|
+
sandboxId: z.string().min(1).max(200),
|
|
311
|
+
sessionId: z.string().regex(/^restored-[a-f0-9]{64}$/),
|
|
312
|
+
path: z.string().min(1).max(512),
|
|
313
|
+
sourceSha256: z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
314
|
+
storedSha256: z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
315
|
+
sourceBytes: z.number().int().nonnegative().safe(),
|
|
316
|
+
storedBytes: z.number().int().nonnegative().safe(),
|
|
317
|
+
etag: z.string().regex(/^"[a-f0-9]{64}"$/)
|
|
318
|
+
}).strip().superRefine((file, context) => {
|
|
319
|
+
if (file.sourceSha256 !== file.storedSha256 || file.sourceBytes !== file.storedBytes || file.path !== `workspace/files/${file.sourcePath}` || isInsideReservedDir(file.sourcePath)) context.addIssue({
|
|
320
|
+
code: "custom",
|
|
321
|
+
message: "Retained publication must name exact raw regular-file bytes"
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
z.object({
|
|
325
|
+
runId: z.string().min(1).max(200),
|
|
326
|
+
sandboxId: z.string().min(1).max(200),
|
|
327
|
+
sourceCreatedAt: z.string().datetime(),
|
|
328
|
+
filesystemIncarnationId: z.string().uuid(),
|
|
329
|
+
workspaceSnapshot: z.string().regex(/^[a-f0-9]{64}$/),
|
|
330
|
+
files: z.array(retainedWorkspaceFileSchema).min(1).max(64)
|
|
331
|
+
}).strip().superRefine((publication, context) => {
|
|
332
|
+
const paths = /* @__PURE__ */ new Set();
|
|
333
|
+
for (const file of publication.files) {
|
|
334
|
+
if (file.runId !== publication.runId || file.sandboxId !== publication.sandboxId || file.workspaceSnapshot !== publication.workspaceSnapshot || paths.has(file.sourcePath)) context.addIssue({
|
|
335
|
+
code: "custom",
|
|
336
|
+
message: "Retained file does not belong to this original publication"
|
|
337
|
+
});
|
|
338
|
+
paths.add(file.sourcePath);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
//#endregion
|
|
229
342
|
//#region ../runtime-contracts/dist/runtime-environment.js
|
|
230
343
|
const SAFE_ENV_VAR_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
231
344
|
function isSafeEnvVarName(name) {
|
|
@@ -251,6 +364,7 @@ const CA_TRUST_ENV_NAMES = [
|
|
|
251
364
|
];
|
|
252
365
|
[...EGRESS_PROXY_ENV_NAMES, ...CA_TRUST_ENV_NAMES];
|
|
253
366
|
const FORBIDDEN_ENV_VAR_NAMES = new Set([
|
|
367
|
+
AGENT_STATE_ROOT_ENV_VAR,
|
|
254
368
|
"LD_PRELOAD",
|
|
255
369
|
"LD_LIBRARY_PATH",
|
|
256
370
|
"LD_AUDIT",
|
|
@@ -337,4 +451,4 @@ safeEnvRecordSchema.refine((value) => Object.keys(value).every((key) => !isForbi
|
|
|
337
451
|
//#endregion
|
|
338
452
|
export { isSafeEnvVarName as n, proxySecretMaterializationsSchema as r, isForbiddenEnvVarName as t };
|
|
339
453
|
|
|
340
|
-
//# sourceMappingURL=harness-
|
|
454
|
+
//# sourceMappingURL=harness-Cw-E18j8.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/cli-agent-registry",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.110",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./cli-backend-auth-env": {
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"tsdown": "^0.21.10",
|
|
74
74
|
"typescript": "^6.0.3",
|
|
75
75
|
"vitest": "^4.1.12",
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
76
|
+
"@tangle-network/runtime-contracts": "0.20.0",
|
|
77
|
+
"@repo/airgap-guard": "0.0.0"
|
|
78
78
|
},
|
|
79
79
|
"tangleRelease": {
|
|
80
|
-
"sourceSha": "
|
|
81
|
-
"mergedAt": "2026-11-
|
|
80
|
+
"sourceSha": "683f9d7a93c93328111e8600d638fda926553204",
|
|
81
|
+
"mergedAt": "2026-11-17T23:28:41-08:00"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "tsdown && node scripts/export-host-contracts.mjs --write",
|