@contractspec/example.agent-console 3.8.9 → 3.8.11
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.log +225 -222
- package/CHANGELOG.md +30 -0
- package/dist/agent/agent.entity.js +1 -127
- package/dist/agent/agent.enum.js +1 -25
- package/dist/agent/agent.event.js +1 -116
- package/dist/agent/agent.handler.js +1 -1030
- package/dist/agent/agent.operation.js +1 -735
- package/dist/agent/agent.presentation.js +1 -282
- package/dist/agent/agent.schema.js +1 -215
- package/dist/agent/agent.test-spec.js +1 -58
- package/dist/agent/index.js +1 -1248
- package/dist/agent.capability.js +1 -19
- package/dist/agent.feature.js +1 -305
- package/dist/browser/agent/agent.entity.js +1 -127
- package/dist/browser/agent/agent.enum.js +1 -25
- package/dist/browser/agent/agent.event.js +1 -116
- package/dist/browser/agent/agent.handler.js +1 -1030
- package/dist/browser/agent/agent.operation.js +1 -735
- package/dist/browser/agent/agent.presentation.js +1 -282
- package/dist/browser/agent/agent.schema.js +1 -215
- package/dist/browser/agent/agent.test-spec.js +1 -58
- package/dist/browser/agent/index.js +1 -1248
- package/dist/browser/agent.capability.js +1 -19
- package/dist/browser/agent.feature.js +1 -305
- package/dist/browser/docs/agent-console.docblock.js +5 -49
- package/dist/browser/docs/index.js +5 -49
- package/dist/browser/example.js +1 -41
- package/dist/browser/handlers/agent.handlers.js +6 -2143
- package/dist/browser/handlers/index.js +6 -2943
- package/dist/browser/index.js +14 -6828
- package/dist/browser/presentations/index.js +1 -693
- package/dist/browser/run/index.js +1 -1363
- package/dist/browser/run/run.entity.js +1 -160
- package/dist/browser/run/run.enum.js +1 -34
- package/dist/browser/run/run.event.js +1 -217
- package/dist/browser/run/run.handler.js +1 -919
- package/dist/browser/run/run.operation.js +1 -667
- package/dist/browser/run/run.presentation.js +1 -223
- package/dist/browser/run/run.schema.js +1 -179
- package/dist/browser/run/run.test-spec.js +1 -58
- package/dist/browser/seeders/index.js +2 -21
- package/dist/browser/shared/index.js +1 -626
- package/dist/browser/shared/mock-agents.js +1 -82
- package/dist/browser/shared/mock-runs.js +1 -113
- package/dist/browser/shared/mock-tools.js +1 -146
- package/dist/browser/tool/index.js +1 -949
- package/dist/browser/tool/tool.entity.js +1 -90
- package/dist/browser/tool/tool.enum.js +1 -26
- package/dist/browser/tool/tool.event.js +1 -99
- package/dist/browser/tool/tool.handler.js +1 -699
- package/dist/browser/tool/tool.operation.js +1 -482
- package/dist/browser/tool/tool.presentation.js +1 -188
- package/dist/browser/tool/tool.schema.js +1 -141
- package/dist/browser/tool/tool.test-spec.js +1 -58
- package/dist/browser/ui/AgentDashboard.js +1 -2527
- package/dist/browser/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/browser/ui/AgentRunList.js +1 -482
- package/dist/browser/ui/AgentToolRegistry.js +1 -212
- package/dist/browser/ui/ExecutionConsoleHost.js +1 -0
- package/dist/browser/ui/hooks/index.js +1 -740
- package/dist/browser/ui/hooks/useAgentList.js +1 -55
- package/dist/browser/ui/hooks/useAgentMutations.js +1 -530
- package/dist/browser/ui/hooks/useRunList.js +1 -70
- package/dist/browser/ui/hooks/useToolList.js +1 -85
- package/dist/browser/ui/index.js +5 -3018
- package/dist/browser/ui/modals/AgentActionsModal.js +1 -304
- package/dist/browser/ui/modals/CreateAgentModal.js +1 -243
- package/dist/browser/ui/modals/index.js +1 -546
- package/dist/browser/ui/overlays/demo-overlays.js +1 -64
- package/dist/browser/ui/overlays/index.js +1 -64
- package/dist/browser/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/browser/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/browser/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/browser/ui/renderers/index.js +5 -642
- package/dist/browser/ui/renderers/run-list.markdown.js +2 -50
- package/dist/browser/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/browser/ui/views/AgentListView.js +1 -165
- package/dist/browser/ui/views/RunDataTable.js +1 -326
- package/dist/browser/ui/views/RunListView.js +1 -479
- package/dist/browser/ui/views/ToolRegistryView.js +1 -209
- package/dist/browser/ui/views/index.js +1 -851
- package/dist/browser/ui/views/run-data-table.columns.js +1 -271
- package/dist/browser/ui/views/run-list.shared.js +1 -177
- package/dist/browser/visualizations/catalog.js +1 -134
- package/dist/browser/visualizations/index.js +1 -187
- package/dist/browser/visualizations/selectors.js +1 -181
- package/dist/docs/agent-console.docblock.js +5 -49
- package/dist/docs/index.js +5 -49
- package/dist/example.js +1 -41
- package/dist/handlers/agent.handlers.js +6 -2143
- package/dist/handlers/index.js +6 -2943
- package/dist/index.js +14 -6828
- package/dist/node/agent/agent.entity.js +1 -127
- package/dist/node/agent/agent.enum.js +1 -25
- package/dist/node/agent/agent.event.js +1 -116
- package/dist/node/agent/agent.handler.js +1 -1030
- package/dist/node/agent/agent.operation.js +1 -735
- package/dist/node/agent/agent.presentation.js +1 -282
- package/dist/node/agent/agent.schema.js +1 -215
- package/dist/node/agent/agent.test-spec.js +1 -58
- package/dist/node/agent/index.js +1 -1248
- package/dist/node/agent.capability.js +1 -19
- package/dist/node/agent.feature.js +1 -305
- package/dist/node/docs/agent-console.docblock.js +5 -49
- package/dist/node/docs/index.js +5 -49
- package/dist/node/example.js +1 -41
- package/dist/node/handlers/agent.handlers.js +6 -2143
- package/dist/node/handlers/index.js +6 -2943
- package/dist/node/index.js +14 -6828
- package/dist/node/presentations/index.js +1 -693
- package/dist/node/run/index.js +1 -1363
- package/dist/node/run/run.entity.js +1 -160
- package/dist/node/run/run.enum.js +1 -34
- package/dist/node/run/run.event.js +1 -217
- package/dist/node/run/run.handler.js +1 -919
- package/dist/node/run/run.operation.js +1 -667
- package/dist/node/run/run.presentation.js +1 -223
- package/dist/node/run/run.schema.js +1 -179
- package/dist/node/run/run.test-spec.js +1 -58
- package/dist/node/seeders/index.js +2 -21
- package/dist/node/shared/index.js +1 -626
- package/dist/node/shared/mock-agents.js +1 -82
- package/dist/node/shared/mock-runs.js +1 -113
- package/dist/node/shared/mock-tools.js +1 -146
- package/dist/node/tool/index.js +1 -949
- package/dist/node/tool/tool.entity.js +1 -90
- package/dist/node/tool/tool.enum.js +1 -26
- package/dist/node/tool/tool.event.js +1 -99
- package/dist/node/tool/tool.handler.js +1 -699
- package/dist/node/tool/tool.operation.js +1 -482
- package/dist/node/tool/tool.presentation.js +1 -188
- package/dist/node/tool/tool.schema.js +1 -141
- package/dist/node/tool/tool.test-spec.js +1 -58
- package/dist/node/ui/AgentDashboard.js +1 -2527
- package/dist/node/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/node/ui/AgentRunList.js +1 -482
- package/dist/node/ui/AgentToolRegistry.js +1 -212
- package/dist/node/ui/ExecutionConsoleHost.js +1 -0
- package/dist/node/ui/hooks/index.js +1 -740
- package/dist/node/ui/hooks/useAgentList.js +1 -55
- package/dist/node/ui/hooks/useAgentMutations.js +1 -530
- package/dist/node/ui/hooks/useRunList.js +1 -70
- package/dist/node/ui/hooks/useToolList.js +1 -85
- package/dist/node/ui/index.js +5 -3018
- package/dist/node/ui/modals/AgentActionsModal.js +1 -304
- package/dist/node/ui/modals/CreateAgentModal.js +1 -243
- package/dist/node/ui/modals/index.js +1 -546
- package/dist/node/ui/overlays/demo-overlays.js +1 -64
- package/dist/node/ui/overlays/index.js +1 -64
- package/dist/node/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/node/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/node/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/node/ui/renderers/index.js +5 -642
- package/dist/node/ui/renderers/run-list.markdown.js +2 -50
- package/dist/node/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/node/ui/views/AgentListView.js +1 -165
- package/dist/node/ui/views/RunDataTable.js +1 -326
- package/dist/node/ui/views/RunListView.js +1 -479
- package/dist/node/ui/views/ToolRegistryView.js +1 -209
- package/dist/node/ui/views/index.js +1 -851
- package/dist/node/ui/views/run-data-table.columns.js +1 -271
- package/dist/node/ui/views/run-list.shared.js +1 -177
- package/dist/node/visualizations/catalog.js +1 -134
- package/dist/node/visualizations/index.js +1 -187
- package/dist/node/visualizations/selectors.js +1 -181
- package/dist/presentations/index.js +1 -693
- package/dist/run/index.js +1 -1363
- package/dist/run/run.entity.js +1 -160
- package/dist/run/run.enum.js +1 -34
- package/dist/run/run.event.js +1 -217
- package/dist/run/run.handler.js +1 -919
- package/dist/run/run.operation.js +1 -667
- package/dist/run/run.presentation.js +1 -223
- package/dist/run/run.schema.js +1 -179
- package/dist/run/run.test-spec.js +1 -58
- package/dist/seeders/index.js +2 -21
- package/dist/shared/index.js +1 -626
- package/dist/shared/mock-agents.js +1 -82
- package/dist/shared/mock-runs.js +1 -113
- package/dist/shared/mock-tools.js +1 -146
- package/dist/tool/index.js +1 -949
- package/dist/tool/tool.entity.js +1 -90
- package/dist/tool/tool.enum.js +1 -26
- package/dist/tool/tool.event.js +1 -99
- package/dist/tool/tool.handler.js +1 -699
- package/dist/tool/tool.operation.js +1 -482
- package/dist/tool/tool.presentation.js +1 -188
- package/dist/tool/tool.schema.js +1 -141
- package/dist/tool/tool.test-spec.js +1 -58
- package/dist/ui/AgentDashboard.js +1 -2527
- package/dist/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/ui/AgentRunList.js +1 -482
- package/dist/ui/AgentToolRegistry.js +1 -212
- package/dist/ui/ExecutionConsoleHost.d.ts +1 -0
- package/dist/ui/ExecutionConsoleHost.js +2 -0
- package/dist/ui/ExecutionConsoleHost.test.d.ts +1 -0
- package/dist/ui/hooks/index.js +1 -740
- package/dist/ui/hooks/useAgentList.js +1 -55
- package/dist/ui/hooks/useAgentMutations.js +1 -530
- package/dist/ui/hooks/useRunList.js +1 -70
- package/dist/ui/hooks/useToolList.js +1 -85
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +5 -3018
- package/dist/ui/modals/AgentActionsModal.js +1 -304
- package/dist/ui/modals/CreateAgentModal.js +1 -243
- package/dist/ui/modals/index.js +1 -546
- package/dist/ui/overlays/demo-overlays.js +1 -64
- package/dist/ui/overlays/index.js +1 -64
- package/dist/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/ui/renderers/index.js +5 -642
- package/dist/ui/renderers/run-list.markdown.js +2 -50
- package/dist/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/ui/views/AgentListView.js +1 -165
- package/dist/ui/views/RunDataTable.js +1 -326
- package/dist/ui/views/RunListView.js +1 -479
- package/dist/ui/views/ToolRegistryView.js +1 -209
- package/dist/ui/views/index.js +1 -851
- package/dist/ui/views/run-data-table.columns.js +1 -271
- package/dist/ui/views/run-list.shared.js +1 -177
- package/dist/visualizations/catalog.js +1 -134
- package/dist/visualizations/index.js +1 -187
- package/dist/visualizations/selectors.js +1 -181
- package/package.json +26 -10
- package/src/ui/ExecutionConsoleHost.test.tsx +110 -0
- package/src/ui/ExecutionConsoleHost.tsx +14 -0
- package/src/ui/index.ts +1 -1
package/dist/run/run.entity.js
CHANGED
|
@@ -1,161 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
defineEntity,
|
|
5
|
-
defineEntityEnum,
|
|
6
|
-
field,
|
|
7
|
-
index
|
|
8
|
-
} from "@contractspec/lib.schema";
|
|
9
|
-
var RunStatusEntityEnum = defineEntityEnum({
|
|
10
|
-
name: "RunStatus",
|
|
11
|
-
values: [
|
|
12
|
-
"QUEUED",
|
|
13
|
-
"IN_PROGRESS",
|
|
14
|
-
"COMPLETED",
|
|
15
|
-
"FAILED",
|
|
16
|
-
"CANCELLED",
|
|
17
|
-
"EXPIRED"
|
|
18
|
-
],
|
|
19
|
-
description: "Status of an agent run"
|
|
20
|
-
});
|
|
21
|
-
var RunStepTypeEntityEnum = defineEntityEnum({
|
|
22
|
-
name: "RunStepType",
|
|
23
|
-
values: ["MESSAGE_CREATION", "TOOL_CALL", "TOOL_RESULT", "ERROR"],
|
|
24
|
-
description: "Type of run step"
|
|
25
|
-
});
|
|
26
|
-
var LogLevelEntityEnum = defineEntityEnum({
|
|
27
|
-
name: "LogLevel",
|
|
28
|
-
values: ["DEBUG", "INFO", "WARN", "ERROR"],
|
|
29
|
-
description: "Log level"
|
|
30
|
-
});
|
|
31
|
-
var RunEntity = defineEntity({
|
|
32
|
-
name: "Run",
|
|
33
|
-
schema: "agent_console",
|
|
34
|
-
description: "An execution of an agent with input/output and metrics.",
|
|
35
|
-
fields: {
|
|
36
|
-
id: field.id(),
|
|
37
|
-
organizationId: field.string({ description: "Organization ID" }),
|
|
38
|
-
agentId: field.foreignKey({ description: "Agent being executed" }),
|
|
39
|
-
userId: field.string({
|
|
40
|
-
isOptional: true,
|
|
41
|
-
description: "User who initiated the run"
|
|
42
|
-
}),
|
|
43
|
-
sessionId: field.string({
|
|
44
|
-
isOptional: true,
|
|
45
|
-
description: "Conversation session ID"
|
|
46
|
-
}),
|
|
47
|
-
input: field.json({ description: "Input data for the run" }),
|
|
48
|
-
output: field.json({
|
|
49
|
-
isOptional: true,
|
|
50
|
-
description: "Output result from the run"
|
|
51
|
-
}),
|
|
52
|
-
status: field.enum("RunStatus", { default: "QUEUED" }),
|
|
53
|
-
errorMessage: field.string({
|
|
54
|
-
isOptional: true,
|
|
55
|
-
description: "Error message if failed"
|
|
56
|
-
}),
|
|
57
|
-
errorCode: field.string({
|
|
58
|
-
isOptional: true,
|
|
59
|
-
description: "Error code if failed"
|
|
60
|
-
}),
|
|
61
|
-
totalTokens: field.int({ default: 0, description: "Total tokens used" }),
|
|
62
|
-
promptTokens: field.int({ default: 0, description: "Prompt tokens used" }),
|
|
63
|
-
completionTokens: field.int({
|
|
64
|
-
default: 0,
|
|
65
|
-
description: "Completion tokens used"
|
|
66
|
-
}),
|
|
67
|
-
totalIterations: field.int({
|
|
68
|
-
default: 0,
|
|
69
|
-
description: "Number of iterations"
|
|
70
|
-
}),
|
|
71
|
-
durationMs: field.int({
|
|
72
|
-
isOptional: true,
|
|
73
|
-
description: "Execution duration in ms"
|
|
74
|
-
}),
|
|
75
|
-
estimatedCostUsd: field.float({
|
|
76
|
-
isOptional: true,
|
|
77
|
-
description: "Estimated cost in USD"
|
|
78
|
-
}),
|
|
79
|
-
queuedAt: field.dateTime({ description: "When run was queued" }),
|
|
80
|
-
startedAt: field.dateTime({
|
|
81
|
-
isOptional: true,
|
|
82
|
-
description: "When run started executing"
|
|
83
|
-
}),
|
|
84
|
-
completedAt: field.dateTime({
|
|
85
|
-
isOptional: true,
|
|
86
|
-
description: "When run completed"
|
|
87
|
-
}),
|
|
88
|
-
metadata: field.json({
|
|
89
|
-
isOptional: true,
|
|
90
|
-
description: "Additional metadata"
|
|
91
|
-
}),
|
|
92
|
-
agent: field.belongsTo("Agent", ["agentId"], ["id"]),
|
|
93
|
-
steps: field.hasMany("RunStep", { description: "Execution steps" }),
|
|
94
|
-
logs: field.hasMany("RunLog", { description: "Execution logs" })
|
|
95
|
-
},
|
|
96
|
-
indexes: [
|
|
97
|
-
index.on(["organizationId", "agentId", "queuedAt"]),
|
|
98
|
-
index.on(["organizationId", "status"]),
|
|
99
|
-
index.on(["agentId", "status"]),
|
|
100
|
-
index.on(["sessionId"])
|
|
101
|
-
],
|
|
102
|
-
enums: [RunStatusEntityEnum]
|
|
103
|
-
});
|
|
104
|
-
var RunStepEntity = defineEntity({
|
|
105
|
-
name: "RunStep",
|
|
106
|
-
schema: "agent_console",
|
|
107
|
-
description: "An individual step in an agent run.",
|
|
108
|
-
fields: {
|
|
109
|
-
id: field.id(),
|
|
110
|
-
runId: field.foreignKey({ description: "Parent run" }),
|
|
111
|
-
stepNumber: field.int({ description: "Step sequence number" }),
|
|
112
|
-
type: field.enum("RunStepType"),
|
|
113
|
-
toolId: field.string({
|
|
114
|
-
isOptional: true,
|
|
115
|
-
description: "Tool used in this step"
|
|
116
|
-
}),
|
|
117
|
-
toolName: field.string({ isOptional: true, description: "Tool name" }),
|
|
118
|
-
input: field.json({ isOptional: true, description: "Step input" }),
|
|
119
|
-
output: field.json({ isOptional: true, description: "Step output" }),
|
|
120
|
-
status: field.enum("RunStatus"),
|
|
121
|
-
errorMessage: field.string({ isOptional: true }),
|
|
122
|
-
tokensUsed: field.int({ default: 0 }),
|
|
123
|
-
durationMs: field.int({ isOptional: true }),
|
|
124
|
-
startedAt: field.dateTime(),
|
|
125
|
-
completedAt: field.dateTime({ isOptional: true }),
|
|
126
|
-
run: field.belongsTo("Run", ["runId"], ["id"])
|
|
127
|
-
},
|
|
128
|
-
indexes: [index.on(["runId", "stepNumber"])],
|
|
129
|
-
enums: [RunStepTypeEntityEnum]
|
|
130
|
-
});
|
|
131
|
-
var RunLogEntity = defineEntity({
|
|
132
|
-
name: "RunLog",
|
|
133
|
-
schema: "agent_console",
|
|
134
|
-
description: "A log entry for an agent run.",
|
|
135
|
-
fields: {
|
|
136
|
-
id: field.id(),
|
|
137
|
-
runId: field.foreignKey({ description: "Parent run" }),
|
|
138
|
-
stepId: field.string({ isOptional: true, description: "Related step" }),
|
|
139
|
-
level: field.enum("LogLevel"),
|
|
140
|
-
message: field.string({ description: "Log message" }),
|
|
141
|
-
data: field.json({ isOptional: true, description: "Additional log data" }),
|
|
142
|
-
source: field.string({
|
|
143
|
-
isOptional: true,
|
|
144
|
-
description: "Log source component"
|
|
145
|
-
}),
|
|
146
|
-
traceId: field.string({ isOptional: true }),
|
|
147
|
-
spanId: field.string({ isOptional: true }),
|
|
148
|
-
timestamp: field.dateTime(),
|
|
149
|
-
run: field.belongsTo("Run", ["runId"], ["id"])
|
|
150
|
-
},
|
|
151
|
-
indexes: [index.on(["runId", "timestamp"]), index.on(["runId", "level"])],
|
|
152
|
-
enums: [LogLevelEntityEnum]
|
|
153
|
-
});
|
|
154
|
-
export {
|
|
155
|
-
RunStepTypeEntityEnum,
|
|
156
|
-
RunStepEntity,
|
|
157
|
-
RunStatusEntityEnum,
|
|
158
|
-
RunLogEntity,
|
|
159
|
-
RunEntity,
|
|
160
|
-
LogLevelEntityEnum
|
|
161
|
-
};
|
|
2
|
+
import{defineEntity as q,defineEntityEnum as w,field as j,index as k}from"@contractspec/lib.schema";var z=w({name:"RunStatus",values:["QUEUED","IN_PROGRESS","COMPLETED","FAILED","CANCELLED","EXPIRED"],description:"Status of an agent run"}),A=w({name:"RunStepType",values:["MESSAGE_CREATION","TOOL_CALL","TOOL_RESULT","ERROR"],description:"Type of run step"}),B=w({name:"LogLevel",values:["DEBUG","INFO","WARN","ERROR"],description:"Log level"}),D=q({name:"Run",schema:"agent_console",description:"An execution of an agent with input/output and metrics.",fields:{id:j.id(),organizationId:j.string({description:"Organization ID"}),agentId:j.foreignKey({description:"Agent being executed"}),userId:j.string({isOptional:!0,description:"User who initiated the run"}),sessionId:j.string({isOptional:!0,description:"Conversation session ID"}),input:j.json({description:"Input data for the run"}),output:j.json({isOptional:!0,description:"Output result from the run"}),status:j.enum("RunStatus",{default:"QUEUED"}),errorMessage:j.string({isOptional:!0,description:"Error message if failed"}),errorCode:j.string({isOptional:!0,description:"Error code if failed"}),totalTokens:j.int({default:0,description:"Total tokens used"}),promptTokens:j.int({default:0,description:"Prompt tokens used"}),completionTokens:j.int({default:0,description:"Completion tokens used"}),totalIterations:j.int({default:0,description:"Number of iterations"}),durationMs:j.int({isOptional:!0,description:"Execution duration in ms"}),estimatedCostUsd:j.float({isOptional:!0,description:"Estimated cost in USD"}),queuedAt:j.dateTime({description:"When run was queued"}),startedAt:j.dateTime({isOptional:!0,description:"When run started executing"}),completedAt:j.dateTime({isOptional:!0,description:"When run completed"}),metadata:j.json({isOptional:!0,description:"Additional metadata"}),agent:j.belongsTo("Agent",["agentId"],["id"]),steps:j.hasMany("RunStep",{description:"Execution steps"}),logs:j.hasMany("RunLog",{description:"Execution logs"})},indexes:[k.on(["organizationId","agentId","queuedAt"]),k.on(["organizationId","status"]),k.on(["agentId","status"]),k.on(["sessionId"])],enums:[z]}),F=q({name:"RunStep",schema:"agent_console",description:"An individual step in an agent run.",fields:{id:j.id(),runId:j.foreignKey({description:"Parent run"}),stepNumber:j.int({description:"Step sequence number"}),type:j.enum("RunStepType"),toolId:j.string({isOptional:!0,description:"Tool used in this step"}),toolName:j.string({isOptional:!0,description:"Tool name"}),input:j.json({isOptional:!0,description:"Step input"}),output:j.json({isOptional:!0,description:"Step output"}),status:j.enum("RunStatus"),errorMessage:j.string({isOptional:!0}),tokensUsed:j.int({default:0}),durationMs:j.int({isOptional:!0}),startedAt:j.dateTime(),completedAt:j.dateTime({isOptional:!0}),run:j.belongsTo("Run",["runId"],["id"])},indexes:[k.on(["runId","stepNumber"])],enums:[A]}),G=q({name:"RunLog",schema:"agent_console",description:"A log entry for an agent run.",fields:{id:j.id(),runId:j.foreignKey({description:"Parent run"}),stepId:j.string({isOptional:!0,description:"Related step"}),level:j.enum("LogLevel"),message:j.string({description:"Log message"}),data:j.json({isOptional:!0,description:"Additional log data"}),source:j.string({isOptional:!0,description:"Log source component"}),traceId:j.string({isOptional:!0}),spanId:j.string({isOptional:!0}),timestamp:j.dateTime(),run:j.belongsTo("Run",["runId"],["id"])},indexes:[k.on(["runId","timestamp"]),k.on(["runId","level"])],enums:[B]});export{A as RunStepTypeEntityEnum,F as RunStepEntity,z as RunStatusEntityEnum,G as RunLogEntity,D as RunEntity,B as LogLevelEntityEnum};
|
package/dist/run/run.enum.js
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
-
var RunStatusEnum = defineEnum("RunStatus", [
|
|
5
|
-
"QUEUED",
|
|
6
|
-
"IN_PROGRESS",
|
|
7
|
-
"COMPLETED",
|
|
8
|
-
"FAILED",
|
|
9
|
-
"CANCELLED",
|
|
10
|
-
"EXPIRED"
|
|
11
|
-
]);
|
|
12
|
-
var RunStepTypeEnum = defineEnum("RunStepType", [
|
|
13
|
-
"MESSAGE_CREATION",
|
|
14
|
-
"TOOL_CALL",
|
|
15
|
-
"TOOL_RESULT",
|
|
16
|
-
"ERROR"
|
|
17
|
-
]);
|
|
18
|
-
var LogLevelEnum = defineEnum("LogLevel", [
|
|
19
|
-
"DEBUG",
|
|
20
|
-
"INFO",
|
|
21
|
-
"WARN",
|
|
22
|
-
"ERROR"
|
|
23
|
-
]);
|
|
24
|
-
var GranularityEnum = defineEnum("Granularity", [
|
|
25
|
-
"hour",
|
|
26
|
-
"day",
|
|
27
|
-
"week",
|
|
28
|
-
"month"
|
|
29
|
-
]);
|
|
30
|
-
export {
|
|
31
|
-
RunStepTypeEnum,
|
|
32
|
-
RunStatusEnum,
|
|
33
|
-
LogLevelEnum,
|
|
34
|
-
GranularityEnum
|
|
35
|
-
};
|
|
2
|
+
import{defineEnum as g}from"@contractspec/lib.schema";var k=g("RunStatus",["QUEUED","IN_PROGRESS","COMPLETED","FAILED","CANCELLED","EXPIRED"]),q=g("RunStepType",["MESSAGE_CREATION","TOOL_CALL","TOOL_RESULT","ERROR"]),v=g("LogLevel",["DEBUG","INFO","WARN","ERROR"]),w=g("Granularity",["hour","day","week","month"]);export{q as RunStepTypeEnum,k as RunStatusEnum,v as LogLevelEnum,w as GranularityEnum};
|
package/dist/run/run.event.js
CHANGED
|
@@ -1,218 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
import {
|
|
5
|
-
defineEnum,
|
|
6
|
-
defineSchemaModel,
|
|
7
|
-
ScalarTypeEnum
|
|
8
|
-
} from "@contractspec/lib.schema";
|
|
9
|
-
var OWNERS = ["@agent-console-team"];
|
|
10
|
-
var RunStartedPayload = defineSchemaModel({
|
|
11
|
-
name: "RunStartedPayload",
|
|
12
|
-
description: "Payload for run started event",
|
|
13
|
-
fields: {
|
|
14
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
-
organizationId: {
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false
|
|
18
|
-
},
|
|
19
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
22
|
-
sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
-
input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
24
|
-
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
var RunStartedEvent = defineEvent({
|
|
28
|
-
meta: {
|
|
29
|
-
key: "agent.run.started",
|
|
30
|
-
version: "1.0.0",
|
|
31
|
-
description: "An agent run was started.",
|
|
32
|
-
stability: "stable",
|
|
33
|
-
owners: [...OWNERS],
|
|
34
|
-
tags: ["run", "started"]
|
|
35
|
-
},
|
|
36
|
-
payload: RunStartedPayload
|
|
37
|
-
});
|
|
38
|
-
var RunCompletedPayload = defineSchemaModel({
|
|
39
|
-
name: "RunCompletedPayload",
|
|
40
|
-
description: "Payload for run completed event",
|
|
41
|
-
fields: {
|
|
42
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
43
|
-
organizationId: {
|
|
44
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
45
|
-
isOptional: false
|
|
46
|
-
},
|
|
47
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
48
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
49
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
50
|
-
output: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
51
|
-
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
52
|
-
promptTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
53
|
-
completionTokens: {
|
|
54
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
55
|
-
isOptional: false
|
|
56
|
-
},
|
|
57
|
-
totalIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
58
|
-
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
59
|
-
estimatedCostUsd: {
|
|
60
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
61
|
-
isOptional: true
|
|
62
|
-
},
|
|
63
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
var RunCompletedEvent = defineEvent({
|
|
67
|
-
meta: {
|
|
68
|
-
key: "agent.run.completed",
|
|
69
|
-
version: "1.0.0",
|
|
70
|
-
description: "An agent run completed successfully.",
|
|
71
|
-
stability: "stable",
|
|
72
|
-
owners: [...OWNERS],
|
|
73
|
-
tags: ["run", "completed"]
|
|
74
|
-
},
|
|
75
|
-
payload: RunCompletedPayload
|
|
76
|
-
});
|
|
77
|
-
var RunFailedPayload = defineSchemaModel({
|
|
78
|
-
name: "RunFailedPayload",
|
|
79
|
-
description: "Payload for run failed event",
|
|
80
|
-
fields: {
|
|
81
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
82
|
-
organizationId: {
|
|
83
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
84
|
-
isOptional: false
|
|
85
|
-
},
|
|
86
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
87
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
88
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
89
|
-
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
90
|
-
errorCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
91
|
-
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
92
|
-
totalIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
93
|
-
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
94
|
-
failedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
var RunFailedEvent = defineEvent({
|
|
98
|
-
meta: {
|
|
99
|
-
key: "agent.run.failed",
|
|
100
|
-
version: "1.0.0",
|
|
101
|
-
description: "An agent run encountered an error.",
|
|
102
|
-
stability: "stable",
|
|
103
|
-
owners: [...OWNERS],
|
|
104
|
-
tags: ["run", "failed"]
|
|
105
|
-
},
|
|
106
|
-
payload: RunFailedPayload
|
|
107
|
-
});
|
|
108
|
-
var RunCancelledPayload = defineSchemaModel({
|
|
109
|
-
name: "RunCancelledPayload",
|
|
110
|
-
description: "Payload for run cancelled event",
|
|
111
|
-
fields: {
|
|
112
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
113
|
-
organizationId: {
|
|
114
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
115
|
-
isOptional: false
|
|
116
|
-
},
|
|
117
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
118
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
119
|
-
cancelledBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
120
|
-
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
121
|
-
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
122
|
-
totalIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
123
|
-
cancelledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
var RunCancelledEvent = defineEvent({
|
|
127
|
-
meta: {
|
|
128
|
-
key: "agent.run.cancelled",
|
|
129
|
-
version: "1.0.0",
|
|
130
|
-
description: "An agent run was cancelled by the user.",
|
|
131
|
-
stability: "stable",
|
|
132
|
-
owners: [...OWNERS],
|
|
133
|
-
tags: ["run", "cancelled"]
|
|
134
|
-
},
|
|
135
|
-
payload: RunCancelledPayload
|
|
136
|
-
});
|
|
137
|
-
var ToolInvokedPayload = defineSchemaModel({
|
|
138
|
-
name: "ToolInvokedPayload",
|
|
139
|
-
description: "Payload for tool invoked event",
|
|
140
|
-
fields: {
|
|
141
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
142
|
-
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
143
|
-
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
144
|
-
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
145
|
-
input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
146
|
-
invokedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
var ToolInvokedEvent = defineEvent({
|
|
150
|
-
meta: {
|
|
151
|
-
key: "agent.run.toolInvoked",
|
|
152
|
-
version: "1.0.0",
|
|
153
|
-
description: "A tool was invoked during an agent run.",
|
|
154
|
-
stability: "stable",
|
|
155
|
-
owners: [...OWNERS],
|
|
156
|
-
tags: ["run", "tool", "invoked"]
|
|
157
|
-
},
|
|
158
|
-
payload: ToolInvokedPayload
|
|
159
|
-
});
|
|
160
|
-
var ToolCompletedPayload = defineSchemaModel({
|
|
161
|
-
name: "ToolCompletedPayload",
|
|
162
|
-
description: "Payload for tool completed event",
|
|
163
|
-
fields: {
|
|
164
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
165
|
-
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
166
|
-
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
167
|
-
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
168
|
-
success: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
169
|
-
output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
170
|
-
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
171
|
-
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
172
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
var ToolCompletedEvent = defineEvent({
|
|
176
|
-
meta: {
|
|
177
|
-
key: "agent.run.toolCompleted",
|
|
178
|
-
version: "1.0.0",
|
|
179
|
-
description: "A tool invocation completed during an agent run.",
|
|
180
|
-
stability: "stable",
|
|
181
|
-
owners: [...OWNERS],
|
|
182
|
-
tags: ["run", "tool", "completed"]
|
|
183
|
-
},
|
|
184
|
-
payload: ToolCompletedPayload
|
|
185
|
-
});
|
|
186
|
-
var MessageTypeEnum = defineEnum("MessageType", ["assistant", "system"]);
|
|
187
|
-
var MessageGeneratedPayload = defineSchemaModel({
|
|
188
|
-
name: "MessageGeneratedPayload",
|
|
189
|
-
description: "Payload for message generated event",
|
|
190
|
-
fields: {
|
|
191
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
192
|
-
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
193
|
-
messageType: { type: MessageTypeEnum, isOptional: false },
|
|
194
|
-
content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
195
|
-
tokensUsed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
196
|
-
generatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
var MessageGeneratedEvent = defineEvent({
|
|
200
|
-
meta: {
|
|
201
|
-
key: "agent.run.messageGenerated",
|
|
202
|
-
version: "1.0.0",
|
|
203
|
-
description: "An agent generated a message during a run.",
|
|
204
|
-
stability: "stable",
|
|
205
|
-
owners: [...OWNERS],
|
|
206
|
-
tags: ["run", "message", "generated"]
|
|
207
|
-
},
|
|
208
|
-
payload: MessageGeneratedPayload
|
|
209
|
-
});
|
|
210
|
-
export {
|
|
211
|
-
ToolInvokedEvent,
|
|
212
|
-
ToolCompletedEvent,
|
|
213
|
-
RunStartedEvent,
|
|
214
|
-
RunFailedEvent,
|
|
215
|
-
RunCompletedEvent,
|
|
216
|
-
RunCancelledEvent,
|
|
217
|
-
MessageGeneratedEvent
|
|
218
|
-
};
|
|
2
|
+
import{defineEvent as q}from"@contractspec/lib.contracts-spec";import{defineEnum as z,defineSchemaModel as w,ScalarTypeEnum as j}from"@contractspec/lib.schema";var x=["@agent-console-team"],A=w({name:"RunStartedPayload",description:"Payload for run started event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},agentName:{type:j.String_unsecure(),isOptional:!1},userId:{type:j.String_unsecure(),isOptional:!0},sessionId:{type:j.String_unsecure(),isOptional:!0},input:{type:j.JSONObject(),isOptional:!1},startedAt:{type:j.DateTime(),isOptional:!1}}}),X=q({meta:{key:"agent.run.started",version:"1.0.0",description:"An agent run was started.",stability:"stable",owners:[...x],tags:["run","started"]},payload:A}),B=w({name:"RunCompletedPayload",description:"Payload for run completed event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},agentName:{type:j.String_unsecure(),isOptional:!1},userId:{type:j.String_unsecure(),isOptional:!0},output:{type:j.JSONObject(),isOptional:!1},totalTokens:{type:j.Int_unsecure(),isOptional:!1},promptTokens:{type:j.Int_unsecure(),isOptional:!1},completionTokens:{type:j.Int_unsecure(),isOptional:!1},totalIterations:{type:j.Int_unsecure(),isOptional:!1},durationMs:{type:j.Int_unsecure(),isOptional:!1},estimatedCostUsd:{type:j.Float_unsecure(),isOptional:!0},completedAt:{type:j.DateTime(),isOptional:!1}}}),Y=q({meta:{key:"agent.run.completed",version:"1.0.0",description:"An agent run completed successfully.",stability:"stable",owners:[...x],tags:["run","completed"]},payload:B}),D=w({name:"RunFailedPayload",description:"Payload for run failed event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},agentName:{type:j.String_unsecure(),isOptional:!1},userId:{type:j.String_unsecure(),isOptional:!0},errorMessage:{type:j.String_unsecure(),isOptional:!1},errorCode:{type:j.String_unsecure(),isOptional:!0},totalTokens:{type:j.Int_unsecure(),isOptional:!1},totalIterations:{type:j.Int_unsecure(),isOptional:!1},durationMs:{type:j.Int_unsecure(),isOptional:!0},failedAt:{type:j.DateTime(),isOptional:!1}}}),Z=q({meta:{key:"agent.run.failed",version:"1.0.0",description:"An agent run encountered an error.",stability:"stable",owners:[...x],tags:["run","failed"]},payload:D}),H=w({name:"RunCancelledPayload",description:"Payload for run cancelled event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},userId:{type:j.String_unsecure(),isOptional:!0},cancelledBy:{type:j.String_unsecure(),isOptional:!0},reason:{type:j.String_unsecure(),isOptional:!0},totalTokens:{type:j.Int_unsecure(),isOptional:!1},totalIterations:{type:j.Int_unsecure(),isOptional:!1},cancelledAt:{type:j.DateTime(),isOptional:!1}}}),_=q({meta:{key:"agent.run.cancelled",version:"1.0.0",description:"An agent run was cancelled by the user.",stability:"stable",owners:[...x],tags:["run","cancelled"]},payload:H}),J=w({name:"ToolInvokedPayload",description:"Payload for tool invoked event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},stepId:{type:j.String_unsecure(),isOptional:!1},toolId:{type:j.String_unsecure(),isOptional:!1},toolName:{type:j.String_unsecure(),isOptional:!1},input:{type:j.JSONObject(),isOptional:!1},invokedAt:{type:j.DateTime(),isOptional:!1}}}),$=q({meta:{key:"agent.run.toolInvoked",version:"1.0.0",description:"A tool was invoked during an agent run.",stability:"stable",owners:[...x],tags:["run","tool","invoked"]},payload:J}),K=w({name:"ToolCompletedPayload",description:"Payload for tool completed event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},stepId:{type:j.String_unsecure(),isOptional:!1},toolId:{type:j.String_unsecure(),isOptional:!1},toolName:{type:j.String_unsecure(),isOptional:!1},success:{type:j.Boolean(),isOptional:!1},output:{type:j.JSONObject(),isOptional:!0},errorMessage:{type:j.String_unsecure(),isOptional:!0},durationMs:{type:j.Int_unsecure(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!1}}}),k=q({meta:{key:"agent.run.toolCompleted",version:"1.0.0",description:"A tool invocation completed during an agent run.",stability:"stable",owners:[...x],tags:["run","tool","completed"]},payload:K}),L=z("MessageType",["assistant","system"]),Q=w({name:"MessageGeneratedPayload",description:"Payload for message generated event",fields:{runId:{type:j.String_unsecure(),isOptional:!1},stepId:{type:j.String_unsecure(),isOptional:!1},messageType:{type:L,isOptional:!1},content:{type:j.String_unsecure(),isOptional:!1},tokensUsed:{type:j.Int_unsecure(),isOptional:!1},generatedAt:{type:j.DateTime(),isOptional:!1}}}),F=q({meta:{key:"agent.run.messageGenerated",version:"1.0.0",description:"An agent generated a message during a run.",stability:"stable",owners:[...x],tags:["run","message","generated"]},payload:Q});export{$ as ToolInvokedEvent,k as ToolCompletedEvent,X as RunStartedEvent,Z as RunFailedEvent,Y as RunCompletedEvent,_ as RunCancelledEvent,F as MessageGeneratedEvent};
|