@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,205 @@
|
|
|
1
|
+
import { defineEntity, defineEntityEnum, field, index } from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/run/run.entity.ts
|
|
4
|
+
/**
|
|
5
|
+
* Run status enum for entities.
|
|
6
|
+
*/
|
|
7
|
+
const RunStatusEntityEnum = defineEntityEnum({
|
|
8
|
+
name: "RunStatus",
|
|
9
|
+
values: [
|
|
10
|
+
"QUEUED",
|
|
11
|
+
"IN_PROGRESS",
|
|
12
|
+
"COMPLETED",
|
|
13
|
+
"FAILED",
|
|
14
|
+
"CANCELLED",
|
|
15
|
+
"EXPIRED"
|
|
16
|
+
],
|
|
17
|
+
description: "Status of an agent run"
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Run step type enum for entities.
|
|
21
|
+
*/
|
|
22
|
+
const RunStepTypeEntityEnum = defineEntityEnum({
|
|
23
|
+
name: "RunStepType",
|
|
24
|
+
values: [
|
|
25
|
+
"MESSAGE_CREATION",
|
|
26
|
+
"TOOL_CALL",
|
|
27
|
+
"TOOL_RESULT",
|
|
28
|
+
"ERROR"
|
|
29
|
+
],
|
|
30
|
+
description: "Type of run step"
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Log level enum for entities.
|
|
34
|
+
*/
|
|
35
|
+
const LogLevelEntityEnum = defineEntityEnum({
|
|
36
|
+
name: "LogLevel",
|
|
37
|
+
values: [
|
|
38
|
+
"DEBUG",
|
|
39
|
+
"INFO",
|
|
40
|
+
"WARN",
|
|
41
|
+
"ERROR"
|
|
42
|
+
],
|
|
43
|
+
description: "Log level"
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Run entity - Represents an agent execution.
|
|
47
|
+
*/
|
|
48
|
+
const RunEntity = defineEntity({
|
|
49
|
+
name: "Run",
|
|
50
|
+
schema: "agent_console",
|
|
51
|
+
description: "An execution of an agent with input/output and metrics.",
|
|
52
|
+
fields: {
|
|
53
|
+
id: field.id(),
|
|
54
|
+
organizationId: field.string({ description: "Organization ID" }),
|
|
55
|
+
agentId: field.foreignKey({ description: "Agent being executed" }),
|
|
56
|
+
userId: field.string({
|
|
57
|
+
isOptional: true,
|
|
58
|
+
description: "User who initiated the run"
|
|
59
|
+
}),
|
|
60
|
+
sessionId: field.string({
|
|
61
|
+
isOptional: true,
|
|
62
|
+
description: "Conversation session ID"
|
|
63
|
+
}),
|
|
64
|
+
input: field.json({ description: "Input data for the run" }),
|
|
65
|
+
output: field.json({
|
|
66
|
+
isOptional: true,
|
|
67
|
+
description: "Output result from the run"
|
|
68
|
+
}),
|
|
69
|
+
status: field.enum("RunStatus", { default: "QUEUED" }),
|
|
70
|
+
errorMessage: field.string({
|
|
71
|
+
isOptional: true,
|
|
72
|
+
description: "Error message if failed"
|
|
73
|
+
}),
|
|
74
|
+
errorCode: field.string({
|
|
75
|
+
isOptional: true,
|
|
76
|
+
description: "Error code if failed"
|
|
77
|
+
}),
|
|
78
|
+
totalTokens: field.int({
|
|
79
|
+
default: 0,
|
|
80
|
+
description: "Total tokens used"
|
|
81
|
+
}),
|
|
82
|
+
promptTokens: field.int({
|
|
83
|
+
default: 0,
|
|
84
|
+
description: "Prompt tokens used"
|
|
85
|
+
}),
|
|
86
|
+
completionTokens: field.int({
|
|
87
|
+
default: 0,
|
|
88
|
+
description: "Completion tokens used"
|
|
89
|
+
}),
|
|
90
|
+
totalIterations: field.int({
|
|
91
|
+
default: 0,
|
|
92
|
+
description: "Number of iterations"
|
|
93
|
+
}),
|
|
94
|
+
durationMs: field.int({
|
|
95
|
+
isOptional: true,
|
|
96
|
+
description: "Execution duration in ms"
|
|
97
|
+
}),
|
|
98
|
+
estimatedCostUsd: field.float({
|
|
99
|
+
isOptional: true,
|
|
100
|
+
description: "Estimated cost in USD"
|
|
101
|
+
}),
|
|
102
|
+
queuedAt: field.dateTime({ description: "When run was queued" }),
|
|
103
|
+
startedAt: field.dateTime({
|
|
104
|
+
isOptional: true,
|
|
105
|
+
description: "When run started executing"
|
|
106
|
+
}),
|
|
107
|
+
completedAt: field.dateTime({
|
|
108
|
+
isOptional: true,
|
|
109
|
+
description: "When run completed"
|
|
110
|
+
}),
|
|
111
|
+
metadata: field.json({
|
|
112
|
+
isOptional: true,
|
|
113
|
+
description: "Additional metadata"
|
|
114
|
+
}),
|
|
115
|
+
agent: field.belongsTo("Agent", ["agentId"], ["id"]),
|
|
116
|
+
steps: field.hasMany("RunStep", { description: "Execution steps" }),
|
|
117
|
+
logs: field.hasMany("RunLog", { description: "Execution logs" })
|
|
118
|
+
},
|
|
119
|
+
indexes: [
|
|
120
|
+
index.on([
|
|
121
|
+
"organizationId",
|
|
122
|
+
"agentId",
|
|
123
|
+
"queuedAt"
|
|
124
|
+
]),
|
|
125
|
+
index.on(["organizationId", "status"]),
|
|
126
|
+
index.on(["agentId", "status"]),
|
|
127
|
+
index.on(["sessionId"])
|
|
128
|
+
],
|
|
129
|
+
enums: [RunStatusEntityEnum]
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* RunStep entity - Individual step in a run.
|
|
133
|
+
*/
|
|
134
|
+
const RunStepEntity = defineEntity({
|
|
135
|
+
name: "RunStep",
|
|
136
|
+
schema: "agent_console",
|
|
137
|
+
description: "An individual step in an agent run.",
|
|
138
|
+
fields: {
|
|
139
|
+
id: field.id(),
|
|
140
|
+
runId: field.foreignKey({ description: "Parent run" }),
|
|
141
|
+
stepNumber: field.int({ description: "Step sequence number" }),
|
|
142
|
+
type: field.enum("RunStepType"),
|
|
143
|
+
toolId: field.string({
|
|
144
|
+
isOptional: true,
|
|
145
|
+
description: "Tool used in this step"
|
|
146
|
+
}),
|
|
147
|
+
toolName: field.string({
|
|
148
|
+
isOptional: true,
|
|
149
|
+
description: "Tool name"
|
|
150
|
+
}),
|
|
151
|
+
input: field.json({
|
|
152
|
+
isOptional: true,
|
|
153
|
+
description: "Step input"
|
|
154
|
+
}),
|
|
155
|
+
output: field.json({
|
|
156
|
+
isOptional: true,
|
|
157
|
+
description: "Step output"
|
|
158
|
+
}),
|
|
159
|
+
status: field.enum("RunStatus"),
|
|
160
|
+
errorMessage: field.string({ isOptional: true }),
|
|
161
|
+
tokensUsed: field.int({ default: 0 }),
|
|
162
|
+
durationMs: field.int({ isOptional: true }),
|
|
163
|
+
startedAt: field.dateTime(),
|
|
164
|
+
completedAt: field.dateTime({ isOptional: true }),
|
|
165
|
+
run: field.belongsTo("Run", ["runId"], ["id"])
|
|
166
|
+
},
|
|
167
|
+
indexes: [index.on(["runId", "stepNumber"])],
|
|
168
|
+
enums: [RunStepTypeEntityEnum]
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* RunLog entity - Log entry for a run.
|
|
172
|
+
*/
|
|
173
|
+
const RunLogEntity = defineEntity({
|
|
174
|
+
name: "RunLog",
|
|
175
|
+
schema: "agent_console",
|
|
176
|
+
description: "A log entry for an agent run.",
|
|
177
|
+
fields: {
|
|
178
|
+
id: field.id(),
|
|
179
|
+
runId: field.foreignKey({ description: "Parent run" }),
|
|
180
|
+
stepId: field.string({
|
|
181
|
+
isOptional: true,
|
|
182
|
+
description: "Related step"
|
|
183
|
+
}),
|
|
184
|
+
level: field.enum("LogLevel"),
|
|
185
|
+
message: field.string({ description: "Log message" }),
|
|
186
|
+
data: field.json({
|
|
187
|
+
isOptional: true,
|
|
188
|
+
description: "Additional log data"
|
|
189
|
+
}),
|
|
190
|
+
source: field.string({
|
|
191
|
+
isOptional: true,
|
|
192
|
+
description: "Log source component"
|
|
193
|
+
}),
|
|
194
|
+
traceId: field.string({ isOptional: true }),
|
|
195
|
+
spanId: field.string({ isOptional: true }),
|
|
196
|
+
timestamp: field.dateTime(),
|
|
197
|
+
run: field.belongsTo("Run", ["runId"], ["id"])
|
|
198
|
+
},
|
|
199
|
+
indexes: [index.on(["runId", "timestamp"]), index.on(["runId", "level"])],
|
|
200
|
+
enums: [LogLevelEntityEnum]
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
//#endregion
|
|
204
|
+
export { LogLevelEntityEnum, RunEntity, RunLogEntity, RunStatusEntityEnum, RunStepEntity, RunStepTypeEntityEnum };
|
|
205
|
+
//# sourceMappingURL=run.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.entity.js","names":[],"sources":["../../src/run/run.entity.ts"],"sourcesContent":["import {\n defineEntity,\n defineEntityEnum,\n field,\n index,\n} from '@contractspec/lib.schema';\n\n/**\n * Run status enum for entities.\n */\nexport const RunStatusEntityEnum = defineEntityEnum({\n name: 'RunStatus',\n values: [\n 'QUEUED',\n 'IN_PROGRESS',\n 'COMPLETED',\n 'FAILED',\n 'CANCELLED',\n 'EXPIRED',\n ],\n description: 'Status of an agent run',\n});\n\n/**\n * Run step type enum for entities.\n */\nexport const RunStepTypeEntityEnum = defineEntityEnum({\n name: 'RunStepType',\n values: ['MESSAGE_CREATION', 'TOOL_CALL', 'TOOL_RESULT', 'ERROR'],\n description: 'Type of run step',\n});\n\n/**\n * Log level enum for entities.\n */\nexport const LogLevelEntityEnum = defineEntityEnum({\n name: 'LogLevel',\n values: ['DEBUG', 'INFO', 'WARN', 'ERROR'],\n description: 'Log level',\n});\n\n/**\n * Run entity - Represents an agent execution.\n */\nexport const RunEntity = defineEntity({\n name: 'Run',\n schema: 'agent_console',\n description: 'An execution of an agent with input/output and metrics.',\n fields: {\n id: field.id(),\n organizationId: field.string({ description: 'Organization ID' }),\n agentId: field.foreignKey({ description: 'Agent being executed' }),\n userId: field.string({\n isOptional: true,\n description: 'User who initiated the run',\n }),\n sessionId: field.string({\n isOptional: true,\n description: 'Conversation session ID',\n }),\n input: field.json({ description: 'Input data for the run' }),\n output: field.json({\n isOptional: true,\n description: 'Output result from the run',\n }),\n status: field.enum('RunStatus', { default: 'QUEUED' }),\n errorMessage: field.string({\n isOptional: true,\n description: 'Error message if failed',\n }),\n errorCode: field.string({\n isOptional: true,\n description: 'Error code if failed',\n }),\n totalTokens: field.int({ default: 0, description: 'Total tokens used' }),\n promptTokens: field.int({ default: 0, description: 'Prompt tokens used' }),\n completionTokens: field.int({\n default: 0,\n description: 'Completion tokens used',\n }),\n totalIterations: field.int({\n default: 0,\n description: 'Number of iterations',\n }),\n durationMs: field.int({\n isOptional: true,\n description: 'Execution duration in ms',\n }),\n estimatedCostUsd: field.float({\n isOptional: true,\n description: 'Estimated cost in USD',\n }),\n queuedAt: field.dateTime({ description: 'When run was queued' }),\n startedAt: field.dateTime({\n isOptional: true,\n description: 'When run started executing',\n }),\n completedAt: field.dateTime({\n isOptional: true,\n description: 'When run completed',\n }),\n metadata: field.json({\n isOptional: true,\n description: 'Additional metadata',\n }),\n agent: field.belongsTo('Agent', ['agentId'], ['id']),\n steps: field.hasMany('RunStep', { description: 'Execution steps' }),\n logs: field.hasMany('RunLog', { description: 'Execution logs' }),\n },\n indexes: [\n index.on(['organizationId', 'agentId', 'queuedAt']),\n index.on(['organizationId', 'status']),\n index.on(['agentId', 'status']),\n index.on(['sessionId']),\n ],\n enums: [RunStatusEntityEnum],\n});\n\n/**\n * RunStep entity - Individual step in a run.\n */\nexport const RunStepEntity = defineEntity({\n name: 'RunStep',\n schema: 'agent_console',\n description: 'An individual step in an agent run.',\n fields: {\n id: field.id(),\n runId: field.foreignKey({ description: 'Parent run' }),\n stepNumber: field.int({ description: 'Step sequence number' }),\n type: field.enum('RunStepType'),\n toolId: field.string({\n isOptional: true,\n description: 'Tool used in this step',\n }),\n toolName: field.string({ isOptional: true, description: 'Tool name' }),\n input: field.json({ isOptional: true, description: 'Step input' }),\n output: field.json({ isOptional: true, description: 'Step output' }),\n status: field.enum('RunStatus'),\n errorMessage: field.string({ isOptional: true }),\n tokensUsed: field.int({ default: 0 }),\n durationMs: field.int({ isOptional: true }),\n startedAt: field.dateTime(),\n completedAt: field.dateTime({ isOptional: true }),\n run: field.belongsTo('Run', ['runId'], ['id']),\n },\n indexes: [index.on(['runId', 'stepNumber'])],\n enums: [RunStepTypeEntityEnum],\n});\n\n/**\n * RunLog entity - Log entry for a run.\n */\nexport const RunLogEntity = defineEntity({\n name: 'RunLog',\n schema: 'agent_console',\n description: 'A log entry for an agent run.',\n fields: {\n id: field.id(),\n runId: field.foreignKey({ description: 'Parent run' }),\n stepId: field.string({ isOptional: true, description: 'Related step' }),\n level: field.enum('LogLevel'),\n message: field.string({ description: 'Log message' }),\n data: field.json({ isOptional: true, description: 'Additional log data' }),\n source: field.string({\n isOptional: true,\n description: 'Log source component',\n }),\n traceId: field.string({ isOptional: true }),\n spanId: field.string({ isOptional: true }),\n timestamp: field.dateTime(),\n run: field.belongsTo('Run', ['runId'], ['id']),\n },\n indexes: [index.on(['runId', 'timestamp']), index.on(['runId', 'level'])],\n enums: [LogLevelEntityEnum],\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema89 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/run/run.enum.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Run status enum.
|
|
6
|
+
*/
|
|
7
|
+
declare const RunStatusEnum: _contractspec_lib_schema89.EnumType<[string, string, string, string, string, string]>;
|
|
8
|
+
/**
|
|
9
|
+
* Run step type enum.
|
|
10
|
+
*/
|
|
11
|
+
declare const RunStepTypeEnum: _contractspec_lib_schema89.EnumType<[string, string, string, string]>;
|
|
12
|
+
/**
|
|
13
|
+
* Log level enum.
|
|
14
|
+
*/
|
|
15
|
+
declare const LogLevelEnum: _contractspec_lib_schema89.EnumType<[string, string, string, string]>;
|
|
16
|
+
/**
|
|
17
|
+
* Granularity enum for metrics.
|
|
18
|
+
*/
|
|
19
|
+
declare const GranularityEnum: _contractspec_lib_schema89.EnumType<[string, string, string, string]>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { GranularityEnum, LogLevelEnum, RunStatusEnum, RunStepTypeEnum };
|
|
22
|
+
//# sourceMappingURL=run.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.enum.d.ts","names":[],"sources":["../../src/run/run.enum.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,aAOX,EAAA,0BAAA,CAPwB,QAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAY1B;AAUA;AAUA;cApBa,iBAKX,0BAAA,CAL0B;;;;cAUf,cAKX,0BAAA,CALuB;;;;cAUZ,iBAKX,0BAAA,CAL0B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/run/run.enum.ts
|
|
4
|
+
/**
|
|
5
|
+
* Run status enum.
|
|
6
|
+
*/
|
|
7
|
+
const RunStatusEnum = defineEnum("RunStatus", [
|
|
8
|
+
"QUEUED",
|
|
9
|
+
"IN_PROGRESS",
|
|
10
|
+
"COMPLETED",
|
|
11
|
+
"FAILED",
|
|
12
|
+
"CANCELLED",
|
|
13
|
+
"EXPIRED"
|
|
14
|
+
]);
|
|
15
|
+
/**
|
|
16
|
+
* Run step type enum.
|
|
17
|
+
*/
|
|
18
|
+
const RunStepTypeEnum = defineEnum("RunStepType", [
|
|
19
|
+
"MESSAGE_CREATION",
|
|
20
|
+
"TOOL_CALL",
|
|
21
|
+
"TOOL_RESULT",
|
|
22
|
+
"ERROR"
|
|
23
|
+
]);
|
|
24
|
+
/**
|
|
25
|
+
* Log level enum.
|
|
26
|
+
*/
|
|
27
|
+
const LogLevelEnum = defineEnum("LogLevel", [
|
|
28
|
+
"DEBUG",
|
|
29
|
+
"INFO",
|
|
30
|
+
"WARN",
|
|
31
|
+
"ERROR"
|
|
32
|
+
]);
|
|
33
|
+
/**
|
|
34
|
+
* Granularity enum for metrics.
|
|
35
|
+
*/
|
|
36
|
+
const GranularityEnum = defineEnum("Granularity", [
|
|
37
|
+
"hour",
|
|
38
|
+
"day",
|
|
39
|
+
"week",
|
|
40
|
+
"month"
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { GranularityEnum, LogLevelEnum, RunStatusEnum, RunStepTypeEnum };
|
|
45
|
+
//# sourceMappingURL=run.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.enum.js","names":[],"sources":["../../src/run/run.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Run status enum.\n */\nexport const RunStatusEnum = defineEnum('RunStatus', [\n 'QUEUED',\n 'IN_PROGRESS',\n 'COMPLETED',\n 'FAILED',\n 'CANCELLED',\n 'EXPIRED',\n]);\n\n/**\n * Run step type enum.\n */\nexport const RunStepTypeEnum = defineEnum('RunStepType', [\n 'MESSAGE_CREATION',\n 'TOOL_CALL',\n 'TOOL_RESULT',\n 'ERROR',\n]);\n\n/**\n * Log level enum.\n */\nexport const LogLevelEnum = defineEnum('LogLevel', [\n 'DEBUG',\n 'INFO',\n 'WARN',\n 'ERROR',\n]);\n\n/**\n * Granularity enum for metrics.\n */\nexport const GranularityEnum = defineEnum('Granularity', [\n 'hour',\n 'day',\n 'week',\n 'month',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,gBAAgB,WAAW,aAAa;CACnD;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,MAAa,kBAAkB,WAAW,eAAe;CACvD;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,MAAa,eAAe,WAAW,YAAY;CACjD;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,MAAa,kBAAkB,WAAW,eAAe;CACvD;CACA;CACA;CACA;CACD,CAAC"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts1 from "@contractspec/lib.contracts";
|
|
2
|
+
import * as _contractspec_lib_schema96 from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/run/run.event.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* RunStartedEvent - An agent run was started.
|
|
7
|
+
*/
|
|
8
|
+
declare const RunStartedEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
9
|
+
runId: {
|
|
10
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
organizationId: {
|
|
14
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
agentId: {
|
|
18
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
agentName: {
|
|
22
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
userId: {
|
|
26
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
29
|
+
sessionId: {
|
|
30
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
31
|
+
isOptional: true;
|
|
32
|
+
};
|
|
33
|
+
input: {
|
|
34
|
+
type: _contractspec_lib_schema96.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
35
|
+
isOptional: false;
|
|
36
|
+
};
|
|
37
|
+
startedAt: {
|
|
38
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
39
|
+
isOptional: false;
|
|
40
|
+
};
|
|
41
|
+
}>>;
|
|
42
|
+
/**
|
|
43
|
+
* RunCompletedEvent - An agent run completed successfully.
|
|
44
|
+
*/
|
|
45
|
+
declare const RunCompletedEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
46
|
+
runId: {
|
|
47
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
organizationId: {
|
|
51
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
agentId: {
|
|
55
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
agentName: {
|
|
59
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
60
|
+
isOptional: false;
|
|
61
|
+
};
|
|
62
|
+
userId: {
|
|
63
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
64
|
+
isOptional: true;
|
|
65
|
+
};
|
|
66
|
+
output: {
|
|
67
|
+
type: _contractspec_lib_schema96.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
68
|
+
isOptional: false;
|
|
69
|
+
};
|
|
70
|
+
totalTokens: {
|
|
71
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
72
|
+
isOptional: false;
|
|
73
|
+
};
|
|
74
|
+
promptTokens: {
|
|
75
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
76
|
+
isOptional: false;
|
|
77
|
+
};
|
|
78
|
+
completionTokens: {
|
|
79
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
80
|
+
isOptional: false;
|
|
81
|
+
};
|
|
82
|
+
totalIterations: {
|
|
83
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
84
|
+
isOptional: false;
|
|
85
|
+
};
|
|
86
|
+
durationMs: {
|
|
87
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
88
|
+
isOptional: false;
|
|
89
|
+
};
|
|
90
|
+
estimatedCostUsd: {
|
|
91
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
92
|
+
isOptional: true;
|
|
93
|
+
};
|
|
94
|
+
completedAt: {
|
|
95
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
96
|
+
isOptional: false;
|
|
97
|
+
};
|
|
98
|
+
}>>;
|
|
99
|
+
/**
|
|
100
|
+
* RunFailedEvent - An agent run failed.
|
|
101
|
+
*/
|
|
102
|
+
declare const RunFailedEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
103
|
+
runId: {
|
|
104
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
105
|
+
isOptional: false;
|
|
106
|
+
};
|
|
107
|
+
organizationId: {
|
|
108
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
109
|
+
isOptional: false;
|
|
110
|
+
};
|
|
111
|
+
agentId: {
|
|
112
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
113
|
+
isOptional: false;
|
|
114
|
+
};
|
|
115
|
+
agentName: {
|
|
116
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
117
|
+
isOptional: false;
|
|
118
|
+
};
|
|
119
|
+
userId: {
|
|
120
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
121
|
+
isOptional: true;
|
|
122
|
+
};
|
|
123
|
+
errorMessage: {
|
|
124
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
125
|
+
isOptional: false;
|
|
126
|
+
};
|
|
127
|
+
errorCode: {
|
|
128
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
129
|
+
isOptional: true;
|
|
130
|
+
};
|
|
131
|
+
totalTokens: {
|
|
132
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
133
|
+
isOptional: false;
|
|
134
|
+
};
|
|
135
|
+
totalIterations: {
|
|
136
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
137
|
+
isOptional: false;
|
|
138
|
+
};
|
|
139
|
+
durationMs: {
|
|
140
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
141
|
+
isOptional: true;
|
|
142
|
+
};
|
|
143
|
+
failedAt: {
|
|
144
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
145
|
+
isOptional: false;
|
|
146
|
+
};
|
|
147
|
+
}>>;
|
|
148
|
+
/**
|
|
149
|
+
* RunCancelledEvent - An agent run was cancelled.
|
|
150
|
+
*/
|
|
151
|
+
declare const RunCancelledEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
152
|
+
runId: {
|
|
153
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
154
|
+
isOptional: false;
|
|
155
|
+
};
|
|
156
|
+
organizationId: {
|
|
157
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
158
|
+
isOptional: false;
|
|
159
|
+
};
|
|
160
|
+
agentId: {
|
|
161
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
162
|
+
isOptional: false;
|
|
163
|
+
};
|
|
164
|
+
userId: {
|
|
165
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
166
|
+
isOptional: true;
|
|
167
|
+
};
|
|
168
|
+
cancelledBy: {
|
|
169
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
170
|
+
isOptional: true;
|
|
171
|
+
};
|
|
172
|
+
reason: {
|
|
173
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
174
|
+
isOptional: true;
|
|
175
|
+
};
|
|
176
|
+
totalTokens: {
|
|
177
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
178
|
+
isOptional: false;
|
|
179
|
+
};
|
|
180
|
+
totalIterations: {
|
|
181
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
182
|
+
isOptional: false;
|
|
183
|
+
};
|
|
184
|
+
cancelledAt: {
|
|
185
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
186
|
+
isOptional: false;
|
|
187
|
+
};
|
|
188
|
+
}>>;
|
|
189
|
+
/**
|
|
190
|
+
* ToolInvokedEvent - A tool was invoked during a run.
|
|
191
|
+
*/
|
|
192
|
+
declare const ToolInvokedEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
193
|
+
runId: {
|
|
194
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
195
|
+
isOptional: false;
|
|
196
|
+
};
|
|
197
|
+
stepId: {
|
|
198
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
199
|
+
isOptional: false;
|
|
200
|
+
};
|
|
201
|
+
toolId: {
|
|
202
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
203
|
+
isOptional: false;
|
|
204
|
+
};
|
|
205
|
+
toolName: {
|
|
206
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
207
|
+
isOptional: false;
|
|
208
|
+
};
|
|
209
|
+
input: {
|
|
210
|
+
type: _contractspec_lib_schema96.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
211
|
+
isOptional: false;
|
|
212
|
+
};
|
|
213
|
+
invokedAt: {
|
|
214
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
215
|
+
isOptional: false;
|
|
216
|
+
};
|
|
217
|
+
}>>;
|
|
218
|
+
/**
|
|
219
|
+
* ToolCompletedEvent - A tool invocation completed.
|
|
220
|
+
*/
|
|
221
|
+
declare const ToolCompletedEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
222
|
+
runId: {
|
|
223
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
224
|
+
isOptional: false;
|
|
225
|
+
};
|
|
226
|
+
stepId: {
|
|
227
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
228
|
+
isOptional: false;
|
|
229
|
+
};
|
|
230
|
+
toolId: {
|
|
231
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
232
|
+
isOptional: false;
|
|
233
|
+
};
|
|
234
|
+
toolName: {
|
|
235
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
236
|
+
isOptional: false;
|
|
237
|
+
};
|
|
238
|
+
success: {
|
|
239
|
+
type: _contractspec_lib_schema96.FieldType<boolean, boolean>;
|
|
240
|
+
isOptional: false;
|
|
241
|
+
};
|
|
242
|
+
output: {
|
|
243
|
+
type: _contractspec_lib_schema96.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
244
|
+
isOptional: true;
|
|
245
|
+
};
|
|
246
|
+
errorMessage: {
|
|
247
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
248
|
+
isOptional: true;
|
|
249
|
+
};
|
|
250
|
+
durationMs: {
|
|
251
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
252
|
+
isOptional: false;
|
|
253
|
+
};
|
|
254
|
+
completedAt: {
|
|
255
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
256
|
+
isOptional: false;
|
|
257
|
+
};
|
|
258
|
+
}>>;
|
|
259
|
+
/**
|
|
260
|
+
* MessageGeneratedEvent - Agent generated a message.
|
|
261
|
+
*/
|
|
262
|
+
declare const MessageGeneratedEvent: _contractspec_lib_contracts1.EventSpec<_contractspec_lib_schema96.SchemaModel<{
|
|
263
|
+
runId: {
|
|
264
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
265
|
+
isOptional: false;
|
|
266
|
+
};
|
|
267
|
+
stepId: {
|
|
268
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
269
|
+
isOptional: false;
|
|
270
|
+
};
|
|
271
|
+
messageType: {
|
|
272
|
+
type: _contractspec_lib_schema96.EnumType<[string, string]>;
|
|
273
|
+
isOptional: false;
|
|
274
|
+
};
|
|
275
|
+
content: {
|
|
276
|
+
type: _contractspec_lib_schema96.FieldType<string, string>;
|
|
277
|
+
isOptional: false;
|
|
278
|
+
};
|
|
279
|
+
tokensUsed: {
|
|
280
|
+
type: _contractspec_lib_schema96.FieldType<number, number>;
|
|
281
|
+
isOptional: false;
|
|
282
|
+
};
|
|
283
|
+
generatedAt: {
|
|
284
|
+
type: _contractspec_lib_schema96.FieldType<Date, string>;
|
|
285
|
+
isOptional: false;
|
|
286
|
+
};
|
|
287
|
+
}>>;
|
|
288
|
+
//#endregion
|
|
289
|
+
export { MessageGeneratedEvent, RunCancelledEvent, RunCompletedEvent, RunFailedEvent, RunStartedEvent, ToolCompletedEvent, ToolInvokedEvent };
|
|
290
|
+
//# sourceMappingURL=run.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.event.d.ts","names":[],"sources":["../../src/run/run.event.ts"],"sourcesContent":[],"mappings":";;;;;;;cA6Ba,iBAAe,4BAAA,CAAA,qCAAA;EAAf,KAAA,EAAA;IAUX,IAAA,EAAA,0BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;IAV0B,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EA+Cf,CAAA;EAUX,MAAA,EAAA;;;;;;;;;;;;;;;;;;;AA6BF;AAUE,cAjDW,iBAiDX,EAjD4B,4BAAA,CAAA,SAiD5B,4BAjD4B,WAiD5B,CAAA;;UAvCA,0BAAA,CAAA;;;;;;;;;;;EA6ByB,SAAA,EAAA;IAAA,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAqCd,UAAA,EAAA,KAUX;EAAA,CAAA;;;;;;;;;;8CAV4B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;EA+BjB,YAAA,EAAA;IAUX,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;EAV2B,CAAA;EAAA,UAAA,EAAA;IAkChB,IAAA,sCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;AAV6B,cAtGlB,cAsGkB,EAtGJ,4BAAA,CAAA,SAsGI,4BAtGJ,WAsGI,CAAA;EAoClB,KAAA,EAAA;IAUX,IAAA,EA1IA,0BAAA,CAAA,SA0IA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;IAVgC,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cArGrB,mBAAiB,4BAAA,CAAA,qCAAA;;UAU5B,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqBW,kBAAgB,4BAAA,CAAA,qCAAA;;UAU3B,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwBW,oBAAkB,4BAAA,CAAA,qCAAA;;UAU7B,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0BW,uBAAqB,4BAAA,CAAA,qCAAA;;UAUhC,0BAAA,CAAA"}
|