@tangle-network/agent-interface 5.10.16 → 5.10.18

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,8 +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
+ /** This stage's credential intent; omitted inherits profile.model.metadata.credentialSource (absent there means router). */
152
+ credentialSource?: "router" | "api-key" | "subscription" | "managed";
153
153
  /** Select all eligible accounts in account-manager order, or one named account. */
154
154
  selector: {
155
155
  kind: "all-eligible";
@@ -103,6 +103,8 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
103
103
  ultracode: "ultracode";
104
104
  }>>;
105
105
  credentialSource: z.ZodOptional<z.ZodEnum<{
106
+ router: "router";
107
+ "api-key": "api-key";
106
108
  subscription: "subscription";
107
109
  managed: "managed";
108
110
  }>>;
@@ -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";
@@ -127,6 +128,8 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
127
128
  ultracode: "ultracode";
128
129
  }>>;
129
130
  credentialSource: z.ZodOptional<z.ZodEnum<{
131
+ router: "router";
132
+ "api-key": "api-key";
130
133
  subscription: "subscription";
131
134
  managed: "managed";
132
135
  }>>;
@@ -540,6 +543,8 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
540
543
  ultracode: "ultracode";
541
544
  }>>;
542
545
  credentialSource: z.ZodOptional<z.ZodEnum<{
546
+ router: "router";
547
+ "api-key": "api-key";
543
548
  subscription: "subscription";
544
549
  managed: "managed";
545
550
  }>>;
@@ -1756,7 +1761,7 @@ export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
1756
1761
  stop: z.ZodBoolean;
1757
1762
  }, z.core.$strict>>;
1758
1763
  }, z.core.$strict>;
1759
- export interface CreateAgentEnvironmentInput {
1764
+ export interface CreateAgentEnvironmentInput extends AgentEnvironmentLifetime {
1760
1765
  profile: AgentProfileRef;
1761
1766
  /**
1762
1767
  * Runtime-owned execution inputs, separate from authored profile identity.
@@ -1813,7 +1818,6 @@ export interface CreateAgentEnvironmentInput {
1813
1818
  * When present, the provider must use this key as one idempotent operation:
1814
1819
  * the same key with canonically equal create input must return or reconstruct
1815
1820
  * the same environment, while a different input must be rejected.
1816
- * `signal` controls one attempt and is not part of create identity.
1817
1821
  */
1818
1822
  idempotencyKey?: string;
1819
1823
  signal?: AbortSignal;
@@ -2067,6 +2071,8 @@ export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
2067
2071
  ultracode: "ultracode";
2068
2072
  }>>;
2069
2073
  credentialSource: z.ZodOptional<z.ZodEnum<{
2074
+ router: "router";
2075
+ "api-key": "api-key";
2070
2076
  subscription: "subscription";
2071
2077
  managed: "managed";
2072
2078
  }>>;
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";
@@ -213,6 +213,8 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
213
213
  ultracode: "ultracode";
214
214
  }>>;
215
215
  credentialSource: z.ZodOptional<z.ZodEnum<{
216
+ router: "router";
217
+ "api-key": "api-key";
216
218
  subscription: "subscription";
217
219
  managed: "managed";
218
220
  }>>;
@@ -204,6 +204,8 @@ export declare const agentProfileSeatSchema: z.ZodObject<{
204
204
  ultracode: "ultracode";
205
205
  }>>;
206
206
  credentialSource: z.ZodOptional<z.ZodEnum<{
207
+ router: "router";
208
+ "api-key": "api-key";
207
209
  subscription: "subscription";
208
210
  managed: "managed";
209
211
  }>>;
@@ -574,6 +576,8 @@ export declare const agentProfileSchema: z.ZodObject<{
574
576
  ultracode: "ultracode";
575
577
  }>>;
576
578
  credentialSource: z.ZodOptional<z.ZodEnum<{
579
+ router: "router";
580
+ "api-key": "api-key";
577
581
  subscription: "subscription";
578
582
  managed: "managed";
579
583
  }>>;
@@ -114,7 +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
+ credentialSource: z.enum(["router", "api-key", "subscription", "managed"]).optional(),
118
118
  selector: z.union([
119
119
  z.strictObject({ kind: z.literal("all-eligible") }),
120
120
  z.strictObject({ kind: z.literal("seat"), id: z.string().min(1).refine((value) => value.trim() === value, "seat id must be canonical") }),
@@ -427,7 +427,7 @@ export const agentProfileSchema = z
427
427
  .superRefine((profile, context) => {
428
428
  validateNestedRecordKeys(profile, context, [], new Set());
429
429
  if (profile.seats?.length) {
430
- const first = profile.seats[0], source = profile.model?.metadata?.credentialSource ?? "managed";
430
+ const first = profile.seats[0], source = profile.model?.metadata?.credentialSource ?? "router";
431
431
  if (first.harness !== profile.harness || first.provider !== profile.model?.provider ||
432
432
  first.model !== profile.model?.default) {
433
433
  context.addIssue({ code: "custom", path: ["seats", 0], message: "first seat must match profile harness, model.provider, and model.default" });
@@ -435,7 +435,10 @@ export const agentProfileSchema = z
435
435
  if (first.reasoningEffort !== undefined && first.reasoningEffort !== profile.model?.reasoningEffort) {
436
436
  context.addIssue({ code: "custom", path: ["seats", 0, "reasoningEffort"], message: "first seat reasoningEffort must match profile model.reasoningEffort" });
437
437
  }
438
- if ((first.credentialSource ?? source) !== source) {
438
+ // `managed` is the deprecated spelling of `router`: an authored profile may still carry
439
+ // either, and the two agree wherever the default would apply (#440).
440
+ const spell = (value) => (value === "managed" ? "router" : value);
441
+ if ((first.credentialSource ?? source) !== source && spell(first.credentialSource) !== spell(source)) {
439
442
  context.addIssue({ code: "custom", path: ["seats", 0, "credentialSource"], message: "first seat credentialSource must match profile model.metadata.credentialSource" });
440
443
  }
441
444
  if (first.tools !== undefined &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "5.10.16",
3
+ "version": "5.10.18",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",