@vfarcic/dot-ai 1.0.3 → 1.1.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/README.md +1 -0
- package/dist/core/ai-provider.interface.d.ts +12 -8
- package/dist/core/ai-provider.interface.d.ts.map +1 -1
- package/dist/core/artifacthub.d.ts +1 -1
- package/dist/core/artifacthub.d.ts.map +1 -1
- package/dist/core/base-vector-service.d.ts +22 -9
- package/dist/core/base-vector-service.d.ts.map +1 -1
- package/dist/core/base-vector-service.js +106 -37
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capabilities.js +5 -2
- package/dist/core/capability-operations.d.ts +55 -7
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +1 -3
- package/dist/core/capability-scan-workflow.d.ts +64 -8
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +14 -13
- package/dist/core/capability-tools.d.ts +1 -1
- package/dist/core/capability-tools.d.ts.map +1 -1
- package/dist/core/capability-tools.js +1 -1
- package/dist/core/capability-vector-service.d.ts +3 -4
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +2 -2
- package/dist/core/command-executor.d.ts +3 -4
- package/dist/core/command-executor.d.ts.map +1 -1
- package/dist/core/command-executor.js +8 -4
- package/dist/core/crd-availability.d.ts +3 -5
- package/dist/core/crd-availability.d.ts.map +1 -1
- package/dist/core/crd-availability.js +8 -18
- package/dist/core/deploy-operation.d.ts +6 -5
- package/dist/core/deploy-operation.d.ts.map +1 -1
- package/dist/core/deploy-operation.js +16 -10
- package/dist/core/discovery.d.ts +6 -14
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +35 -51
- package/dist/core/embedding-service.d.ts.map +1 -1
- package/dist/core/embedding-service.js +1 -1
- package/dist/core/error-handling.d.ts +13 -13
- package/dist/core/error-handling.d.ts.map +1 -1
- package/dist/core/error-handling.js +2 -3
- package/dist/core/generic-session-manager.d.ts +2 -2
- package/dist/core/generic-session-manager.d.ts.map +1 -1
- package/dist/core/helm-types.d.ts +5 -5
- package/dist/core/helm-types.d.ts.map +1 -1
- package/dist/core/index.d.ts +4 -11
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -14
- package/dist/core/knowledge-types.d.ts +114 -0
- package/dist/core/knowledge-types.d.ts.map +1 -0
- package/dist/core/knowledge-types.js +10 -0
- package/dist/core/memory.d.ts +12 -12
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core/mermaid-tools.d.ts +24 -1
- package/dist/core/mermaid-tools.d.ts.map +1 -1
- package/dist/core/mermaid-tools.js +10 -8
- package/dist/core/packaging.d.ts +23 -1
- package/dist/core/packaging.d.ts.map +1 -1
- package/dist/core/pattern-operations.d.ts +32 -9
- package/dist/core/pattern-operations.d.ts.map +1 -1
- package/dist/core/pattern-operations.js +17 -22
- package/dist/core/pattern-vector-service.d.ts +3 -4
- package/dist/core/pattern-vector-service.d.ts.map +1 -1
- package/dist/core/pattern-vector-service.js +2 -2
- package/dist/core/platform-utils.d.ts +2 -2
- package/dist/core/platform-utils.d.ts.map +1 -1
- package/dist/core/plugin-manager.d.ts +6 -2
- package/dist/core/plugin-manager.d.ts.map +1 -1
- package/dist/core/plugin-manager.js +9 -16
- package/dist/core/plugin-registry.d.ts +59 -0
- package/dist/core/plugin-registry.d.ts.map +1 -0
- package/dist/core/plugin-registry.js +80 -0
- package/dist/core/policy-operations.d.ts +101 -21
- package/dist/core/policy-operations.d.ts.map +1 -1
- package/dist/core/policy-operations.js +45 -47
- package/dist/core/policy-vector-service.d.ts +3 -4
- package/dist/core/policy-vector-service.d.ts.map +1 -1
- package/dist/core/policy-vector-service.js +2 -2
- package/dist/core/providers/host-provider.d.ts +1 -1
- package/dist/core/providers/host-provider.d.ts.map +1 -1
- package/dist/core/providers/host-provider.js +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.d.ts +10 -2
- package/dist/core/providers/tool-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.js +2 -2
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +29 -23
- package/dist/core/resource-tools.d.ts +29 -1
- package/dist/core/resource-tools.d.ts.map +1 -1
- package/dist/core/resource-vector-service.d.ts +3 -4
- package/dist/core/resource-vector-service.d.ts.map +1 -1
- package/dist/core/resource-vector-service.js +2 -2
- package/dist/core/schema.d.ts +15 -14
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +32 -34
- package/dist/core/shared-prompt-loader.d.ts +1 -1
- package/dist/core/shared-prompt-loader.d.ts.map +1 -1
- package/dist/core/solution-cr.js +1 -1
- package/dist/core/solution-utils.d.ts +22 -3
- package/dist/core/solution-utils.d.ts.map +1 -1
- package/dist/core/solution-utils.js +1 -1
- package/dist/core/telemetry/client.d.ts +0 -6
- package/dist/core/telemetry/client.d.ts.map +1 -1
- package/dist/core/telemetry/client.js +6 -17
- package/dist/core/telemetry/config.js +1 -1
- package/dist/core/telemetry/index.d.ts +1 -1
- package/dist/core/telemetry/index.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +1 -2
- package/dist/core/tracing/tool-tracing.d.ts +1 -1
- package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
- package/dist/core/unified-creation-session.d.ts +15 -8
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +19 -19
- package/dist/core/unified-creation-types.d.ts +2 -2
- package/dist/core/unified-creation-types.d.ts.map +1 -1
- package/dist/core/visualization.d.ts +1 -1
- package/dist/core/visualization.d.ts.map +1 -1
- package/dist/core/workflow.d.ts +8 -5
- package/dist/core/workflow.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.d.ts +13 -7
- package/dist/evaluation/dataset-analyzer.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.js +1 -1
- package/dist/evaluation/datasets/loader.d.ts +2 -2
- package/dist/evaluation/datasets/loader.d.ts.map +1 -1
- package/dist/evaluation/eval-runner.js +7 -5
- package/dist/evaluation/evaluators/base-comparative.d.ts +1 -1
- package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
- package/dist/evaluation/evaluators/base-comparative.js +4 -3
- package/dist/evaluation/evaluators/base.d.ts +5 -5
- package/dist/evaluation/evaluators/base.d.ts.map +1 -1
- package/dist/evaluation/evaluators/capability-comparative.js +1 -1
- package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +26 -15
- package/dist/interfaces/openapi-generator.d.ts +116 -12
- package/dist/interfaces/openapi-generator.d.ts.map +1 -1
- package/dist/interfaces/openapi-generator.js +490 -199
- package/dist/interfaces/rest-api.d.ts +28 -6
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +436 -245
- package/dist/interfaces/rest-registry.d.ts +4 -4
- package/dist/interfaces/rest-registry.d.ts.map +1 -1
- package/dist/interfaces/rest-registry.js +6 -5
- package/dist/interfaces/rest-route-registry.d.ts +165 -0
- package/dist/interfaces/rest-route-registry.d.ts.map +1 -0
- package/dist/interfaces/rest-route-registry.js +230 -0
- package/dist/interfaces/routes/index.d.ts +22 -0
- package/dist/interfaces/routes/index.d.ts.map +1 -0
- package/dist/interfaces/routes/index.js +347 -0
- package/dist/interfaces/schemas/common.d.ts +177 -0
- package/dist/interfaces/schemas/common.d.ts.map +1 -0
- package/dist/interfaces/schemas/common.js +102 -0
- package/dist/interfaces/schemas/events.d.ts +131 -0
- package/dist/interfaces/schemas/events.d.ts.map +1 -0
- package/dist/interfaces/schemas/events.js +66 -0
- package/dist/interfaces/schemas/index.d.ts +21 -0
- package/dist/interfaces/schemas/index.d.ts.map +1 -0
- package/dist/interfaces/schemas/index.js +138 -0
- package/dist/interfaces/schemas/knowledge.d.ts +210 -0
- package/dist/interfaces/schemas/knowledge.d.ts.map +1 -0
- package/dist/interfaces/schemas/knowledge.js +117 -0
- package/dist/interfaces/schemas/logs.d.ts +82 -0
- package/dist/interfaces/schemas/logs.d.ts.map +1 -0
- package/dist/interfaces/schemas/logs.js +46 -0
- package/dist/interfaces/schemas/prompts.d.ts +191 -0
- package/dist/interfaces/schemas/prompts.d.ts.map +1 -0
- package/dist/interfaces/schemas/prompts.js +91 -0
- package/dist/interfaces/schemas/resources.d.ts +378 -0
- package/dist/interfaces/schemas/resources.d.ts.map +1 -0
- package/dist/interfaces/schemas/resources.js +173 -0
- package/dist/interfaces/schemas/sessions.d.ts +90 -0
- package/dist/interfaces/schemas/sessions.d.ts.map +1 -0
- package/dist/interfaces/schemas/sessions.js +56 -0
- package/dist/interfaces/schemas/tools.d.ts +194 -0
- package/dist/interfaces/schemas/tools.d.ts.map +1 -0
- package/dist/interfaces/schemas/tools.js +101 -0
- package/dist/interfaces/schemas/visualization.d.ts +373 -0
- package/dist/interfaces/schemas/visualization.d.ts.map +1 -0
- package/dist/interfaces/schemas/visualization.js +134 -0
- package/dist/mcp/server.js +5 -4
- package/dist/tools/answer-question.d.ts +1 -1
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +9 -8
- package/dist/tools/deploy-manifests.d.ts +4 -2
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +10 -6
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +28 -20
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/manage-knowledge.d.ts +77 -0
- package/dist/tools/manage-knowledge.d.ts.map +1 -0
- package/dist/tools/manage-knowledge.js +573 -0
- package/dist/tools/operate-analysis.d.ts +31 -2
- package/dist/tools/operate-analysis.d.ts.map +1 -1
- package/dist/tools/operate-execution.d.ts +2 -3
- package/dist/tools/operate-execution.d.ts.map +1 -1
- package/dist/tools/operate-execution.js +7 -7
- package/dist/tools/operate.d.ts +7 -2
- package/dist/tools/operate.d.ts.map +1 -1
- package/dist/tools/operate.js +2 -2
- package/dist/tools/organizational-data.d.ts +30 -4
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +24 -19
- package/dist/tools/project-setup/discovery.d.ts.map +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts.map +1 -1
- package/dist/tools/project-setup/types.d.ts +1 -0
- package/dist/tools/project-setup/types.d.ts.map +1 -1
- package/dist/tools/prompts.d.ts +28 -2
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/query.d.ts +17 -3
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +1 -7
- package/dist/tools/recommend.d.ts +24 -6
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +18 -15
- package/dist/tools/remediate.d.ts +12 -3
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +22 -14
- package/dist/tools/version.d.ts +19 -5
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +106 -54
- package/package.json +11 -5
- package/prompts/knowledge-ask.md +29 -0
- package/dist/core/vector-db-service.d.ts +0 -108
- package/dist/core/vector-db-service.d.ts.map +0 -1
- package/dist/core/vector-db-service.js +0 -647
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sessions Endpoint Schemas
|
|
4
|
+
*
|
|
5
|
+
* Schemas for the /api/v1/sessions/:sessionId endpoint.
|
|
6
|
+
* PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SessionRetrievalErrorSchema = exports.SessionNotFoundErrorSchema = exports.SessionResponseSchema = exports.SessionResponseDataSchema = exports.SessionDataSchema = exports.SessionMetadataSchema = void 0;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const common_1 = require("./common");
|
|
12
|
+
/**
|
|
13
|
+
* Session metadata
|
|
14
|
+
*/
|
|
15
|
+
exports.SessionMetadataSchema = zod_1.z.object({
|
|
16
|
+
id: zod_1.z.string().describe('Session ID'),
|
|
17
|
+
createdAt: zod_1.z.string().describe('Session creation timestamp'),
|
|
18
|
+
expiresAt: zod_1.z.string().optional().describe('Session expiration timestamp'),
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Generic session data
|
|
22
|
+
* Sessions can contain different data based on the tool that created them
|
|
23
|
+
*/
|
|
24
|
+
exports.SessionDataSchema = zod_1.z.object({
|
|
25
|
+
toolName: zod_1.z.string().optional().describe('Tool that created this session'),
|
|
26
|
+
intent: zod_1.z.string().optional().describe('User intent for this session'),
|
|
27
|
+
// Additional fields vary by tool type
|
|
28
|
+
}).passthrough(); // Allow additional properties
|
|
29
|
+
/**
|
|
30
|
+
* Session response data
|
|
31
|
+
* GET /api/v1/sessions/:sessionId
|
|
32
|
+
*/
|
|
33
|
+
exports.SessionResponseDataSchema = zod_1.z.object({
|
|
34
|
+
id: zod_1.z.string().describe('Session ID'),
|
|
35
|
+
data: exports.SessionDataSchema.describe('Session data'),
|
|
36
|
+
createdAt: zod_1.z.string().optional().describe('Session creation timestamp'),
|
|
37
|
+
expiresAt: zod_1.z.string().optional().describe('Session expiration timestamp'),
|
|
38
|
+
});
|
|
39
|
+
exports.SessionResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.SessionResponseDataSchema);
|
|
40
|
+
/**
|
|
41
|
+
* Session endpoint error schemas
|
|
42
|
+
*/
|
|
43
|
+
exports.SessionNotFoundErrorSchema = common_1.NotFoundErrorSchema.extend({
|
|
44
|
+
error: zod_1.z.object({
|
|
45
|
+
code: zod_1.z.literal('SESSION_NOT_FOUND'),
|
|
46
|
+
message: zod_1.z.string(),
|
|
47
|
+
details: zod_1.z.any().optional(),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
exports.SessionRetrievalErrorSchema = common_1.InternalServerErrorSchema.extend({
|
|
51
|
+
error: zod_1.z.object({
|
|
52
|
+
code: zod_1.z.literal('SESSION_RETRIEVAL_ERROR'),
|
|
53
|
+
message: zod_1.z.string(),
|
|
54
|
+
details: zod_1.z.any().optional(),
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Discovery and Execution Schemas
|
|
3
|
+
*
|
|
4
|
+
* Schemas for the /api/v1/tools and /api/v1/tools/:toolName endpoints.
|
|
5
|
+
* PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Tool parameter schema
|
|
10
|
+
*/
|
|
11
|
+
export declare const ToolParameterSchema: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
type: z.ZodString;
|
|
14
|
+
description: z.ZodString;
|
|
15
|
+
required: z.ZodBoolean;
|
|
16
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
17
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type ToolParameter = z.infer<typeof ToolParameterSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Tool information schema
|
|
22
|
+
* Matches ToolInfo from rest-registry.ts
|
|
23
|
+
*/
|
|
24
|
+
export declare const ToolInfoSchema: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
description: z.ZodString;
|
|
27
|
+
category: z.ZodOptional<z.ZodString>;
|
|
28
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
type: z.ZodString;
|
|
32
|
+
description: z.ZodString;
|
|
33
|
+
required: z.ZodBoolean;
|
|
34
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
35
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type ToolInfo = z.infer<typeof ToolInfoSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* Tool discovery response data
|
|
42
|
+
*/
|
|
43
|
+
export declare const ToolDiscoveryDataSchema: z.ZodObject<{
|
|
44
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
description: z.ZodString;
|
|
47
|
+
category: z.ZodOptional<z.ZodString>;
|
|
48
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
type: z.ZodString;
|
|
52
|
+
description: z.ZodString;
|
|
53
|
+
required: z.ZodBoolean;
|
|
54
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
55
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
}, z.core.$strip>>>;
|
|
57
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
total: z.ZodNumber;
|
|
60
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type ToolDiscoveryData = z.infer<typeof ToolDiscoveryDataSchema>;
|
|
64
|
+
/**
|
|
65
|
+
* Tool discovery response schema
|
|
66
|
+
* GET /api/v1/tools
|
|
67
|
+
*/
|
|
68
|
+
export declare const ToolDiscoveryResponseSchema: z.ZodObject<{
|
|
69
|
+
success: z.ZodLiteral<true>;
|
|
70
|
+
data: z.ZodObject<{
|
|
71
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
description: z.ZodString;
|
|
74
|
+
category: z.ZodOptional<z.ZodString>;
|
|
75
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
type: z.ZodString;
|
|
79
|
+
description: z.ZodString;
|
|
80
|
+
required: z.ZodBoolean;
|
|
81
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
82
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
total: z.ZodNumber;
|
|
87
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
error: z.ZodOptional<z.ZodUndefined>;
|
|
91
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
timestamp: z.ZodString;
|
|
93
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
94
|
+
version: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type ToolDiscoveryResponse = z.infer<typeof ToolDiscoveryResponseSchema>;
|
|
98
|
+
/**
|
|
99
|
+
* Tool execution result data
|
|
100
|
+
*/
|
|
101
|
+
export declare const ToolExecutionDataSchema: z.ZodObject<{
|
|
102
|
+
result: z.ZodAny;
|
|
103
|
+
tool: z.ZodString;
|
|
104
|
+
executionTime: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export type ToolExecutionData = z.infer<typeof ToolExecutionDataSchema>;
|
|
107
|
+
/**
|
|
108
|
+
* Tool execution response schema
|
|
109
|
+
* POST /api/v1/tools/:toolName
|
|
110
|
+
*/
|
|
111
|
+
export declare const ToolExecutionResponseSchema: z.ZodObject<{
|
|
112
|
+
success: z.ZodLiteral<true>;
|
|
113
|
+
data: z.ZodObject<{
|
|
114
|
+
result: z.ZodAny;
|
|
115
|
+
tool: z.ZodString;
|
|
116
|
+
executionTime: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
error: z.ZodOptional<z.ZodUndefined>;
|
|
119
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
timestamp: z.ZodString;
|
|
121
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
version: z.ZodString;
|
|
123
|
+
}, z.core.$strip>>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export type ToolExecutionResponse = z.infer<typeof ToolExecutionResponseSchema>;
|
|
126
|
+
/**
|
|
127
|
+
* Tool not found error
|
|
128
|
+
*/
|
|
129
|
+
export declare const ToolNotFoundErrorSchema: z.ZodObject<{
|
|
130
|
+
success: z.ZodLiteral<false>;
|
|
131
|
+
data: z.ZodOptional<z.ZodUndefined>;
|
|
132
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
timestamp: z.ZodString;
|
|
134
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
135
|
+
version: z.ZodString;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
error: z.ZodObject<{
|
|
138
|
+
code: z.ZodLiteral<"TOOL_NOT_FOUND">;
|
|
139
|
+
message: z.ZodString;
|
|
140
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
/**
|
|
144
|
+
* Invalid tool request error
|
|
145
|
+
*/
|
|
146
|
+
export declare const InvalidToolRequestErrorSchema: z.ZodObject<{
|
|
147
|
+
success: z.ZodLiteral<false>;
|
|
148
|
+
data: z.ZodOptional<z.ZodUndefined>;
|
|
149
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
timestamp: z.ZodString;
|
|
151
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
version: z.ZodString;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
error: z.ZodObject<{
|
|
155
|
+
code: z.ZodLiteral<"INVALID_REQUEST">;
|
|
156
|
+
message: z.ZodString;
|
|
157
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
/**
|
|
161
|
+
* Tool execution error
|
|
162
|
+
*/
|
|
163
|
+
export declare const ToolExecutionErrorSchema: z.ZodObject<{
|
|
164
|
+
success: z.ZodLiteral<false>;
|
|
165
|
+
data: z.ZodOptional<z.ZodUndefined>;
|
|
166
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
timestamp: z.ZodString;
|
|
168
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
169
|
+
version: z.ZodString;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
error: z.ZodObject<{
|
|
172
|
+
code: z.ZodLiteral<"EXECUTION_ERROR">;
|
|
173
|
+
message: z.ZodString;
|
|
174
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
/**
|
|
178
|
+
* Tool discovery error
|
|
179
|
+
*/
|
|
180
|
+
export declare const ToolDiscoveryErrorSchema: z.ZodObject<{
|
|
181
|
+
success: z.ZodLiteral<false>;
|
|
182
|
+
data: z.ZodOptional<z.ZodUndefined>;
|
|
183
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
timestamp: z.ZodString;
|
|
185
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
186
|
+
version: z.ZodString;
|
|
187
|
+
}, z.core.$strip>>;
|
|
188
|
+
error: z.ZodObject<{
|
|
189
|
+
code: z.ZodLiteral<"DISCOVERY_ERROR">;
|
|
190
|
+
message: z.ZodString;
|
|
191
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/interfaces/schemas/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;iBAOzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;iBAKlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAuD,CAAC;AAEhG,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;iBAAuD,CAAC;AAEhG,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;iBAMlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;iBAMxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;iBAMnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;iBAMnC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool Discovery and Execution Schemas
|
|
4
|
+
*
|
|
5
|
+
* Schemas for the /api/v1/tools and /api/v1/tools/:toolName endpoints.
|
|
6
|
+
* PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ToolDiscoveryErrorSchema = exports.ToolExecutionErrorSchema = exports.InvalidToolRequestErrorSchema = exports.ToolNotFoundErrorSchema = exports.ToolExecutionResponseSchema = exports.ToolExecutionDataSchema = exports.ToolDiscoveryResponseSchema = exports.ToolDiscoveryDataSchema = exports.ToolInfoSchema = exports.ToolParameterSchema = void 0;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const common_1 = require("./common");
|
|
12
|
+
/**
|
|
13
|
+
* Tool parameter schema
|
|
14
|
+
*/
|
|
15
|
+
exports.ToolParameterSchema = zod_1.z.object({
|
|
16
|
+
name: zod_1.z.string().describe('Parameter name'),
|
|
17
|
+
type: zod_1.z.string().describe('Parameter type (string, number, boolean, object, array)'),
|
|
18
|
+
description: zod_1.z.string().describe('Parameter description'),
|
|
19
|
+
required: zod_1.z.boolean().describe('Whether the parameter is required'),
|
|
20
|
+
default: zod_1.z.any().optional().describe('Default value if not provided'),
|
|
21
|
+
enum: zod_1.z.array(zod_1.z.string()).optional().describe('Allowed values for enum parameters'),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Tool information schema
|
|
25
|
+
* Matches ToolInfo from rest-registry.ts
|
|
26
|
+
*/
|
|
27
|
+
exports.ToolInfoSchema = zod_1.z.object({
|
|
28
|
+
name: zod_1.z.string().describe('Tool name/identifier'),
|
|
29
|
+
description: zod_1.z.string().describe('Tool description'),
|
|
30
|
+
category: zod_1.z.string().optional().describe('Tool category for grouping'),
|
|
31
|
+
tags: zod_1.z.array(zod_1.z.string()).optional().describe('Tags for filtering'),
|
|
32
|
+
parameters: zod_1.z.array(exports.ToolParameterSchema).optional().describe('Tool parameters'),
|
|
33
|
+
inputSchema: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe('JSON Schema for tool input'),
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Tool discovery response data
|
|
37
|
+
*/
|
|
38
|
+
exports.ToolDiscoveryDataSchema = zod_1.z.object({
|
|
39
|
+
tools: zod_1.z.array(exports.ToolInfoSchema).describe('List of available tools'),
|
|
40
|
+
total: zod_1.z.number().describe('Total number of tools'),
|
|
41
|
+
categories: zod_1.z.array(zod_1.z.string()).optional().describe('Available categories'),
|
|
42
|
+
tags: zod_1.z.array(zod_1.z.string()).optional().describe('Available tags'),
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Tool discovery response schema
|
|
46
|
+
* GET /api/v1/tools
|
|
47
|
+
*/
|
|
48
|
+
exports.ToolDiscoveryResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.ToolDiscoveryDataSchema);
|
|
49
|
+
/**
|
|
50
|
+
* Tool execution result data
|
|
51
|
+
*/
|
|
52
|
+
exports.ToolExecutionDataSchema = zod_1.z.object({
|
|
53
|
+
result: zod_1.z.any().describe('Tool execution result'),
|
|
54
|
+
tool: zod_1.z.string().describe('Name of the executed tool'),
|
|
55
|
+
executionTime: zod_1.z.number().optional().describe('Execution time in milliseconds'),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Tool execution response schema
|
|
59
|
+
* POST /api/v1/tools/:toolName
|
|
60
|
+
*/
|
|
61
|
+
exports.ToolExecutionResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.ToolExecutionDataSchema);
|
|
62
|
+
/**
|
|
63
|
+
* Tool not found error
|
|
64
|
+
*/
|
|
65
|
+
exports.ToolNotFoundErrorSchema = common_1.NotFoundErrorSchema.extend({
|
|
66
|
+
error: zod_1.z.object({
|
|
67
|
+
code: zod_1.z.literal('TOOL_NOT_FOUND'),
|
|
68
|
+
message: zod_1.z.string(),
|
|
69
|
+
details: zod_1.z.any().optional(),
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Invalid tool request error
|
|
74
|
+
*/
|
|
75
|
+
exports.InvalidToolRequestErrorSchema = common_1.BadRequestErrorSchema.extend({
|
|
76
|
+
error: zod_1.z.object({
|
|
77
|
+
code: zod_1.z.literal('INVALID_REQUEST'),
|
|
78
|
+
message: zod_1.z.string(),
|
|
79
|
+
details: zod_1.z.any().optional(),
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* Tool execution error
|
|
84
|
+
*/
|
|
85
|
+
exports.ToolExecutionErrorSchema = common_1.InternalServerErrorSchema.extend({
|
|
86
|
+
error: zod_1.z.object({
|
|
87
|
+
code: zod_1.z.literal('EXECUTION_ERROR'),
|
|
88
|
+
message: zod_1.z.string(),
|
|
89
|
+
details: zod_1.z.any().optional(),
|
|
90
|
+
}),
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* Tool discovery error
|
|
94
|
+
*/
|
|
95
|
+
exports.ToolDiscoveryErrorSchema = common_1.InternalServerErrorSchema.extend({
|
|
96
|
+
error: zod_1.z.object({
|
|
97
|
+
code: zod_1.z.literal('DISCOVERY_ERROR'),
|
|
98
|
+
message: zod_1.z.string(),
|
|
99
|
+
details: zod_1.z.any().optional(),
|
|
100
|
+
}),
|
|
101
|
+
});
|