@lssm/example.agent-console 0.0.0-canary-20251217080011 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +46 -48
- package/dist/agent/agent.contracts.js +1 -336
- package/dist/agent/agent.entity.js +1 -136
- package/dist/agent/agent.enum.js +1 -34
- package/dist/agent/agent.event.js +1 -183
- package/dist/agent/agent.handler.js +1 -83
- package/dist/agent/agent.presentation.js +1 -75
- package/dist/agent/agent.schema.js +1 -407
- package/dist/agent/index.js +1 -9
- package/dist/agent.feature.js +1 -295
- package/dist/docs/agent-console.docblock.js +5 -69
- package/dist/docs/index.js +1 -1
- package/dist/example.js +1 -50
- package/dist/handlers/index.js +1 -5
- package/dist/index.js +1 -32
- package/dist/presentations/index.js +1 -5
- package/dist/run/index.js +1 -9
- package/dist/run/run.contracts.js +1 -469
- package/dist/run/run.entity.js +1 -205
- package/dist/run/run.enum.js +1 -45
- package/dist/run/run.event.js +1 -389
- package/dist/run/run.handler.js +1 -82
- package/dist/run/run.presentation.js +1 -55
- package/dist/run/run.schema.js +1 -339
- package/dist/shared/index.js +1 -5
- package/dist/shared/mock-agents.js +1 -93
- package/dist/shared/mock-runs.js +1 -117
- package/dist/shared/mock-tools.js +1 -180
- package/dist/tool/index.js +1 -9
- package/dist/tool/tool.contracts.js +1 -288
- package/dist/tool/tool.entity.js +1 -105
- package/dist/tool/tool.enum.js +1 -35
- package/dist/tool/tool.event.js +1 -145
- package/dist/tool/tool.handler.js +1 -86
- package/dist/tool/tool.presentation.js +1 -55
- package/dist/tool/tool.schema.js +1 -237
- package/package.json +43 -45
- package/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build$colon$bundle.log +0 -272
- package/CHANGELOG.md +0 -16
- package/dist/agent/agent.contracts.d.ts +0 -504
- package/dist/agent/agent.entity.d.ts +0 -54
- package/dist/agent/agent.enum.d.ts +0 -17
- package/dist/agent/agent.event.d.ts +0 -127
- package/dist/agent/agent.handler.d.ts +0 -99
- package/dist/agent/agent.presentation.d.ts +0 -18
- package/dist/agent/agent.schema.d.ts +0 -400
- package/dist/agent/index.d.ts +0 -8
- package/dist/agent.feature.d.ts +0 -11
- package/dist/docs/agent-console.docblock.d.ts +0 -1
- package/dist/docs/index.d.ts +0 -1
- package/dist/example.d.ts +0 -39
- package/dist/handlers/index.d.ts +0 -4
- package/dist/index.d.ts +0 -27
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -10
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -71
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -19
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -1
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -1
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -1
- package/dist/libs/contracts/dist/regenerator/service.js +0 -6
- package/dist/libs/contracts/dist/registry.js +0 -2
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -34
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -2
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -56
- package/dist/libs/schema/dist/FieldType.js +0 -49
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -236
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/index.js +0 -6
- package/dist/presentations/index.d.ts +0 -4
- package/dist/run/index.d.ts +0 -8
- package/dist/run/run.contracts.d.ts +0 -713
- package/dist/run/run.entity.d.ts +0 -81
- package/dist/run/run.enum.d.ts +0 -21
- package/dist/run/run.event.d.ts +0 -289
- package/dist/run/run.handler.d.ts +0 -202
- package/dist/run/run.presentation.d.ts +0 -14
- package/dist/run/run.schema.d.ts +0 -415
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/mock-agents.d.ts +0 -87
- package/dist/shared/mock-runs.d.ts +0 -119
- package/dist/shared/mock-tools.d.ts +0 -243
- package/dist/tool/index.d.ts +0 -8
- package/dist/tool/tool.contracts.d.ts +0 -404
- package/dist/tool/tool.entity.d.ts +0 -41
- package/dist/tool/tool.enum.d.ts +0 -17
- package/dist/tool/tool.event.d.ts +0 -102
- package/dist/tool/tool.handler.d.ts +0 -314
- package/dist/tool/tool.presentation.d.ts +0 -14
- package/dist/tool/tool.schema.d.ts +0 -217
|
@@ -1,469 +1 @@
|
|
|
1
|
-
import { ScalarTypeEnum }
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
4
|
-
import { defineCommand, defineQuery } from "../libs/contracts/dist/spec.js";
|
|
5
|
-
import { GranularityEnum, LogLevelEnum, RunStatusEnum } from "./run.enum.js";
|
|
6
|
-
import { RunInputModel, RunLogModel, RunModel, RunStepModel, RunSummaryModel, TimelineDataPointModel } from "./run.schema.js";
|
|
7
|
-
|
|
8
|
-
//#region src/run/run.contracts.ts
|
|
9
|
-
const OWNERS = ["agent-console-team"];
|
|
10
|
-
/**
|
|
11
|
-
* ExecuteAgentCommand - Starts a new agent run.
|
|
12
|
-
*/
|
|
13
|
-
const ExecuteAgentCommand = defineCommand({
|
|
14
|
-
meta: {
|
|
15
|
-
name: "agent.run.execute",
|
|
16
|
-
version: 1,
|
|
17
|
-
stability: "stable",
|
|
18
|
-
owners: [...OWNERS],
|
|
19
|
-
tags: ["run", "execute"],
|
|
20
|
-
description: "Starts a new agent run with the given input.",
|
|
21
|
-
goal: "Execute an AI agent with user input.",
|
|
22
|
-
context: "Called from chat interface or API."
|
|
23
|
-
},
|
|
24
|
-
io: {
|
|
25
|
-
input: defineSchemaModel({
|
|
26
|
-
name: "ExecuteAgentInput",
|
|
27
|
-
fields: {
|
|
28
|
-
agentId: {
|
|
29
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
30
|
-
isOptional: false
|
|
31
|
-
},
|
|
32
|
-
input: {
|
|
33
|
-
type: RunInputModel,
|
|
34
|
-
isOptional: false
|
|
35
|
-
},
|
|
36
|
-
sessionId: {
|
|
37
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
-
isOptional: true
|
|
39
|
-
},
|
|
40
|
-
metadata: {
|
|
41
|
-
type: ScalarTypeEnum.JSONObject(),
|
|
42
|
-
isOptional: true
|
|
43
|
-
},
|
|
44
|
-
stream: {
|
|
45
|
-
type: ScalarTypeEnum.Boolean(),
|
|
46
|
-
isOptional: true
|
|
47
|
-
},
|
|
48
|
-
maxIterations: {
|
|
49
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
50
|
-
isOptional: true
|
|
51
|
-
},
|
|
52
|
-
timeoutMs: {
|
|
53
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
54
|
-
isOptional: true
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
output: defineSchemaModel({
|
|
59
|
-
name: "ExecuteAgentOutput",
|
|
60
|
-
fields: {
|
|
61
|
-
runId: {
|
|
62
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
63
|
-
isOptional: false
|
|
64
|
-
},
|
|
65
|
-
status: {
|
|
66
|
-
type: RunStatusEnum,
|
|
67
|
-
isOptional: false
|
|
68
|
-
},
|
|
69
|
-
estimatedWaitMs: {
|
|
70
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
71
|
-
isOptional: true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}),
|
|
75
|
-
errors: {
|
|
76
|
-
AGENT_NOT_FOUND: {
|
|
77
|
-
description: "The specified agent does not exist",
|
|
78
|
-
http: 404,
|
|
79
|
-
gqlCode: "AGENT_NOT_FOUND",
|
|
80
|
-
when: "Agent ID is invalid"
|
|
81
|
-
},
|
|
82
|
-
AGENT_NOT_ACTIVE: {
|
|
83
|
-
description: "The specified agent is not active",
|
|
84
|
-
http: 400,
|
|
85
|
-
gqlCode: "AGENT_NOT_ACTIVE",
|
|
86
|
-
when: "Agent is in draft/paused/archived state"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
policy: { auth: "user" },
|
|
91
|
-
sideEffects: {
|
|
92
|
-
emits: [{
|
|
93
|
-
name: "run.started",
|
|
94
|
-
version: 1,
|
|
95
|
-
when: "Run is queued",
|
|
96
|
-
payload: RunSummaryModel
|
|
97
|
-
}],
|
|
98
|
-
audit: ["run.started"]
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
/**
|
|
102
|
-
* CancelRunCommand - Cancels an in-progress run.
|
|
103
|
-
*/
|
|
104
|
-
const CancelRunCommand = defineCommand({
|
|
105
|
-
meta: {
|
|
106
|
-
name: "agent.run.cancel",
|
|
107
|
-
version: 1,
|
|
108
|
-
stability: "stable",
|
|
109
|
-
owners: [...OWNERS],
|
|
110
|
-
tags: ["run", "cancel"],
|
|
111
|
-
description: "Cancels an in-progress agent run.",
|
|
112
|
-
goal: "Stop a running agent execution.",
|
|
113
|
-
context: "Called when user wants to abort a long-running task."
|
|
114
|
-
},
|
|
115
|
-
io: {
|
|
116
|
-
input: defineSchemaModel({
|
|
117
|
-
name: "CancelRunInput",
|
|
118
|
-
fields: {
|
|
119
|
-
runId: {
|
|
120
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
121
|
-
isOptional: false
|
|
122
|
-
},
|
|
123
|
-
reason: {
|
|
124
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
125
|
-
isOptional: true
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}),
|
|
129
|
-
output: defineSchemaModel({
|
|
130
|
-
name: "CancelRunOutput",
|
|
131
|
-
fields: {
|
|
132
|
-
success: {
|
|
133
|
-
type: ScalarTypeEnum.Boolean(),
|
|
134
|
-
isOptional: false
|
|
135
|
-
},
|
|
136
|
-
status: {
|
|
137
|
-
type: RunStatusEnum,
|
|
138
|
-
isOptional: false
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}),
|
|
142
|
-
errors: {
|
|
143
|
-
RUN_NOT_FOUND: {
|
|
144
|
-
description: "The specified run does not exist",
|
|
145
|
-
http: 404,
|
|
146
|
-
gqlCode: "RUN_NOT_FOUND",
|
|
147
|
-
when: "Run ID is invalid"
|
|
148
|
-
},
|
|
149
|
-
RUN_NOT_CANCELLABLE: {
|
|
150
|
-
description: "The run cannot be cancelled",
|
|
151
|
-
http: 400,
|
|
152
|
-
gqlCode: "RUN_NOT_CANCELLABLE",
|
|
153
|
-
when: "Run is already completed/failed/cancelled"
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
policy: { auth: "user" },
|
|
158
|
-
sideEffects: {
|
|
159
|
-
emits: [{
|
|
160
|
-
name: "run.cancelled",
|
|
161
|
-
version: 1,
|
|
162
|
-
when: "Run is cancelled",
|
|
163
|
-
payload: RunSummaryModel
|
|
164
|
-
}],
|
|
165
|
-
audit: ["run.cancelled"]
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
/**
|
|
169
|
-
* GetRunQuery - Retrieves a run by ID.
|
|
170
|
-
*/
|
|
171
|
-
const GetRunQuery = defineQuery({
|
|
172
|
-
meta: {
|
|
173
|
-
name: "agent.run.get",
|
|
174
|
-
version: 1,
|
|
175
|
-
stability: "stable",
|
|
176
|
-
owners: [...OWNERS],
|
|
177
|
-
tags: ["run", "get"],
|
|
178
|
-
description: "Retrieves a run by its ID with optional details.",
|
|
179
|
-
goal: "View detailed run information.",
|
|
180
|
-
context: "Run details page or monitoring."
|
|
181
|
-
},
|
|
182
|
-
io: {
|
|
183
|
-
input: defineSchemaModel({
|
|
184
|
-
name: "GetRunInput",
|
|
185
|
-
fields: {
|
|
186
|
-
runId: {
|
|
187
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
188
|
-
isOptional: false
|
|
189
|
-
},
|
|
190
|
-
includeSteps: {
|
|
191
|
-
type: ScalarTypeEnum.Boolean(),
|
|
192
|
-
isOptional: true
|
|
193
|
-
},
|
|
194
|
-
includeLogs: {
|
|
195
|
-
type: ScalarTypeEnum.Boolean(),
|
|
196
|
-
isOptional: true
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}),
|
|
200
|
-
output: RunModel,
|
|
201
|
-
errors: { RUN_NOT_FOUND: {
|
|
202
|
-
description: "The specified run does not exist",
|
|
203
|
-
http: 404,
|
|
204
|
-
gqlCode: "RUN_NOT_FOUND",
|
|
205
|
-
when: "Run ID is invalid"
|
|
206
|
-
} }
|
|
207
|
-
},
|
|
208
|
-
policy: { auth: "user" }
|
|
209
|
-
});
|
|
210
|
-
/**
|
|
211
|
-
* ListRunsQuery - Lists runs for an organization or agent.
|
|
212
|
-
*/
|
|
213
|
-
const ListRunsQuery = defineQuery({
|
|
214
|
-
meta: {
|
|
215
|
-
name: "agent.run.list",
|
|
216
|
-
version: 1,
|
|
217
|
-
stability: "stable",
|
|
218
|
-
owners: [...OWNERS],
|
|
219
|
-
tags: ["run", "list"],
|
|
220
|
-
description: "Lists runs with optional filtering.",
|
|
221
|
-
goal: "Browse and search run history.",
|
|
222
|
-
context: "Run history/dashboard view."
|
|
223
|
-
},
|
|
224
|
-
io: {
|
|
225
|
-
input: defineSchemaModel({
|
|
226
|
-
name: "ListRunsInput",
|
|
227
|
-
fields: {
|
|
228
|
-
organizationId: {
|
|
229
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
230
|
-
isOptional: true
|
|
231
|
-
},
|
|
232
|
-
agentId: {
|
|
233
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
234
|
-
isOptional: true
|
|
235
|
-
},
|
|
236
|
-
userId: {
|
|
237
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
238
|
-
isOptional: true
|
|
239
|
-
},
|
|
240
|
-
sessionId: {
|
|
241
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
242
|
-
isOptional: true
|
|
243
|
-
},
|
|
244
|
-
status: {
|
|
245
|
-
type: RunStatusEnum,
|
|
246
|
-
isOptional: true
|
|
247
|
-
},
|
|
248
|
-
startDate: {
|
|
249
|
-
type: ScalarTypeEnum.DateTime(),
|
|
250
|
-
isOptional: true
|
|
251
|
-
},
|
|
252
|
-
endDate: {
|
|
253
|
-
type: ScalarTypeEnum.DateTime(),
|
|
254
|
-
isOptional: true
|
|
255
|
-
},
|
|
256
|
-
limit: {
|
|
257
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
258
|
-
isOptional: true,
|
|
259
|
-
defaultValue: 20
|
|
260
|
-
},
|
|
261
|
-
offset: {
|
|
262
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
263
|
-
isOptional: true,
|
|
264
|
-
defaultValue: 0
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}),
|
|
268
|
-
output: defineSchemaModel({
|
|
269
|
-
name: "ListRunsOutput",
|
|
270
|
-
fields: {
|
|
271
|
-
items: {
|
|
272
|
-
type: RunSummaryModel,
|
|
273
|
-
isArray: true,
|
|
274
|
-
isOptional: false
|
|
275
|
-
},
|
|
276
|
-
total: {
|
|
277
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
278
|
-
isOptional: false
|
|
279
|
-
},
|
|
280
|
-
hasMore: {
|
|
281
|
-
type: ScalarTypeEnum.Boolean(),
|
|
282
|
-
isOptional: false
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
})
|
|
286
|
-
},
|
|
287
|
-
policy: { auth: "user" }
|
|
288
|
-
});
|
|
289
|
-
/**
|
|
290
|
-
* GetRunStepsQuery - Retrieves steps for a run.
|
|
291
|
-
*/
|
|
292
|
-
const GetRunStepsQuery = defineQuery({
|
|
293
|
-
meta: {
|
|
294
|
-
name: "agent.run.getSteps",
|
|
295
|
-
version: 1,
|
|
296
|
-
stability: "stable",
|
|
297
|
-
owners: [...OWNERS],
|
|
298
|
-
tags: ["run", "steps"],
|
|
299
|
-
description: "Retrieves all steps for a specific run.",
|
|
300
|
-
goal: "View step-by-step execution details.",
|
|
301
|
-
context: "Run details page - steps tab."
|
|
302
|
-
},
|
|
303
|
-
io: {
|
|
304
|
-
input: defineSchemaModel({
|
|
305
|
-
name: "GetRunStepsInput",
|
|
306
|
-
fields: { runId: {
|
|
307
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
308
|
-
isOptional: false
|
|
309
|
-
} }
|
|
310
|
-
}),
|
|
311
|
-
output: defineSchemaModel({
|
|
312
|
-
name: "GetRunStepsOutput",
|
|
313
|
-
fields: { steps: {
|
|
314
|
-
type: RunStepModel,
|
|
315
|
-
isArray: true,
|
|
316
|
-
isOptional: false
|
|
317
|
-
} }
|
|
318
|
-
})
|
|
319
|
-
},
|
|
320
|
-
policy: { auth: "user" }
|
|
321
|
-
});
|
|
322
|
-
/**
|
|
323
|
-
* GetRunLogsQuery - Retrieves logs for a run.
|
|
324
|
-
*/
|
|
325
|
-
const GetRunLogsQuery = defineQuery({
|
|
326
|
-
meta: {
|
|
327
|
-
name: "agent.run.getLogs",
|
|
328
|
-
version: 1,
|
|
329
|
-
stability: "stable",
|
|
330
|
-
owners: [...OWNERS],
|
|
331
|
-
tags: ["run", "logs"],
|
|
332
|
-
description: "Retrieves all logs for a specific run.",
|
|
333
|
-
goal: "Debug and audit run execution.",
|
|
334
|
-
context: "Run details page - logs tab."
|
|
335
|
-
},
|
|
336
|
-
io: {
|
|
337
|
-
input: defineSchemaModel({
|
|
338
|
-
name: "GetRunLogsInput",
|
|
339
|
-
fields: {
|
|
340
|
-
runId: {
|
|
341
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
342
|
-
isOptional: false
|
|
343
|
-
},
|
|
344
|
-
level: {
|
|
345
|
-
type: LogLevelEnum,
|
|
346
|
-
isOptional: true
|
|
347
|
-
},
|
|
348
|
-
stepId: {
|
|
349
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
350
|
-
isOptional: true
|
|
351
|
-
},
|
|
352
|
-
limit: {
|
|
353
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
354
|
-
isOptional: true,
|
|
355
|
-
defaultValue: 100
|
|
356
|
-
},
|
|
357
|
-
offset: {
|
|
358
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
359
|
-
isOptional: true,
|
|
360
|
-
defaultValue: 0
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}),
|
|
364
|
-
output: defineSchemaModel({
|
|
365
|
-
name: "GetRunLogsOutput",
|
|
366
|
-
fields: {
|
|
367
|
-
items: {
|
|
368
|
-
type: RunLogModel,
|
|
369
|
-
isArray: true,
|
|
370
|
-
isOptional: false
|
|
371
|
-
},
|
|
372
|
-
total: {
|
|
373
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
374
|
-
isOptional: false
|
|
375
|
-
},
|
|
376
|
-
hasMore: {
|
|
377
|
-
type: ScalarTypeEnum.Boolean(),
|
|
378
|
-
isOptional: false
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
})
|
|
382
|
-
},
|
|
383
|
-
policy: { auth: "user" }
|
|
384
|
-
});
|
|
385
|
-
/**
|
|
386
|
-
* GetRunMetricsQuery - Retrieves aggregated metrics for runs.
|
|
387
|
-
*/
|
|
388
|
-
const GetRunMetricsQuery = defineQuery({
|
|
389
|
-
meta: {
|
|
390
|
-
name: "agent.run.getMetrics",
|
|
391
|
-
version: 1,
|
|
392
|
-
stability: "stable",
|
|
393
|
-
owners: [...OWNERS],
|
|
394
|
-
tags: ["run", "metrics"],
|
|
395
|
-
description: "Retrieves aggregated metrics for runs within a time period.",
|
|
396
|
-
goal: "Monitor and analyze agent usage.",
|
|
397
|
-
context: "Analytics dashboard."
|
|
398
|
-
},
|
|
399
|
-
io: {
|
|
400
|
-
input: defineSchemaModel({
|
|
401
|
-
name: "GetRunMetricsInput",
|
|
402
|
-
fields: {
|
|
403
|
-
organizationId: {
|
|
404
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
405
|
-
isOptional: false
|
|
406
|
-
},
|
|
407
|
-
agentId: {
|
|
408
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
409
|
-
isOptional: true
|
|
410
|
-
},
|
|
411
|
-
startDate: {
|
|
412
|
-
type: ScalarTypeEnum.DateTime(),
|
|
413
|
-
isOptional: false
|
|
414
|
-
},
|
|
415
|
-
endDate: {
|
|
416
|
-
type: ScalarTypeEnum.DateTime(),
|
|
417
|
-
isOptional: false
|
|
418
|
-
},
|
|
419
|
-
granularity: {
|
|
420
|
-
type: GranularityEnum,
|
|
421
|
-
isOptional: true,
|
|
422
|
-
defaultValue: "day"
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}),
|
|
426
|
-
output: defineSchemaModel({
|
|
427
|
-
name: "GetRunMetricsOutput",
|
|
428
|
-
fields: {
|
|
429
|
-
totalRuns: {
|
|
430
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
431
|
-
isOptional: false
|
|
432
|
-
},
|
|
433
|
-
completedRuns: {
|
|
434
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
435
|
-
isOptional: false
|
|
436
|
-
},
|
|
437
|
-
failedRuns: {
|
|
438
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
439
|
-
isOptional: false
|
|
440
|
-
},
|
|
441
|
-
totalTokens: {
|
|
442
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
443
|
-
isOptional: false
|
|
444
|
-
},
|
|
445
|
-
totalCostUsd: {
|
|
446
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
447
|
-
isOptional: false
|
|
448
|
-
},
|
|
449
|
-
averageDurationMs: {
|
|
450
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
451
|
-
isOptional: false
|
|
452
|
-
},
|
|
453
|
-
successRate: {
|
|
454
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
455
|
-
isOptional: false
|
|
456
|
-
},
|
|
457
|
-
timeline: {
|
|
458
|
-
type: TimelineDataPointModel,
|
|
459
|
-
isArray: true,
|
|
460
|
-
isOptional: false
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
})
|
|
464
|
-
},
|
|
465
|
-
policy: { auth: "user" }
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
//#endregion
|
|
469
|
-
export { CancelRunCommand, ExecuteAgentCommand, GetRunLogsQuery, GetRunMetricsQuery, GetRunQuery, GetRunStepsQuery, ListRunsQuery };
|
|
1
|
+
import{GranularityEnum as e,LogLevelEnum as t,RunStatusEnum as n}from"./run.enum.js";import{RunInputModel as r,RunLogModel as i,RunModel as a,RunStepModel as o,RunSummaryModel as s,TimelineDataPointModel as c}from"./run.schema.js";import{ScalarTypeEnum as l,defineSchemaModel as u}from"@lssm/lib.schema";import{defineCommand as d,defineQuery as f}from"@lssm/lib.contracts/spec";const p=[`agent-console-team`],m=d({meta:{name:`agent.run.execute`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`execute`],description:`Starts a new agent run with the given input.`,goal:`Execute an AI agent with user input.`,context:`Called from chat interface or API.`},io:{input:u({name:`ExecuteAgentInput`,fields:{agentId:{type:l.String_unsecure(),isOptional:!1},input:{type:r,isOptional:!1},sessionId:{type:l.String_unsecure(),isOptional:!0},metadata:{type:l.JSONObject(),isOptional:!0},stream:{type:l.Boolean(),isOptional:!0},maxIterations:{type:l.Int_unsecure(),isOptional:!0},timeoutMs:{type:l.Int_unsecure(),isOptional:!0}}}),output:u({name:`ExecuteAgentOutput`,fields:{runId:{type:l.String_unsecure(),isOptional:!1},status:{type:n,isOptional:!1},estimatedWaitMs:{type:l.Int_unsecure(),isOptional:!0}}}),errors:{AGENT_NOT_FOUND:{description:`The specified agent does not exist`,http:404,gqlCode:`AGENT_NOT_FOUND`,when:`Agent ID is invalid`},AGENT_NOT_ACTIVE:{description:`The specified agent is not active`,http:400,gqlCode:`AGENT_NOT_ACTIVE`,when:`Agent is in draft/paused/archived state`}}},policy:{auth:`user`},sideEffects:{emits:[{name:`run.started`,version:1,when:`Run is queued`,payload:s}],audit:[`run.started`]}}),h=d({meta:{name:`agent.run.cancel`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`cancel`],description:`Cancels an in-progress agent run.`,goal:`Stop a running agent execution.`,context:`Called when user wants to abort a long-running task.`},io:{input:u({name:`CancelRunInput`,fields:{runId:{type:l.String_unsecure(),isOptional:!1},reason:{type:l.String_unsecure(),isOptional:!0}}}),output:u({name:`CancelRunOutput`,fields:{success:{type:l.Boolean(),isOptional:!1},status:{type:n,isOptional:!1}}}),errors:{RUN_NOT_FOUND:{description:`The specified run does not exist`,http:404,gqlCode:`RUN_NOT_FOUND`,when:`Run ID is invalid`},RUN_NOT_CANCELLABLE:{description:`The run cannot be cancelled`,http:400,gqlCode:`RUN_NOT_CANCELLABLE`,when:`Run is already completed/failed/cancelled`}}},policy:{auth:`user`},sideEffects:{emits:[{name:`run.cancelled`,version:1,when:`Run is cancelled`,payload:s}],audit:[`run.cancelled`]}}),g=f({meta:{name:`agent.run.get`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`get`],description:`Retrieves a run by its ID with optional details.`,goal:`View detailed run information.`,context:`Run details page or monitoring.`},io:{input:u({name:`GetRunInput`,fields:{runId:{type:l.String_unsecure(),isOptional:!1},includeSteps:{type:l.Boolean(),isOptional:!0},includeLogs:{type:l.Boolean(),isOptional:!0}}}),output:a,errors:{RUN_NOT_FOUND:{description:`The specified run does not exist`,http:404,gqlCode:`RUN_NOT_FOUND`,when:`Run ID is invalid`}}},policy:{auth:`user`}}),_=f({meta:{name:`agent.run.list`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`list`],description:`Lists runs with optional filtering.`,goal:`Browse and search run history.`,context:`Run history/dashboard view.`},io:{input:u({name:`ListRunsInput`,fields:{organizationId:{type:l.String_unsecure(),isOptional:!0},agentId:{type:l.String_unsecure(),isOptional:!0},userId:{type:l.String_unsecure(),isOptional:!0},sessionId:{type:l.String_unsecure(),isOptional:!0},status:{type:n,isOptional:!0},startDate:{type:l.DateTime(),isOptional:!0},endDate:{type:l.DateTime(),isOptional:!0},limit:{type:l.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:l.Int_unsecure(),isOptional:!0,defaultValue:0}}}),output:u({name:`ListRunsOutput`,fields:{items:{type:s,isArray:!0,isOptional:!1},total:{type:l.Int_unsecure(),isOptional:!1},hasMore:{type:l.Boolean(),isOptional:!1}}})},policy:{auth:`user`}}),v=f({meta:{name:`agent.run.getSteps`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`steps`],description:`Retrieves all steps for a specific run.`,goal:`View step-by-step execution details.`,context:`Run details page - steps tab.`},io:{input:u({name:`GetRunStepsInput`,fields:{runId:{type:l.String_unsecure(),isOptional:!1}}}),output:u({name:`GetRunStepsOutput`,fields:{steps:{type:o,isArray:!0,isOptional:!1}}})},policy:{auth:`user`}}),y=f({meta:{name:`agent.run.getLogs`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`logs`],description:`Retrieves all logs for a specific run.`,goal:`Debug and audit run execution.`,context:`Run details page - logs tab.`},io:{input:u({name:`GetRunLogsInput`,fields:{runId:{type:l.String_unsecure(),isOptional:!1},level:{type:t,isOptional:!0},stepId:{type:l.String_unsecure(),isOptional:!0},limit:{type:l.Int_unsecure(),isOptional:!0,defaultValue:100},offset:{type:l.Int_unsecure(),isOptional:!0,defaultValue:0}}}),output:u({name:`GetRunLogsOutput`,fields:{items:{type:i,isArray:!0,isOptional:!1},total:{type:l.Int_unsecure(),isOptional:!1},hasMore:{type:l.Boolean(),isOptional:!1}}})},policy:{auth:`user`}}),b=f({meta:{name:`agent.run.getMetrics`,version:1,stability:`stable`,owners:[...p],tags:[`run`,`metrics`],description:`Retrieves aggregated metrics for runs within a time period.`,goal:`Monitor and analyze agent usage.`,context:`Analytics dashboard.`},io:{input:u({name:`GetRunMetricsInput`,fields:{organizationId:{type:l.String_unsecure(),isOptional:!1},agentId:{type:l.String_unsecure(),isOptional:!0},startDate:{type:l.DateTime(),isOptional:!1},endDate:{type:l.DateTime(),isOptional:!1},granularity:{type:e,isOptional:!0,defaultValue:`day`}}}),output:u({name:`GetRunMetricsOutput`,fields:{totalRuns:{type:l.Int_unsecure(),isOptional:!1},completedRuns:{type:l.Int_unsecure(),isOptional:!1},failedRuns:{type:l.Int_unsecure(),isOptional:!1},totalTokens:{type:l.Int_unsecure(),isOptional:!1},totalCostUsd:{type:l.Float_unsecure(),isOptional:!1},averageDurationMs:{type:l.Float_unsecure(),isOptional:!1},successRate:{type:l.Float_unsecure(),isOptional:!1},timeline:{type:c,isArray:!0,isOptional:!1}}})},policy:{auth:`user`}});export{h as CancelRunCommand,m as ExecuteAgentCommand,y as GetRunLogsQuery,b as GetRunMetricsQuery,g as GetRunQuery,v as GetRunStepsQuery,_ as ListRunsQuery};
|
package/dist/run/run.entity.js
CHANGED
|
@@ -1,205 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../libs/schema/dist/entity/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/run/run.entity.ts
|
|
5
|
-
/**
|
|
6
|
-
* Run status enum for entities.
|
|
7
|
-
*/
|
|
8
|
-
const RunStatusEntityEnum = defineEntityEnum({
|
|
9
|
-
name: "RunStatus",
|
|
10
|
-
values: [
|
|
11
|
-
"QUEUED",
|
|
12
|
-
"IN_PROGRESS",
|
|
13
|
-
"COMPLETED",
|
|
14
|
-
"FAILED",
|
|
15
|
-
"CANCELLED",
|
|
16
|
-
"EXPIRED"
|
|
17
|
-
],
|
|
18
|
-
description: "Status of an agent run"
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* Run step type enum for entities.
|
|
22
|
-
*/
|
|
23
|
-
const RunStepTypeEntityEnum = defineEntityEnum({
|
|
24
|
-
name: "RunStepType",
|
|
25
|
-
values: [
|
|
26
|
-
"MESSAGE_CREATION",
|
|
27
|
-
"TOOL_CALL",
|
|
28
|
-
"TOOL_RESULT",
|
|
29
|
-
"ERROR"
|
|
30
|
-
],
|
|
31
|
-
description: "Type of run step"
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Log level enum for entities.
|
|
35
|
-
*/
|
|
36
|
-
const LogLevelEntityEnum = defineEntityEnum({
|
|
37
|
-
name: "LogLevel",
|
|
38
|
-
values: [
|
|
39
|
-
"DEBUG",
|
|
40
|
-
"INFO",
|
|
41
|
-
"WARN",
|
|
42
|
-
"ERROR"
|
|
43
|
-
],
|
|
44
|
-
description: "Log level"
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Run entity - Represents an agent execution.
|
|
48
|
-
*/
|
|
49
|
-
const RunEntity = defineEntity({
|
|
50
|
-
name: "Run",
|
|
51
|
-
schema: "agent_console",
|
|
52
|
-
description: "An execution of an agent with input/output and metrics.",
|
|
53
|
-
fields: {
|
|
54
|
-
id: field.id(),
|
|
55
|
-
organizationId: field.string({ description: "Organization ID" }),
|
|
56
|
-
agentId: field.foreignKey({ description: "Agent being executed" }),
|
|
57
|
-
userId: field.string({
|
|
58
|
-
isOptional: true,
|
|
59
|
-
description: "User who initiated the run"
|
|
60
|
-
}),
|
|
61
|
-
sessionId: field.string({
|
|
62
|
-
isOptional: true,
|
|
63
|
-
description: "Conversation session ID"
|
|
64
|
-
}),
|
|
65
|
-
input: field.json({ description: "Input data for the run" }),
|
|
66
|
-
output: field.json({
|
|
67
|
-
isOptional: true,
|
|
68
|
-
description: "Output result from the run"
|
|
69
|
-
}),
|
|
70
|
-
status: field.enum("RunStatus", { default: "QUEUED" }),
|
|
71
|
-
errorMessage: field.string({
|
|
72
|
-
isOptional: true,
|
|
73
|
-
description: "Error message if failed"
|
|
74
|
-
}),
|
|
75
|
-
errorCode: field.string({
|
|
76
|
-
isOptional: true,
|
|
77
|
-
description: "Error code if failed"
|
|
78
|
-
}),
|
|
79
|
-
totalTokens: field.int({
|
|
80
|
-
default: 0,
|
|
81
|
-
description: "Total tokens used"
|
|
82
|
-
}),
|
|
83
|
-
promptTokens: field.int({
|
|
84
|
-
default: 0,
|
|
85
|
-
description: "Prompt tokens used"
|
|
86
|
-
}),
|
|
87
|
-
completionTokens: field.int({
|
|
88
|
-
default: 0,
|
|
89
|
-
description: "Completion tokens used"
|
|
90
|
-
}),
|
|
91
|
-
totalIterations: field.int({
|
|
92
|
-
default: 0,
|
|
93
|
-
description: "Number of iterations"
|
|
94
|
-
}),
|
|
95
|
-
durationMs: field.int({
|
|
96
|
-
isOptional: true,
|
|
97
|
-
description: "Execution duration in ms"
|
|
98
|
-
}),
|
|
99
|
-
estimatedCostUsd: field.float({
|
|
100
|
-
isOptional: true,
|
|
101
|
-
description: "Estimated cost in USD"
|
|
102
|
-
}),
|
|
103
|
-
queuedAt: field.dateTime({ description: "When run was queued" }),
|
|
104
|
-
startedAt: field.dateTime({
|
|
105
|
-
isOptional: true,
|
|
106
|
-
description: "When run started executing"
|
|
107
|
-
}),
|
|
108
|
-
completedAt: field.dateTime({
|
|
109
|
-
isOptional: true,
|
|
110
|
-
description: "When run completed"
|
|
111
|
-
}),
|
|
112
|
-
metadata: field.json({
|
|
113
|
-
isOptional: true,
|
|
114
|
-
description: "Additional metadata"
|
|
115
|
-
}),
|
|
116
|
-
agent: field.belongsTo("Agent", ["agentId"], ["id"]),
|
|
117
|
-
steps: field.hasMany("RunStep", { description: "Execution steps" }),
|
|
118
|
-
logs: field.hasMany("RunLog", { description: "Execution logs" })
|
|
119
|
-
},
|
|
120
|
-
indexes: [
|
|
121
|
-
index.on([
|
|
122
|
-
"organizationId",
|
|
123
|
-
"agentId",
|
|
124
|
-
"queuedAt"
|
|
125
|
-
]),
|
|
126
|
-
index.on(["organizationId", "status"]),
|
|
127
|
-
index.on(["agentId", "status"]),
|
|
128
|
-
index.on(["sessionId"])
|
|
129
|
-
],
|
|
130
|
-
enums: [RunStatusEntityEnum]
|
|
131
|
-
});
|
|
132
|
-
/**
|
|
133
|
-
* RunStep entity - Individual step in a run.
|
|
134
|
-
*/
|
|
135
|
-
const RunStepEntity = defineEntity({
|
|
136
|
-
name: "RunStep",
|
|
137
|
-
schema: "agent_console",
|
|
138
|
-
description: "An individual step in an agent run.",
|
|
139
|
-
fields: {
|
|
140
|
-
id: field.id(),
|
|
141
|
-
runId: field.foreignKey({ description: "Parent run" }),
|
|
142
|
-
stepNumber: field.int({ description: "Step sequence number" }),
|
|
143
|
-
type: field.enum("RunStepType"),
|
|
144
|
-
toolId: field.string({
|
|
145
|
-
isOptional: true,
|
|
146
|
-
description: "Tool used in this step"
|
|
147
|
-
}),
|
|
148
|
-
toolName: field.string({
|
|
149
|
-
isOptional: true,
|
|
150
|
-
description: "Tool name"
|
|
151
|
-
}),
|
|
152
|
-
input: field.json({
|
|
153
|
-
isOptional: true,
|
|
154
|
-
description: "Step input"
|
|
155
|
-
}),
|
|
156
|
-
output: field.json({
|
|
157
|
-
isOptional: true,
|
|
158
|
-
description: "Step output"
|
|
159
|
-
}),
|
|
160
|
-
status: field.enum("RunStatus"),
|
|
161
|
-
errorMessage: field.string({ isOptional: true }),
|
|
162
|
-
tokensUsed: field.int({ default: 0 }),
|
|
163
|
-
durationMs: field.int({ isOptional: true }),
|
|
164
|
-
startedAt: field.dateTime(),
|
|
165
|
-
completedAt: field.dateTime({ isOptional: true }),
|
|
166
|
-
run: field.belongsTo("Run", ["runId"], ["id"])
|
|
167
|
-
},
|
|
168
|
-
indexes: [index.on(["runId", "stepNumber"])],
|
|
169
|
-
enums: [RunStepTypeEntityEnum]
|
|
170
|
-
});
|
|
171
|
-
/**
|
|
172
|
-
* RunLog entity - Log entry for a run.
|
|
173
|
-
*/
|
|
174
|
-
const RunLogEntity = defineEntity({
|
|
175
|
-
name: "RunLog",
|
|
176
|
-
schema: "agent_console",
|
|
177
|
-
description: "A log entry for an agent run.",
|
|
178
|
-
fields: {
|
|
179
|
-
id: field.id(),
|
|
180
|
-
runId: field.foreignKey({ description: "Parent run" }),
|
|
181
|
-
stepId: field.string({
|
|
182
|
-
isOptional: true,
|
|
183
|
-
description: "Related step"
|
|
184
|
-
}),
|
|
185
|
-
level: field.enum("LogLevel"),
|
|
186
|
-
message: field.string({ description: "Log message" }),
|
|
187
|
-
data: field.json({
|
|
188
|
-
isOptional: true,
|
|
189
|
-
description: "Additional log data"
|
|
190
|
-
}),
|
|
191
|
-
source: field.string({
|
|
192
|
-
isOptional: true,
|
|
193
|
-
description: "Log source component"
|
|
194
|
-
}),
|
|
195
|
-
traceId: field.string({ isOptional: true }),
|
|
196
|
-
spanId: field.string({ isOptional: true }),
|
|
197
|
-
timestamp: field.dateTime(),
|
|
198
|
-
run: field.belongsTo("Run", ["runId"], ["id"])
|
|
199
|
-
},
|
|
200
|
-
indexes: [index.on(["runId", "timestamp"]), index.on(["runId", "level"])],
|
|
201
|
-
enums: [LogLevelEntityEnum]
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
//#endregion
|
|
205
|
-
export { LogLevelEntityEnum, RunEntity, RunLogEntity, RunStatusEntityEnum, RunStepEntity, RunStepTypeEntityEnum };
|
|
1
|
+
import{defineEntity as e,defineEntityEnum as t,field as n,index as r}from"@lssm/lib.schema/entity";const i=t({name:`RunStatus`,values:[`QUEUED`,`IN_PROGRESS`,`COMPLETED`,`FAILED`,`CANCELLED`,`EXPIRED`],description:`Status of an agent run`}),a=t({name:`RunStepType`,values:[`MESSAGE_CREATION`,`TOOL_CALL`,`TOOL_RESULT`,`ERROR`],description:`Type of run step`}),o=t({name:`LogLevel`,values:[`DEBUG`,`INFO`,`WARN`,`ERROR`],description:`Log level`}),s=e({name:`Run`,schema:`agent_console`,description:`An execution of an agent with input/output and metrics.`,fields:{id:n.id(),organizationId:n.string({description:`Organization ID`}),agentId:n.foreignKey({description:`Agent being executed`}),userId:n.string({isOptional:!0,description:`User who initiated the run`}),sessionId:n.string({isOptional:!0,description:`Conversation session ID`}),input:n.json({description:`Input data for the run`}),output:n.json({isOptional:!0,description:`Output result from the run`}),status:n.enum(`RunStatus`,{default:`QUEUED`}),errorMessage:n.string({isOptional:!0,description:`Error message if failed`}),errorCode:n.string({isOptional:!0,description:`Error code if failed`}),totalTokens:n.int({default:0,description:`Total tokens used`}),promptTokens:n.int({default:0,description:`Prompt tokens used`}),completionTokens:n.int({default:0,description:`Completion tokens used`}),totalIterations:n.int({default:0,description:`Number of iterations`}),durationMs:n.int({isOptional:!0,description:`Execution duration in ms`}),estimatedCostUsd:n.float({isOptional:!0,description:`Estimated cost in USD`}),queuedAt:n.dateTime({description:`When run was queued`}),startedAt:n.dateTime({isOptional:!0,description:`When run started executing`}),completedAt:n.dateTime({isOptional:!0,description:`When run completed`}),metadata:n.json({isOptional:!0,description:`Additional metadata`}),agent:n.belongsTo(`Agent`,[`agentId`],[`id`]),steps:n.hasMany(`RunStep`,{description:`Execution steps`}),logs:n.hasMany(`RunLog`,{description:`Execution logs`})},indexes:[r.on([`organizationId`,`agentId`,`queuedAt`]),r.on([`organizationId`,`status`]),r.on([`agentId`,`status`]),r.on([`sessionId`])],enums:[i]}),c=e({name:`RunStep`,schema:`agent_console`,description:`An individual step in an agent run.`,fields:{id:n.id(),runId:n.foreignKey({description:`Parent run`}),stepNumber:n.int({description:`Step sequence number`}),type:n.enum(`RunStepType`),toolId:n.string({isOptional:!0,description:`Tool used in this step`}),toolName:n.string({isOptional:!0,description:`Tool name`}),input:n.json({isOptional:!0,description:`Step input`}),output:n.json({isOptional:!0,description:`Step output`}),status:n.enum(`RunStatus`),errorMessage:n.string({isOptional:!0}),tokensUsed:n.int({default:0}),durationMs:n.int({isOptional:!0}),startedAt:n.dateTime(),completedAt:n.dateTime({isOptional:!0}),run:n.belongsTo(`Run`,[`runId`],[`id`])},indexes:[r.on([`runId`,`stepNumber`])],enums:[a]}),l=e({name:`RunLog`,schema:`agent_console`,description:`A log entry for an agent run.`,fields:{id:n.id(),runId:n.foreignKey({description:`Parent run`}),stepId:n.string({isOptional:!0,description:`Related step`}),level:n.enum(`LogLevel`),message:n.string({description:`Log message`}),data:n.json({isOptional:!0,description:`Additional log data`}),source:n.string({isOptional:!0,description:`Log source component`}),traceId:n.string({isOptional:!0}),spanId:n.string({isOptional:!0}),timestamp:n.dateTime(),run:n.belongsTo(`Run`,[`runId`],[`id`])},indexes:[r.on([`runId`,`timestamp`]),r.on([`runId`,`level`])],enums:[o]});export{o as LogLevelEntityEnum,s as RunEntity,l as RunLogEntity,i as RunStatusEntityEnum,c as RunStepEntity,a as RunStepTypeEntityEnum};
|