@tangle-network/sdk-provider-claude-code 0.6.93 → 0.6.95

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 +8 -8
package/dist/index.mjs CHANGED
@@ -440,6 +440,119 @@ z.discriminatedUnion("status", [
440
440
  })
441
441
  ]);
442
442
  //#endregion
443
+ //#region ../runtime-contracts/dist/file-limits.js
444
+ const MEBIBYTE$1 = 1024 * 1024;
445
+ 10 * MEBIBYTE$1;
446
+ 5 * MEBIBYTE$1;
447
+ 5 * MEBIBYTE$1;
448
+ 10 * MEBIBYTE$1;
449
+ 5 * MEBIBYTE$1;
450
+ //#endregion
451
+ //#region ../runtime-contracts/dist/request-limits.js
452
+ /**
453
+ * Raw WIRE/TRANSPORT caps: request-byte limits checked while the body
454
+ * streams in (bodyLimit middleware, Content-Length, encoded proxy bodies),
455
+ * before anything is parsed or decoded. Rejections against these carry
456
+ * code `PAYLOAD_TOO_LARGE` (`payload-too-large.ts`) — the remedy is to
457
+ * split the delivery. Decoded/parsed-content caps (code `FILE_TOO_LARGE`)
458
+ * live in `file-io.ts`.
459
+ */
460
+ const MEBIBYTE = 1024 * 1024;
461
+ 32 * MEBIBYTE;
462
+ 64 * MEBIBYTE;
463
+ 128 * MEBIBYTE;
464
+ //#endregion
465
+ //#region ../runtime-contracts/dist/file-transfer.js
466
+ /** Platform control-plane trees are never customer file or retained-workspace content. */
467
+ function isInsideReservedDir(path) {
468
+ return path.replaceAll("\\", "/").split("/").includes(".sidecar");
469
+ }
470
+ //#endregion
471
+ //#region ../runtime-contracts/dist/workspace-cwd.js
472
+ const MAX_RUNTIME_WORKSPACE_CWD_LENGTH = 4096;
473
+ function hasControlCharacter(value) {
474
+ return Array.from(value).some((character) => {
475
+ const codePoint = character.codePointAt(0);
476
+ return codePoint !== void 0 && (codePoint <= 31 || codePoint === 127);
477
+ });
478
+ }
479
+ /**
480
+ * A portable working directory below a sandbox workspace root.
481
+ *
482
+ * The value is relative because container layouts differ by runtime.
483
+ * The platform resolves it only after it knows the mounted checkout root.
484
+ */
485
+ const runtimeWorkspaceCwdSchema = z.string().min(1).max(MAX_RUNTIME_WORKSPACE_CWD_LENGTH).superRefine((value, refinement) => {
486
+ if (value.startsWith("/")) refinement.addIssue({
487
+ code: "custom",
488
+ message: "Workspace cwd must be relative"
489
+ });
490
+ if (value.includes("\\")) refinement.addIssue({
491
+ code: "custom",
492
+ message: "Workspace cwd must use POSIX separators"
493
+ });
494
+ if (hasControlCharacter(value)) refinement.addIssue({
495
+ code: "custom",
496
+ message: "Workspace cwd cannot contain control characters"
497
+ });
498
+ if (value.split("/").includes("..")) refinement.addIssue({
499
+ code: "custom",
500
+ message: "Workspace cwd cannot leave the workspace root"
501
+ });
502
+ }).transform((value) => {
503
+ return value.split("/").filter((segment) => segment.length > 0 && segment !== ".").join("/") || ".";
504
+ });
505
+ /**
506
+ * Names the home that keeps harness state when the runtime cwd is a requested
507
+ * project directory below it (the Console's /home/agent/workspace). Set only
508
+ * where that cwd is applied: the host-agent's cold create spec and the
509
+ * sidecar's claim rebind. A caller's env never sets it.
510
+ */
511
+ const AGENT_STATE_ROOT_ENV_VAR = "AGENT_STATE_ROOT";
512
+ z.object({
513
+ publication: z.literal(true).optional(),
514
+ paths: z.array(runtimeWorkspaceCwdSchema.pipe(z.string().max(450)).refine((path) => !isInsideReservedDir(path), "Retained path is reserved for platform control state")).max(64)
515
+ }).strict();
516
+ /** Existing Intelligence address and immutable revision of one exact regular file. */
517
+ const retainedWorkspaceFileSchema = z.object({
518
+ sourcePath: runtimeWorkspaceCwdSchema.pipe(z.string().max(450)),
519
+ workspaceSnapshot: z.string().regex(/^[a-f0-9]{64}$/),
520
+ sourceKind: z.literal("regular"),
521
+ preserved: z.literal(true)
522
+ }).strip().extend({
523
+ runId: z.string().regex(/^(?!\.+$)[A-Za-z0-9._:-]{1,200}$/),
524
+ sandboxId: z.string().min(1).max(200),
525
+ sessionId: z.string().regex(/^restored-[a-f0-9]{64}$/),
526
+ path: z.string().min(1).max(512),
527
+ sourceSha256: z.string().regex(/^sha256:[a-f0-9]{64}$/),
528
+ storedSha256: z.string().regex(/^sha256:[a-f0-9]{64}$/),
529
+ sourceBytes: z.number().int().nonnegative().safe(),
530
+ storedBytes: z.number().int().nonnegative().safe(),
531
+ etag: z.string().regex(/^"[a-f0-9]{64}"$/)
532
+ }).strip().superRefine((file, context) => {
533
+ if (file.sourceSha256 !== file.storedSha256 || file.sourceBytes !== file.storedBytes || file.path !== `workspace/files/${file.sourcePath}` || isInsideReservedDir(file.sourcePath)) context.addIssue({
534
+ code: "custom",
535
+ message: "Retained publication must name exact raw regular-file bytes"
536
+ });
537
+ });
538
+ z.object({
539
+ runId: z.string().min(1).max(200),
540
+ sandboxId: z.string().min(1).max(200),
541
+ sourceCreatedAt: z.string().datetime(),
542
+ filesystemIncarnationId: z.string().uuid(),
543
+ workspaceSnapshot: z.string().regex(/^[a-f0-9]{64}$/),
544
+ files: z.array(retainedWorkspaceFileSchema).min(1).max(64)
545
+ }).strip().superRefine((publication, context) => {
546
+ const paths = /* @__PURE__ */ new Set();
547
+ for (const file of publication.files) {
548
+ if (file.runId !== publication.runId || file.sandboxId !== publication.sandboxId || file.workspaceSnapshot !== publication.workspaceSnapshot || paths.has(file.sourcePath)) context.addIssue({
549
+ code: "custom",
550
+ message: "Retained file does not belong to this original publication"
551
+ });
552
+ paths.add(file.sourcePath);
553
+ }
554
+ });
555
+ //#endregion
443
556
  //#region ../runtime-contracts/dist/runtime-environment.js
444
557
  const SAFE_ENV_VAR_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
445
558
  function isSafeEnvVarName(name) {
@@ -465,6 +578,7 @@ const CA_TRUST_ENV_NAMES = [
465
578
  ];
466
579
  [...EGRESS_PROXY_ENV_NAMES, ...CA_TRUST_ENV_NAMES];
467
580
  const FORBIDDEN_ENV_VAR_NAMES = new Set([
581
+ AGENT_STATE_ROOT_ENV_VAR,
468
582
  "LD_PRELOAD",
469
583
  "LD_LIBRARY_PATH",
470
584
  "LD_AUDIT",
@@ -521,7 +635,11 @@ const FORBIDDEN_ENV_VAR_PREFIXES = [
521
635
  "AGENT_SUBPROCESS_",
522
636
  "TEE_ATTESTATION_"
523
637
  ];
524
- const RUNTIME_CALLER_ALLOWED_ENV_NAMES = new Set(["SIDECAR_CAPABILITIES", "SIDECAR_PLATFORM_CONTROL_RUNTIME"]);
638
+ const RUNTIME_CALLER_ALLOWED_ENV_NAMES = new Set([
639
+ "SIDECAR_CAPABILITIES",
640
+ "SIDECAR_PLATFORM_CONTROL_RUNTIME",
641
+ "SIDECAR_RUNTIME_MODE"
642
+ ]);
525
643
  new Set(Object.values(HARNESS_WARM_TRANSPORT_ENV).flatMap(({ warmServer, prewarm }) => [warmServer, prewarm]));
526
644
  function isForbiddenEnvVarName(name) {
527
645
  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-claude-code",
3
- "version": "0.6.93",
3
+ "version": "0.6.95",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -16,11 +16,11 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@modelcontextprotocol/sdk": "^1.32.2",
19
- "@tangle-network/agent-interface": "^5.10.27",
20
- "@tangle-network/agent-profile-materialize": "1.1.134",
21
- "@tangle-network/sdk-cli-runner": "0.3.12",
22
- "@tangle-network/sdk-provider-cli-base": "0.13.117",
23
- "@tangle-network/sdk-session-persistence": "0.7.13",
19
+ "@tangle-network/agent-interface": "^5.10.28",
20
+ "@tangle-network/agent-profile-materialize": "1.1.136",
21
+ "@tangle-network/sdk-cli-runner": "0.3.13",
22
+ "@tangle-network/sdk-provider-cli-base": "0.13.119",
23
+ "@tangle-network/sdk-session-persistence": "0.7.14",
24
24
  "zod": "4.6.7"
25
25
  },
26
26
  "devDependencies": {
@@ -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": "61759acea650aa1e856a2aa0da5a3b04e1105e06",
39
+ "mergedAt": "2026-11-18T18:45:51-08:00"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsdown",