@tangle-network/agent-interface 2.14.0 → 2.16.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 +8 -0
- package/dist/environment-interactive-start.d.ts +1 -0
- package/dist/environment-interactive-start.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/native-session-event.d.ts +15 -0
- package/dist/native-session-event.js +14 -0
- package/dist/runtime-control.js +2 -0
- package/dist/stream-events.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -269,3 +269,11 @@ Repeated cumulative totals do not add spend.
|
|
|
269
269
|
An absent mode means the aggregation semantics are unknown.
|
|
270
270
|
Materialization receipts cover all three model token ceilings at their exact requested paths.
|
|
271
271
|
A strict profile rejects unsupported ceilings instead of silently accepting them.
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
### Native session observations
|
|
275
|
+
|
|
276
|
+
Adapters emit `native.session.observed` with `provider` and `nativeSessionId` after observing the provider conversation identity.
|
|
277
|
+
The execution owner binds the observation to its execution and keeps it private.
|
|
278
|
+
Public `session.updated` events retain their resume-key semantics and do not establish native identity.
|
|
279
|
+
Native identity does not establish artifact capture completeness.
|
|
@@ -220,6 +220,7 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
|
|
|
220
220
|
extensions: z.ZodOptional<z.ZodType<Record<string, Record<string, unknown> | undefined>, unknown, z.core.$ZodTypeInternals<Record<string, Record<string, unknown> | undefined>, unknown>>>;
|
|
221
221
|
}, z.core.$strict>;
|
|
222
222
|
requestedProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
223
|
+
authMode: z.ZodOptional<z.ZodLiteral<"oauth">>;
|
|
223
224
|
initialPrompt: z.ZodOptional<z.ZodString>;
|
|
224
225
|
cwd: z.ZodOptional<z.ZodString>;
|
|
225
226
|
cols: z.ZodOptional<z.ZodNumber>;
|
|
@@ -23,6 +23,8 @@ export const AgentInteractiveSessionStartSchema = z.strictObject({
|
|
|
23
23
|
run: AgentExactRunControlRefSchema,
|
|
24
24
|
profile: agentProfileSchema,
|
|
25
25
|
requestedProfileDigest: sha256DigestSchema,
|
|
26
|
+
// A provider-owned CLI login choice, never a credential or token.
|
|
27
|
+
authMode: z.literal("oauth").optional(),
|
|
26
28
|
initialPrompt: boundedStringSchema.optional(),
|
|
27
29
|
cwd: boundedStringSchema.min(1).optional(),
|
|
28
30
|
cols: interactiveDimensionSchema.optional(),
|
|
@@ -36,6 +38,9 @@ export function agentInteractiveSessionRequestDigest(coordinates, input) {
|
|
|
36
38
|
kind: "agent-interactive-session-start.v1",
|
|
37
39
|
run: exactCoordinates,
|
|
38
40
|
requestedProfileDigest: exactInput.requestedProfileDigest,
|
|
41
|
+
...(exactInput.authMode === undefined
|
|
42
|
+
? {}
|
|
43
|
+
: { authMode: exactInput.authMode }),
|
|
39
44
|
...(exactInput.initialPrompt === undefined
|
|
40
45
|
? {}
|
|
41
46
|
: { initialPrompt: exactInput.initialPrompt }),
|
|
@@ -60,6 +65,10 @@ export function exactAgentInteractiveSessionStart(value) {
|
|
|
60
65
|
if (parsed.profile.harness === undefined) {
|
|
61
66
|
throw new Error("interactive agent sessions require AgentProfile.harness");
|
|
62
67
|
}
|
|
68
|
+
if (parsed.authMode === "oauth" &&
|
|
69
|
+
parsed.profile.harness !== "claude-code") {
|
|
70
|
+
throw new Error("Claude Code OAuth mode requires the claude-code harness");
|
|
71
|
+
}
|
|
63
72
|
const digest = canonicalAgentProfileDigest(parsed.profile);
|
|
64
73
|
if (digest !== parsed.requestedProfileDigest) {
|
|
65
74
|
throw new Error("interactive agent session requested profile digest does not match its profile");
|
package/dist/index.d.ts
CHANGED
|
@@ -43,3 +43,4 @@ export * from "./profile-security.js";
|
|
|
43
43
|
export * from "./sandbox-size.js";
|
|
44
44
|
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";
|
|
45
45
|
export { AgentEnvironmentEgressPolicySchema } from "./environment-requests.js";
|
|
46
|
+
export * from "./native-session-event.js";
|
package/dist/index.js
CHANGED
|
@@ -45,3 +45,4 @@ export {
|
|
|
45
45
|
// does exactly that, after three bound mismatches shipped through it (agent-sdk#311, #312, #314).
|
|
46
46
|
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";
|
|
47
47
|
export { AgentEnvironmentEgressPolicySchema } from "./environment-requests.js";
|
|
48
|
+
export * from "./native-session-event.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Private adapter observation of a provider conversation or resume identity.
|
|
4
|
+
* The adapter must obtain this ID from its bound provider process or API.
|
|
5
|
+
* Caller keys, execution IDs, storage paths, and public session updates are not evidence.
|
|
6
|
+
* The execution owner binds this observation to its own execution and session.
|
|
7
|
+
* Public SSE and user-visible event streams must exclude this control event.
|
|
8
|
+
* An observation establishes identity only, not native artifact completeness.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NativeSessionObservedEventSchema: z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"native.session.observed">;
|
|
12
|
+
provider: z.ZodString;
|
|
13
|
+
nativeSessionId: z.ZodString;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type NativeSessionObservedEvent = z.infer<typeof NativeSessionObservedEventSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Private adapter observation of a provider conversation or resume identity.
|
|
4
|
+
* The adapter must obtain this ID from its bound provider process or API.
|
|
5
|
+
* Caller keys, execution IDs, storage paths, and public session updates are not evidence.
|
|
6
|
+
* The execution owner binds this observation to its own execution and session.
|
|
7
|
+
* Public SSE and user-visible event streams must exclude this control event.
|
|
8
|
+
* An observation establishes identity only, not native artifact completeness.
|
|
9
|
+
*/
|
|
10
|
+
export const NativeSessionObservedEventSchema = z.object({
|
|
11
|
+
type: z.literal("native.session.observed"),
|
|
12
|
+
provider: z.string().regex(/^[a-z][a-z0-9-]{0,127}$/),
|
|
13
|
+
nativeSessionId: z.string().min(1).max(512).regex(/^\S+$/u),
|
|
14
|
+
}).strict();
|
package/dist/runtime-control.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NativeSessionObservedEventSchema } from "./native-session-event.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { canonicalCandidateDigest, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
|
|
3
4
|
import { boundedEventContentJsonSchema, boundedEventContentRecordSchema, boundedEventContentStringSchema, boundedIdentifierSchema, boundedJsonRecordSchema, boundedStringSchema, isBoundedEventContentJson, } from "./contract-limits.js";
|
|
@@ -385,6 +386,7 @@ const CanonicalStreamEventUnionSchema = z.discriminatedUnion("type", [
|
|
|
385
386
|
backend: stableIdSchema,
|
|
386
387
|
event: boundedEventContentJsonSchema,
|
|
387
388
|
}),
|
|
389
|
+
NativeSessionObservedEventSchema,
|
|
388
390
|
z.strictObject({
|
|
389
391
|
type: z.literal("session.updated"),
|
|
390
392
|
sessionId: stableIdSchema,
|
package/dist/stream-events.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NativeSessionObservedEvent } from "./native-session-event.js";
|
|
1
2
|
import type { TokenUsage } from "./execution-types.js";
|
|
2
3
|
import type { InteractionRequest } from "./interaction.js";
|
|
3
4
|
import type { DurablePlan } from "./plan.js";
|
|
@@ -65,7 +66,7 @@ export type ChildTaskEvent = {
|
|
|
65
66
|
sourceEventId: string;
|
|
66
67
|
raw?: Record<string, unknown>;
|
|
67
68
|
};
|
|
68
|
-
export type StreamEvent = MessagePartUpdatedEvent | {
|
|
69
|
+
export type StreamEvent = NativeSessionObservedEvent | MessagePartUpdatedEvent | {
|
|
69
70
|
type: "tool-heartbeat";
|
|
70
71
|
toolName: string;
|
|
71
72
|
partId: string;
|