@contractspec/example.agent-console 3.8.9 → 3.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +225 -222
- package/CHANGELOG.md +18 -0
- package/dist/agent/agent.entity.js +1 -127
- package/dist/agent/agent.enum.js +1 -25
- package/dist/agent/agent.event.js +1 -116
- package/dist/agent/agent.handler.js +1 -1030
- package/dist/agent/agent.operation.js +1 -735
- package/dist/agent/agent.presentation.js +1 -282
- package/dist/agent/agent.schema.js +1 -215
- package/dist/agent/agent.test-spec.js +1 -58
- package/dist/agent/index.js +1 -1248
- package/dist/agent.capability.js +1 -19
- package/dist/agent.feature.js +1 -305
- package/dist/browser/agent/agent.entity.js +1 -127
- package/dist/browser/agent/agent.enum.js +1 -25
- package/dist/browser/agent/agent.event.js +1 -116
- package/dist/browser/agent/agent.handler.js +1 -1030
- package/dist/browser/agent/agent.operation.js +1 -735
- package/dist/browser/agent/agent.presentation.js +1 -282
- package/dist/browser/agent/agent.schema.js +1 -215
- package/dist/browser/agent/agent.test-spec.js +1 -58
- package/dist/browser/agent/index.js +1 -1248
- package/dist/browser/agent.capability.js +1 -19
- package/dist/browser/agent.feature.js +1 -305
- package/dist/browser/docs/agent-console.docblock.js +5 -49
- package/dist/browser/docs/index.js +5 -49
- package/dist/browser/example.js +1 -41
- package/dist/browser/handlers/agent.handlers.js +6 -2143
- package/dist/browser/handlers/index.js +6 -2943
- package/dist/browser/index.js +14 -6828
- package/dist/browser/presentations/index.js +1 -693
- package/dist/browser/run/index.js +1 -1363
- package/dist/browser/run/run.entity.js +1 -160
- package/dist/browser/run/run.enum.js +1 -34
- package/dist/browser/run/run.event.js +1 -217
- package/dist/browser/run/run.handler.js +1 -919
- package/dist/browser/run/run.operation.js +1 -667
- package/dist/browser/run/run.presentation.js +1 -223
- package/dist/browser/run/run.schema.js +1 -179
- package/dist/browser/run/run.test-spec.js +1 -58
- package/dist/browser/seeders/index.js +2 -21
- package/dist/browser/shared/index.js +1 -626
- package/dist/browser/shared/mock-agents.js +1 -82
- package/dist/browser/shared/mock-runs.js +1 -113
- package/dist/browser/shared/mock-tools.js +1 -146
- package/dist/browser/tool/index.js +1 -949
- package/dist/browser/tool/tool.entity.js +1 -90
- package/dist/browser/tool/tool.enum.js +1 -26
- package/dist/browser/tool/tool.event.js +1 -99
- package/dist/browser/tool/tool.handler.js +1 -699
- package/dist/browser/tool/tool.operation.js +1 -482
- package/dist/browser/tool/tool.presentation.js +1 -188
- package/dist/browser/tool/tool.schema.js +1 -141
- package/dist/browser/tool/tool.test-spec.js +1 -58
- package/dist/browser/ui/AgentDashboard.js +1 -2527
- package/dist/browser/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/browser/ui/AgentRunList.js +1 -482
- package/dist/browser/ui/AgentToolRegistry.js +1 -212
- package/dist/browser/ui/ExecutionConsoleHost.js +1 -0
- package/dist/browser/ui/hooks/index.js +1 -740
- package/dist/browser/ui/hooks/useAgentList.js +1 -55
- package/dist/browser/ui/hooks/useAgentMutations.js +1 -530
- package/dist/browser/ui/hooks/useRunList.js +1 -70
- package/dist/browser/ui/hooks/useToolList.js +1 -85
- package/dist/browser/ui/index.js +5 -3018
- package/dist/browser/ui/modals/AgentActionsModal.js +1 -304
- package/dist/browser/ui/modals/CreateAgentModal.js +1 -243
- package/dist/browser/ui/modals/index.js +1 -546
- package/dist/browser/ui/overlays/demo-overlays.js +1 -64
- package/dist/browser/ui/overlays/index.js +1 -64
- package/dist/browser/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/browser/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/browser/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/browser/ui/renderers/index.js +5 -642
- package/dist/browser/ui/renderers/run-list.markdown.js +2 -50
- package/dist/browser/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/browser/ui/views/AgentListView.js +1 -165
- package/dist/browser/ui/views/RunDataTable.js +1 -326
- package/dist/browser/ui/views/RunListView.js +1 -479
- package/dist/browser/ui/views/ToolRegistryView.js +1 -209
- package/dist/browser/ui/views/index.js +1 -851
- package/dist/browser/ui/views/run-data-table.columns.js +1 -271
- package/dist/browser/ui/views/run-list.shared.js +1 -177
- package/dist/browser/visualizations/catalog.js +1 -134
- package/dist/browser/visualizations/index.js +1 -187
- package/dist/browser/visualizations/selectors.js +1 -181
- package/dist/docs/agent-console.docblock.js +5 -49
- package/dist/docs/index.js +5 -49
- package/dist/example.js +1 -41
- package/dist/handlers/agent.handlers.js +6 -2143
- package/dist/handlers/index.js +6 -2943
- package/dist/index.js +14 -6828
- package/dist/node/agent/agent.entity.js +1 -127
- package/dist/node/agent/agent.enum.js +1 -25
- package/dist/node/agent/agent.event.js +1 -116
- package/dist/node/agent/agent.handler.js +1 -1030
- package/dist/node/agent/agent.operation.js +1 -735
- package/dist/node/agent/agent.presentation.js +1 -282
- package/dist/node/agent/agent.schema.js +1 -215
- package/dist/node/agent/agent.test-spec.js +1 -58
- package/dist/node/agent/index.js +1 -1248
- package/dist/node/agent.capability.js +1 -19
- package/dist/node/agent.feature.js +1 -305
- package/dist/node/docs/agent-console.docblock.js +5 -49
- package/dist/node/docs/index.js +5 -49
- package/dist/node/example.js +1 -41
- package/dist/node/handlers/agent.handlers.js +6 -2143
- package/dist/node/handlers/index.js +6 -2943
- package/dist/node/index.js +14 -6828
- package/dist/node/presentations/index.js +1 -693
- package/dist/node/run/index.js +1 -1363
- package/dist/node/run/run.entity.js +1 -160
- package/dist/node/run/run.enum.js +1 -34
- package/dist/node/run/run.event.js +1 -217
- package/dist/node/run/run.handler.js +1 -919
- package/dist/node/run/run.operation.js +1 -667
- package/dist/node/run/run.presentation.js +1 -223
- package/dist/node/run/run.schema.js +1 -179
- package/dist/node/run/run.test-spec.js +1 -58
- package/dist/node/seeders/index.js +2 -21
- package/dist/node/shared/index.js +1 -626
- package/dist/node/shared/mock-agents.js +1 -82
- package/dist/node/shared/mock-runs.js +1 -113
- package/dist/node/shared/mock-tools.js +1 -146
- package/dist/node/tool/index.js +1 -949
- package/dist/node/tool/tool.entity.js +1 -90
- package/dist/node/tool/tool.enum.js +1 -26
- package/dist/node/tool/tool.event.js +1 -99
- package/dist/node/tool/tool.handler.js +1 -699
- package/dist/node/tool/tool.operation.js +1 -482
- package/dist/node/tool/tool.presentation.js +1 -188
- package/dist/node/tool/tool.schema.js +1 -141
- package/dist/node/tool/tool.test-spec.js +1 -58
- package/dist/node/ui/AgentDashboard.js +1 -2527
- package/dist/node/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/node/ui/AgentRunList.js +1 -482
- package/dist/node/ui/AgentToolRegistry.js +1 -212
- package/dist/node/ui/ExecutionConsoleHost.js +1 -0
- package/dist/node/ui/hooks/index.js +1 -740
- package/dist/node/ui/hooks/useAgentList.js +1 -55
- package/dist/node/ui/hooks/useAgentMutations.js +1 -530
- package/dist/node/ui/hooks/useRunList.js +1 -70
- package/dist/node/ui/hooks/useToolList.js +1 -85
- package/dist/node/ui/index.js +5 -3018
- package/dist/node/ui/modals/AgentActionsModal.js +1 -304
- package/dist/node/ui/modals/CreateAgentModal.js +1 -243
- package/dist/node/ui/modals/index.js +1 -546
- package/dist/node/ui/overlays/demo-overlays.js +1 -64
- package/dist/node/ui/overlays/index.js +1 -64
- package/dist/node/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/node/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/node/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/node/ui/renderers/index.js +5 -642
- package/dist/node/ui/renderers/run-list.markdown.js +2 -50
- package/dist/node/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/node/ui/views/AgentListView.js +1 -165
- package/dist/node/ui/views/RunDataTable.js +1 -326
- package/dist/node/ui/views/RunListView.js +1 -479
- package/dist/node/ui/views/ToolRegistryView.js +1 -209
- package/dist/node/ui/views/index.js +1 -851
- package/dist/node/ui/views/run-data-table.columns.js +1 -271
- package/dist/node/ui/views/run-list.shared.js +1 -177
- package/dist/node/visualizations/catalog.js +1 -134
- package/dist/node/visualizations/index.js +1 -187
- package/dist/node/visualizations/selectors.js +1 -181
- package/dist/presentations/index.js +1 -693
- package/dist/run/index.js +1 -1363
- package/dist/run/run.entity.js +1 -160
- package/dist/run/run.enum.js +1 -34
- package/dist/run/run.event.js +1 -217
- package/dist/run/run.handler.js +1 -919
- package/dist/run/run.operation.js +1 -667
- package/dist/run/run.presentation.js +1 -223
- package/dist/run/run.schema.js +1 -179
- package/dist/run/run.test-spec.js +1 -58
- package/dist/seeders/index.js +2 -21
- package/dist/shared/index.js +1 -626
- package/dist/shared/mock-agents.js +1 -82
- package/dist/shared/mock-runs.js +1 -113
- package/dist/shared/mock-tools.js +1 -146
- package/dist/tool/index.js +1 -949
- package/dist/tool/tool.entity.js +1 -90
- package/dist/tool/tool.enum.js +1 -26
- package/dist/tool/tool.event.js +1 -99
- package/dist/tool/tool.handler.js +1 -699
- package/dist/tool/tool.operation.js +1 -482
- package/dist/tool/tool.presentation.js +1 -188
- package/dist/tool/tool.schema.js +1 -141
- package/dist/tool/tool.test-spec.js +1 -58
- package/dist/ui/AgentDashboard.js +1 -2527
- package/dist/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/ui/AgentRunList.js +1 -482
- package/dist/ui/AgentToolRegistry.js +1 -212
- package/dist/ui/ExecutionConsoleHost.d.ts +1 -0
- package/dist/ui/ExecutionConsoleHost.js +2 -0
- package/dist/ui/ExecutionConsoleHost.test.d.ts +1 -0
- package/dist/ui/hooks/index.js +1 -740
- package/dist/ui/hooks/useAgentList.js +1 -55
- package/dist/ui/hooks/useAgentMutations.js +1 -530
- package/dist/ui/hooks/useRunList.js +1 -70
- package/dist/ui/hooks/useToolList.js +1 -85
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +5 -3018
- package/dist/ui/modals/AgentActionsModal.js +1 -304
- package/dist/ui/modals/CreateAgentModal.js +1 -243
- package/dist/ui/modals/index.js +1 -546
- package/dist/ui/overlays/demo-overlays.js +1 -64
- package/dist/ui/overlays/index.js +1 -64
- package/dist/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/ui/renderers/index.js +5 -642
- package/dist/ui/renderers/run-list.markdown.js +2 -50
- package/dist/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/ui/views/AgentListView.js +1 -165
- package/dist/ui/views/RunDataTable.js +1 -326
- package/dist/ui/views/RunListView.js +1 -479
- package/dist/ui/views/ToolRegistryView.js +1 -209
- package/dist/ui/views/index.js +1 -851
- package/dist/ui/views/run-data-table.columns.js +1 -271
- package/dist/ui/views/run-list.shared.js +1 -177
- package/dist/visualizations/catalog.js +1 -134
- package/dist/visualizations/index.js +1 -187
- package/dist/visualizations/selectors.js +1 -181
- package/package.json +26 -10
- package/src/ui/ExecutionConsoleHost.test.tsx +110 -0
- package/src/ui/ExecutionConsoleHost.tsx +14 -0
- package/src/ui/index.ts +1 -1
|
@@ -1,283 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
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
|
-
export {
|
|
280
|
-
AgentListPresentation,
|
|
281
|
-
AgentDetailPresentation,
|
|
282
|
-
AgentConsoleDashboardPresentation
|
|
283
|
-
};
|
|
2
|
+
import{defineEnum as z}from"@contractspec/lib.schema";var q=z("AgentStatus",["DRAFT","ACTIVE","PAUSED","ARCHIVED"]),w=z("ModelProvider",["OPENAI","ANTHROPIC","GOOGLE","MISTRAL","CUSTOM"]),x=z("ToolChoice",["auto","required","none"]);import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var N=k({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:q,isOptional:!1},modelProvider:{type:w,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:x,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}}}),F=k({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:q,isOptional:!1},modelProvider:{type:w,isOptional:!1},modelName:{type:j.NonEmptyString(),isOptional:!1},version:{type:j.NonEmptyString(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1}}}),G=k({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}}}),O=k({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:q,isOptional:!1},modelProvider:{type:w,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:x,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:G,isArray:!0,isOptional:!0}}}),Q=k({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:w,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:x,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}}}),U=k({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:q,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:x,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 B,StabilityEnum as D}from"@contractspec/lib.contracts-spec";var Y=B({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:D.Experimental},source:{type:"component",framework:"react",componentKey:"AgentListView",props:F},targets:["react","markdown","application/json"],policy:{flags:["agent-console.enabled"]}}),Z=B({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:D.Experimental},source:{type:"component",framework:"react",componentKey:"AgentDetailView"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}}),_=B({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:D.Experimental},source:{type:"component",framework:"react",componentKey:"AgentConsoleDashboard"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}});export{Y as AgentListPresentation,Z as AgentDetailPresentation,_ as AgentConsoleDashboardPresentation};
|
|
@@ -1,216 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
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
|
-
export {
|
|
210
|
-
UpdateAgentInputModel,
|
|
211
|
-
CreateAgentInputModel,
|
|
212
|
-
AgentWithToolsModel,
|
|
213
|
-
AgentToolRefModel,
|
|
214
|
-
AgentSummaryModel,
|
|
215
|
-
AgentModel
|
|
216
|
-
};
|
|
2
|
+
import{defineEnum as z}from"@contractspec/lib.schema";var q=z("AgentStatus",["DRAFT","ACTIVE","PAUSED","ARCHIVED"]),w=z("ModelProvider",["OPENAI","ANTHROPIC","GOOGLE","MISTRAL","CUSTOM"]),x=z("ToolChoice",["auto","required","none"]);import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var J=k({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:q,isOptional:!1},modelProvider:{type:w,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:x,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}}}),K=k({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:q,isOptional:!1},modelProvider:{type:w,isOptional:!1},modelName:{type:j.NonEmptyString(),isOptional:!1},version:{type:j.NonEmptyString(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1}}}),B=k({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}}}),L=k({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:q,isOptional:!1},modelProvider:{type:w,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:x,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:B,isArray:!0,isOptional:!0}}}),N=k({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:w,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:x,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}}}),O=k({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:q,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:x,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}}});export{O as UpdateAgentInputModel,N as CreateAgentInputModel,L as AgentWithToolsModel,B as AgentToolRefModel,K as AgentSummaryModel,J as AgentModel};
|
|
@@ -1,59 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineTestSpec } from "@contractspec/lib.contracts-spec/tests";
|
|
4
|
-
var agentListTest = defineTestSpec({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "test.agent-console.agent.list",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
owners: ["@agent-console-team"],
|
|
9
|
-
description: "Test for listing agents",
|
|
10
|
-
stability: "stable",
|
|
11
|
-
tags: ["test"]
|
|
12
|
-
},
|
|
13
|
-
target: {
|
|
14
|
-
type: "operation",
|
|
15
|
-
operation: { key: "agent-console.agent.list", version: "1.0.0" }
|
|
16
|
-
},
|
|
17
|
-
scenarios: [
|
|
18
|
-
{
|
|
19
|
-
key: "success",
|
|
20
|
-
when: { operation: { key: "agent-console.agent.list" } },
|
|
21
|
-
then: [{ type: "expectOutput", match: {} }]
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
key: "error",
|
|
25
|
-
when: { operation: { key: "agent-console.agent.list" } },
|
|
26
|
-
then: [{ type: "expectError" }]
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
var agentGetTest = defineTestSpec({
|
|
31
|
-
meta: {
|
|
32
|
-
key: "test.agent-console.agent.get",
|
|
33
|
-
version: "1.0.0",
|
|
34
|
-
owners: ["@agent-console-team"],
|
|
35
|
-
description: "Test for getting agent",
|
|
36
|
-
stability: "stable",
|
|
37
|
-
tags: ["test"]
|
|
38
|
-
},
|
|
39
|
-
target: {
|
|
40
|
-
type: "operation",
|
|
41
|
-
operation: { key: "agent-console.agent.get", version: "1.0.0" }
|
|
42
|
-
},
|
|
43
|
-
scenarios: [
|
|
44
|
-
{
|
|
45
|
-
key: "success",
|
|
46
|
-
when: { operation: { key: "agent-console.agent.get" } },
|
|
47
|
-
then: [{ type: "expectOutput", match: {} }]
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
key: "error",
|
|
51
|
-
when: { operation: { key: "agent-console.agent.get" } },
|
|
52
|
-
then: [{ type: "expectError" }]
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
export {
|
|
57
|
-
agentListTest,
|
|
58
|
-
agentGetTest
|
|
59
|
-
};
|
|
2
|
+
import{defineTestSpec as g}from"@contractspec/lib.contracts-spec/tests";var j=g({meta:{key:"test.agent-console.agent.list",version:"1.0.0",owners:["@agent-console-team"],description:"Test for listing agents",stability:"stable",tags:["test"]},target:{type:"operation",operation:{key:"agent-console.agent.list",version:"1.0.0"}},scenarios:[{key:"success",when:{operation:{key:"agent-console.agent.list"}},then:[{type:"expectOutput",match:{}}]},{key:"error",when:{operation:{key:"agent-console.agent.list"}},then:[{type:"expectError"}]}]}),k=g({meta:{key:"test.agent-console.agent.get",version:"1.0.0",owners:["@agent-console-team"],description:"Test for getting agent",stability:"stable",tags:["test"]},target:{type:"operation",operation:{key:"agent-console.agent.get",version:"1.0.0"}},scenarios:[{key:"success",when:{operation:{key:"agent-console.agent.get"}},then:[{type:"expectOutput",match:{}}]},{key:"error",when:{operation:{key:"agent-console.agent.get"}},then:[{type:"expectError"}]}]});export{j as agentListTest,k as agentGetTest};
|