@nocobase/app-plugin-agents 0.1.0-beta.1 → 0.1.0-beta.3
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/CHANGELOG.md +124 -0
- package/README.md +44 -12
- package/dist/client/api/client.d.ts +9 -2
- package/dist/client/api/client.d.ts.map +1 -1
- package/dist/client/api/client.js +15 -3
- package/dist/client/api/client.js.map +1 -1
- package/dist/client/chat/message-model.d.ts.map +1 -1
- package/dist/client/chat/message-model.js +10 -0
- package/dist/client/chat/message-model.js.map +1 -1
- package/dist/client/chat/settings-section.d.ts.map +1 -1
- package/dist/client/chat/settings-section.js +29 -19
- package/dist/client/chat/settings-section.js.map +1 -1
- package/dist/client/components/model-entries.d.ts +12 -3
- package/dist/client/components/model-entries.d.ts.map +1 -1
- package/dist/client/components/model-entries.js +41 -19
- package/dist/client/components/model-entries.js.map +1 -1
- package/dist/client/components/variables/variable-dialogs.d.ts +6 -1
- package/dist/client/components/variables/variable-dialogs.d.ts.map +1 -1
- package/dist/client/components/variables/variable-dialogs.js +27 -11
- package/dist/client/components/variables/variable-dialogs.js.map +1 -1
- package/dist/client/components/variables/variables-panel.d.ts.map +1 -1
- package/dist/client/components/variables/variables-panel.js +9 -2
- package/dist/client/components/variables/variables-panel.js.map +1 -1
- package/dist/client/lib/agents.d.ts +5 -0
- package/dist/client/lib/agents.d.ts.map +1 -1
- package/dist/client/lib/agents.js +23 -0
- package/dist/client/lib/agents.js.map +1 -1
- package/dist/client/lib/model-suggestions.d.ts +28 -0
- package/dist/client/lib/model-suggestions.d.ts.map +1 -0
- package/dist/client/lib/model-suggestions.js +44 -0
- package/dist/client/lib/model-suggestions.js.map +1 -0
- package/dist/client/locales/chat.en-US.d.ts +7 -0
- package/dist/client/locales/chat.en-US.d.ts.map +1 -1
- package/dist/client/locales/chat.en-US.js +8 -1
- package/dist/client/locales/chat.en-US.js.map +1 -1
- package/dist/client/locales/chat.zh-CN.d.ts.map +1 -1
- package/dist/client/locales/chat.zh-CN.js +8 -1
- package/dist/client/locales/chat.zh-CN.js.map +1 -1
- package/dist/client/locales/en-US.d.ts +20 -1
- package/dist/client/locales/en-US.d.ts.map +1 -1
- package/dist/client/locales/en-US.js +21 -1
- package/dist/client/locales/en-US.js.map +1 -1
- package/dist/client/locales/runWait.en-US.d.ts +31 -0
- package/dist/client/locales/runWait.en-US.d.ts.map +1 -0
- package/dist/client/locales/runWait.en-US.js +30 -0
- package/dist/client/locales/runWait.en-US.js.map +1 -0
- package/dist/client/locales/runWait.zh-CN.d.ts +5 -0
- package/dist/client/locales/runWait.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/runWait.zh-CN.js +25 -0
- package/dist/client/locales/runWait.zh-CN.js.map +1 -0
- package/dist/client/locales/runtimes.en-US.d.ts +6 -0
- package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
- package/dist/client/locales/runtimes.en-US.js +7 -1
- package/dist/client/locales/runtimes.en-US.js.map +1 -1
- package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -1
- package/dist/client/locales/runtimes.zh-CN.js +7 -1
- package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
- package/dist/client/locales/zh-CN.d.ts.map +1 -1
- package/dist/client/locales/zh-CN.js +21 -1
- package/dist/client/locales/zh-CN.js.map +1 -1
- package/dist/client/pages/agents/index.d.ts.map +1 -1
- package/dist/client/pages/agents/index.js +6 -6
- package/dist/client/pages/agents/index.js.map +1 -1
- package/dist/client/pages/runtimes/index.js +2 -2
- package/dist/client/pages/runtimes/index.js.map +1 -1
- package/dist/client/pages/runtimes/runner-sheet.js +11 -3
- package/dist/client/pages/runtimes/runner-sheet.js.map +1 -1
- package/dist/client/runs/format-wait.d.ts +21 -0
- package/dist/client/runs/format-wait.d.ts.map +1 -0
- package/dist/client/runs/format-wait.js +76 -0
- package/dist/client/runs/format-wait.js.map +1 -0
- package/dist/client/runs.d.ts +2 -0
- package/dist/client/runs.d.ts.map +1 -1
- package/dist/client/runs.js +2 -0
- package/dist/client/runs.js.map +1 -1
- package/dist/database/migrations/.manifest.json +20 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.d.ts +9 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.d.ts.map +1 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.js +28 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.js.map +1 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.d.ts +10 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.d.ts.map +1 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.js +105 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.js.map +1 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.d.ts +4 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.d.ts.map +1 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.js +17 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.js.map +1 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.d.ts +9 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.d.ts.map +1 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.js +22 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.js.map +1 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.d.ts +10 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.d.ts.map +1 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.js +36 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/server/composition.d.ts +12 -2
- package/dist/server/composition.d.ts.map +1 -1
- package/dist/server/composition.js +16 -3
- package/dist/server/composition.js.map +1 -1
- package/dist/server/core/agents/agent.service.d.ts.map +1 -1
- package/dist/server/core/agents/agent.service.js +4 -1
- package/dist/server/core/agents/agent.service.js.map +1 -1
- package/dist/server/core/consultations/consultation.service.d.ts.map +1 -1
- package/dist/server/core/consultations/consultation.service.js +5 -2
- package/dist/server/core/consultations/consultation.service.js.map +1 -1
- package/dist/server/core/conversations/availability.d.ts +10 -4
- package/dist/server/core/conversations/availability.d.ts.map +1 -1
- package/dist/server/core/conversations/availability.js +6 -20
- package/dist/server/core/conversations/availability.js.map +1 -1
- package/dist/server/core/conversations/chat-settings.d.ts +2 -2
- package/dist/server/core/conversations/chat-settings.d.ts.map +1 -1
- package/dist/server/core/conversations/chat-settings.js +19 -1
- package/dist/server/core/conversations/chat-settings.js.map +1 -1
- package/dist/server/core/conversations/conversation.service.d.ts +2 -1
- package/dist/server/core/conversations/conversation.service.d.ts.map +1 -1
- package/dist/server/core/conversations/conversation.service.js +255 -57
- package/dist/server/core/conversations/conversation.service.js.map +1 -1
- package/dist/server/core/runs/availability.d.ts +5 -2
- package/dist/server/core/runs/availability.d.ts.map +1 -1
- package/dist/server/core/runs/availability.js +17 -6
- package/dist/server/core/runs/availability.js.map +1 -1
- package/dist/server/core/runs/claim.d.ts +16 -2
- package/dist/server/core/runs/claim.d.ts.map +1 -1
- package/dist/server/core/runs/claim.js +220 -64
- package/dist/server/core/runs/claim.js.map +1 -1
- package/dist/server/core/runs/eligibility.d.ts +49 -0
- package/dist/server/core/runs/eligibility.d.ts.map +1 -0
- package/dist/server/core/runs/eligibility.js +44 -0
- package/dist/server/core/runs/eligibility.js.map +1 -0
- package/dist/server/core/runs/execution-view.d.ts +10 -0
- package/dist/server/core/runs/execution-view.d.ts.map +1 -0
- package/dist/server/core/runs/execution-view.js +25 -0
- package/dist/server/core/runs/execution-view.js.map +1 -0
- package/dist/server/core/runs/execution.d.ts +13 -0
- package/dist/server/core/runs/execution.d.ts.map +1 -0
- package/dist/server/core/runs/execution.js +85 -0
- package/dist/server/core/runs/execution.js.map +1 -0
- package/dist/server/core/runs/extensions.d.ts +2 -0
- package/dist/server/core/runs/extensions.d.ts.map +1 -1
- package/dist/server/core/runs/extensions.js.map +1 -1
- package/dist/server/core/runs/index.d.ts +6 -3
- package/dist/server/core/runs/index.d.ts.map +1 -1
- package/dist/server/core/runs/index.js +5 -2
- package/dist/server/core/runs/index.js.map +1 -1
- package/dist/server/core/runs/lifecycle.d.ts.map +1 -1
- package/dist/server/core/runs/lifecycle.js +29 -2
- package/dist/server/core/runs/lifecycle.js.map +1 -1
- package/dist/server/core/runs/ports.d.ts +20 -0
- package/dist/server/core/runs/ports.d.ts.map +1 -1
- package/dist/server/core/runs/ports.js.map +1 -1
- package/dist/server/core/runs/preview.d.ts.map +1 -1
- package/dist/server/core/runs/preview.js +2 -0
- package/dist/server/core/runs/preview.js.map +1 -1
- package/dist/server/core/runs/run-requests.d.ts +217 -0
- package/dist/server/core/runs/run-requests.d.ts.map +1 -0
- package/dist/server/core/runs/run-requests.js +471 -0
- package/dist/server/core/runs/run-requests.js.map +1 -0
- package/dist/server/core/runs/run.service.d.ts +63 -7
- package/dist/server/core/runs/run.service.d.ts.map +1 -1
- package/dist/server/core/runs/run.service.js +211 -37
- package/dist/server/core/runs/run.service.js.map +1 -1
- package/dist/server/core/runs/run.store.d.ts +14 -3
- package/dist/server/core/runs/run.store.d.ts.map +1 -1
- package/dist/server/core/runs/run.store.js +41 -2
- package/dist/server/core/runs/run.store.js.map +1 -1
- package/dist/server/core/runs/runner-view.d.ts +4 -3
- package/dist/server/core/runs/runner-view.d.ts.map +1 -1
- package/dist/server/core/runs/runner-view.js +7 -3
- package/dist/server/core/runs/runner-view.js.map +1 -1
- package/dist/server/core/runs/transitions.d.ts.map +1 -1
- package/dist/server/core/runs/transitions.js +4 -0
- package/dist/server/core/runs/transitions.js.map +1 -1
- package/dist/server/core/runs/workload.d.ts +1 -1
- package/dist/server/core/runs/workload.d.ts.map +1 -1
- package/dist/server/core/runs/workload.js +44 -13
- package/dist/server/core/runs/workload.js.map +1 -1
- package/dist/server/core/variables/index.d.ts +1 -1
- package/dist/server/core/variables/index.d.ts.map +1 -1
- package/dist/server/core/variables/index.js +1 -1
- package/dist/server/core/variables/index.js.map +1 -1
- package/dist/server/core/variables/variable.service.d.ts +38 -6
- package/dist/server/core/variables/variable.service.d.ts.map +1 -1
- package/dist/server/core/variables/variable.service.js +201 -30
- package/dist/server/core/variables/variable.service.js.map +1 -1
- package/dist/server/jobs/index.d.ts +1 -1
- package/dist/server/jobs/index.d.ts.map +1 -1
- package/dist/server/jobs/index.js +1 -1
- package/dist/server/jobs/index.js.map +1 -1
- package/dist/server/jobs/job.service.d.ts +2 -0
- package/dist/server/jobs/job.service.d.ts.map +1 -1
- package/dist/server/jobs/job.service.js +3 -1
- package/dist/server/jobs/job.service.js.map +1 -1
- package/dist/server/jobs/spec.d.ts +4 -0
- package/dist/server/jobs/spec.d.ts.map +1 -1
- package/dist/server/jobs/spec.js +6 -0
- package/dist/server/jobs/spec.js.map +1 -1
- package/dist/server/kernel/errors.d.ts +1 -1
- package/dist/server/kernel/errors.d.ts.map +1 -1
- package/dist/server/kernel/errors.js +1 -0
- package/dist/server/kernel/errors.js.map +1 -1
- package/dist/server/kernel/events.d.ts +28 -8
- package/dist/server/kernel/events.d.ts.map +1 -1
- package/dist/server/kernel/events.js.map +1 -1
- package/dist/server/routes/admin.d.ts.map +1 -1
- package/dist/server/routes/admin.js +38 -7
- package/dist/server/routes/admin.js.map +1 -1
- package/dist/server/routes/chat.d.ts.map +1 -1
- package/dist/server/routes/chat.js +9 -6
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +11 -1
- package/dist/server/routes/index.js.map +1 -1
- package/dist/server/routes/roster.d.ts.map +1 -1
- package/dist/server/routes/roster.js +2 -1
- package/dist/server/routes/roster.js.map +1 -1
- package/dist/server/routes/run-requests.d.ts +6 -0
- package/dist/server/routes/run-requests.d.ts.map +1 -0
- package/dist/server/routes/run-requests.js +216 -0
- package/dist/server/routes/run-requests.js.map +1 -0
- package/dist/server/routes/runners/admin.d.ts +9 -1
- package/dist/server/routes/runners/admin.d.ts.map +1 -1
- package/dist/server/routes/runners/admin.js +62 -24
- package/dist/server/routes/runners/admin.js.map +1 -1
- package/dist/server/routes/runners/runner.d.ts.map +1 -1
- package/dist/server/routes/runners/runner.js +21 -3
- package/dist/server/routes/runners/runner.js.map +1 -1
- package/dist/server/routes/schemas.d.ts +31 -3
- package/dist/server/routes/schemas.d.ts.map +1 -1
- package/dist/server/routes/schemas.js +233 -3
- package/dist/server/routes/schemas.js.map +1 -1
- package/dist/server/runners/index.d.ts +1 -0
- package/dist/server/runners/index.d.ts.map +1 -1
- package/dist/server/runners/index.js +1 -0
- package/dist/server/runners/index.js.map +1 -1
- package/dist/server/runners/runner.service.d.ts +10 -5
- package/dist/server/runners/runner.service.d.ts.map +1 -1
- package/dist/server/runners/runner.service.js +35 -10
- package/dist/server/runners/runner.service.js.map +1 -1
- package/dist/server/runners/runner.store.d.ts +7 -1
- package/dist/server/runners/runner.store.d.ts.map +1 -1
- package/dist/server/runners/runner.store.js +69 -4
- package/dist/server/runners/runner.store.js.map +1 -1
- package/dist/server/runners/sweeper.d.ts +5 -0
- package/dist/server/runners/sweeper.d.ts.map +1 -1
- package/dist/server/runners/sweeper.js +4 -2
- package/dist/server/runners/sweeper.js.map +1 -1
- package/dist/server/runners/workspaces.d.ts +30 -0
- package/dist/server/runners/workspaces.d.ts.map +1 -0
- package/dist/server/runners/workspaces.js +135 -0
- package/dist/server/runners/workspaces.js.map +1 -0
- package/dist/server/tokens.d.ts +4 -2
- package/dist/server/tokens.d.ts.map +1 -1
- package/dist/server/tokens.js +2 -0
- package/dist/server/tokens.js.map +1 -1
- package/dist/shared/agents.d.ts +2 -0
- package/dist/shared/agents.d.ts.map +1 -1
- package/dist/shared/agents.js.map +1 -1
- package/dist/shared/conversations.d.ts +48 -13
- package/dist/shared/conversations.d.ts.map +1 -1
- package/dist/shared/conversations.js +2 -2
- package/dist/shared/conversations.js.map +1 -1
- package/dist/shared/runners.d.ts +56 -5
- package/dist/shared/runners.d.ts.map +1 -1
- package/dist/shared/runners.js.map +1 -1
- package/dist/shared/runs.d.ts +145 -1
- package/dist/shared/runs.d.ts.map +1 -1
- package/dist/shared/runs.js +18 -0
- package/dist/shared/runs.js.map +1 -1
- package/dist/shared/variables.d.ts +22 -0
- package/dist/shared/variables.d.ts.map +1 -1
- package/dist/shared/variables.js +9 -1
- package/dist/shared/variables.js.map +1 -1
- package/package.json +8 -8
- package/skills/nocobase-app-plugin-agents/references/extension-points.md +4 -0
- package/skills/nocobase-app-plugin-agents/references/runners.md +9 -1
- package/skills/nocobase-app-plugin-agents/references/verification-and-troubleshooting.md +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a queued run waits, in words. The server sends a stable reason code and the values its words need
|
|
3
|
+
* (`RunWait.params`, `shared/runs.ts`) and never text; this words them with the caller's `t`, so the language follows
|
|
4
|
+
* the page. The texts are this plugin's (`runWait.reasons.<reason>` in its namespace), so an application overrides one
|
|
5
|
+
* in its own resources for that namespace, or adds one for a reason this version does not know, or formats waits
|
|
6
|
+
* itself. A reason with no text reads as `runWait.unknown`, naming the code.
|
|
7
|
+
*/
|
|
8
|
+
import { ACCESS_NAMESPACE } from '../../shared/access.js';
|
|
9
|
+
/** The reasons that need someone to act (an administrator, an agent's owner) rather than time. */
|
|
10
|
+
export const BLOCKING_RUN_WAIT_REASONS = [
|
|
11
|
+
'agentArchived',
|
|
12
|
+
'noRunnerOnline',
|
|
13
|
+
'runnersOffline',
|
|
14
|
+
'toolUnavailable',
|
|
15
|
+
'noSharedRunner',
|
|
16
|
+
'missingFeatures',
|
|
17
|
+
'secretsNotAllowed',
|
|
18
|
+
'setupRetrying',
|
|
19
|
+
];
|
|
20
|
+
/** Whether a wait needs someone to act rather than time; false for a reason this version does not know. */
|
|
21
|
+
export function runWaitBlocks(wait) {
|
|
22
|
+
return BLOCKING_RUN_WAIT_REASONS.includes(wait.reason);
|
|
23
|
+
}
|
|
24
|
+
/** The values a reason's text may name; each one the server did not send reads as `runWait.unknownValue`. */
|
|
25
|
+
const NAMES = [
|
|
26
|
+
'until',
|
|
27
|
+
'tool',
|
|
28
|
+
'features',
|
|
29
|
+
'variables',
|
|
30
|
+
'active',
|
|
31
|
+
'limit',
|
|
32
|
+
'used',
|
|
33
|
+
'runners',
|
|
34
|
+
'detail',
|
|
35
|
+
];
|
|
36
|
+
export function formatRunWait(t, wait, options = {}) {
|
|
37
|
+
const ns = ACCESS_NAMESPACE;
|
|
38
|
+
const unknownValue = t('runWait.unknownValue', { ns });
|
|
39
|
+
const given = {
|
|
40
|
+
...(wait.until ? { until: wait.until } : {}),
|
|
41
|
+
...(wait.tool ? { tool: wait.tool } : {}),
|
|
42
|
+
...(wait.missing && wait.missing.length > 0
|
|
43
|
+
? { features: wait.missing }
|
|
44
|
+
: {}),
|
|
45
|
+
...(wait.detail ? { detail: wait.detail } : {}),
|
|
46
|
+
...wait.params,
|
|
47
|
+
};
|
|
48
|
+
const values = { reason: wait.reason };
|
|
49
|
+
for (const name of NAMES)
|
|
50
|
+
values[name] = unknownValue;
|
|
51
|
+
for (const [name, value] of Object.entries(given)) {
|
|
52
|
+
if (Array.isArray(value)) {
|
|
53
|
+
if (value.length > 0)
|
|
54
|
+
values[name] = value.join(', ');
|
|
55
|
+
}
|
|
56
|
+
else if (name === 'until' && typeof value === 'string') {
|
|
57
|
+
const at = new Date(value);
|
|
58
|
+
values[name] = Number.isNaN(at.getTime())
|
|
59
|
+
? value
|
|
60
|
+
: new Intl.DateTimeFormat(options.locale, {
|
|
61
|
+
month: 'short',
|
|
62
|
+
day: 'numeric',
|
|
63
|
+
hour: '2-digit',
|
|
64
|
+
minute: '2-digit',
|
|
65
|
+
}).format(at);
|
|
66
|
+
}
|
|
67
|
+
else if (value !== '')
|
|
68
|
+
values[name] = value;
|
|
69
|
+
}
|
|
70
|
+
return t(`runWait.reasons.${wait.reason}`, {
|
|
71
|
+
ns,
|
|
72
|
+
...values,
|
|
73
|
+
defaultValue: t('runWait.unknown', { ns, reason: wait.reason }),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=format-wait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-wait.js","sourceRoot":"","sources":["../../../client/runs/format-wait.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAyB1D,kGAAkG;AAClG,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;CAChB,CAAC;AAEF,2GAA2G;AAC3G,MAAM,UAAU,aAAa,CAC3B,IAAwC;IAExC,OAAO,yBAAyB,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,6GAA6G;AAC7G,MAAM,KAAK,GAAG;IACZ,OAAO;IACP,MAAM;IACN,UAAU;IACV,WAAW;IACX,QAAQ;IACR,OAAO;IACP,MAAM;IACN,SAAS;IACT,QAAQ;CACA,CAAC;AAEX,MAAM,UAAU,aAAa,CAC3B,CAAmB,EACnB,IAAwB,EACxB,UAAgC,EAAE;IAElC,MAAM,EAAE,GAAG,gBAAgB,CAAC;IAC5B,MAAM,YAAY,GAAG,CAAC,CAAC,sBAAsB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACvD,MAAM,KAAK,GAAwD;QACjE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC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AAI,KAAK,KAAK,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,KAAwB,CAAC;IACnE,CAAC;IACD,OAAO,CAAC,CAAC,mBAAmB,IAAI,CAAC,MAAM,EAAE,EAAE;QACzC,EAAE;QACF,GAAG,MAAM;QACT,YAAY,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;KAChE,CAAC,CAAC;AACL,CAAC"}
|
package/dist/client/runs.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { useAgentNames, useSubjectRuns, type SubjectRun, } from './runs/subject-
|
|
|
8
8
|
export { useRetryRun, useRunBrief, useRunWithTranscript, useStopRun, useWorkspaceReset, type RunWithTranscript, } from './runs/run-hooks.js';
|
|
9
9
|
/** A run's transcript fetched incrementally (`fetchMore` after each `runTopic(runId)` announcement), for a chat UI's live steps. */
|
|
10
10
|
export { useRunEvents, type RunEventsState } from './runs/use-run-events.js';
|
|
11
|
+
/** Why a queued run waits, in words, from the reason and `params` the server sends; for queue and progress views. */
|
|
12
|
+
export { BLOCKING_RUN_WAIT_REASONS, formatRunWait, runWaitBlocks, type FormatRunWaitOptions, type RunWaitDescription, type RunWaitTranslate, } from './runs/format-wait.js';
|
|
11
13
|
export { useRealtimeTopic } from './hooks/use-realtime-topic.js';
|
|
12
14
|
export { useAgentsApi } from './hooks/use-agents-api.js';
|
|
13
15
|
export type { AgentsApi } from './api/client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../client/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,aAAa,EACb,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,oIAAoI;AACpI,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../client/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,aAAa,EACb,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,oIAAoI;AACpI,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC7E,qHAAqH;AACrH,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/client/runs.js
CHANGED
|
@@ -8,6 +8,8 @@ export { useAgentNames, useSubjectRuns, } from './runs/subject-runs.js';
|
|
|
8
8
|
export { useRetryRun, useRunBrief, useRunWithTranscript, useStopRun, useWorkspaceReset, } from './runs/run-hooks.js';
|
|
9
9
|
/** A run's transcript fetched incrementally (`fetchMore` after each `runTopic(runId)` announcement), for a chat UI's live steps. */
|
|
10
10
|
export { useRunEvents } from './runs/use-run-events.js';
|
|
11
|
+
/** Why a queued run waits, in words, from the reason and `params` the server sends; for queue and progress views. */
|
|
12
|
+
export { BLOCKING_RUN_WAIT_REASONS, formatRunWait, runWaitBlocks, } from './runs/format-wait.js';
|
|
11
13
|
export { useRealtimeTopic } from './hooks/use-realtime-topic.js';
|
|
12
14
|
export { useAgentsApi } from './hooks/use-agents-api.js';
|
|
13
15
|
//# sourceMappingURL=runs.js.map
|
package/dist/client/runs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../client/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,aAAa,EACb,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAE7B,oIAAoI;AACpI,OAAO,EAAE,YAAY,EAAuB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../client/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,aAAa,EACb,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAE7B,oIAAoI;AACpI,OAAO,EAAE,YAAY,EAAuB,MAAM,0BAA0B,CAAC;AAC7E,qHAAqH;AACrH,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,aAAa,GAId,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -52,6 +52,26 @@
|
|
|
52
52
|
"202610080001_ag_add_runner_tool_slots.js": {
|
|
53
53
|
"sourceChecksum": "a8756535826a31f9c16a1920165f64771d177e0a44325ed9a1ce16398d1d39af",
|
|
54
54
|
"artifactChecksum": "6862d2be26245128b49cfd568fc7cda3a0276307b5b1a225eabc1e2f1acef8e2"
|
|
55
|
+
},
|
|
56
|
+
"202610090001_ag_add_team_runner_variables.js": {
|
|
57
|
+
"sourceChecksum": "7141d9615c4fdfdc8f26a50addc6b948426dca073b3fd1a747bd06506ac053d8",
|
|
58
|
+
"artifactChecksum": "1ed9075f7dc96de790e5523975dd72556d8310eee6455932eee4b3b8c1d256d0"
|
|
59
|
+
},
|
|
60
|
+
"202610090002_ag_create_run_requests.js": {
|
|
61
|
+
"sourceChecksum": "d4d1a1beb0711d9112488e50de0bda384ea8854920118184811ac6656248b922",
|
|
62
|
+
"artifactChecksum": "3a64dcdeacb0016850ce4986eec2169b3c5af82442802e829aa36393f8e4a8f5"
|
|
63
|
+
},
|
|
64
|
+
"202610090003_ag_add_execution_history.js": {
|
|
65
|
+
"sourceChecksum": "f1665361aea1ac57b2482ca3f8682448e0a135f554dabd04bf811c5ea45c6964",
|
|
66
|
+
"artifactChecksum": "8da74e0928770c4c920337772fea13f3c3fa842844570cd092d61c19fe7abd28"
|
|
67
|
+
},
|
|
68
|
+
"202610090004_ag_add_runner_workspace_usage.js": {
|
|
69
|
+
"sourceChecksum": "b6d95353a19943b76caffe76f5a0896118ff1992ce9742953599f6d47e57a824",
|
|
70
|
+
"artifactChecksum": "c14ad9fad9baf3714074c553ee093b67e14aff4dc83cb0c5cae89998a9e35ffb"
|
|
71
|
+
},
|
|
72
|
+
"202610090005_ag_add_runner_variables.js": {
|
|
73
|
+
"sourceChecksum": "95e40f23ad719b90023b598ff337dec7885ecb0468557b41af5a571f95dabed4",
|
|
74
|
+
"artifactChecksum": "77a2501d8ac6194119422babfa6863143dbd9a534ca31a008e6fac6cc100d9ea"
|
|
55
75
|
}
|
|
56
76
|
}
|
|
57
77
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MigrationDefinition } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* Variables a run may hand only to a team runner (`agSecrets.teamRunnersOnly`, off for every existing variable), and,
|
|
4
|
+
* on a queued run a personal runner left for that reason, which of its variables asked for a team runner
|
|
5
|
+
* (`agRuns.teamOnlyVariables`, a JSON array of `{ scope, scopeId, name }`), so its wait can say so. Null otherwise.
|
|
6
|
+
*/
|
|
7
|
+
declare const migration: MigrationDefinition;
|
|
8
|
+
export default migration;
|
|
9
|
+
//# sourceMappingURL=202610090001_ag_add_team_runner_variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090001_ag_add_team_runner_variables.d.ts","sourceRoot":"","sources":["../../../database/migrations/202610090001_ag_add_team_runner_variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,QAAA,MAAM,SAAS,EAAE,mBAoBf,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineMigration, } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* Variables a run may hand only to a team runner (`agSecrets.teamRunnersOnly`, off for every existing variable), and,
|
|
4
|
+
* on a queued run a personal runner left for that reason, which of its variables asked for a team runner
|
|
5
|
+
* (`agRuns.teamOnlyVariables`, a JSON array of `{ scope, scopeId, name }`), so its wait can say so. Null otherwise.
|
|
6
|
+
*/
|
|
7
|
+
const migration = defineMigration({
|
|
8
|
+
name: '202610090001_ag_add_team_runner_variables',
|
|
9
|
+
async up({ builder }) {
|
|
10
|
+
await builder.alterCollection('agSecrets', (collection) => {
|
|
11
|
+
collection.boolean('teamRunnersOnly').notNull().defaultTo(false);
|
|
12
|
+
});
|
|
13
|
+
await builder.alterCollection('agRuns', (collection) => {
|
|
14
|
+
collection.json('teamOnlyVariables').nullable();
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
async down({ builder }) {
|
|
18
|
+
await builder.alterCollection('agRuns', (collection) => {
|
|
19
|
+
collection.dropField('teamOnlyVariables');
|
|
20
|
+
});
|
|
21
|
+
await builder.alterCollection('agSecrets', (collection) => {
|
|
22
|
+
collection.dropField('teamRunnersOnly');
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
export default migration;
|
|
27
|
+
//# sourceMappingURL=202610090001_ag_add_team_runner_variables.js.map
|
|
28
|
+
// @nocobase/task-manifest v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090001_ag_add_team_runner_variables.js","sourceRoot":"","sources":["../../../database/migrations/202610090001_ag_add_team_runner_variables.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,MAAM,SAAS,GAAwB,eAAe,CAAC;IACrD,IAAI,EAAE,2CAA2C;IAEjD,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,EAAoB;QACpC,MAAM,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;YACxD,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,EAAE;YACrD,UAAU,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAoB;QACtC,MAAM,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,EAAE;YACrD,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;YACxD,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MigrationDefinition } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* Run requests: work someone asked of an agent on a subject another person answers for. It waits for that person
|
|
4
|
+
* (the responsible) to confirm it before anything runs, keeping the input as it was when asked. Runs record who the
|
|
5
|
+
* chain of work they belong to started with (`requestedByUserId`) and who confirmed it (`confirmedByUserId`); runs
|
|
6
|
+
* queued before this migration were started by the person they run as.
|
|
7
|
+
*/
|
|
8
|
+
declare const migration: MigrationDefinition;
|
|
9
|
+
export default migration;
|
|
10
|
+
//# sourceMappingURL=202610090002_ag_create_run_requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090002_ag_create_run_requests.d.ts","sourceRoot":"","sources":["../../../database/migrations/202610090002_ag_create_run_requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAWtB;;;;;GAKG;AACH,QAAA,MAAM,SAAS,EAAE,mBA0Ff,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineMigration, } from '@nocobase/db';
|
|
2
|
+
const STATUSES = [
|
|
3
|
+
'pending',
|
|
4
|
+
'confirmed',
|
|
5
|
+
'rejected',
|
|
6
|
+
'withdrawn',
|
|
7
|
+
'expired',
|
|
8
|
+
'superseded',
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Run requests: work someone asked of an agent on a subject another person answers for. It waits for that person
|
|
12
|
+
* (the responsible) to confirm it before anything runs, keeping the input as it was when asked. Runs record who the
|
|
13
|
+
* chain of work they belong to started with (`requestedByUserId`) and who confirmed it (`confirmedByUserId`); runs
|
|
14
|
+
* queued before this migration were started by the person they run as.
|
|
15
|
+
*/
|
|
16
|
+
const migration = defineMigration({
|
|
17
|
+
name: '202610090002_ag_create_run_requests',
|
|
18
|
+
async up({ builder, query }) {
|
|
19
|
+
await builder.createCollection('agRunRequests', (collection) => {
|
|
20
|
+
collection.string('id', { length: 64 }).primary().notNull();
|
|
21
|
+
collection.string('agentId', { length: 64 }).notNull();
|
|
22
|
+
collection.string('subjectKind', { length: 32 }).notNull();
|
|
23
|
+
collection.string('subjectId', { length: 64 }).notNull();
|
|
24
|
+
collection.string('threadScope', { length: 64 }).notNull();
|
|
25
|
+
// Who answers for the subject (and confirms), and who the chain of work started with.
|
|
26
|
+
collection.string('responsibleUserId', { length: 64 }).notNull();
|
|
27
|
+
collection.string('requestedByUserId', { length: 64 }).notNull();
|
|
28
|
+
// What the run is queued with once confirmed.
|
|
29
|
+
collection.string('ownerUserId', { length: 64 }).nullable();
|
|
30
|
+
collection.integer('priority').notNull().defaultTo(0);
|
|
31
|
+
collection.json('requires').notNull().defaultTo([]);
|
|
32
|
+
// When the work was to be claimed at the earliest (`fireAt`), and how many attempts it may take; null for now and
|
|
33
|
+
// for the agent's default.
|
|
34
|
+
collection.datetimeTz('fireAt').nullable();
|
|
35
|
+
collection.integer('maxAttempts').nullable();
|
|
36
|
+
// The input as it was when asked: confirming runs exactly this, whatever happens to its source later.
|
|
37
|
+
collection.string('inputType', { length: 32 }).notNull();
|
|
38
|
+
collection.string('inputActorKind', { length: 16 }).notNull();
|
|
39
|
+
collection.string('inputActorId', { length: 64 }).notNull();
|
|
40
|
+
collection.string('inputActorName', { length: 200 }).notNull();
|
|
41
|
+
collection.text('inputText').notNull();
|
|
42
|
+
collection.json('inputPayload').nullable();
|
|
43
|
+
collection
|
|
44
|
+
.enum('status', { values: STATUSES })
|
|
45
|
+
.notNull()
|
|
46
|
+
.defaultTo('pending');
|
|
47
|
+
// Who settled it and when; null while pending (and for an expired one).
|
|
48
|
+
collection.string('settledById', { length: 64 }).nullable();
|
|
49
|
+
collection.datetimeTz('settledAt').nullable();
|
|
50
|
+
collection.text('note').nullable();
|
|
51
|
+
collection.datetimeTz('expiresAt').notNull();
|
|
52
|
+
// The run it went into: on confirming, or when the requester ran it as themselves.
|
|
53
|
+
collection.string('runId', { length: 64 }).nullable();
|
|
54
|
+
// The request that took over when the subject's responsible changed.
|
|
55
|
+
collection.string('supersededById', { length: 64 }).nullable();
|
|
56
|
+
collection.datetimeTz('createdAt').notNull();
|
|
57
|
+
collection.datetimeTz('updatedAt').notNull();
|
|
58
|
+
collection.index(['responsibleUserId', 'status'], {
|
|
59
|
+
name: 'ag_run_requests_responsible_idx',
|
|
60
|
+
});
|
|
61
|
+
collection.index(['requestedByUserId', 'status'], {
|
|
62
|
+
name: 'ag_run_requests_requested_by_idx',
|
|
63
|
+
});
|
|
64
|
+
collection.index(['subjectKind', 'subjectId', 'status'], {
|
|
65
|
+
name: 'ag_run_requests_subject_idx',
|
|
66
|
+
});
|
|
67
|
+
collection.index(['status', 'expiresAt'], {
|
|
68
|
+
name: 'ag_run_requests_expiry_idx',
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
await builder.alterCollection('agRuns', (collection) => {
|
|
72
|
+
// Who the chain of work started with; left nullable so the backfill below can fill existing rows.
|
|
73
|
+
collection.string('requestedByUserId', { length: 64 }).nullable();
|
|
74
|
+
// Who confirmed the run request the run was queued from; null for work its actor started.
|
|
75
|
+
collection.string('confirmedByUserId', { length: 64 }).nullable();
|
|
76
|
+
});
|
|
77
|
+
// Every existing run was started by the person it runs as. One statement per such person keeps the backfill set
|
|
78
|
+
// based, since an update cannot copy one column into another through `query`.
|
|
79
|
+
const actors = await query
|
|
80
|
+
.selectFrom('agRuns')
|
|
81
|
+
.select('actorUserId')
|
|
82
|
+
.distinct()
|
|
83
|
+
.where('requestedByUserId', 'is', null)
|
|
84
|
+
.execute();
|
|
85
|
+
for (const row of actors) {
|
|
86
|
+
const actorUserId = String(row.actorUserId);
|
|
87
|
+
await query
|
|
88
|
+
.updateTable('agRuns')
|
|
89
|
+
.set({ requestedByUserId: actorUserId })
|
|
90
|
+
.where('actorUserId', '=', actorUserId)
|
|
91
|
+
.where('requestedByUserId', 'is', null)
|
|
92
|
+
.execute();
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
async down({ builder }) {
|
|
96
|
+
await builder.alterCollection('agRuns', (collection) => {
|
|
97
|
+
collection.dropField('confirmedByUserId');
|
|
98
|
+
collection.dropField('requestedByUserId');
|
|
99
|
+
});
|
|
100
|
+
await builder.dropCollection('agRunRequests');
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
export default migration;
|
|
104
|
+
//# sourceMappingURL=202610090002_ag_create_run_requests.js.map
|
|
105
|
+
// @nocobase/task-manifest v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090002_ag_create_run_requests.js","sourceRoot":"","sources":["../../../database/migrations/202610090002_ag_create_run_requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,MAAM,QAAQ,GAAG;IACf,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;IACX,SAAS;IACT,YAAY;CACb,CAAC;AAEF;;;;;GAKG;AACH,MAAM,SAAS,GAAwB,eAAe,CAAC;IACrD,IAAI,EAAE,qCAAqC;IAE3C,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAoB;QAC3C,MAAM,OAAO,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,EAAE;YAC7D,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;YAC5D,UAAU,CAAC,MAAM,CAAC,SAAS,EA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BACrB,GAAG,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAC;iBACvC,KAAK,CAAC,aAAa,EAAE,GAAG,EAAE,WAAW,CAAC;iBACtC,KAAK,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,CAAC;iBACtC,OAAO,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAoB;QACtC,MAAM,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,EAAE;YACrD,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;YAC1C,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090003_ag_add_execution_history.d.ts","sourceRoot":"","sources":["../../../database/migrations/202610090003_ag_add_execution_history.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB,QAAA,MAAM,SAAS,EAAE,mBAYf,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineMigration, } from '@nocobase/db';
|
|
2
|
+
const migration = defineMigration({
|
|
3
|
+
name: '202610090003_ag_add_execution_history',
|
|
4
|
+
async up({ builder }) {
|
|
5
|
+
await builder.alterCollection('agRuns', (collection) => {
|
|
6
|
+
collection.json('executionHistory').nullable();
|
|
7
|
+
});
|
|
8
|
+
},
|
|
9
|
+
async down({ builder }) {
|
|
10
|
+
await builder.alterCollection('agRuns', (collection) => {
|
|
11
|
+
collection.dropField('executionHistory');
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export default migration;
|
|
16
|
+
//# sourceMappingURL=202610090003_ag_add_execution_history.js.map
|
|
17
|
+
// @nocobase/task-manifest v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090003_ag_add_execution_history.js","sourceRoot":"","sources":["../../../database/migrations/202610090003_ag_add_execution_history.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAwB,eAAe,CAAC;IACrD,IAAI,EAAE,uCAAuC;IAC7C,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,EAAoB;QACpC,MAAM,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,EAAE;YACrD,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAoB;QACtC,MAAM,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,EAAE;YACrD,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MigrationDefinition } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* The working directories a runner last reported for this application and the disk they take (`workspaceUsage`): the
|
|
4
|
+
* totals, the owner's limit and each directory with its subject and whether its work is over. Null until the runner
|
|
5
|
+
* reports.
|
|
6
|
+
*/
|
|
7
|
+
declare const migration: MigrationDefinition;
|
|
8
|
+
export default migration;
|
|
9
|
+
//# sourceMappingURL=202610090004_ag_add_runner_workspace_usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090004_ag_add_runner_workspace_usage.d.ts","sourceRoot":"","sources":["../../../database/migrations/202610090004_ag_add_runner_workspace_usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,QAAA,MAAM,SAAS,EAAE,mBAcf,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineMigration, } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* The working directories a runner last reported for this application and the disk they take (`workspaceUsage`): the
|
|
4
|
+
* totals, the owner's limit and each directory with its subject and whether its work is over. Null until the runner
|
|
5
|
+
* reports.
|
|
6
|
+
*/
|
|
7
|
+
const migration = defineMigration({
|
|
8
|
+
name: '202610090004_ag_add_runner_workspace_usage',
|
|
9
|
+
async up({ builder }) {
|
|
10
|
+
await builder.alterCollection('agRunners', (collection) => {
|
|
11
|
+
collection.json('workspaceUsage').nullable();
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
async down({ builder }) {
|
|
15
|
+
await builder.alterCollection('agRunners', (collection) => {
|
|
16
|
+
collection.dropField('workspaceUsage');
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export default migration;
|
|
21
|
+
//# sourceMappingURL=202610090004_ag_add_runner_workspace_usage.js.map
|
|
22
|
+
// @nocobase/task-manifest v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090004_ag_add_runner_workspace_usage.js","sourceRoot":"","sources":["../../../database/migrations/202610090004_ag_add_runner_workspace_usage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,MAAM,SAAS,GAAwB,eAAe,CAAC;IACrD,IAAI,EAAE,4CAA4C;IAElD,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,EAAoB;QACpC,MAAM,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;YACxD,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAoB;QACtC,MAAM,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;YACxD,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MigrationDefinition } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* Variables a run takes from the runner (`agRunnerVariables`): a name only, set on an agent, a working directory or a
|
|
4
|
+
* scope the application registers like a variable with a value, and handed to the runner as a name it provides from its
|
|
5
|
+
* own configuration (`RunWorkspace.passthrough`). And the names a runner last reported it provides (`agRunners.variables`,
|
|
6
|
+
* a JSON array of names), null for a runner that reported none.
|
|
7
|
+
*/
|
|
8
|
+
declare const migration: MigrationDefinition;
|
|
9
|
+
export default migration;
|
|
10
|
+
//# sourceMappingURL=202610090005_ag_add_runner_variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090005_ag_add_runner_variables.d.ts","sourceRoot":"","sources":["../../../database/migrations/202610090005_ag_add_runner_variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,QAAA,MAAM,SAAS,EAAE,mBA2Bf,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineMigration, } from '@nocobase/db';
|
|
2
|
+
/**
|
|
3
|
+
* Variables a run takes from the runner (`agRunnerVariables`): a name only, set on an agent, a working directory or a
|
|
4
|
+
* scope the application registers like a variable with a value, and handed to the runner as a name it provides from its
|
|
5
|
+
* own configuration (`RunWorkspace.passthrough`). And the names a runner last reported it provides (`agRunners.variables`,
|
|
6
|
+
* a JSON array of names), null for a runner that reported none.
|
|
7
|
+
*/
|
|
8
|
+
const migration = defineMigration({
|
|
9
|
+
name: '202610090005_ag_add_runner_variables',
|
|
10
|
+
async up({ builder }) {
|
|
11
|
+
await builder.createCollection('agRunnerVariables', (collection) => {
|
|
12
|
+
collection.string('id', { length: 64 }).primary().notNull();
|
|
13
|
+
// agent | workdir | a registered scope key, as on agSecrets.
|
|
14
|
+
collection.string('scope', { length: 32 }).notNull();
|
|
15
|
+
collection.string('scopeId', { length: 64 }).notNull();
|
|
16
|
+
collection.string('name', { length: 128 }).notNull();
|
|
17
|
+
collection.string('createdById', { length: 64 }).nullable();
|
|
18
|
+
collection.string('updatedById', { length: 64 }).nullable();
|
|
19
|
+
collection.datetimeTz('createdAt').notNull();
|
|
20
|
+
collection.datetimeTz('updatedAt').notNull();
|
|
21
|
+
collection.unique(['scope', 'scopeId', 'name']);
|
|
22
|
+
});
|
|
23
|
+
await builder.alterCollection('agRunners', (collection) => {
|
|
24
|
+
collection.json('variables').nullable();
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
async down({ builder }) {
|
|
28
|
+
await builder.alterCollection('agRunners', (collection) => {
|
|
29
|
+
collection.dropField('variables');
|
|
30
|
+
});
|
|
31
|
+
await builder.dropCollection('agRunnerVariables');
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export default migration;
|
|
35
|
+
//# sourceMappingURL=202610090005_ag_add_runner_variables.js.map
|
|
36
|
+
// @nocobase/task-manifest v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202610090005_ag_add_runner_variables.js","sourceRoot":"","sources":["../../../database/migrations/202610090005_ag_add_runner_variables.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,SAAS,GAA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L,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAoB;QACtC,MAAM,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;YACxD,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@nocobase/app-plugin-agents",
|
|
3
3
|
"displayName": "Agents",
|
|
4
4
|
"description": "Agents for NocoBase applications: agents, the model services online agents call, their runs and conversations, and the runners people connect to run them (registration, the long-poll claim, slots, the sweeper, build jobs, and the runner and CLI tarballs the application serves).",
|
|
5
|
-
"version": "0.1.0-beta.
|
|
5
|
+
"version": "0.1.0-beta.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"prettier": "@nocobase/dev-config/prettier",
|
|
8
8
|
"engines": {
|
|
@@ -21,7 +21,7 @@ import { type AgentsEventBus } from './kernel/events.js';
|
|
|
21
21
|
import { type People } from './kernel/people.js';
|
|
22
22
|
import { type ScopeKindRegistry } from './kernel/scopes.js';
|
|
23
23
|
import { type TxRunner } from './kernel/tx.js';
|
|
24
|
-
import { type RunnerService, type RunnerSweeper, type Slots, type WorkSignal } from './runners/index.js';
|
|
24
|
+
import { type RunnerService, type RunnerSweeper, type RunnerWorkspaces, type Slots, type WorkSignal } from './runners/index.js';
|
|
25
25
|
import { type AgentActionCatalog, type AgentService } from './core/agents/index.js';
|
|
26
26
|
import { type ChatAttachmentService, type ChatFileStorage, type ChatSettingsService, type ConversationService } from './core/conversations/index.js';
|
|
27
27
|
import { type ConsultationService } from './core/consultations/index.js';
|
|
@@ -32,7 +32,7 @@ import { type SkillDisk, type SkillService } from './core/skills/index.js';
|
|
|
32
32
|
import { type VariableService } from './core/variables/index.js';
|
|
33
33
|
import { type ModelGateway, type ModelServices, type ServerExecutor, type CommandSurface, type OnlineSkill, type ServerExecutorOptions } from './online/index.js';
|
|
34
34
|
import { type Vectors, type VectorsConfig } from './vectors/index.js';
|
|
35
|
-
import { type AgentCli, type Availability, type BriefPreviewer, type ClaimService, type RunnerReports, type RepoAccessRegistry, type RunMountRegistry, type RunnerView, type RunService, type SubjectRegistry } from './core/runs/index.js';
|
|
35
|
+
import { type AgentCli, type Availability, type BriefPreviewer, type ClaimEligibility, type ClaimService, type RunnerReports, type RepoAccessRegistry, type RunMountRegistry, type RunnerView, type RunService, type SubjectRegistry } from './core/runs/index.js';
|
|
36
36
|
export interface AgentsDeps {
|
|
37
37
|
readonly database: Pick<DatabaseManager, 'transaction' | 'connection'>;
|
|
38
38
|
readonly idGenerator: {
|
|
@@ -94,6 +94,11 @@ export interface Agents {
|
|
|
94
94
|
* its model), and how many of its runs have not finished.
|
|
95
95
|
*/
|
|
96
96
|
readonly availability: Availability;
|
|
97
|
+
/**
|
|
98
|
+
* Whether a runner would actually take an agent's work done as a person, by the claim's rules: trust, features and
|
|
99
|
+
* whether it may receive the work's variables. For deciding before a run exists; call it outside a transaction.
|
|
100
|
+
*/
|
|
101
|
+
readonly eligibility: ClaimEligibility;
|
|
97
102
|
/** Who runners register with: the application's id and name. */
|
|
98
103
|
readonly app: RunApp;
|
|
99
104
|
/** The application's CLI (`agents.cli`, resolved): what runs talk to it with and what the install script installs. */
|
|
@@ -102,6 +107,11 @@ export interface Agents {
|
|
|
102
107
|
readonly runners: RunnerService;
|
|
103
108
|
/** Which agents each runner may run and which runs one holds, for the runtimes pages. */
|
|
104
109
|
readonly runnerView: RunnerView;
|
|
110
|
+
/**
|
|
111
|
+
* The working directories runners report: which may go because their subject's work is over, and the disk they
|
|
112
|
+
* take, kept for the runtimes pages.
|
|
113
|
+
*/
|
|
114
|
+
readonly workspaces: RunnerWorkspaces;
|
|
105
115
|
/**
|
|
106
116
|
* Jobs: deterministic steps runners execute without a model (a build), of the kinds the application registers; used
|
|
107
117
|
* by the off-by-default runner build method.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../server/composition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../server/composition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,mBAAmB,CA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