@tangle-network/agent-interface 0.9.0 → 0.10.1

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.
@@ -94,7 +94,7 @@ export interface AgentProfileResources {
94
94
  * - `ultracode` — maximum (claude-code's "ultracode" run mode; codex's `max` reconciles here).
95
95
  * A backend without a matching native tier clamps to its nearest (e.g. codex maps `xhigh`/`ultracode` → `high`).
96
96
  */
97
- export type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'ultracode';
97
+ export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
98
98
  /**
99
99
  * Model selection hints for backends.
100
100
  */
@@ -200,6 +200,25 @@ export interface AgentProfileMcpServer {
200
200
  enabled?: boolean;
201
201
  metadata?: Record<string, unknown>;
202
202
  }
203
+ /**
204
+ * Hub-managed integration grant. The sandbox runtime resolves each declared
205
+ * connection/capability pair into an MCP tool backed by Tangle Hub policy.
206
+ */
207
+ export interface AgentProfileConnection {
208
+ /**
209
+ * Hub connection id selected by the user, for example a connected Gmail
210
+ * account.
211
+ */
212
+ connectionId: string;
213
+ /**
214
+ * Capability paths explicitly granted to the agent.
215
+ */
216
+ capabilities: string[];
217
+ /**
218
+ * Optional MCP server alias. Must be unique after profile merge.
219
+ */
220
+ alias?: string;
221
+ }
203
222
  /**
204
223
  * Public provider-neutral agent profile contract.
205
224
  */
@@ -213,6 +232,7 @@ export interface AgentProfile {
213
232
  permissions?: Record<string, AgentProfilePermission>;
214
233
  tools?: Record<string, boolean>;
215
234
  mcp?: Record<string, AgentProfileMcpServer>;
235
+ connections?: AgentProfileConnection[];
216
236
  subagents?: Record<string, AgentSubagentProfile>;
217
237
  resources?: AgentProfileResources;
218
238
  hooks?: Record<string, AgentProfileHookCommand[]>;
@@ -43,6 +43,11 @@ function mergeRecord(base, overlay) {
43
43
  ...(overlay ?? {}),
44
44
  };
45
45
  }
46
+ function mergeOptionalArrays(base, overlay) {
47
+ if (!base && !overlay)
48
+ return undefined;
49
+ return [...(base ?? []), ...(overlay ?? [])];
50
+ }
46
51
  /**
47
52
  * Merge two public AgentProfile values.
48
53
  *
@@ -92,6 +97,7 @@ export function mergeAgentProfiles(base, overlay) {
92
97
  permissions: mergeRecord(base?.permissions, overlay?.permissions),
93
98
  tools: mergeRecord(base?.tools, overlay?.tools),
94
99
  mcp: mergeRecord(base?.mcp, overlay?.mcp),
100
+ connections: mergeOptionalArrays(base?.connections, overlay?.connections),
95
101
  subagents: mergeRecord(base?.subagents, overlay?.subagents),
96
102
  resources: mergedResources,
97
103
  hooks: mergeRecord(base?.hooks, overlay?.hooks),
@@ -192,6 +192,11 @@ export declare const agentProfileMcpServerSchema: z.ZodObject<{
192
192
  enabled: z.ZodOptional<z.ZodBoolean>;
193
193
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
194
194
  }, z.core.$strip>;
195
+ export declare const agentProfileConnectionSchema: z.ZodObject<{
196
+ connectionId: z.ZodString;
197
+ capabilities: z.ZodArray<z.ZodString>;
198
+ alias: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strip>;
195
200
  /**
196
201
  * The complete provider-neutral agent profile schema — the runtime validator for
197
202
  * the canonical {@link AgentProfile} TS contract. Kept structurally in lock-step
@@ -246,6 +251,11 @@ export declare const agentProfileSchema: z.ZodObject<{
246
251
  enabled: z.ZodOptional<z.ZodBoolean>;
247
252
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
248
253
  }, z.core.$strip>>>;
254
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
255
+ connectionId: z.ZodString;
256
+ capabilities: z.ZodArray<z.ZodString>;
257
+ alias: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strip>>>;
249
259
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
250
260
  description: z.ZodOptional<z.ZodString>;
251
261
  prompt: z.ZodOptional<z.ZodString>;
@@ -1,5 +1,9 @@
1
1
  import { z } from "zod";
2
- export const agentProfilePermissionValueSchema = z.enum(["allow", "deny", "ask"]);
2
+ export const agentProfilePermissionValueSchema = z.enum([
3
+ "allow",
4
+ "deny",
5
+ "ask",
6
+ ]);
3
7
  export const agentProfilePermissionSchema = z.union([
4
8
  agentProfilePermissionValueSchema,
5
9
  z.record(z.string(), agentProfilePermissionValueSchema),
@@ -37,7 +41,9 @@ export const agentProfileModelHintsSchema = z.object({
37
41
  default: z.string().optional(),
38
42
  small: z.string().optional(),
39
43
  provider: z.string().optional(),
40
- reasoningEffort: z.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'ultracode']).optional(),
44
+ reasoningEffort: z
45
+ .enum(["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"])
46
+ .optional(),
41
47
  metadata: z.record(z.string(), z.unknown()).optional(),
42
48
  });
43
49
  export const agentProfilePromptSchema = z.object({
@@ -85,6 +91,11 @@ export const agentProfileMcpServerSchema = z.object({
85
91
  enabled: z.boolean().optional(),
86
92
  metadata: z.record(z.string(), z.unknown()).optional(),
87
93
  });
94
+ export const agentProfileConnectionSchema = z.object({
95
+ connectionId: z.string().min(1),
96
+ capabilities: z.array(z.string().min(1)).min(1),
97
+ alias: z.string().min(1).optional(),
98
+ });
88
99
  /**
89
100
  * The complete provider-neutral agent profile schema — the runtime validator for
90
101
  * the canonical {@link AgentProfile} TS contract. Kept structurally in lock-step
@@ -100,9 +111,12 @@ export const agentProfileSchema = z.object({
100
111
  permissions: z.record(z.string(), agentProfilePermissionSchema).optional(),
101
112
  tools: z.record(z.string(), z.boolean()).optional(),
102
113
  mcp: z.record(z.string(), agentProfileMcpServerSchema).optional(),
114
+ connections: z.array(agentProfileConnectionSchema).optional(),
103
115
  subagents: z.record(z.string(), agentSubagentProfileSchema).optional(),
104
116
  resources: agentProfileResourcesSchema.optional(),
105
- hooks: z.record(z.string(), z.array(agentProfileHookCommandSchema)).optional(),
117
+ hooks: z
118
+ .record(z.string(), z.array(agentProfileHookCommandSchema))
119
+ .optional(),
106
120
  modes: z.record(z.string(), agentProfileModeSchema).optional(),
107
121
  confidential: agentProfileConfidentialSchema.optional(),
108
122
  metadata: z.record(z.string(), z.unknown()).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",