@nocobase/app-plugin-agents 1.0.0-beta.23 → 1.0.0-beta.25
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 +36 -0
- package/README.md +7 -3
- package/dist/client/api/client.d.ts +1 -19
- package/dist/client/api/client.d.ts.map +1 -1
- package/dist/client/api/client.js +0 -22
- package/dist/client/api/client.js.map +1 -1
- package/dist/client/api/keys.d.ts +0 -4
- package/dist/client/api/keys.d.ts.map +1 -1
- package/dist/client/api/keys.js +0 -3
- package/dist/client/api/keys.js.map +1 -1
- package/dist/client/chat/message-model.d.ts.map +1 -1
- package/dist/client/chat/message-model.js +27 -1
- package/dist/client/chat/message-model.js.map +1 -1
- package/dist/client/kit.d.ts +1 -1
- package/dist/client/kit.js +1 -1
- package/dist/client/locales/de-DE.d.ts.map +1 -1
- package/dist/client/locales/de-DE.js +4 -53
- package/dist/client/locales/de-DE.js.map +1 -1
- package/dist/client/locales/en-US.d.ts +1 -42
- package/dist/client/locales/en-US.d.ts.map +1 -1
- package/dist/client/locales/en-US.js +4 -45
- package/dist/client/locales/en-US.js.map +1 -1
- package/dist/client/locales/es-ES.d.ts.map +1 -1
- package/dist/client/locales/es-ES.js +4 -56
- package/dist/client/locales/es-ES.js.map +1 -1
- package/dist/client/locales/fr-FR.d.ts.map +1 -1
- package/dist/client/locales/fr-FR.js +4 -56
- package/dist/client/locales/fr-FR.js.map +1 -1
- package/dist/client/locales/id-ID.d.ts.map +1 -1
- package/dist/client/locales/id-ID.js +4 -53
- package/dist/client/locales/id-ID.js.map +1 -1
- package/dist/client/locales/ja-JP.d.ts.map +1 -1
- package/dist/client/locales/ja-JP.js +4 -53
- package/dist/client/locales/ja-JP.js.map +1 -1
- package/dist/client/locales/pt-BR.d.ts.map +1 -1
- package/dist/client/locales/pt-BR.js +4 -56
- package/dist/client/locales/pt-BR.js.map +1 -1
- package/dist/client/locales/runtimes.en-US.d.ts +0 -8
- package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
- package/dist/client/locales/runtimes.en-US.js +0 -8
- 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 +0 -8
- package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
- package/dist/client/locales/vi-VN.d.ts.map +1 -1
- package/dist/client/locales/vi-VN.js +4 -53
- package/dist/client/locales/vi-VN.js.map +1 -1
- package/dist/client/locales/zh-CN.d.ts.map +1 -1
- package/dist/client/locales/zh-CN.js +4 -45
- package/dist/client/locales/zh-CN.js.map +1 -1
- package/dist/client/locales/zh-TW.d.ts.map +1 -1
- package/dist/client/locales/zh-TW.js +4 -53
- package/dist/client/locales/zh-TW.js.map +1 -1
- package/dist/client/pages/agents/agent-dialog.d.ts +1 -2
- package/dist/client/pages/agents/agent-dialog.d.ts.map +1 -1
- package/dist/client/pages/agents/agent-dialog.js +9 -25
- package/dist/client/pages/agents/agent-dialog.js.map +1 -1
- package/dist/client/pages/agents/agent-state.d.ts +4 -4
- package/dist/client/pages/agents/agent-state.d.ts.map +1 -1
- package/dist/client/pages/agents/agent-state.js +4 -8
- package/dist/client/pages/agents/agent-state.js.map +1 -1
- package/dist/client/pages/agents/available-models-drawer.js +2 -2
- package/dist/client/pages/agents/available-models-drawer.js.map +1 -1
- package/dist/client/pages/agents/index.js +1 -1
- package/dist/client/pages/agents/runner-agents.d.ts.map +1 -1
- package/dist/client/pages/agents/runner-agents.js +6 -15
- package/dist/client/pages/agents/runner-agents.js.map +1 -1
- package/dist/client/pages/runtimes/runner-cells.d.ts +2 -4
- package/dist/client/pages/runtimes/runner-cells.d.ts.map +1 -1
- package/dist/client/pages/runtimes/runner-cells.js +7 -34
- package/dist/client/pages/runtimes/runner-cells.js.map +1 -1
- package/dist/client/pages/runtimes/runner-sheet.js +1 -1
- package/dist/client/pages/runtimes/runner-sheet.js.map +1 -1
- package/dist/database/migrations/.manifest.json +4 -0
- package/dist/database/migrations/202610310001_ag_retire_pending_runner_agents.d.ts +12 -0
- package/dist/database/migrations/202610310001_ag_retire_pending_runner_agents.d.ts.map +1 -0
- package/dist/database/migrations/202610310001_ag_retire_pending_runner_agents.js +174 -0
- package/dist/database/migrations/202610310001_ag_retire_pending_runner_agents.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/server/composition.d.ts +3 -3
- package/dist/server/composition.d.ts.map +1 -1
- package/dist/server/composition.js +2 -1
- package/dist/server/composition.js.map +1 -1
- package/dist/server/core/agents/agent.history.d.ts +0 -2
- package/dist/server/core/agents/agent.history.d.ts.map +1 -1
- package/dist/server/core/agents/agent.history.js +0 -4
- package/dist/server/core/agents/agent.history.js.map +1 -1
- package/dist/server/core/agents/agent.service.d.ts +3 -30
- package/dist/server/core/agents/agent.service.d.ts.map +1 -1
- package/dist/server/core/agents/agent.service.js +9 -124
- package/dist/server/core/agents/agent.service.js.map +1 -1
- package/dist/server/core/agents/agent.store.d.ts +0 -2
- package/dist/server/core/agents/agent.store.d.ts.map +1 -1
- package/dist/server/core/agents/agent.store.js +1 -5
- package/dist/server/core/agents/agent.store.js.map +1 -1
- package/dist/server/core/agents/agent.views.d.ts.map +1 -1
- package/dist/server/core/agents/agent.views.js +0 -14
- package/dist/server/core/agents/agent.views.js.map +1 -1
- package/dist/server/core/agents/available-models.d.ts.map +1 -1
- package/dist/server/core/agents/available-models.js +6 -2
- package/dist/server/core/agents/available-models.js.map +1 -1
- package/dist/server/core/conversations/conversation.service.d.ts.map +1 -1
- package/dist/server/core/conversations/conversation.service.js +10 -0
- package/dist/server/core/conversations/conversation.service.js.map +1 -1
- package/dist/server/core/runs/claim.d.ts.map +1 -1
- package/dist/server/core/runs/claim.js +4 -0
- package/dist/server/core/runs/claim.js.map +1 -1
- package/dist/server/core/runs/lifecycle.d.ts +2 -0
- package/dist/server/core/runs/lifecycle.d.ts.map +1 -1
- package/dist/server/core/runs/lifecycle.js +135 -89
- package/dist/server/core/runs/lifecycle.js.map +1 -1
- package/dist/server/core/runs/output-preview.d.ts +7 -0
- package/dist/server/core/runs/output-preview.d.ts.map +1 -0
- package/dist/server/core/runs/output-preview.js +95 -0
- package/dist/server/core/runs/output-preview.js.map +1 -0
- package/dist/server/online/agent/configuration.d.ts +1 -0
- package/dist/server/online/agent/configuration.d.ts.map +1 -1
- package/dist/server/online/agent/configuration.js +86 -46
- package/dist/server/online/agent/configuration.js.map +1 -1
- package/dist/server/online/agent/runner/backend.d.ts +5 -0
- package/dist/server/online/agent/runner/backend.d.ts.map +1 -1
- package/dist/server/online/agent/runner/backend.js +207 -14
- package/dist/server/online/agent/runner/backend.js.map +1 -1
- package/dist/server/online/agent/runner/projection.d.ts +6 -1
- package/dist/server/online/agent/runner/projection.d.ts.map +1 -1
- package/dist/server/online/agent/runner/projection.js +114 -6
- package/dist/server/online/agent/runner/projection.js.map +1 -1
- package/dist/server/online/agent/runner/types.d.ts +7 -0
- package/dist/server/online/agent/runner/types.d.ts.map +1 -1
- package/dist/server/online/agent/service.d.ts.map +1 -1
- package/dist/server/online/agent/service.js +0 -2
- package/dist/server/online/agent/service.js.map +1 -1
- package/dist/server/online/gateway.d.ts +6 -2
- package/dist/server/online/gateway.d.ts.map +1 -1
- package/dist/server/online/gateway.js +1 -1
- package/dist/server/online/gateway.js.map +1 -1
- package/dist/server/online/providers.d.ts.map +1 -1
- package/dist/server/online/providers.js +26 -16
- package/dist/server/online/providers.js.map +1 -1
- package/dist/server/online/services.d.ts.map +1 -1
- package/dist/server/online/services.js +10 -4
- package/dist/server/online/services.js.map +1 -1
- package/dist/server/routes/admin.d.ts.map +1 -1
- package/dist/server/routes/admin.js +1 -103
- package/dist/server/routes/admin.js.map +1 -1
- package/dist/server/routes/runners/runs.js +1 -1
- package/dist/server/routes/runners/runs.js.map +1 -1
- package/dist/server/routes/schemas.d.ts +1 -13
- package/dist/server/routes/schemas.d.ts.map +1 -1
- package/dist/server/routes/schemas.js +1 -45
- package/dist/server/routes/schemas.js.map +1 -1
- package/dist/server/tokens.d.ts +1 -0
- package/dist/server/tokens.d.ts.map +1 -1
- package/dist/server/tokens.js +1 -0
- package/dist/server/tokens.js.map +1 -1
- package/dist/shared/agents.d.ts +8 -41
- package/dist/shared/agents.d.ts.map +1 -1
- package/dist/shared/agents.js +3 -4
- package/dist/shared/agents.js.map +1 -1
- package/dist/shared/conversations.d.ts +4 -1
- package/dist/shared/conversations.d.ts.map +1 -1
- package/dist/shared/conversations.js.map +1 -1
- package/dist/shared/model-catalog.d.ts +0 -2
- package/dist/shared/model-catalog.d.ts.map +1 -1
- package/dist/shared/model-catalog.js +0 -4
- package/dist/shared/model-catalog.js.map +1 -1
- package/dist/shared/ui-message.d.ts +2 -0
- package/dist/shared/ui-message.d.ts.map +1 -1
- package/dist/shared/ui-message.js +2 -0
- package/dist/shared/ui-message.js.map +1 -1
- package/docs/native-sandbox.md +3 -3
- package/docs/retire-pending-runner-agents.md +46 -0
- package/docs/runner-agents.md +8 -12
- package/package.json +5 -5
- package/skills/nocobase-app-plugin-agents/SKILL.md +1 -1
- package/skills/nocobase-app-plugin-agents/references/agents.md +8 -8
- package/skills/nocobase-app-plugin-agents/references/online-agent.md +12 -2
- package/dist/client/pages/agents/cleanup-drawer.d.ts +0 -7
- package/dist/client/pages/agents/cleanup-drawer.d.ts.map +0 -1
- package/dist/client/pages/agents/cleanup-drawer.js +0 -214
- package/dist/client/pages/agents/cleanup-drawer.js.map +0 -1
- package/dist/server/core/agents/discovery.d.ts +0 -12
- package/dist/server/core/agents/discovery.d.ts.map +0 -1
- package/dist/server/core/agents/discovery.js +0 -39
- package/dist/server/core/agents/discovery.js.map +0 -1
|
@@ -60,7 +60,9 @@ export function configureInvoices(
|
|
|
60
60
|
|
|
61
61
|
Replace `billing-models/chat` with an enabled chat model in the application's existing model services. Model credentials remain in that service. Factories resolve application dependencies once and must not capture a current user. Each tool invocation receives fresh `OnlineAgentToolContext`: user, current authorization, complete entry credentials, business data, signal and the authoritative runtime `sessionId`. Forward it to the original business service; retain its object, row and field checks. Never use model-provided user/session IDs as authority. Keep secrets out of tool output, prompts, variables and saved configuration. Every tool result and async yield must already be lossless JSON: convert Date to an ISO string and other business objects to intentional JSON values inside `execute`. Non-JSON returns are rejected, not implicitly serialized or retried. The SDK's `toModelOutput` derives model input from that raw JSON without replacing the saved result.
|
|
62
62
|
|
|
63
|
-
Layers resolve in order: global registrations, selected named scopes, then explicit options. Providers run
|
|
63
|
+
Layers resolve in order: global registrations, selected named scopes, then explicit options. Resolution has two phases: Providers run exactly once, see accumulated raw variables and the prompt snapshot entering resolution, and collect configuration before any prompt is rendered. Omitted fields keep their preceding value and arrays replace it, including empty arrays; context.variable is also whole-value replacement, not deep merging. All template object schemas validate only their declared fields against the final candidate, retaining defaults, transforms and object-level constraints without stripping other scopes' fields. Shared fields must normalize to identical JSON-safe values or configuration fails. A missing candidate allows schema defaults; null, arrays and scalars cannot stand in for an object schema. Each template then sees an independent copy of the same final normalized variables. Prompt assembly still follows layer order: context.systemPrompt first, then a replacing string or a function composing the accumulated context.systemPrompt. Logic requiring earlier rendered prompts belongs in a template, not a Provider.
|
|
64
|
+
|
|
65
|
+
The resolved serializable snapshot is saved. Loading an existing session restores it without reevaluating Providers or templates. Idle explicit overrides reevaluate only the named sources requested; running configuration is frozen. Globals are not replayed for variable-only updates, so changing a variable alone cannot regenerate a saved global prompt. Create a new session when a global variable-driven policy must change. HTTP business variables remain limited to fields explicitly declared in selected scopes' variableSchema; a global schema never expands that browser whitelist, and input is authorized before any template runs. selectedModel explicitly selects the existing model columns, while a model-list replacement selects its first entry. A prompt-only override retains the selected model.
|
|
64
66
|
|
|
65
67
|
## Native web search
|
|
66
68
|
|
|
@@ -135,7 +137,7 @@ Native public history and realtime streams include actual model-provided SDK rea
|
|
|
135
137
|
|
|
136
138
|
Native and Runner realtime receive use the standard SDK stream with optional shared Redis recovery. Background sessions have no browser receive transport and do not require Redis. Browser disconnect never cancels generation. Finish ends the HTTP response, possibly while waiting for approval; execution detail and saved history determine business state. Failed persistence keeps occupancy and supports explicit finalization without reexecution. Missing streams require history/status reconciliation, never automatic resend. A lost producer remains interrupted and is not automatically restarted. The public ChatProvider and installed Registry/Examples consumers use SDK Chat ownership and GET recovery. See [UI messages](../../../docs/ui-messages.md) and [client coordination](../../../docs/ui-message-clients.md) for configuration, costs and limits.
|
|
137
139
|
|
|
138
|
-
Permission-restricted configuration and custom permission/approval protocols remain unsupported.
|
|
140
|
+
Permission-restricted configuration and custom permission/approval protocols remain unsupported. New native sessions enable bash and skill by default; scopes may select Skills or explicitly replace the tool list; follow [Native Skills and application CLI](../../../docs/native-sandbox.md) for current support trees, VFS-only inputs, lazy `context.execution`, existing business authorization and approval/new-environment boundaries. SDK approval is native-only; Runner remote tool approval is refused. Verify with isolated model fixtures and authorized application services, never real business writes.
|
|
139
141
|
|
|
140
142
|
## Open UI context, custom tool cards and local form drafts
|
|
141
143
|
|
|
@@ -224,3 +226,11 @@ Deploy one execution process per logical application/database, fully stopping th
|
|
|
224
226
|
Normal native and Runner creation accepts showInChatList (default true); background creation always hides the record. List filtering happens in the database before pagination. A known hidden ID retains its ownership checks and remains readable. Notifications delivered through conversations.deliver join the caller's transaction, do not wake new native/Runner execution, and roll back with business changes; native realtime notices are saved as standard data parts.
|
|
225
227
|
|
|
226
228
|
HTTP creation/configuration cannot override tool lists, model lists or system prompts. Business variables must be declared and validated by selected scopes; selectedModel still selects an authorized catalog entry. Trusted server SDK configuration retains its policy capability. Legacy unbound conversations are read-only but their owner can still Stop their existing Run without a current model or online Agent.
|
|
229
|
+
|
|
230
|
+
## Runner conversation previews
|
|
231
|
+
|
|
232
|
+
Upgrade the server agents plugin before runners. Conversation claims automatically include `outputBlocks: true` when the runner advertises the capability; tasks never receive it, and there is no application configuration switch. All task adapters, storage, summaries and run-history components keep their previous behavior.
|
|
233
|
+
|
|
234
|
+
Update the application chat consumers to retain standard text/reasoning stream parts, `sourceRecords[].output`, stable part IDs, whitespace and part state. Render one text part as one Markdown document through `chatMessageSegments`. Previews are realtime-only; a completed block produces one canonical record, so prompt history retains the previous user turns. Completed negotiated reasoning summaries are restored from existing run events alongside the response's text records; one batched read covers the runs in a history page, with no new conversation writes or model-context changes. Interrupted previews are closed without storing partial text unless the tool supplies a completed partial snapshot. A mid-block refresh may wait for block completion; do not add recovery or replay services. Task/transcript Registry components need no change.
|
|
235
|
+
|
|
236
|
+
Validate conversation text and supplied reasoning summaries, split Markdown and whitespace, independent messages and child/tool boundaries, refresh and cancellation using native application authentication. Studio integration and real-model page verification are application work; source Registry components copied into an application still belong to that application.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type ReactElement } from 'react';
|
|
2
|
-
export interface CleanupDrawerProps {
|
|
3
|
-
readonly open: boolean;
|
|
4
|
-
readonly onClose: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function CleanupDrawer({ open, onClose, }: CleanupDrawerProps): ReactElement;
|
|
7
|
-
//# sourceMappingURL=cleanup-drawer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup-drawer.d.ts","sourceRoot":"","sources":["../../../../client/pages/agents/cleanup-drawer.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAoD7D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,GACR,EAAE,kBAAkB,GAAG,YAAY,CAyOnC"}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from '@nocobase/i18n/client';
|
|
3
|
-
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
4
|
-
import { useMemo, useState } from 'react';
|
|
5
|
-
import { Virtuoso } from 'react-virtuoso';
|
|
6
|
-
import { TOOL_LABELS } from '../../../shared/model-catalog.js';
|
|
7
|
-
import { agentsKeys } from '../../api/keys.js';
|
|
8
|
-
import { AgListSkeleton, AgLoadError } from '../../components/ag-states.js';
|
|
9
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogOverlay, AlertDialogTitle, } from '../../components/ui/alert-dialog.js';
|
|
10
|
-
import { Button } from '../../components/ui/button.js';
|
|
11
|
-
import { Checkbox } from '../../components/ui/checkbox.js';
|
|
12
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible.js';
|
|
13
|
-
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, } from '../../components/ui/sheet.js';
|
|
14
|
-
import { useAgentsApi } from '../../hooks/use-agents-api.js';
|
|
15
|
-
import { useFormatters } from '../../lib/format.js';
|
|
16
|
-
import { errorText, useNotify } from '../../hooks/use-notify.js';
|
|
17
|
-
const VIRTUALIZE_THRESHOLD = 30;
|
|
18
|
-
const PAGE_SIZE = 50;
|
|
19
|
-
/** How many ids one "select all in group" page fetch asks for; large enough that most groups need only one call. */
|
|
20
|
-
const SELECT_ALL_PAGE_SIZE = 500;
|
|
21
|
-
/** `POST /agents/cleanup` refuses more ids than this at once; a bigger selection is sent in several requests. */
|
|
22
|
-
const CLEANUP_BATCH_SIZE = 256;
|
|
23
|
-
function chunk(items, size) {
|
|
24
|
-
const chunks = [];
|
|
25
|
-
for (let index = 0; index < items.length; index += size)
|
|
26
|
-
chunks.push(items.slice(index, index + size));
|
|
27
|
-
return chunks;
|
|
28
|
-
}
|
|
29
|
-
export function CleanupDrawer({ open, onClose, }) {
|
|
30
|
-
const { t } = useTranslation();
|
|
31
|
-
const api = useAgentsApi();
|
|
32
|
-
const notify = useNotify();
|
|
33
|
-
const queryClient = useQueryClient();
|
|
34
|
-
const [selected, setSelected] = useState(() => new Map());
|
|
35
|
-
const [confirming, setConfirming] = useState(false);
|
|
36
|
-
const reset = () => {
|
|
37
|
-
setSelected(new Map());
|
|
38
|
-
setConfirming(false);
|
|
39
|
-
};
|
|
40
|
-
const groups = useQuery({
|
|
41
|
-
queryKey: agentsKeys.cleanupGroups(''),
|
|
42
|
-
queryFn: () => api.cleanupGroups(),
|
|
43
|
-
enabled: open,
|
|
44
|
-
});
|
|
45
|
-
const setRowSelected = (candidate, checked) => setSelected((current) => {
|
|
46
|
-
const next = new Map(current);
|
|
47
|
-
if (checked)
|
|
48
|
-
next.set(candidate.id, candidate);
|
|
49
|
-
else
|
|
50
|
-
next.delete(candidate.id);
|
|
51
|
-
return next;
|
|
52
|
-
});
|
|
53
|
-
const setGroupSelected = (group, checked) => setSelected((current) => {
|
|
54
|
-
const next = new Map(current);
|
|
55
|
-
for (const candidate of group)
|
|
56
|
-
if (checked)
|
|
57
|
-
next.set(candidate.id, candidate);
|
|
58
|
-
else
|
|
59
|
-
next.delete(candidate.id);
|
|
60
|
-
return next;
|
|
61
|
-
});
|
|
62
|
-
// Clears a whole group's selection, including ids a "select all" picked up from a page this group's own list
|
|
63
|
-
// never loaded: scans the authoritative selection map by `tool`, not the group's own (possibly partial) `loaded`.
|
|
64
|
-
const clearGroupSelection = (tool) => setSelected((current) => {
|
|
65
|
-
const next = new Map(current);
|
|
66
|
-
for (const [id, candidate] of current)
|
|
67
|
-
if ((candidate.tool ?? null) === tool)
|
|
68
|
-
next.delete(id);
|
|
69
|
-
return next;
|
|
70
|
-
});
|
|
71
|
-
const remove = useMutation({
|
|
72
|
-
mutationFn: async () => {
|
|
73
|
-
const ids = [...selected.keys()];
|
|
74
|
-
const batches = chunk(ids, CLEANUP_BATCH_SIZE);
|
|
75
|
-
// `allSettled`, not `all`: one batch's request failing (network, a 500) must not discard the ids another
|
|
76
|
-
// batch already removed. Each outcome is matched back to its own batch by index to know which ids to retry.
|
|
77
|
-
const outcomes = await Promise.allSettled(batches.map((batch) => api.cleanup(batch)));
|
|
78
|
-
const removed = [];
|
|
79
|
-
const skipped = [];
|
|
80
|
-
const failed = [];
|
|
81
|
-
let lastError;
|
|
82
|
-
outcomes.forEach((outcome, index) => {
|
|
83
|
-
if (outcome.status === 'fulfilled') {
|
|
84
|
-
removed.push(...outcome.value.removed);
|
|
85
|
-
skipped.push(...outcome.value.skipped);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
failed.push(...batches[index]);
|
|
89
|
-
lastError = outcome.reason;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
return { removed, skipped, failed, lastError };
|
|
93
|
-
},
|
|
94
|
-
onSuccess: ({ removed, skipped, failed, lastError }) => {
|
|
95
|
-
void queryClient.invalidateQueries({ queryKey: agentsKeys.agents });
|
|
96
|
-
void queryClient.invalidateQueries({
|
|
97
|
-
queryKey: agentsKeys.cleanupCandidatesAll,
|
|
98
|
-
});
|
|
99
|
-
if (failed.length === 0) {
|
|
100
|
-
setSelected(new Map());
|
|
101
|
-
setConfirming(false);
|
|
102
|
-
notify.success(t('agents.cleanup.done', {
|
|
103
|
-
removed: removed.length,
|
|
104
|
-
skipped: skipped.length,
|
|
105
|
-
}));
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
// Partial (or total) failure: keep only the ids whose batch failed selected, so the confirmation that stays
|
|
109
|
-
// open names exactly what is left to retry, and a removed or skipped id is never reported as untouched.
|
|
110
|
-
setSelected((current) => {
|
|
111
|
-
const next = new Map();
|
|
112
|
-
for (const id of failed) {
|
|
113
|
-
const candidate = current.get(id);
|
|
114
|
-
if (candidate)
|
|
115
|
-
next.set(id, candidate);
|
|
116
|
-
}
|
|
117
|
-
return next;
|
|
118
|
-
});
|
|
119
|
-
// `notify.error`'s own fallback logic would replace this count summary with a bare reason translation when
|
|
120
|
-
// `lastError` is a recognized API error; call it with no error so the summary (which already embeds the real
|
|
121
|
-
// reason) is always what shows.
|
|
122
|
-
notify.error(undefined, t('agents.cleanup.partialFailure', {
|
|
123
|
-
removed: removed.length,
|
|
124
|
-
skipped: skipped.length,
|
|
125
|
-
failed: failed.length,
|
|
126
|
-
reason: errorText(t, lastError, t('common.requestFailed')),
|
|
127
|
-
}));
|
|
128
|
-
},
|
|
129
|
-
onError: (error) => notify.error(error),
|
|
130
|
-
});
|
|
131
|
-
const tools = useMemo(() => [...new Set([...selected.values()].map((c) => c.tool))], [selected]);
|
|
132
|
-
const toolNames = tools
|
|
133
|
-
.map((tool) => (tool ? TOOL_LABELS[tool] : ''))
|
|
134
|
-
.filter(Boolean)
|
|
135
|
-
.join(', ');
|
|
136
|
-
return (_jsxs(Sheet, { open: open, onOpenChange: (next) => {
|
|
137
|
-
if (!next) {
|
|
138
|
-
reset();
|
|
139
|
-
onClose();
|
|
140
|
-
}
|
|
141
|
-
}, children: [_jsxs(SheetContent, { className: 'flex w-full flex-col gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-[780px]', "data-testid": 'cleanup-drawer', children: [_jsxs(SheetHeader, { className: 'shrink-0', children: [_jsx(SheetTitle, { children: t('agents.cleanup.title') }), _jsx(SheetDescription, { children: t('agents.cleanup.description') })] }), _jsx("div", { className: 'min-h-0 flex-1 space-y-2 overflow-y-auto px-4 py-3 sm:px-6', children: groups.isError && !groups.data ? (_jsx(AgLoadError, { title: t('agents.loadFailed'), error: groups.error, onRetry: () => void groups.refetch() })) : !groups.data ? (_jsx(AgListSkeleton, {})) : groups.data.data.length === 0 ? (_jsx("p", { className: 'text-sm text-muted-foreground', children: t('agents.cleanup.none') })) : (groups.data.data.map((group) => (_jsx(CleanupToolGroup, { group: group, selected: selected, onSelectRow: setRowSelected, onSelectGroup: setGroupSelected, onClearGroup: clearGroupSelection }, group.tool ?? '')))) }), _jsxs(SheetFooter, { "data-fixed-sheet-footer": true, className: 'shrink-0 flex-row items-center justify-between border-t', children: [_jsx("div", { className: 'text-sm text-muted-foreground', children: selected.size > 0
|
|
142
|
-
? t('agents.cleanup.selectedCount', { count: selected.size })
|
|
143
|
-
: null }), _jsxs("div", { className: 'flex gap-2', children: [_jsx(Button, { variant: 'outline', onClick: onClose, children: t('actions.close') }), _jsx(Button, { variant: 'destructive', disabled: selected.size === 0 || remove.isPending, "data-testid": 'cleanup-open-confirm', onClick: () => setConfirming(true), children: t('agents.cleanup.remove', { count: selected.size }) })] })] })] }), _jsxs(AlertDialog, { open: confirming, onOpenChange: setConfirming, children: [_jsx(AlertDialogPortal, { children: _jsx(AlertDialogOverlay, { forceRender: true, "data-testid": 'cleanup-confirm-overlay' }) }), _jsxs(AlertDialogContent, { "data-testid": 'cleanup-confirm', children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: t('agents.cleanup.confirmTitle', { count: selected.size }) }), _jsx(AlertDialogDescription, { children: t('agents.cleanup.confirmDescription', {
|
|
144
|
-
tools: toolNames,
|
|
145
|
-
}) })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: t('actions.back') }), _jsx(AlertDialogAction, { disabled: remove.isPending, onClick: () => remove.mutate(), "data-testid": 'cleanup-confirm-submit', children: t('agents.cleanup.confirmAction', {
|
|
146
|
-
count: selected.size,
|
|
147
|
-
}) })] })] })] })] }));
|
|
148
|
-
}
|
|
149
|
-
function CleanupToolGroup({ group, selected, onSelectRow, onSelectGroup, onClearGroup, }) {
|
|
150
|
-
const { t } = useTranslation();
|
|
151
|
-
const format = useFormatters();
|
|
152
|
-
const api = useAgentsApi();
|
|
153
|
-
const [open, setOpen] = useState(false);
|
|
154
|
-
const [selectingAll, setSelectingAll] = useState(false);
|
|
155
|
-
const label = group.tool ? TOOL_LABELS[group.tool] : '';
|
|
156
|
-
const rows = useInfiniteQuery({
|
|
157
|
-
queryKey: agentsKeys.cleanupRows(group.tool ?? '', ''),
|
|
158
|
-
queryFn: ({ pageParam }) => api.cleanupRows(group.tool, {
|
|
159
|
-
page: pageParam,
|
|
160
|
-
pageSize: PAGE_SIZE,
|
|
161
|
-
}),
|
|
162
|
-
initialPageParam: 1,
|
|
163
|
-
getNextPageParam: (last) => last.meta.page * last.meta.pageSize < last.meta.total
|
|
164
|
-
? last.meta.page + 1
|
|
165
|
-
: undefined,
|
|
166
|
-
enabled: open && group.tool !== null,
|
|
167
|
-
});
|
|
168
|
-
const loaded = useMemo(() => rows.data?.pages.flatMap((page) => page.data) ?? [], [rows.data]);
|
|
169
|
-
// The authoritative count from the server, not `loaded`: a "select all" can have picked up ids from pages this
|
|
170
|
-
// group's own list never fetched, so checking only `loaded` would under-report (or under-clear) the selection.
|
|
171
|
-
const selectedInGroup = useMemo(() => [...selected.values()].filter((c) => (c.tool ?? null) === group.tool)
|
|
172
|
-
.length, [selected, group.tool]);
|
|
173
|
-
const allSelected = group.count > 0 && selectedInGroup >= group.count;
|
|
174
|
-
const selectAllInGroup = async (checked) => {
|
|
175
|
-
if (!checked) {
|
|
176
|
-
onClearGroup(group.tool);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
if (!group.tool)
|
|
180
|
-
return;
|
|
181
|
-
setSelectingAll(true);
|
|
182
|
-
try {
|
|
183
|
-
const all = [];
|
|
184
|
-
let page = 1;
|
|
185
|
-
for (;;) {
|
|
186
|
-
const answer = await api.cleanupRows(group.tool, {
|
|
187
|
-
page,
|
|
188
|
-
pageSize: SELECT_ALL_PAGE_SIZE,
|
|
189
|
-
});
|
|
190
|
-
all.push(...answer.data);
|
|
191
|
-
if (answer.meta.page * answer.meta.pageSize >= answer.meta.total)
|
|
192
|
-
break;
|
|
193
|
-
page += 1;
|
|
194
|
-
}
|
|
195
|
-
onSelectGroup(all, true);
|
|
196
|
-
}
|
|
197
|
-
finally {
|
|
198
|
-
setSelectingAll(false);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
return (_jsx(Collapsible, { open: open, onOpenChange: setOpen, children: _jsxs("div", { className: 'rounded-lg border', children: [_jsx(CollapsibleTrigger, { className: 'flex w-full items-center justify-between gap-3 p-3 text-left', "data-testid": `cleanup-group-${group.tool ?? 'none'}`, children: _jsx("span", { className: 'font-medium', children: t('agents.cleanup.group', { count: group.count, tool: label }) }) }), _jsx(CollapsibleContent, { className: 'border-t px-3 pb-3', children: rows.isError && !rows.data ? (_jsx(AgLoadError, { title: t('agents.loadFailed'), error: rows.error, onRetry: () => void rows.refetch() })) : !rows.data ? (_jsx(AgListSkeleton, { rows: 2 })) : (_jsxs("div", { className: 'pt-2', children: [_jsx(Button, { type: 'button', variant: 'outline', size: 'sm', className: 'mb-2', disabled: selectingAll, onClick: () => void selectAllInGroup(!allSelected), "data-testid": `cleanup-group-select-all-${group.tool ?? 'none'}`, children: t(allSelected
|
|
202
|
-
? 'agents.cleanup.clearGroup'
|
|
203
|
-
: 'agents.cleanup.selectGroup', { tool: label }) }), loaded.length > VIRTUALIZE_THRESHOLD ? (_jsx(Virtuoso, { style: { height: 320 }, data: loaded, computeItemKey: (_, row) => row.id, endReached: () => {
|
|
204
|
-
if (rows.hasNextPage && !rows.isFetchingNextPage)
|
|
205
|
-
void rows.fetchNextPage();
|
|
206
|
-
}, itemContent: (_, candidate) => (_jsx("div", { className: 'py-1', children: _jsx(CandidateRow, { candidate: candidate, checked: selected.has(candidate.id), onSelect: onSelectRow, formatRelative: format.relative }) })) })) : (_jsx("div", { className: 'space-y-1', children: loaded.map((candidate) => (_jsx(CandidateRow, { candidate: candidate, checked: selected.has(candidate.id), onSelect: onSelectRow, formatRelative: format.relative }, candidate.id))) })), rows.hasNextPage ? (_jsx(Button, { type: 'button', variant: 'outline', size: 'sm', className: 'mt-2', disabled: rows.isFetchingNextPage, onClick: () => void rows.fetchNextPage(), children: t('agents.loadMore') })) : null] })) })] }) }));
|
|
207
|
-
}
|
|
208
|
-
function CandidateRow({ candidate, checked, onSelect, formatRelative, }) {
|
|
209
|
-
const { t } = useTranslation();
|
|
210
|
-
return (_jsxs("div", { "data-testid": `cleanup-candidate-${candidate.id}`, className: 'flex items-center gap-3 rounded-md p-2 hover:bg-muted/50', children: [_jsx(Checkbox, { "aria-label": t('agents.cleanup.select', { name: candidate.name }), checked: checked, onCheckedChange: (next) => onSelect(candidate, next === true) }), _jsxs("div", { className: 'min-w-0 flex-1', children: [_jsx("div", { className: 'font-medium', children: candidate.name }), _jsxs("div", { className: 'text-xs text-muted-foreground', children: [t('agents.cleanup.neverEnabled'), " \u00B7", ' ', t('agents.cleanup.createdAt', {
|
|
211
|
-
when: formatRelative(candidate.createdAt),
|
|
212
|
-
})] })] })] }));
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=cleanup-drawer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup-drawer.js","sourceRoot":"","sources":["../../../../client/pages/agents/cleanup-drawer.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB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AAE,CAAC,KAAK,IAAI,CAAC,aAAa,EAAE,YAEvC,CAAC,CAAC,iBAAiB,CAAC,GACd,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,GACkB,IACjB,GACM,CACf,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EACpB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,GAMf;IACC,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,OAAO,CACL,8BACe,qBAAqB,SAAS,CAAC,EAAE,EAAE,EAChD,SAAS,EAAC,0DAA0D,aAEpE,KAAC,QAAQ,kBACK,CAAC,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,EAChE,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,KAAK,IAAI,CAAC,GAC7D,EACF,eAAK,SAAS,EAAC,gBAAgB,aAC7B,cAAK,SAAS,EAAC,aAAa,YAAE,SAAS,CAAC,IAAI,GAAO,EACnD,eAAK,SAAS,EAAC,+BAA+B,aAC3C,CAAC,CAAC,6BAA6B,CAAC,aAAI,GAAG,EACvC,CAAC,CAAC,0BAA0B,EAAE;gCAC7B,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC;6BAC1C,CAAC,IACE,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DatabaseConnection, Repository } from '@nocobase/db';
|
|
2
|
-
export interface DiscoveryPreference {
|
|
3
|
-
readonly key: string;
|
|
4
|
-
readonly ignored: boolean;
|
|
5
|
-
readonly revision: number;
|
|
6
|
-
readonly updatedAt?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const preferences: (conn: DatabaseConnection) => Repository<DiscoveryPreference>;
|
|
9
|
-
export declare function discoveryPreferences(conn: DatabaseConnection): Promise<Map<string, DiscoveryPreference>>;
|
|
10
|
-
/** All state transitions in a model group lock the same persisted row. Reports never reset it. */
|
|
11
|
-
export declare function lockDiscovery(conn: DatabaseConnection, key: string, expectedRevision?: number): Promise<DiscoveryPreference>;
|
|
12
|
-
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../../server/core/agents/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,GACtB,MAAM,kBAAkB,KACvB,UAAU,CAAC,mBAAmB,CAC+B,CAAC;AAEjE,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAI3C;AAED,kGAAkG;AAClG,wBAAsB,aAAa,CACjC,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,MAAM,EACX,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAqC9B"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ProtocolError } from '../../kernel/errors.js';
|
|
2
|
-
export const preferences = (conn) => conn.repository('agDiscoveryPreferences');
|
|
3
|
-
export async function discoveryPreferences(conn) {
|
|
4
|
-
return new Map((await preferences(conn).findMany()).map((row) => [row.key, row]));
|
|
5
|
-
}
|
|
6
|
-
/** All state transitions in a model group lock the same persisted row. Reports never reset it. */
|
|
7
|
-
export async function lockDiscovery(conn, key, expectedRevision) {
|
|
8
|
-
let row = await preferences(conn).findOne({ filter: { key } });
|
|
9
|
-
if (!row) {
|
|
10
|
-
try {
|
|
11
|
-
await conn.transaction(async (savepoint) => {
|
|
12
|
-
await preferences(savepoint).createOne({
|
|
13
|
-
values: {
|
|
14
|
-
key,
|
|
15
|
-
ignored: false,
|
|
16
|
-
revision: 0,
|
|
17
|
-
updatedAt: new Date().toISOString(),
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
if (!(await preferences(conn).findOne({ filter: { key } })))
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
row = await preferences(conn).findOne({ filter: { key } });
|
|
27
|
-
}
|
|
28
|
-
if (!row ||
|
|
29
|
-
(expectedRevision !== undefined && row.revision !== expectedRevision))
|
|
30
|
-
throw new ProtocolError('REVISION_CONFLICT', 'The discovery group changed. Reload before trying again.');
|
|
31
|
-
const result = await preferences(conn).updateMany({
|
|
32
|
-
filter: { key, revision: row.revision },
|
|
33
|
-
values: { revision: row.revision + 1, updatedAt: new Date().toISOString() },
|
|
34
|
-
});
|
|
35
|
-
if (!result.updatedCount)
|
|
36
|
-
throw new ProtocolError('REVISION_CONFLICT', 'The discovery group changed. Reload before trying again.');
|
|
37
|
-
return { key: row.key, ignored: row.ignored, revision: row.revision + 1 };
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=discovery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../../server/core/agents/discovery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AASvD,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAAwB,EACS,EAAE,CACnC,IAAI,CAAC,UAAU,CAAsB,wBAAwB,CAAC,CAAC;AAEjE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAwB;I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