@lssm/example.agent-console 0.0.0-canary-20251216031832 → 0.0.0-canary-20251216033905
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 +2 -2
- package/CHANGELOG.md +6 -6
- package/package.json +1 -1
- package/src/agent/agent.entity.ts +74 -21
- package/src/agent/agent.event.ts +17 -6
- package/src/agent/agent.handler.ts +40 -10
- package/src/agent/agent.presentation.ts +4 -3
- package/src/agent/agent.schema.ts +88 -21
- package/src/agent/index.ts +5 -3
- package/src/handlers/index.ts +0 -1
- package/src/presentations/index.ts +0 -1
- package/src/run/index.ts +6 -3
- package/src/run/run.contracts.ts +130 -26
- package/src/run/run.entity.ts +71 -22
- package/src/run/run.enum.ts +0 -2
- package/src/run/run.event.ts +24 -8
- package/src/run/run.handler.ts +45 -10
- package/src/run/run.presentation.ts +2 -3
- package/src/run/run.schema.ts +41 -11
- package/src/shared/mock-agents.ts +0 -2
- package/src/shared/mock-runs.ts +0 -1
- package/src/shared/mock-tools.ts +0 -1
- package/src/tool/index.ts +33 -8
- package/src/tool/tool.contracts.ts +74 -14
- package/src/tool/tool.entity.ts +45 -12
- package/src/tool/tool.enum.ts +0 -2
- package/src/tool/tool.event.ts +27 -9
- package/src/tool/tool.handler.ts +59 -12
- package/src/tool/tool.presentation.ts +4 -4
- package/src/tool/tool.schema.ts +0 -1
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,7 +2,7 @@ $ bun build:bundle && bun build:types
|
|
|
2
2
|
$ tsdown
|
|
3
3
|
[34mℹ[39m tsdown [2mv0.17.4[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
4
|
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/agent-console/tsdown.config.js[24m
|
|
5
|
-
[34mℹ[39m entry: [34msrc/agent.feature.ts, src/example.ts, src/index.ts, src/
|
|
5
|
+
[34mℹ[39m entry: [34msrc/agent.feature.ts, src/example.ts, src/index.ts, src/docs/agent-console.docblock.ts, src/docs/index.ts, src/handlers/index.ts, src/agent/agent.contracts.ts, src/agent/agent.entity.ts, src/agent/agent.enum.ts, src/agent/agent.event.ts, src/agent/agent.handler.ts, src/agent/agent.presentation.ts, src/agent/agent.schema.ts, src/agent/index.ts, src/presentations/index.ts, src/run/index.ts, src/run/run.contracts.ts, src/run/run.entity.ts, src/run/run.enum.ts, src/run/run.event.ts, src/run/run.handler.ts, src/run/run.presentation.ts, src/run/run.schema.ts, src/shared/index.ts, src/shared/mock-agents.ts, src/shared/mock-runs.ts, src/shared/mock-tools.ts, src/tool/index.ts, src/tool/tool.contracts.ts, src/tool/tool.entity.ts, src/tool/tool.enum.ts, src/tool/tool.event.ts, src/tool/tool.handler.ts, src/tool/tool.presentation.ts, src/tool/tool.schema.ts[39m
|
|
6
6
|
[34mℹ[39m target: [34mesnext[39m
|
|
7
7
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
8
|
[34mℹ[39m Build start
|
|
@@ -42,5 +42,5 @@ $ tsdown
|
|
|
42
42
|
[34mℹ[39m [2mdist/[22m[1mshared/index.js[22m [2m0.19 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
43
43
|
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
44
44
|
[34mℹ[39m 35 files, total: 79.23 kB
|
|
45
|
-
[32m✔[39m Build complete in [
|
|
45
|
+
[32m✔[39m Build complete in [32m140ms[39m
|
|
46
46
|
$ tsc --noEmit
|
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @lssm/example.agent-console
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20251216033905
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 3086383: refactor: dependencies upgrade
|
|
8
8
|
- Updated dependencies [3086383]
|
|
9
|
-
- @lssm/lib.contracts@0.0.0-canary-
|
|
10
|
-
- @lssm/lib.schema@0.0.0-canary-
|
|
11
|
-
- @lssm/lib.jobs@0.0.0-canary-
|
|
12
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-
|
|
13
|
-
- @lssm/module.audit-trail@0.0.0-canary-
|
|
9
|
+
- @lssm/lib.contracts@0.0.0-canary-20251216033905
|
|
10
|
+
- @lssm/lib.schema@0.0.0-canary-20251216033905
|
|
11
|
+
- @lssm/lib.jobs@0.0.0-canary-20251216033905
|
|
12
|
+
- @lssm/lib.identity-rbac@0.0.0-canary-20251216033905
|
|
13
|
+
- @lssm/module.audit-trail@0.0.0-canary-20251216033905
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.agent-console",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251216033905",
|
|
4
4
|
"description": "Agent Console example - AI agent orchestration with tools, runs, and logs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineEntity,
|
|
3
|
+
defineEntityEnum,
|
|
4
|
+
field,
|
|
5
|
+
index,
|
|
6
|
+
} from '@lssm/lib.schema/entity';
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
9
|
* Agent status for lifecycle management.
|
|
@@ -24,30 +29,71 @@ export const ModelProviderEntityEnum = defineEntityEnum({
|
|
|
24
29
|
export const AgentEntity = defineEntity({
|
|
25
30
|
name: 'Agent',
|
|
26
31
|
schema: 'agent_console',
|
|
27
|
-
description:
|
|
32
|
+
description:
|
|
33
|
+
'Represents an AI agent configuration with assigned tools and parameters.',
|
|
28
34
|
fields: {
|
|
29
35
|
id: field.id(),
|
|
30
|
-
organizationId: field.string({
|
|
36
|
+
organizationId: field.string({
|
|
37
|
+
description: 'Organization that owns this agent',
|
|
38
|
+
}),
|
|
31
39
|
name: field.string({ description: 'Agent name (1-100 chars)' }),
|
|
32
|
-
slug: field.string({
|
|
33
|
-
|
|
40
|
+
slug: field.string({
|
|
41
|
+
description: 'URL-safe identifier (lowercase, numbers, hyphens)',
|
|
42
|
+
}),
|
|
43
|
+
description: field.string({
|
|
44
|
+
isOptional: true,
|
|
45
|
+
description: 'Agent description (max 1000 chars)',
|
|
46
|
+
}),
|
|
34
47
|
status: field.enum('AgentStatus', { default: 'DRAFT' }),
|
|
35
48
|
modelProvider: field.enum('ModelProvider', { default: 'OPENAI' }),
|
|
36
|
-
modelName: field.string({
|
|
37
|
-
|
|
49
|
+
modelName: field.string({
|
|
50
|
+
description: "Model identifier: 'gpt-4', 'claude-3-opus', etc.",
|
|
51
|
+
}),
|
|
52
|
+
modelConfig: field.json({
|
|
53
|
+
isOptional: true,
|
|
54
|
+
description: 'Model parameters: temperature, max_tokens, etc.',
|
|
55
|
+
}),
|
|
38
56
|
systemPrompt: field.string({ description: 'System prompt for the agent' }),
|
|
39
|
-
userPromptTemplate: field.string({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
userPromptTemplate: field.string({
|
|
58
|
+
isOptional: true,
|
|
59
|
+
description: 'Template for user prompts',
|
|
60
|
+
}),
|
|
61
|
+
toolIds: field.string({
|
|
62
|
+
isArray: true,
|
|
63
|
+
isOptional: true,
|
|
64
|
+
description: 'IDs of assigned tools',
|
|
65
|
+
}),
|
|
66
|
+
toolChoice: field.string({
|
|
67
|
+
default: 'auto',
|
|
68
|
+
description: "Tool selection mode: 'auto', 'required', 'none'",
|
|
69
|
+
}),
|
|
70
|
+
maxIterations: field.int({
|
|
71
|
+
default: 10,
|
|
72
|
+
description: 'Maximum iterations per run',
|
|
73
|
+
}),
|
|
74
|
+
maxTokensPerRun: field.int({
|
|
75
|
+
isOptional: true,
|
|
76
|
+
description: 'Maximum tokens per run',
|
|
77
|
+
}),
|
|
78
|
+
timeoutMs: field.int({
|
|
79
|
+
default: 120000,
|
|
80
|
+
description: 'Execution timeout in milliseconds',
|
|
81
|
+
}),
|
|
45
82
|
version: field.string({ default: '1.0.0', description: 'Agent version' }),
|
|
46
|
-
tags: field.string({
|
|
83
|
+
tags: field.string({
|
|
84
|
+
isArray: true,
|
|
85
|
+
isOptional: true,
|
|
86
|
+
description: 'Tags for categorization',
|
|
87
|
+
}),
|
|
47
88
|
createdAt: field.createdAt(),
|
|
48
89
|
updatedAt: field.updatedAt(),
|
|
49
|
-
createdById: field.string({
|
|
50
|
-
|
|
90
|
+
createdById: field.string({
|
|
91
|
+
isOptional: true,
|
|
92
|
+
description: 'User who created this agent',
|
|
93
|
+
}),
|
|
94
|
+
tools: field.hasMany('Tool', {
|
|
95
|
+
description: 'Tools assigned to this agent',
|
|
96
|
+
}),
|
|
51
97
|
},
|
|
52
98
|
indexes: [
|
|
53
99
|
index.unique(['organizationId', 'slug']),
|
|
@@ -68,9 +114,18 @@ export const AgentToolEntity = defineEntity({
|
|
|
68
114
|
id: field.id(),
|
|
69
115
|
agentId: field.foreignKey({ description: 'Agent ID' }),
|
|
70
116
|
toolId: field.foreignKey({ description: 'Tool ID' }),
|
|
71
|
-
config: field.json({
|
|
72
|
-
|
|
73
|
-
|
|
117
|
+
config: field.json({
|
|
118
|
+
isOptional: true,
|
|
119
|
+
description: 'Tool-specific configuration for this agent',
|
|
120
|
+
}),
|
|
121
|
+
order: field.int({
|
|
122
|
+
default: 0,
|
|
123
|
+
description: 'Order of tool in agent tool list',
|
|
124
|
+
}),
|
|
125
|
+
isEnabled: field.boolean({
|
|
126
|
+
default: true,
|
|
127
|
+
description: 'Whether tool is enabled for this agent',
|
|
128
|
+
}),
|
|
74
129
|
createdAt: field.createdAt(),
|
|
75
130
|
agent: field.belongsTo('Agent', ['agentId'], ['id']),
|
|
76
131
|
tool: field.belongsTo('Tool', ['toolId'], ['id']),
|
|
@@ -80,5 +135,3 @@ export const AgentToolEntity = defineEntity({
|
|
|
80
135
|
index.on(['agentId', 'order']),
|
|
81
136
|
],
|
|
82
137
|
});
|
|
83
|
-
|
|
84
|
-
|
package/src/agent/agent.event.ts
CHANGED
|
@@ -9,10 +9,16 @@ const AgentCreatedPayload = defineSchemaModel({
|
|
|
9
9
|
description: 'Payload for agent created event',
|
|
10
10
|
fields: {
|
|
11
11
|
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
-
organizationId: {
|
|
12
|
+
organizationId: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false,
|
|
15
|
+
},
|
|
13
16
|
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
17
|
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
-
modelProvider: {
|
|
18
|
+
modelProvider: {
|
|
19
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
20
|
+
isOptional: false,
|
|
21
|
+
},
|
|
16
22
|
modelName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
23
|
toolCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
18
24
|
createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
@@ -38,10 +44,17 @@ const AgentUpdatedPayload = defineSchemaModel({
|
|
|
38
44
|
description: 'Payload for agent updated event',
|
|
39
45
|
fields: {
|
|
40
46
|
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
41
|
-
organizationId: {
|
|
47
|
+
organizationId: {
|
|
48
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
49
|
+
isOptional: false,
|
|
50
|
+
},
|
|
42
51
|
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
43
52
|
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
-
updatedFields: {
|
|
53
|
+
updatedFields: {
|
|
54
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
55
|
+
isArray: true,
|
|
56
|
+
isOptional: false,
|
|
57
|
+
},
|
|
45
58
|
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
46
59
|
},
|
|
47
60
|
});
|
|
@@ -105,5 +118,3 @@ export const AgentToolRemovedEvent = defineEvent({
|
|
|
105
118
|
description: 'A tool was removed from an agent.',
|
|
106
119
|
payload: AgentToolRemovedPayload,
|
|
107
120
|
});
|
|
108
|
-
|
|
109
|
-
|
|
@@ -71,16 +71,29 @@ export interface AgentWithTools {
|
|
|
71
71
|
/**
|
|
72
72
|
* Mock handler for ListAgentsQuery.
|
|
73
73
|
*/
|
|
74
|
-
export async function mockListAgentsHandler(
|
|
75
|
-
|
|
74
|
+
export async function mockListAgentsHandler(
|
|
75
|
+
input: ListAgentsInput
|
|
76
|
+
): Promise<ListAgentsOutput> {
|
|
77
|
+
const {
|
|
78
|
+
organizationId,
|
|
79
|
+
status,
|
|
80
|
+
modelProvider,
|
|
81
|
+
search,
|
|
82
|
+
limit = 20,
|
|
83
|
+
offset = 0,
|
|
84
|
+
} = input;
|
|
76
85
|
|
|
77
86
|
let filtered = MOCK_AGENTS.filter((a) => a.organizationId === organizationId);
|
|
78
87
|
if (status) filtered = filtered.filter((a) => a.status === status);
|
|
79
|
-
if (modelProvider)
|
|
88
|
+
if (modelProvider)
|
|
89
|
+
filtered = filtered.filter((a) => a.modelProvider === modelProvider);
|
|
80
90
|
if (search) {
|
|
81
91
|
const q = search.toLowerCase();
|
|
82
92
|
filtered = filtered.filter(
|
|
83
|
-
(a) =>
|
|
93
|
+
(a) =>
|
|
94
|
+
a.name.toLowerCase().includes(q) ||
|
|
95
|
+
a.description?.toLowerCase().includes(q) ||
|
|
96
|
+
a.tags?.some((t) => t.toLowerCase().includes(q))
|
|
84
97
|
);
|
|
85
98
|
}
|
|
86
99
|
|
|
@@ -103,7 +116,9 @@ export async function mockListAgentsHandler(input: ListAgentsInput): Promise<Lis
|
|
|
103
116
|
/**
|
|
104
117
|
* Mock handler for GetAgentQuery.
|
|
105
118
|
*/
|
|
106
|
-
export async function mockGetAgentHandler(
|
|
119
|
+
export async function mockGetAgentHandler(
|
|
120
|
+
input: GetAgentInput
|
|
121
|
+
): Promise<AgentWithTools> {
|
|
107
122
|
const agent = MOCK_AGENTS.find((a) => a.id === input.agentId);
|
|
108
123
|
if (!agent) throw new Error('AGENT_NOT_FOUND');
|
|
109
124
|
|
|
@@ -132,17 +147,32 @@ export async function mockCreateAgentHandler(input: {
|
|
|
132
147
|
modelName: string;
|
|
133
148
|
systemPrompt: string;
|
|
134
149
|
}) {
|
|
135
|
-
const exists = MOCK_AGENTS.some(
|
|
150
|
+
const exists = MOCK_AGENTS.some(
|
|
151
|
+
(a) => a.organizationId === input.organizationId && a.slug === input.slug
|
|
152
|
+
);
|
|
136
153
|
if (exists) throw new Error('SLUG_EXISTS');
|
|
137
|
-
return {
|
|
154
|
+
return {
|
|
155
|
+
id: `agent-${Date.now()}`,
|
|
156
|
+
name: input.name,
|
|
157
|
+
slug: input.slug,
|
|
158
|
+
status: 'DRAFT' as const,
|
|
159
|
+
};
|
|
138
160
|
}
|
|
139
161
|
|
|
140
162
|
/**
|
|
141
163
|
* Mock handler for UpdateAgentCommand.
|
|
142
164
|
*/
|
|
143
|
-
export async function mockUpdateAgentHandler(input: {
|
|
165
|
+
export async function mockUpdateAgentHandler(input: {
|
|
166
|
+
agentId: string;
|
|
167
|
+
name?: string;
|
|
168
|
+
status?: 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
|
|
169
|
+
}) {
|
|
144
170
|
const agent = MOCK_AGENTS.find((a) => a.id === input.agentId);
|
|
145
171
|
if (!agent) throw new Error('AGENT_NOT_FOUND');
|
|
146
|
-
return {
|
|
172
|
+
return {
|
|
173
|
+
id: agent.id,
|
|
174
|
+
name: input.name ?? agent.name,
|
|
175
|
+
status: input.status ?? agent.status,
|
|
176
|
+
updatedAt: new Date(),
|
|
177
|
+
};
|
|
147
178
|
}
|
|
148
|
-
|
|
@@ -8,7 +8,8 @@ export const AgentListPresentation: PresentationDescriptorV2 = {
|
|
|
8
8
|
meta: {
|
|
9
9
|
name: 'agent-console.agent.list',
|
|
10
10
|
version: 1,
|
|
11
|
-
description:
|
|
11
|
+
description:
|
|
12
|
+
'List view of AI agents with status, model provider, and version info',
|
|
12
13
|
domain: 'agent-console',
|
|
13
14
|
owners: ['agent-console-team'],
|
|
14
15
|
tags: ['agent', 'list', 'dashboard'],
|
|
@@ -30,7 +31,8 @@ export const AgentDetailPresentation: PresentationDescriptorV2 = {
|
|
|
30
31
|
meta: {
|
|
31
32
|
name: 'agent-console.agent.detail',
|
|
32
33
|
version: 1,
|
|
33
|
-
description:
|
|
34
|
+
description:
|
|
35
|
+
'Detailed view of an AI agent with configuration, tools, and recent runs',
|
|
34
36
|
domain: 'agent-console',
|
|
35
37
|
owners: ['agent-console-team'],
|
|
36
38
|
tags: ['agent', 'detail'],
|
|
@@ -64,4 +66,3 @@ export const AgentConsoleDashboardPresentation: PresentationDescriptorV2 = {
|
|
|
64
66
|
targets: ['react', 'markdown'],
|
|
65
67
|
policy: { flags: ['agent-console.enabled'] },
|
|
66
68
|
};
|
|
67
|
-
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AgentStatusEnum,
|
|
4
|
+
ModelProviderEnum,
|
|
5
|
+
ToolChoiceEnum,
|
|
6
|
+
} from './agent.enum';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* AI agent configuration schema.
|
|
@@ -9,7 +13,10 @@ export const AgentModel = defineSchemaModel({
|
|
|
9
13
|
description: 'AI agent configuration',
|
|
10
14
|
fields: {
|
|
11
15
|
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
-
organizationId: {
|
|
16
|
+
organizationId: {
|
|
17
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
+
isOptional: false,
|
|
19
|
+
},
|
|
13
20
|
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
14
21
|
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
22
|
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
@@ -18,14 +25,37 @@ export const AgentModel = defineSchemaModel({
|
|
|
18
25
|
modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
19
26
|
modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
20
27
|
systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
-
userPromptTemplate: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
userPromptTemplate: {
|
|
29
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
30
|
+
isOptional: true,
|
|
31
|
+
},
|
|
32
|
+
toolIds: {
|
|
33
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
34
|
+
isArray: true,
|
|
35
|
+
isOptional: true,
|
|
36
|
+
},
|
|
37
|
+
toolChoice: {
|
|
38
|
+
type: ToolChoiceEnum,
|
|
39
|
+
isOptional: false,
|
|
40
|
+
defaultValue: 'auto',
|
|
41
|
+
},
|
|
42
|
+
maxIterations: {
|
|
43
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
44
|
+
isOptional: false,
|
|
45
|
+
defaultValue: 10,
|
|
46
|
+
},
|
|
25
47
|
maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
26
|
-
timeoutMs: {
|
|
48
|
+
timeoutMs: {
|
|
49
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
50
|
+
isOptional: false,
|
|
51
|
+
defaultValue: 120000,
|
|
52
|
+
},
|
|
27
53
|
version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
28
|
-
tags: {
|
|
54
|
+
tags: {
|
|
55
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
56
|
+
isArray: true,
|
|
57
|
+
isOptional: true,
|
|
58
|
+
},
|
|
29
59
|
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
30
60
|
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
31
61
|
},
|
|
@@ -73,7 +103,10 @@ export const AgentWithToolsModel = defineSchemaModel({
|
|
|
73
103
|
description: 'Agent with associated tools',
|
|
74
104
|
fields: {
|
|
75
105
|
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
76
|
-
organizationId: {
|
|
106
|
+
organizationId: {
|
|
107
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
108
|
+
isOptional: false,
|
|
109
|
+
},
|
|
77
110
|
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
78
111
|
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
79
112
|
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
@@ -82,14 +115,25 @@ export const AgentWithToolsModel = defineSchemaModel({
|
|
|
82
115
|
modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
83
116
|
modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
84
117
|
systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
85
|
-
userPromptTemplate: {
|
|
86
|
-
|
|
118
|
+
userPromptTemplate: {
|
|
119
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
120
|
+
isOptional: true,
|
|
121
|
+
},
|
|
122
|
+
toolIds: {
|
|
123
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
124
|
+
isArray: true,
|
|
125
|
+
isOptional: true,
|
|
126
|
+
},
|
|
87
127
|
toolChoice: { type: ToolChoiceEnum, isOptional: false },
|
|
88
128
|
maxIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
89
129
|
maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
90
130
|
timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
91
131
|
version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
92
|
-
tags: {
|
|
132
|
+
tags: {
|
|
133
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
134
|
+
isArray: true,
|
|
135
|
+
isOptional: true,
|
|
136
|
+
},
|
|
93
137
|
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
94
138
|
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
95
139
|
tools: { type: AgentToolRefModel, isArray: true, isOptional: true },
|
|
@@ -103,7 +147,10 @@ export const CreateAgentInputModel = defineSchemaModel({
|
|
|
103
147
|
name: 'CreateAgentInput',
|
|
104
148
|
description: 'Input for creating an agent',
|
|
105
149
|
fields: {
|
|
106
|
-
organizationId: {
|
|
150
|
+
organizationId: {
|
|
151
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
152
|
+
isOptional: false,
|
|
153
|
+
},
|
|
107
154
|
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
108
155
|
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
109
156
|
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
@@ -111,13 +158,24 @@ export const CreateAgentInputModel = defineSchemaModel({
|
|
|
111
158
|
modelName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
112
159
|
modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
113
160
|
systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
114
|
-
userPromptTemplate: {
|
|
115
|
-
|
|
161
|
+
userPromptTemplate: {
|
|
162
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
163
|
+
isOptional: true,
|
|
164
|
+
},
|
|
165
|
+
toolIds: {
|
|
166
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
167
|
+
isArray: true,
|
|
168
|
+
isOptional: true,
|
|
169
|
+
},
|
|
116
170
|
toolChoice: { type: ToolChoiceEnum, isOptional: true },
|
|
117
171
|
maxIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
118
172
|
maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
119
173
|
timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
120
|
-
tags: {
|
|
174
|
+
tags: {
|
|
175
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
176
|
+
isArray: true,
|
|
177
|
+
isOptional: true,
|
|
178
|
+
},
|
|
121
179
|
},
|
|
122
180
|
});
|
|
123
181
|
|
|
@@ -134,14 +192,23 @@ export const UpdateAgentInputModel = defineSchemaModel({
|
|
|
134
192
|
status: { type: AgentStatusEnum, isOptional: true },
|
|
135
193
|
modelConfig: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
136
194
|
systemPrompt: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
137
|
-
userPromptTemplate: {
|
|
138
|
-
|
|
195
|
+
userPromptTemplate: {
|
|
196
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
197
|
+
isOptional: true,
|
|
198
|
+
},
|
|
199
|
+
toolIds: {
|
|
200
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
201
|
+
isArray: true,
|
|
202
|
+
isOptional: true,
|
|
203
|
+
},
|
|
139
204
|
toolChoice: { type: ToolChoiceEnum, isOptional: true },
|
|
140
205
|
maxIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
141
206
|
maxTokensPerRun: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
142
207
|
timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
143
|
-
tags: {
|
|
208
|
+
tags: {
|
|
209
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
210
|
+
isArray: true,
|
|
211
|
+
isOptional: true,
|
|
212
|
+
},
|
|
144
213
|
},
|
|
145
214
|
});
|
|
146
|
-
|
|
147
|
-
|
package/src/agent/index.ts
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// Enums
|
|
6
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
AgentStatusEnum,
|
|
8
|
+
ModelProviderEnum,
|
|
9
|
+
ToolChoiceEnum,
|
|
10
|
+
} from './agent.enum';
|
|
7
11
|
|
|
8
12
|
// Schema models
|
|
9
13
|
export {
|
|
@@ -61,5 +65,3 @@ export {
|
|
|
61
65
|
type AgentToolRef,
|
|
62
66
|
type AgentWithTools,
|
|
63
67
|
} from './agent.handler';
|
|
64
|
-
|
|
65
|
-
|
package/src/handlers/index.ts
CHANGED
package/src/run/index.ts
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// Enums
|
|
6
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
RunStatusEnum,
|
|
8
|
+
RunStepTypeEnum,
|
|
9
|
+
LogLevelEnum,
|
|
10
|
+
GranularityEnum,
|
|
11
|
+
} from './run.enum';
|
|
7
12
|
|
|
8
13
|
// Schema models
|
|
9
14
|
export {
|
|
@@ -61,5 +66,3 @@ export {
|
|
|
61
66
|
type RunSummary,
|
|
62
67
|
type ListRunsOutput,
|
|
63
68
|
} from './run.handler';
|
|
64
|
-
|
|
65
|
-
|