@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
package/dist/shared/runs.d.ts
CHANGED
|
@@ -2,10 +2,46 @@
|
|
|
2
2
|
* Runs as the browser and the server's admin API exchange them.
|
|
3
3
|
*/
|
|
4
4
|
import type { ActorKind, AgentTool, FailureReason, RunEvent, RunEventType, RunInputType, RunnerFeature, RunStatus } from '@nocobase/agent-protocol';
|
|
5
|
+
import type { VariableRef } from './variables.js';
|
|
5
6
|
/** The run subject kind of a consultation: an online agent asking another a question (`ask_agent`). */
|
|
6
7
|
export declare const CONSULTATION_SUBJECT = "consultation";
|
|
7
8
|
/** How deep consultations go: the agent asked may ask another, which may not ask further. */
|
|
8
9
|
export declare const CONSULT_MAX_DEPTH = 2;
|
|
10
|
+
/** Execution facts captured at claim time, retained even after a retry releases its holder. */
|
|
11
|
+
export interface RunEffortReport {
|
|
12
|
+
readonly effort: string | null;
|
|
13
|
+
/** The tool response that reported the value, never the requested configuration. */
|
|
14
|
+
readonly source: string;
|
|
15
|
+
readonly at: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RunExecutionSnapshot {
|
|
18
|
+
readonly attempt: number;
|
|
19
|
+
readonly runnerId: string;
|
|
20
|
+
readonly runnerName: string | null;
|
|
21
|
+
readonly runnerOwnerUserId: string | null;
|
|
22
|
+
readonly runnerOwnerName: string | null;
|
|
23
|
+
readonly runnerTrust: 'team' | 'ownerOnly' | null;
|
|
24
|
+
readonly tool: string | null;
|
|
25
|
+
readonly toolVersion: string | null;
|
|
26
|
+
readonly modelService: string | null;
|
|
27
|
+
/** Requested model; null means the tool's default. */
|
|
28
|
+
readonly model: string | null;
|
|
29
|
+
/** Models reported by this attempt's primary tool, excluding other tools' usage. */
|
|
30
|
+
readonly actualModels: readonly string[];
|
|
31
|
+
/** Requested effort, never evidence of what the tool used. */
|
|
32
|
+
readonly effort: string | null;
|
|
33
|
+
readonly effortReports?: readonly RunEffortReport[];
|
|
34
|
+
/** Latest accepted observation, including repeats; distinct from the value/source change time. */
|
|
35
|
+
readonly actualEffortObservedAt?: string;
|
|
36
|
+
readonly actualEffort?: string | null;
|
|
37
|
+
readonly actualEffortSource?: string | null;
|
|
38
|
+
readonly actualEffortAt?: string | null;
|
|
39
|
+
/** Machine fields were removed for this reader. */
|
|
40
|
+
readonly machineHidden?: boolean;
|
|
41
|
+
readonly dispatchedAt: string;
|
|
42
|
+
readonly finishedAt: string | null;
|
|
43
|
+
readonly failureReason: string | null;
|
|
44
|
+
}
|
|
9
45
|
export interface Run {
|
|
10
46
|
readonly id: string;
|
|
11
47
|
readonly agentId: string;
|
|
@@ -13,6 +49,18 @@ export interface Run {
|
|
|
13
49
|
readonly agentType: 'online' | 'runner';
|
|
14
50
|
/** The runner holding it; `server:<instance>` for an online run held by an application instance. */
|
|
15
51
|
readonly runnerId: string | null;
|
|
52
|
+
/** Claim snapshots, oldest first. Absent on responses from older servers. */
|
|
53
|
+
readonly executions?: readonly RunExecutionSnapshot[];
|
|
54
|
+
/** The latest attempt's runner, including while queued again. Null when no snapshot exists. */
|
|
55
|
+
readonly runnerName?: string | null;
|
|
56
|
+
readonly runnerOwnerUserId?: string | null;
|
|
57
|
+
readonly runnerOwnerName?: string | null;
|
|
58
|
+
readonly toolVersion?: string | null;
|
|
59
|
+
readonly actualModels?: readonly string[];
|
|
60
|
+
readonly actualEffort?: string | null;
|
|
61
|
+
readonly actualEffortSource?: string | null;
|
|
62
|
+
readonly actualEffortAt?: string | null;
|
|
63
|
+
readonly machineHidden?: boolean;
|
|
16
64
|
/**
|
|
17
65
|
* The entry of the agent's list it works with (`AgentModelEntry`): a runner run's coding tool and model (null: the
|
|
18
66
|
* tool's default), set when a runner claims it; an online run's model service and model, set when it is claimed (a
|
|
@@ -38,7 +86,15 @@ export interface Run {
|
|
|
38
86
|
readonly id: string;
|
|
39
87
|
};
|
|
40
88
|
readonly threadScope: string;
|
|
89
|
+
/** The person the run acts as: their permissions bound it, and only their own runners (or team runners) take it. */
|
|
41
90
|
readonly actorUserId: string;
|
|
91
|
+
/**
|
|
92
|
+
* Who the chain of work the run belongs to started with: the person whose action woke the agent, or for work a run
|
|
93
|
+
* caused, that run's source. The actor when they started it themselves.
|
|
94
|
+
*/
|
|
95
|
+
readonly requestedByUserId: string;
|
|
96
|
+
/** Who confirmed the run request the run was queued from (`RunRequest`); null for work its actor started. */
|
|
97
|
+
readonly confirmedByUserId: string | null;
|
|
42
98
|
readonly ownerUserId: string | null;
|
|
43
99
|
readonly requires: readonly RunnerFeature[];
|
|
44
100
|
readonly acceptsInput: boolean;
|
|
@@ -123,6 +179,8 @@ export interface RunEventPage {
|
|
|
123
179
|
* signed in.
|
|
124
180
|
* - `noSharedRunner`: only personal runners could take it, and none belongs to the person who woke the agent.
|
|
125
181
|
* - `missingFeatures`: the runners that could take it lack what it needs (`missing`).
|
|
182
|
+
* - `secretsNotAllowed`: some of its variables are for team runners only (`variables` names them), and the runners
|
|
183
|
+
* that could take it are personal ones.
|
|
126
184
|
* - `sameWorkActive`: the agent is already working on the same subject and thread; this run follows.
|
|
127
185
|
* - `concurrencyFull`: the agent has as many runs held as it may have at once.
|
|
128
186
|
* - `runnersBusy`: every runner that could take it has its slots full (the machine's slots).
|
|
@@ -131,8 +189,22 @@ export interface RunEventPage {
|
|
|
131
189
|
* - `setupRetrying`: preparing it failed and is tried again (`detail` says why).
|
|
132
190
|
* - `next`: nothing holds it; the next free runner that asks takes it.
|
|
133
191
|
*/
|
|
134
|
-
export declare const RUN_WAIT_REASONS: readonly ["agentArchived", "delayed", "noRunnerOnline", "runnersOffline", "toolUnavailable", "noSharedRunner", "missingFeatures", "sameWorkActive", "concurrencyFull", "runnersBusy", "toolSlotsFull", "setupRetrying", "next"];
|
|
192
|
+
export declare const RUN_WAIT_REASONS: readonly ["agentArchived", "delayed", "noRunnerOnline", "runnersOffline", "toolUnavailable", "noSharedRunner", "missingFeatures", "secretsNotAllowed", "sameWorkActive", "concurrencyFull", "runnersBusy", "toolSlotsFull", "setupRetrying", "next"];
|
|
135
193
|
export type RunWaitReason = (typeof RUN_WAIT_REASONS)[number];
|
|
194
|
+
/**
|
|
195
|
+
* What a wait's words need, by reason: the server sends codes and these, never text, and the client words them
|
|
196
|
+
* (`formatRunWait` in `client/runs.ts`, or the application's own). Absent for a reason that needs nothing.
|
|
197
|
+
*
|
|
198
|
+
* - `delayed`: `until` (RFC 3339).
|
|
199
|
+
* - `toolUnavailable`: `tool`, the agent's default coding tool.
|
|
200
|
+
* - `missingFeatures`: `features`, what no fitting runner has.
|
|
201
|
+
* - `secretsNotAllowed`: `variables`, the names of the variables for team runners only.
|
|
202
|
+
* - `concurrencyFull`: `active`, `limit`, the agent's runs held and its limit.
|
|
203
|
+
* - `runnersBusy`: `runners`, how many fitting runners have their slots full.
|
|
204
|
+
* - `toolSlotsFull`: `tool`, `used`, `limit`, that tool's runs and limit on the fitting runner closest to room.
|
|
205
|
+
* - `setupRetrying`: `detail`, why preparing it failed.
|
|
206
|
+
*/
|
|
207
|
+
export type RunWaitParams = Readonly<Record<string, string | number | readonly string[]>>;
|
|
136
208
|
/** Where a queued run stands and what holds it. */
|
|
137
209
|
export interface RunWait {
|
|
138
210
|
readonly reason: RunWaitReason;
|
|
@@ -151,6 +223,10 @@ export interface RunWait {
|
|
|
151
223
|
readonly missing: readonly RunnerFeature[];
|
|
152
224
|
/** For `setupRetrying`: why preparing it failed. */
|
|
153
225
|
readonly detail: string | null;
|
|
226
|
+
/** For `secretsNotAllowed`: the variables that ask for a team runner, by scope; absent when not provided. */
|
|
227
|
+
readonly variables?: readonly VariableRef[];
|
|
228
|
+
/** What its words need (`RunWaitParams`); absent when nothing, or from a server before they were sent. */
|
|
229
|
+
readonly params?: RunWaitParams;
|
|
154
230
|
}
|
|
155
231
|
/** The newest thing a held run reported, for a one-line "last activity". */
|
|
156
232
|
export interface RunActivity {
|
|
@@ -202,4 +278,72 @@ export interface WorkloadQuery {
|
|
|
202
278
|
/** At most this many runs (200 by default, at most 1000). */
|
|
203
279
|
readonly limit?: number;
|
|
204
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* What a run request can be: `pending` until the responsible confirms it (`confirmed`, queued as them) or rejects it
|
|
283
|
+
* (`rejected`), the requester withdraws it (`withdrawn`, also when they run it as themselves), it is handed to a new
|
|
284
|
+
* responsible (`superseded`), or nobody settles it in time (`expired`). Only a pending request changes.
|
|
285
|
+
*/
|
|
286
|
+
export declare const RUN_REQUEST_STATUSES: readonly ["pending", "confirmed", "rejected", "withdrawn", "expired", "superseded"];
|
|
287
|
+
export type RunRequestStatus = (typeof RUN_REQUEST_STATUSES)[number];
|
|
288
|
+
/** How work someone asks of an agent is run (`EnqueueRequest.execution`). */
|
|
289
|
+
export declare const RUN_EXECUTIONS: readonly ["auto", "mine"];
|
|
290
|
+
/**
|
|
291
|
+
* `auto`: as the subject's responsible, once they confirm it when someone else asked; `mine`: as the person who asked,
|
|
292
|
+
* at once, on a runner they may use (their own, or a team runner).
|
|
293
|
+
*/
|
|
294
|
+
export type RunExecution = (typeof RUN_EXECUTIONS)[number];
|
|
295
|
+
/** The input of a run request, as it was when asked: what confirming it runs. */
|
|
296
|
+
export interface RunRequestInput {
|
|
297
|
+
readonly type: RunInputType;
|
|
298
|
+
readonly actor: {
|
|
299
|
+
readonly kind: ActorKind;
|
|
300
|
+
readonly id: string;
|
|
301
|
+
readonly name: string;
|
|
302
|
+
};
|
|
303
|
+
readonly text: string;
|
|
304
|
+
readonly payload: unknown;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Work someone asked of an agent on a subject another person answers for (its responsible: an issue's owner, say). It
|
|
308
|
+
* runs only once the responsible confirms it, as them, or when the person who asked runs it as themselves.
|
|
309
|
+
*/
|
|
310
|
+
export interface RunRequest {
|
|
311
|
+
readonly id: string;
|
|
312
|
+
readonly agentId: string;
|
|
313
|
+
readonly subject: {
|
|
314
|
+
readonly kind: string;
|
|
315
|
+
readonly id: string;
|
|
316
|
+
};
|
|
317
|
+
readonly threadScope: string;
|
|
318
|
+
/** Who answers for the subject: the only person who may confirm or reject the request. */
|
|
319
|
+
readonly responsibleUserId: string;
|
|
320
|
+
/** Who the chain of work started with: the only person who may withdraw it or run it as themselves. */
|
|
321
|
+
readonly requestedByUserId: string;
|
|
322
|
+
readonly ownerUserId: string | null;
|
|
323
|
+
/** The moment the work was not to be claimed before (`EnqueueRequest.fireAt`); null for as soon as it runs. */
|
|
324
|
+
readonly fireAt: string | null;
|
|
325
|
+
/** Attempts its run may take; null for the agent's default. */
|
|
326
|
+
readonly maxAttempts: number | null;
|
|
327
|
+
readonly input: RunRequestInput;
|
|
328
|
+
readonly status: RunRequestStatus;
|
|
329
|
+
/** Who settled it (confirmed, rejected, withdrew or handed it on); null while pending, and when it expired. */
|
|
330
|
+
readonly settledById: string | null;
|
|
331
|
+
readonly settledAt: string | null;
|
|
332
|
+
/** Why it was rejected or handed on, when someone said. */
|
|
333
|
+
readonly note: string | null;
|
|
334
|
+
readonly expiresAt: string;
|
|
335
|
+
/** The run it went into: on confirming, or when the requester ran it as themselves. */
|
|
336
|
+
readonly runId: string | null;
|
|
337
|
+
/** The request that took over when the subject's responsible changed. */
|
|
338
|
+
readonly supersededById: string | null;
|
|
339
|
+
readonly createdAt: string;
|
|
340
|
+
readonly updatedAt: string;
|
|
341
|
+
}
|
|
342
|
+
/** A run request as people's lists show it: with the names of its agent and of the people in it. */
|
|
343
|
+
export interface RunRequestItem extends RunRequest {
|
|
344
|
+
/** Null when the agent was deleted. */
|
|
345
|
+
readonly agentName: string | null;
|
|
346
|
+
readonly responsibleName: string | null;
|
|
347
|
+
readonly requestedByName: string | null;
|
|
348
|
+
}
|
|
205
349
|
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../shared/runs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,SAAS,EACV,MAAM,0BAA0B,CAAC;AAElC,uGAAuG;AACvG,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,qHAAqH;IACrH,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACxC,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gGAAgG;IAChG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;OAGG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A+G;IAC/G,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,oGAAoG;AACpG,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC"}
|
package/dist/shared/runs.js
CHANGED
|
@@ -14,6 +14,8 @@ export const CONSULT_MAX_DEPTH = 2;
|
|
|
14
14
|
* signed in.
|
|
15
15
|
* - `noSharedRunner`: only personal runners could take it, and none belongs to the person who woke the agent.
|
|
16
16
|
* - `missingFeatures`: the runners that could take it lack what it needs (`missing`).
|
|
17
|
+
* - `secretsNotAllowed`: some of its variables are for team runners only (`variables` names them), and the runners
|
|
18
|
+
* that could take it are personal ones.
|
|
17
19
|
* - `sameWorkActive`: the agent is already working on the same subject and thread; this run follows.
|
|
18
20
|
* - `concurrencyFull`: the agent has as many runs held as it may have at once.
|
|
19
21
|
* - `runnersBusy`: every runner that could take it has its slots full (the machine's slots).
|
|
@@ -30,6 +32,7 @@ export const RUN_WAIT_REASONS = [
|
|
|
30
32
|
'toolUnavailable',
|
|
31
33
|
'noSharedRunner',
|
|
32
34
|
'missingFeatures',
|
|
35
|
+
'secretsNotAllowed',
|
|
33
36
|
'sameWorkActive',
|
|
34
37
|
'concurrencyFull',
|
|
35
38
|
'runnersBusy',
|
|
@@ -38,4 +41,19 @@ export const RUN_WAIT_REASONS = [
|
|
|
38
41
|
'next',
|
|
39
42
|
];
|
|
40
43
|
export const RUN_ACTIVITY_TEXT_MAX = 200;
|
|
44
|
+
/**
|
|
45
|
+
* What a run request can be: `pending` until the responsible confirms it (`confirmed`, queued as them) or rejects it
|
|
46
|
+
* (`rejected`), the requester withdraws it (`withdrawn`, also when they run it as themselves), it is handed to a new
|
|
47
|
+
* responsible (`superseded`), or nobody settles it in time (`expired`). Only a pending request changes.
|
|
48
|
+
*/
|
|
49
|
+
export const RUN_REQUEST_STATUSES = [
|
|
50
|
+
'pending',
|
|
51
|
+
'confirmed',
|
|
52
|
+
'rejected',
|
|
53
|
+
'withdrawn',
|
|
54
|
+
'expired',
|
|
55
|
+
'superseded',
|
|
56
|
+
];
|
|
57
|
+
/** How work someone asks of an agent is run (`EnqueueRequest.execution`). */
|
|
58
|
+
export const RUN_EXECUTIONS = ['auto', 'mine'];
|
|
41
59
|
//# sourceMappingURL=runs.js.map
|
package/dist/shared/runs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../shared/runs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../shared/runs.ts"],"names":[],"mappings":"AAgBA,uGAAuG;AACvG,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAwKnC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,eAAe;IACf,SAAS;IACT,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,eAAe;IACf,MAAM;CACE,CAAC;AAsDX,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAgDzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;IACX,SAAS;IACT,YAAY;CACJ,CAAC;AAIX,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
* Variables are set on an agent, on a working directory (`workdir`), or on a scope the application registers (the
|
|
7
7
|
* group a run's subject belongs to, say), and a run gets them merged: the subject's scopes < its working directories <
|
|
8
8
|
* the agent, a later scope replacing an earlier one's value.
|
|
9
|
+
*
|
|
10
|
+
* A run's variables go to whichever runner takes it, including a personal runner of whoever may use the agent: sharing
|
|
11
|
+
* an agent shares the tokens it works with. A variable marked `teamRunnersOnly` keeps a run that gets it off personal
|
|
12
|
+
* runners: only a team runner takes such a run.
|
|
13
|
+
*
|
|
14
|
+
* A variable taken from the runner (`fromRunner`) is a name only: the runner that takes the run provides its value from
|
|
15
|
+
* its own configuration, and the value never reaches the application. It merges with the others by name, a later
|
|
16
|
+
* scope's entry replacing an earlier one's whichever kind each is.
|
|
9
17
|
*/
|
|
10
18
|
/** The scopes this plugin knows; the application registers the others (`GET agents/vocabulary` lists them). */
|
|
11
19
|
export declare const CORE_VARIABLE_SCOPES: readonly ["agent", "workdir"];
|
|
@@ -13,10 +21,24 @@ export declare const CORE_VARIABLE_SCOPES: readonly ["agent", "workdir"];
|
|
|
13
21
|
export type VariableScope = string;
|
|
14
22
|
export interface Variable {
|
|
15
23
|
readonly name: string;
|
|
24
|
+
/** Only team runners receive it: a run that gets it waits for one (`secretsNotAllowed`); absent means false. */
|
|
25
|
+
readonly teamRunnersOnly?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Taken from the runner: the variable has no value here, and the runner that takes the run provides it from its own
|
|
28
|
+
* configuration (`nocobase-runner env set NAME`, or `--pass-env NAME`); a runner that does not fails the run before
|
|
29
|
+
* the agent starts. Absent means false.
|
|
30
|
+
*/
|
|
31
|
+
readonly fromRunner?: boolean;
|
|
16
32
|
readonly updatedAt: string;
|
|
17
33
|
readonly updatedById: string | null;
|
|
18
34
|
readonly updatedByName: string | null;
|
|
19
35
|
}
|
|
36
|
+
/** A variable named by where it is kept, such as one that asks for a team runner. */
|
|
37
|
+
export interface VariableRef {
|
|
38
|
+
readonly scope: VariableScope;
|
|
39
|
+
readonly scopeId: string;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
}
|
|
20
42
|
export interface VariableValue {
|
|
21
43
|
readonly name: string;
|
|
22
44
|
readonly value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../shared/variables.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../shared/variables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,+GAA+G;AAC/G,eAAO,MAAM,oBAAoB,+BAAgC,CAAC;AAElE,oEAAoE;AACpE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gHAAgH;IAChH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAA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AAM,GAAG,OAAO,CAMtE;AAED,MAAM,MAAM,mBAAmB,GAC7B,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AAEpD,qEAAqE;AACrE,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,SAAS,MAAM,EAAO,EAChC,GAAG,CAAC,EAAE,MAAM,GACX,mBAAmB,GAAG,IAAI,CAM5B"}
|
package/dist/shared/variables.js
CHANGED
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
* Variables are set on an agent, on a working directory (`workdir`), or on a scope the application registers (the
|
|
7
7
|
* group a run's subject belongs to, say), and a run gets them merged: the subject's scopes < its working directories <
|
|
8
8
|
* the agent, a later scope replacing an earlier one's value.
|
|
9
|
+
*
|
|
10
|
+
* A run's variables go to whichever runner takes it, including a personal runner of whoever may use the agent: sharing
|
|
11
|
+
* an agent shares the tokens it works with. A variable marked `teamRunnersOnly` keeps a run that gets it off personal
|
|
12
|
+
* runners: only a team runner takes such a run.
|
|
13
|
+
*
|
|
14
|
+
* A variable taken from the runner (`fromRunner`) is a name only: the runner that takes the run provides its value from
|
|
15
|
+
* its own configuration, and the value never reaches the application. It merges with the others by name, a later
|
|
16
|
+
* scope's entry replacing an earlier one's whichever kind each is.
|
|
9
17
|
*/
|
|
10
18
|
/** The scopes this plugin knows; the application registers the others (`GET agents/vocabulary` lists them). */
|
|
11
19
|
export const CORE_VARIABLE_SCOPES = ['agent', 'workdir'];
|
|
@@ -28,7 +36,7 @@ export function cliEnvPrefix(cli) {
|
|
|
28
36
|
*/
|
|
29
37
|
export function isReservedVariable(name, cli) {
|
|
30
38
|
return (['PATH', 'HOME', 'TMPDIR', 'SHELL', 'USER'].includes(name) ||
|
|
31
|
-
/^(AGENT_RUN_|GIT_)/u.test(name) ||
|
|
39
|
+
/^(NOCOBASE_RUNNER_|AGENT_RUN_|GIT_)/u.test(name) ||
|
|
32
40
|
(cli !== undefined && name.startsWith(cliEnvPrefix(cli))));
|
|
33
41
|
}
|
|
34
42
|
/** Why `name` cannot be a new variable among `existing`, or null. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.js","sourceRoot":"","sources":["../../shared/variables.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"variables.js","sourceRoot":"","sources":["../../shared/variables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,+GAA+G;AAC/G,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAgClE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,SAAS;CACD,CAAC;AAiBX,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAW,2BAA2B,CAAC;AAEzE,4CAA4C;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAW,CAAC,GAAG,IAAI,CAAC;AAEzD,yHAAyH;AACzH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,GAAY;IAC3D,OAAO,CACL,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC1D,sCAAsC,CAAC,IAAI,CAAC,IAAI,CAAC;QACjD,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAC1D,CAAC;AACJ,CAAC;AAKD,qEAAqE;AACrE,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,WAA8B,EAAE,EAChC,GAAY;IAEZ,IAAI,CAAC,IAAI;QAAE,OAAO,UAAU,CAAC;IAC7B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACxD,IAAI,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IACrD,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,WAAW,CAAC;IAChD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/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": {
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
"sqlite-vec": "^0.1.9",
|
|
144
144
|
"yaml": "^2.9.0",
|
|
145
145
|
"zod": "^4.6.5",
|
|
146
|
-
"@nocobase/agent-protocol": "^0.1.0-beta.
|
|
147
|
-
"@nocobase/app-cli-client": "^0.1.0-beta.
|
|
146
|
+
"@nocobase/agent-protocol": "^0.1.0-beta.2",
|
|
147
|
+
"@nocobase/app-cli-client": "^0.1.0-beta.1",
|
|
148
148
|
"@nocobase/cli-envelope": "^0.1.0-beta.0"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
@@ -160,16 +160,16 @@
|
|
|
160
160
|
"react-router": "^7.0.2",
|
|
161
161
|
"recharts": "^3.8.0",
|
|
162
162
|
"remark-gfm": "^4.0.1",
|
|
163
|
-
"@nocobase/app-cli": "^1.0.0-beta.
|
|
163
|
+
"@nocobase/app-cli": "^1.0.0-beta.16",
|
|
164
164
|
"@nocobase/app-client": "^2.0.0-beta.2",
|
|
165
165
|
"@nocobase/app-plugin-authentication": "^2.0.0-beta.2",
|
|
166
166
|
"@nocobase/app-plugin-authorization": "^1.0.0-beta.25",
|
|
167
|
-
"@nocobase/app-plugin-file": "^1.0.0-beta.
|
|
168
|
-
"@nocobase/app-server": "^2.0.0-beta.
|
|
167
|
+
"@nocobase/app-plugin-file": "^1.0.0-beta.21",
|
|
168
|
+
"@nocobase/app-server": "^2.0.0-beta.2",
|
|
169
169
|
"@nocobase/authorization": "^1.0.0-beta.12",
|
|
170
170
|
"@nocobase/db": "^1.0.0-beta.18",
|
|
171
171
|
"@nocobase/i18n": "^1.0.0-beta.5",
|
|
172
|
-
"@nocobase/markdown-mermaid": "^0.1.0-beta.
|
|
172
|
+
"@nocobase/markdown-mermaid": "^0.1.0-beta.1",
|
|
173
173
|
"@nocobase/service-provider": "^0.0.2-beta.1"
|
|
174
174
|
},
|
|
175
175
|
"devDependencies": {
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"@nocobase/app-testing": "0.1.0-beta.1",
|
|
189
189
|
"@nocobase/db-postgres": "0.1.0-beta.3",
|
|
190
190
|
"@nocobase/db-sqlite": "0.1.0-beta.4",
|
|
191
|
-
"@nocobase/dev-config": "0.1.0-beta.
|
|
191
|
+
"@nocobase/dev-config": "0.1.0-beta.20",
|
|
192
192
|
"@nocobase/jobs": "0.1.0-beta.2"
|
|
193
193
|
},
|
|
194
194
|
"scripts": {
|
|
@@ -25,6 +25,10 @@ Rules that are easy to miss:
|
|
|
25
25
|
|
|
26
26
|
- `context.assemble`, brief sections and mounts run inside the claim's transaction and read the database through the claim's connection only (on SQLite it is the only connection). Read anything else in the provider's optional `prepare(run)`, which runs before the transaction. A throw leaves the run queued; three failures fail it `setupFailed`.
|
|
27
27
|
- `runs.enqueue` takes an optional outer transaction; inside another plugin's transaction, publish the collected events after it commits.
|
|
28
|
+
- When someone answers for the subject, pass `responsibleUserId` and the source (`requestedByUserId`, or `causedByRunId` for what a run did). Work another person causes then answers `outcome: 'pending'`: a run request only the responsible confirms (`runs.requests`, `/api/agents/runRequests`), unless `execution: 'mine'` runs it as the asker, which is refused with `NO_RUNNER_AVAILABLE` when no online runner would take the asker's work (`eligibility.canClaim` with the agent's variables). Both people must have agent access; identical pending snapshots are reused without renewing expiry. For mutable responsibility, bind `subjects.register({ …, responsibleUserId: (conn, subjectId) => … })` to read the current responsible using the supplied transaction connection, so old owners cannot confirm or reject before reassignment. Call `runs.requests.reassign` with each responsibility change; without a resolver this is the only protection against stale confirmation. If there is no usable new responsible, reassignment expires and notifies instead of dropping the work, preserving `runAsMe`. Forward `runRequest.*` events and `run_request_expired` notices to the App's inbox, and handle `outcome` before using a possibly null `runId`.
|
|
29
|
+
- To tell a person before queuing whether a runner would take their work, call `eligibility.canClaim` (online now) or `mayQueue` (some registered runner could) with the subject's variable scopes; a variable marked `teamRunnersOnly` needs a team runner. Enqueue itself does not refuse work run as the responsible or as whoever woke the agent: such work waits with `secretsNotAllowed`.
|
|
30
|
+
- Forward `notice` / `notice.cleared` using the exported `AgentsNotice` interface. Dispatch by its `type`: runner notices go to the runner's owner, `run_secrets_not_allowed` to the run's actor and owner, and `run_request_expired` to the requester. Subjects are of kind `runner`, `run` or `runRequest`. A secrets notice names the run, the agent and the team-only variables in its parameters. Deduplicate by the notice key. Existing copied queue components must merge the `secretsNotAllowed` type and label from the Registry.
|
|
31
|
+
- A repository provider minting credentials in `prepare` implements idempotent `discard(run, prepared)` to revoke undelivered credentials. The plugin calls it outside the transaction on a skipped or rolled-back claim; the App implements the code host revocation API.
|
|
28
32
|
- A subject kind takes runner agents only unless its binding lists `online` in `agentTypes`; a run of another type is refused with `AGENT_TYPE_NOT_ALLOWED`.
|
|
29
33
|
- Name commands in a brief with `commandRef(dialect, cli, id, flag?)` rather than spelling them, so online and runner agents both get the right form.
|
|
30
34
|
- The App's CLI commands are its API routes: a route declares `...cliRoute({ command, action, ... })` in `describeRoute()`, and lists `runToken` in its `security` when a run may call it. The command manifest (`GET /api/cli/manifest`) offers each caller only the commands whose `action` the gate allows. There is no separate command registry.
|
|
@@ -12,7 +12,7 @@ A runner registers once per App with a one-time registration token (10 minutes):
|
|
|
12
12
|
|
|
13
13
|
Then on the runner's machine: `nocobase-runner register --server <App URL> --token <token>`, and `nocobase-runner start` or `nocobase-runner service install` (launchd on macOS, a systemd user unit on Linux). The install script does all of this in one line; see [Distribution](distribution.md).
|
|
14
14
|
|
|
15
|
-
A runner authenticates afterwards with its own key. Personal runners (`ownerOnly`) run only work their owner started
|
|
15
|
+
A runner authenticates afterwards with its own key. Personal runners (`ownerOnly`) run only work their owner started, and receive its variables like any runner, except those marked "Team runtimes only" (`teamRunnersOnly`): a run that gets one goes to a team runner. Their owner may share them with the team. `nocobase-runner unregister --server <url>` or "Revoke" on the Runtimes page ends a registration.
|
|
16
16
|
|
|
17
17
|
## How work reaches a runner
|
|
18
18
|
|
|
@@ -29,4 +29,12 @@ What to do: upgrade the runner to a version that speaks the App's protocol. An i
|
|
|
29
29
|
|
|
30
30
|
## Coding tools
|
|
31
31
|
|
|
32
|
+
`RunnerSummary.tools` also carries optional advisory capabilities: `models` (model `id` and optional `efforts`), `modelsDetectedAt` (the last discovery attempt), `modelsDetectionStatus` (`detected`, `unsupported`, `failed`) and a fixed brief `modelsDetectionError` on failure. Missing status means capability information is unknown; missing efforts means unknown support, while an empty model list is a successful discovery of no available models. Discovery runs in the background every five minutes, so completed results arrive on a later heartbeat. The App stores these per runner in its existing tools JSON, keeps the same runner visibility and machine-information filtering, and never writes the suggestions into Agent configuration or uses them to authorize or route work. Pi reports provider/model IDs, and its table does not enumerate per-model efforts; OpenCode variants and Codex reasoning efforts do. Claude reports unsupported. Rebuild and serve the updated runner tarballs to enable reporting; upgrading the plugin alone does not update an already installed runner.
|
|
33
|
+
|
|
34
|
+
Capability reports are advisory across independently released runners and Apps: registration and heartbeats discard invalid model entries, individual invalid efforts, malformed detection timestamps and unfamiliar status or error values while still validating the tool's basic fields. A report containing only invalid models does not retain detected status; a valid empty list still means no models were found. Counts and identifier lengths remain bounded, and versioned model ids such as `claude-sonnet-4@20250514` are supported.
|
|
35
|
+
|
|
36
|
+
Run lists and details expose `executions`, one claim snapshot per attempt, with the runner's name, owner and trust, the tool version, requested model, reported `actualModels` and reasoning effort. Retries retain these facts after releasing `runnerId` to null; use the latest snapshot for historical display and the current holder for authorization. Only the primary tool's usage identifies its actual model, and multiple models remain visible. Older runs have no snapshots: their known usage models can be displayed, but their historical machine names and attempt boundaries must not be invented. Applications must forward the fields through custom CLI projections and update their installed UI Library run components.
|
|
37
|
+
|
|
38
|
+
`effort` is requested; `actualEffort` is only a tool report, with `actualEffortSource`, `actualEffortAt` and per-attempt `effortReports`. Show unreported actual values explicitly, never infer from requests or token counts. Import `runForViewer`/`executionForViewer` from `@nocobase/app-plugin-agents/server/tokens` and apply them to custom user-facing run/workload/CLI outputs, using the runner machine rights; `machineHidden` means a generic runtime label, not a fallback to the hostname/id. A projects viewer may provide `seesExecutionMachine` from those same rights. See `docs/execution-history.md` for the report and projection contracts.
|
|
39
|
+
|
|
32
40
|
The runner finds each coding tool on its PATH and reports whether it is signed in. A tool not found, or not signed in, is offered no runs: sign in on the runner's machine as the runner's user (for example `claude` and its login), then wait for the next heartbeat. Which tools a runner is offered work for is chosen on the Runtimes page (`enabledTools`). A model the tool's account cannot use fails the run `modelUnavailable`.
|
|
@@ -15,7 +15,7 @@ Test what the App builds on the plugin, not the plugin itself. `@nocobase/app-pl
|
|
|
15
15
|
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
16
|
| Runners | `GET /api/agents/runners` (`runtime list`): `status` (`online`, `offline`, `revoked`, `upgrade_required`), `lastSeenAt`, `tools` (installed, version, signed in), `policy`, `updateVersion`, `requiredProtocol` |
|
|
17
17
|
| Agents that can take work | `GET /api/agents/available` (`agent list`): each agent and whether it can take work now |
|
|
18
|
-
| Why a run waits | The run's detail and `runs.workload()`: `RUN_WAIT_REASONS` (`noRunnerOnline`, `toolUnavailable`, `noSharedRunner`, `missingFeatures`, `concurrencyFull`, `runnersBusy`, …)
|
|
18
|
+
| Why a run waits | The run's detail and `runs.workload()`: `RUN_WAIT_REASONS` (`noRunnerOnline`, `toolUnavailable`, `noSharedRunner`, `missingFeatures`, `secretsNotAllowed`, `concurrencyFull`, `runnersBusy`, …) |
|
|
19
19
|
| A run's history | `GET /api/agents/runs/:runId` and its events (`run get`, `run events`); `failureReason` and `failureDetail` |
|
|
20
20
|
| Models | `GET /api/agents/models` (what agents may use), `POST /api/agents/checkModel` (`model check`), `GET /api/agents/defaultModels` |
|
|
21
21
|
| Tarballs served | `GET /api/agents/dist/manifest` signed in; `GET /api/agents/dist/products/<product>/targets/linux-x64?format=env` |
|