@contractspec/example.agent-console 1.44.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.
Files changed (168) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +133 -0
  2. package/.turbo/turbo-build.log +134 -0
  3. package/CHANGELOG.md +212 -0
  4. package/LICENSE +21 -0
  5. package/README.md +86 -0
  6. package/dist/agent/agent.entity.d.ts +55 -0
  7. package/dist/agent/agent.entity.d.ts.map +1 -0
  8. package/dist/agent/agent.entity.js +136 -0
  9. package/dist/agent/agent.entity.js.map +1 -0
  10. package/dist/agent/agent.enum.d.ts +18 -0
  11. package/dist/agent/agent.enum.d.ts.map +1 -0
  12. package/dist/agent/agent.enum.js +34 -0
  13. package/dist/agent/agent.enum.js.map +1 -0
  14. package/dist/agent/agent.event.d.ts +128 -0
  15. package/dist/agent/agent.event.d.ts.map +1 -0
  16. package/dist/agent/agent.event.js +210 -0
  17. package/dist/agent/agent.event.js.map +1 -0
  18. package/dist/agent/agent.handler.d.ts +100 -0
  19. package/dist/agent/agent.handler.d.ts.map +1 -0
  20. package/dist/agent/agent.handler.js +84 -0
  21. package/dist/agent/agent.handler.js.map +1 -0
  22. package/dist/agent/agent.operation.d.ts +471 -0
  23. package/dist/agent/agent.operation.d.ts.map +1 -0
  24. package/dist/agent/agent.operation.js +486 -0
  25. package/dist/agent/agent.operation.js.map +1 -0
  26. package/dist/agent/agent.presentation.d.ts +19 -0
  27. package/dist/agent/agent.presentation.d.ts.map +1 -0
  28. package/dist/agent/agent.presentation.js +89 -0
  29. package/dist/agent/agent.presentation.js.map +1 -0
  30. package/dist/agent/agent.schema.d.ts +401 -0
  31. package/dist/agent/agent.schema.d.ts.map +1 -0
  32. package/dist/agent/agent.schema.js +406 -0
  33. package/dist/agent/agent.schema.js.map +1 -0
  34. package/dist/agent/index.d.ts +8 -0
  35. package/dist/agent/index.js +9 -0
  36. package/dist/agent.feature.d.ts +12 -0
  37. package/dist/agent.feature.d.ts.map +1 -0
  38. package/dist/agent.feature.js +303 -0
  39. package/dist/agent.feature.js.map +1 -0
  40. package/dist/docs/agent-console.docblock.d.ts +1 -0
  41. package/dist/docs/agent-console.docblock.js +113 -0
  42. package/dist/docs/agent-console.docblock.js.map +1 -0
  43. package/dist/docs/index.d.ts +1 -0
  44. package/dist/docs/index.js +1 -0
  45. package/dist/example.d.ts +40 -0
  46. package/dist/example.d.ts.map +1 -0
  47. package/dist/example.js +51 -0
  48. package/dist/example.js.map +1 -0
  49. package/dist/handlers/index.d.ts +4 -0
  50. package/dist/handlers/index.js +5 -0
  51. package/dist/index.d.ts +30 -0
  52. package/dist/index.js +32 -0
  53. package/dist/presentations/index.d.ts +4 -0
  54. package/dist/presentations/index.js +5 -0
  55. package/dist/run/index.d.ts +8 -0
  56. package/dist/run/index.js +9 -0
  57. package/dist/run/run.entity.d.ts +82 -0
  58. package/dist/run/run.entity.d.ts.map +1 -0
  59. package/dist/run/run.entity.js +205 -0
  60. package/dist/run/run.entity.js.map +1 -0
  61. package/dist/run/run.enum.d.ts +22 -0
  62. package/dist/run/run.enum.d.ts.map +1 -0
  63. package/dist/run/run.enum.js +45 -0
  64. package/dist/run/run.enum.js.map +1 -0
  65. package/dist/run/run.event.d.ts +290 -0
  66. package/dist/run/run.event.d.ts.map +1 -0
  67. package/dist/run/run.event.js +434 -0
  68. package/dist/run/run.event.js.map +1 -0
  69. package/dist/run/run.handler.d.ts +203 -0
  70. package/dist/run/run.handler.d.ts.map +1 -0
  71. package/dist/run/run.handler.js +83 -0
  72. package/dist/run/run.handler.js.map +1 -0
  73. package/dist/run/run.operation.d.ts +720 -0
  74. package/dist/run/run.operation.d.ts.map +1 -0
  75. package/dist/run/run.operation.js +626 -0
  76. package/dist/run/run.operation.js.map +1 -0
  77. package/dist/run/run.presentation.d.ts +15 -0
  78. package/dist/run/run.presentation.d.ts.map +1 -0
  79. package/dist/run/run.presentation.js +65 -0
  80. package/dist/run/run.presentation.js.map +1 -0
  81. package/dist/run/run.schema.d.ts +416 -0
  82. package/dist/run/run.schema.d.ts.map +1 -0
  83. package/dist/run/run.schema.js +338 -0
  84. package/dist/run/run.schema.js.map +1 -0
  85. package/dist/shared/index.d.ts +4 -0
  86. package/dist/shared/index.js +5 -0
  87. package/dist/shared/mock-agents.d.ts +88 -0
  88. package/dist/shared/mock-agents.d.ts.map +1 -0
  89. package/dist/shared/mock-agents.js +94 -0
  90. package/dist/shared/mock-agents.js.map +1 -0
  91. package/dist/shared/mock-runs.d.ts +120 -0
  92. package/dist/shared/mock-runs.d.ts.map +1 -0
  93. package/dist/shared/mock-runs.js +118 -0
  94. package/dist/shared/mock-runs.js.map +1 -0
  95. package/dist/shared/mock-tools.d.ts +244 -0
  96. package/dist/shared/mock-tools.d.ts.map +1 -0
  97. package/dist/shared/mock-tools.js +181 -0
  98. package/dist/shared/mock-tools.js.map +1 -0
  99. package/dist/tool/index.d.ts +8 -0
  100. package/dist/tool/index.js +9 -0
  101. package/dist/tool/tool.entity.d.ts +42 -0
  102. package/dist/tool/tool.entity.d.ts.map +1 -0
  103. package/dist/tool/tool.entity.js +105 -0
  104. package/dist/tool/tool.entity.js.map +1 -0
  105. package/dist/tool/tool.enum.d.ts +18 -0
  106. package/dist/tool/tool.enum.d.ts.map +1 -0
  107. package/dist/tool/tool.enum.js +35 -0
  108. package/dist/tool/tool.enum.js.map +1 -0
  109. package/dist/tool/tool.event.d.ts +103 -0
  110. package/dist/tool/tool.event.d.ts.map +1 -0
  111. package/dist/tool/tool.event.js +159 -0
  112. package/dist/tool/tool.event.js.map +1 -0
  113. package/dist/tool/tool.handler.d.ts +315 -0
  114. package/dist/tool/tool.handler.d.ts.map +1 -0
  115. package/dist/tool/tool.handler.js +87 -0
  116. package/dist/tool/tool.handler.js.map +1 -0
  117. package/dist/tool/tool.operation.d.ts +411 -0
  118. package/dist/tool/tool.operation.d.ts.map +1 -0
  119. package/dist/tool/tool.operation.js +406 -0
  120. package/dist/tool/tool.operation.js.map +1 -0
  121. package/dist/tool/tool.presentation.d.ts +15 -0
  122. package/dist/tool/tool.presentation.d.ts.map +1 -0
  123. package/dist/tool/tool.presentation.js +65 -0
  124. package/dist/tool/tool.presentation.js.map +1 -0
  125. package/dist/tool/tool.schema.d.ts +218 -0
  126. package/dist/tool/tool.schema.d.ts.map +1 -0
  127. package/dist/tool/tool.schema.js +236 -0
  128. package/dist/tool/tool.schema.js.map +1 -0
  129. package/example.ts +1 -0
  130. package/package.json +123 -0
  131. package/src/agent/agent.entity.ts +137 -0
  132. package/src/agent/agent.enum.ts +31 -0
  133. package/src/agent/agent.event.ts +142 -0
  134. package/src/agent/agent.handler.ts +178 -0
  135. package/src/agent/agent.operation.ts +444 -0
  136. package/src/agent/agent.presentation.ts +81 -0
  137. package/src/agent/agent.schema.ts +214 -0
  138. package/src/agent/index.ts +67 -0
  139. package/src/agent.feature.ts +146 -0
  140. package/src/docs/agent-console.docblock.ts +97 -0
  141. package/src/docs/index.ts +1 -0
  142. package/src/example.ts +34 -0
  143. package/src/handlers/index.ts +27 -0
  144. package/src/index.ts +27 -0
  145. package/src/presentations/index.ts +26 -0
  146. package/src/run/index.ts +68 -0
  147. package/src/run/run.entity.ts +175 -0
  148. package/src/run/run.enum.ts +43 -0
  149. package/src/run/run.event.ts +264 -0
  150. package/src/run/run.handler.ts +138 -0
  151. package/src/run/run.operation.ts +524 -0
  152. package/src/run/run.presentation.ts +55 -0
  153. package/src/run/run.schema.ts +169 -0
  154. package/src/shared/index.ts +6 -0
  155. package/src/shared/mock-agents.ts +81 -0
  156. package/src/shared/mock-runs.ts +107 -0
  157. package/src/shared/mock-tools.ts +145 -0
  158. package/src/tool/index.ts +60 -0
  159. package/src/tool/tool.entity.ts +99 -0
  160. package/src/tool/tool.enum.ts +32 -0
  161. package/src/tool/tool.event.ts +119 -0
  162. package/src/tool/tool.handler.ts +154 -0
  163. package/src/tool/tool.operation.ts +366 -0
  164. package/src/tool/tool.presentation.ts +56 -0
  165. package/src/tool/tool.schema.ts +133 -0
  166. package/tsconfig.json +10 -0
  167. package/tsconfig.tsbuildinfo +1 -0
  168. package/tsdown.config.js +7 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.operation.d.ts","names":[],"sources":["../../src/run/run.operation.ts"],"sourcesContent":[],"mappings":";;;;;;;cAoBa,mDAAmB,0CAAA;EAAnB,OAAA,EAAA;IA2FX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;IA3F8B,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;EAAA,CAAA;EAgGnB,SAAA,EAAA;IA+EX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;CA/E2B,CAAA,yCAAA,CAAA;;UAhGG,2BAAA,CAAA;;;;;;;;;;;;;;EAgGH,SAAA,EAAA,MAAA;EAoFhB,MAAA,EAAA,qBAgDX,EAAA;EAAA,IAAA,EAAA,MAAA,EAAA;;;;MAhDsB,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cApFX,gDAAgB,0CAAA;;UA+E3B,2BAAA,CAAA;;;;;;;;;UA/E2B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;IAoFL,CAAA;IAqDX,OAAA,EAAA;MAgEX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;MAhEwB,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;MAAA,IAAA,uCAAA,KAAA,EAAA,MAAA,CAAA;MAqEb,UAAA,EA2CX,IAAA;IAAA,CAAA;;CA3C2B,EAAA,CAAA;;;;cA1HhB,2CAAW,0CAAA;;UAgDtB,2BAAA,CAAA;;;;;;;;;;;;;UAhDsB,2BAAA,CAAA;;;EA0HK,cAAA,EAAA;IAgDhB,IAAA,uCAyDX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;EAzD0B,MAAA,EAAA;;;;;;;;;;;;;;;;;IAAA,IAAA,sCAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IA8Df,UAAA,EAAA,KA2FX;EAAA,CAAA;;;;;;;;EA3F6B,CAAA;;;;;;;;;;;;;;;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAnLlB,6CAAa,0CAAA;;UAgExB,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAhEwB,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqEb,gDAAgB,0CAAA;;UA2C3B,2BAAA,CAAA;;;;;;;cA3C2B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgDhB,+CAAe,0CAAA;;UAyD1B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;cAzD0B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8Df,kDAAkB,0CAAA;;UA2F7B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;UA3F6B,2BAAA,CAAA"}
@@ -0,0 +1,626 @@
1
+ import { GranularityEnum, LogLevelEnum, RunStatusEnum } from "./run.enum.js";
2
+ import { RunInputModel, RunLogModel, RunModel, RunStepModel, RunSummaryModel, TimelineDataPointModel } from "./run.schema.js";
3
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts/operations";
5
+
6
+ //#region src/run/run.operation.ts
7
+ const OWNERS = ["@agent-console-team"];
8
+ /**
9
+ * ExecuteAgentCommand - Starts a new agent run.
10
+ */
11
+ const ExecuteAgentCommand = defineCommand({
12
+ meta: {
13
+ key: "agent.run.execute",
14
+ version: 1,
15
+ stability: "stable",
16
+ owners: [...OWNERS],
17
+ tags: ["run", "execute"],
18
+ description: "Starts a new agent run with the given input.",
19
+ goal: "Execute an AI agent with user input.",
20
+ context: "Called from chat interface or API."
21
+ },
22
+ io: {
23
+ input: defineSchemaModel({
24
+ name: "ExecuteAgentInput",
25
+ fields: {
26
+ agentId: {
27
+ type: ScalarTypeEnum.String_unsecure(),
28
+ isOptional: false
29
+ },
30
+ input: {
31
+ type: RunInputModel,
32
+ isOptional: false
33
+ },
34
+ sessionId: {
35
+ type: ScalarTypeEnum.String_unsecure(),
36
+ isOptional: true
37
+ },
38
+ metadata: {
39
+ type: ScalarTypeEnum.JSONObject(),
40
+ isOptional: true
41
+ },
42
+ stream: {
43
+ type: ScalarTypeEnum.Boolean(),
44
+ isOptional: true
45
+ },
46
+ maxIterations: {
47
+ type: ScalarTypeEnum.Int_unsecure(),
48
+ isOptional: true
49
+ },
50
+ timeoutMs: {
51
+ type: ScalarTypeEnum.Int_unsecure(),
52
+ isOptional: true
53
+ }
54
+ }
55
+ }),
56
+ output: defineSchemaModel({
57
+ name: "ExecuteAgentOutput",
58
+ fields: {
59
+ runId: {
60
+ type: ScalarTypeEnum.String_unsecure(),
61
+ isOptional: false
62
+ },
63
+ status: {
64
+ type: RunStatusEnum,
65
+ isOptional: false
66
+ },
67
+ estimatedWaitMs: {
68
+ type: ScalarTypeEnum.Int_unsecure(),
69
+ isOptional: true
70
+ }
71
+ }
72
+ }),
73
+ errors: {
74
+ AGENT_NOT_FOUND: {
75
+ description: "The specified agent does not exist",
76
+ http: 404,
77
+ gqlCode: "AGENT_NOT_FOUND",
78
+ when: "Agent ID is invalid"
79
+ },
80
+ AGENT_NOT_ACTIVE: {
81
+ description: "The specified agent is not active",
82
+ http: 400,
83
+ gqlCode: "AGENT_NOT_ACTIVE",
84
+ when: "Agent is in draft/paused/archived state"
85
+ }
86
+ }
87
+ },
88
+ policy: { auth: "user" },
89
+ sideEffects: {
90
+ emits: [{
91
+ key: "run.started",
92
+ version: 1,
93
+ stability: "stable",
94
+ owners: [...OWNERS],
95
+ tags: ["run", "started"],
96
+ when: "Run is queued",
97
+ payload: RunSummaryModel
98
+ }],
99
+ audit: ["run.started"]
100
+ },
101
+ acceptance: {
102
+ scenarios: [{
103
+ key: "execute-agent-happy-path",
104
+ given: ["Agent exists", "Agent is active"],
105
+ when: ["User submits execution request"],
106
+ then: ["Run is created", "RunStarted event is emitted"]
107
+ }, {
108
+ key: "execute-agent-not-active",
109
+ given: ["Agent exists but is not active"],
110
+ when: ["User attempts to execute"],
111
+ then: ["AGENT_NOT_ACTIVE error is returned"]
112
+ }],
113
+ examples: [{
114
+ key: "basic-execute",
115
+ input: {
116
+ agentId: "agent-123",
117
+ input: { message: "Hello" }
118
+ },
119
+ output: {
120
+ runId: "run-456",
121
+ status: "pending",
122
+ estimatedWaitMs: 5e3
123
+ }
124
+ }]
125
+ }
126
+ });
127
+ /**
128
+ * CancelRunCommand - Cancels an in-progress run.
129
+ */
130
+ const CancelRunCommand = defineCommand({
131
+ meta: {
132
+ key: "agent.run.cancel",
133
+ version: 1,
134
+ stability: "stable",
135
+ owners: [...OWNERS],
136
+ tags: ["run", "cancel"],
137
+ description: "Cancels an in-progress agent run.",
138
+ goal: "Stop a running agent execution.",
139
+ context: "Called when user wants to abort a long-running task."
140
+ },
141
+ io: {
142
+ input: defineSchemaModel({
143
+ name: "CancelRunInput",
144
+ fields: {
145
+ runId: {
146
+ type: ScalarTypeEnum.String_unsecure(),
147
+ isOptional: false
148
+ },
149
+ reason: {
150
+ type: ScalarTypeEnum.String_unsecure(),
151
+ isOptional: true
152
+ }
153
+ }
154
+ }),
155
+ output: defineSchemaModel({
156
+ name: "CancelRunOutput",
157
+ fields: {
158
+ success: {
159
+ type: ScalarTypeEnum.Boolean(),
160
+ isOptional: false
161
+ },
162
+ status: {
163
+ type: RunStatusEnum,
164
+ isOptional: false
165
+ }
166
+ }
167
+ }),
168
+ errors: {
169
+ RUN_NOT_FOUND: {
170
+ description: "The specified run does not exist",
171
+ http: 404,
172
+ gqlCode: "RUN_NOT_FOUND",
173
+ when: "Run ID is invalid"
174
+ },
175
+ RUN_NOT_CANCELLABLE: {
176
+ description: "The run cannot be cancelled",
177
+ http: 400,
178
+ gqlCode: "RUN_NOT_CANCELLABLE",
179
+ when: "Run is already completed/failed/cancelled"
180
+ }
181
+ }
182
+ },
183
+ policy: { auth: "user" },
184
+ sideEffects: {
185
+ emits: [{
186
+ key: "run.cancelled",
187
+ version: 1,
188
+ stability: "stable",
189
+ owners: [...OWNERS],
190
+ tags: ["run", "cancelled"],
191
+ when: "Run is cancelled",
192
+ payload: RunSummaryModel
193
+ }],
194
+ audit: ["run.cancelled"]
195
+ },
196
+ acceptance: {
197
+ scenarios: [{
198
+ key: "cancel-run-happy-path",
199
+ given: ["Run exists", "Run is in progress"],
200
+ when: ["User cancels run"],
201
+ then: ["Run is cancelled", "RunCancelled event is emitted"]
202
+ }, {
203
+ key: "cancel-run-already-completed",
204
+ given: ["Run exists but is already completed"],
205
+ when: ["User attempts to cancel"],
206
+ then: ["RUN_NOT_CANCELLABLE error is returned"]
207
+ }],
208
+ examples: [{
209
+ key: "cancel-basic",
210
+ input: {
211
+ runId: "run-456",
212
+ reason: "User requested"
213
+ },
214
+ output: {
215
+ success: true,
216
+ status: "cancelled"
217
+ }
218
+ }]
219
+ }
220
+ });
221
+ /**
222
+ * GetRunQuery - Retrieves a run by ID.
223
+ */
224
+ const GetRunQuery = defineQuery({
225
+ meta: {
226
+ key: "agent.run.get",
227
+ version: 1,
228
+ stability: "stable",
229
+ owners: [...OWNERS],
230
+ tags: ["run", "get"],
231
+ description: "Retrieves a run by its ID with optional details.",
232
+ goal: "View detailed run information.",
233
+ context: "Run details page or monitoring."
234
+ },
235
+ io: {
236
+ input: defineSchemaModel({
237
+ name: "GetRunInput",
238
+ fields: {
239
+ runId: {
240
+ type: ScalarTypeEnum.String_unsecure(),
241
+ isOptional: false
242
+ },
243
+ includeSteps: {
244
+ type: ScalarTypeEnum.Boolean(),
245
+ isOptional: true
246
+ },
247
+ includeLogs: {
248
+ type: ScalarTypeEnum.Boolean(),
249
+ isOptional: true
250
+ }
251
+ }
252
+ }),
253
+ output: RunModel,
254
+ errors: { RUN_NOT_FOUND: {
255
+ description: "The specified run does not exist",
256
+ http: 404,
257
+ gqlCode: "RUN_NOT_FOUND",
258
+ when: "Run ID is invalid"
259
+ } }
260
+ },
261
+ policy: { auth: "user" },
262
+ acceptance: {
263
+ scenarios: [{
264
+ key: "get-run-happy-path",
265
+ given: ["Run exists"],
266
+ when: ["User requests run by ID"],
267
+ then: ["Run details are returned"]
268
+ }],
269
+ examples: [{
270
+ key: "get-with-steps",
271
+ input: {
272
+ runId: "run-456",
273
+ includeSteps: true,
274
+ includeLogs: false
275
+ },
276
+ output: {
277
+ id: "run-456",
278
+ status: "completed",
279
+ steps: []
280
+ }
281
+ }]
282
+ }
283
+ });
284
+ /**
285
+ * ListRunsQuery - Lists runs for an organization or agent.
286
+ */
287
+ const ListRunsQuery = defineQuery({
288
+ meta: {
289
+ key: "agent.run.list",
290
+ version: 1,
291
+ stability: "stable",
292
+ owners: [...OWNERS],
293
+ tags: ["run", "list"],
294
+ description: "Lists runs with optional filtering.",
295
+ goal: "Browse and search run history.",
296
+ context: "Run history/dashboard view."
297
+ },
298
+ io: {
299
+ input: defineSchemaModel({
300
+ name: "ListRunsInput",
301
+ fields: {
302
+ organizationId: {
303
+ type: ScalarTypeEnum.String_unsecure(),
304
+ isOptional: true
305
+ },
306
+ agentId: {
307
+ type: ScalarTypeEnum.String_unsecure(),
308
+ isOptional: true
309
+ },
310
+ userId: {
311
+ type: ScalarTypeEnum.String_unsecure(),
312
+ isOptional: true
313
+ },
314
+ sessionId: {
315
+ type: ScalarTypeEnum.String_unsecure(),
316
+ isOptional: true
317
+ },
318
+ status: {
319
+ type: RunStatusEnum,
320
+ isOptional: true
321
+ },
322
+ startDate: {
323
+ type: ScalarTypeEnum.DateTime(),
324
+ isOptional: true
325
+ },
326
+ endDate: {
327
+ type: ScalarTypeEnum.DateTime(),
328
+ isOptional: true
329
+ },
330
+ limit: {
331
+ type: ScalarTypeEnum.Int_unsecure(),
332
+ isOptional: true,
333
+ defaultValue: 20
334
+ },
335
+ offset: {
336
+ type: ScalarTypeEnum.Int_unsecure(),
337
+ isOptional: true,
338
+ defaultValue: 0
339
+ }
340
+ }
341
+ }),
342
+ output: defineSchemaModel({
343
+ name: "ListRunsOutput",
344
+ fields: {
345
+ items: {
346
+ type: RunSummaryModel,
347
+ isArray: true,
348
+ isOptional: false
349
+ },
350
+ total: {
351
+ type: ScalarTypeEnum.Int_unsecure(),
352
+ isOptional: false
353
+ },
354
+ hasMore: {
355
+ type: ScalarTypeEnum.Boolean(),
356
+ isOptional: false
357
+ }
358
+ }
359
+ })
360
+ },
361
+ policy: { auth: "user" },
362
+ acceptance: {
363
+ scenarios: [{
364
+ key: "list-runs-happy-path",
365
+ given: ["Organization has runs"],
366
+ when: ["User lists runs"],
367
+ then: ["Paginated list of runs is returned"]
368
+ }],
369
+ examples: [{
370
+ key: "list-by-agent",
371
+ input: {
372
+ agentId: "agent-123",
373
+ limit: 20,
374
+ offset: 0
375
+ },
376
+ output: {
377
+ items: [],
378
+ total: 0,
379
+ hasMore: false
380
+ }
381
+ }]
382
+ }
383
+ });
384
+ /**
385
+ * GetRunStepsQuery - Retrieves steps for a run.
386
+ */
387
+ const GetRunStepsQuery = defineQuery({
388
+ meta: {
389
+ key: "agent.run.getSteps",
390
+ version: 1,
391
+ stability: "stable",
392
+ owners: [...OWNERS],
393
+ tags: ["run", "steps"],
394
+ description: "Retrieves all steps for a specific run.",
395
+ goal: "View step-by-step execution details.",
396
+ context: "Run details page - steps tab."
397
+ },
398
+ io: {
399
+ input: defineSchemaModel({
400
+ name: "GetRunStepsInput",
401
+ fields: { runId: {
402
+ type: ScalarTypeEnum.String_unsecure(),
403
+ isOptional: false
404
+ } }
405
+ }),
406
+ output: defineSchemaModel({
407
+ name: "GetRunStepsOutput",
408
+ fields: { steps: {
409
+ type: RunStepModel,
410
+ isArray: true,
411
+ isOptional: false
412
+ } }
413
+ })
414
+ },
415
+ policy: { auth: "user" },
416
+ acceptance: {
417
+ scenarios: [{
418
+ key: "get-run-steps-happy-path",
419
+ given: ["Run exists with steps"],
420
+ when: ["User requests steps"],
421
+ then: ["Steps list is returned"]
422
+ }],
423
+ examples: [{
424
+ key: "get-steps-basic",
425
+ input: { runId: "run-456" },
426
+ output: { steps: [] }
427
+ }]
428
+ }
429
+ });
430
+ /**
431
+ * GetRunLogsQuery - Retrieves logs for a run.
432
+ */
433
+ const GetRunLogsQuery = defineQuery({
434
+ meta: {
435
+ key: "agent.run.getLogs",
436
+ version: 1,
437
+ stability: "stable",
438
+ owners: [...OWNERS],
439
+ tags: ["run", "logs"],
440
+ description: "Retrieves all logs for a specific run.",
441
+ goal: "Debug and audit run execution.",
442
+ context: "Run details page - logs tab."
443
+ },
444
+ io: {
445
+ input: defineSchemaModel({
446
+ name: "GetRunLogsInput",
447
+ fields: {
448
+ runId: {
449
+ type: ScalarTypeEnum.String_unsecure(),
450
+ isOptional: false
451
+ },
452
+ level: {
453
+ type: LogLevelEnum,
454
+ isOptional: true
455
+ },
456
+ stepId: {
457
+ type: ScalarTypeEnum.String_unsecure(),
458
+ isOptional: true
459
+ },
460
+ limit: {
461
+ type: ScalarTypeEnum.Int_unsecure(),
462
+ isOptional: true,
463
+ defaultValue: 100
464
+ },
465
+ offset: {
466
+ type: ScalarTypeEnum.Int_unsecure(),
467
+ isOptional: true,
468
+ defaultValue: 0
469
+ }
470
+ }
471
+ }),
472
+ output: defineSchemaModel({
473
+ name: "GetRunLogsOutput",
474
+ fields: {
475
+ items: {
476
+ type: RunLogModel,
477
+ isArray: true,
478
+ isOptional: false
479
+ },
480
+ total: {
481
+ type: ScalarTypeEnum.Int_unsecure(),
482
+ isOptional: false
483
+ },
484
+ hasMore: {
485
+ type: ScalarTypeEnum.Boolean(),
486
+ isOptional: false
487
+ }
488
+ }
489
+ })
490
+ },
491
+ policy: { auth: "user" },
492
+ acceptance: {
493
+ scenarios: [{
494
+ key: "get-run-logs-happy-path",
495
+ given: ["Run exists with logs"],
496
+ when: ["User requests logs"],
497
+ then: ["Paginated logs list is returned"]
498
+ }],
499
+ examples: [{
500
+ key: "get-logs-filtered",
501
+ input: {
502
+ runId: "run-456",
503
+ level: "error",
504
+ limit: 50
505
+ },
506
+ output: {
507
+ items: [],
508
+ total: 0,
509
+ hasMore: false
510
+ }
511
+ }]
512
+ }
513
+ });
514
+ /**
515
+ * GetRunMetricsQuery - Retrieves aggregated metrics for runs.
516
+ */
517
+ const GetRunMetricsQuery = defineQuery({
518
+ meta: {
519
+ key: "agent.run.getMetrics",
520
+ version: 1,
521
+ stability: "stable",
522
+ owners: [...OWNERS],
523
+ tags: ["run", "metrics"],
524
+ description: "Retrieves aggregated metrics for runs within a time period.",
525
+ goal: "Monitor and analyze agent usage.",
526
+ context: "Analytics dashboard."
527
+ },
528
+ io: {
529
+ input: defineSchemaModel({
530
+ name: "GetRunMetricsInput",
531
+ fields: {
532
+ organizationId: {
533
+ type: ScalarTypeEnum.String_unsecure(),
534
+ isOptional: false
535
+ },
536
+ agentId: {
537
+ type: ScalarTypeEnum.String_unsecure(),
538
+ isOptional: true
539
+ },
540
+ startDate: {
541
+ type: ScalarTypeEnum.DateTime(),
542
+ isOptional: false
543
+ },
544
+ endDate: {
545
+ type: ScalarTypeEnum.DateTime(),
546
+ isOptional: false
547
+ },
548
+ granularity: {
549
+ type: GranularityEnum,
550
+ isOptional: true,
551
+ defaultValue: "day"
552
+ }
553
+ }
554
+ }),
555
+ output: defineSchemaModel({
556
+ name: "GetRunMetricsOutput",
557
+ fields: {
558
+ totalRuns: {
559
+ type: ScalarTypeEnum.Int_unsecure(),
560
+ isOptional: false
561
+ },
562
+ completedRuns: {
563
+ type: ScalarTypeEnum.Int_unsecure(),
564
+ isOptional: false
565
+ },
566
+ failedRuns: {
567
+ type: ScalarTypeEnum.Int_unsecure(),
568
+ isOptional: false
569
+ },
570
+ totalTokens: {
571
+ type: ScalarTypeEnum.Int_unsecure(),
572
+ isOptional: false
573
+ },
574
+ totalCostUsd: {
575
+ type: ScalarTypeEnum.Float_unsecure(),
576
+ isOptional: false
577
+ },
578
+ averageDurationMs: {
579
+ type: ScalarTypeEnum.Float_unsecure(),
580
+ isOptional: false
581
+ },
582
+ successRate: {
583
+ type: ScalarTypeEnum.Float_unsecure(),
584
+ isOptional: false
585
+ },
586
+ timeline: {
587
+ type: TimelineDataPointModel,
588
+ isArray: true,
589
+ isOptional: false
590
+ }
591
+ }
592
+ })
593
+ },
594
+ policy: { auth: "user" },
595
+ acceptance: {
596
+ scenarios: [{
597
+ key: "get-run-metrics-happy-path",
598
+ given: ["Organization has run history"],
599
+ when: ["User requests metrics for date range"],
600
+ then: ["Aggregated metrics are returned"]
601
+ }],
602
+ examples: [{
603
+ key: "get-daily-metrics",
604
+ input: {
605
+ organizationId: "org-123",
606
+ startDate: "2025-01-01",
607
+ endDate: "2025-01-31",
608
+ granularity: "day"
609
+ },
610
+ output: {
611
+ totalRuns: 100,
612
+ completedRuns: 90,
613
+ failedRuns: 10,
614
+ totalTokens: 5e4,
615
+ totalCostUsd: 5,
616
+ averageDurationMs: 2500,
617
+ successRate: .9,
618
+ timeline: []
619
+ }
620
+ }]
621
+ }
622
+ });
623
+
624
+ //#endregion
625
+ export { CancelRunCommand, ExecuteAgentCommand, GetRunLogsQuery, GetRunMetricsQuery, GetRunQuery, GetRunStepsQuery, ListRunsQuery };
626
+ //# sourceMappingURL=run.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.operation.js","names":[],"sources":["../../src/run/run.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { GranularityEnum, LogLevelEnum, RunStatusEnum } from './run.enum';\nimport {\n RunInputModel,\n RunLogModel,\n RunModel,\n RunStepModel,\n RunSummaryModel,\n TimelineDataPointModel,\n} from './run.schema';\n\nconst OWNERS = ['@agent-console-team'] as const;\n\n/**\n * ExecuteAgentCommand - Starts a new agent run.\n */\nexport const ExecuteAgentCommand = defineCommand({\n meta: {\n key: 'agent.run.execute',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'execute'],\n description: 'Starts a new agent run with the given input.',\n goal: 'Execute an AI agent with user input.',\n context: 'Called from chat interface or API.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ExecuteAgentInput',\n fields: {\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n input: { type: RunInputModel, isOptional: false },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n stream: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n maxIterations: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'ExecuteAgentOutput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n estimatedWaitMs: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n },\n }),\n errors: {\n AGENT_NOT_FOUND: {\n description: 'The specified agent does not exist',\n http: 404,\n gqlCode: 'AGENT_NOT_FOUND',\n when: 'Agent ID is invalid',\n },\n AGENT_NOT_ACTIVE: {\n description: 'The specified agent is not active',\n http: 400,\n gqlCode: 'AGENT_NOT_ACTIVE',\n when: 'Agent is in draft/paused/archived state',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'run.started',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'started'],\n when: 'Run is queued',\n payload: RunSummaryModel,\n },\n ],\n audit: ['run.started'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'execute-agent-happy-path',\n given: ['Agent exists', 'Agent is active'],\n when: ['User submits execution request'],\n then: ['Run is created', 'RunStarted event is emitted'],\n },\n {\n key: 'execute-agent-not-active',\n given: ['Agent exists but is not active'],\n when: ['User attempts to execute'],\n then: ['AGENT_NOT_ACTIVE error is returned'],\n },\n ],\n examples: [\n {\n key: 'basic-execute',\n input: { agentId: 'agent-123', input: { message: 'Hello' } },\n output: { runId: 'run-456', status: 'pending', estimatedWaitMs: 5000 },\n },\n ],\n },\n});\n\n/**\n * CancelRunCommand - Cancels an in-progress run.\n */\nexport const CancelRunCommand = defineCommand({\n meta: {\n key: 'agent.run.cancel',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'cancel'],\n description: 'Cancels an in-progress agent run.',\n goal: 'Stop a running agent execution.',\n context: 'Called when user wants to abort a long-running task.',\n },\n io: {\n input: defineSchemaModel({\n name: 'CancelRunInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n }),\n output: defineSchemaModel({\n name: 'CancelRunOutput',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n },\n }),\n errors: {\n RUN_NOT_FOUND: {\n description: 'The specified run does not exist',\n http: 404,\n gqlCode: 'RUN_NOT_FOUND',\n when: 'Run ID is invalid',\n },\n RUN_NOT_CANCELLABLE: {\n description: 'The run cannot be cancelled',\n http: 400,\n gqlCode: 'RUN_NOT_CANCELLABLE',\n when: 'Run is already completed/failed/cancelled',\n },\n },\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'run.cancelled',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'cancelled'],\n when: 'Run is cancelled',\n payload: RunSummaryModel,\n },\n ],\n audit: ['run.cancelled'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'cancel-run-happy-path',\n given: ['Run exists', 'Run is in progress'],\n when: ['User cancels run'],\n then: ['Run is cancelled', 'RunCancelled event is emitted'],\n },\n {\n key: 'cancel-run-already-completed',\n given: ['Run exists but is already completed'],\n when: ['User attempts to cancel'],\n then: ['RUN_NOT_CANCELLABLE error is returned'],\n },\n ],\n examples: [\n {\n key: 'cancel-basic',\n input: { runId: 'run-456', reason: 'User requested' },\n output: { success: true, status: 'cancelled' },\n },\n ],\n },\n});\n\n/**\n * GetRunQuery - Retrieves a run by ID.\n */\nexport const GetRunQuery = defineQuery({\n meta: {\n key: 'agent.run.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'get'],\n description: 'Retrieves a run by its ID with optional details.',\n goal: 'View detailed run information.',\n context: 'Run details page or monitoring.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includeSteps: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n includeLogs: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n }),\n output: RunModel,\n errors: {\n RUN_NOT_FOUND: {\n description: 'The specified run does not exist',\n http: 404,\n gqlCode: 'RUN_NOT_FOUND',\n when: 'Run ID is invalid',\n },\n },\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-happy-path',\n given: ['Run exists'],\n when: ['User requests run by ID'],\n then: ['Run details are returned'],\n },\n ],\n examples: [\n {\n key: 'get-with-steps',\n input: { runId: 'run-456', includeSteps: true, includeLogs: false },\n output: { id: 'run-456', status: 'completed', steps: [] },\n },\n ],\n },\n});\n\n/**\n * ListRunsQuery - Lists runs for an organization or agent.\n */\nexport const ListRunsQuery = defineQuery({\n meta: {\n key: 'agent.run.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'list'],\n description: 'Lists runs with optional filtering.',\n goal: 'Browse and search run history.',\n context: 'Run history/dashboard view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListRunsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: RunStatusEnum, isOptional: true },\n startDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n endDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListRunsOutput',\n fields: {\n items: { type: RunSummaryModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'list-runs-happy-path',\n given: ['Organization has runs'],\n when: ['User lists runs'],\n then: ['Paginated list of runs is returned'],\n },\n ],\n examples: [\n {\n key: 'list-by-agent',\n input: { agentId: 'agent-123', limit: 20, offset: 0 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * GetRunStepsQuery - Retrieves steps for a run.\n */\nexport const GetRunStepsQuery = defineQuery({\n meta: {\n key: 'agent.run.getSteps',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'steps'],\n description: 'Retrieves all steps for a specific run.',\n goal: 'View step-by-step execution details.',\n context: 'Run details page - steps tab.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunStepsInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunStepsOutput',\n fields: {\n steps: { type: RunStepModel, isArray: true, isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-steps-happy-path',\n given: ['Run exists with steps'],\n when: ['User requests steps'],\n then: ['Steps list is returned'],\n },\n ],\n examples: [\n {\n key: 'get-steps-basic',\n input: { runId: 'run-456' },\n output: { steps: [] },\n },\n ],\n },\n});\n\n/**\n * GetRunLogsQuery - Retrieves logs for a run.\n */\nexport const GetRunLogsQuery = defineQuery({\n meta: {\n key: 'agent.run.getLogs',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'logs'],\n description: 'Retrieves all logs for a specific run.',\n goal: 'Debug and audit run execution.',\n context: 'Run details page - logs tab.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunLogsInput',\n fields: {\n runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n level: { type: LogLevelEnum, isOptional: true },\n stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 100,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunLogsOutput',\n fields: {\n items: { type: RunLogModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-logs-happy-path',\n given: ['Run exists with logs'],\n when: ['User requests logs'],\n then: ['Paginated logs list is returned'],\n },\n ],\n examples: [\n {\n key: 'get-logs-filtered',\n input: { runId: 'run-456', level: 'error', limit: 50 },\n output: { items: [], total: 0, hasMore: false },\n },\n ],\n },\n});\n\n/**\n * GetRunMetricsQuery - Retrieves aggregated metrics for runs.\n */\nexport const GetRunMetricsQuery = defineQuery({\n meta: {\n key: 'agent.run.getMetrics',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['run', 'metrics'],\n description: 'Retrieves aggregated metrics for runs within a time period.',\n goal: 'Monitor and analyze agent usage.',\n context: 'Analytics dashboard.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetRunMetricsInput',\n fields: {\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n startDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n endDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n granularity: {\n type: GranularityEnum,\n isOptional: true,\n defaultValue: 'day',\n },\n },\n }),\n output: defineSchemaModel({\n name: 'GetRunMetricsOutput',\n fields: {\n totalRuns: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n completedRuns: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n failedRuns: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalCostUsd: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n averageDurationMs: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n successRate: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n timeline: {\n type: TimelineDataPointModel,\n isArray: true,\n isOptional: false,\n },\n },\n }),\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'get-run-metrics-happy-path',\n given: ['Organization has run history'],\n when: ['User requests metrics for date range'],\n then: ['Aggregated metrics are returned'],\n },\n ],\n examples: [\n {\n key: 'get-daily-metrics',\n input: {\n organizationId: 'org-123',\n startDate: '2025-01-01',\n endDate: '2025-01-31',\n granularity: 'day',\n },\n output: {\n totalRuns: 100,\n completedRuns: 90,\n failedRuns: 10,\n totalTokens: 50000,\n totalCostUsd: 5.0,\n averageDurationMs: 2500,\n successRate: 0.9,\n timeline: [],\n },\n },\n ],\n },\n});\n"],"mappings":";;;;;;AAeA,MAAM,SAAS,CAAC,sBAAsB;;;;AAKtC,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,OAAO,UAAU;EACxB,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO,kBAAkB;GACvB,MAAM;GACN,QAAQ;IACN,SAAS;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAO;IACtE,OAAO;KAAE,MAAM;KAAe,YAAY;KAAO;IACjD,WAAW;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAM;IACvE,UAAU;KAAE,MAAM,eAAe,YAAY;KAAE,YAAY;KAAM;IACjE,QAAQ;KAAE,MAAM,eAAe,SAAS;KAAE,YAAY;KAAM;IAC5D,eAAe;KACb,MAAM,eAAe,cAAc;KACnC,YAAY;KACb;IACD,WAAW;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAM;IACrE;GACF,CAAC;EACF,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ;IACN,OAAO;KAAE,MAAM,eAAe,iBAAiB;KAAE,YAAY;KAAO;IACpE,QAAQ;KAAE,MAAM;KAAe,YAAY;KAAO;IAClD,iBAAiB;KACf,MAAM,eAAe,cAAc;KACnC,YAAY;KACb;IACF;GACF,CAAC;EACF,QAAQ;GACN,iBAAiB;IACf,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,kBAAkB;IAChB,aAAa;IACb,MAAM;IACN,SAAS;IACT,M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;KAAE,YAAY;KAAM;IACrE,WAAW;KAAE,MAAM,eAAe,UAAU;KAAE,YAAY;KAAO;IACjE,SAAS;KAAE,MAAM,eAAe,UAAU;KAAE,YAAY;KAAO;IAC/D,aAAa;KACX,MAAM;KACN,YAAY;KACZ,cAAc;KACf;IACF;GACF,CAAC;EACF,QAAQ,kBAAkB;GACxB,MAAM;GACN,QAAQ;IACN,WAAW;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACrE,eAAe;KACb,MAAM,eAAe,cAAc;KACnC,YAAY;KACb;IACD,YAAY;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACtE,aAAa;KAAE,MAAM,eAAe,cAAc;KAAE,YAAY;KAAO;IACvE,cAAc;KACZ,MAAM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,mBAAmB;KACjB,MAAM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,aAAa;KACX,MAAM,eAAe,gBAAgB;KACrC,YAAY;KACb;IACD,UAAU;KACR,MAAM;KACN,SAAS;KACT,YAAY;KACb;IACF;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,+BAA+B;GACvC,MAAM,CAAC,uCAAuC;GAC9C,MAAM,CAAC,kCAAkC;GAC1C,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IACL,gBAAgB;IAChB,WAAW;IACX,SAAS;IACT,aAAa;IACd;GACD,QAAQ;IACN,WAAW;IACX,eAAe;IACf,YAAY;IACZ,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,aAAa;IACb,UAAU,EAAE;IACb;GACF,CACF;EACF;CACF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { PresentationSpec } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/run/run.presentation.d.ts
4
+
5
+ /**
6
+ * Presentation for displaying a list of agent runs.
7
+ */
8
+ declare const RunListPresentation: PresentationSpec;
9
+ /**
10
+ * Presentation for run detail view.
11
+ */
12
+ declare const RunDetailPresentation: PresentationSpec;
13
+ //#endregion
14
+ export { RunDetailPresentation, RunListPresentation };
15
+ //# sourceMappingURL=run.presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.presentation.d.ts","names":[],"sources":["../../src/run/run.presentation.ts"],"sourcesContent":[],"mappings":";;;;;;AAOA;AA2Ba,cA3BA,mBA2BuB,EA3BF,gBA+CjC;;;;cApBY,uBAAuB"}