@adea-ai/tool-sdk 1.5.2 → 1.5.3
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/dist/index.js +8 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { IdentifierSchemas } from '@adea-ai/contracts';
|
|
1
|
+
import { IdentifierSchemas, Sha256DigestSchema, TimestampSchema } from '@adea-ai/contracts';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
const TimestampSchema = z.iso.datetime();
|
|
4
|
-
const DigestSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
5
3
|
const SemanticVersionSchema = z
|
|
6
4
|
.string()
|
|
7
5
|
.regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/);
|
|
@@ -87,8 +85,8 @@ export const ToolSourceSchema = z
|
|
|
87
85
|
serverId: CanonicalNameSchema,
|
|
88
86
|
sourceToolName: z.string().min(1).max(256),
|
|
89
87
|
sourceToolVersion: z.string().min(1).max(128).optional(),
|
|
90
|
-
schemaDigest:
|
|
91
|
-
legacySchemaDigest:
|
|
88
|
+
schemaDigest: Sha256DigestSchema,
|
|
89
|
+
legacySchemaDigest: Sha256DigestSchema.optional(),
|
|
92
90
|
discoveredAt: TimestampSchema,
|
|
93
91
|
})
|
|
94
92
|
.strict();
|
|
@@ -115,7 +113,7 @@ export const ToolVersionDraftSchema = ToolVersionFieldsSchema;
|
|
|
115
113
|
export const ToolVersionSchema = ToolVersionFieldsSchema.extend({
|
|
116
114
|
revision: z.number().int().positive(),
|
|
117
115
|
lifecycle: ToolVersionLifecycleSchema,
|
|
118
|
-
contentDigest:
|
|
116
|
+
contentDigest: Sha256DigestSchema,
|
|
119
117
|
}).strict();
|
|
120
118
|
export const ToolGrantSchema = z
|
|
121
119
|
.object({
|
|
@@ -160,7 +158,7 @@ export const ToolExecutionResultSchema = z
|
|
|
160
158
|
.object({
|
|
161
159
|
principalRef: z.string().min(1).max(256),
|
|
162
160
|
traceId: IdentifierSchemas.traceId,
|
|
163
|
-
contentDigest:
|
|
161
|
+
contentDigest: Sha256DigestSchema,
|
|
164
162
|
})
|
|
165
163
|
.strict(),
|
|
166
164
|
})
|
|
@@ -212,7 +210,7 @@ export const ToolCallStatusSchema = z.enum([
|
|
|
212
210
|
export const ToolCallSchema = z
|
|
213
211
|
.object({
|
|
214
212
|
toolCallId: IdentifierSchemas.toolCallId,
|
|
215
|
-
requestDigest:
|
|
213
|
+
requestDigest: Sha256DigestSchema,
|
|
216
214
|
requestDigestVersion: z.literal(2).optional(),
|
|
217
215
|
executionId: IdentifierSchemas.executionId,
|
|
218
216
|
attemptId: IdentifierSchemas.attemptId,
|
|
@@ -222,7 +220,7 @@ export const ToolCallSchema = z
|
|
|
222
220
|
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
223
221
|
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
224
222
|
operation: CanonicalNameSchema,
|
|
225
|
-
inputDigest:
|
|
223
|
+
inputDigest: Sha256DigestSchema,
|
|
226
224
|
inputDigestVersion: z.literal(2).optional(),
|
|
227
225
|
policySnapshotRef: PolicyReferenceSchema,
|
|
228
226
|
policyDecision: ToolPolicyDecisionSchema.optional(),
|
|
@@ -262,7 +260,7 @@ export const ToolAuthorizationRequestSchema = z
|
|
|
262
260
|
toolDefinitionId: IdentifierSchemas.toolDefinitionId,
|
|
263
261
|
toolVersionId: IdentifierSchemas.toolVersionId,
|
|
264
262
|
operation: CanonicalNameSchema,
|
|
265
|
-
inputDigest:
|
|
263
|
+
inputDigest: Sha256DigestSchema,
|
|
266
264
|
inputDigestVersion: z.literal(2).optional(),
|
|
267
265
|
riskClass: ToolRiskClassSchema,
|
|
268
266
|
requiredCapabilities: z.array(CanonicalNameSchema).max(64).refine(unique),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/tool-sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Tool definition schemas for the Control Plane: ownership, executors, risk classes, approval modes, idempotency, retry policies, and limits.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"test": "bun test src"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@adea-ai/contracts": "^5.0.
|
|
43
|
+
"@adea-ai/contracts": "^5.0.2",
|
|
44
44
|
"zod": "4.6.6"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|