@contractspec/example.agent-console 0.0.0-canary-20260113170453
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/.turbo/turbo-build$colon$bundle.log +280 -0
- package/.turbo/turbo-build.log +281 -0
- package/CHANGELOG.md +368 -0
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/agent/agent.entity.d.ts +55 -0
- package/dist/agent/agent.entity.d.ts.map +1 -0
- package/dist/agent/agent.entity.js +136 -0
- package/dist/agent/agent.entity.js.map +1 -0
- package/dist/agent/agent.enum.d.ts +18 -0
- package/dist/agent/agent.enum.d.ts.map +1 -0
- package/dist/agent/agent.enum.js +34 -0
- package/dist/agent/agent.enum.js.map +1 -0
- package/dist/agent/agent.event.d.ts +128 -0
- package/dist/agent/agent.event.d.ts.map +1 -0
- package/dist/agent/agent.event.js +210 -0
- package/dist/agent/agent.event.js.map +1 -0
- package/dist/agent/agent.handler.d.ts +100 -0
- package/dist/agent/agent.handler.d.ts.map +1 -0
- package/dist/agent/agent.handler.js +84 -0
- package/dist/agent/agent.handler.js.map +1 -0
- package/dist/agent/agent.operation.d.ts +471 -0
- package/dist/agent/agent.operation.d.ts.map +1 -0
- package/dist/agent/agent.operation.js +486 -0
- package/dist/agent/agent.operation.js.map +1 -0
- package/dist/agent/agent.presentation.d.ts +18 -0
- package/dist/agent/agent.presentation.d.ts.map +1 -0
- package/dist/agent/agent.presentation.js +89 -0
- package/dist/agent/agent.presentation.js.map +1 -0
- package/dist/agent/agent.schema.d.ts +401 -0
- package/dist/agent/agent.schema.d.ts.map +1 -0
- package/dist/agent/agent.schema.js +406 -0
- package/dist/agent/agent.schema.js.map +1 -0
- package/dist/agent/agent.test-spec.d.ts +8 -0
- package/dist/agent/agent.test-spec.d.ts.map +1 -0
- package/dist/agent/agent.test-spec.js +65 -0
- package/dist/agent/agent.test-spec.js.map +1 -0
- package/dist/agent/index.d.ts +8 -0
- package/dist/agent/index.js +9 -0
- package/dist/agent.capability.d.ts +7 -0
- package/dist/agent.capability.d.ts.map +1 -0
- package/dist/agent.capability.js +20 -0
- package/dist/agent.capability.js.map +1 -0
- package/dist/agent.feature.d.ts +12 -0
- package/dist/agent.feature.d.ts.map +1 -0
- package/dist/agent.feature.js +305 -0
- package/dist/agent.feature.js.map +1 -0
- package/dist/docs/agent-console.docblock.d.ts +1 -0
- package/dist/docs/agent-console.docblock.js +113 -0
- package/dist/docs/agent-console.docblock.js.map +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +58 -0
- package/dist/example.js.map +1 -0
- package/dist/handlers/agent.handlers.d.ts +135 -0
- package/dist/handlers/agent.handlers.d.ts.map +1 -0
- package/dist/handlers/agent.handlers.js +263 -0
- package/dist/handlers/agent.handlers.js.map +1 -0
- package/dist/handlers/index.d.ts +5 -0
- package/dist/handlers/index.js +6 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +50 -0
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +5 -0
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.js +9 -0
- package/dist/run/run.entity.d.ts +82 -0
- package/dist/run/run.entity.d.ts.map +1 -0
- package/dist/run/run.entity.js +205 -0
- package/dist/run/run.entity.js.map +1 -0
- package/dist/run/run.enum.d.ts +22 -0
- package/dist/run/run.enum.d.ts.map +1 -0
- package/dist/run/run.enum.js +45 -0
- package/dist/run/run.enum.js.map +1 -0
- package/dist/run/run.event.d.ts +290 -0
- package/dist/run/run.event.d.ts.map +1 -0
- package/dist/run/run.event.js +434 -0
- package/dist/run/run.event.js.map +1 -0
- package/dist/run/run.handler.d.ts +203 -0
- package/dist/run/run.handler.d.ts.map +1 -0
- package/dist/run/run.handler.js +83 -0
- package/dist/run/run.handler.js.map +1 -0
- package/dist/run/run.operation.d.ts +720 -0
- package/dist/run/run.operation.d.ts.map +1 -0
- package/dist/run/run.operation.js +626 -0
- package/dist/run/run.operation.js.map +1 -0
- package/dist/run/run.presentation.d.ts +14 -0
- package/dist/run/run.presentation.d.ts.map +1 -0
- package/dist/run/run.presentation.js +65 -0
- package/dist/run/run.presentation.js.map +1 -0
- package/dist/run/run.schema.d.ts +416 -0
- package/dist/run/run.schema.d.ts.map +1 -0
- package/dist/run/run.schema.js +338 -0
- package/dist/run/run.schema.js.map +1 -0
- package/dist/run/run.test-spec.d.ts +8 -0
- package/dist/run/run.test-spec.d.ts.map +1 -0
- package/dist/run/run.test-spec.js +65 -0
- package/dist/run/run.test-spec.js.map +1 -0
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +20 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/mock-agents.d.ts +88 -0
- package/dist/shared/mock-agents.d.ts.map +1 -0
- package/dist/shared/mock-agents.js +94 -0
- package/dist/shared/mock-agents.js.map +1 -0
- package/dist/shared/mock-runs.d.ts +120 -0
- package/dist/shared/mock-runs.d.ts.map +1 -0
- package/dist/shared/mock-runs.js +118 -0
- package/dist/shared/mock-runs.js.map +1 -0
- package/dist/shared/mock-tools.d.ts +244 -0
- package/dist/shared/mock-tools.d.ts.map +1 -0
- package/dist/shared/mock-tools.js +181 -0
- package/dist/shared/mock-tools.js.map +1 -0
- package/dist/shared/overlay-types.d.ts +34 -0
- package/dist/shared/overlay-types.d.ts.map +1 -0
- package/dist/shared/overlay-types.js +0 -0
- package/dist/tool/index.d.ts +8 -0
- package/dist/tool/index.js +9 -0
- package/dist/tool/tool.entity.d.ts +42 -0
- package/dist/tool/tool.entity.d.ts.map +1 -0
- package/dist/tool/tool.entity.js +105 -0
- package/dist/tool/tool.entity.js.map +1 -0
- package/dist/tool/tool.enum.d.ts +18 -0
- package/dist/tool/tool.enum.d.ts.map +1 -0
- package/dist/tool/tool.enum.js +35 -0
- package/dist/tool/tool.enum.js.map +1 -0
- package/dist/tool/tool.event.d.ts +103 -0
- package/dist/tool/tool.event.d.ts.map +1 -0
- package/dist/tool/tool.event.js +159 -0
- package/dist/tool/tool.event.js.map +1 -0
- package/dist/tool/tool.handler.d.ts +315 -0
- package/dist/tool/tool.handler.d.ts.map +1 -0
- package/dist/tool/tool.handler.js +87 -0
- package/dist/tool/tool.handler.js.map +1 -0
- package/dist/tool/tool.operation.d.ts +411 -0
- package/dist/tool/tool.operation.d.ts.map +1 -0
- package/dist/tool/tool.operation.js +406 -0
- package/dist/tool/tool.operation.js.map +1 -0
- package/dist/tool/tool.presentation.d.ts +14 -0
- package/dist/tool/tool.presentation.d.ts.map +1 -0
- package/dist/tool/tool.presentation.js +65 -0
- package/dist/tool/tool.presentation.js.map +1 -0
- package/dist/tool/tool.schema.d.ts +218 -0
- package/dist/tool/tool.schema.d.ts.map +1 -0
- package/dist/tool/tool.schema.js +236 -0
- package/dist/tool/tool.schema.js.map +1 -0
- package/dist/tool/tool.test-spec.d.ts +8 -0
- package/dist/tool/tool.test-spec.d.ts.map +1 -0
- package/dist/tool/tool.test-spec.js +65 -0
- package/dist/tool/tool.test-spec.js.map +1 -0
- package/dist/ui/AgentDashboard.d.ts +7 -0
- package/dist/ui/AgentDashboard.d.ts.map +1 -0
- package/dist/ui/AgentDashboard.js +420 -0
- package/dist/ui/AgentDashboard.js.map +1 -0
- package/dist/ui/AgentRunList.d.ts +2 -0
- package/dist/ui/AgentRunList.js +5 -0
- package/dist/ui/AgentToolRegistry.d.ts +2 -0
- package/dist/ui/AgentToolRegistry.js +5 -0
- package/dist/ui/hooks/index.d.ts +6 -0
- package/dist/ui/hooks/index.js +8 -0
- package/dist/ui/hooks/useAgentList.d.ts +28 -0
- package/dist/ui/hooks/useAgentList.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentList.js +66 -0
- package/dist/ui/hooks/useAgentList.js.map +1 -0
- package/dist/ui/hooks/useAgentMutations.d.ts +29 -0
- package/dist/ui/hooks/useAgentMutations.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentMutations.js +124 -0
- package/dist/ui/hooks/useAgentMutations.js.map +1 -0
- package/dist/ui/hooks/useRunList.d.ts +24 -0
- package/dist/ui/hooks/useRunList.d.ts.map +1 -0
- package/dist/ui/hooks/useRunList.js +66 -0
- package/dist/ui/hooks/useRunList.js.map +1 -0
- package/dist/ui/hooks/useToolList.d.ts +40 -0
- package/dist/ui/hooks/useToolList.d.ts.map +1 -0
- package/dist/ui/hooks/useToolList.js +96 -0
- package/dist/ui/hooks/useToolList.js.map +1 -0
- package/dist/ui/index.d.ts +24 -0
- package/dist/ui/index.js +24 -0
- package/dist/ui/modals/AgentActionsModal.d.ts +27 -0
- package/dist/ui/modals/AgentActionsModal.d.ts.map +1 -0
- package/dist/ui/modals/AgentActionsModal.js +262 -0
- package/dist/ui/modals/AgentActionsModal.js.map +1 -0
- package/dist/ui/modals/CreateAgentModal.d.ts +25 -0
- package/dist/ui/modals/CreateAgentModal.d.ts.map +1 -0
- package/dist/ui/modals/CreateAgentModal.js +214 -0
- package/dist/ui/modals/CreateAgentModal.js.map +1 -0
- package/dist/ui/modals/index.d.ts +3 -0
- package/dist/ui/modals/index.js +4 -0
- package/dist/ui/overlays/demo-overlays.d.ts +19 -0
- package/dist/ui/overlays/demo-overlays.d.ts.map +1 -0
- package/dist/ui/overlays/demo-overlays.js +73 -0
- package/dist/ui/overlays/demo-overlays.js.map +1 -0
- package/dist/ui/overlays/index.d.ts +2 -0
- package/dist/ui/overlays/index.js +3 -0
- package/dist/ui/renderers/agent-list.markdown.d.ts +15 -0
- package/dist/ui/renderers/agent-list.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/agent-list.markdown.js +51 -0
- package/dist/ui/renderers/agent-list.markdown.js.map +1 -0
- package/dist/ui/renderers/agent-list.renderer.d.ts +11 -0
- package/dist/ui/renderers/agent-list.renderer.d.ts.map +1 -0
- package/dist/ui/renderers/agent-list.renderer.js +19 -0
- package/dist/ui/renderers/agent-list.renderer.js.map +1 -0
- package/dist/ui/renderers/dashboard.markdown.d.ts +15 -0
- package/dist/ui/renderers/dashboard.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/dashboard.markdown.js +100 -0
- package/dist/ui/renderers/dashboard.markdown.js.map +1 -0
- package/dist/ui/renderers/index.d.ts +6 -0
- package/dist/ui/renderers/index.js +7 -0
- package/dist/ui/renderers/run-list.markdown.d.ts +15 -0
- package/dist/ui/renderers/run-list.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/run-list.markdown.js +44 -0
- package/dist/ui/renderers/run-list.markdown.js.map +1 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts +15 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/tool-registry.markdown.js +55 -0
- package/dist/ui/renderers/tool-registry.markdown.js.map +1 -0
- package/dist/ui/views/AgentListView.d.ts +7 -0
- package/dist/ui/views/AgentListView.d.ts.map +1 -0
- package/dist/ui/views/AgentListView.js +93 -0
- package/dist/ui/views/AgentListView.js.map +1 -0
- package/dist/ui/views/RunListView.d.ts +14 -0
- package/dist/ui/views/RunListView.d.ts.map +1 -0
- package/dist/ui/views/RunListView.js +165 -0
- package/dist/ui/views/RunListView.js.map +1 -0
- package/dist/ui/views/ToolRegistryView.d.ts +14 -0
- package/dist/ui/views/ToolRegistryView.d.ts.map +1 -0
- package/dist/ui/views/ToolRegistryView.js +97 -0
- package/dist/ui/views/ToolRegistryView.js.map +1 -0
- package/dist/ui/views/index.d.ts +4 -0
- package/dist/ui/views/index.js +5 -0
- package/example.ts +1 -0
- package/package.json +155 -0
- package/src/agent/agent.entity.ts +137 -0
- package/src/agent/agent.enum.ts +31 -0
- package/src/agent/agent.event.ts +142 -0
- package/src/agent/agent.handler.ts +178 -0
- package/src/agent/agent.operation.ts +444 -0
- package/src/agent/agent.presentation.ts +80 -0
- package/src/agent/agent.schema.ts +214 -0
- package/src/agent/agent.test-spec.ts +55 -0
- package/src/agent/index.ts +67 -0
- package/src/agent.capability.ts +13 -0
- package/src/agent.feature.ts +147 -0
- package/src/docs/agent-console.docblock.ts +97 -0
- package/src/docs/index.ts +1 -0
- package/src/example.ts +41 -0
- package/src/handlers/agent.handlers.ts +572 -0
- package/src/handlers/index.ts +30 -0
- package/src/index.ts +32 -0
- package/src/presentations/index.ts +26 -0
- package/src/run/index.ts +68 -0
- package/src/run/run.entity.ts +175 -0
- package/src/run/run.enum.ts +43 -0
- package/src/run/run.event.ts +264 -0
- package/src/run/run.handler.ts +138 -0
- package/src/run/run.operation.ts +524 -0
- package/src/run/run.presentation.ts +54 -0
- package/src/run/run.schema.ts +169 -0
- package/src/run/run.test-spec.ts +55 -0
- package/src/seeders/index.ts +29 -0
- package/src/shared/index.ts +6 -0
- package/src/shared/mock-agents.ts +81 -0
- package/src/shared/mock-runs.ts +107 -0
- package/src/shared/mock-tools.ts +145 -0
- package/src/shared/overlay-types.ts +39 -0
- package/src/tool/index.ts +60 -0
- package/src/tool/tool.entity.ts +99 -0
- package/src/tool/tool.enum.ts +32 -0
- package/src/tool/tool.event.ts +119 -0
- package/src/tool/tool.handler.ts +154 -0
- package/src/tool/tool.operation.ts +366 -0
- package/src/tool/tool.presentation.ts +55 -0
- package/src/tool/tool.schema.ts +133 -0
- package/src/tool/tool.test-spec.ts +55 -0
- package/src/ui/AgentDashboard.tsx +416 -0
- package/src/ui/AgentRunList.tsx +8 -0
- package/src/ui/AgentToolRegistry.tsx +8 -0
- package/src/ui/hooks/index.ts +14 -0
- package/src/ui/hooks/useAgentList.ts +80 -0
- package/src/ui/hooks/useAgentMutations.ts +156 -0
- package/src/ui/hooks/useRunList.ts +81 -0
- package/src/ui/hooks/useToolList.ts +122 -0
- package/src/ui/index.ts +21 -0
- package/src/ui/modals/AgentActionsModal.tsx +306 -0
- package/src/ui/modals/CreateAgentModal.tsx +257 -0
- package/src/ui/modals/index.ts +2 -0
- package/src/ui/overlays/demo-overlays.ts +77 -0
- package/src/ui/overlays/index.ts +1 -0
- package/src/ui/renderers/agent-list.markdown.ts +84 -0
- package/src/ui/renderers/agent-list.renderer.tsx +27 -0
- package/src/ui/renderers/dashboard.markdown.ts +169 -0
- package/src/ui/renderers/index.ts +12 -0
- package/src/ui/renderers/run-list.markdown.ts +75 -0
- package/src/ui/renderers/tool-registry.markdown.ts +91 -0
- package/src/ui/views/AgentListView.tsx +113 -0
- package/src/ui/views/RunListView.tsx +173 -0
- package/src/ui/views/ToolRegistryView.tsx +140 -0
- package/src/ui/views/index.ts +6 -0
- package/tsconfig.json +10 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +7 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
//#region src/tool/tool.handler.d.ts
|
|
2
|
+
interface ListToolsInput {
|
|
3
|
+
organizationId: string;
|
|
4
|
+
category?: 'RETRIEVAL' | 'COMPUTATION' | 'COMMUNICATION' | 'INTEGRATION' | 'UTILITY' | 'CUSTOM';
|
|
5
|
+
status?: 'DRAFT' | 'ACTIVE' | 'DEPRECATED' | 'DISABLED';
|
|
6
|
+
search?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
}
|
|
10
|
+
interface ToolSummary {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
description: string;
|
|
15
|
+
category: 'RETRIEVAL' | 'COMPUTATION' | 'COMMUNICATION' | 'INTEGRATION' | 'UTILITY' | 'CUSTOM';
|
|
16
|
+
status: 'DRAFT' | 'ACTIVE' | 'DEPRECATED' | 'DISABLED';
|
|
17
|
+
version: string;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
}
|
|
20
|
+
interface ListToolsOutput {
|
|
21
|
+
items: ToolSummary[];
|
|
22
|
+
total: number;
|
|
23
|
+
hasMore: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Mock handler for ListToolsQuery.
|
|
27
|
+
*/
|
|
28
|
+
declare function mockListToolsHandler(input: ListToolsInput): Promise<ListToolsOutput>;
|
|
29
|
+
/**
|
|
30
|
+
* Mock handler for GetToolQuery.
|
|
31
|
+
*/
|
|
32
|
+
declare function mockGetToolHandler(input: {
|
|
33
|
+
toolId: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
id: string;
|
|
36
|
+
organizationId: string;
|
|
37
|
+
name: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
description: string;
|
|
40
|
+
category: "RETRIEVAL";
|
|
41
|
+
status: "ACTIVE";
|
|
42
|
+
parametersSchema: {
|
|
43
|
+
type: string;
|
|
44
|
+
properties: {
|
|
45
|
+
query: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
numResults: {
|
|
50
|
+
type: string;
|
|
51
|
+
default: number;
|
|
52
|
+
};
|
|
53
|
+
maxRows?: undefined;
|
|
54
|
+
to?: undefined;
|
|
55
|
+
subject?: undefined;
|
|
56
|
+
body?: undefined;
|
|
57
|
+
action?: undefined;
|
|
58
|
+
repo?: undefined;
|
|
59
|
+
params?: undefined;
|
|
60
|
+
expression?: undefined;
|
|
61
|
+
};
|
|
62
|
+
required: string[];
|
|
63
|
+
};
|
|
64
|
+
outputSchema: {
|
|
65
|
+
type: string;
|
|
66
|
+
items: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
properties?: undefined;
|
|
70
|
+
};
|
|
71
|
+
implementationType: "http";
|
|
72
|
+
implementationConfig: {
|
|
73
|
+
url: string;
|
|
74
|
+
method: string;
|
|
75
|
+
handler?: undefined;
|
|
76
|
+
auth?: undefined;
|
|
77
|
+
};
|
|
78
|
+
maxInvocationsPerMinute: number;
|
|
79
|
+
timeoutMs: number;
|
|
80
|
+
version: string;
|
|
81
|
+
tags: string[];
|
|
82
|
+
createdAt: Date;
|
|
83
|
+
updatedAt: Date;
|
|
84
|
+
} | {
|
|
85
|
+
id: string;
|
|
86
|
+
organizationId: string;
|
|
87
|
+
name: string;
|
|
88
|
+
slug: string;
|
|
89
|
+
description: string;
|
|
90
|
+
category: "RETRIEVAL";
|
|
91
|
+
status: "ACTIVE";
|
|
92
|
+
parametersSchema: {
|
|
93
|
+
type: string;
|
|
94
|
+
properties: {
|
|
95
|
+
query: {
|
|
96
|
+
type: string;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
maxRows: {
|
|
100
|
+
type: string;
|
|
101
|
+
default: number;
|
|
102
|
+
};
|
|
103
|
+
numResults?: undefined;
|
|
104
|
+
to?: undefined;
|
|
105
|
+
subject?: undefined;
|
|
106
|
+
body?: undefined;
|
|
107
|
+
action?: undefined;
|
|
108
|
+
repo?: undefined;
|
|
109
|
+
params?: undefined;
|
|
110
|
+
expression?: undefined;
|
|
111
|
+
};
|
|
112
|
+
required: string[];
|
|
113
|
+
};
|
|
114
|
+
outputSchema: {
|
|
115
|
+
type: string;
|
|
116
|
+
items?: undefined;
|
|
117
|
+
properties?: undefined;
|
|
118
|
+
};
|
|
119
|
+
implementationType: "function";
|
|
120
|
+
implementationConfig: {
|
|
121
|
+
handler: string;
|
|
122
|
+
url?: undefined;
|
|
123
|
+
method?: undefined;
|
|
124
|
+
auth?: undefined;
|
|
125
|
+
};
|
|
126
|
+
maxInvocationsPerMinute: number;
|
|
127
|
+
timeoutMs: number;
|
|
128
|
+
version: string;
|
|
129
|
+
tags: string[];
|
|
130
|
+
createdAt: Date;
|
|
131
|
+
updatedAt: Date;
|
|
132
|
+
} | {
|
|
133
|
+
id: string;
|
|
134
|
+
organizationId: string;
|
|
135
|
+
name: string;
|
|
136
|
+
slug: string;
|
|
137
|
+
description: string;
|
|
138
|
+
category: "COMMUNICATION";
|
|
139
|
+
status: "ACTIVE";
|
|
140
|
+
parametersSchema: {
|
|
141
|
+
type: string;
|
|
142
|
+
properties: {
|
|
143
|
+
to: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
subject: {
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
body: {
|
|
150
|
+
type: string;
|
|
151
|
+
};
|
|
152
|
+
query?: undefined;
|
|
153
|
+
numResults?: undefined;
|
|
154
|
+
maxRows?: undefined;
|
|
155
|
+
action?: undefined;
|
|
156
|
+
repo?: undefined;
|
|
157
|
+
params?: undefined;
|
|
158
|
+
expression?: undefined;
|
|
159
|
+
};
|
|
160
|
+
required: string[];
|
|
161
|
+
};
|
|
162
|
+
implementationType: "http";
|
|
163
|
+
implementationConfig: {
|
|
164
|
+
url: string;
|
|
165
|
+
method: string;
|
|
166
|
+
handler?: undefined;
|
|
167
|
+
auth?: undefined;
|
|
168
|
+
};
|
|
169
|
+
maxInvocationsPerMinute: number;
|
|
170
|
+
timeoutMs: number;
|
|
171
|
+
version: string;
|
|
172
|
+
tags: string[];
|
|
173
|
+
createdAt: Date;
|
|
174
|
+
updatedAt: Date;
|
|
175
|
+
outputSchema?: undefined;
|
|
176
|
+
} | {
|
|
177
|
+
id: string;
|
|
178
|
+
organizationId: string;
|
|
179
|
+
name: string;
|
|
180
|
+
slug: string;
|
|
181
|
+
description: string;
|
|
182
|
+
category: "INTEGRATION";
|
|
183
|
+
status: "ACTIVE";
|
|
184
|
+
parametersSchema: {
|
|
185
|
+
type: string;
|
|
186
|
+
properties: {
|
|
187
|
+
action: {
|
|
188
|
+
type: string;
|
|
189
|
+
enum: string[];
|
|
190
|
+
};
|
|
191
|
+
repo: {
|
|
192
|
+
type: string;
|
|
193
|
+
};
|
|
194
|
+
params: {
|
|
195
|
+
type: string;
|
|
196
|
+
};
|
|
197
|
+
query?: undefined;
|
|
198
|
+
numResults?: undefined;
|
|
199
|
+
maxRows?: undefined;
|
|
200
|
+
to?: undefined;
|
|
201
|
+
subject?: undefined;
|
|
202
|
+
body?: undefined;
|
|
203
|
+
expression?: undefined;
|
|
204
|
+
};
|
|
205
|
+
required: string[];
|
|
206
|
+
};
|
|
207
|
+
implementationType: "http";
|
|
208
|
+
implementationConfig: {
|
|
209
|
+
url: string;
|
|
210
|
+
auth: string;
|
|
211
|
+
method?: undefined;
|
|
212
|
+
handler?: undefined;
|
|
213
|
+
};
|
|
214
|
+
maxInvocationsPerMinute: number;
|
|
215
|
+
timeoutMs: number;
|
|
216
|
+
version: string;
|
|
217
|
+
tags: string[];
|
|
218
|
+
createdAt: Date;
|
|
219
|
+
updatedAt: Date;
|
|
220
|
+
outputSchema?: undefined;
|
|
221
|
+
} | {
|
|
222
|
+
id: string;
|
|
223
|
+
organizationId: string;
|
|
224
|
+
name: string;
|
|
225
|
+
slug: string;
|
|
226
|
+
description: string;
|
|
227
|
+
category: "COMPUTATION";
|
|
228
|
+
status: "ACTIVE";
|
|
229
|
+
parametersSchema: {
|
|
230
|
+
type: string;
|
|
231
|
+
properties: {
|
|
232
|
+
expression: {
|
|
233
|
+
type: string;
|
|
234
|
+
description: string;
|
|
235
|
+
};
|
|
236
|
+
query?: undefined;
|
|
237
|
+
numResults?: undefined;
|
|
238
|
+
maxRows?: undefined;
|
|
239
|
+
to?: undefined;
|
|
240
|
+
subject?: undefined;
|
|
241
|
+
body?: undefined;
|
|
242
|
+
action?: undefined;
|
|
243
|
+
repo?: undefined;
|
|
244
|
+
params?: undefined;
|
|
245
|
+
};
|
|
246
|
+
required: string[];
|
|
247
|
+
};
|
|
248
|
+
outputSchema: {
|
|
249
|
+
type: string;
|
|
250
|
+
properties: {
|
|
251
|
+
result: {
|
|
252
|
+
type: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
items?: undefined;
|
|
256
|
+
};
|
|
257
|
+
implementationType: "function";
|
|
258
|
+
implementationConfig: {
|
|
259
|
+
handler: string;
|
|
260
|
+
url?: undefined;
|
|
261
|
+
method?: undefined;
|
|
262
|
+
auth?: undefined;
|
|
263
|
+
};
|
|
264
|
+
timeoutMs: number;
|
|
265
|
+
version: string;
|
|
266
|
+
tags: string[];
|
|
267
|
+
createdAt: Date;
|
|
268
|
+
updatedAt: Date;
|
|
269
|
+
maxInvocationsPerMinute?: undefined;
|
|
270
|
+
}>;
|
|
271
|
+
/**
|
|
272
|
+
* Mock handler for CreateToolCommand.
|
|
273
|
+
*/
|
|
274
|
+
declare function mockCreateToolHandler(input: {
|
|
275
|
+
organizationId: string;
|
|
276
|
+
name: string;
|
|
277
|
+
slug: string;
|
|
278
|
+
description: string;
|
|
279
|
+
implementationType: 'http' | 'function' | 'workflow';
|
|
280
|
+
}): Promise<{
|
|
281
|
+
id: string;
|
|
282
|
+
name: string;
|
|
283
|
+
slug: string;
|
|
284
|
+
status: "DRAFT";
|
|
285
|
+
}>;
|
|
286
|
+
/**
|
|
287
|
+
* Mock handler for UpdateToolCommand.
|
|
288
|
+
*/
|
|
289
|
+
declare function mockUpdateToolHandler(input: {
|
|
290
|
+
toolId: string;
|
|
291
|
+
name?: string;
|
|
292
|
+
status?: 'DRAFT' | 'ACTIVE' | 'DEPRECATED' | 'DISABLED';
|
|
293
|
+
}): Promise<{
|
|
294
|
+
id: string;
|
|
295
|
+
name: string;
|
|
296
|
+
status: "DRAFT" | "ACTIVE" | "DEPRECATED" | "DISABLED";
|
|
297
|
+
updatedAt: Date;
|
|
298
|
+
}>;
|
|
299
|
+
/**
|
|
300
|
+
* Mock handler for TestToolCommand.
|
|
301
|
+
*/
|
|
302
|
+
declare function mockTestToolHandler(input: {
|
|
303
|
+
toolId: string;
|
|
304
|
+
testInput: Record<string, unknown>;
|
|
305
|
+
}): Promise<{
|
|
306
|
+
success: boolean;
|
|
307
|
+
output: {
|
|
308
|
+
result: string;
|
|
309
|
+
input: Record<string, unknown>;
|
|
310
|
+
};
|
|
311
|
+
durationMs: number;
|
|
312
|
+
}>;
|
|
313
|
+
//#endregion
|
|
314
|
+
export { ListToolsInput, ListToolsOutput, ToolSummary, mockCreateToolHandler, mockGetToolHandler, mockListToolsHandler, mockTestToolHandler, mockUpdateToolHandler };
|
|
315
|
+
//# sourceMappingURL=tool.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.handler.d.ts","names":[],"sources":["../../src/tool/tool.handler.ts"],"sourcesContent":[],"mappings":";UAKiB,cAAA;EAAA,cAAA,EAAA,MAAc;EAed,QAAA,CAAA,EAAA,WAAW,GAAA,aAcX,GAAA,eAAA,GAAA,aAAA,GAAA,SAAA,GAAA,QAAA;EAGA,MAAA,CAAA,EAAA,OAAA,GAAe,QAAA,GAAA,YACvB,GAAW,UAAA;EAQE,MAAA,CAAA,EAAA,MAAA;EACb,KAAA,CAAA,EAAA,MAAA;EACE,MAAA,CAAA,EAAA,MAAA;;AAAD,UA5BO,WAAA,CA4BP;EAwCY,EAAA,EAAA,MAAA;;;;;;;aAtDT;;UAGI,eAAA;SACR;EAkDyD,KAAA,EAAA,MAAA;EAAA,OAAA,EAAA,OAAA;AASlE;AAsBA;AAkBA;;iBA3FsB,oBAAA,QACb,iBACN,QAAQ;;;;iBAwCW,kBAAA;;IAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS5C,qBAAA;;;;;;IAMrB;;;;;;;;;iBAgBqB,qBAAA;;;;IAIrB;;;;aAJ0C;;;;;iBAkBrB,mBAAA;;aAET;IACZ"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MOCK_TOOLS } from "../shared/mock-tools.js";
|
|
2
|
+
|
|
3
|
+
//#region src/tool/tool.handler.ts
|
|
4
|
+
/**
|
|
5
|
+
* Mock handlers for Tool contracts.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Mock handler for ListToolsQuery.
|
|
9
|
+
*/
|
|
10
|
+
async function mockListToolsHandler(input) {
|
|
11
|
+
const { organizationId, category, status, search, limit = 20, offset = 0 } = input;
|
|
12
|
+
let filtered = MOCK_TOOLS.filter((t) => t.organizationId === organizationId);
|
|
13
|
+
if (category) filtered = filtered.filter((t) => t.category === category);
|
|
14
|
+
if (status) filtered = filtered.filter((t) => t.status === status);
|
|
15
|
+
if (search) {
|
|
16
|
+
const q = search.toLowerCase();
|
|
17
|
+
filtered = filtered.filter((t) => t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q));
|
|
18
|
+
}
|
|
19
|
+
const total = filtered.length;
|
|
20
|
+
return {
|
|
21
|
+
items: filtered.slice(offset, offset + limit).map((t) => ({
|
|
22
|
+
id: t.id,
|
|
23
|
+
name: t.name,
|
|
24
|
+
slug: t.slug,
|
|
25
|
+
description: t.description,
|
|
26
|
+
category: t.category,
|
|
27
|
+
status: t.status,
|
|
28
|
+
version: t.version,
|
|
29
|
+
createdAt: t.createdAt
|
|
30
|
+
})),
|
|
31
|
+
total,
|
|
32
|
+
hasMore: offset + limit < total
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Mock handler for GetToolQuery.
|
|
37
|
+
*/
|
|
38
|
+
async function mockGetToolHandler(input) {
|
|
39
|
+
const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
|
|
40
|
+
if (!tool) throw new Error("TOOL_NOT_FOUND");
|
|
41
|
+
return tool;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Mock handler for CreateToolCommand.
|
|
45
|
+
*/
|
|
46
|
+
async function mockCreateToolHandler(input) {
|
|
47
|
+
if (MOCK_TOOLS.some((t) => t.organizationId === input.organizationId && t.slug === input.slug)) throw new Error("SLUG_EXISTS");
|
|
48
|
+
return {
|
|
49
|
+
id: `tool-${Date.now()}`,
|
|
50
|
+
name: input.name,
|
|
51
|
+
slug: input.slug,
|
|
52
|
+
status: "DRAFT"
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Mock handler for UpdateToolCommand.
|
|
57
|
+
*/
|
|
58
|
+
async function mockUpdateToolHandler(input) {
|
|
59
|
+
const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
|
|
60
|
+
if (!tool) throw new Error("TOOL_NOT_FOUND");
|
|
61
|
+
return {
|
|
62
|
+
id: tool.id,
|
|
63
|
+
name: input.name ?? tool.name,
|
|
64
|
+
status: input.status ?? tool.status,
|
|
65
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Mock handler for TestToolCommand.
|
|
70
|
+
*/
|
|
71
|
+
async function mockTestToolHandler(input) {
|
|
72
|
+
if (!MOCK_TOOLS.find((t) => t.id === input.toolId)) throw new Error("TOOL_NOT_FOUND");
|
|
73
|
+
const startTime = Date.now();
|
|
74
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
75
|
+
return {
|
|
76
|
+
success: true,
|
|
77
|
+
output: {
|
|
78
|
+
result: "Test successful",
|
|
79
|
+
input: input.testInput
|
|
80
|
+
},
|
|
81
|
+
durationMs: Date.now() - startTime
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { mockCreateToolHandler, mockGetToolHandler, mockListToolsHandler, mockTestToolHandler, mockUpdateToolHandler };
|
|
87
|
+
//# sourceMappingURL=tool.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.handler.js","names":[],"sources":["../../src/tool/tool.handler.ts"],"sourcesContent":["/**\n * Mock handlers for Tool contracts.\n */\nimport { MOCK_TOOLS } from '../shared/mock-tools';\n\nexport interface ListToolsInput {\n organizationId: string;\n category?:\n | 'RETRIEVAL'\n | 'COMPUTATION'\n | 'COMMUNICATION'\n | 'INTEGRATION'\n | 'UTILITY'\n | 'CUSTOM';\n status?: 'DRAFT' | 'ACTIVE' | 'DEPRECATED' | 'DISABLED';\n search?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface ToolSummary {\n id: string;\n name: string;\n slug: string;\n description: string;\n category:\n | 'RETRIEVAL'\n | 'COMPUTATION'\n | 'COMMUNICATION'\n | 'INTEGRATION'\n | 'UTILITY'\n | 'CUSTOM';\n status: 'DRAFT' | 'ACTIVE' | 'DEPRECATED' | 'DISABLED';\n version: string;\n createdAt: Date;\n}\n\nexport interface ListToolsOutput {\n items: ToolSummary[];\n total: number;\n hasMore: boolean;\n}\n\n/**\n * Mock handler for ListToolsQuery.\n */\nexport async function mockListToolsHandler(\n input: ListToolsInput\n): Promise<ListToolsOutput> {\n const {\n organizationId,\n category,\n status,\n search,\n limit = 20,\n offset = 0,\n } = input;\n\n let filtered = MOCK_TOOLS.filter((t) => t.organizationId === organizationId);\n if (category) filtered = filtered.filter((t) => t.category === category);\n if (status) filtered = filtered.filter((t) => t.status === status);\n if (search) {\n const q = search.toLowerCase();\n filtered = filtered.filter(\n (t) =>\n t.name.toLowerCase().includes(q) ||\n t.description.toLowerCase().includes(q)\n );\n }\n\n const total = filtered.length;\n const items = filtered.slice(offset, offset + limit).map((t) => ({\n id: t.id,\n name: t.name,\n slug: t.slug,\n description: t.description,\n category: t.category,\n status: t.status,\n version: t.version,\n createdAt: t.createdAt,\n }));\n\n return { items, total, hasMore: offset + limit < total };\n}\n\n/**\n * Mock handler for GetToolQuery.\n */\nexport async function mockGetToolHandler(input: { toolId: string }) {\n const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);\n if (!tool) throw new Error('TOOL_NOT_FOUND');\n return tool;\n}\n\n/**\n * Mock handler for CreateToolCommand.\n */\nexport async function mockCreateToolHandler(input: {\n organizationId: string;\n name: string;\n slug: string;\n description: string;\n implementationType: 'http' | 'function' | 'workflow';\n}) {\n const exists = MOCK_TOOLS.some(\n (t) => t.organizationId === input.organizationId && t.slug === input.slug\n );\n if (exists) throw new Error('SLUG_EXISTS');\n return {\n id: `tool-${Date.now()}`,\n name: input.name,\n slug: input.slug,\n status: 'DRAFT' as const,\n };\n}\n\n/**\n * Mock handler for UpdateToolCommand.\n */\nexport async function mockUpdateToolHandler(input: {\n toolId: string;\n name?: string;\n status?: 'DRAFT' | 'ACTIVE' | 'DEPRECATED' | 'DISABLED';\n}) {\n const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);\n if (!tool) throw new Error('TOOL_NOT_FOUND');\n return {\n id: tool.id,\n name: input.name ?? tool.name,\n status: input.status ?? tool.status,\n updatedAt: new Date(),\n };\n}\n\n/**\n * Mock handler for TestToolCommand.\n */\nexport async function mockTestToolHandler(input: {\n toolId: string;\n testInput: Record<string, unknown>;\n}) {\n const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);\n if (!tool) throw new Error('TOOL_NOT_FOUND');\n\n // Simulate tool execution\n const startTime = Date.now();\n await new Promise((resolve) => setTimeout(resolve, 100));\n\n return {\n success: true,\n output: { result: 'Test successful', input: input.testInput },\n durationMs: Date.now() - startTime,\n };\n}\n"],"mappings":";;;;;;;;;AA8CA,eAAsB,qBACpB,OAC0B;CAC1B,MAAM,EACJ,gBACA,UACA,QACA,QACA,QAAQ,IACR,SAAS,MACP;CAEJ,IAAI,WAAW,WAAW,QAAQ,MAAM,EAAE,mBAAmB,eAAe;AAC5E,KAAI,SAAU,YAAW,SAAS,QAAQ,MAAM,EAAE,aAAa,SAAS;AACxE,KAAI,OAAQ,YAAW,SAAS,QAAQ,MAAM,EAAE,WAAW,OAAO;AAClE,KAAI,QAAQ;EACV,MAAM,IAAI,OAAO,aAAa;AAC9B,aAAW,SAAS,QACjB,MACC,EAAE,KAAK,aAAa,CAAC,SAAS,EAAE,IAChC,EAAE,YAAY,aAAa,CAAC,SAAS,EAAE,CAC1C;;CAGH,MAAM,QAAQ,SAAS;AAYvB,QAAO;EAAE,OAXK,SAAS,MAAM,QAAQ,SAAS,MAAM,CAAC,KAAK,OAAO;GAC/D,IAAI,EAAE;GACN,MAAM,EAAE;GACR,MAAM,EAAE;GACR,aAAa,EAAE;GACf,UAAU,EAAE;GACZ,QAAQ,EAAE;GACV,SAAS,EAAE;GACX,WAAW,EAAE;GACd,EAAE;EAEa;EAAO,SAAS,SAAS,QAAQ;EAAO;;;;;AAM1D,eAAsB,mBAAmB,OAA2B;CAClE,MAAM,OAAO,WAAW,MAAM,MAAM,EAAE,OAAO,MAAM,OAAO;AAC1D,KAAI,CAAC,KAAM,OAAM,IAAI,MAAM,iBAAiB;AAC5C,QAAO;;;;;AAMT,eAAsB,sBAAsB,OAMzC;AAID,KAHe,WAAW,MACvB,MAAM,EAAE,mBAAmB,MAAM,kBAAkB,EAAE,SAAS,MAAM,KACtE,CACW,OAAM,IAAI,MAAM,cAAc;AAC1C,QAAO;EACL,IAAI,QAAQ,KAAK,KAAK;EACtB,MAAM,MAAM;EACZ,MAAM,MAAM;EACZ,QAAQ;EACT;;;;;AAMH,eAAsB,sBAAsB,OAIzC;CACD,MAAM,OAAO,WAAW,MAAM,MAAM,EAAE,OAAO,MAAM,OAAO;AAC1D,KAAI,CAAC,KAAM,OAAM,IAAI,MAAM,iBAAiB;AAC5C,QAAO;EACL,IAAI,KAAK;EACT,MAAM,MAAM,QAAQ,KAAK;EACzB,QAAQ,MAAM,UAAU,KAAK;EAC7B,2BAAW,IAAI,MAAM;EACtB;;;;;AAMH,eAAsB,oBAAoB,OAGvC;AAED,KAAI,CADS,WAAW,MAAM,MAAM,EAAE,OAAO,MAAM,OAAO,CAC/C,OAAM,IAAI,MAAM,iBAAiB;CAG5C,MAAM,YAAY,KAAK,KAAK;AAC5B,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,IAAI,CAAC;AAExD,QAAO;EACL,SAAS;EACT,QAAQ;GAAE,QAAQ;GAAmB,OAAO,MAAM;GAAW;EAC7D,YAAY,KAAK,KAAK,GAAG;EAC1B"}
|