@tangle-network/agent-interface 0.10.0 → 0.11.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/LICENSE +18 -8
- package/README.md +31 -0
- package/dist/agent-profile.d.ts +21 -1
- package/dist/agent-profile.js +6 -0
- package/dist/profile-schema.d.ts +10 -0
- package/dist/profile-schema.js +17 -3
- package/package.json +15 -2
package/LICENSE
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copyright (c) 2026 Tangle Network
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @tangle-network/agent-interface
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types and zod schemas that define the contract between Tangle
|
|
4
|
+
agents, the sidecar, and provider adapters: capabilities, agent profiles,
|
|
5
|
+
message parts, and harness descriptors. This is the canonical home for those
|
|
6
|
+
shapes; higher-level packages import from here rather than redefining them.
|
|
7
|
+
|
|
8
|
+
The only runtime dependency is `zod` (used for the schema exports).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add @tangle-network/agent-interface
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import type { BackendCapabilities, ProviderCapabilities } from "@tangle-network/agent-interface";
|
|
20
|
+
|
|
21
|
+
const caps: ProviderCapabilities = {
|
|
22
|
+
supportsVision: true,
|
|
23
|
+
supportsLogprobs: false,
|
|
24
|
+
supportsToolCalls: true,
|
|
25
|
+
supportsComputerUse: false,
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT
|
package/dist/agent-profile.d.ts
CHANGED
|
@@ -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 =
|
|
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[]>;
|
package/dist/agent-profile.js
CHANGED
|
@@ -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),
|
package/dist/profile-schema.d.ts
CHANGED
|
@@ -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>;
|
package/dist/profile-schema.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export const agentProfilePermissionValueSchema = z.enum([
|
|
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
|
|
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
|
|
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,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-interface",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
@@ -11,8 +12,19 @@
|
|
|
11
12
|
"default": "./dist/index.js"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/tangle-network/agent-sdk.git",
|
|
18
|
+
"directory": "packages/agent-interface"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public",
|
|
22
|
+
"registry": "https://registry.npmjs.org"
|
|
23
|
+
},
|
|
14
24
|
"files": [
|
|
15
|
-
"dist"
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
16
28
|
],
|
|
17
29
|
"dependencies": {
|
|
18
30
|
"zod": "4.4.3"
|
|
@@ -23,6 +35,7 @@
|
|
|
23
35
|
},
|
|
24
36
|
"scripts": {
|
|
25
37
|
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"check-types": "tsc --noEmit",
|
|
26
39
|
"clean": "rm -rf dist"
|
|
27
40
|
}
|
|
28
41
|
}
|