@tangle-network/agent-interface 3.1.0 → 3.1.2

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 CHANGED
@@ -22,6 +22,13 @@ provider-facing projection without `seats`, setting its top-level harness and
22
22
  model to the selected stage. A cross-provider continuation requires an explicit
23
23
  stage in the authored chain.
24
24
 
25
+ Each later stage may replace the profile-level `tools` and `permissions` maps.
26
+ An explicit `{}` removes those profile-level controls for that stage; an omitted
27
+ map inherits them. If the first stage names a map, it must equal the top-level
28
+ map. The executor projects the selected maps before materialization and must
29
+ refuse a stage whose native harness cannot honor them. A missing grant map does
30
+ not prove which built-in tools the harness actually exposes.
31
+
25
32
  ## Profile measurements
26
33
 
27
34
  `measureAgentProfile(profile)` returns the canonical profile digest and JSON byte size,
@@ -163,6 +163,10 @@ export interface AgentProfileSeat {
163
163
  kind: "seat";
164
164
  id: string;
165
165
  };
166
+ /** Replace the profile-level native tool map for this stage; `{}` clears it. */
167
+ tools?: Record<string, boolean>;
168
+ /** Replace the profile-level permission map for this stage; `{}` clears it. */
169
+ permissions?: Record<string, AgentProfilePermission>;
166
170
  }
167
171
  /**
168
172
  * Prompt shaping for an agent.
@@ -97,6 +97,8 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
97
97
  kind: z.ZodLiteral<"seat">;
98
98
  id: z.ZodString;
99
99
  }, z.core.$strict>]>;
100
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
101
+ 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>>>;
100
102
  }, z.core.$strict>>>;
101
103
  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>>>;
102
104
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
@@ -34,6 +34,12 @@ export interface AgentTurnInput {
34
34
  contextTransfer?: ContextTransferRequest;
35
35
  /** Verified same-session continuation; never carries duplicate history. */
36
36
  nativeContinuation?: NativeContextContinuationRequest;
37
+ /** Resume an exact native Claude or Codex conversation inside a restored workspace. */
38
+ nativeResume?: {
39
+ harness: "claude-code" | "codex";
40
+ nativeSessionId: string;
41
+ sourceCheckpointId: string;
42
+ };
37
43
  context?: Record<string, unknown>;
38
44
  /** Interaction kinds the provider may originate for this turn. */
39
45
  interactions?: RequestedInteractions;
@@ -114,6 +120,8 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
114
120
  kind: z.ZodLiteral<"seat">;
115
121
  id: z.ZodString;
116
122
  }, z.core.$strict>]>;
123
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
124
+ 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>>>;
117
125
  }, z.core.$strict>>>;
118
126
  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>>>;
119
127
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
@@ -466,6 +474,14 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
466
474
  observedAt: z.ZodISODateTime;
467
475
  }, z.core.$strict>;
468
476
  }, z.core.$strict>>;
477
+ nativeResume: z.ZodOptional<z.ZodObject<{
478
+ harness: z.ZodEnum<{
479
+ "claude-code": "claude-code";
480
+ codex: "codex";
481
+ }>;
482
+ nativeSessionId: z.ZodString;
483
+ sourceCheckpointId: z.ZodString;
484
+ }, z.core.$strict>>;
469
485
  context: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
470
486
  interactions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
471
487
  signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
@@ -29,6 +29,11 @@ export const AgentTurnInputSchema = z.strictObject({
29
29
  controlRef: AgentRunControlRefSchema.optional(),
30
30
  contextTransfer: ContextTransferRequestSchema.optional(),
31
31
  nativeContinuation: NativeContextContinuationRequestSchema.optional(),
32
+ nativeResume: z.strictObject({
33
+ harness: z.enum(["claude-code", "codex"]),
34
+ nativeSessionId: boundedIdentifierSchema,
35
+ sourceCheckpointId: boundedIdentifierSchema,
36
+ }).optional(),
32
37
  context: boundedJsonRecordSchema.optional(),
33
38
  interactions: RequestedInteractionsSchema.optional(),
34
39
  signal: z.custom().optional(),
@@ -194,6 +194,8 @@ export declare const agentProfileSeatSchema: z.ZodObject<{
194
194
  kind: z.ZodLiteral<"seat">;
195
195
  id: z.ZodString;
196
196
  }, z.core.$strict>]>;
197
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
198
+ 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>>>;
197
199
  }, z.core.$strict>;
198
200
  /**
199
201
  * Replacement and addition are separate, independently optional fields, and the
@@ -544,6 +546,8 @@ export declare const agentProfileSchema: z.ZodObject<{
544
546
  kind: z.ZodLiteral<"seat">;
545
547
  id: z.ZodString;
546
548
  }, z.core.$strict>]>;
549
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
550
+ 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>>>;
547
551
  }, z.core.$strict>>>;
548
552
  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>>>;
549
553
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import { REASONING_EFFORTS, TRAINED_MODEL_PREFIX, trainedModelIdForArtifact, } from "./agent-profile.js";
3
3
  import { canonicalCandidateDigest, sha256DigestSchema, environmentNameSchema, headerNameSchema, isSafeExecutable, isSafeRelativePath, isWellFormedUnicode, looksLikeCredential, } from "./agent-candidate-schema-common.js";
4
4
  import { harnessTypeSchema } from "./harness.js";
5
+ import { canonicalAgentProfileJson } from "./agent-profile-canonical.js";
5
6
  import { harnessHonorsEffort, harnessHonorsModel, harnessModelSupport, harnessReasoningEfforts, harnessSystemPromptIntents, resolveModelProvider, } from "./harness-capabilities.js";
6
7
  import { SANDBOX_SIZE_PRESET_NAMES, } from "./sandbox-size.js";
7
8
  /**
@@ -140,6 +141,8 @@ export const agentProfileSeatSchema = z.strictObject({
140
141
  z.strictObject({ kind: z.literal("all-eligible") }),
141
142
  z.strictObject({ kind: z.literal("seat"), id: z.string().min(1).refine((value) => value.trim() === value, "seat id must be canonical") }),
142
143
  ]),
144
+ tools: ownPropertyRecordSchema(z.boolean()).optional(),
145
+ permissions: ownPropertyRecordSchema(agentProfilePermissionSchema).optional(),
143
146
  });
144
147
  /**
145
148
  * Replacement and addition are separate, independently optional fields, and the
@@ -451,6 +454,14 @@ export const agentProfileSchema = z
451
454
  first.model !== profile.model?.default) {
452
455
  context.addIssue({ code: "custom", path: ["seats", 0], message: "first seat must match profile harness, model.provider, and model.default" });
453
456
  }
457
+ if (first.tools !== undefined &&
458
+ canonicalAgentProfileJson(first.tools) !== canonicalAgentProfileJson(profile.tools)) {
459
+ context.addIssue({ code: "custom", path: ["seats", 0, "tools"], message: "first seat tools must match profile tools" });
460
+ }
461
+ if (first.permissions !== undefined &&
462
+ canonicalAgentProfileJson(first.permissions) !== canonicalAgentProfileJson(profile.permissions)) {
463
+ context.addIssue({ code: "custom", path: ["seats", 0, "permissions"], message: "first seat permissions must match profile permissions" });
464
+ }
454
465
  for (const [index, seat] of profile.seats.entries()) {
455
466
  const provider = resolveModelProvider(seat.model);
456
467
  if (provider !== seat.provider) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",