plugin-agent-orchestrator 1.0.27 → 1.0.32
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/README.md +9 -7
- package/dist/client/index.js +1 -1
- package/dist/client-v2/{214.723affb37c13bf7a.js → 214.79650a549273f163.js} +1 -1
- package/dist/client-v2/264.718a107e43fc163c.js +10 -0
- package/dist/client-v2/373.f5d5292e53c4e832.js +10 -0
- package/dist/client-v2/{41.1805b2edfaa4afe2.js → 41.ba6e080cc0488143.js} +1 -1
- package/dist/client-v2/418.29e713f79131eece.js +10 -0
- package/dist/client-v2/619.bd3c5698b40705c3.js +10 -0
- package/dist/client-v2/677.a991ce0250ff5c77.js +10 -0
- package/dist/client-v2/{70.a15d7fcec7c41768.js → 70.bda9518881c05360.js} +1 -1
- package/dist/client-v2/925.f5370de8f6632d65.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +7 -10
- package/dist/locale/en-US.json +94 -25
- package/dist/locale/vi-VN.json +94 -25
- package/dist/locale/zh-CN.json +94 -25
- package/dist/server/collections/agent-execution-spans.js +37 -0
- package/dist/server/collections/agent-harness-profiles.js +2 -2
- package/dist/server/collections/agent-memory-contexts.js +125 -0
- package/dist/server/collections/orchestrator-logs.js +2 -2
- package/dist/server/migrations/20260425000000-add-interaction-schema.js +3 -1
- package/dist/server/migrations/20260427000000-change-packages-to-text.js +3 -1
- package/dist/server/migrations/20260427000001-change-other-json-to-text.js +6 -2
- package/dist/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.js +21 -19
- package/dist/server/migrations/20260621000000-native-policy-profile-defaults.js +193 -0
- package/dist/server/plugin.js +128 -74
- package/dist/server/resources/agent-monitor.js +454 -0
- package/dist/server/services/AgentHarness.js +24 -499
- package/dist/server/services/AgentMemoryContextService.js +216 -0
- package/dist/server/services/ExecutionSpanService.js +2 -2
- package/dist/server/services/NativeSubAgentObserver.js +413 -0
- package/dist/server/skill-hub/mcp/McpController.js +16 -5
- package/dist/server/skill-hub/plugin.js +81 -5
- package/dist/server/skill-hub/tasks/SkillExecutionTask.js +9 -3
- package/dist/server/tools/delegate-task.js +11 -589
- package/dist/server/utils/skill-settings.js +18 -1
- package/package.json +47 -49
- package/src/client/AIEmployeesContext.tsx +5 -18
- package/src/client/AgentRunsTab.tsx +2 -771
- package/src/client/HarnessProfilesTab.tsx +2 -257
- package/src/client/OrchestratorSettings.tsx +97 -106
- package/src/client/RulesTab.tsx +2 -788
- package/src/client/plugin.tsx +0 -2
- package/src/client/skill-hub/components/ExecutionHistory.tsx +200 -202
- package/src/client/skill-hub/components/ExecutionProgress.tsx +51 -55
- package/src/client/skill-hub/components/LoopSettings.tsx +331 -331
- package/src/client/skill-hub/components/SkillEditor.tsx +43 -39
- package/src/client/skill-hub/components/SkillManager.tsx +194 -181
- package/src/client/skill-hub/components/SkillTestPanel.tsx +141 -145
- package/src/client/skill-hub/locale.ts +16 -16
- package/src/client/skill-hub/tools/SkillHubCard.tsx +104 -109
- package/src/client/skill-hub/tools/loopTemplates.ts +52 -52
- package/src/client/skill-hub/utils/jsonFields.ts +7 -3
- package/src/client-v2/components/AIEmployeesContext.tsx +3 -16
- package/src/client-v2/components/AgentRunsTab.tsx +182 -455
- package/src/client-v2/components/HarnessProfilesTab.tsx +34 -31
- package/src/client-v2/components/RulesTab.tsx +2 -782
- package/src/client-v2/components/TracingTab.tsx +1 -1
- package/src/client-v2/hooks/useApiRequest.ts +8 -1
- package/src/client-v2/pages/RulesPage.tsx +2 -2
- package/src/client-v2/plugin.tsx +3 -3
- package/src/locale/en-US.json +94 -25
- package/src/locale/vi-VN.json +94 -25
- package/src/locale/zh-CN.json +94 -25
- package/src/server/__tests__/native-sub-agent-observer.test.ts +246 -0
- package/src/server/__tests__/skill-settings.test.ts +6 -6
- package/src/server/__tests__/smoke.test.ts +1 -0
- package/src/server/collections/agent-execution-spans.ts +37 -0
- package/src/server/collections/agent-harness-profiles.ts +59 -59
- package/src/server/collections/agent-loop-events.ts +71 -71
- package/src/server/collections/agent-loop-steps.ts +144 -144
- package/src/server/collections/agent-memory-contexts.ts +95 -0
- package/src/server/collections/orchestrator-logs.ts +4 -4
- package/src/server/collections/skill-definitions.ts +111 -111
- package/src/server/collections/skill-executions.ts +106 -106
- package/src/server/collections/skill-loop-configs.ts +65 -65
- package/src/server/migrations/20260423000000-add-progress-fields.ts +14 -14
- package/src/server/migrations/20260425000000-add-interaction-schema.ts +3 -1
- package/src/server/migrations/20260427000000-change-packages-to-text.ts +4 -2
- package/src/server/migrations/20260427000001-change-other-json-to-text.ts +9 -5
- package/src/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.ts +30 -30
- package/src/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.ts +145 -142
- package/src/server/migrations/20260615000000-normalize-ai-employee-tool-bindings.ts +2 -2
- package/src/server/migrations/20260621000000-native-policy-profile-defaults.ts +193 -0
- package/src/server/plugin.ts +151 -94
- package/src/server/resources/agent-monitor.ts +482 -0
- package/src/server/services/AgentHarness.ts +38 -623
- package/src/server/services/AgentMemoryContextService.ts +256 -0
- package/src/server/services/AgentPlanValidator.ts +73 -73
- package/src/server/services/ExecutionSpanService.ts +6 -2
- package/src/server/services/FileManager.ts +144 -144
- package/src/server/services/NativeSubAgentObserver.ts +507 -0
- package/src/server/services/SkillManager.ts +583 -583
- package/src/server/services/SkillRepositoryService.ts +5 -7
- package/src/server/services/TokenTracker.ts +3 -3
- package/src/server/services/WorkerEnvManager.ts +1 -2
- package/src/server/skill-hub/actions/git-import.ts +5 -7
- package/src/server/skill-hub/mcp/McpController.ts +41 -14
- package/src/server/skill-hub/plugin.ts +89 -6
- package/src/server/skill-hub/tasks/SkillExecutionTask.ts +470 -460
- package/src/server/skill-hub/utils/json-fields.ts +1 -1
- package/src/server/tools/delegate-task.ts +13 -847
- package/src/server/utils/skill-settings.ts +24 -6
- package/dist/client-v2/264.0533912e6c5ea2d7.js +0 -10
- package/dist/client-v2/418.5ae055abf141820e.js +0 -10
- package/dist/client-v2/619.d99d3c9e61c99064.js +0 -10
- package/dist/client-v2/892.72db4161511c8a16.js +0 -10
- package/dist/client-v2/926.87f660b670d85bcc.js +0 -10
- package/src/client/tools/PlanApprovalCard.tsx +0 -176
- package/src/client/tools/registerOrchestratorCards.ts +0 -17
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { AgentMemoryContextService } from '../services/AgentMemoryContextService';
|
|
3
|
+
import { NativeSubAgentObserver } from '../services/NativeSubAgentObserver';
|
|
4
|
+
|
|
5
|
+
function createObserverHarness(profileSettings: Record<string, unknown> | null = {}) {
|
|
6
|
+
let nextSpanId = 1;
|
|
7
|
+
const spanRepo = {
|
|
8
|
+
create: vi.fn(async ({ values }) => ({ id: nextSpanId++, ...values })),
|
|
9
|
+
update: vi.fn(async () => ({})),
|
|
10
|
+
};
|
|
11
|
+
const originalRun = vi.fn(async (task) => {
|
|
12
|
+
task.writer?.({
|
|
13
|
+
action: 'beforeToolCall',
|
|
14
|
+
body: {
|
|
15
|
+
toolCall: {
|
|
16
|
+
id: 'tool-1',
|
|
17
|
+
name: 'skill_hub_execute',
|
|
18
|
+
args: { input: 'x' },
|
|
19
|
+
messageId: 'msg-1',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
currentConversation: {
|
|
23
|
+
sessionId: 'sub-session',
|
|
24
|
+
username: 'sub-agent',
|
|
25
|
+
from: 'sub-agent',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
task.writer?.({
|
|
29
|
+
action: 'afterToolCall',
|
|
30
|
+
body: {
|
|
31
|
+
toolCall: {
|
|
32
|
+
id: 'tool-1',
|
|
33
|
+
name: 'skill_hub_execute',
|
|
34
|
+
messageId: 'msg-1',
|
|
35
|
+
},
|
|
36
|
+
toolCallResult: {
|
|
37
|
+
status: 'success',
|
|
38
|
+
content: { ok: true },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
currentConversation: {
|
|
42
|
+
sessionId: 'sub-session',
|
|
43
|
+
username: 'sub-agent',
|
|
44
|
+
from: 'sub-agent',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
return `answer:${task.question}`;
|
|
48
|
+
});
|
|
49
|
+
const dispatcher = { run: originalRun };
|
|
50
|
+
const repos: Record<string, unknown> = {
|
|
51
|
+
agentExecutionSpans: spanRepo,
|
|
52
|
+
agentHarnessProfiles: {
|
|
53
|
+
findOne: vi.fn(async () => (profileSettings ? { settings: profileSettings } : null)),
|
|
54
|
+
},
|
|
55
|
+
agentMemoryContexts: {
|
|
56
|
+
find: vi.fn(async () => []),
|
|
57
|
+
},
|
|
58
|
+
aiToolMessages: {
|
|
59
|
+
findOne: vi.fn(async () => ({
|
|
60
|
+
id: 10,
|
|
61
|
+
messageId: 20,
|
|
62
|
+
toolCallId: 'dispatch-call',
|
|
63
|
+
sessionId: 'parent-session',
|
|
64
|
+
})),
|
|
65
|
+
},
|
|
66
|
+
aiConversations: {
|
|
67
|
+
findOne: vi.fn(async ({ filter }) =>
|
|
68
|
+
filter?.sessionId === 'parent-session'
|
|
69
|
+
? { sessionId: 'parent-session', aiEmployeeUsername: 'leader', userId: 7 }
|
|
70
|
+
: null,
|
|
71
|
+
),
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const plugin = {
|
|
75
|
+
app: {
|
|
76
|
+
logger: {
|
|
77
|
+
info: vi.fn(),
|
|
78
|
+
warn: vi.fn(),
|
|
79
|
+
},
|
|
80
|
+
pm: {
|
|
81
|
+
get: vi.fn((name) => (name === 'ai' ? { subAgentsDispatcher: dispatcher } : null)),
|
|
82
|
+
getPlugins: vi.fn(() => new Map()),
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
db: {
|
|
86
|
+
getRepository: vi.fn((name) => repos[name]),
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return { plugin, dispatcher, originalRun, spanRepo, repos };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function createTask(getRepository?: (name: string) => unknown) {
|
|
94
|
+
return {
|
|
95
|
+
ctx: {
|
|
96
|
+
action: {
|
|
97
|
+
params: {
|
|
98
|
+
values: {
|
|
99
|
+
sessionId: 'parent-session',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
auth: {
|
|
104
|
+
user: { id: 7 },
|
|
105
|
+
},
|
|
106
|
+
db: {
|
|
107
|
+
getRepository: getRepository || vi.fn(),
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
sessionId: 'sub-session',
|
|
111
|
+
employee: { username: 'sub-agent' },
|
|
112
|
+
question: 'do the work',
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
describe('NativeSubAgentObserver', () => {
|
|
117
|
+
it('wraps dispatcher once and calls the original native run', async () => {
|
|
118
|
+
const { plugin, dispatcher, originalRun, spanRepo } = createObserverHarness();
|
|
119
|
+
const observer = new NativeSubAgentObserver(plugin);
|
|
120
|
+
|
|
121
|
+
expect(observer.install()).toBe(true);
|
|
122
|
+
expect(observer.install()).toBe(false);
|
|
123
|
+
|
|
124
|
+
const result = await dispatcher.run(createTask());
|
|
125
|
+
|
|
126
|
+
expect(result).toBe('answer:do the work');
|
|
127
|
+
expect(originalRun).toHaveBeenCalledTimes(1);
|
|
128
|
+
expect(spanRepo.create).toHaveBeenCalled();
|
|
129
|
+
expect(spanRepo.update).toHaveBeenCalled();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('restores the native dispatcher when uninstalled', async () => {
|
|
133
|
+
const { plugin, dispatcher, originalRun } = createObserverHarness();
|
|
134
|
+
const observer = new NativeSubAgentObserver(plugin);
|
|
135
|
+
|
|
136
|
+
observer.install();
|
|
137
|
+
expect(dispatcher.run).not.toBe(originalRun);
|
|
138
|
+
|
|
139
|
+
expect(observer.uninstall()).toBe(true);
|
|
140
|
+
await dispatcher.run(createTask());
|
|
141
|
+
expect(originalRun).toHaveBeenCalledTimes(1);
|
|
142
|
+
expect(observer.uninstall()).toBe(false);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('maps dispatch toolCallId from native sub-agent metadata by sub-session', async () => {
|
|
146
|
+
const { plugin, dispatcher, spanRepo, repos } = createObserverHarness();
|
|
147
|
+
repos.aiMessages = {
|
|
148
|
+
find: vi.fn(async () => [
|
|
149
|
+
{
|
|
150
|
+
messageId: 30,
|
|
151
|
+
metadata: {
|
|
152
|
+
subAgentConversations: [
|
|
153
|
+
{ sessionId: 'other-sub-session', toolCallId: 'other-dispatch-call', status: 'pending' },
|
|
154
|
+
{ sessionId: 'sub-session', toolCallId: 'metadata-dispatch-call', status: 'pending' },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
]),
|
|
159
|
+
};
|
|
160
|
+
repos.aiToolMessages = {
|
|
161
|
+
findOne: vi.fn(async ({ filter }) => ({
|
|
162
|
+
id: 11,
|
|
163
|
+
messageId: 30,
|
|
164
|
+
toolCallId: filter.toolCallId,
|
|
165
|
+
sessionId: filter.sessionId,
|
|
166
|
+
})),
|
|
167
|
+
};
|
|
168
|
+
const observer = new NativeSubAgentObserver(plugin);
|
|
169
|
+
observer.install();
|
|
170
|
+
|
|
171
|
+
await dispatcher.run(createTask(plugin.db.getRepository));
|
|
172
|
+
|
|
173
|
+
const rootSpanValues = spanRepo.create.mock.calls[0][0].values;
|
|
174
|
+
expect(rootSpanValues.toolCallId).toBe('metadata-dispatch-call');
|
|
175
|
+
expect(rootSpanValues.metadata.dispatchToolMessageId).toBe(11);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it('bypasses tracing and injection when policy disables the native observer', async () => {
|
|
179
|
+
const { plugin, dispatcher, originalRun, spanRepo } = createObserverHarness({ nativeObserverEnabled: false });
|
|
180
|
+
const observer = new NativeSubAgentObserver(plugin);
|
|
181
|
+
observer.install();
|
|
182
|
+
|
|
183
|
+
await dispatcher.run(createTask());
|
|
184
|
+
|
|
185
|
+
expect(originalRun).toHaveBeenCalledTimes(1);
|
|
186
|
+
expect(originalRun.mock.calls[0][0].question).toBe('do the work');
|
|
187
|
+
expect(spanRepo.create).not.toHaveBeenCalled();
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
describe('AgentMemoryContextService', () => {
|
|
192
|
+
it('builds context in public, user-memory, user, agent_user precedence', async () => {
|
|
193
|
+
const rows = [
|
|
194
|
+
{ scope: 'public', enabled: true, userId: null, aiEmployeeUsername: '', contentMd: 'Public fact' },
|
|
195
|
+
{ scope: 'user', enabled: true, userId: 7, aiEmployeeUsername: '', contentMd: 'User context' },
|
|
196
|
+
{ scope: 'agent_user', enabled: true, userId: 7, aiEmployeeUsername: 'sub-agent', contentMd: 'Private graph' },
|
|
197
|
+
{ scope: 'agent_user', enabled: true, userId: 8, aiEmployeeUsername: 'sub-agent', contentMd: 'Other private' },
|
|
198
|
+
];
|
|
199
|
+
const plugin = {
|
|
200
|
+
app: {
|
|
201
|
+
logger: { warn: vi.fn() },
|
|
202
|
+
pm: {
|
|
203
|
+
get: vi.fn((name) =>
|
|
204
|
+
name === 'plugin-user-memory'
|
|
205
|
+
? {
|
|
206
|
+
memoryInjector: {
|
|
207
|
+
getMemoryPromptSection: vi.fn(async () => '<user_memory>User profile</user_memory>'),
|
|
208
|
+
},
|
|
209
|
+
}
|
|
210
|
+
: null,
|
|
211
|
+
),
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
db: {
|
|
215
|
+
getRepository: vi.fn((name) => {
|
|
216
|
+
if (name === 'agentMemoryContexts') {
|
|
217
|
+
return {
|
|
218
|
+
find: vi.fn(async ({ filter }) =>
|
|
219
|
+
rows.filter(
|
|
220
|
+
(row) =>
|
|
221
|
+
row.scope === filter.scope &&
|
|
222
|
+
row.enabled === filter.enabled &&
|
|
223
|
+
(filter.userId === undefined || row.userId === filter.userId),
|
|
224
|
+
),
|
|
225
|
+
),
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
return null;
|
|
229
|
+
}),
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
const service = new AgentMemoryContextService(plugin);
|
|
233
|
+
|
|
234
|
+
const result = await service.buildContext({
|
|
235
|
+
userId: 7,
|
|
236
|
+
aiEmployeeUsername: 'sub-agent',
|
|
237
|
+
settings: { memoryScopes: ['public', 'user', 'agent_user'], maxMemoryContextChars: 10000 },
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
expect(result.appliedScopes).toEqual(['public', 'user-memory', 'user', 'agent_user']);
|
|
241
|
+
expect(result.context.indexOf('Public fact')).toBeLessThan(result.context.indexOf('<user_memory>'));
|
|
242
|
+
expect(result.context.indexOf('<user_memory>')).toBeLessThan(result.context.indexOf('User context'));
|
|
243
|
+
expect(result.context.indexOf('User context')).toBeLessThan(result.context.indexOf('Private graph'));
|
|
244
|
+
expect(result.context).not.toContain('Other private');
|
|
245
|
+
});
|
|
246
|
+
});
|
|
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest';
|
|
|
2
2
|
import { normalizeAIEmployeeSkillSettings } from '../utils/skill-settings';
|
|
3
3
|
|
|
4
4
|
describe('normalizeAIEmployeeSkillSettings', () => {
|
|
5
|
-
it('
|
|
5
|
+
it('removes retired orchestrator plan tool bindings from skills', () => {
|
|
6
6
|
const result = normalizeAIEmployeeSkillSettings({
|
|
7
7
|
skills: [{ name: 'orchestrator_plan_goal', autoCall: false }, 'crm-research'],
|
|
8
8
|
tools: [],
|
|
@@ -10,20 +10,20 @@ describe('normalizeAIEmployeeSkillSettings', () => {
|
|
|
10
10
|
|
|
11
11
|
expect(result.changed).toBe(true);
|
|
12
12
|
expect(result.skillSettings.skills).toEqual(['crm-research']);
|
|
13
|
-
expect(result.skillSettings.tools).toEqual([
|
|
13
|
+
expect(result.skillSettings.tools).toEqual([]);
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
it('
|
|
16
|
+
it('removes retired delegate tool names stored as skill strings', () => {
|
|
17
17
|
const result = normalizeAIEmployeeSkillSettings({
|
|
18
18
|
skills: ['delegate_lead_to_researcher', 'crm-research'],
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
expect(result.changed).toBe(true);
|
|
22
22
|
expect(result.skillSettings.skills).toEqual(['crm-research']);
|
|
23
|
-
expect(result.skillSettings.tools).toEqual([
|
|
23
|
+
expect(result.skillSettings.tools).toEqual([]);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
it('
|
|
26
|
+
it('removes retired dispatch tool bindings from current tools', () => {
|
|
27
27
|
const result = normalizeAIEmployeeSkillSettings({
|
|
28
28
|
skills: [{ name: 'dispatch_subagents_lead', autoCall: true }],
|
|
29
29
|
tools: [{ name: 'dispatch_subagents_lead', autoCall: false }],
|
|
@@ -31,7 +31,7 @@ describe('normalizeAIEmployeeSkillSettings', () => {
|
|
|
31
31
|
|
|
32
32
|
expect(result.changed).toBe(true);
|
|
33
33
|
expect(result.skillSettings.skills).toEqual([]);
|
|
34
|
-
expect(result.skillSettings.tools).toEqual([
|
|
34
|
+
expect(result.skillSettings.tools).toEqual([]);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
it('moves browser and drawio tools stored as skill strings to tools', () => {
|
|
@@ -28,6 +28,28 @@ export default defineCollection({
|
|
|
28
28
|
type: 'string',
|
|
29
29
|
length: 100,
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
name: 'source',
|
|
33
|
+
type: 'string',
|
|
34
|
+
length: 100,
|
|
35
|
+
comment: 'native-plugin-ai or legacy orchestrator source.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'parentSessionId',
|
|
39
|
+
type: 'uuid',
|
|
40
|
+
comment: 'Main AI conversation session id when this span comes from native plugin-ai.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'subSessionId',
|
|
44
|
+
type: 'uuid',
|
|
45
|
+
comment: 'Sub-agent AI conversation session id when this span comes from native plugin-ai.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'toolCallId',
|
|
49
|
+
type: 'string',
|
|
50
|
+
length: 200,
|
|
51
|
+
comment: 'Native AI tool call id associated with this span.',
|
|
52
|
+
},
|
|
31
53
|
{
|
|
32
54
|
name: 'type',
|
|
33
55
|
type: 'string',
|
|
@@ -143,11 +165,26 @@ export default defineCollection({
|
|
|
143
165
|
{
|
|
144
166
|
fields: ['parentSpanId'],
|
|
145
167
|
},
|
|
168
|
+
{
|
|
169
|
+
fields: ['source'],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
fields: ['parentSessionId'],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
fields: ['subSessionId'],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
fields: ['toolCallId'],
|
|
179
|
+
},
|
|
146
180
|
{
|
|
147
181
|
fields: ['type'],
|
|
148
182
|
},
|
|
149
183
|
{
|
|
150
184
|
fields: ['status'],
|
|
151
185
|
},
|
|
186
|
+
{
|
|
187
|
+
fields: ['userId'],
|
|
188
|
+
},
|
|
152
189
|
],
|
|
153
190
|
});
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { defineCollection } from '@nocobase/database';
|
|
2
|
-
|
|
3
|
-
export default defineCollection({
|
|
4
|
-
name: 'agentHarnessProfiles',
|
|
5
|
-
title: 'Agent Harness Profiles',
|
|
6
|
-
fields: [
|
|
7
|
-
{
|
|
8
|
-
name: 'id',
|
|
9
|
-
type: 'bigInt',
|
|
10
|
-
autoIncrement: true,
|
|
11
|
-
primaryKey: true,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'tag',
|
|
15
|
-
type: 'string',
|
|
16
|
-
length: 100,
|
|
17
|
-
allowNull: false,
|
|
18
|
-
unique: true,
|
|
19
|
-
comment: 'Stable
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'title',
|
|
23
|
-
type: 'string',
|
|
24
|
-
length: 200,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'description',
|
|
28
|
-
type: 'text',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'enabled',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
defaultValue: true,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'settings',
|
|
37
|
-
type: 'json',
|
|
38
|
-
defaultValue: {},
|
|
39
|
-
comment: '
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'createdAt',
|
|
43
|
-
type: 'date',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'updatedAt',
|
|
47
|
-
type: 'date',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
indexes: [
|
|
51
|
-
{
|
|
52
|
-
unique: true,
|
|
53
|
-
fields: ['tag'],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
fields: ['enabled'],
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
});
|
|
1
|
+
import { defineCollection } from '@nocobase/database';
|
|
2
|
+
|
|
3
|
+
export default defineCollection({
|
|
4
|
+
name: 'agentHarnessProfiles',
|
|
5
|
+
title: 'Agent Harness Profiles',
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: 'id',
|
|
9
|
+
type: 'bigInt',
|
|
10
|
+
autoIncrement: true,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'tag',
|
|
15
|
+
type: 'string',
|
|
16
|
+
length: 100,
|
|
17
|
+
allowNull: false,
|
|
18
|
+
unique: true,
|
|
19
|
+
comment: 'Stable policy profile tag used by native sub-agent observer and context injection.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'title',
|
|
23
|
+
type: 'string',
|
|
24
|
+
length: 200,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'description',
|
|
28
|
+
type: 'text',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'enabled',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
defaultValue: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'settings',
|
|
37
|
+
type: 'json',
|
|
38
|
+
defaultValue: {},
|
|
39
|
+
comment: 'Policy settings such as native observer enablement, memory scopes, and tracing retention.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'createdAt',
|
|
43
|
+
type: 'date',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'updatedAt',
|
|
47
|
+
type: 'date',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
indexes: [
|
|
51
|
+
{
|
|
52
|
+
unique: true,
|
|
53
|
+
fields: ['tag'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
fields: ['enabled'],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { defineCollection } from '@nocobase/database';
|
|
2
|
-
|
|
3
|
-
export default defineCollection({
|
|
4
|
-
name: 'agentLoopEvents',
|
|
5
|
-
title: 'Agent Loop Events',
|
|
6
|
-
fields: [
|
|
7
|
-
{
|
|
8
|
-
name: 'id',
|
|
9
|
-
type: 'bigInt',
|
|
10
|
-
autoIncrement: true,
|
|
11
|
-
primaryKey: true,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'run',
|
|
15
|
-
type: 'belongsTo',
|
|
16
|
-
target: 'agentLoopRuns',
|
|
17
|
-
foreignKey: 'runId',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'step',
|
|
21
|
-
type: 'belongsTo',
|
|
22
|
-
target: 'agentLoopSteps',
|
|
23
|
-
foreignKey: 'stepId',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'type',
|
|
27
|
-
type: 'string',
|
|
28
|
-
length: 80,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'title',
|
|
32
|
-
type: 'string',
|
|
33
|
-
length: 500,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'content',
|
|
37
|
-
type: 'text',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'status',
|
|
41
|
-
type: 'string',
|
|
42
|
-
length: 30,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'payload',
|
|
46
|
-
type: 'json',
|
|
47
|
-
defaultValue: {},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'user',
|
|
51
|
-
type: 'belongsTo',
|
|
52
|
-
target: 'users',
|
|
53
|
-
foreignKey: 'userId',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'createdAt',
|
|
57
|
-
type: 'date',
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
indexes: [
|
|
61
|
-
{
|
|
62
|
-
fields: ['runId'],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
fields: ['stepId'],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
fields: ['type'],
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
});
|
|
1
|
+
import { defineCollection } from '@nocobase/database';
|
|
2
|
+
|
|
3
|
+
export default defineCollection({
|
|
4
|
+
name: 'agentLoopEvents',
|
|
5
|
+
title: 'Agent Loop Events',
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: 'id',
|
|
9
|
+
type: 'bigInt',
|
|
10
|
+
autoIncrement: true,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'run',
|
|
15
|
+
type: 'belongsTo',
|
|
16
|
+
target: 'agentLoopRuns',
|
|
17
|
+
foreignKey: 'runId',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'step',
|
|
21
|
+
type: 'belongsTo',
|
|
22
|
+
target: 'agentLoopSteps',
|
|
23
|
+
foreignKey: 'stepId',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'type',
|
|
27
|
+
type: 'string',
|
|
28
|
+
length: 80,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'title',
|
|
32
|
+
type: 'string',
|
|
33
|
+
length: 500,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'content',
|
|
37
|
+
type: 'text',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'status',
|
|
41
|
+
type: 'string',
|
|
42
|
+
length: 30,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'payload',
|
|
46
|
+
type: 'json',
|
|
47
|
+
defaultValue: {},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'user',
|
|
51
|
+
type: 'belongsTo',
|
|
52
|
+
target: 'users',
|
|
53
|
+
foreignKey: 'userId',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'createdAt',
|
|
57
|
+
type: 'date',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
indexes: [
|
|
61
|
+
{
|
|
62
|
+
fields: ['runId'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
fields: ['stepId'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
fields: ['type'],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
});
|