@tangle-network/sdk-provider-codex 0.4.95 → 0.4.96

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 (2) hide show
  1. package/dist/index.mjs +119 -1
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -330,6 +330,119 @@ z.discriminatedUnion("status", [
330
330
  })
331
331
  ]);
332
332
  //#endregion
333
+ //#region ../runtime-contracts/dist/file-limits.js
334
+ const MEBIBYTE$1 = 1024 * 1024;
335
+ 10 * MEBIBYTE$1;
336
+ 5 * MEBIBYTE$1;
337
+ 5 * MEBIBYTE$1;
338
+ 10 * MEBIBYTE$1;
339
+ 5 * MEBIBYTE$1;
340
+ //#endregion
341
+ //#region ../runtime-contracts/dist/request-limits.js
342
+ /**
343
+ * Raw WIRE/TRANSPORT caps: request-byte limits checked while the body
344
+ * streams in (bodyLimit middleware, Content-Length, encoded proxy bodies),
345
+ * before anything is parsed or decoded. Rejections against these carry
346
+ * code `PAYLOAD_TOO_LARGE` (`payload-too-large.ts`) — the remedy is to
347
+ * split the delivery. Decoded/parsed-content caps (code `FILE_TOO_LARGE`)
348
+ * live in `file-io.ts`.
349
+ */
350
+ const MEBIBYTE = 1024 * 1024;
351
+ 32 * MEBIBYTE;
352
+ 64 * MEBIBYTE;
353
+ 128 * MEBIBYTE;
354
+ //#endregion
355
+ //#region ../runtime-contracts/dist/file-transfer.js
356
+ /** Platform control-plane trees are never customer file or retained-workspace content. */
357
+ function isInsideReservedDir(path) {
358
+ return path.replaceAll("\\", "/").split("/").includes(".sidecar");
359
+ }
360
+ //#endregion
361
+ //#region ../runtime-contracts/dist/workspace-cwd.js
362
+ const MAX_RUNTIME_WORKSPACE_CWD_LENGTH = 4096;
363
+ function hasControlCharacter(value) {
364
+ return Array.from(value).some((character) => {
365
+ const codePoint = character.codePointAt(0);
366
+ return codePoint !== void 0 && (codePoint <= 31 || codePoint === 127);
367
+ });
368
+ }
369
+ /**
370
+ * A portable working directory below a sandbox workspace root.
371
+ *
372
+ * The value is relative because container layouts differ by runtime.
373
+ * The platform resolves it only after it knows the mounted checkout root.
374
+ */
375
+ const runtimeWorkspaceCwdSchema = z.string().min(1).max(MAX_RUNTIME_WORKSPACE_CWD_LENGTH).superRefine((value, refinement) => {
376
+ if (value.startsWith("/")) refinement.addIssue({
377
+ code: "custom",
378
+ message: "Workspace cwd must be relative"
379
+ });
380
+ if (value.includes("\\")) refinement.addIssue({
381
+ code: "custom",
382
+ message: "Workspace cwd must use POSIX separators"
383
+ });
384
+ if (hasControlCharacter(value)) refinement.addIssue({
385
+ code: "custom",
386
+ message: "Workspace cwd cannot contain control characters"
387
+ });
388
+ if (value.split("/").includes("..")) refinement.addIssue({
389
+ code: "custom",
390
+ message: "Workspace cwd cannot leave the workspace root"
391
+ });
392
+ }).transform((value) => {
393
+ return value.split("/").filter((segment) => segment.length > 0 && segment !== ".").join("/") || ".";
394
+ });
395
+ /**
396
+ * Names the home that keeps harness state when the runtime cwd is a requested
397
+ * project directory below it (the Console's /home/agent/workspace). Set only
398
+ * where that cwd is applied: the host-agent's cold create spec and the
399
+ * sidecar's claim rebind. A caller's env never sets it.
400
+ */
401
+ const AGENT_STATE_ROOT_ENV_VAR = "AGENT_STATE_ROOT";
402
+ z.object({
403
+ publication: z.literal(true).optional(),
404
+ paths: z.array(runtimeWorkspaceCwdSchema.pipe(z.string().max(450)).refine((path) => !isInsideReservedDir(path), "Retained path is reserved for platform control state")).max(64)
405
+ }).strict();
406
+ /** Existing Intelligence address and immutable revision of one exact regular file. */
407
+ const retainedWorkspaceFileSchema = z.object({
408
+ sourcePath: runtimeWorkspaceCwdSchema.pipe(z.string().max(450)),
409
+ workspaceSnapshot: z.string().regex(/^[a-f0-9]{64}$/),
410
+ sourceKind: z.literal("regular"),
411
+ preserved: z.literal(true)
412
+ }).strip().extend({
413
+ runId: z.string().regex(/^(?!\.+$)[A-Za-z0-9._:-]{1,200}$/),
414
+ sandboxId: z.string().min(1).max(200),
415
+ sessionId: z.string().regex(/^restored-[a-f0-9]{64}$/),
416
+ path: z.string().min(1).max(512),
417
+ sourceSha256: z.string().regex(/^sha256:[a-f0-9]{64}$/),
418
+ storedSha256: z.string().regex(/^sha256:[a-f0-9]{64}$/),
419
+ sourceBytes: z.number().int().nonnegative().safe(),
420
+ storedBytes: z.number().int().nonnegative().safe(),
421
+ etag: z.string().regex(/^"[a-f0-9]{64}"$/)
422
+ }).strip().superRefine((file, context) => {
423
+ if (file.sourceSha256 !== file.storedSha256 || file.sourceBytes !== file.storedBytes || file.path !== `workspace/files/${file.sourcePath}` || isInsideReservedDir(file.sourcePath)) context.addIssue({
424
+ code: "custom",
425
+ message: "Retained publication must name exact raw regular-file bytes"
426
+ });
427
+ });
428
+ z.object({
429
+ runId: z.string().min(1).max(200),
430
+ sandboxId: z.string().min(1).max(200),
431
+ sourceCreatedAt: z.string().datetime(),
432
+ filesystemIncarnationId: z.string().uuid(),
433
+ workspaceSnapshot: z.string().regex(/^[a-f0-9]{64}$/),
434
+ files: z.array(retainedWorkspaceFileSchema).min(1).max(64)
435
+ }).strip().superRefine((publication, context) => {
436
+ const paths = /* @__PURE__ */ new Set();
437
+ for (const file of publication.files) {
438
+ if (file.runId !== publication.runId || file.sandboxId !== publication.sandboxId || file.workspaceSnapshot !== publication.workspaceSnapshot || paths.has(file.sourcePath)) context.addIssue({
439
+ code: "custom",
440
+ message: "Retained file does not belong to this original publication"
441
+ });
442
+ paths.add(file.sourcePath);
443
+ }
444
+ });
445
+ //#endregion
333
446
  //#region ../runtime-contracts/dist/runtime-environment.js
334
447
  const SAFE_ENV_VAR_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
335
448
  function isSafeEnvVarName(name) {
@@ -355,6 +468,7 @@ const CA_TRUST_ENV_NAMES = [
355
468
  ];
356
469
  [...EGRESS_PROXY_ENV_NAMES, ...CA_TRUST_ENV_NAMES];
357
470
  const FORBIDDEN_ENV_VAR_NAMES = new Set([
471
+ AGENT_STATE_ROOT_ENV_VAR,
358
472
  "LD_PRELOAD",
359
473
  "LD_LIBRARY_PATH",
360
474
  "LD_AUDIT",
@@ -411,7 +525,11 @@ const FORBIDDEN_ENV_VAR_PREFIXES = [
411
525
  "AGENT_SUBPROCESS_",
412
526
  "TEE_ATTESTATION_"
413
527
  ];
414
- const RUNTIME_CALLER_ALLOWED_ENV_NAMES = new Set(["SIDECAR_CAPABILITIES", "SIDECAR_PLATFORM_CONTROL_RUNTIME"]);
528
+ const RUNTIME_CALLER_ALLOWED_ENV_NAMES = new Set([
529
+ "SIDECAR_CAPABILITIES",
530
+ "SIDECAR_PLATFORM_CONTROL_RUNTIME",
531
+ "SIDECAR_RUNTIME_MODE"
532
+ ]);
415
533
  new Set(Object.values(HARNESS_WARM_TRANSPORT_ENV).flatMap(({ warmServer, prewarm }) => [warmServer, prewarm]));
416
534
  function isForbiddenEnvVarName(name) {
417
535
  if (RUNTIME_CALLER_ALLOWED_ENV_NAMES.has(name)) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sdk-provider-codex",
3
- "version": "0.4.95",
3
+ "version": "0.4.96",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -17,8 +17,8 @@
17
17
  "dependencies": {
18
18
  "@tangle-network/agent-backend-types": "1.3.3",
19
19
  "@tangle-network/agent-interface": "^5.10.27",
20
- "@tangle-network/sdk-cli-runner": "0.3.12",
21
- "@tangle-network/sdk-provider-cli-base": "0.13.117",
20
+ "@tangle-network/sdk-cli-runner": "0.3.13",
21
+ "@tangle-network/sdk-provider-cli-base": "0.13.118",
22
22
  "@tangle-network/sdk-session-persistence": "0.7.13",
23
23
  "smol-toml": "^1.9.0",
24
24
  "zod": "4.6.7"
@@ -35,8 +35,8 @@
35
35
  "registry": "https://registry.npmjs.org"
36
36
  },
37
37
  "tangleRelease": {
38
- "sourceSha": "135cabe951875734e26e251fb149d9c839c46f58",
39
- "mergedAt": "2026-11-17T17:03:21-08:00"
38
+ "sourceSha": "0a10816e481c8d9c7c6982281c2e9e994207d85b",
39
+ "mergedAt": "2026-11-18T16:50:01-08:00"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsdown",