@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.
Files changed (228) hide show
  1. package/.turbo/turbo-build.log +225 -222
  2. package/CHANGELOG.md +30 -0
  3. package/dist/agent/agent.entity.js +1 -127
  4. package/dist/agent/agent.enum.js +1 -25
  5. package/dist/agent/agent.event.js +1 -116
  6. package/dist/agent/agent.handler.js +1 -1030
  7. package/dist/agent/agent.operation.js +1 -735
  8. package/dist/agent/agent.presentation.js +1 -282
  9. package/dist/agent/agent.schema.js +1 -215
  10. package/dist/agent/agent.test-spec.js +1 -58
  11. package/dist/agent/index.js +1 -1248
  12. package/dist/agent.capability.js +1 -19
  13. package/dist/agent.feature.js +1 -305
  14. package/dist/browser/agent/agent.entity.js +1 -127
  15. package/dist/browser/agent/agent.enum.js +1 -25
  16. package/dist/browser/agent/agent.event.js +1 -116
  17. package/dist/browser/agent/agent.handler.js +1 -1030
  18. package/dist/browser/agent/agent.operation.js +1 -735
  19. package/dist/browser/agent/agent.presentation.js +1 -282
  20. package/dist/browser/agent/agent.schema.js +1 -215
  21. package/dist/browser/agent/agent.test-spec.js +1 -58
  22. package/dist/browser/agent/index.js +1 -1248
  23. package/dist/browser/agent.capability.js +1 -19
  24. package/dist/browser/agent.feature.js +1 -305
  25. package/dist/browser/docs/agent-console.docblock.js +5 -49
  26. package/dist/browser/docs/index.js +5 -49
  27. package/dist/browser/example.js +1 -41
  28. package/dist/browser/handlers/agent.handlers.js +6 -2143
  29. package/dist/browser/handlers/index.js +6 -2943
  30. package/dist/browser/index.js +14 -6828
  31. package/dist/browser/presentations/index.js +1 -693
  32. package/dist/browser/run/index.js +1 -1363
  33. package/dist/browser/run/run.entity.js +1 -160
  34. package/dist/browser/run/run.enum.js +1 -34
  35. package/dist/browser/run/run.event.js +1 -217
  36. package/dist/browser/run/run.handler.js +1 -919
  37. package/dist/browser/run/run.operation.js +1 -667
  38. package/dist/browser/run/run.presentation.js +1 -223
  39. package/dist/browser/run/run.schema.js +1 -179
  40. package/dist/browser/run/run.test-spec.js +1 -58
  41. package/dist/browser/seeders/index.js +2 -21
  42. package/dist/browser/shared/index.js +1 -626
  43. package/dist/browser/shared/mock-agents.js +1 -82
  44. package/dist/browser/shared/mock-runs.js +1 -113
  45. package/dist/browser/shared/mock-tools.js +1 -146
  46. package/dist/browser/tool/index.js +1 -949
  47. package/dist/browser/tool/tool.entity.js +1 -90
  48. package/dist/browser/tool/tool.enum.js +1 -26
  49. package/dist/browser/tool/tool.event.js +1 -99
  50. package/dist/browser/tool/tool.handler.js +1 -699
  51. package/dist/browser/tool/tool.operation.js +1 -482
  52. package/dist/browser/tool/tool.presentation.js +1 -188
  53. package/dist/browser/tool/tool.schema.js +1 -141
  54. package/dist/browser/tool/tool.test-spec.js +1 -58
  55. package/dist/browser/ui/AgentDashboard.js +1 -2527
  56. package/dist/browser/ui/AgentDashboard.visualizations.js +1 -217
  57. package/dist/browser/ui/AgentRunList.js +1 -482
  58. package/dist/browser/ui/AgentToolRegistry.js +1 -212
  59. package/dist/browser/ui/ExecutionConsoleHost.js +1 -0
  60. package/dist/browser/ui/hooks/index.js +1 -740
  61. package/dist/browser/ui/hooks/useAgentList.js +1 -55
  62. package/dist/browser/ui/hooks/useAgentMutations.js +1 -530
  63. package/dist/browser/ui/hooks/useRunList.js +1 -70
  64. package/dist/browser/ui/hooks/useToolList.js +1 -85
  65. package/dist/browser/ui/index.js +5 -3018
  66. package/dist/browser/ui/modals/AgentActionsModal.js +1 -304
  67. package/dist/browser/ui/modals/CreateAgentModal.js +1 -243
  68. package/dist/browser/ui/modals/index.js +1 -546
  69. package/dist/browser/ui/overlays/demo-overlays.js +1 -64
  70. package/dist/browser/ui/overlays/index.js +1 -64
  71. package/dist/browser/ui/renderers/agent-list.markdown.js +2 -64
  72. package/dist/browser/ui/renderers/agent-list.renderer.js +1 -180
  73. package/dist/browser/ui/renderers/dashboard.markdown.js +2 -288
  74. package/dist/browser/ui/renderers/index.js +5 -642
  75. package/dist/browser/ui/renderers/run-list.markdown.js +2 -50
  76. package/dist/browser/ui/renderers/tool-registry.markdown.js +2 -64
  77. package/dist/browser/ui/views/AgentListView.js +1 -165
  78. package/dist/browser/ui/views/RunDataTable.js +1 -326
  79. package/dist/browser/ui/views/RunListView.js +1 -479
  80. package/dist/browser/ui/views/ToolRegistryView.js +1 -209
  81. package/dist/browser/ui/views/index.js +1 -851
  82. package/dist/browser/ui/views/run-data-table.columns.js +1 -271
  83. package/dist/browser/ui/views/run-list.shared.js +1 -177
  84. package/dist/browser/visualizations/catalog.js +1 -134
  85. package/dist/browser/visualizations/index.js +1 -187
  86. package/dist/browser/visualizations/selectors.js +1 -181
  87. package/dist/docs/agent-console.docblock.js +5 -49
  88. package/dist/docs/index.js +5 -49
  89. package/dist/example.js +1 -41
  90. package/dist/handlers/agent.handlers.js +6 -2143
  91. package/dist/handlers/index.js +6 -2943
  92. package/dist/index.js +14 -6828
  93. package/dist/node/agent/agent.entity.js +1 -127
  94. package/dist/node/agent/agent.enum.js +1 -25
  95. package/dist/node/agent/agent.event.js +1 -116
  96. package/dist/node/agent/agent.handler.js +1 -1030
  97. package/dist/node/agent/agent.operation.js +1 -735
  98. package/dist/node/agent/agent.presentation.js +1 -282
  99. package/dist/node/agent/agent.schema.js +1 -215
  100. package/dist/node/agent/agent.test-spec.js +1 -58
  101. package/dist/node/agent/index.js +1 -1248
  102. package/dist/node/agent.capability.js +1 -19
  103. package/dist/node/agent.feature.js +1 -305
  104. package/dist/node/docs/agent-console.docblock.js +5 -49
  105. package/dist/node/docs/index.js +5 -49
  106. package/dist/node/example.js +1 -41
  107. package/dist/node/handlers/agent.handlers.js +6 -2143
  108. package/dist/node/handlers/index.js +6 -2943
  109. package/dist/node/index.js +14 -6828
  110. package/dist/node/presentations/index.js +1 -693
  111. package/dist/node/run/index.js +1 -1363
  112. package/dist/node/run/run.entity.js +1 -160
  113. package/dist/node/run/run.enum.js +1 -34
  114. package/dist/node/run/run.event.js +1 -217
  115. package/dist/node/run/run.handler.js +1 -919
  116. package/dist/node/run/run.operation.js +1 -667
  117. package/dist/node/run/run.presentation.js +1 -223
  118. package/dist/node/run/run.schema.js +1 -179
  119. package/dist/node/run/run.test-spec.js +1 -58
  120. package/dist/node/seeders/index.js +2 -21
  121. package/dist/node/shared/index.js +1 -626
  122. package/dist/node/shared/mock-agents.js +1 -82
  123. package/dist/node/shared/mock-runs.js +1 -113
  124. package/dist/node/shared/mock-tools.js +1 -146
  125. package/dist/node/tool/index.js +1 -949
  126. package/dist/node/tool/tool.entity.js +1 -90
  127. package/dist/node/tool/tool.enum.js +1 -26
  128. package/dist/node/tool/tool.event.js +1 -99
  129. package/dist/node/tool/tool.handler.js +1 -699
  130. package/dist/node/tool/tool.operation.js +1 -482
  131. package/dist/node/tool/tool.presentation.js +1 -188
  132. package/dist/node/tool/tool.schema.js +1 -141
  133. package/dist/node/tool/tool.test-spec.js +1 -58
  134. package/dist/node/ui/AgentDashboard.js +1 -2527
  135. package/dist/node/ui/AgentDashboard.visualizations.js +1 -217
  136. package/dist/node/ui/AgentRunList.js +1 -482
  137. package/dist/node/ui/AgentToolRegistry.js +1 -212
  138. package/dist/node/ui/ExecutionConsoleHost.js +1 -0
  139. package/dist/node/ui/hooks/index.js +1 -740
  140. package/dist/node/ui/hooks/useAgentList.js +1 -55
  141. package/dist/node/ui/hooks/useAgentMutations.js +1 -530
  142. package/dist/node/ui/hooks/useRunList.js +1 -70
  143. package/dist/node/ui/hooks/useToolList.js +1 -85
  144. package/dist/node/ui/index.js +5 -3018
  145. package/dist/node/ui/modals/AgentActionsModal.js +1 -304
  146. package/dist/node/ui/modals/CreateAgentModal.js +1 -243
  147. package/dist/node/ui/modals/index.js +1 -546
  148. package/dist/node/ui/overlays/demo-overlays.js +1 -64
  149. package/dist/node/ui/overlays/index.js +1 -64
  150. package/dist/node/ui/renderers/agent-list.markdown.js +2 -64
  151. package/dist/node/ui/renderers/agent-list.renderer.js +1 -180
  152. package/dist/node/ui/renderers/dashboard.markdown.js +2 -288
  153. package/dist/node/ui/renderers/index.js +5 -642
  154. package/dist/node/ui/renderers/run-list.markdown.js +2 -50
  155. package/dist/node/ui/renderers/tool-registry.markdown.js +2 -64
  156. package/dist/node/ui/views/AgentListView.js +1 -165
  157. package/dist/node/ui/views/RunDataTable.js +1 -326
  158. package/dist/node/ui/views/RunListView.js +1 -479
  159. package/dist/node/ui/views/ToolRegistryView.js +1 -209
  160. package/dist/node/ui/views/index.js +1 -851
  161. package/dist/node/ui/views/run-data-table.columns.js +1 -271
  162. package/dist/node/ui/views/run-list.shared.js +1 -177
  163. package/dist/node/visualizations/catalog.js +1 -134
  164. package/dist/node/visualizations/index.js +1 -187
  165. package/dist/node/visualizations/selectors.js +1 -181
  166. package/dist/presentations/index.js +1 -693
  167. package/dist/run/index.js +1 -1363
  168. package/dist/run/run.entity.js +1 -160
  169. package/dist/run/run.enum.js +1 -34
  170. package/dist/run/run.event.js +1 -217
  171. package/dist/run/run.handler.js +1 -919
  172. package/dist/run/run.operation.js +1 -667
  173. package/dist/run/run.presentation.js +1 -223
  174. package/dist/run/run.schema.js +1 -179
  175. package/dist/run/run.test-spec.js +1 -58
  176. package/dist/seeders/index.js +2 -21
  177. package/dist/shared/index.js +1 -626
  178. package/dist/shared/mock-agents.js +1 -82
  179. package/dist/shared/mock-runs.js +1 -113
  180. package/dist/shared/mock-tools.js +1 -146
  181. package/dist/tool/index.js +1 -949
  182. package/dist/tool/tool.entity.js +1 -90
  183. package/dist/tool/tool.enum.js +1 -26
  184. package/dist/tool/tool.event.js +1 -99
  185. package/dist/tool/tool.handler.js +1 -699
  186. package/dist/tool/tool.operation.js +1 -482
  187. package/dist/tool/tool.presentation.js +1 -188
  188. package/dist/tool/tool.schema.js +1 -141
  189. package/dist/tool/tool.test-spec.js +1 -58
  190. package/dist/ui/AgentDashboard.js +1 -2527
  191. package/dist/ui/AgentDashboard.visualizations.js +1 -217
  192. package/dist/ui/AgentRunList.js +1 -482
  193. package/dist/ui/AgentToolRegistry.js +1 -212
  194. package/dist/ui/ExecutionConsoleHost.d.ts +1 -0
  195. package/dist/ui/ExecutionConsoleHost.js +2 -0
  196. package/dist/ui/ExecutionConsoleHost.test.d.ts +1 -0
  197. package/dist/ui/hooks/index.js +1 -740
  198. package/dist/ui/hooks/useAgentList.js +1 -55
  199. package/dist/ui/hooks/useAgentMutations.js +1 -530
  200. package/dist/ui/hooks/useRunList.js +1 -70
  201. package/dist/ui/hooks/useToolList.js +1 -85
  202. package/dist/ui/index.d.ts +1 -0
  203. package/dist/ui/index.js +5 -3018
  204. package/dist/ui/modals/AgentActionsModal.js +1 -304
  205. package/dist/ui/modals/CreateAgentModal.js +1 -243
  206. package/dist/ui/modals/index.js +1 -546
  207. package/dist/ui/overlays/demo-overlays.js +1 -64
  208. package/dist/ui/overlays/index.js +1 -64
  209. package/dist/ui/renderers/agent-list.markdown.js +2 -64
  210. package/dist/ui/renderers/agent-list.renderer.js +1 -180
  211. package/dist/ui/renderers/dashboard.markdown.js +2 -288
  212. package/dist/ui/renderers/index.js +5 -642
  213. package/dist/ui/renderers/run-list.markdown.js +2 -50
  214. package/dist/ui/renderers/tool-registry.markdown.js +2 -64
  215. package/dist/ui/views/AgentListView.js +1 -165
  216. package/dist/ui/views/RunDataTable.js +1 -326
  217. package/dist/ui/views/RunListView.js +1 -479
  218. package/dist/ui/views/ToolRegistryView.js +1 -209
  219. package/dist/ui/views/index.js +1 -851
  220. package/dist/ui/views/run-data-table.columns.js +1 -271
  221. package/dist/ui/views/run-list.shared.js +1 -177
  222. package/dist/visualizations/catalog.js +1 -134
  223. package/dist/visualizations/index.js +1 -187
  224. package/dist/visualizations/selectors.js +1 -181
  225. package/package.json +26 -10
  226. package/src/ui/ExecutionConsoleHost.test.tsx +110 -0
  227. package/src/ui/ExecutionConsoleHost.tsx +14 -0
  228. package/src/ui/index.ts +1 -1
@@ -1,694 +1,2 @@
1
1
  // @bun
2
- // src/agent/agent.enum.ts
3
- import { defineEnum } from "@contractspec/lib.schema";
4
- var AgentStatusEnum = defineEnum("AgentStatus", [
5
- "DRAFT",
6
- "ACTIVE",
7
- "PAUSED",
8
- "ARCHIVED"
9
- ]);
10
- var ModelProviderEnum = defineEnum("ModelProvider", [
11
- "OPENAI",
12
- "ANTHROPIC",
13
- "GOOGLE",
14
- "MISTRAL",
15
- "CUSTOM"
16
- ]);
17
- var ToolChoiceEnum = defineEnum("ToolChoice", [
18
- "auto",
19
- "required",
20
- "none"
21
- ]);
22
-
23
- // src/agent/agent.schema.ts
24
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
25
- var AgentModel = defineSchemaModel({
26
- name: "Agent",
27
- description: "AI agent configuration",
28
- fields: {
29
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
- organizationId: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: false
33
- },
34
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
35
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
37
- status: { type: AgentStatusEnum, isOptional: false },
38
- modelProvider: { type: ModelProviderEnum, isOptional: false },
39
- modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
40
- modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
41
- systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
42
- userPromptTemplate: {
43
- type: ScalarTypeEnum.String_unsecure(),
44
- isOptional: true
45
- },
46
- toolIds: {
47
- type: ScalarTypeEnum.String_unsecure(),
48
- isArray: true,
49
- isOptional: true
50
- },
51
- toolChoice: {
52
- type: ToolChoiceEnum,
53
- isOptional: false,
54
- defaultValue: "auto"
55
- },
56
- maxIterations: {
57
- type: ScalarTypeEnum.Int_unsecure(),
58
- isOptional: false,
59
- defaultValue: 10
60
- },
61
- maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
62
- timeoutMs: {
63
- type: ScalarTypeEnum.Int_unsecure(),
64
- isOptional: false,
65
- defaultValue: 120000
66
- },
67
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
68
- tags: {
69
- type: ScalarTypeEnum.String_unsecure(),
70
- isArray: true,
71
- isOptional: true
72
- },
73
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
74
- updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
75
- }
76
- });
77
- var AgentSummaryModel = defineSchemaModel({
78
- name: "AgentSummary",
79
- description: "Summary of an agent for list views",
80
- fields: {
81
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
82
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
83
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
84
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
85
- status: { type: AgentStatusEnum, isOptional: false },
86
- modelProvider: { type: ModelProviderEnum, isOptional: false },
87
- modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
88
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
89
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
90
- }
91
- });
92
- var AgentToolRefModel = defineSchemaModel({
93
- name: "AgentToolRef",
94
- description: "Tool reference in agent context",
95
- fields: {
96
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
97
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
98
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
99
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
100
- category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
101
- }
102
- });
103
- var AgentWithToolsModel = defineSchemaModel({
104
- name: "AgentWithTools",
105
- description: "Agent with associated tools",
106
- fields: {
107
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
108
- organizationId: {
109
- type: ScalarTypeEnum.String_unsecure(),
110
- isOptional: false
111
- },
112
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
113
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
114
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
115
- status: { type: AgentStatusEnum, isOptional: false },
116
- modelProvider: { type: ModelProviderEnum, isOptional: false },
117
- modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
118
- modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
119
- systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
120
- userPromptTemplate: {
121
- type: ScalarTypeEnum.String_unsecure(),
122
- isOptional: true
123
- },
124
- toolIds: {
125
- type: ScalarTypeEnum.String_unsecure(),
126
- isArray: true,
127
- isOptional: true
128
- },
129
- toolChoice: { type: ToolChoiceEnum, isOptional: false },
130
- maxIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
131
- maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
132
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
133
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
134
- tags: {
135
- type: ScalarTypeEnum.String_unsecure(),
136
- isArray: true,
137
- isOptional: true
138
- },
139
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
140
- updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
141
- tools: { type: AgentToolRefModel, isArray: true, isOptional: true }
142
- }
143
- });
144
- var CreateAgentInputModel = defineSchemaModel({
145
- name: "CreateAgentInput",
146
- description: "Input for creating an agent",
147
- fields: {
148
- organizationId: {
149
- type: ScalarTypeEnum.String_unsecure(),
150
- isOptional: false
151
- },
152
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
153
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
154
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
155
- modelProvider: { type: ModelProviderEnum, isOptional: false },
156
- modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
157
- modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
158
- systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
159
- userPromptTemplate: {
160
- type: ScalarTypeEnum.String_unsecure(),
161
- isOptional: true
162
- },
163
- toolIds: {
164
- type: ScalarTypeEnum.String_unsecure(),
165
- isArray: true,
166
- isOptional: true
167
- },
168
- toolChoice: { type: ToolChoiceEnum, isOptional: true },
169
- maxIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
170
- maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
171
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
172
- tags: {
173
- type: ScalarTypeEnum.String_unsecure(),
174
- isArray: true,
175
- isOptional: true
176
- }
177
- }
178
- });
179
- var UpdateAgentInputModel = defineSchemaModel({
180
- name: "UpdateAgentInput",
181
- description: "Input for updating an agent",
182
- fields: {
183
- agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
184
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: true },
185
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
186
- status: { type: AgentStatusEnum, isOptional: true },
187
- modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
188
- systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
189
- userPromptTemplate: {
190
- type: ScalarTypeEnum.String_unsecure(),
191
- isOptional: true
192
- },
193
- toolIds: {
194
- type: ScalarTypeEnum.String_unsecure(),
195
- isArray: true,
196
- isOptional: true
197
- },
198
- toolChoice: { type: ToolChoiceEnum, isOptional: true },
199
- maxIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
200
- maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
201
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
202
- tags: {
203
- type: ScalarTypeEnum.String_unsecure(),
204
- isArray: true,
205
- isOptional: true
206
- }
207
- }
208
- });
209
-
210
- // src/agent/agent.presentation.ts
211
- import {
212
- definePresentation,
213
- StabilityEnum
214
- } from "@contractspec/lib.contracts-spec";
215
- var AgentListPresentation = definePresentation({
216
- meta: {
217
- key: "agent-console.agent.viewList",
218
- version: "1.0.0",
219
- title: "Agent List",
220
- description: "List view of AI agents with status, model provider, and version info",
221
- goal: "Provide an overview of all agents in an organization.",
222
- context: "Main landing page for agent management.",
223
- domain: "agent-console",
224
- owners: ["@agent-console-team"],
225
- tags: ["agent", "list", "dashboard"],
226
- stability: StabilityEnum.Experimental
227
- },
228
- source: {
229
- type: "component",
230
- framework: "react",
231
- componentKey: "AgentListView",
232
- props: AgentSummaryModel
233
- },
234
- targets: ["react", "markdown", "application/json"],
235
- policy: { flags: ["agent-console.enabled"] }
236
- });
237
- var AgentDetailPresentation = definePresentation({
238
- meta: {
239
- key: "agent-console.agent.detail",
240
- version: "1.0.0",
241
- title: "Agent Details",
242
- description: "Detailed view of an AI agent with configuration, tools, and recent runs",
243
- goal: "Allow users to inspect and configure a specific agent.",
244
- context: "Detailed view of an agent.",
245
- domain: "agent-console",
246
- owners: ["@agent-console-team"],
247
- tags: ["agent", "detail"],
248
- stability: StabilityEnum.Experimental
249
- },
250
- source: {
251
- type: "component",
252
- framework: "react",
253
- componentKey: "AgentDetailView"
254
- },
255
- targets: ["react", "markdown"],
256
- policy: { flags: ["agent-console.enabled"] }
257
- });
258
- var AgentConsoleDashboardPresentation = definePresentation({
259
- meta: {
260
- key: "agent-console.dashboard",
261
- version: "1.0.0",
262
- title: "Agent Console Dashboard",
263
- description: "Dashboard overview of AI agents, runs, and tools",
264
- goal: "Provide a high-level overview of the AI platform health and usage.",
265
- context: "Root dashboard of the Agent Console.",
266
- domain: "agent-console",
267
- owners: ["@agent-console-team"],
268
- tags: ["dashboard", "overview"],
269
- stability: StabilityEnum.Experimental
270
- },
271
- source: {
272
- type: "component",
273
- framework: "react",
274
- componentKey: "AgentConsoleDashboard"
275
- },
276
- targets: ["react", "markdown"],
277
- policy: { flags: ["agent-console.enabled"] }
278
- });
279
-
280
- // src/run/run.enum.ts
281
- import { defineEnum as defineEnum2 } from "@contractspec/lib.schema";
282
- var RunStatusEnum = defineEnum2("RunStatus", [
283
- "QUEUED",
284
- "IN_PROGRESS",
285
- "COMPLETED",
286
- "FAILED",
287
- "CANCELLED",
288
- "EXPIRED"
289
- ]);
290
- var RunStepTypeEnum = defineEnum2("RunStepType", [
291
- "MESSAGE_CREATION",
292
- "TOOL_CALL",
293
- "TOOL_RESULT",
294
- "ERROR"
295
- ]);
296
- var LogLevelEnum = defineEnum2("LogLevel", [
297
- "DEBUG",
298
- "INFO",
299
- "WARN",
300
- "ERROR"
301
- ]);
302
- var GranularityEnum = defineEnum2("Granularity", [
303
- "hour",
304
- "day",
305
- "week",
306
- "month"
307
- ]);
308
-
309
- // src/run/run.schema.ts
310
- import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
311
- var RunInputModel = defineSchemaModel2({
312
- name: "RunInput",
313
- description: "Input data for agent execution",
314
- fields: {
315
- message: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
316
- context: { type: ScalarTypeEnum2.JSONObject(), isOptional: true }
317
- }
318
- });
319
- var RunStepModel = defineSchemaModel2({
320
- name: "RunStep",
321
- description: "Individual step within a run",
322
- fields: {
323
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
324
- stepNumber: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
325
- type: { type: RunStepTypeEnum, isOptional: false },
326
- toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
327
- toolName: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
328
- input: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
329
- output: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
330
- status: { type: RunStatusEnum, isOptional: false },
331
- errorMessage: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
332
- tokensUsed: {
333
- type: ScalarTypeEnum2.Int_unsecure(),
334
- isOptional: false,
335
- defaultValue: 0
336
- },
337
- durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
338
- startedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
339
- completedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: true }
340
- }
341
- });
342
- var RunLogModel = defineSchemaModel2({
343
- name: "RunLog",
344
- description: "Execution log entry",
345
- fields: {
346
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
347
- stepId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
348
- level: { type: LogLevelEnum, isOptional: false },
349
- message: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
350
- data: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
351
- source: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
352
- traceId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
353
- spanId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
354
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
355
- }
356
- });
357
- var RunAgentRefModel = defineSchemaModel2({
358
- name: "RunAgentRef",
359
- description: "Agent reference in a run",
360
- fields: {
361
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
362
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
363
- modelProvider: {
364
- type: ScalarTypeEnum2.String_unsecure(),
365
- isOptional: false
366
- },
367
- modelName: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
368
- }
369
- });
370
- var RunModel = defineSchemaModel2({
371
- name: "Run",
372
- description: "Agent execution instance",
373
- fields: {
374
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
375
- organizationId: {
376
- type: ScalarTypeEnum2.String_unsecure(),
377
- isOptional: false
378
- },
379
- agentId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
380
- userId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
381
- sessionId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
382
- input: { type: ScalarTypeEnum2.JSONObject(), isOptional: false },
383
- output: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
384
- status: { type: RunStatusEnum, isOptional: false },
385
- errorMessage: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
386
- errorCode: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
387
- totalTokens: {
388
- type: ScalarTypeEnum2.Int_unsecure(),
389
- isOptional: false,
390
- defaultValue: 0
391
- },
392
- promptTokens: {
393
- type: ScalarTypeEnum2.Int_unsecure(),
394
- isOptional: false,
395
- defaultValue: 0
396
- },
397
- completionTokens: {
398
- type: ScalarTypeEnum2.Int_unsecure(),
399
- isOptional: false,
400
- defaultValue: 0
401
- },
402
- totalIterations: {
403
- type: ScalarTypeEnum2.Int_unsecure(),
404
- isOptional: false,
405
- defaultValue: 0
406
- },
407
- durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
408
- estimatedCostUsd: {
409
- type: ScalarTypeEnum2.Float_unsecure(),
410
- isOptional: true
411
- },
412
- queuedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
413
- startedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: true },
414
- completedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: true },
415
- metadata: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
416
- steps: { type: RunStepModel, isArray: true, isOptional: true },
417
- logs: { type: RunLogModel, isArray: true, isOptional: true },
418
- agent: { type: RunAgentRefModel, isOptional: true }
419
- }
420
- });
421
- var RunSummaryModel = defineSchemaModel2({
422
- name: "RunSummary",
423
- description: "Summary of a run for list views",
424
- fields: {
425
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
426
- agentId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
427
- agentName: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
428
- status: { type: RunStatusEnum, isOptional: false },
429
- totalTokens: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
430
- durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
431
- estimatedCostUsd: {
432
- type: ScalarTypeEnum2.Float_unsecure(),
433
- isOptional: true
434
- },
435
- queuedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
436
- completedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: true }
437
- }
438
- });
439
- var TimelineDataPointModel = defineSchemaModel2({
440
- name: "TimelineDataPoint",
441
- description: "Timeline data point for metrics",
442
- fields: {
443
- period: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
444
- runs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
445
- tokens: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
446
- costUsd: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
447
- avgDurationMs: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false }
448
- }
449
- });
450
-
451
- // src/tool/tool.enum.ts
452
- import { defineEnum as defineEnum3 } from "@contractspec/lib.schema";
453
- var ToolCategoryEnum = defineEnum3("ToolCategory", [
454
- "RETRIEVAL",
455
- "COMPUTATION",
456
- "COMMUNICATION",
457
- "INTEGRATION",
458
- "UTILITY",
459
- "CUSTOM"
460
- ]);
461
- var ToolStatusEnum = defineEnum3("ToolStatus", [
462
- "DRAFT",
463
- "ACTIVE",
464
- "DEPRECATED",
465
- "DISABLED"
466
- ]);
467
- var ImplementationTypeEnum = defineEnum3("ImplementationType", [
468
- "http",
469
- "function",
470
- "workflow"
471
- ]);
472
-
473
- // src/tool/tool.schema.ts
474
- import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
475
- var ToolModel = defineSchemaModel3({
476
- name: "Tool",
477
- description: "AI tool definition",
478
- fields: {
479
- id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
480
- organizationId: {
481
- type: ScalarTypeEnum3.String_unsecure(),
482
- isOptional: false
483
- },
484
- name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
485
- slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
486
- description: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
487
- category: { type: ToolCategoryEnum, isOptional: false },
488
- status: { type: ToolStatusEnum, isOptional: false },
489
- parametersSchema: { type: ScalarTypeEnum3.JSONObject(), isOptional: false },
490
- outputSchema: { type: ScalarTypeEnum3.JSONObject(), isOptional: true },
491
- implementationType: { type: ImplementationTypeEnum, isOptional: false },
492
- implementationConfig: {
493
- type: ScalarTypeEnum3.JSONObject(),
494
- isOptional: false
495
- },
496
- maxInvocationsPerMinute: {
497
- type: ScalarTypeEnum3.Int_unsecure(),
498
- isOptional: true
499
- },
500
- timeoutMs: {
501
- type: ScalarTypeEnum3.Int_unsecure(),
502
- isOptional: false,
503
- defaultValue: 30000
504
- },
505
- version: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
506
- tags: {
507
- type: ScalarTypeEnum3.String_unsecure(),
508
- isArray: true,
509
- isOptional: true
510
- },
511
- createdAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false },
512
- updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
513
- }
514
- });
515
- var ToolSummaryModel = defineSchemaModel3({
516
- name: "ToolSummary",
517
- description: "Summary of a tool for list views",
518
- fields: {
519
- id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
520
- name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
521
- slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
522
- description: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
523
- category: { type: ToolCategoryEnum, isOptional: false },
524
- status: { type: ToolStatusEnum, isOptional: false },
525
- version: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
526
- createdAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
527
- }
528
- });
529
- var CreateToolInputModel = defineSchemaModel3({
530
- name: "CreateToolInput",
531
- description: "Input for creating a tool",
532
- fields: {
533
- organizationId: {
534
- type: ScalarTypeEnum3.String_unsecure(),
535
- isOptional: false
536
- },
537
- name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
538
- slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
539
- description: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
540
- category: { type: ToolCategoryEnum, isOptional: true },
541
- parametersSchema: { type: ScalarTypeEnum3.JSONObject(), isOptional: false },
542
- outputSchema: { type: ScalarTypeEnum3.JSONObject(), isOptional: true },
543
- implementationType: { type: ImplementationTypeEnum, isOptional: false },
544
- implementationConfig: {
545
- type: ScalarTypeEnum3.JSONObject(),
546
- isOptional: false
547
- },
548
- maxInvocationsPerMinute: {
549
- type: ScalarTypeEnum3.Int_unsecure(),
550
- isOptional: true
551
- },
552
- timeoutMs: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: true },
553
- tags: {
554
- type: ScalarTypeEnum3.String_unsecure(),
555
- isArray: true,
556
- isOptional: true
557
- }
558
- }
559
- });
560
- var UpdateToolInputModel = defineSchemaModel3({
561
- name: "UpdateToolInput",
562
- description: "Input for updating a tool",
563
- fields: {
564
- toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
565
- name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: true },
566
- description: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
567
- status: { type: ToolStatusEnum, isOptional: true },
568
- parametersSchema: { type: ScalarTypeEnum3.JSONObject(), isOptional: true },
569
- outputSchema: { type: ScalarTypeEnum3.JSONObject(), isOptional: true },
570
- implementationConfig: {
571
- type: ScalarTypeEnum3.JSONObject(),
572
- isOptional: true
573
- },
574
- maxInvocationsPerMinute: {
575
- type: ScalarTypeEnum3.Int_unsecure(),
576
- isOptional: true
577
- },
578
- timeoutMs: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: true },
579
- tags: {
580
- type: ScalarTypeEnum3.String_unsecure(),
581
- isArray: true,
582
- isOptional: true
583
- }
584
- }
585
- });
586
-
587
- // src/run/run.presentation.ts
588
- import {
589
- definePresentation as definePresentation2,
590
- StabilityEnum as StabilityEnum2
591
- } from "@contractspec/lib.contracts-spec";
592
- var RunListPresentation = definePresentation2({
593
- meta: {
594
- key: "agent-console.run.list",
595
- version: "1.0.0",
596
- title: "Run List",
597
- description: "List view of agent runs with status, tokens, and duration info",
598
- goal: "Provide an overview of agent execution history and performance.",
599
- context: "Run history dashboard.",
600
- domain: "agent-console",
601
- owners: ["@agent-console-team"],
602
- tags: ["run", "list", "dashboard"],
603
- stability: StabilityEnum2.Experimental
604
- },
605
- source: {
606
- type: "component",
607
- framework: "react",
608
- componentKey: "RunListView",
609
- props: RunSummaryModel
610
- },
611
- targets: ["react", "markdown", "application/json"],
612
- policy: { flags: ["agent-console.enabled"] }
613
- });
614
- var RunDetailPresentation = definePresentation2({
615
- meta: {
616
- key: "agent-console.run.detail",
617
- version: "1.0.0",
618
- title: "Run Details",
619
- description: "Detailed view of an agent run with steps, logs, and metrics",
620
- goal: "Allow users to inspect and debug a specific agent run.",
621
- context: "Detailed view of an agent run.",
622
- domain: "agent-console",
623
- owners: ["@agent-console-team"],
624
- tags: ["run", "detail"],
625
- stability: StabilityEnum2.Experimental
626
- },
627
- source: {
628
- type: "component",
629
- framework: "react",
630
- componentKey: "RunDetailView"
631
- },
632
- targets: ["react", "markdown"],
633
- policy: { flags: ["agent-console.enabled"] }
634
- });
635
-
636
- // src/tool/tool.presentation.ts
637
- import {
638
- definePresentation as definePresentation3,
639
- StabilityEnum as StabilityEnum3
640
- } from "@contractspec/lib.contracts-spec";
641
- var ToolListPresentation = definePresentation3({
642
- meta: {
643
- key: "agent-console.tool.list",
644
- version: "1.0.0",
645
- title: "Tool List",
646
- description: "List view of AI tools with category, status, and version info",
647
- goal: "Provide an overview of all available tools for agents.",
648
- context: "Tool management dashboard.",
649
- domain: "agent-console",
650
- owners: ["@agent-console-team"],
651
- tags: ["tool", "list", "dashboard"],
652
- stability: StabilityEnum3.Experimental
653
- },
654
- source: {
655
- type: "component",
656
- framework: "react",
657
- componentKey: "ToolListView",
658
- props: ToolSummaryModel
659
- },
660
- targets: ["react", "markdown", "application/json"],
661
- policy: { flags: ["agent-console.enabled"] }
662
- });
663
- var ToolDetailPresentation = definePresentation3({
664
- meta: {
665
- key: "agent-console.tool.detail",
666
- version: "1.0.0",
667
- title: "Tool Details",
668
- description: "Detailed view of an AI tool with configuration and test panel",
669
- goal: "Allow users to inspect and test a specific tool.",
670
- context: "Detailed view of a tool.",
671
- domain: "agent-console",
672
- owners: ["@agent-console-team"],
673
- tags: ["tool", "detail"],
674
- stability: StabilityEnum3.Experimental
675
- },
676
- source: {
677
- type: "component",
678
- framework: "react",
679
- componentKey: "ToolDetailView"
680
- },
681
- targets: ["react", "markdown"],
682
- policy: { flags: ["agent-console.enabled"] }
683
- });
684
- export {
685
- ToolListPresentation as ToolRegistryPresentation,
686
- ToolListPresentation,
687
- ToolDetailPresentation,
688
- RunDetailPresentation as RunMetricsPresentation,
689
- RunListPresentation,
690
- RunDetailPresentation,
691
- AgentListPresentation,
692
- AgentDetailPresentation,
693
- AgentConsoleDashboardPresentation
694
- };
2
+ import{defineEnum as U}from"@contractspec/lib.schema";var D=U("AgentStatus",["DRAFT","ACTIVE","PAUSED","ARCHIVED"]),F=U("ModelProvider",["OPENAI","ANTHROPIC","GOOGLE","MISTRAL","CUSTOM"]),H=U("ToolChoice",["auto","required","none"]);import{defineSchemaModel as B,ScalarTypeEnum as j}from"@contractspec/lib.schema";var y=B({name:"Agent",description:"AI agent configuration",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},status:{type:D,isOptional:!1},modelProvider:{type:F,isOptional:!1},modelName:{type:j.NonEmptyString(),isOptional:!1},modelConfig:{type:j.JSONObject(),isOptional:!0},systemPrompt:{type:j.String_unsecure(),isOptional:!1},userPromptTemplate:{type:j.String_unsecure(),isOptional:!0},toolIds:{type:j.String_unsecure(),isArray:!0,isOptional:!0},toolChoice:{type:H,isOptional:!1,defaultValue:"auto"},maxIterations:{type:j.Int_unsecure(),isOptional:!1,defaultValue:10},maxTokensPerRun:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!1,defaultValue:120000},version:{type:j.NonEmptyString(),isOptional:!1},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1},updatedAt:{type:j.DateTime(),isOptional:!1}}}),Z=B({name:"AgentSummary",description:"Summary of an agent for list views",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},status:{type:D,isOptional:!1},modelProvider:{type:F,isOptional:!1},modelName:{type:j.NonEmptyString(),isOptional:!1},version:{type:j.NonEmptyString(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1}}}),R=B({name:"AgentToolRef",description:"Tool reference in agent context",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:j.String_unsecure(),isOptional:!1}}}),p=B({name:"AgentWithTools",description:"Agent with associated tools",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},status:{type:D,isOptional:!1},modelProvider:{type:F,isOptional:!1},modelName:{type:j.NonEmptyString(),isOptional:!1},modelConfig:{type:j.JSONObject(),isOptional:!0},systemPrompt:{type:j.String_unsecure(),isOptional:!1},userPromptTemplate:{type:j.String_unsecure(),isOptional:!0},toolIds:{type:j.String_unsecure(),isArray:!0,isOptional:!0},toolChoice:{type:H,isOptional:!1},maxIterations:{type:j.Int_unsecure(),isOptional:!1},maxTokensPerRun:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!1},version:{type:j.NonEmptyString(),isOptional:!1},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1},updatedAt:{type:j.DateTime(),isOptional:!1},tools:{type:R,isArray:!0,isOptional:!0}}}),S=B({name:"CreateAgentInput",description:"Input for creating an agent",fields:{organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},modelProvider:{type:F,isOptional:!1},modelName:{type:j.NonEmptyString(),isOptional:!1},modelConfig:{type:j.JSONObject(),isOptional:!0},systemPrompt:{type:j.String_unsecure(),isOptional:!1},userPromptTemplate:{type:j.String_unsecure(),isOptional:!0},toolIds:{type:j.String_unsecure(),isArray:!0,isOptional:!0},toolChoice:{type:H,isOptional:!0},maxIterations:{type:j.Int_unsecure(),isOptional:!0},maxTokensPerRun:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!0},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}}),E=B({name:"UpdateAgentInput",description:"Input for updating an agent",fields:{agentId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!0},description:{type:j.String_unsecure(),isOptional:!0},status:{type:D,isOptional:!0},modelConfig:{type:j.JSONObject(),isOptional:!0},systemPrompt:{type:j.String_unsecure(),isOptional:!0},userPromptTemplate:{type:j.String_unsecure(),isOptional:!0},toolIds:{type:j.String_unsecure(),isArray:!0,isOptional:!0},toolChoice:{type:H,isOptional:!0},maxIterations:{type:j.Int_unsecure(),isOptional:!0},maxTokensPerRun:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!0},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}});import{definePresentation as V,StabilityEnum as W}from"@contractspec/lib.contracts-spec";var P=V({meta:{key:"agent-console.agent.viewList",version:"1.0.0",title:"Agent List",description:"List view of AI agents with status, model provider, and version info",goal:"Provide an overview of all agents in an organization.",context:"Main landing page for agent management.",domain:"agent-console",owners:["@agent-console-team"],tags:["agent","list","dashboard"],stability:W.Experimental},source:{type:"component",framework:"react",componentKey:"AgentListView",props:Z},targets:["react","markdown","application/json"],policy:{flags:["agent-console.enabled"]}}),b=V({meta:{key:"agent-console.agent.detail",version:"1.0.0",title:"Agent Details",description:"Detailed view of an AI agent with configuration, tools, and recent runs",goal:"Allow users to inspect and configure a specific agent.",context:"Detailed view of an agent.",domain:"agent-console",owners:["@agent-console-team"],tags:["agent","detail"],stability:W.Experimental},source:{type:"component",framework:"react",componentKey:"AgentDetailView"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}}),g=V({meta:{key:"agent-console.dashboard",version:"1.0.0",title:"Agent Console Dashboard",description:"Dashboard overview of AI agents, runs, and tools",goal:"Provide a high-level overview of the AI platform health and usage.",context:"Root dashboard of the Agent Console.",domain:"agent-console",owners:["@agent-console-team"],tags:["dashboard","overview"],stability:W.Experimental},source:{type:"component",framework:"react",componentKey:"AgentConsoleDashboard"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}});import{defineEnum as J}from"@contractspec/lib.schema";var K=J("RunStatus",["QUEUED","IN_PROGRESS","COMPLETED","FAILED","CANCELLED","EXPIRED"]),_=J("RunStepType",["MESSAGE_CREATION","TOOL_CALL","TOOL_RESULT","ERROR"]),$=J("LogLevel",["DEBUG","INFO","WARN","ERROR"]),n=J("Granularity",["hour","day","week","month"]);import{defineSchemaModel as z,ScalarTypeEnum as q}from"@contractspec/lib.schema";var qj=z({name:"RunInput",description:"Input data for agent execution",fields:{message:{type:q.NonEmptyString(),isOptional:!1},context:{type:q.JSONObject(),isOptional:!0}}}),M=z({name:"RunStep",description:"Individual step within a run",fields:{id:{type:q.String_unsecure(),isOptional:!1},stepNumber:{type:q.Int_unsecure(),isOptional:!1},type:{type:_,isOptional:!1},toolId:{type:q.String_unsecure(),isOptional:!0},toolName:{type:q.String_unsecure(),isOptional:!0},input:{type:q.JSONObject(),isOptional:!0},output:{type:q.JSONObject(),isOptional:!0},status:{type:K,isOptional:!1},errorMessage:{type:q.String_unsecure(),isOptional:!0},tokensUsed:{type:q.Int_unsecure(),isOptional:!1,defaultValue:0},durationMs:{type:q.Int_unsecure(),isOptional:!0},startedAt:{type:q.DateTime(),isOptional:!1},completedAt:{type:q.DateTime(),isOptional:!0}}}),h=z({name:"RunLog",description:"Execution log entry",fields:{id:{type:q.String_unsecure(),isOptional:!1},stepId:{type:q.String_unsecure(),isOptional:!0},level:{type:$,isOptional:!1},message:{type:q.String_unsecure(),isOptional:!1},data:{type:q.JSONObject(),isOptional:!0},source:{type:q.String_unsecure(),isOptional:!0},traceId:{type:q.String_unsecure(),isOptional:!0},spanId:{type:q.String_unsecure(),isOptional:!0},timestamp:{type:q.DateTime(),isOptional:!1}}}),f=z({name:"RunAgentRef",description:"Agent reference in a run",fields:{id:{type:q.String_unsecure(),isOptional:!1},name:{type:q.NonEmptyString(),isOptional:!1},modelProvider:{type:q.String_unsecure(),isOptional:!1},modelName:{type:q.String_unsecure(),isOptional:!1}}}),xj=z({name:"Run",description:"Agent execution instance",fields:{id:{type:q.String_unsecure(),isOptional:!1},organizationId:{type:q.String_unsecure(),isOptional:!1},agentId:{type:q.String_unsecure(),isOptional:!1},userId:{type:q.String_unsecure(),isOptional:!0},sessionId:{type:q.String_unsecure(),isOptional:!0},input:{type:q.JSONObject(),isOptional:!1},output:{type:q.JSONObject(),isOptional:!0},status:{type:K,isOptional:!1},errorMessage:{type:q.String_unsecure(),isOptional:!0},errorCode:{type:q.String_unsecure(),isOptional:!0},totalTokens:{type:q.Int_unsecure(),isOptional:!1,defaultValue:0},promptTokens:{type:q.Int_unsecure(),isOptional:!1,defaultValue:0},completionTokens:{type:q.Int_unsecure(),isOptional:!1,defaultValue:0},totalIterations:{type:q.Int_unsecure(),isOptional:!1,defaultValue:0},durationMs:{type:q.Int_unsecure(),isOptional:!0},estimatedCostUsd:{type:q.Float_unsecure(),isOptional:!0},queuedAt:{type:q.DateTime(),isOptional:!1},startedAt:{type:q.DateTime(),isOptional:!0},completedAt:{type:q.DateTime(),isOptional:!0},metadata:{type:q.JSONObject(),isOptional:!0},steps:{type:M,isArray:!0,isOptional:!0},logs:{type:h,isArray:!0,isOptional:!0},agent:{type:f,isOptional:!0}}}),k=z({name:"RunSummary",description:"Summary of a run for list views",fields:{id:{type:q.String_unsecure(),isOptional:!1},agentId:{type:q.String_unsecure(),isOptional:!1},agentName:{type:q.NonEmptyString(),isOptional:!1},status:{type:K,isOptional:!1},totalTokens:{type:q.Int_unsecure(),isOptional:!1},durationMs:{type:q.Int_unsecure(),isOptional:!0},estimatedCostUsd:{type:q.Float_unsecure(),isOptional:!0},queuedAt:{type:q.DateTime(),isOptional:!1},completedAt:{type:q.DateTime(),isOptional:!0}}}),zj=z({name:"TimelineDataPoint",description:"Timeline data point for metrics",fields:{period:{type:q.String_unsecure(),isOptional:!1},runs:{type:q.Int_unsecure(),isOptional:!1},tokens:{type:q.Int_unsecure(),isOptional:!1},costUsd:{type:q.Float_unsecure(),isOptional:!1},avgDurationMs:{type:q.Float_unsecure(),isOptional:!1}}});import{defineEnum as X}from"@contractspec/lib.schema";var N=X("ToolCategory",["RETRIEVAL","COMPUTATION","COMMUNICATION","INTEGRATION","UTILITY","CUSTOM"]),O=X("ToolStatus",["DRAFT","ACTIVE","DEPRECATED","DISABLED"]),Y=X("ImplementationType",["http","function","workflow"]);import{defineSchemaModel as Q,ScalarTypeEnum as x}from"@contractspec/lib.schema";var Kj=Q({name:"Tool",description:"AI tool definition",fields:{id:{type:x.String_unsecure(),isOptional:!1},organizationId:{type:x.String_unsecure(),isOptional:!1},name:{type:x.NonEmptyString(),isOptional:!1},slug:{type:x.String_unsecure(),isOptional:!1},description:{type:x.String_unsecure(),isOptional:!1},category:{type:N,isOptional:!1},status:{type:O,isOptional:!1},parametersSchema:{type:x.JSONObject(),isOptional:!1},outputSchema:{type:x.JSONObject(),isOptional:!0},implementationType:{type:Y,isOptional:!1},implementationConfig:{type:x.JSONObject(),isOptional:!1},maxInvocationsPerMinute:{type:x.Int_unsecure(),isOptional:!0},timeoutMs:{type:x.Int_unsecure(),isOptional:!1,defaultValue:30000},version:{type:x.NonEmptyString(),isOptional:!1},tags:{type:x.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:x.DateTime(),isOptional:!1},updatedAt:{type:x.DateTime(),isOptional:!1}}}),w=Q({name:"ToolSummary",description:"Summary of a tool for list views",fields:{id:{type:x.String_unsecure(),isOptional:!1},name:{type:x.NonEmptyString(),isOptional:!1},slug:{type:x.String_unsecure(),isOptional:!1},description:{type:x.String_unsecure(),isOptional:!1},category:{type:N,isOptional:!1},status:{type:O,isOptional:!1},version:{type:x.NonEmptyString(),isOptional:!1},createdAt:{type:x.DateTime(),isOptional:!1}}}),Nj=Q({name:"CreateToolInput",description:"Input for creating a tool",fields:{organizationId:{type:x.String_unsecure(),isOptional:!1},name:{type:x.NonEmptyString(),isOptional:!1},slug:{type:x.String_unsecure(),isOptional:!1},description:{type:x.String_unsecure(),isOptional:!1},category:{type:N,isOptional:!0},parametersSchema:{type:x.JSONObject(),isOptional:!1},outputSchema:{type:x.JSONObject(),isOptional:!0},implementationType:{type:Y,isOptional:!1},implementationConfig:{type:x.JSONObject(),isOptional:!1},maxInvocationsPerMinute:{type:x.Int_unsecure(),isOptional:!0},timeoutMs:{type:x.Int_unsecure(),isOptional:!0},tags:{type:x.String_unsecure(),isArray:!0,isOptional:!0}}}),Oj=Q({name:"UpdateToolInput",description:"Input for updating a tool",fields:{toolId:{type:x.String_unsecure(),isOptional:!1},name:{type:x.NonEmptyString(),isOptional:!0},description:{type:x.String_unsecure(),isOptional:!0},status:{type:O,isOptional:!0},parametersSchema:{type:x.JSONObject(),isOptional:!0},outputSchema:{type:x.JSONObject(),isOptional:!0},implementationConfig:{type:x.JSONObject(),isOptional:!0},maxInvocationsPerMinute:{type:x.Int_unsecure(),isOptional:!0},timeoutMs:{type:x.Int_unsecure(),isOptional:!0},tags:{type:x.String_unsecure(),isArray:!0,isOptional:!0}}});import{definePresentation as G,StabilityEnum as L}from"@contractspec/lib.contracts-spec";var s=G({meta:{key:"agent-console.run.list",version:"1.0.0",title:"Run List",description:"List view of agent runs with status, tokens, and duration info",goal:"Provide an overview of agent execution history and performance.",context:"Run history dashboard.",domain:"agent-console",owners:["@agent-console-team"],tags:["run","list","dashboard"],stability:L.Experimental},source:{type:"component",framework:"react",componentKey:"RunListView",props:k},targets:["react","markdown","application/json"],policy:{flags:["agent-console.enabled"]}}),v=G({meta:{key:"agent-console.run.detail",version:"1.0.0",title:"Run Details",description:"Detailed view of an agent run with steps, logs, and metrics",goal:"Allow users to inspect and debug a specific agent run.",context:"Detailed view of an agent run.",domain:"agent-console",owners:["@agent-console-team"],tags:["run","detail"],stability:L.Experimental},source:{type:"component",framework:"react",componentKey:"RunDetailView"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}});import{definePresentation as I,StabilityEnum as C}from"@contractspec/lib.contracts-spec";var A=I({meta:{key:"agent-console.tool.list",version:"1.0.0",title:"Tool List",description:"List view of AI tools with category, status, and version info",goal:"Provide an overview of all available tools for agents.",context:"Tool management dashboard.",domain:"agent-console",owners:["@agent-console-team"],tags:["tool","list","dashboard"],stability:C.Experimental},source:{type:"component",framework:"react",componentKey:"ToolListView",props:w},targets:["react","markdown","application/json"],policy:{flags:["agent-console.enabled"]}}),d=I({meta:{key:"agent-console.tool.detail",version:"1.0.0",title:"Tool Details",description:"Detailed view of an AI tool with configuration and test panel",goal:"Allow users to inspect and test a specific tool.",context:"Detailed view of a tool.",domain:"agent-console",owners:["@agent-console-team"],tags:["tool","detail"],stability:C.Experimental},source:{type:"component",framework:"react",componentKey:"ToolDetailView"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}});export{A as ToolRegistryPresentation,A as ToolListPresentation,d as ToolDetailPresentation,v as RunMetricsPresentation,s as RunListPresentation,v as RunDetailPresentation,P as AgentListPresentation,b as AgentDetailPresentation,g as AgentConsoleDashboardPresentation};