@tangle-network/agent-interface 5.10.15 → 5.10.17

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.
@@ -148,6 +148,8 @@ export interface AgentProfileSeat {
148
148
  model: string;
149
149
  /** Override profile.model.reasoningEffort for this stage; omission inherits, none disables thinking. */
150
150
  reasoningEffort?: ReasoningEffort;
151
+ /** This stage's credential intent; omitted inherits profile.model.metadata.credentialSource (absent there means managed). */
152
+ credentialSource?: "subscription" | "managed";
151
153
  /** Select all eligible accounts in account-manager order, or one named account. */
152
154
  selector: {
153
155
  kind: "all-eligible";
@@ -79,7 +79,6 @@ type WithDigest<Material> = Material extends unknown ? Material & {
79
79
  /** Self-hashed public projection. Private authorization and durable state stay out. */
80
80
  export type AgentWorkspaceLeaseRecord = WithDigest<AgentWorkspaceLeaseRecordMaterial>;
81
81
  export type AgentWorkspaceSealedLeaseRecord = WithDigest<AgentWorkspaceSealedLeaseRecordMaterial>;
82
- export type AgentWorkspaceExecutionBoundLeaseRecord = WithDigest<AgentWorkspaceExecutionBoundLeaseRecordMaterial>;
83
82
  export declare const agentWorkspaceLeasePhaseSchema: z.ZodEnum<{
84
83
  "copy-ready": "copy-ready";
85
84
  "workspace-sealed": "workspace-sealed";
@@ -102,6 +102,10 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
102
102
  xhigh: "xhigh";
103
103
  ultracode: "ultracode";
104
104
  }>>;
105
+ credentialSource: z.ZodOptional<z.ZodEnum<{
106
+ subscription: "subscription";
107
+ managed: "managed";
108
+ }>>;
105
109
  selector: z.ZodUnion<readonly [z.ZodObject<{
106
110
  kind: z.ZodLiteral<"all-eligible">;
107
111
  }, z.core.$strict>, z.ZodObject<{
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Lifecycle bounds a caller may place on one environment create (#309).
3
+ *
4
+ * Both are whole seconds — a millisecond value that is not a whole second is
5
+ * refused, so a caller never believes a sub-second bound was honored. A
6
+ * provider that cannot enforce a requested bound fails the create rather than
7
+ * dropping the field; one whose platform caps the value honors the shorter.
8
+ */
9
+ export interface AgentEnvironmentLifetime {
10
+ /** Hard wall-clock lifetime the environment cannot outlive, counted from the create. */
11
+ maxLifetimeMs?: number;
12
+ /** After this long with no caller activity the platform may suspend or stop the environment. */
13
+ idleTimeoutMs?: number;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { type ProxySecretBinding, type ProxySecretCapabilities, type ProxySecretReceipt, type ProxySecretParents } from "./proxy-secrets.js";
3
3
  import type { AgentRuntimeAttachments } from "./runtime-attachments.js";
4
+ import type { AgentEnvironmentLifetime } from "./environment-lifetime.js";
4
5
  export { AgentRuntimeAttachmentsSchema, type AgentRuntimeAttachments } from "./runtime-attachments.js";
5
6
  import type { AgentCandidateArtifactPort, Sha256Digest } from "./agent-candidate.js";
6
7
  import type { AgentProfile, AgentProfileCapabilities, AgentProfileValidationResult } from "./agent-profile.js";
@@ -126,6 +127,10 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
126
127
  xhigh: "xhigh";
127
128
  ultracode: "ultracode";
128
129
  }>>;
130
+ credentialSource: z.ZodOptional<z.ZodEnum<{
131
+ subscription: "subscription";
132
+ managed: "managed";
133
+ }>>;
129
134
  selector: z.ZodUnion<readonly [z.ZodObject<{
130
135
  kind: z.ZodLiteral<"all-eligible">;
131
136
  }, z.core.$strict>, z.ZodObject<{
@@ -535,6 +540,10 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
535
540
  xhigh: "xhigh";
536
541
  ultracode: "ultracode";
537
542
  }>>;
543
+ credentialSource: z.ZodOptional<z.ZodEnum<{
544
+ subscription: "subscription";
545
+ managed: "managed";
546
+ }>>;
538
547
  selector: z.ZodUnion<readonly [z.ZodObject<{
539
548
  kind: z.ZodLiteral<"all-eligible">;
540
549
  }, z.core.$strict>, z.ZodObject<{
@@ -1748,7 +1757,7 @@ export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
1748
1757
  stop: z.ZodBoolean;
1749
1758
  }, z.core.$strict>>;
1750
1759
  }, z.core.$strict>;
1751
- export interface CreateAgentEnvironmentInput {
1760
+ export interface CreateAgentEnvironmentInput extends AgentEnvironmentLifetime {
1752
1761
  profile: AgentProfileRef;
1753
1762
  /**
1754
1763
  * Runtime-owned execution inputs, separate from authored profile identity.
@@ -1805,7 +1814,6 @@ export interface CreateAgentEnvironmentInput {
1805
1814
  * When present, the provider must use this key as one idempotent operation:
1806
1815
  * the same key with canonically equal create input must return or reconstruct
1807
1816
  * the same environment, while a different input must be rejected.
1808
- * `signal` controls one attempt and is not part of create identity.
1809
1817
  */
1810
1818
  idempotencyKey?: string;
1811
1819
  signal?: AbortSignal;
@@ -2058,6 +2066,10 @@ export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
2058
2066
  xhigh: "xhigh";
2059
2067
  ultracode: "ultracode";
2060
2068
  }>>;
2069
+ credentialSource: z.ZodOptional<z.ZodEnum<{
2070
+ subscription: "subscription";
2071
+ managed: "managed";
2072
+ }>>;
2061
2073
  selector: z.ZodUnion<readonly [z.ZodObject<{
2062
2074
  kind: z.ZodLiteral<"all-eligible">;
2063
2075
  }, z.core.$strict>, z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./host-services.js";
9
9
  export * from "./mcp.js";
10
10
  export * from "./provider-adapter.js";
11
11
  export type * from "./environment-provider.js";
12
+ export type { AgentEnvironmentLifetime } from "./environment-lifetime.js";
12
13
  export { AgentEnvironmentCapabilitiesSchema, AgentEnvironmentReadOnlyGetOptionsSchema, AgentRuntimeAttachmentsSchema, AgentNativeContextContinuationAdmissionSchema, AgentNativeContextContinuationResultSchema, AgentTurnInputSchema, AgentTurnResultSchema, agentEnvironmentCreateInputDigest, agentNativeContextContinuationAdmissionMatchesRequest, agentNativeContextContinuationResultMatchesRequest, AccountUsageSchema, AgentEnvironmentObservationSchema, AgentEnvironmentStatusSchema, ComputeBillingSchema, EnvironmentLifecycleSchema, ModelUsageSchema, ObservationProvenanceSchema, PlacementDescriptorSchema, ProviderIdentitySchema, ResourceProfileSchema, ResourceUseSampleSchema, SafeEndpointSchema, agentEnvironmentObservationIdentityMatches, observationContainsCredential, observationOf, AgentInteractiveSessionAttachSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimRequestSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionPromptCommandSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStartSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentInteractiveSessionStopCommandSchema, AgentInteractiveSessionStatusSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimRequestDigest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionControlClaimIsNewer, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionPromptRequestDigest, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentInteractiveSessionStopRequestDigest, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, exactAgentInteractiveSessionStart, createAgentEnvironmentWithIdempotency, canonicalWorkspaceCwd, MAX_WORKSPACE_CWD_LENGTH, workspaceCwdSchema, workspaceCwdPathForBase, WorkspaceRequestSchema, ResourceRequestSchema, TerminalAttachRequestSchema, TerminalAttachResultSchema, TerminalDetachAckSchema, TerminalInputSchema, TerminalOutputEventSchema, TerminalReplayWindowSchema, TerminalResizeSchema, TerminalSessionRefSchema, terminalAttachResultMatchesRequest, terminalSessionUsable, } from "./environment-provider.js";
13
14
  export * from "./environment-provider-error.js";
14
15
  export * from "./plan.js";
@@ -55,7 +55,6 @@ export declare const AgentLearningFileSchema: z.ZodObject<{
55
55
  trust: z.ZodLiteral<"untrusted">;
56
56
  }, z.core.$strict>;
57
57
  }, z.core.$strict>;
58
- export type AgentLearningFile = z.infer<typeof AgentLearningFileSchema>;
59
58
  /** A host-resolved reference to exact native state, never a path or credential value. */
60
59
  export declare const AgentLearningNativeRefSchema: z.ZodObject<{
61
60
  harness: z.ZodEnum<{
@@ -82,7 +81,6 @@ export declare const AgentLearningNativeRefSchema: z.ZodObject<{
82
81
  reference: z.ZodString;
83
82
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
84
83
  }, z.core.$strict>;
85
- export type AgentLearningNativeRef = z.infer<typeof AgentLearningNativeRefSchema>;
86
84
  declare const materialSchema: z.ZodObject<{
87
85
  version: z.ZodLiteral<1>;
88
86
  identity: z.ZodObject<{
@@ -212,6 +212,10 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
212
212
  xhigh: "xhigh";
213
213
  ultracode: "ultracode";
214
214
  }>>;
215
+ credentialSource: z.ZodOptional<z.ZodEnum<{
216
+ subscription: "subscription";
217
+ managed: "managed";
218
+ }>>;
215
219
  selector: z.ZodUnion<readonly [z.ZodObject<{
216
220
  kind: z.ZodLiteral<"all-eligible">;
217
221
  }, z.core.$strict>, z.ZodObject<{
@@ -203,6 +203,10 @@ export declare const agentProfileSeatSchema: z.ZodObject<{
203
203
  xhigh: "xhigh";
204
204
  ultracode: "ultracode";
205
205
  }>>;
206
+ credentialSource: z.ZodOptional<z.ZodEnum<{
207
+ subscription: "subscription";
208
+ managed: "managed";
209
+ }>>;
206
210
  selector: z.ZodUnion<readonly [z.ZodObject<{
207
211
  kind: z.ZodLiteral<"all-eligible">;
208
212
  }, z.core.$strict>, z.ZodObject<{
@@ -569,6 +573,10 @@ export declare const agentProfileSchema: z.ZodObject<{
569
573
  xhigh: "xhigh";
570
574
  ultracode: "ultracode";
571
575
  }>>;
576
+ credentialSource: z.ZodOptional<z.ZodEnum<{
577
+ subscription: "subscription";
578
+ managed: "managed";
579
+ }>>;
572
580
  selector: z.ZodUnion<readonly [z.ZodObject<{
573
581
  kind: z.ZodLiteral<"all-eligible">;
574
582
  }, z.core.$strict>, z.ZodObject<{
@@ -114,6 +114,7 @@ export const agentProfileSeatSchema = z.strictObject({
114
114
  provider: z.string().regex(/^[a-z][a-z0-9-]*$/),
115
115
  model: z.string().min(1).refine((value) => value.trim() === value, "model must be canonical"),
116
116
  reasoningEffort: reasoningEffortSchema.optional(),
117
+ credentialSource: z.enum(["subscription", "managed"]).optional(),
117
118
  selector: z.union([
118
119
  z.strictObject({ kind: z.literal("all-eligible") }),
119
120
  z.strictObject({ kind: z.literal("seat"), id: z.string().min(1).refine((value) => value.trim() === value, "seat id must be canonical") }),
@@ -426,7 +427,7 @@ export const agentProfileSchema = z
426
427
  .superRefine((profile, context) => {
427
428
  validateNestedRecordKeys(profile, context, [], new Set());
428
429
  if (profile.seats?.length) {
429
- const first = profile.seats[0];
430
+ const first = profile.seats[0], source = profile.model?.metadata?.credentialSource ?? "managed";
430
431
  if (first.harness !== profile.harness || first.provider !== profile.model?.provider ||
431
432
  first.model !== profile.model?.default) {
432
433
  context.addIssue({ code: "custom", path: ["seats", 0], message: "first seat must match profile harness, model.provider, and model.default" });
@@ -434,6 +435,9 @@ export const agentProfileSchema = z
434
435
  if (first.reasoningEffort !== undefined && first.reasoningEffort !== profile.model?.reasoningEffort) {
435
436
  context.addIssue({ code: "custom", path: ["seats", 0, "reasoningEffort"], message: "first seat reasoningEffort must match profile model.reasoningEffort" });
436
437
  }
438
+ if ((first.credentialSource ?? source) !== source) {
439
+ context.addIssue({ code: "custom", path: ["seats", 0, "credentialSource"], message: "first seat credentialSource must match profile model.metadata.credentialSource" });
440
+ }
437
441
  if (first.tools !== undefined &&
438
442
  canonicalAgentProfileJson(first.tools) !== canonicalAgentProfileJson(profile.tools)) {
439
443
  context.addIssue({ code: "custom", path: ["seats", 0, "tools"], message: "first seat tools must match profile tools" });
@@ -88,8 +88,6 @@ export declare const ProxySecretParentsSchema: z.ZodType<Record<string, string |
88
88
  export type ProxySecretParents = z.infer<typeof ProxySecretParentsSchema>;
89
89
  /** Shape and totality only; the API verifies issuer authority and durable immutable pins. */
90
90
  export declare function isProxySecretParentsTotal(bindings: readonly ProxySecretBinding[], parents: unknown): parents is ProxySecretParents;
91
- /** API control-plane support; intentionally separate from the engine capability contract. */
92
- export declare const ProxySecretDelegationCapabilitySchema: z.ZodLiteral<1>;
93
91
  export declare const ProxySecretResolvedIdentitySchema: z.ZodObject<{
94
92
  tenantId: z.ZodString;
95
93
  issuerId: z.ZodString;
@@ -63,8 +63,6 @@ export function isProxySecretParentsTotal(bindings, parents) {
63
63
  return selection.success && parsed.success && Object.keys(parsed.data).length === selection.data.length &&
64
64
  selection.data.every((binding) => Object.hasOwn(parsed.data, binding.envName));
65
65
  }
66
- /** API control-plane support; intentionally separate from the engine capability contract. */
67
- export const ProxySecretDelegationCapabilitySchema = z.literal(1);
68
66
  export const ProxySecretResolvedIdentitySchema = z.strictObject({
69
67
  tenantId: boundedIdentifierSchema, issuerId: boundedIdentifierSchema,
70
68
  secretId: boundedIdentifierSchema, revision: boundedIdentifierSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "5.10.15",
3
+ "version": "5.10.17",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",