@adea-ai/tool-sdk 1.2.2
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 +201 -0
- package/README.md +40 -0
- package/dist/index.d.ts +495 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +282 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @control-plane/tool-sdk
|
|
2
|
+
|
|
3
|
+
Tool definition schemas for the Control Plane. Describe what a tool is —
|
|
4
|
+
ownership, executor type, risk class, approval mode, idempotency, retry
|
|
5
|
+
policy, and limits — so the Control Plane can authorize, rate-limit, and
|
|
6
|
+
audit tool executions.
|
|
7
|
+
|
|
8
|
+
Pure Zod schemas over
|
|
9
|
+
[`@adea-ai/contracts`](https://www.npmjs.com/package/@adea-ai/contracts)
|
|
10
|
+
identifiers. No transport, no credentials, no execution.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
|
|
14
|
+
- **Tool definitions** — canonical names, display metadata, ownership
|
|
15
|
+
(system vs workspace scope).
|
|
16
|
+
- **Executors** — `internal`, `connector`, `mcp`, and `sandbox` executor
|
|
17
|
+
references, including MCP source discovery metadata with schema digests.
|
|
18
|
+
- **Operations** — required capabilities, risk class, approval mode,
|
|
19
|
+
idempotency class, and retry policies.
|
|
20
|
+
- **Limits** — input/output byte ceilings, timeouts, and rate limits.
|
|
21
|
+
- **Lifecycle** — version lifecycle (`published`, `deprecated`, `revoked`,
|
|
22
|
+
`superseded`) and version schemas.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
bun add @adea-ai/tool-sdk
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { ToolDefinitionSchema, ToolOperationSchema } from '@adea-ai/tool-sdk'
|
|
34
|
+
|
|
35
|
+
const definition = ToolDefinitionSchema.parse(raw)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
Apache-2.0
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ToolOwnershipSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
scope: z.ZodLiteral<"system">;
|
|
4
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5
|
+
scope: z.ZodLiteral<"workspace">;
|
|
6
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
7
|
+
}, z.core.$strict>], "scope">;
|
|
8
|
+
export declare const ToolDefinitionSchema: z.ZodObject<{
|
|
9
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
displayName: z.ZodString;
|
|
12
|
+
description: z.ZodString;
|
|
13
|
+
ownership: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
scope: z.ZodLiteral<"system">;
|
|
15
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
16
|
+
scope: z.ZodLiteral<"workspace">;
|
|
17
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
18
|
+
}, z.core.$strict>], "scope">;
|
|
19
|
+
createdAt: z.ZodISODateTime;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export declare const ToolExecutorTypeSchema: z.ZodEnum<{
|
|
22
|
+
internal: "internal";
|
|
23
|
+
connector: "connector";
|
|
24
|
+
mcp: "mcp";
|
|
25
|
+
sandbox: "sandbox";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const ToolVersionLifecycleSchema: z.ZodEnum<{
|
|
28
|
+
published: "published";
|
|
29
|
+
deprecated: "deprecated";
|
|
30
|
+
revoked: "revoked";
|
|
31
|
+
superseded: "superseded";
|
|
32
|
+
}>;
|
|
33
|
+
export declare const ToolRiskClassSchema: z.ZodEnum<{
|
|
34
|
+
low: "low";
|
|
35
|
+
medium: "medium";
|
|
36
|
+
high: "high";
|
|
37
|
+
critical: "critical";
|
|
38
|
+
}>;
|
|
39
|
+
export declare const ToolApprovalModeSchema: z.ZodEnum<{
|
|
40
|
+
never: "never";
|
|
41
|
+
policy: "policy";
|
|
42
|
+
always: "always";
|
|
43
|
+
}>;
|
|
44
|
+
export declare const ToolIdempotencySchema: z.ZodEnum<{
|
|
45
|
+
inherent: "inherent";
|
|
46
|
+
provider_key: "provider_key";
|
|
47
|
+
reconcile: "reconcile";
|
|
48
|
+
none: "none";
|
|
49
|
+
}>;
|
|
50
|
+
export declare const ToolRetryPolicySchema: z.ZodObject<{
|
|
51
|
+
maxAttempts: z.ZodNumber;
|
|
52
|
+
retryableErrorCodes: z.ZodArray<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export declare const ToolOperationSchema: z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
57
|
+
riskClass: z.ZodEnum<{
|
|
58
|
+
low: "low";
|
|
59
|
+
medium: "medium";
|
|
60
|
+
high: "high";
|
|
61
|
+
critical: "critical";
|
|
62
|
+
}>;
|
|
63
|
+
approvalMode: z.ZodEnum<{
|
|
64
|
+
never: "never";
|
|
65
|
+
policy: "policy";
|
|
66
|
+
always: "always";
|
|
67
|
+
}>;
|
|
68
|
+
idempotency: z.ZodEnum<{
|
|
69
|
+
inherent: "inherent";
|
|
70
|
+
provider_key: "provider_key";
|
|
71
|
+
reconcile: "reconcile";
|
|
72
|
+
none: "none";
|
|
73
|
+
}>;
|
|
74
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
maxAttempts: z.ZodNumber;
|
|
76
|
+
retryableErrorCodes: z.ZodArray<z.ZodString>;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export declare const ToolExecutorReferenceSchema: z.ZodObject<{
|
|
80
|
+
type: z.ZodEnum<{
|
|
81
|
+
internal: "internal";
|
|
82
|
+
connector: "connector";
|
|
83
|
+
mcp: "mcp";
|
|
84
|
+
sandbox: "sandbox";
|
|
85
|
+
}>;
|
|
86
|
+
reference: z.ZodString;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export declare const ToolLimitsSchema: z.ZodObject<{
|
|
89
|
+
maxInputBytes: z.ZodNumber;
|
|
90
|
+
maxOutputBytes: z.ZodNumber;
|
|
91
|
+
timeoutMs: z.ZodNumber;
|
|
92
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
maxCalls: z.ZodNumber;
|
|
94
|
+
windowMs: z.ZodNumber;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export declare const ToolSourceSchema: z.ZodObject<{
|
|
98
|
+
kind: z.ZodLiteral<"mcp">;
|
|
99
|
+
serverId: z.ZodString;
|
|
100
|
+
sourceToolName: z.ZodString;
|
|
101
|
+
sourceToolVersion: z.ZodOptional<z.ZodString>;
|
|
102
|
+
schemaDigest: z.ZodString;
|
|
103
|
+
discoveredAt: z.ZodISODateTime;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
export declare const ToolVersionDraftSchema: z.ZodObject<{
|
|
106
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
107
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
108
|
+
semanticVersion: z.ZodString;
|
|
109
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
110
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
111
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
114
|
+
riskClass: z.ZodEnum<{
|
|
115
|
+
low: "low";
|
|
116
|
+
medium: "medium";
|
|
117
|
+
high: "high";
|
|
118
|
+
critical: "critical";
|
|
119
|
+
}>;
|
|
120
|
+
approvalMode: z.ZodEnum<{
|
|
121
|
+
never: "never";
|
|
122
|
+
policy: "policy";
|
|
123
|
+
always: "always";
|
|
124
|
+
}>;
|
|
125
|
+
idempotency: z.ZodEnum<{
|
|
126
|
+
inherent: "inherent";
|
|
127
|
+
provider_key: "provider_key";
|
|
128
|
+
reconcile: "reconcile";
|
|
129
|
+
none: "none";
|
|
130
|
+
}>;
|
|
131
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
maxAttempts: z.ZodNumber;
|
|
133
|
+
retryableErrorCodes: z.ZodArray<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
}, z.core.$strict>>;
|
|
136
|
+
executor: z.ZodObject<{
|
|
137
|
+
type: z.ZodEnum<{
|
|
138
|
+
internal: "internal";
|
|
139
|
+
connector: "connector";
|
|
140
|
+
mcp: "mcp";
|
|
141
|
+
sandbox: "sandbox";
|
|
142
|
+
}>;
|
|
143
|
+
reference: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
kind: z.ZodLiteral<"mcp">;
|
|
147
|
+
serverId: z.ZodString;
|
|
148
|
+
sourceToolName: z.ZodString;
|
|
149
|
+
sourceToolVersion: z.ZodOptional<z.ZodString>;
|
|
150
|
+
schemaDigest: z.ZodString;
|
|
151
|
+
discoveredAt: z.ZodISODateTime;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
limits: z.ZodObject<{
|
|
154
|
+
maxInputBytes: z.ZodNumber;
|
|
155
|
+
maxOutputBytes: z.ZodNumber;
|
|
156
|
+
timeoutMs: z.ZodNumber;
|
|
157
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
maxCalls: z.ZodNumber;
|
|
159
|
+
windowMs: z.ZodNumber;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
createdAt: z.ZodISODateTime;
|
|
163
|
+
publishedAt: z.ZodISODateTime;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
export declare const ToolVersionSchema: z.ZodObject<{
|
|
166
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
167
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
168
|
+
semanticVersion: z.ZodString;
|
|
169
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
170
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
171
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
174
|
+
riskClass: z.ZodEnum<{
|
|
175
|
+
low: "low";
|
|
176
|
+
medium: "medium";
|
|
177
|
+
high: "high";
|
|
178
|
+
critical: "critical";
|
|
179
|
+
}>;
|
|
180
|
+
approvalMode: z.ZodEnum<{
|
|
181
|
+
never: "never";
|
|
182
|
+
policy: "policy";
|
|
183
|
+
always: "always";
|
|
184
|
+
}>;
|
|
185
|
+
idempotency: z.ZodEnum<{
|
|
186
|
+
inherent: "inherent";
|
|
187
|
+
provider_key: "provider_key";
|
|
188
|
+
reconcile: "reconcile";
|
|
189
|
+
none: "none";
|
|
190
|
+
}>;
|
|
191
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
maxAttempts: z.ZodNumber;
|
|
193
|
+
retryableErrorCodes: z.ZodArray<z.ZodString>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
}, z.core.$strict>>;
|
|
196
|
+
executor: z.ZodObject<{
|
|
197
|
+
type: z.ZodEnum<{
|
|
198
|
+
internal: "internal";
|
|
199
|
+
connector: "connector";
|
|
200
|
+
mcp: "mcp";
|
|
201
|
+
sandbox: "sandbox";
|
|
202
|
+
}>;
|
|
203
|
+
reference: z.ZodString;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
206
|
+
kind: z.ZodLiteral<"mcp">;
|
|
207
|
+
serverId: z.ZodString;
|
|
208
|
+
sourceToolName: z.ZodString;
|
|
209
|
+
sourceToolVersion: z.ZodOptional<z.ZodString>;
|
|
210
|
+
schemaDigest: z.ZodString;
|
|
211
|
+
discoveredAt: z.ZodISODateTime;
|
|
212
|
+
}, z.core.$strict>>;
|
|
213
|
+
limits: z.ZodObject<{
|
|
214
|
+
maxInputBytes: z.ZodNumber;
|
|
215
|
+
maxOutputBytes: z.ZodNumber;
|
|
216
|
+
timeoutMs: z.ZodNumber;
|
|
217
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
maxCalls: z.ZodNumber;
|
|
219
|
+
windowMs: z.ZodNumber;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
createdAt: z.ZodISODateTime;
|
|
223
|
+
publishedAt: z.ZodISODateTime;
|
|
224
|
+
revision: z.ZodNumber;
|
|
225
|
+
lifecycle: z.ZodEnum<{
|
|
226
|
+
published: "published";
|
|
227
|
+
deprecated: "deprecated";
|
|
228
|
+
revoked: "revoked";
|
|
229
|
+
superseded: "superseded";
|
|
230
|
+
}>;
|
|
231
|
+
contentDigest: z.ZodString;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
export declare const ToolGrantSchema: z.ZodObject<{
|
|
234
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
235
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
236
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
237
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
238
|
+
operations: z.ZodArray<z.ZodString>;
|
|
239
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
export declare const ToolExecutionRequestSchema: z.ZodObject<{
|
|
242
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"request ID">, string>>;
|
|
243
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"execution ID">, string>>;
|
|
244
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"attempt ID">, string>>;
|
|
245
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
246
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
247
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
248
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
249
|
+
operation: z.ZodString;
|
|
250
|
+
input: z.ZodJSONSchema;
|
|
251
|
+
grant: z.ZodObject<{
|
|
252
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
253
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
254
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
255
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
256
|
+
operations: z.ZodArray<z.ZodString>;
|
|
257
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
audit: z.ZodObject<{
|
|
260
|
+
principalRef: z.ZodString;
|
|
261
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"trace ID">, string>>;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
export declare const ToolExecutionResultSchema: z.ZodObject<{
|
|
265
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
266
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
267
|
+
operation: z.ZodString;
|
|
268
|
+
output: z.ZodJSONSchema;
|
|
269
|
+
artifactRefs: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"Artifact reference ID">, string>>>;
|
|
270
|
+
executor: z.ZodObject<{
|
|
271
|
+
type: z.ZodEnum<{
|
|
272
|
+
internal: "internal";
|
|
273
|
+
connector: "connector";
|
|
274
|
+
mcp: "mcp";
|
|
275
|
+
sandbox: "sandbox";
|
|
276
|
+
}>;
|
|
277
|
+
reference: z.ZodString;
|
|
278
|
+
}, z.core.$strict>;
|
|
279
|
+
attempts: z.ZodNumber;
|
|
280
|
+
audit: z.ZodObject<{
|
|
281
|
+
principalRef: z.ZodString;
|
|
282
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"trace ID">, string>>;
|
|
283
|
+
contentDigest: z.ZodString;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
export declare const ToolPolicyDecisionSchema: z.ZodObject<{
|
|
287
|
+
effect: z.ZodEnum<{
|
|
288
|
+
allow: "allow";
|
|
289
|
+
deny: "deny";
|
|
290
|
+
}>;
|
|
291
|
+
decisionId: z.ZodString;
|
|
292
|
+
policyVersion: z.ZodString;
|
|
293
|
+
reasonCode: z.ZodString;
|
|
294
|
+
requiresApproval: z.ZodBoolean;
|
|
295
|
+
evaluatedAt: z.ZodISODateTime;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
export declare const DurableToolCallRequestSchema: z.ZodObject<{
|
|
298
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"request ID">, string>>;
|
|
299
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"execution ID">, string>>;
|
|
300
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"attempt ID">, string>>;
|
|
301
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
302
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
303
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
304
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
305
|
+
operation: z.ZodString;
|
|
306
|
+
input: z.ZodJSONSchema;
|
|
307
|
+
grant: z.ZodObject<{
|
|
308
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
309
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
310
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
311
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
312
|
+
operations: z.ZodArray<z.ZodString>;
|
|
313
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
audit: z.ZodObject<{
|
|
316
|
+
principalRef: z.ZodString;
|
|
317
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"trace ID">, string>>;
|
|
318
|
+
}, z.core.$strict>;
|
|
319
|
+
toolCallId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-call ID">, string>>;
|
|
320
|
+
idempotencyKey: z.ZodString;
|
|
321
|
+
requestedAt: z.ZodISODateTime;
|
|
322
|
+
policySnapshotRef: z.ZodString;
|
|
323
|
+
approval: z.ZodOptional<z.ZodObject<{
|
|
324
|
+
interactionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"interaction ID">, string>>;
|
|
325
|
+
allowedPrincipalIds: z.ZodArray<z.ZodString>;
|
|
326
|
+
requestedAt: z.ZodISODateTime;
|
|
327
|
+
expiresAt: z.ZodISODateTime;
|
|
328
|
+
}, z.core.$strict>>;
|
|
329
|
+
}, z.core.$strict>;
|
|
330
|
+
export declare const ToolCallStatusSchema: z.ZodEnum<{
|
|
331
|
+
requested: "requested";
|
|
332
|
+
awaiting_approval: "awaiting_approval";
|
|
333
|
+
authorized: "authorized";
|
|
334
|
+
executing: "executing";
|
|
335
|
+
succeeded: "succeeded";
|
|
336
|
+
denied: "denied";
|
|
337
|
+
failed: "failed";
|
|
338
|
+
reconciliation_required: "reconciliation_required";
|
|
339
|
+
}>;
|
|
340
|
+
export declare const ToolCallSchema: z.ZodObject<{
|
|
341
|
+
toolCallId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-call ID">, string>>;
|
|
342
|
+
requestDigest: z.ZodString;
|
|
343
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"execution ID">, string>>;
|
|
344
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"attempt ID">, string>>;
|
|
345
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
346
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
347
|
+
principalRef: z.ZodString;
|
|
348
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
349
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
350
|
+
operation: z.ZodString;
|
|
351
|
+
inputDigest: z.ZodString;
|
|
352
|
+
policySnapshotRef: z.ZodString;
|
|
353
|
+
policyDecision: z.ZodOptional<z.ZodObject<{
|
|
354
|
+
effect: z.ZodEnum<{
|
|
355
|
+
allow: "allow";
|
|
356
|
+
deny: "deny";
|
|
357
|
+
}>;
|
|
358
|
+
decisionId: z.ZodString;
|
|
359
|
+
policyVersion: z.ZodString;
|
|
360
|
+
reasonCode: z.ZodString;
|
|
361
|
+
requiresApproval: z.ZodBoolean;
|
|
362
|
+
evaluatedAt: z.ZodISODateTime;
|
|
363
|
+
}, z.core.$strict>>;
|
|
364
|
+
approvalInteractionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"interaction ID">, string>>>;
|
|
365
|
+
approvalPrincipalRef: z.ZodOptional<z.ZodString>;
|
|
366
|
+
executor: z.ZodObject<{
|
|
367
|
+
type: z.ZodEnum<{
|
|
368
|
+
internal: "internal";
|
|
369
|
+
connector: "connector";
|
|
370
|
+
mcp: "mcp";
|
|
371
|
+
sandbox: "sandbox";
|
|
372
|
+
}>;
|
|
373
|
+
reference: z.ZodString;
|
|
374
|
+
}, z.core.$strict>;
|
|
375
|
+
idempotencyKey: z.ZodString;
|
|
376
|
+
status: z.ZodEnum<{
|
|
377
|
+
requested: "requested";
|
|
378
|
+
awaiting_approval: "awaiting_approval";
|
|
379
|
+
authorized: "authorized";
|
|
380
|
+
executing: "executing";
|
|
381
|
+
succeeded: "succeeded";
|
|
382
|
+
denied: "denied";
|
|
383
|
+
failed: "failed";
|
|
384
|
+
reconciliation_required: "reconciliation_required";
|
|
385
|
+
}>;
|
|
386
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
387
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
388
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
389
|
+
operation: z.ZodString;
|
|
390
|
+
output: z.ZodJSONSchema;
|
|
391
|
+
artifactRefs: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"Artifact reference ID">, string>>>;
|
|
392
|
+
executor: z.ZodObject<{
|
|
393
|
+
type: z.ZodEnum<{
|
|
394
|
+
internal: "internal";
|
|
395
|
+
connector: "connector";
|
|
396
|
+
mcp: "mcp";
|
|
397
|
+
sandbox: "sandbox";
|
|
398
|
+
}>;
|
|
399
|
+
reference: z.ZodString;
|
|
400
|
+
}, z.core.$strict>;
|
|
401
|
+
attempts: z.ZodNumber;
|
|
402
|
+
audit: z.ZodObject<{
|
|
403
|
+
principalRef: z.ZodString;
|
|
404
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"trace ID">, string>>;
|
|
405
|
+
contentDigest: z.ZodString;
|
|
406
|
+
}, z.core.$strict>;
|
|
407
|
+
}, z.core.$strict>>;
|
|
408
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
409
|
+
revision: z.ZodNumber;
|
|
410
|
+
requestedAt: z.ZodISODateTime;
|
|
411
|
+
authorizedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
412
|
+
startedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
413
|
+
completedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
414
|
+
history: z.ZodArray<z.ZodObject<{
|
|
415
|
+
status: z.ZodEnum<{
|
|
416
|
+
requested: "requested";
|
|
417
|
+
awaiting_approval: "awaiting_approval";
|
|
418
|
+
authorized: "authorized";
|
|
419
|
+
executing: "executing";
|
|
420
|
+
succeeded: "succeeded";
|
|
421
|
+
denied: "denied";
|
|
422
|
+
failed: "failed";
|
|
423
|
+
reconciliation_required: "reconciliation_required";
|
|
424
|
+
}>;
|
|
425
|
+
at: z.ZodISODateTime;
|
|
426
|
+
reasonCode: z.ZodOptional<z.ZodString>;
|
|
427
|
+
}, z.core.$strict>>;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
export declare const ToolAuthorizationRequestSchema: z.ZodObject<{
|
|
430
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"request ID">, string>>;
|
|
431
|
+
toolCallId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-call ID">, string>>;
|
|
432
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"execution ID">, string>>;
|
|
433
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"attempt ID">, string>>;
|
|
434
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
435
|
+
profileId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"profile ID">, string>>;
|
|
436
|
+
principalRef: z.ZodString;
|
|
437
|
+
toolDefinitionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-definition ID">, string>>;
|
|
438
|
+
toolVersionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@control-plane/contracts").OpaqueIdentifier<"tool-version ID">, string>>;
|
|
439
|
+
operation: z.ZodString;
|
|
440
|
+
inputDigest: z.ZodString;
|
|
441
|
+
riskClass: z.ZodEnum<{
|
|
442
|
+
low: "low";
|
|
443
|
+
medium: "medium";
|
|
444
|
+
high: "high";
|
|
445
|
+
critical: "critical";
|
|
446
|
+
}>;
|
|
447
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
448
|
+
policySnapshotRef: z.ZodString;
|
|
449
|
+
requestedAt: z.ZodISODateTime;
|
|
450
|
+
}, z.core.$strict>;
|
|
451
|
+
export type ToolDefinition = z.output<typeof ToolDefinitionSchema>;
|
|
452
|
+
export type ToolVersion = z.output<typeof ToolVersionSchema>;
|
|
453
|
+
export type ToolVersionDraft = z.input<typeof ToolVersionDraftSchema>;
|
|
454
|
+
export type ToolGrant = z.output<typeof ToolGrantSchema>;
|
|
455
|
+
export type ToolExecutionRequest = z.output<typeof ToolExecutionRequestSchema>;
|
|
456
|
+
export type ToolExecutionResult = z.output<typeof ToolExecutionResultSchema>;
|
|
457
|
+
export type ToolExecutorType = z.output<typeof ToolExecutorTypeSchema>;
|
|
458
|
+
export type DurableToolCallRequest = z.output<typeof DurableToolCallRequestSchema>;
|
|
459
|
+
export type ToolCall = z.output<typeof ToolCallSchema>;
|
|
460
|
+
export type ToolCallStatus = z.output<typeof ToolCallStatusSchema>;
|
|
461
|
+
export type ToolPolicyDecision = z.output<typeof ToolPolicyDecisionSchema>;
|
|
462
|
+
export type ToolAuthorizationRequest = z.output<typeof ToolAuthorizationRequestSchema>;
|
|
463
|
+
export interface ToolPolicyAuthorizer {
|
|
464
|
+
authorize(request: ToolAuthorizationRequest): Promise<ToolPolicyDecision>;
|
|
465
|
+
}
|
|
466
|
+
export interface ToolApprovalCoordinator {
|
|
467
|
+
review(request: {
|
|
468
|
+
readonly toolCallId: string;
|
|
469
|
+
readonly interactionId: string;
|
|
470
|
+
readonly executionId: string;
|
|
471
|
+
readonly attemptId: string;
|
|
472
|
+
readonly title: string;
|
|
473
|
+
readonly allowedPrincipalIds: readonly string[];
|
|
474
|
+
readonly requestedAt: string;
|
|
475
|
+
readonly expiresAt: string;
|
|
476
|
+
}): Promise<{
|
|
477
|
+
readonly state: 'pending' | 'approved' | 'denied' | 'expired' | 'revoked';
|
|
478
|
+
readonly interactionId: string;
|
|
479
|
+
readonly decisionPrincipalRef?: string;
|
|
480
|
+
}>;
|
|
481
|
+
}
|
|
482
|
+
export declare class ToolExecutorError extends Error {
|
|
483
|
+
readonly code: string;
|
|
484
|
+
readonly retryable: boolean;
|
|
485
|
+
readonly effectState: 'none' | 'committed' | 'unknown';
|
|
486
|
+
constructor(code: string, retryable: boolean, effectState?: 'none' | 'committed' | 'unknown');
|
|
487
|
+
}
|
|
488
|
+
export interface ToolExecutor {
|
|
489
|
+
execute(request: ToolExecutionRequest, version: ToolVersion, signal: AbortSignal): Promise<{
|
|
490
|
+
readonly output: unknown;
|
|
491
|
+
readonly artifactRefs?: readonly string[];
|
|
492
|
+
}>;
|
|
493
|
+
}
|
|
494
|
+
export declare const packageName = "tool-sdk";
|
|
495
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAoBvB,eAAO,MAAM,mBAAmB;;;;;6BAG9B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;kBAStB,CAAA;AAEX,eAAO,MAAM,sBAAsB;;;;;EAAsD,CAAA;AACzF,eAAO,MAAM,0BAA0B;;;;;EAKrC,CAAA;AACF,eAAO,MAAM,mBAAmB;;;;;EAAgD,CAAA;AAChF,eAAO,MAAM,sBAAsB;;;;EAAwC,CAAA;AAC3E,eAAO,MAAM,qBAAqB;;;;;EAA4D,CAAA;AAC9F,eAAO,MAAM,qBAAqB;;;kBAKvB,CAAA;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;kBASrB,CAAA;AAEX,eAAO,MAA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AO,CAAC;QACV,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAA;QACzE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;QAC9B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KACvC,CAAC,CAAA;CACH;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAExC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;gBAF7C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,EAClB,WAAW,GAAE,MAAM,GAAG,WAAW,GAAG,SAAqB;CAKrE;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,CACL,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpF;AAED,eAAO,MAAM,WAAW,aAAa,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { IdentifierSchemas } from '@control-plane/contracts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const TimestampSchema = z.iso.datetime();
|
|
4
|
+
const DigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
5
|
+
const SemanticVersionSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/);
|
|
8
|
+
const CanonicalNameSchema = z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.max(128)
|
|
12
|
+
.regex(/^[a-z][a-z0-9.-]*$/);
|
|
13
|
+
const ErrorCodeSchema = z
|
|
14
|
+
.string()
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(128)
|
|
17
|
+
.regex(/^[A-Z][A-Z0-9_]*$/);
|
|
18
|
+
const JsonObjectSchema = z.record(z.string(), z.json());
|
|
19
|
+
const unique = (values) => new Set(values).size === values.length;
|
|
20
|
+
export const ToolOwnershipSchema = z.discriminatedUnion('scope', [
|
|
21
|
+
z.object({ scope: z.literal('system') }).strict(),
|
|
22
|
+
z.object({ scope: z.literal('workspace'), workspaceId: IdentifierSchemas.workspaceId }).strict(),
|
|
23
|
+
]);
|
|
24
|
+
export const ToolDefinitionSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
27
|
+
name: CanonicalNameSchema,
|
|
28
|
+
displayName: z.string().min(1).max(128),
|
|
29
|
+
description: z.string().min(1).max(2_048),
|
|
30
|
+
ownership: ToolOwnershipSchema,
|
|
31
|
+
createdAt: TimestampSchema,
|
|
32
|
+
})
|
|
33
|
+
.strict();
|
|
34
|
+
export const ToolExecutorTypeSchema = z.enum(['internal', 'connector', 'mcp', 'sandbox']);
|
|
35
|
+
export const ToolVersionLifecycleSchema = z.enum([
|
|
36
|
+
'published',
|
|
37
|
+
'deprecated',
|
|
38
|
+
'revoked',
|
|
39
|
+
'superseded',
|
|
40
|
+
]);
|
|
41
|
+
export const ToolRiskClassSchema = z.enum(['low', 'medium', 'high', 'critical']);
|
|
42
|
+
export const ToolApprovalModeSchema = z.enum(['never', 'policy', 'always']);
|
|
43
|
+
export const ToolIdempotencySchema = z.enum(['inherent', 'provider_key', 'reconcile', 'none']);
|
|
44
|
+
export const ToolRetryPolicySchema = z
|
|
45
|
+
.object({
|
|
46
|
+
maxAttempts: z.number().int().positive().max(8),
|
|
47
|
+
retryableErrorCodes: z.array(ErrorCodeSchema).max(32).refine(unique),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
export const ToolOperationSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
name: CanonicalNameSchema,
|
|
53
|
+
requiredCapabilities: z.array(CanonicalNameSchema).max(64).refine(unique),
|
|
54
|
+
riskClass: ToolRiskClassSchema,
|
|
55
|
+
approvalMode: ToolApprovalModeSchema,
|
|
56
|
+
idempotency: ToolIdempotencySchema,
|
|
57
|
+
retryPolicy: ToolRetryPolicySchema.optional(),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
export const ToolExecutorReferenceSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
type: ToolExecutorTypeSchema,
|
|
63
|
+
reference: z
|
|
64
|
+
.string()
|
|
65
|
+
.min(1)
|
|
66
|
+
.max(256)
|
|
67
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
export const ToolLimitsSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
maxInputBytes: z.number().int().positive().max(1_048_576),
|
|
73
|
+
maxOutputBytes: z.number().int().positive().max(16_777_216),
|
|
74
|
+
timeoutMs: z.number().int().positive().max(900_000),
|
|
75
|
+
rateLimit: z
|
|
76
|
+
.object({
|
|
77
|
+
maxCalls: z.number().int().positive().max(100_000),
|
|
78
|
+
windowMs: z.number().int().positive().max(86_400_000),
|
|
79
|
+
})
|
|
80
|
+
.strict()
|
|
81
|
+
.optional(),
|
|
82
|
+
})
|
|
83
|
+
.strict();
|
|
84
|
+
export const ToolSourceSchema = z
|
|
85
|
+
.object({
|
|
86
|
+
kind: z.literal('mcp'),
|
|
87
|
+
serverId: CanonicalNameSchema,
|
|
88
|
+
sourceToolName: z.string().min(1).max(256),
|
|
89
|
+
sourceToolVersion: z.string().min(1).max(128).optional(),
|
|
90
|
+
schemaDigest: DigestSchema,
|
|
91
|
+
discoveredAt: TimestampSchema,
|
|
92
|
+
})
|
|
93
|
+
.strict();
|
|
94
|
+
const ToolVersionFieldsSchema = z
|
|
95
|
+
.object({
|
|
96
|
+
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
97
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
98
|
+
semanticVersion: SemanticVersionSchema,
|
|
99
|
+
inputSchema: JsonObjectSchema,
|
|
100
|
+
outputSchema: JsonObjectSchema,
|
|
101
|
+
operations: z
|
|
102
|
+
.array(ToolOperationSchema)
|
|
103
|
+
.min(1)
|
|
104
|
+
.max(64)
|
|
105
|
+
.refine((operations) => unique(operations.map(({ name }) => name))),
|
|
106
|
+
executor: ToolExecutorReferenceSchema,
|
|
107
|
+
source: ToolSourceSchema.optional(),
|
|
108
|
+
limits: ToolLimitsSchema,
|
|
109
|
+
createdAt: TimestampSchema,
|
|
110
|
+
publishedAt: TimestampSchema,
|
|
111
|
+
})
|
|
112
|
+
.strict();
|
|
113
|
+
export const ToolVersionDraftSchema = ToolVersionFieldsSchema;
|
|
114
|
+
export const ToolVersionSchema = ToolVersionFieldsSchema.extend({
|
|
115
|
+
revision: z.number().int().positive(),
|
|
116
|
+
lifecycle: ToolVersionLifecycleSchema,
|
|
117
|
+
contentDigest: DigestSchema,
|
|
118
|
+
}).strict();
|
|
119
|
+
export const ToolGrantSchema = z
|
|
120
|
+
.object({
|
|
121
|
+
workspaceId: IdentifierSchemas.workspaceId,
|
|
122
|
+
profileId: IdentifierSchemas.profileId,
|
|
123
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
124
|
+
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
125
|
+
operations: z.array(CanonicalNameSchema).min(1).max(64).refine(unique),
|
|
126
|
+
expiresAt: TimestampSchema.optional(),
|
|
127
|
+
})
|
|
128
|
+
.strict();
|
|
129
|
+
export const ToolExecutionRequestSchema = z
|
|
130
|
+
.object({
|
|
131
|
+
requestId: IdentifierSchemas.requestId,
|
|
132
|
+
executionId: IdentifierSchemas.executionId,
|
|
133
|
+
attemptId: IdentifierSchemas.attemptId,
|
|
134
|
+
workspaceId: IdentifierSchemas.workspaceId,
|
|
135
|
+
profileId: IdentifierSchemas.profileId,
|
|
136
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
137
|
+
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
138
|
+
operation: CanonicalNameSchema,
|
|
139
|
+
input: z.json(),
|
|
140
|
+
grant: ToolGrantSchema,
|
|
141
|
+
audit: z
|
|
142
|
+
.object({
|
|
143
|
+
principalRef: z.string().min(1).max(256),
|
|
144
|
+
traceId: IdentifierSchemas.traceId,
|
|
145
|
+
})
|
|
146
|
+
.strict(),
|
|
147
|
+
})
|
|
148
|
+
.strict();
|
|
149
|
+
export const ToolExecutionResultSchema = z
|
|
150
|
+
.object({
|
|
151
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
152
|
+
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
153
|
+
operation: CanonicalNameSchema,
|
|
154
|
+
output: z.json(),
|
|
155
|
+
artifactRefs: z.array(IdentifierSchemas.artifactId).max(128),
|
|
156
|
+
executor: ToolExecutorReferenceSchema,
|
|
157
|
+
attempts: z.number().int().positive(),
|
|
158
|
+
audit: z
|
|
159
|
+
.object({
|
|
160
|
+
principalRef: z.string().min(1).max(256),
|
|
161
|
+
traceId: IdentifierSchemas.traceId,
|
|
162
|
+
contentDigest: DigestSchema,
|
|
163
|
+
})
|
|
164
|
+
.strict(),
|
|
165
|
+
})
|
|
166
|
+
.strict();
|
|
167
|
+
const PolicyReferenceSchema = z
|
|
168
|
+
.string()
|
|
169
|
+
.min(1)
|
|
170
|
+
.max(512)
|
|
171
|
+
.regex(/^[a-z][a-z0-9+.-]*:\/\/\S+$/);
|
|
172
|
+
export const ToolPolicyDecisionSchema = z
|
|
173
|
+
.object({
|
|
174
|
+
effect: z.enum(['allow', 'deny']),
|
|
175
|
+
decisionId: z.string().min(1).max(256),
|
|
176
|
+
policyVersion: z.string().min(1).max(256),
|
|
177
|
+
reasonCode: ErrorCodeSchema,
|
|
178
|
+
requiresApproval: z.boolean(),
|
|
179
|
+
evaluatedAt: TimestampSchema,
|
|
180
|
+
})
|
|
181
|
+
.strict();
|
|
182
|
+
export const DurableToolCallRequestSchema = ToolExecutionRequestSchema.extend({
|
|
183
|
+
toolCallId: IdentifierSchemas.toolCallId,
|
|
184
|
+
idempotencyKey: z
|
|
185
|
+
.string()
|
|
186
|
+
.min(8)
|
|
187
|
+
.max(256)
|
|
188
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),
|
|
189
|
+
requestedAt: TimestampSchema,
|
|
190
|
+
policySnapshotRef: PolicyReferenceSchema,
|
|
191
|
+
approval: z
|
|
192
|
+
.object({
|
|
193
|
+
interactionId: IdentifierSchemas.interactionId,
|
|
194
|
+
allowedPrincipalIds: z.array(z.string().min(3).max(128)).min(1).max(64).refine(unique),
|
|
195
|
+
requestedAt: TimestampSchema,
|
|
196
|
+
expiresAt: TimestampSchema,
|
|
197
|
+
})
|
|
198
|
+
.strict()
|
|
199
|
+
.optional(),
|
|
200
|
+
}).strict();
|
|
201
|
+
export const ToolCallStatusSchema = z.enum([
|
|
202
|
+
'requested',
|
|
203
|
+
'awaiting_approval',
|
|
204
|
+
'authorized',
|
|
205
|
+
'executing',
|
|
206
|
+
'succeeded',
|
|
207
|
+
'denied',
|
|
208
|
+
'failed',
|
|
209
|
+
'reconciliation_required',
|
|
210
|
+
]);
|
|
211
|
+
export const ToolCallSchema = z
|
|
212
|
+
.object({
|
|
213
|
+
toolCallId: IdentifierSchemas.toolCallId,
|
|
214
|
+
requestDigest: DigestSchema,
|
|
215
|
+
executionId: IdentifierSchemas.executionId,
|
|
216
|
+
attemptId: IdentifierSchemas.attemptId,
|
|
217
|
+
workspaceId: IdentifierSchemas.workspaceId,
|
|
218
|
+
profileId: IdentifierSchemas.profileId,
|
|
219
|
+
principalRef: z.string().min(1).max(256),
|
|
220
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
221
|
+
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
222
|
+
operation: CanonicalNameSchema,
|
|
223
|
+
inputDigest: DigestSchema,
|
|
224
|
+
policySnapshotRef: PolicyReferenceSchema,
|
|
225
|
+
policyDecision: ToolPolicyDecisionSchema.optional(),
|
|
226
|
+
approvalInteractionId: IdentifierSchemas.interactionId.optional(),
|
|
227
|
+
approvalPrincipalRef: z.string().min(1).max(256).optional(),
|
|
228
|
+
executor: ToolExecutorReferenceSchema,
|
|
229
|
+
idempotencyKey: z.string().min(8).max(256),
|
|
230
|
+
status: ToolCallStatusSchema,
|
|
231
|
+
result: ToolExecutionResultSchema.optional(),
|
|
232
|
+
errorCode: ErrorCodeSchema.optional(),
|
|
233
|
+
revision: z.number().int().positive(),
|
|
234
|
+
requestedAt: TimestampSchema,
|
|
235
|
+
authorizedAt: TimestampSchema.optional(),
|
|
236
|
+
startedAt: TimestampSchema.optional(),
|
|
237
|
+
completedAt: TimestampSchema.optional(),
|
|
238
|
+
history: z
|
|
239
|
+
.array(z
|
|
240
|
+
.object({
|
|
241
|
+
status: ToolCallStatusSchema,
|
|
242
|
+
at: TimestampSchema,
|
|
243
|
+
reasonCode: ErrorCodeSchema.optional(),
|
|
244
|
+
})
|
|
245
|
+
.strict())
|
|
246
|
+
.min(1)
|
|
247
|
+
.max(64),
|
|
248
|
+
})
|
|
249
|
+
.strict();
|
|
250
|
+
export const ToolAuthorizationRequestSchema = z
|
|
251
|
+
.object({
|
|
252
|
+
requestId: IdentifierSchemas.requestId,
|
|
253
|
+
toolCallId: IdentifierSchemas.toolCallId,
|
|
254
|
+
executionId: IdentifierSchemas.executionId,
|
|
255
|
+
attemptId: IdentifierSchemas.attemptId,
|
|
256
|
+
workspaceId: IdentifierSchemas.workspaceId,
|
|
257
|
+
profileId: IdentifierSchemas.profileId,
|
|
258
|
+
principalRef: z.string().min(1).max(256),
|
|
259
|
+
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
260
|
+
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
261
|
+
operation: CanonicalNameSchema,
|
|
262
|
+
inputDigest: DigestSchema,
|
|
263
|
+
riskClass: ToolRiskClassSchema,
|
|
264
|
+
requiredCapabilities: z.array(CanonicalNameSchema).max(64).refine(unique),
|
|
265
|
+
policySnapshotRef: PolicyReferenceSchema,
|
|
266
|
+
requestedAt: TimestampSchema,
|
|
267
|
+
})
|
|
268
|
+
.strict();
|
|
269
|
+
export class ToolExecutorError extends Error {
|
|
270
|
+
code;
|
|
271
|
+
retryable;
|
|
272
|
+
effectState;
|
|
273
|
+
constructor(code, retryable, effectState = 'unknown') {
|
|
274
|
+
super(code);
|
|
275
|
+
this.code = code;
|
|
276
|
+
this.retryable = retryable;
|
|
277
|
+
this.effectState = effectState;
|
|
278
|
+
this.name = 'ToolExecutorError';
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
export const packageName = 'tool-sdk';
|
|
282
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;AACxC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;AAC9D,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,KAAK,CAAC,qFAAqF,CAAC,CAAA;AAC/F,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,oBAAoB,CAAC,CAAA;AAC9B,MAAM,eAAe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AE,iBAAiB,CAAC,SAAS;IACtC,UAAU,EAAE,iBAAiB,CAAC,UAAU;IACxC,WAAW,EAAE,iBAAiB,CAAC,WAAW;IAC1C,SAAS,EAAE,iBAAiB,CAAC,SAAS;IACtC,WAAW,EAAE,iBAAiB,CAAC,WAAW;IAC1C,SAAS,EAAE,iBAAiB,CAAC,SAAS;IACtC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACxC,gBAAgB,EAAE,iBAAiB,CAAC,gBAAgB;IACpD,aAAa,EAAE,iBAAiB,CAAC,aAAa;IAC9C,SAAS,EAAE,mBAAmB;IAC9B,WAAW,EAAE,YAAY;IACzB,SAAS,EAAE,mBAAmB;IAC9B,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACzE,iBAAiB,EAAE,qBAAqB;IACxC,WAAW,EAAE,eAAe;CAC7B,CAAC;KACD,MAAM,EAAE,CAAA;AAoCX,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAE/B;IACA;IACA;IAHX,YACW,IAAY,EACZ,SAAkB,EAClB,cAAgD,SAAS;QAElE,KAAK,CAAC,IAAI,CAAC,CAAA;QAJF,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAS;QAClB,gBAAW,GAAX,WAAW,CAA8C;QAGlE,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;IACjC,CAAC;CACF;AAUD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adea-ai/tool-sdk",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Tool definition schemas for the Control Plane: ownership, executors, risk classes, approval modes, idempotency, retry policies, and limits.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agents",
|
|
7
|
+
"mcp",
|
|
8
|
+
"schemas",
|
|
9
|
+
"tools",
|
|
10
|
+
"zod"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/adea-ai/control-plane#readme",
|
|
13
|
+
"bugs": "https://github.com/adea-ai/control-plane/issues",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/adea-ai/control-plane.git",
|
|
18
|
+
"directory": "packages/tool-sdk"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"browser": false,
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"node": "./dist/index.js",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"provenance": true
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json",
|
|
39
|
+
"lint": "oxlint src",
|
|
40
|
+
"test": "bun test src"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@adea-ai/contracts": "^1.5.2",
|
|
44
|
+
"zod": "4.5.4"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=24 <25"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {},
|
|
50
|
+
"peerDependencies": {}
|
|
51
|
+
}
|