@tangle-network/agent-interface 2.6.1 → 2.8.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.
@@ -1512,7 +1512,7 @@ export declare const AgentInteractiveSessionPromptCommandSchema: z.ZodObject<{
1512
1512
  holderId: z.ZodString;
1513
1513
  expiresAt: z.ZodISODateTime;
1514
1514
  }, z.core.$strict>;
1515
- prompt: z.ZodString;
1515
+ prompt: z.ZodCustom<string, string>;
1516
1516
  requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
1517
1517
  }, z.core.$strict>;
1518
1518
  export interface AgentInteractiveSessionPromptAcknowledgement {
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { canonicalCandidateDigest, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
3
3
  import { agentExecutionPreparationReceiptSchema, } from "./agent-execution-preparation-receipt.js";
4
- import { boundedIdentifierSchema, boundedStringSchema, } from "./contract-limits.js";
4
+ import { boundedIdentifierSchema, boundedEventContentStringSchema, boundedStringSchema, } from "./contract-limits.js";
5
5
  import { agentInteractiveDimensionSchema as interactiveDimensionSchema, sameAgentExactRun as sameExactRun, } from "./environment-interactive-shared.js";
6
6
  import { AgentExactRunControlRefSchema } from "./runtime-control.js";
7
7
  /**
@@ -348,7 +348,13 @@ const AgentInteractiveSessionPromptCommandMaterialSchema = z
348
348
  operationId: boundedIdentifierSchema,
349
349
  ref: AgentInteractiveSessionRefSchema,
350
350
  control: AgentInteractiveSessionControlClaimSchema,
351
- prompt: boundedStringSchema.min(1),
351
+ // Content, not metadata: see environment-runtime.ts.
352
+ // Content, not metadata: see environment-runtime.ts. `boundedEventContentStringSchema` is a
353
+ // custom schema and carries no `.min`, so the non-empty requirement is kept as a refinement —
354
+ // an interactive prompt with nothing in it is still refused.
355
+ prompt: boundedEventContentStringSchema.refine((value) => value.length >= 1, {
356
+ message: "interactive prompt must not be empty",
357
+ }),
352
358
  })
353
359
  .superRefine((command, refinement) => {
354
360
  if (!agentInteractiveSessionControlClaimMatchesRef(command.ref, command.control)) {
@@ -38,7 +38,7 @@ export interface AgentTurnInput {
38
38
  providerOptions?: Record<string, unknown>;
39
39
  }
40
40
  export declare const AgentTurnInputSchema: z.ZodObject<{
41
- prompt: z.ZodOptional<z.ZodString>;
41
+ prompt: z.ZodOptional<z.ZodCustom<string, string>>;
42
42
  parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
43
43
  type: z.ZodLiteral<"text">;
44
44
  text: z.ZodString;
@@ -9,7 +9,12 @@ import { boundedEventContentJsonSchema, boundedEventContentRecordSchema, bounded
9
9
  import { InputPartSchema } from "./portable-context-shared.js";
10
10
  import { deepFreeze } from "./deep-freeze.js";
11
11
  export const AgentTurnInputSchema = z.strictObject({
12
- prompt: boundedStringSchema.optional(),
12
+ // A prompt is what the agent is asked to do, so it is CONTENT: its size is set by the work,
13
+ // not by the protocol. Held to the metadata bound it capped a manager's brief at 16,384
14
+ // characters, which refused a director handing a checker a 27 KB patch to re-verify a measured
15
+ // result (agent-sdk#313). Refusal is still right here — a silently shortened instruction is
16
+ // worse than none — so only the ceiling moves.
17
+ prompt: boundedEventContentStringSchema.optional(),
13
18
  parts: z.array(InputPartSchema).max(CONTRACT_MAX_ARRAY_LENGTH).optional(),
14
19
  sessionId: boundedIdentifierSchema.optional(),
15
20
  model: boundedIdentifierSchema.optional(),
package/dist/index.d.ts CHANGED
@@ -40,5 +40,5 @@ export * from "./harness-capabilities.js";
40
40
  export * from "./profile-schema.js";
41
41
  export * from "./profile-security.js";
42
42
  export * from "./sandbox-size.js";
43
- export { CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, CONTRACT_MAX_JSON_BYTES, boundedEventContentJsonSchema, boundedEventContentRecordSchema, boundedEventContentStringSchema, isBoundedEventContentJson, } from "./contract-limits.js";
43
+ export { CONTRACT_MAX_ARRAY_LENGTH, CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, CONTRACT_MAX_IDENTIFIER_LENGTH, CONTRACT_MAX_JSON_BYTES, CONTRACT_MAX_JSON_DEPTH, CONTRACT_MAX_JSON_NODES, CONTRACT_MAX_MAP_ENTRIES, CONTRACT_MAX_STRING_LENGTH, boundedEventContentJsonSchema, boundedEventContentRecordSchema, boundedEventContentStringSchema, isBoundedEventContentJson, } from "./contract-limits.js";
44
44
  export { AgentEnvironmentEgressPolicySchema } from "./environment-requests.js";
package/dist/index.js CHANGED
@@ -38,5 +38,9 @@ export * from "./harness-capabilities.js";
38
38
  export * from "./profile-schema.js";
39
39
  export * from "./profile-security.js";
40
40
  export * from "./sandbox-size.js";
41
- export { CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, CONTRACT_MAX_JSON_BYTES, boundedEventContentJsonSchema, boundedEventContentRecordSchema, boundedEventContentStringSchema, isBoundedEventContentJson, } from "./contract-limits.js";
41
+ export {
42
+ // Every bound a consumer may be asked to honour is public, so a package that WRITES values
43
+ // this contract validates can assert its own limits fit — the seam test in agent-provider-tangle
44
+ // does exactly that, after three bound mismatches shipped through it (agent-sdk#311, #312, #314).
45
+ CONTRACT_MAX_ARRAY_LENGTH, CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, CONTRACT_MAX_IDENTIFIER_LENGTH, CONTRACT_MAX_JSON_BYTES, CONTRACT_MAX_JSON_DEPTH, CONTRACT_MAX_JSON_NODES, CONTRACT_MAX_MAP_ENTRIES, CONTRACT_MAX_STRING_LENGTH, boundedEventContentJsonSchema, boundedEventContentRecordSchema, boundedEventContentStringSchema, isBoundedEventContentJson, } from "./contract-limits.js";
42
46
  export { AgentEnvironmentEgressPolicySchema } from "./environment-requests.js";
@@ -62,7 +62,7 @@ export interface NativeContextContinuationTurn {
62
62
  providerOptions?: Record<string, unknown>;
63
63
  }
64
64
  export declare const NativeContextContinuationTurnSchema: z.ZodObject<{
65
- prompt: z.ZodOptional<z.ZodString>;
65
+ prompt: z.ZodOptional<z.ZodCustom<string, string>>;
66
66
  parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
67
67
  type: z.ZodLiteral<"text">;
68
68
  text: z.ZodString;
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { AgentExactRunControlRefSchema, } from "./runtime-control.js";
3
3
  import { idSchema, InputPartSchema, jsonRecordSchema, sha256DigestSchema, wireDigest } from "./portable-context-shared.js";
4
- import { boundedStringSchema, CONTRACT_MAX_ARRAY_LENGTH } from "./contract-limits.js";
4
+ import { boundedEventContentStringSchema, boundedStringSchema, CONTRACT_MAX_ARRAY_LENGTH } from "./contract-limits.js";
5
5
  export const NativeContextBoundarySchema = z
6
6
  .discriminatedUnion("kind", [
7
7
  z.strictObject({ kind: z.literal("token"), token: idSchema }),
@@ -40,7 +40,8 @@ const NativeContextContinuationRequestMaterialSchema = z.strictObject({
40
40
  expectedBoundary: NativeContextBoundaryProofSchema,
41
41
  });
42
42
  export const NativeContextContinuationTurnSchema = z.strictObject({
43
- prompt: boundedStringSchema.optional(),
43
+ // Content, not metadata: see environment-runtime.ts.
44
+ prompt: boundedEventContentStringSchema.optional(),
44
45
  parts: z.array(InputPartSchema).max(CONTRACT_MAX_ARRAY_LENGTH).optional(),
45
46
  model: idSchema.optional(),
46
47
  context: jsonRecordSchema.optional(),
@@ -268,7 +268,8 @@ const partSchema = z.discriminatedUnion("type", [
268
268
  z.strictObject({
269
269
  ...partBase,
270
270
  type: z.literal("subtask"),
271
- prompt: boundedStringSchema,
271
+ // Content, not metadata: see environment-runtime.ts.
272
+ prompt: boundedEventContentStringSchema,
272
273
  description: boundedStringSchema,
273
274
  agent: stableIdSchema,
274
275
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "2.6.1",
3
+ "version": "2.8.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",