@tangle-network/agent-interface 0.52.0 → 0.53.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.
package/README.md
CHANGED
|
@@ -17,6 +17,9 @@ Metadata can include caller-authored values and does not prove authorization or
|
|
|
17
17
|
Its acknowledgement repeats the operation, digest, and run coordinates and distinguishes a known cancellation effect from conflict or unknown state.
|
|
18
18
|
|
|
19
19
|
An environment advertises `interactions` only when it can originate and answer typed requests.
|
|
20
|
+
`RequestedInteractions` defines the strict per-turn posture for `permission`, `question`, and `plan` requests.
|
|
21
|
+
`AgentTurnInput.interactions` and `AgentExecutionInput.interactions` carry that posture through shared execution boundaries.
|
|
22
|
+
An omitted posture leaves provider defaults unchanged, while an empty object enables no interaction kind for that turn.
|
|
20
23
|
`AgentEnvironmentCapabilitiesSchema` strictly validates the complete capability document at runtime, including all-or-nothing durable branching declarations.
|
|
21
24
|
Optional provider methods must be absent when their capability is false so clients cannot expose an action the provider has denied.
|
|
22
25
|
The capability names supported request kinds, answer field types, response scopes, secret answers, concurrency, replay, and response idempotency.
|
|
@@ -3,7 +3,7 @@ import type { AgentProfileCapabilities, AgentProfileValidationResult } from "./a
|
|
|
3
3
|
import type { InputPart } from "./parts.js";
|
|
4
4
|
import type { StreamEvent } from "./stream-events.js";
|
|
5
5
|
import type { TokenUsage } from "./execution-types.js";
|
|
6
|
-
import { type InteractionAcknowledgement, type InteractionCapabilities, type InteractionResponseCommand } from "./interaction.js";
|
|
6
|
+
import { type InteractionAcknowledgement, type InteractionCapabilities, type InteractionResponseCommand, type RequestedInteractions } from "./interaction.js";
|
|
7
7
|
import { type ContextTransferReceipt, type ContextTransferRequest, type NativeContextBoundaryProof, type NativeContextContinuationRequest, type NativeContextContinuationTurn } from "./portable-context.js";
|
|
8
8
|
import { type AgentRunCancellationAcknowledgement, type AgentRunCancellationRequest, type AgentRunControlRef } from "./runtime-control.js";
|
|
9
9
|
import type { AgentWorkspaceBranching } from "./workspace-branching.js";
|
|
@@ -28,6 +28,8 @@ export interface AgentTurnInput {
|
|
|
28
28
|
/** Verified same-session continuation; never carries duplicate history. */
|
|
29
29
|
nativeContinuation?: NativeContextContinuationRequest;
|
|
30
30
|
context?: Record<string, unknown>;
|
|
31
|
+
/** Interaction kinds the provider may originate for this turn. */
|
|
32
|
+
interactions?: RequestedInteractions;
|
|
31
33
|
signal?: AbortSignal;
|
|
32
34
|
providerOptions?: Record<string, unknown>;
|
|
33
35
|
}
|
|
@@ -235,6 +237,11 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
|
|
|
235
237
|
}, z.core.$strict>;
|
|
236
238
|
}, z.core.$strict>>;
|
|
237
239
|
context: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
240
|
+
interactions: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
permission: z.ZodOptional<z.ZodBoolean>;
|
|
242
|
+
question: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
+
plan: z.ZodOptional<z.ZodBoolean>;
|
|
244
|
+
}, z.core.$strict>>;
|
|
238
245
|
signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
|
|
239
246
|
providerOptions: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
240
247
|
}, z.core.$strict>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { InteractionCapabilitiesSchema } from "./interaction.js";
|
|
2
|
+
import { InteractionCapabilitiesSchema, RequestedInteractionsSchema } from "./interaction.js";
|
|
3
3
|
import { ContextTransferReceiptSchema, ContextTransferRequestSchema, NativeContextContinuationAcknowledgementSchema, NativeContextContinuationRequestSchema, nativeContextContinuationAcknowledgementMatches } from "./portable-context.js";
|
|
4
4
|
import { AgentExactRunControlRefSchema, AgentRunControlRefSchema, CanonicalStreamEventSchema } from "./runtime-control.js";
|
|
5
5
|
import { AgentProfileCapabilitiesSchema } from "./environment-profile-capabilities.js";
|
|
@@ -19,6 +19,7 @@ export const AgentTurnInputSchema = z.strictObject({
|
|
|
19
19
|
contextTransfer: ContextTransferRequestSchema.optional(),
|
|
20
20
|
nativeContinuation: NativeContextContinuationRequestSchema.optional(),
|
|
21
21
|
context: boundedJsonRecordSchema.optional(),
|
|
22
|
+
interactions: RequestedInteractionsSchema.optional(),
|
|
22
23
|
signal: z.custom().optional(),
|
|
23
24
|
providerOptions: boundedJsonRecordSchema.optional(),
|
|
24
25
|
});
|
|
@@ -2,6 +2,7 @@ import type { AgentExecutionOutcome, PlanContinuation } from "./plan.js";
|
|
|
2
2
|
import type { InputPart } from "./parts.js";
|
|
3
3
|
import type { ProviderConfig } from "./provider-config.js";
|
|
4
4
|
import type { InteractionExecutionBinding } from "./interaction-envelope.js";
|
|
5
|
+
import type { RequestedInteractions } from "./interaction-permissions.js";
|
|
5
6
|
export type ToolInvocation = {
|
|
6
7
|
toolName: string;
|
|
7
8
|
input: unknown;
|
|
@@ -31,6 +32,8 @@ export type AgentExecutionInput = {
|
|
|
31
32
|
sessionId?: string;
|
|
32
33
|
/** Exact run coordinates required when this turn can emit interactions. */
|
|
33
34
|
interactionBinding?: InteractionExecutionBinding;
|
|
35
|
+
/** Interaction kinds the provider may originate for this turn. */
|
|
36
|
+
interactions?: RequestedInteractions;
|
|
34
37
|
workspaceRoot?: string;
|
|
35
38
|
abortSignal?: AbortSignal;
|
|
36
39
|
headers?: Record<string, string>;
|
|
@@ -9,6 +9,18 @@ export declare const InteractionKind: {
|
|
|
9
9
|
readonly Plan: "plan";
|
|
10
10
|
};
|
|
11
11
|
export type WellKnownInteractionKind = (typeof InteractionKind)[keyof typeof InteractionKind];
|
|
12
|
+
/** Interaction kinds a provider may originate for one turn. */
|
|
13
|
+
export type RequestedInteractions = {
|
|
14
|
+
[InteractionKind.Permission]?: boolean;
|
|
15
|
+
[InteractionKind.Question]?: boolean;
|
|
16
|
+
[InteractionKind.Plan]?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/** Strict per-turn interaction posture; an empty object enables no kinds. */
|
|
19
|
+
export declare const RequestedInteractionsSchema: z.ZodObject<{
|
|
20
|
+
permission: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
question: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
plan: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
}, z.core.$strict>;
|
|
12
24
|
/** Field name carrying the grant on a `permission` interaction's response. */
|
|
13
25
|
export declare const PERMISSION_GRANT_FIELD = "grant";
|
|
14
26
|
/** Optional free-text field carrying the user's reason on a `permission` response. */
|
|
@@ -10,6 +10,12 @@ export const InteractionKind = {
|
|
|
10
10
|
/** Agent shares a plan/todo list for review/approval. */
|
|
11
11
|
Plan: "plan",
|
|
12
12
|
};
|
|
13
|
+
/** Strict per-turn interaction posture; an empty object enables no kinds. */
|
|
14
|
+
export const RequestedInteractionsSchema = z.strictObject({
|
|
15
|
+
[InteractionKind.Permission]: z.boolean().optional(),
|
|
16
|
+
[InteractionKind.Question]: z.boolean().optional(),
|
|
17
|
+
[InteractionKind.Plan]: z.boolean().optional(),
|
|
18
|
+
});
|
|
13
19
|
/** Field name carrying the grant on a `permission` interaction's response. */
|
|
14
20
|
export const PERMISSION_GRANT_FIELD = "grant";
|
|
15
21
|
/** Optional free-text field carrying the user's reason on a `permission` response. */
|